调整j-dict-select-tag组件:增加 :ignoreDisabled="true" 加上后停用的选项变为可选且提示“已停用”
调整JCheckbox组件:停用的选项 如果已被勾选 则可取消勾选 取消后变为不可选
This commit is contained in:
parent
4a2e668204
commit
fa204c8c01
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<a-checkbox-group v-bind="attrs" v-model:value="checkboxArray" :options="checkOptions" @change="handleChange">
|
||||
<template #label="{ label, value }">
|
||||
<span :class="[useDicColor && getDicColor(value) ? 'colorText' : '']" :style="{ backgroundColor: `${getDicColor(value)}` }">{{ label }}</span>
|
||||
<span :class="[useDicColor && getDicColor(value) ? 'colorText' : '']"
|
||||
:style="{ backgroundColor: `${getDicColor(value)}` }">{{ label }}</span>
|
||||
</template>
|
||||
</a-checkbox-group>
|
||||
</template>
|
||||
|
@ -54,6 +55,7 @@
|
|||
*/
|
||||
watchEffect(() => {
|
||||
props && initOptions();
|
||||
checkboxArray.value && loadDictOptions()
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -82,7 +84,7 @@
|
|||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
getDictItems(temp).then((res) => {
|
||||
if (res) {
|
||||
checkOptions.value = res.map((item) => ({value: item.value, label: item.text, color: item.color}));
|
||||
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status != 0 && !checkboxArray.value.includes(item.value), color: item.color }));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
console.error('getDictItems error: : ', res);
|
||||
|
@ -124,5 +126,5 @@
|
|||
color: #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
||||
</style>
|
||||
|
||||
// update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置</style>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<a-radio-group v-if="compType === CompTypeEnum.Radio" v-bind="attrs" v-model:value="state"
|
||||
@change="handleChangeRadio">
|
||||
<template v-for="item in dictOptions" :key="`${item.value}`">
|
||||
<a-radio :value="item.value">
|
||||
<a-radio :value="item.value" :disabled="item.disabled">
|
||||
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
||||
:style="{ backgroundColor: `${useDicColor && item.color}` }">
|
||||
{{ item.label }}
|
||||
|
@ -14,7 +14,7 @@
|
|||
<a-radio-group v-else-if="compType === CompTypeEnum.RadioButton" v-bind="attrs" v-model:value="state"
|
||||
buttonStyle="solid" @change="handleChangeRadio">
|
||||
<template v-for="item in dictOptions" :key="`${item.value}`">
|
||||
<a-radio-button :value="item.value">
|
||||
<a-radio-button :value="item.value" :disabled="item.disabled">
|
||||
{{ item.label }}
|
||||
</a-radio-button>
|
||||
</template>
|
||||
|
@ -31,10 +31,10 @@
|
|||
:getPopupContainer="getPopupContainer" :style="style" @change="handleChange">
|
||||
<a-select-option v-if="showChooseOption" :value="null">请选择…</a-select-option>
|
||||
<template v-for="item in dictOptions" :key="`${item.value}`">
|
||||
<a-select-option :value="item.value" :disabled="item.disabled">
|
||||
<a-select-option :value="item.value" :disabled="!ignoreDisabled && item.disabled">
|
||||
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
||||
:style="{ backgroundColor: `${useDicColor && item.color}` }" :title="item.label">
|
||||
{{ item.label }}
|
||||
{{ item.label }}<span style="color:rgb(255 39 39);">{{ ignoreDisabled && item.disabled ? '(已停用)' : '' }}</span>
|
||||
</span>
|
||||
</a-select-option>
|
||||
</template>
|
||||
|
@ -75,6 +75,7 @@ export default defineComponent({
|
|||
required: false,
|
||||
},
|
||||
style: propTypes.any,
|
||||
ignoreDisabled: propTypes.bool.def(false),
|
||||
},
|
||||
emits: ['options-change', 'change', 'update:value'],
|
||||
setup(props, { emit, refs }) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
||||
:dictCode="`config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择服务类别" allow-clear />
|
||||
:ignoreDisabled="true" placeholder="请选择服务类别" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
|
@ -18,7 +18,7 @@
|
|||
<template #label><span title="服务类型">服务类型</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
|
||||
:dictCode="`config_service_type,type_name,id,del_flag = 0 order by sort asc`" placeholder="请选择服务类型"
|
||||
allowClear />
|
||||
:ignoreDisabled="true" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
|
@ -26,7 +26,7 @@
|
|||
<a-form-item name="instructionTagId">
|
||||
<template #label><span title="指令标签">指令标签</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId" dictCode="instruction_tag"
|
||||
placeholder="请选择指令标签" allowClear />
|
||||
:ignoreDisabled="true" placeholder="请选择指令标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
|
@ -51,34 +51,34 @@
|
|||
<a-form-item name="izReimbursement">
|
||||
<template #label><span title="医保报销">医保报销</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izReimbursement" dictCode="med_ins_reimb"
|
||||
placeholder="请选择医保报销" allowClear />
|
||||
:ignoreDisabled="true" placeholder="请选择医保报销" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="izPreferential">
|
||||
<template #label><span title="机构优惠">机构优惠</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izPreferential"
|
||||
dictCode="institutional_discount" placeholder="请选择机构优惠" allowClear />
|
||||
dictCode="institutional_discount" :ignoreDisabled="true" placeholder="请选择机构优惠" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="chargingFrequency">
|
||||
<template #label><span title="收费频次">收费频次</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.chargingFrequency" dictCode="billing_frequency"
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.chargingFrequency" dictCode="billing_frequency" :ignoreDisabled="true"
|
||||
placeholder="请选择收费频次" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="cycleType">
|
||||
<template #label><span title="周期类型">周期类型</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.cycleType" dictCode="period_type"
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.cycleType" dictCode="period_type" :ignoreDisabled="true"
|
||||
placeholder="请选择周期类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled" :ignoreDisabled="true"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.categoryId"
|
||||
:dictCode="`config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择服务类别" allowClear />
|
||||
:ignoreDisabled="true" placeholder="请选择服务类别" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
|
@ -24,7 +24,7 @@
|
|||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button
|
||||
>批量操作
|
||||
<a-button>批量操作
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
|
|
Loading…
Reference in New Issue