diff --git a/src/service/api/dict.ts b/src/service/api/dict.ts index be896da..bd69224 100644 --- a/src/service/api/dict.ts +++ b/src/service/api/dict.ts @@ -60,3 +60,15 @@ export function getDictDataType(dictType: string) { method: 'get', }); } + +/** + * 获取字典选择框列表 + * @param data 字典数据对象 + * @returns object + */ +export function getDictOptionselect() { + return request({ + url: '/system/dict/type/optionselect', + method: 'get', + }); +} diff --git a/src/views/manage/dict/dictData/index.vue b/src/views/manage/dict/dictData/index.vue index 5cb7125..9f3c6cd 100644 --- a/src/views/manage/dict/dictData/index.vue +++ b/src/views/manage/dict/dictData/index.vue @@ -69,7 +69,7 @@ let modalState: any = reactive({ dictCode: undefined, dictLabel: '', dictSort: 0, - dictType: 'sys_oper_type', + dictType: '', dictValue: '', tagClass: '', tagType: '', @@ -93,6 +93,9 @@ let dict: { sysDictType: [], }); +//是否显示type框 +const drawerVisible = ref(true); + const scrollConfig = computed(() => { return { y: wrapperElHeight.value - 72, @@ -196,14 +199,14 @@ function handleUserSelectChange(selectedRowKeys: Key[], selectedRows: any[]) { function fnQueryReset() { if (dictId && dictId !== '0') { - searchParams.value = Object.assign(searchParams, { + Object.assign(searchParams, { dictLabel: '', status: undefined, pageNum: 1, pageSize: 10, }); } else { - searchParams.value = Object.assign(searchParams, { + Object.assign(searchParams, { dictType: '', dictLabel: '', status: undefined, @@ -394,10 +397,14 @@ onMounted(() => { // 初始字典数据 Promise.allSettled([ getDict('sys_normal_disable'), + getDictOptionselect(), ]).then((resArr: any) => { if (resArr[0].status === 'fulfilled') { dict.sysNormalDisable = resArr[0].value; } + if (resArr[1].status === 'fulfilled') { + dict.sysDictType = resArr[1].value.data; + } }); // 指定任务id数据列表 @@ -408,7 +415,9 @@ onMounted(() => { getData(); } }); + drawerVisible.value = true; } else { + drawerVisible.value = false; getData(); } }) @@ -590,8 +599,8 @@ onMounted(() => { {{ dict.sysDictType.find( - item => item.value === modalState.from.dictType - )?.label + item => item.dictType === modalState.from.dictType + )?.dictName }} @@ -674,7 +683,9 @@ onMounted(() => { + :placeholder="t('common.selectPlease')" :options="dict.sysDictType" + :field-names="{ label: 'dictName', value: 'dictType' }" + :disabled="drawerVisible"> diff --git a/src/views/manage/task/index.vue b/src/views/manage/task/index.vue index 16376c8..c0e8dcd 100644 --- a/src/views/manage/task/index.vue +++ b/src/views/manage/task/index.vue @@ -10,10 +10,12 @@ import { saveAs } from 'file-saver'; import Form from 'ant-design-vue/es/form/Form'; import Modal from 'ant-design-vue/es/modal/Modal'; import { useRouter, useRoute } from 'vue-router'; +import useDictStore from '@/store/modules/dict'; const router = useRouter(); const route = useRoute(); const routePath = route.path; +const { getDict } = useDictStore(); const { t } = useI18n(); @@ -57,6 +59,14 @@ let modalState: any = reactive({ ] }); +/**字典数据 */ +let dict: { + /**任务组名 */ + sysJobGroup: DictType[]; +} = reactive({ + sysJobGroup: [], +}); + /**对话框内表单属性和校验规则 */ const modalStateFrom = Form.useForm( modalState.from, @@ -100,7 +110,7 @@ const { columns, data, loading, getData, mobilePagination, searchParams, resetSe pageNum: 1, pageSize: 10, jobName: '', - jobGroup: '', + jobGroup: 'DEFAULT', status: '' }, rowKey: 'jobId', @@ -405,6 +415,19 @@ function fnExportList() { }); } + +onMounted(() => { + // 初始字典数据 + Promise.allSettled([ + getDict('sys_job_group'), + ]).then((resArr: any) => { + if (resArr[0].status === 'fulfilled') { + dict.sysJobGroup = resArr[0].value; + } + }); + +}) +