Browse Source

优化报错信息

master
zhouhaibin 5 months ago
parent
commit
9d7dc83573
  1. 33
      src/views/informationSub/countStatistics/countStatistics.data.ts
  2. 100
      src/views/informationSub/countStatistics/modifycountStatistics.vue

33
src/views/informationSub/countStatistics/countStatistics.data.ts

@ -1,37 +1,8 @@
import { FormSchema } from '@/components/Form'; import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table'; import { BasicColumn } from '@/components/Table';
import { useDictStore } from '@/store/modules/dict';
import { getDutyWorkplaceList, getadminDivisionList } from './countStatistics.api';
import { get } from 'sortablejs';
let dutyWorkplaceOption=[]
let adminDivisionOption=[]
async function getDutyWorkplaceOptions() {
let list = await getDutyWorkplaceList();
let uniqueList = [...new Set(list)];
let res= uniqueList.map(item => {
return {
label: item,
value: item
}
})
console.log("wwres",res)
return res
}
async function getadminDivisionOptions() {
let list = await getadminDivisionList();
let uniqueList = [...new Set(list)];
let res= uniqueList.map(item => {
return {
label: item,
value: item
}
})
console.log("wres",res)
return res
}
export const countStatisticsColumns: BasicColumn[] = [ export const countStatisticsColumns: BasicColumn[] = [
{ {
@ -82,7 +53,7 @@ export const countStatisticsFormSchema: FormSchema[] = [
required: true, required: true,
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options:await getDutyWorkplaceOptions() options:[]
}, },
colProps: { span:12}, colProps: { span:12},
}, },
@ -92,7 +63,7 @@ export const countStatisticsFormSchema: FormSchema[] = [
required: true, required: true,
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options:await getadminDivisionOptions() options:[]
}, },
colProps: { span:12 }, colProps: { span:12 },
}, },

100
src/views/informationSub/countStatistics/modifycountStatistics.vue

@ -19,12 +19,30 @@
modifyPeriodicallabCount, modifyPeriodicallabCount,
getperiodicallabById, getperiodicallabById,
addPeriodicallabCount, addPeriodicallabCount,
getDutyWorkplaceList,
getadminDivisionList,
} from './countStatistics.api'; } from './countStatistics.api';
import { useModalInner, BasicModal } from '@/components/Modal'; import { useModalInner, BasicModal } from '@/components/Modal';
const [registerModal, { closeModal }] = useModalInner(init); const [registerModal, { closeModal }] = useModalInner(init);
let id = ref(''); let id = ref('');
let emit = defineEmits(['exit']); let emit = defineEmits(['exit']);
async function init(dataTo) { async function init(dataTo) {
let dutyWorkplaceOption = await getDutyWorkplaceOptions();
let adminDivisionOption = await getadminDivisionOptions();
updateSchema({
field: 'dutyWorkplace',
componentProps: {
options: dutyWorkplaceOption,
},
});
updateSchema({
field: 'adminDivision',
componentProps: {
options: adminDivisionOption,
},
});
id.value = dataTo.id; id.value = dataTo.id;
if (dataTo.id) { if (dataTo.id) {
let res = await getperiodicallabById({ id: dataTo.id }); let res = await getperiodicallabById({ id: dataTo.id });
@ -33,30 +51,31 @@
} }
} }
onMounted(async () => {}); onMounted(async () => {});
const [registerchangeFieldForm, { getFieldsValue, validate, setFieldsValue }] = useForm({ const [registerchangeFieldForm, { getFieldsValue, validate, setFieldsValue, updateSchema }] =
// useForm({
schemas: countStatisticsFormSchema, //
// schemas: countStatisticsFormSchema,
// submitButtonOptions: { text: '', preIcon: '' }, //
// // submitButtonOptions: { text: '', preIcon: '' },
resetButtonOptions: { text: '取消' }, //
// showActionButtonGroup: false, resetButtonOptions: { text: '取消' },
// // showActionButtonGroup: false,
// autoSubmitOnEnter: true, //
// // // autoSubmitOnEnter: true,
// showResetButton: false, // //
// // showResetButton: false,
submitButtonOptions: { text: '提交' }, //
// 24 0-24 submitButtonOptions: { text: '提交' },
actionColOptions: { span: 14 }, // 24 0-24
// actionColOptions: { span: 14 },
// submitFunc: customSubmitFunc, //
// // submitFunc: customSubmitFunc,
resetFunc: customResetFunc, //
labelCol: { style: { width: '120px' } }, resetFunc: customResetFunc,
wrapperCol: { style: { width: 'auto' } }, labelCol: { style: { width: '120px' } },
// disabled:true wrapperCol: { style: { width: 'auto' } },
}); // disabled:true
});
async function handleSubmit() { async function handleSubmit() {
if (await validate()) { if (await validate()) {
if (id.value) { if (id.value) {
@ -68,12 +87,41 @@
} }
emit('exit'); emit('exit');
closeModal() closeModal();
} }
} }
async function customResetFunc() { async function customResetFunc() {
emit('exit'); emit('exit');
closeModal() closeModal();
}
async function getDutyWorkplaceOptions() {
let dutyWorkplaceOption = await getDutyWorkplaceList();
let uniqueList = [...new Set(dutyWorkplaceOption)];
let res = uniqueList.map((item) => {
return {
label: item,
value: item,
};
});
console.log('wwres', res);
return res;
}
async function getadminDivisionOptions() {
let adminDivisionOption = await getadminDivisionList();
let uniqueList = [...new Set(adminDivisionOption)];
let res = uniqueList.map((item) => {
return {
label: item,
value: item,
};
});
console.log('wres', res);
return res;
} }
</script> </script>
<style scoped></style> <style scoped></style>

Loading…
Cancel
Save