Browse Source

优化报错信息

master
zhouhaibin 3 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 { 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[] = [
{
@ -82,7 +53,7 @@ export const countStatisticsFormSchema: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options:await getDutyWorkplaceOptions()
options:[]
},
colProps: { span:12},
},
@ -92,7 +63,7 @@ export const countStatisticsFormSchema: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options:await getadminDivisionOptions()
options:[]
},
colProps: { span:12 },
},

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

@ -19,12 +19,30 @@
modifyPeriodicallabCount,
getperiodicallabById,
addPeriodicallabCount,
getDutyWorkplaceList,
getadminDivisionList,
} from './countStatistics.api';
import { useModalInner, BasicModal } from '@/components/Modal';
const [registerModal, { closeModal }] = useModalInner(init);
let id = ref('');
let emit = defineEmits(['exit']);
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;
if (dataTo.id) {
let res = await getperiodicallabById({ id: dataTo.id });
@ -33,30 +51,31 @@
}
}
onMounted(async () => {});
const [registerchangeFieldForm, { getFieldsValue, validate, setFieldsValue }] = useForm({
//
schemas: countStatisticsFormSchema,
//
// submitButtonOptions: { text: '', preIcon: '' },
//
resetButtonOptions: { text: '取消' },
// showActionButtonGroup: false,
//
// autoSubmitOnEnter: true,
// //
// showResetButton: false,
//
submitButtonOptions: { text: '提交' },
// 24 0-24
actionColOptions: { span: 14 },
//
// submitFunc: customSubmitFunc,
//
resetFunc: customResetFunc,
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
// disabled:true
});
const [registerchangeFieldForm, { getFieldsValue, validate, setFieldsValue, updateSchema }] =
useForm({
//
schemas: countStatisticsFormSchema,
//
// submitButtonOptions: { text: '', preIcon: '' },
//
resetButtonOptions: { text: '取消' },
// showActionButtonGroup: false,
//
// autoSubmitOnEnter: true,
// //
// showResetButton: false,
//
submitButtonOptions: { text: '提交' },
// 24 0-24
actionColOptions: { span: 14 },
//
// submitFunc: customSubmitFunc,
//
resetFunc: customResetFunc,
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
// disabled:true
});
async function handleSubmit() {
if (await validate()) {
if (id.value) {
@ -68,12 +87,41 @@
}
emit('exit');
closeModal()
closeModal();
}
}
async function customResetFunc() {
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>
<style scoped></style>

Loading…
Cancel
Save