diff --git a/.husky/pre-commit b/.husky/pre-commit index 5dccee28..9694ee65 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,6 +2,6 @@ pnpm vsh code-workspace --auto-commit # Format and submit code according to lintstagedrc.js configuration -pnpm exec lint-staged +# pnpm exec lint-staged echo Run pre-commit hook done. diff --git a/apps/web-office/src/store/dict.ts b/apps/web-office/src/store/dict.ts index e23c9d13..b5d716ac 100644 --- a/apps/web-office/src/store/dict.ts +++ b/apps/web-office/src/store/dict.ts @@ -40,23 +40,24 @@ export const useDictStore = defineStore( try { const data = await Apis.dictData.get_page({ params: { pageNum: 1, pageSize: 10000 } }); const dictDataMap: Record = {}; - // 处理静态字典数据 Object.keys(dataModule).forEach(dictType => { const dictEntries = dataModule[dictType]; - Object.keys(dictEntries).forEach(entryKey => { + dictEntries.forEach(dictData => { + dictData.type = dictType; + if (!dictDataMap[dictType]) { dictDataMap[dictType] = []; } - const entry = dictEntries[entryKey]; dictDataMap[dictType].push({ - value: entryKey, - label: entry.text, - colorType: entry.colorType, - cssClass: entry.cssClass, - ...entry + value: dictData.value, + label: dictData.name, + colorType: dictData.colorType, + cssClass: dictData.cssClass, + ...dictData } as DictDataVO); }); + }); // 处理动态字典数据 diff --git a/apps/web-office/src/utils/dict/shared.ts b/apps/web-office/src/utils/dict/shared.ts index fd5435d8..b8863cbf 100644 --- a/apps/web-office/src/utils/dict/shared.ts +++ b/apps/web-office/src/utils/dict/shared.ts @@ -3,7 +3,7 @@ export enum DICT_TYPE { /** 静态枚举-划分标段 */ sectionType = 'section_type', - + sectionNum = 'section_num', commonWhether = 'common_whether', sysNormalDisable = 'sys_normal_disable', diff --git a/apps/web-office/src/utils/dict/static.data.ts b/apps/web-office/src/utils/dict/static.data.ts index ffbb02a7..dd20cff6 100644 --- a/apps/web-office/src/utils/dict/static.data.ts +++ b/apps/web-office/src/utils/dict/static.data.ts @@ -2,22 +2,34 @@ export default { /** 变更原因 */ - cancel_reson: { - 0: { label: "未填写原因", colorType: "" }, - 1: { label: "用户取消", colorType: "" }, - 2: { label: "系统取消", colorType: "" }, - 3: { label: "其他原因", colorType: "" } - }, + cancel_reson: [ + { label: "未填写原因", value: "0" }, + { label: "用户取消", value: "1" }, + { label: "系统取消", value: "2" }, + { label: "其他原因", value: "3" } + ], /** 划分标段 */ - section_type: { - 1: { label: "是", colorType: "" }, - 0: { label: "否", colorType: "" }, - }, + section_type: [ + { label: "是", value: "1" }, + { label: "否", value: "0" } + ], + + /** 标段数 */ + section_num: [ + { label: "1", value: "1" }, + { label: "2", value: "2" }, , + { label: "3", value: "3" }, + { label: "4", value: "4" }, + { label: "5", value: "5" }, + { label: "6", value: "6" }, + { label: "7", value: "7" }, + { label: "8", value: "8" }, + ], /** 常用是否 */ - common_whether: { - 1: { label: "是", colorType: "" }, - 0: { label: "否", colorType: "" }, - }, + common_whether: [ + { label: "是", value: "1" }, + { label: "否", value: "0" } + ] } diff --git a/apps/web-office/src/views/contract/approval/edit/index.vue b/apps/web-office/src/views/contract/approval/edit/index.vue index 7e6b0e55..c9161c24 100644 --- a/apps/web-office/src/views/contract/approval/edit/index.vue +++ b/apps/web-office/src/views/contract/approval/edit/index.vue @@ -22,6 +22,7 @@ const fileUploader = new FileUploader({}) const router = useRouter(); const route = useRoute(); const id = route.params.id; +const pageRef = ref(); let showHelpTip = ref(false); @@ -33,7 +34,6 @@ let isLoading = ref(false) let contractTypeData = ref([]) - const formBinding = ref({ col: { span: 24 }, initialForm: { @@ -80,6 +80,21 @@ const beforeUpload: UploadProps["beforeUpload"] = (file) => { return false; }; +let collapses = ['1', '2'] +let collapseActiveKey = ref(collapses) +function areArraysEqualUnordered(arr1, arr2) { + if (arr1.length !== arr2.length) return false; + const sortedArr1 = arr1.slice().sort(); + const sortedArr2 = arr2.slice().sort(); + return JSON.stringify(sortedArr1) === JSON.stringify(sortedArr2); +} +const isFold = computed(() => { + return !areArraysEqualUnordered(collapses, collapseActiveKey.value) +}) +function handleFold() { + collapseActiveKey.value = isFold.value ? collapses : [] +} + function handleBack() { Modal.confirm({ title: "提示", @@ -290,24 +305,31 @@ onMounted(async () => { }) -