Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setvalue(option) {
if (this.disabled || (option && option.disabled)) return;
let value = null;
if (this.isSingle) {
if (!utils.isNull(this.value)) {
value = utils.toggleValue(this.checkList, this.value);
} else if (!utils.isNull(this.checkStatus)) {
value = this.isChecked ? this.falseValue : this.trueValue;
} else if (this.checked === true) {
value = this.checked;
} else {
value = this.isChecked ? this.falseValue : this.trueValue;
}
} else {
value = utils.copy(this.checkStatus);
let key = option[this.key];
value = utils.toggleValue(value, key);
if (this.limit && this.limit < value.length) {
Message.error(this.t('h.checkbox.limitSize', { limitSize: this.limit }));
return;
}
}
this.$emit('change', value);getOption(type, name) {
let key = `${type}`;
if (!utils.isNull(name)) {
key = `${type}.${name}`;
}
const value = utils.getKeyValue(config, `${key}`);
if (utils.isNull(value)) {
console.error(`[HeyUI] Config: There is no dictionary named ${key}`);
return null;
}
return value;
},
config(name, value) {hasValue() {
if (this.multiple) {
return this.codes.length > 0;
} else {
return !utils.isNull(this.codes) && this.objects;
}
},
singleValue() {parse(value, initShow = true) {
if (value != '' && !utils.isNull(value)) {
try {
this.nowView = manba(value, this.nowFormat);
this.nowDate = this.nowView.format('k');
if (initShow) {
if (this.type == 'week') {
this.showDate = this.t('h.date.show.weekInput', { year: this.nowView.year(), week: this.nowView.getWeekOfYear(this.startWeek) });
} else if (this.type == 'quarter') {
this.showDate = this.t('h.date.show.quarter', { year: this.nowView.year(), quarter: Math.ceil(this.nowView.month() / 3) });
} else {
this.showDate = this.nowView.format(this.nowFormat);
}
}
return;
} catch (err) {
}
}getValue(item) {
if (utils.isNull(item)) {
return null;
}
if (this.type == 'key') {
return this.categoryObj[item];
} else {
return utils.getValue(item, this.param);
}
},
getShow(data) {getValue(value) {
return utils.isNull(value) ? null : value;
},
setvalue(option, trigger) {getValue(item) {
if (utils.isNull(item)) {
return null;
}
if (this.type == 'key') {
return this.cascaderObj[item];
} else {
return utils.getValue(item, this.param);
}
},
dispose() {getValue(item) {
if (utils.isNull(item)) {
return null;
}
if (this.type == 'key') {
return this.categoryObj[item];
} else {
return utils.getValue(item, this.param);
}
},
dispose() {updateChecked() {
if (this.isSingle) {
if (!utils.isNull(this.value)) {
this.isChecked = this.checkList.indexOf(this.value) != -1;
} else if (this.checked === true) {
this.isChecked = this.checked;
} else if (this.checkStatus === this.trueValue) {
this.isChecked = true;
} else if (this.checkStatus === this.falseValue) {
this.isChecked = false;
} else {
this.isChecked = false;
}
}
},
setvalue(option) {