调整jeecg框架JDictSelectTag、JCheckbox组件禁用逻辑
This commit is contained in:
parent
bb1f8e4496
commit
d05744e01f
|
@ -84,7 +84,7 @@ export default defineComponent({
|
||||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||||
getDictItems(temp).then((res) => {
|
getDictItems(temp).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status != 0 && !checkboxArray.value.includes(item.value), color: item.color }));
|
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
|
||||||
//console.info('res', dictOptions.value);
|
//console.info('res', dictOptions.value);
|
||||||
} else {
|
} else {
|
||||||
console.error('getDictItems error: : ', res);
|
console.error('getDictItems error: : ', res);
|
||||||
|
|
|
@ -129,12 +129,11 @@ export default defineComponent({
|
||||||
const dictData = await initDictOptions(dictCode);
|
const dictData = await initDictOptions(dictCode);
|
||||||
dictOptions.value = dictData.reduce((prev, next) => {
|
dictOptions.value = dictData.reduce((prev, next) => {
|
||||||
if (next) {
|
if (next) {
|
||||||
console.log(next['status'] == 1)
|
|
||||||
const value = next['value'];
|
const value = next['value'];
|
||||||
prev.push({
|
prev.push({
|
||||||
label: next['text'] || next['label'],
|
label: next['text'] || next['label'],
|
||||||
value: stringToNumber ? +value : value,
|
value: stringToNumber ? +value : value,
|
||||||
disabled: next['status'] != 0,
|
disabled: next['status'] == 1,
|
||||||
color: next['color'],
|
color: next['color'],
|
||||||
...omit(next, ['text', 'value', 'color']),
|
...omit(next, ['text', 'value', 'color']),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue