2
0

修复BUG

This commit is contained in:
lai
2025-02-13 17:53:31 +08:00
parent 7f60eafc6d
commit fd0d541fdf
3 changed files with 57 additions and 8 deletions

View File

@@ -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',
});
}

View File

@@ -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(() => {
<a-form-item :label="t('page.manage.dict.dictData.dictType')" name="dictType">
{{
dict.sysDictType.find(
item => item.value === modalState.from.dictType
)?.label
item => item.dictType === modalState.from.dictType
)?.dictName
}}
</a-form-item>
</a-col>
@@ -674,7 +683,9 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('page.manage.dict.dictData.dictType')" name="dictType">
<a-select v-model:value="modalState.from.dictType" default-value="sys_oper_type"
:placeholder="t('common.selectPlease')" :options="dict.sysDictType" :disabled="true">
:placeholder="t('common.selectPlease')" :options="dict.sysDictType"
:field-names="{ label: 'dictName', value: 'dictType' }"
:disabled="drawerVisible">
</a-select>
</a-form-item>
</a-col>

View File

@@ -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;
}
});
})
</script>
<template>
@@ -422,7 +445,10 @@ function fnExportList() {
<ACol :lg="6" :md="12" :xs="24">
<AFormItem label="Group" name="jobGroup" class="m-0">
<AInput v-model:value="searchParams.jobGroup" />
<a-select v-model:value="searchParams.jobGroup" default-value="DEFAULT"
:field-names="{ label: 'value', value: 'value' }"
:placeholder="t('common.selectPlease')" :options="dict.sysJobGroup" >
</a-select>
</AFormItem>
</ACol>