Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function notice(param, timeout) {
if (utils.isString(param)) {
return Notice({ content: param, timeout });
} else if (utils.isObject(param)) {
if (this) {
if (this.$router) {
param.$router = this.$router;
}
if (this.$i18n) {
param.$i18n = this.$i18n;
}
if (this.$store) {
param.$store = this.$store;
}
}
return Notice(param);
}
console.error('Notice params are incorrect:', param);
dictMapping(value, key, connector) {
let dict = this.getDict(key);
if (!dict || utils.isNull(value)) return '';
if (utils.isString(value) && connector) {
value = value.split(connector);
}
if (!utils.isNull(value) && value !== '' && key) {
if (!utils.isArray(value)) {
value = [value];
}
}
if (value.length <= 0) {
return '';
}
const keyField = this.getOption('dict', 'keyName');
const titleField = this.getOption('dict', 'titleName');
if (utils.isArray(dict)) {
dict = utils.toObject(dict, keyField);
function noticeWithType(type, param, timeout) {
if (utils.isString(param)) {
return Notice({ content: param, timeout, type });
} else if (utils.isObject(param)) {
if (type) param.type = type;
return Notice(param);
}
console.error('Notice params are incorrect:', param);
}
href() {
let href = this.data.value.href;
if (href) {
if (utils.isString(href)) {
return href;
} else if (this.$router) {
return this.$router.resolve(href).href;
}
}
return null;
}
}
shortcuts() {
let shortcuts = [];
let shortcutsConfig = null;
if (this.option && this.option.shortcuts) {
shortcutsConfig = this.option.shortcuts;
}
if (utils.isArray(shortcutsConfig)) {
for (let s of shortcutsConfig) {
if (utils.isString(s)) {
shortcuts.push(config.getOption('datepicker.shortcuts')[s]);
} else if (utils.isObject(s)) {
shortcuts.push(s);
}
}
}
return shortcuts;
},
dateCls() {
const parse = function (value, param) {
if (utils.isString(value)) {
return { url: value, original: { [param.urlName]: value } };
} else if (utils.isObject(value)) {
return { url: value[param.urlName], name: value[param.fileName], thumbUrl: value.thumbUrl || param.thumbUrl.call(value), original: value };
}
};
const dispose = function (value, type, param) {
shortcuts() {
let shortcuts = [];
let shortcutsConfig = null;
if (this.option && this.option.shortcuts) {
shortcutsConfig = this.option.shortcuts;
}
if (utils.isArray(shortcutsConfig)) {
for (let s of shortcutsConfig) {
if (utils.isString(s)) {
shortcuts.push(options.shortcuts[s]);
} else if (utils.isObject(s)) {
shortcuts.push(s);
}
}
}
return shortcuts;
},
dateCls() {
updatePreview() {
if (this.computedDatas.length == 0 || this.isShow === false) {
return {};
}
let data = this.computedDatas[this.showIndex];
let previewFile = utils.isString(data) ? { url: data } : data;
if (previewFile.url == this.previewFile.url) {
this.$nextTick(() => {
if (this.$refs.img && this.$refs.img.complete) {
setTimeout(() => {
this.changeing = false;
}, 300);
}
});
}
this.previewFile = previewFile;
}
},
shortcuts() {
let shortcuts = [];
let shortcutsConfig = null;
if (this.option && this.option.shortcuts) {
shortcutsConfig = this.option.shortcuts;
}
if (utils.isArray(shortcutsConfig)) {
for (let s of shortcutsConfig) {
if (utils.isString(s)) {
shortcuts.push(config.getOption('datepicker.shortcuts')[s]);
} else if (utils.isObject(s)) {
shortcuts.push(s);
}
}
}
return shortcuts;
},
dateCls() {
isSingle() {
return utils.isString(this.datas);
},
computedList() {