From fe588ec25a7190143ff0114d81f4a005c2095134 Mon Sep 17 00:00:00 2001 From: z9130 <984661593@qq.com> Date: Sat, 14 Sep 2024 19:02:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E5=AD=97=E5=85=B8vi?= =?UTF-8?q?te=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 1 + apps/web-antd/src/preferences.ts | 21 ++ apps/web-contract/.env | 2 +- apps/web-contract/.env.production | 3 + apps/web-contract/auto-imports.d.ts | 134 +++++++++++ apps/web-contract/package.json | 3 +- apps/web-contract/src/api/request/config.ts | 2 +- apps/web-contract/src/layouts/basic.vue | 3 +- apps/web-contract/src/utils/dict/shared.ts | 85 +++---- .../src/utils/dict/static.data.js | 65 ++++++ .../src/utils/dict/static.data.ts | 48 ---- .../src/views/_core/authentication/login.vue | 2 +- .../src/views/contract/approval/edit/curd.tsx | 125 ++++++----- .../views/contract/approval/edit/index.vue | 6 +- .../src/views/contract/approval/list/crud.tsx | 6 +- .../contract/approval/signing-basis/crud.tsx | 6 +- .../signing-basis-edit-modal.vue | 2 +- .../src/views/contract/archive/list/crud.tsx | 6 +- .../src/views/contract/audit/list/crud.tsx | 6 +- .../business/edit/basic-info-curd.tsx | 8 +- .../src/views/contract/business/edit/curd.tsx | 155 ++++++------- .../views/contract/business/edit/index.vue | 8 +- .../src/views/contract/business/list/crud.tsx | 2 +- .../src/views/contract/company/edit/curd.tsx | 2 +- .../src/views/contract/company/edit/index.vue | 4 +- .../src/views/contract/company/list/crud.tsx | 2 +- .../contract-type-edit-modal.vue | 2 +- .../config/components/contract-type/crud.tsx | 2 +- .../project-name-manager-edit-modal.vue | 2 +- .../project-name-manager.vue | 2 +- .../components/template-manager/crud.tsx | 2 +- .../template-manager-edit-modal.vue | 2 +- .../declaration/edit/basic-info-curd.tsx | 24 +- .../views/contract/declaration/edit/curd.tsx | 209 +++++++++--------- .../views/contract/declaration/edit/index.vue | 10 +- .../views/contract/declaration/list/crud.tsx | 4 +- .../src/views/contract/perform/list/crud.tsx | 2 +- .../perform/temporary-archive/crud.tsx | 2 +- .../contract/sign-authorization/edit/curd.tsx | 2 +- .../sign-authorization/edit/index.vue | 8 +- .../contract/sign-authorization/list/crud.tsx | 6 +- .../src/views/contract/sign/list/crud.tsx | 6 +- .../src/views/system/dict/index.vue | 2 +- apps/web-contract/vite.config.mts | 139 ++++++++---- apps/web-office/.env | 2 +- apps/web-office/.env.development | 2 +- apps/web-office/.env.production | 3 + apps/web-office/package.json | 3 +- apps/web-office/src/api/request/config.ts | 2 +- apps/web-office/src/layouts/basic.vue | 3 +- apps/web-office/src/preferences.ts | 1 + .../src/views/_core/authentication/login.vue | 2 +- .../src/views/meeting/start/index.vue | 12 +- apps/web-office/vite.config.mts | 12 +- internal/common-utils/build.config.ts | 7 + internal/common-utils/package.json | 35 +++ internal/common-utils/src/index.ts | 0 internal/common-utils/src/store/auth.ts | 0 internal/common-utils/src/store/dict.ts | 0 internal/common-utils/tsconfig.json | 6 + package.json | 3 + packages/preferences/src/index.ts | 51 ++--- vben-admin.code-workspace | 4 + 63 files changed, 780 insertions(+), 501 deletions(-) create mode 100644 apps/web-contract/auto-imports.d.ts create mode 100644 apps/web-contract/src/utils/dict/static.data.js delete mode 100644 apps/web-contract/src/utils/dict/static.data.ts create mode 100644 internal/common-utils/build.config.ts create mode 100644 internal/common-utils/package.json create mode 100644 internal/common-utils/src/index.ts create mode 100644 internal/common-utils/src/store/auth.ts create mode 100644 internal/common-utils/src/store/dict.ts create mode 100644 internal/common-utils/tsconfig.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 7740e810..fa810205 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,6 +2,7 @@ "$schema": "https://json.schemastore.org/launchsettings.json", "version": "0.2.0", "configurations": [ + { "type": "chrome", "name": "vben admin playground dev", diff --git a/apps/web-antd/src/preferences.ts b/apps/web-antd/src/preferences.ts index 63edb3a9..7791ddd7 100644 --- a/apps/web-antd/src/preferences.ts +++ b/apps/web-antd/src/preferences.ts @@ -8,5 +8,26 @@ export const overridesPreferences = defineOverridesPreferences({ // overrides app: { name: import.meta.env.VITE_APP_TITLE, + accessMode: 'frontend', + authPageLayout: 'panel-center', + colorGrayMode: false, + colorWeakMode: false, + compact: false, + contentCompact: 'wide', + defaultAvatar: '', + dynamicTitle: true, + // 是否开启检查更新 + enableCheckUpdates: true, + // 检查更新的时间间隔,单位为分钟 + checkUpdatesInterval: 1, + // 开启布局设置按钮 + enablePreferences: false, + enableRefreshToken: false, + isMobile: false, + layout: 'sidebar-nav', + locale: 'zh-CN', + loginExpiredMode: 'page', + preferencesButtonPosition: 'auto', + watermark: false, }, }); diff --git a/apps/web-contract/.env b/apps/web-contract/.env index 015add3a..14bacc7a 100644 --- a/apps/web-contract/.env +++ b/apps/web-contract/.env @@ -2,4 +2,4 @@ VITE_APP_TITLE=热力合同系统 # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 -VITE_APP_NAMESPACE=erp-contract +VITE_APP_NAMESPACE=contract diff --git a/apps/web-contract/.env.production b/apps/web-contract/.env.production index 1c92699b..5993af93 100644 --- a/apps/web-contract/.env.production +++ b/apps/web-contract/.env.production @@ -14,3 +14,6 @@ VITE_ROUTER_HISTORY=history # 是否注入全局loading VITE_INJECT_APP_LOADING=true + +# 打包后是否生成dist.zip +VITE_ARCHIVER=true diff --git a/apps/web-contract/auto-imports.d.ts b/apps/web-contract/auto-imports.d.ts new file mode 100644 index 00000000..d7d30c37 --- /dev/null +++ b/apps/web-contract/auto-imports.d.ts @@ -0,0 +1,134 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +// biome-ignore lint: disable +export {} +declare global { + const EffectScope: typeof import('vue')['EffectScope'] + const computed: typeof import('vue')['computed'] + const createApp: typeof import('vue')['createApp'] + const customRef: typeof import('vue')['customRef'] + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] + const defineComponent: typeof import('vue')['defineComponent'] + const effectScope: typeof import('vue')['effectScope'] + const getCurrentInstance: typeof import('vue')['getCurrentInstance'] + const getCurrentScope: typeof import('vue')['getCurrentScope'] + const h: typeof import('vue')['h'] + const inject: typeof import('vue')['inject'] + const isProxy: typeof import('vue')['isProxy'] + const isReactive: typeof import('vue')['isReactive'] + const isReadonly: typeof import('vue')['isReadonly'] + const isRef: typeof import('vue')['isRef'] + const markRaw: typeof import('vue')['markRaw'] + const nextTick: typeof import('vue')['nextTick'] + const onActivated: typeof import('vue')['onActivated'] + const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] + const onDeactivated: typeof import('vue')['onDeactivated'] + const onErrorCaptured: typeof import('vue')['onErrorCaptured'] + const onMounted: typeof import('vue')['onMounted'] + const onRenderTracked: typeof import('vue')['onRenderTracked'] + const onRenderTriggered: typeof import('vue')['onRenderTriggered'] + const onScopeDispose: typeof import('vue')['onScopeDispose'] + const onServerPrefetch: typeof import('vue')['onServerPrefetch'] + const onUnmounted: typeof import('vue')['onUnmounted'] + const onUpdated: typeof import('vue')['onUpdated'] + const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] + const provide: typeof import('vue')['provide'] + const reactive: typeof import('vue')['reactive'] + const readonly: typeof import('vue')['readonly'] + const ref: typeof import('vue')['ref'] + const resolveComponent: typeof import('vue')['resolveComponent'] + const shallowReactive: typeof import('vue')['shallowReactive'] + const shallowReadonly: typeof import('vue')['shallowReadonly'] + const shallowRef: typeof import('vue')['shallowRef'] + const toRaw: typeof import('vue')['toRaw'] + const toRef: typeof import('vue')['toRef'] + const toRefs: typeof import('vue')['toRefs'] + const toValue: typeof import('vue')['toValue'] + const triggerRef: typeof import('vue')['triggerRef'] + const unref: typeof import('vue')['unref'] + const useAttrs: typeof import('vue')['useAttrs'] + const useCssModule: typeof import('vue')['useCssModule'] + const useCssVars: typeof import('vue')['useCssVars'] + const useId: typeof import('vue')['useId'] + const useModel: typeof import('vue')['useModel'] + const useSlots: typeof import('vue')['useSlots'] + const useTemplateRef: typeof import('vue')['useTemplateRef'] + const watch: typeof import('vue')['watch'] + const watchEffect: typeof import('vue')['watchEffect'] + const watchPostEffect: typeof import('vue')['watchPostEffect'] + const watchSyncEffect: typeof import('vue')['watchSyncEffect'] +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' + import('vue') +} +// for vue template auto import +import { UnwrapRef } from 'vue' +declare module 'vue' { + interface GlobalComponents {} + interface ComponentCustomProperties { + readonly EffectScope: UnwrapRef + readonly computed: UnwrapRef + readonly createApp: UnwrapRef + readonly customRef: UnwrapRef + readonly defineAsyncComponent: UnwrapRef + readonly defineComponent: UnwrapRef + readonly effectScope: UnwrapRef + readonly getCurrentInstance: UnwrapRef + readonly getCurrentScope: UnwrapRef + readonly h: UnwrapRef + readonly inject: UnwrapRef + readonly isProxy: UnwrapRef + readonly isReactive: UnwrapRef + readonly isReadonly: UnwrapRef + readonly isRef: UnwrapRef + readonly markRaw: UnwrapRef + readonly nextTick: UnwrapRef + readonly onActivated: UnwrapRef + readonly onBeforeMount: UnwrapRef + readonly onBeforeUnmount: UnwrapRef + readonly onBeforeUpdate: UnwrapRef + readonly onDeactivated: UnwrapRef + readonly onErrorCaptured: UnwrapRef + readonly onMounted: UnwrapRef + readonly onRenderTracked: UnwrapRef + readonly onRenderTriggered: UnwrapRef + readonly onScopeDispose: UnwrapRef + readonly onServerPrefetch: UnwrapRef + readonly onUnmounted: UnwrapRef + readonly onUpdated: UnwrapRef + readonly onWatcherCleanup: UnwrapRef + readonly provide: UnwrapRef + readonly reactive: UnwrapRef + readonly readonly: UnwrapRef + readonly ref: UnwrapRef + readonly resolveComponent: UnwrapRef + readonly shallowReactive: UnwrapRef + readonly shallowReadonly: UnwrapRef + readonly shallowRef: UnwrapRef + readonly toRaw: UnwrapRef + readonly toRef: UnwrapRef + readonly toRefs: UnwrapRef + readonly toValue: UnwrapRef + readonly triggerRef: UnwrapRef + readonly unref: UnwrapRef + readonly useAttrs: UnwrapRef + readonly useCssModule: UnwrapRef + readonly useCssVars: UnwrapRef + readonly useId: UnwrapRef + readonly useModel: UnwrapRef + readonly useSlots: UnwrapRef + readonly useTemplateRef: UnwrapRef + readonly watch: UnwrapRef + readonly watchEffect: UnwrapRef + readonly watchPostEffect: UnwrapRef + readonly watchSyncEffect: UnwrapRef + } +} diff --git a/apps/web-contract/package.json b/apps/web-contract/package.json index 11f94455..2f980751 100644 --- a/apps/web-contract/package.json +++ b/apps/web-contract/package.json @@ -17,10 +17,11 @@ "type": "module", "scripts": { "build": "pnpm vite build --mode production", + "build:dev": "pnpm vite build --mode development", "build:analyze": "pnpm vite build --mode analyze", "dev": "pnpm vite --mode development", "dev:prod": "pnpm vite --mode production", - "preview": "vite preview", + "preview": "vite preview --port 4174", "typecheck": "vue-tsc --noEmit --skipLibCheck" }, "imports": { diff --git a/apps/web-contract/src/api/request/config.ts b/apps/web-contract/src/api/request/config.ts index 6577a11e..50e70181 100644 --- a/apps/web-contract/src/api/request/config.ts +++ b/apps/web-contract/src/api/request/config.ts @@ -10,7 +10,7 @@ export const ACCESS_TOKEN_FIELD = 'Token' * 适用于同时连接多个后端功能开发,通过设置 proxy_type 值实现‘非重启更新’连接的后端 */ export function getBaseURL(): string { - if (import.meta.env.DEV) { + if (import.meta.env.MODE === 'development') { const proxyType = localStorage.getItem('@@@proxy_type') || ''; // return BASE_URL + "/zzz" return BASE_URL + proxyType diff --git a/apps/web-contract/src/layouts/basic.vue b/apps/web-contract/src/layouts/basic.vue index 566ed063..49f03dae 100644 --- a/apps/web-contract/src/layouts/basic.vue +++ b/apps/web-contract/src/layouts/basic.vue @@ -102,7 +102,7 @@ function handleViewAll() { router.push("/user/todo"); } -const isDev = import.meta.env.DEV; +const isDev = import.meta.env.MODE === 'development'; const value = ref(localStorage.getItem("@@@proxy_type") || ""); // /zp function handleMenuClick(e) { console.log(e); @@ -111,6 +111,7 @@ function handleMenuClick(e) { } else { localStorage.setItem("@@@proxy_type", "/" + e.key); } + location.reload() } diff --git a/apps/web-contract/src/utils/dict/shared.ts b/apps/web-contract/src/utils/dict/shared.ts index 60f15a9c..42de57e7 100644 --- a/apps/web-contract/src/utils/dict/shared.ts +++ b/apps/web-contract/src/utils/dict/shared.ts @@ -1,72 +1,45 @@ -/** 字典枚举 */ export enum DICT_TYPE { - - /** 静态枚举-划分标段 */ - sectionType = 'section_type', - sectionNum = 'section_num', - commonWhether = 'common_whether', - deadlineForPerformance = 'deadline_for_performance', - disputeSettlementMethods = 'dispute_settlement_methods', - - sysNormalDisable = 'sys_normal_disable', - // 会议类型 - meeting_type = 'meeting_type', - meeting_facilities = 'meeting_facilities', - meeting_room = 'meeting_room', - - // 订餐 - // 主食 - canteen_staplefood = 'canteen_staplefood', - /** 就餐方式 */ - canteen_dineway = 'canteen_dineway', - - canteenTimeRange = 'canteen_time_range', - officesupplies_status = 'officesupplies_status', - - supervise_task_type = 'supervise_task_type', - supervise_emergency_level = 'supervise_emergency_level', - + /** 系统通用状态 */ + sys_normal_disable = 'sys_normal_disable', /** 合同管理-资金流向 */ - contractFundFlow = 'contract_fund_flow', - + contract_fund_flow = 'contract_fund_flow', /** 合同管理-资金渠道 */ - contractFundingSource = 'contract_funding_source', - + contract_funding_source = 'contract_funding_source', /** 合同管理-组织形式 */ - contractOrganizationForm = 'contract_organization_form', - + contract_organization_form = 'contract_organization_form', /** 合同管理-币种单位 */ - contractCurrencyUnit = 'contract_currency_unit', - + contract_currency_unit = 'contract_currency_unit', /** 合同管理-合同模块 */ - contractModule = 'contract_module', - + contract_module = 'contract_module', /** 合同管理-选商方式 */ - contractSelectionMethod = 'contract_selection_method', - + contract_selection_method = 'contract_selection_method', /** 合同管理-合同审批 */ - contractApproval = 'contract_approval', - + contract_approval = 'contract_approval', /** 合同管理-履行状态 */ - contractPerformanceStatus = 'contract_performance_status', - + contract_performance_status = 'contract_performance_status', /** 合同管理-授权类型 */ - contractAuthorizationType = 'contract_authorization_type', - + contract_authorization_type = 'contract_authorization_type', /** 合同管理-项目类型 */ - contractProjectType = 'contract_project_type', - + contract_project_type = 'contract_project_type', /** 合同管理-商务计价方式 */ - contractPriceStyle = 'contract_price_style', - + contract_price_style = 'contract_price_style', /** 综合管理-项目管理 */ - comprehensiveProject = 'comprehensive_project', - + comprehensive_project = 'comprehensive_project', /** 综合管理-项目名称管理 */ - comprehensiveProjectName = 'comprehensive_project_name', - - comprehensiveConfig = 'comprehensive_config', - + comprehensive_project_name = 'comprehensive_project_name', + comprehensive_config = 'comprehensive_config', /** 合同管理-签约依据类型 */ - contractBasisType = 'contract_basis_type', + contract_basis_type = 'contract_basis_type', + /** 变更原因 */ + cancel_reson = 'cancel_reson', + /** 划分标段 */ + section_type = 'section_type', + /** 标段数 */ + section_num = 'section_num', + /** 常用是否 */ + common_whether = 'common_whether', + /** 履行期限 */ + deadline_for_performance = 'deadline_for_performance', + /** 纠纷解决方式 */ + dispute_settlement_methods = 'dispute_settlement_methods' } diff --git a/apps/web-contract/src/utils/dict/static.data.js b/apps/web-contract/src/utils/dict/static.data.js new file mode 100644 index 00000000..1f991558 --- /dev/null +++ b/apps/web-contract/src/utils/dict/static.data.js @@ -0,0 +1,65 @@ +const createEntry = (annotation = '', data = []) => ({ + annotation, + data, +}); + +export default { + sys_normal_disable: createEntry('系统通用状态'), + + contract_fund_flow: createEntry('合同管理-资金流向'), + contract_funding_source: createEntry('合同管理-资金渠道'), + contract_organization_form: createEntry('合同管理-组织形式'), + contract_currency_unit: createEntry('合同管理-币种单位'), + contract_module: createEntry('合同管理-合同模块'), + contract_selection_method: createEntry('合同管理-选商方式'), + contract_approval: createEntry('合同管理-合同审批'), + contract_performance_status: createEntry('合同管理-履行状态'), + contract_authorization_type: createEntry('合同管理-授权类型'), + contract_project_type: createEntry('合同管理-项目类型'), + contract_price_style: createEntry('合同管理-商务计价方式'), + + comprehensive_project: createEntry('综合管理-项目管理'), + comprehensive_project_name: createEntry('综合管理-项目名称管理'), + comprehensive_config: createEntry(), + + contract_basis_type: createEntry('合同管理-签约依据类型'), + + cancel_reson: createEntry('变更原因', [ + { label: '未填写原因', value: '0' }, + { label: '用户取消', value: '1' }, + { label: '系统取消', value: '2' }, + { label: '其他原因', value: '3' }, + ]), + + section_type: createEntry('划分标段', [ + { label: '是', value: '1' }, + { label: '否', value: '0' }, + ]), + + section_num: createEntry('标段数', [ + { 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: createEntry('常用是否', [ + { label: '是', value: '1' }, + { label: '否', value: '0' }, + ]), + + deadline_for_performance: createEntry('履行期限', [ + { label: '确定', value: '1' }, + { label: '不确定', value: '0' }, + ]), + + dispute_settlement_methods: createEntry('纠纷解决方式', [ + { label: '诉讼', value: '1' }, + { label: '仲裁', value: '2' }, + { label: '其它', value: '3' }, + ]), +}; diff --git a/apps/web-contract/src/utils/dict/static.data.ts b/apps/web-contract/src/utils/dict/static.data.ts deleted file mode 100644 index eed19136..00000000 --- a/apps/web-contract/src/utils/dict/static.data.ts +++ /dev/null @@ -1,48 +0,0 @@ - -export default { - - /** 变更原因 */ - cancel_reson: [ - { label: "未填写原因", value: "0" }, - { label: "用户取消", value: "1" }, - { label: "系统取消", value: "2" }, - { label: "其他原因", value: "3" } - ], - - /** 划分标段 */ - 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: [ - { label: "是", value: "1" }, - { label: "否", value: "0" } - ], - - /** 履行期限 */ - deadline_for_performance:[ - { label: "确定", value: "1" }, - { label: "不确定", value: "0" } - ], - - /** 纠纷解决方式 */ - dispute_settlement_methods: [ - { label: "诉讼", value: "1" }, - { label: "仲裁", value: "2" }, - { label: "其它", value: "3" } - ], -} diff --git a/apps/web-contract/src/views/_core/authentication/login.vue b/apps/web-contract/src/views/_core/authentication/login.vue index 252a7b96..f0074fe4 100644 --- a/apps/web-contract/src/views/_core/authentication/login.vue +++ b/apps/web-contract/src/views/_core/authentication/login.vue @@ -68,7 +68,7 @@ const formSchema = computed((): VbenFormSchema[] => { ]; }); -const isDev = import.meta.env.DEV; +const isDev = import.meta.env.MODE === 'development'; function mockLogin(username: string, password: string, isSkip: boolean = true) { authStore.authLogin({ username, diff --git a/apps/web-contract/src/views/contract/approval/edit/curd.tsx b/apps/web-contract/src/views/contract/approval/edit/curd.tsx index 6eb1d98d..50a002e3 100644 --- a/apps/web-contract/src/views/contract/approval/edit/curd.tsx +++ b/apps/web-contract/src/views/contract/approval/edit/curd.tsx @@ -1,64 +1,64 @@ -import { DICT_TYPE, getDictOptions } from "#/utils/dict"; -import { dict } from "@fast-crud/fast-crud"; - +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; +import { dict } from '@fast-crud/fast-crud'; /** * 筛选合同列表数据 * */ function filterContractTypes(contractTypeData: any = [], parentId: string) { - return contractTypeData.map((item) => { - item.label = item.contrLevelName; - item.value = item.contrLevelId; - return item; - }).filter((item) => item.parentId === parentId); + return contractTypeData + .map((item) => { + item.label = item.contrLevelName; + item.value = item.contrLevelId; + return item; + }) + .filter((item) => item.parentId === parentId); } export function getFormSchema(params: any = {}) { - - const { contractTypeData } = params + const { contractTypeData } = params; return { contractName: { - title: "合同名称", - key: "contractName", + title: '合同名称', + key: 'contractName', col: { span: 24 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', allowClear: false, }, rules: [{ required: true }], }, ctrType: { - title: "合同类别", - key: "ctrType", + title: '合同类别', + key: 'ctrType', col: { span: 12 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', class: 'min-w-[200px]', dict: dict({ async getData({ form = {} }) { - return filterContractTypes(contractTypeData, "-1"); + return filterContractTypes(contractTypeData, '-1'); }, }), }, valueChange({ form, value, getComponentRef }) { form.ctrTwoType = undefined; if (value) { - getComponentRef("ctrTwoType").reloadDict(); // 执行city的select组件的reloadDict()方法,触发“city”重新加载字典 + getComponentRef('ctrTwoType').reloadDict(); // 执行city的select组件的reloadDict()方法,触发“city”重新加载字典 } }, rules: [{ required: true }], }, ctrTwoType: { - title: "二级类别", - key: "ctrTwoType", + title: '二级类别', + key: 'ctrTwoType', col: { span: 12 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', class: 'min-w-[200px]', dict: dict({ async getData({ form = {} }) { @@ -69,65 +69,65 @@ export function getFormSchema(params: any = {}) { rules: [{ required: true }], }, frameProtocol: { - title: "框架协议", - key: "frameProtocol", + title: '框架协议', + key: 'frameProtocol', col: { span: 8 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', dict: dict({ data: [ - { label: "是", value: 1, }, - { label: "否", value: 0 }, - ] + { label: '是', value: 1 }, + { label: '否', value: 0 }, + ], }), }, }, frameProtocolCtr: { - title: "框架协议下的合同", - key: "frameProtocolCtr", + title: '框架协议下的合同', + key: 'frameProtocolCtr', col: { span: 12 }, - labelCol: { style: { width: "200px" } }, + labelCol: { style: { width: '200px' } }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', dict: dict({ data: [ - { label: "是", value: 1, }, - { label: "否", value: 0 }, - ] + { label: '是', value: 1 }, + { label: '否', value: 0 }, + ], }), }, }, fundAllocation: { - title: "资金流向", - key: "fundAllocation", + title: '资金流向', + key: 'fundAllocation', col: { span: 12 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundFlow) + data: getDictOptions(DICT_TYPE.contract_fund_flow), }), }, - rules: [{ required: true, message: "请选择资金流向" }], + rules: [{ required: true, message: '请选择资金流向' }], }, fundDitch: { - title: "资金渠道", - key: "fundDitch", + title: '资金渠道', + key: 'fundDitch', col: { span: 12 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundingSource) + data: getDictOptions(DICT_TYPE.contract_funding_source), }), }, - rules: [{ required: true, message: "请选择资金渠道" }], + rules: [{ required: true, message: '请选择资金渠道' }], }, budgetSum: { title: '预算金额', @@ -146,35 +146,34 @@ export function getFormSchema(params: any = {}) { title: '', key: 'priceType', col: { span: 6 }, - labelCol: { style: { width: "12px" } }, + labelCol: { style: { width: '12px' } }, colon: false, component: { name: 'fs-dict-select', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.contractCurrencyUnit) + data: getDictOptions(DICT_TYPE.contract_currency_unit), }), }, }, organiza: { - title: "组织形式", - key: "organiza", + title: '组织形式', + key: 'organiza', col: { span: 12 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form), }), }, - rules: [{ required: true, message: "请选择组织形式" }], + rules: [{ required: true, message: '请选择组织形式' }], }, fileList: { - title: "相关附件", - key: "fileList", + title: '相关附件', + key: 'fileList', }, - } - + }; } diff --git a/apps/web-contract/src/views/contract/approval/edit/index.vue b/apps/web-contract/src/views/contract/approval/edit/index.vue index 6c1ef32f..a6bf91f8 100644 --- a/apps/web-contract/src/views/contract/approval/edit/index.vue +++ b/apps/web-contract/src/views/contract/approval/edit/index.vue @@ -69,7 +69,7 @@ function getColumns(params): any { width: 100, slots: { default: ({ row }) => { - return getDictObj(DICT_TYPE.contractBasisType, row.basisTypeId) + return getDictObj(DICT_TYPE.contract_basis_type, row.basisTypeId) ?.label; }, }, @@ -242,12 +242,12 @@ async function handleSave() { } newForm.fundDitchName = getDictObj( - DICT_TYPE.contractFundingSource, + DICT_TYPE.contract_funding_source, newForm.fundDitch )?.label; newForm.priceTypeName = getDictObj( - DICT_TYPE.contractCurrencyUnit, + DICT_TYPE.contract_currency_unit, newForm.priceType )?.label; diff --git a/apps/web-contract/src/views/contract/approval/list/crud.tsx b/apps/web-contract/src/views/contract/approval/list/crud.tsx index 5f37c779..c44ce0ac 100644 --- a/apps/web-contract/src/views/contract/approval/list/crud.tsx +++ b/apps/web-contract/src/views/contract/approval/list/crud.tsx @@ -52,14 +52,14 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { { field: 'organiza', title: '组织形式', width: 120, slots: { default: ({ row }) => { - return useRender.renderDict(row.organiza, DICT_TYPE.contractOrganizationForm); + return useRender.renderDict(row.organiza, DICT_TYPE.contract_organization_form); } } }, { field: 'fundAllocation', title: '资金流向', width: 100, slots: { default: ({ row }) => { - return useRender.renderDict(row.fundAllocation, DICT_TYPE.contractFundFlow); + return useRender.renderDict(row.fundAllocation, DICT_TYPE.contract_fund_flow); } } }, @@ -103,7 +103,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/approval/signing-basis/crud.tsx b/apps/web-contract/src/views/contract/approval/signing-basis/crud.tsx index 39c23696..df91b494 100644 --- a/apps/web-contract/src/views/contract/approval/signing-basis/crud.tsx +++ b/apps/web-contract/src/views/contract/approval/signing-basis/crud.tsx @@ -22,7 +22,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { width: 100, slots: { default: ({ row }) => { - return getDictObj(DICT_TYPE.contractBasisType, row.basisTypeId) + return getDictObj(DICT_TYPE.contract_basis_type, row.basisTypeId) ?.label; }, }, @@ -65,7 +65,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { width: 100, slots: { default: ({ row }) => { - return getDictObj(DICT_TYPE.contractBasisType, row.basisTypeId) + return getDictObj(DICT_TYPE.contract_basis_type, row.basisTypeId) ?.label; }, }, @@ -134,7 +134,7 @@ export function getFormSchema(_params: any = {}) { allowClear: true, dict: dict({ async getData(form) { - return getDictOptions(DICT_TYPE.contractBasisType); + return getDictOptions(DICT_TYPE.contract_basis_type); }, }), }, diff --git a/apps/web-contract/src/views/contract/approval/signing-basis/signing-basis-edit-modal.vue b/apps/web-contract/src/views/contract/approval/signing-basis/signing-basis-edit-modal.vue index d2b0b4c9..591b80de 100644 --- a/apps/web-contract/src/views/contract/approval/signing-basis/signing-basis-edit-modal.vue +++ b/apps/web-contract/src/views/contract/approval/signing-basis/signing-basis-edit-modal.vue @@ -36,7 +36,7 @@ const formBinding = ref({ allowClear: true, dict: dict({ async getData(form) { - return getDictOptions(DICT_TYPE.contractBasisType); + return getDictOptions(DICT_TYPE.contract_basis_type); }, }), }, diff --git a/apps/web-contract/src/views/contract/archive/list/crud.tsx b/apps/web-contract/src/views/contract/archive/list/crud.tsx index 48b48aa0..d8698f63 100644 --- a/apps/web-contract/src/views/contract/archive/list/crud.tsx +++ b/apps/web-contract/src/views/contract/archive/list/crud.tsx @@ -31,14 +31,14 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { { field: 'organiza', title: '组织形式', width: 120, slots: { default: ({ row }) => { - return useRender.renderDict(row.organiza, DICT_TYPE.contractOrganizationForm); + return useRender.renderDict(row.organiza, DICT_TYPE.contract_organization_form); } } }, { field: 'fundAllocation', title: '资金流向', width: 100, slots: { default: ({ row }) => { - return useRender.renderDict(row.fundAllocation, DICT_TYPE.contractFundFlow); + return useRender.renderDict(row.fundAllocation, DICT_TYPE.contract_fund_flow); } } }, @@ -74,7 +74,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/audit/list/crud.tsx b/apps/web-contract/src/views/contract/audit/list/crud.tsx index 48b48aa0..d8698f63 100644 --- a/apps/web-contract/src/views/contract/audit/list/crud.tsx +++ b/apps/web-contract/src/views/contract/audit/list/crud.tsx @@ -31,14 +31,14 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { { field: 'organiza', title: '组织形式', width: 120, slots: { default: ({ row }) => { - return useRender.renderDict(row.organiza, DICT_TYPE.contractOrganizationForm); + return useRender.renderDict(row.organiza, DICT_TYPE.contract_organization_form); } } }, { field: 'fundAllocation', title: '资金流向', width: 100, slots: { default: ({ row }) => { - return useRender.renderDict(row.fundAllocation, DICT_TYPE.contractFundFlow); + return useRender.renderDict(row.fundAllocation, DICT_TYPE.contract_fund_flow); } } }, @@ -74,7 +74,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx b/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx index c4f8b255..cbd2ee0b 100644 --- a/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx +++ b/apps/web-contract/src/views/contract/business/edit/basic-info-curd.tsx @@ -121,7 +121,7 @@ export function getFormSchema(params: any = {}) { name: 'fs-dict-select', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.contractCurrencyUnit) + data: getDictOptions(DICT_TYPE.contract_currency_unit) }), }, }, @@ -135,7 +135,7 @@ export function getFormSchema(params: any = {}) { allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundFlow) + data: getDictOptions(DICT_TYPE.contract_fund_flow) }), }, rules: [{ required: true, message: "请选择资金流向" }], @@ -150,7 +150,7 @@ export function getFormSchema(params: any = {}) { allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundingSource) + data: getDictOptions(DICT_TYPE.contract_funding_source) }), }, rules: [{ required: true, message: "请选择资金渠道" }], @@ -198,7 +198,7 @@ export function getFormSchema(params: any = {}) { allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, rules: [{ required: true, message: "请选择组织方式" }], diff --git a/apps/web-contract/src/views/contract/business/edit/curd.tsx b/apps/web-contract/src/views/contract/business/edit/curd.tsx index bdc99d1d..3bfb1b64 100644 --- a/apps/web-contract/src/views/contract/business/edit/curd.tsx +++ b/apps/web-contract/src/views/contract/business/edit/curd.tsx @@ -1,177 +1,178 @@ -import { DICT_TYPE, getDictOptions } from "#/utils/dict"; -import { dict } from "@fast-crud/fast-crud"; +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; +import { dict } from '@fast-crud/fast-crud'; export function getFormSchema(_params: any = {}) { - return { projectNum: { - title: "项目", - key: "projectNum", + title: '项目', + key: 'projectNum', col: { span: 12 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', allowClear: false, }, rules: [{ required: true }], }, projectProp: { - title: "项目类别", - key: "projectProp", + title: '项目类别', + key: 'projectProp', col: { span: 12 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractProjectType) + data: getDictOptions(DICT_TYPE.contract_project_type), }), }, rules: [{ required: true }], }, projectName: { - title: "项目名称", - key: "projectName", + title: '项目名称', + key: 'projectName', col: { span: 24 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.comprehensiveProjectName) + data: getDictOptions(DICT_TYPE.comprehensive_project_name), }), }, rules: [{ required: true }], }, priceStyleId: { - title: "商务计价方式", - key: "priceStyleId", + title: '商务计价方式', + key: 'priceStyleId', col: { span: 24 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractPriceStyle) + data: getDictOptions(DICT_TYPE.contract_price_style), }), }, }, choiceType: { - title: "选商方式", - key: "choiceType", + title: '选商方式', + key: 'choiceType', col: { span: 24 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.contractSelectionMethod) + data: getDictOptions(DICT_TYPE.contract_selection_method), }), }, }, choiceReason: { - title: "选商方式说明", - key: "choiceReason", + title: '选商方式说明', + key: 'choiceReason', col: { span: 24 }, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, qualificReq: { - title: "资质要求", - key: "qualificReq", + title: '资质要求', + key: 'qualificReq', col: { span: 24 }, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, isBid: { - title: "划分标段", - key: "isBid", + title: '划分标段', + key: 'isBid', col: { span: 24 }, // component: { // name: "fs-dict-radio", // vModel: "value", // dict: dict({ - // data: getDictOptions(DICT_TYPE.sectionType) + // data: getDictOptions(DICT_TYPE.section_type) // }), // }, render({ form }) { //注意此处的v-model写法 - let options1 = getDictOptions(DICT_TYPE.sectionType,'string') - let options2 = getDictOptions(DICT_TYPE.sectionNum,'string') + let options1 = getDictOptions(DICT_TYPE.section_type, 'string'); + let options2 = getDictOptions(DICT_TYPE.section_num, 'string'); return (
- +
{form.isBid === 1 && ( - - - + + + )}
); - } + }, }, projectRange: { - title: "项目范围", - key: "projectRange", + title: '项目范围', + key: 'projectRange', col: { span: 24 }, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, projectContent: { - title: "项目内容", - key: "projectContent", + title: '项目内容', + key: 'projectContent', col: { span: 24 }, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, quality: { - title: "工期/质量要求", - key: "quality", + title: '工期/质量要求', + key: 'quality', col: { span: 24 }, - labelWrap:true, + labelWrap: true, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, stockNums: { - title: "工程/采购量", - key: "stockNums", + title: '工程/采购量', + key: 'stockNums', col: { span: 24 }, - labelWrap:true, + labelWrap: true, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, stockPlanMx: { - title: "计划投资明细", - key: "stockPlanMx", + title: '计划投资明细', + key: 'stockPlanMx', col: { span: 24 }, - labelWrap:true, + labelWrap: true, component: { - name: "a-textarea", - vModel: "value", - autosize: { minRows: 4, maxRows: 6 } + name: 'a-textarea', + vModel: 'value', + autosize: { minRows: 4, maxRows: 6 }, }, }, - } - + }; } diff --git a/apps/web-contract/src/views/contract/business/edit/index.vue b/apps/web-contract/src/views/contract/business/edit/index.vue index 308ac659..0e7427b9 100644 --- a/apps/web-contract/src/views/contract/business/edit/index.vue +++ b/apps/web-contract/src/views/contract/business/edit/index.vue @@ -156,8 +156,8 @@ async function handleSave() { let contractForm = formRefByBaseInfo.value.form; let bussinessForm = formRef.value.form; - bussinessForm.priceStyleName = getDictObj(DICT_TYPE.contractPriceStyle, bussinessForm.priceStyleId)?.label - bussinessForm.choiceTypeName = getDictObj(DICT_TYPE.contractSelectionMethod, bussinessForm.choiceType)?.label; + bussinessForm.priceStyleName = getDictObj(DICT_TYPE.contract_price_style, bussinessForm.priceStyleId)?.label + bussinessForm.choiceTypeName = getDictObj(DICT_TYPE.contract_selection_method, bussinessForm.choiceType)?.label; // 合同附件 { @@ -249,12 +249,12 @@ async function handleSave() { } newForm.fundDitchName = getDictObj( - DICT_TYPE.contractFundingSource, + DICT_TYPE.contract_funding_source, newForm.fundDitch )?.label; newForm.priceTypeName = getDictObj( - DICT_TYPE.contractCurrencyUnit, + DICT_TYPE.contract_currency_unit, newForm.priceType )?.label; diff --git a/apps/web-contract/src/views/contract/business/list/crud.tsx b/apps/web-contract/src/views/contract/business/list/crud.tsx index 31cbc984..3489ab5a 100644 --- a/apps/web-contract/src/views/contract/business/list/crud.tsx +++ b/apps/web-contract/src/views/contract/business/list/crud.tsx @@ -77,7 +77,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractSelectionMethod) + data: getDictOptions(DICT_TYPE.contract_selection_method) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/company/edit/curd.tsx b/apps/web-contract/src/views/contract/company/edit/curd.tsx index f4bb9e0f..e05a5d08 100644 --- a/apps/web-contract/src/views/contract/company/edit/curd.tsx +++ b/apps/web-contract/src/views/contract/company/edit/curd.tsx @@ -108,7 +108,7 @@ export function getFormSchema(_params: any = {}) { name: 'fs-dict-select', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.contractCurrencyUnit), + data: getDictOptions(DICT_TYPE.contract_currency_unit), }), }, }, diff --git a/apps/web-contract/src/views/contract/company/edit/index.vue b/apps/web-contract/src/views/contract/company/edit/index.vue index 13bdd567..fa767e6e 100644 --- a/apps/web-contract/src/views/contract/company/edit/index.vue +++ b/apps/web-contract/src/views/contract/company/edit/index.vue @@ -157,12 +157,12 @@ async function handleSave() { } newForm.fundDitchName = getDictObj( - DICT_TYPE.contractFundingSource, + DICT_TYPE.contract_funding_source, newForm.fundDitch, )?.label; newForm.priceTypeName = getDictObj( - DICT_TYPE.contractCurrencyUnit, + DICT_TYPE.contract_currency_unit, newForm.priceType, )?.label; diff --git a/apps/web-contract/src/views/contract/company/list/crud.tsx b/apps/web-contract/src/views/contract/company/list/crud.tsx index 9fdfb08e..21777260 100644 --- a/apps/web-contract/src/views/contract/company/list/crud.tsx +++ b/apps/web-contract/src/views/contract/company/list/crud.tsx @@ -70,7 +70,7 @@ export function getFormSchema(_params: any = {}) { name: 'fs-dict-select', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.contractCurrencyUnit), + data: getDictOptions(DICT_TYPE.contract_currency_unit), }), }, show: true, diff --git a/apps/web-contract/src/views/contract/config/components/contract-type/contract-type-edit-modal.vue b/apps/web-contract/src/views/contract/config/components/contract-type/contract-type-edit-modal.vue index bf7312b0..10c42943 100644 --- a/apps/web-contract/src/views/contract/config/components/contract-type/contract-type-edit-modal.vue +++ b/apps/web-contract/src/views/contract/config/components/contract-type/contract-type-edit-modal.vue @@ -101,7 +101,7 @@ const formBinding = ref({ name: "fs-dict-radio", vModel: "value", dict: dict({ - data: getDictOptions(DICT_TYPE.sysNormalDisable), + data: getDictOptions(DICT_TYPE.sys_normal_disable), }), }, }, diff --git a/apps/web-contract/src/views/contract/config/components/contract-type/crud.tsx b/apps/web-contract/src/views/contract/config/components/contract-type/crud.tsx index 6b07abb8..96b3b462 100644 --- a/apps/web-contract/src/views/contract/config/components/contract-type/crud.tsx +++ b/apps/web-contract/src/views/contract/config/components/contract-type/crud.tsx @@ -11,7 +11,7 @@ export function getColumns(_params: any = {}): VxeGridPropTypes.Columns { { field: 'status', title: '状态', width: 150, slots: { default: ({ row }) => { - return useRender.renderDict(row.status, DICT_TYPE.sysNormalDisable); + return useRender.renderDict(row.status, DICT_TYPE.sys_normal_disable); } } }, diff --git a/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager-edit-modal.vue b/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager-edit-modal.vue index f4b4de27..0f7fcb56 100644 --- a/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager-edit-modal.vue +++ b/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager-edit-modal.vue @@ -62,7 +62,7 @@ const [BaseModal, baseModalApi] = useVbenModal({ isConfirmLoading.value = true let form = formRef.value?.form - form.type = DICT_TYPE.comprehensiveProjectName + form.type = DICT_TYPE.comprehensive_project_name await Apis.dictData.post_save({ data: form }); emit("success"); diff --git a/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager.vue b/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager.vue index 72644ad6..78ab379c 100644 --- a/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager.vue +++ b/apps/web-contract/src/views/contract/config/components/project-name-manager/project-name-manager.vue @@ -36,7 +36,7 @@ const gridOptions = reactive(gridProps({ return Apis.dictData.get_page({ params: { pageNum: page.currentPage, pageSize: page.pageSize, - type: DICT_TYPE.comprehensiveProjectName, + type: DICT_TYPE.comprehensive_project_name, ...form } }) diff --git a/apps/web-contract/src/views/contract/config/components/template-manager/crud.tsx b/apps/web-contract/src/views/contract/config/components/template-manager/crud.tsx index 0094fb2c..4fbc5fa3 100644 --- a/apps/web-contract/src/views/contract/config/components/template-manager/crud.tsx +++ b/apps/web-contract/src/views/contract/config/components/template-manager/crud.tsx @@ -24,7 +24,7 @@ export function getColumns(_params: any = {}): VxeGridPropTypes.Columns { { field: 'status', title: '状态', width: 150, slots: { default: ({ row }) => { - return useRender.renderDict(row.status, DICT_TYPE.sysNormalDisable); + return useRender.renderDict(row.status, DICT_TYPE.sys_normal_disable); } } }, diff --git a/apps/web-contract/src/views/contract/config/components/template-manager/template-manager-edit-modal.vue b/apps/web-contract/src/views/contract/config/components/template-manager/template-manager-edit-modal.vue index bbac0dac..c9b45489 100644 --- a/apps/web-contract/src/views/contract/config/components/template-manager/template-manager-edit-modal.vue +++ b/apps/web-contract/src/views/contract/config/components/template-manager/template-manager-edit-modal.vue @@ -73,7 +73,7 @@ const formBinding = ref({ name: "fs-dict-radio", vModel: "value", dict: dict({ - data: getDictOptions(DICT_TYPE.sysNormalDisable), + data: getDictOptions(DICT_TYPE.sys_normal_disable), }), }, }, diff --git a/apps/web-contract/src/views/contract/declaration/edit/basic-info-curd.tsx b/apps/web-contract/src/views/contract/declaration/edit/basic-info-curd.tsx index 873a52a4..6f9b7c78 100644 --- a/apps/web-contract/src/views/contract/declaration/edit/basic-info-curd.tsx +++ b/apps/web-contract/src/views/contract/declaration/edit/basic-info-curd.tsx @@ -156,7 +156,7 @@ export function getFormSchema(params: any = {}) { name: 'fs-dict-select', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.contractCurrencyUnit), + data: getDictOptions(DICT_TYPE.contract_currency_unit), }), }, conditionalRender: { @@ -164,7 +164,7 @@ export function getFormSchema(params: any = {}) { return true; }, render({ form }) { - return {getDictObj(DICT_TYPE.contractCurrencyUnit,form.priceType)?.label}; + return {getDictObj(DICT_TYPE.contract_currency_unit,form.priceType)?.label}; }, }, }, @@ -178,7 +178,7 @@ export function getFormSchema(params: any = {}) { allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundFlow), + data: getDictOptions(DICT_TYPE.contract_fund_flow), }), }, conditionalRender: { @@ -186,7 +186,7 @@ export function getFormSchema(params: any = {}) { return true; }, render({ form }) { - return {getDictObj(DICT_TYPE.contractFundFlow,form.fundAllocation)?.label}; + return {getDictObj(DICT_TYPE.contract_fund_flow,form.fundAllocation)?.label}; }, }, }, @@ -200,7 +200,7 @@ export function getFormSchema(params: any = {}) { allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundingSource), + data: getDictOptions(DICT_TYPE.contract_funding_source), }), }, conditionalRender: { @@ -208,7 +208,7 @@ export function getFormSchema(params: any = {}) { return true; }, render({ form }) { - return {getDictObj(DICT_TYPE.contractFundingSource,form.fundDitch)?.label}; + return {getDictObj(DICT_TYPE.contract_funding_source,form.fundDitch)?.label}; }, }, }, @@ -221,7 +221,7 @@ export function getFormSchema(params: any = {}) { name: 'fs-dict-radio', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.commonWhether), + data: getDictOptions(DICT_TYPE.common_whether), }), }, conditionalRender: { @@ -229,7 +229,7 @@ export function getFormSchema(params: any = {}) { return true; }, render({ form }) { - return {getDictObj(DICT_TYPE.commonWhether,form.frameProtocol)?.label}; + return {getDictObj(DICT_TYPE.common_whether,form.frameProtocol)?.label}; }, }, }, @@ -242,7 +242,7 @@ export function getFormSchema(params: any = {}) { name: 'fs-dict-radio', vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.commonWhether), + data: getDictOptions(DICT_TYPE.common_whether), }), }, conditionalRender: { @@ -250,7 +250,7 @@ export function getFormSchema(params: any = {}) { return true; }, render({ form }) { - return {getDictObj(DICT_TYPE.commonWhether,form.frameProtocolCtr)?.label}; + return {getDictObj(DICT_TYPE.common_whether,form.frameProtocolCtr)?.label}; }, }, }, @@ -264,7 +264,7 @@ export function getFormSchema(params: any = {}) { allowClear: false, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm), + data: getDictOptions(DICT_TYPE.contract_organization_form), }), }, conditionalRender: { @@ -272,7 +272,7 @@ export function getFormSchema(params: any = {}) { return true; }, render({ form }) { - return {getDictObj(DICT_TYPE.contractOrganizationForm,form.organiza)?.label}; + return {getDictObj(DICT_TYPE.contract_organization_form,form.organiza)?.label}; }, }, }, diff --git a/apps/web-contract/src/views/contract/declaration/edit/curd.tsx b/apps/web-contract/src/views/contract/declaration/edit/curd.tsx index 3d9d4983..838a1c81 100644 --- a/apps/web-contract/src/views/contract/declaration/edit/curd.tsx +++ b/apps/web-contract/src/views/contract/declaration/edit/curd.tsx @@ -1,84 +1,90 @@ -import { DICT_TYPE, getDictObj, getDictOptions } from "#/utils/dict"; -import { dict } from "@fast-crud/fast-crud"; +import { DICT_TYPE, getDictObj, getDictOptions } from '#/utils/dict'; +import { dict } from '@fast-crud/fast-crud'; export function getFormSchema(_params: any = {}) { - return { initialForm: { - projectNum4:'克拉玛依市热力有限责任公司' + signUnitName: '克拉玛依市热力有限责任公司', }, - columns:{ - projectNum: { - title: "合同标的", - key: "projectNum", + columns: { + objects: { + title: '合同标的', + key: 'objects', col: { span: 24 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', allowClear: false, }, rules: [{ required: true }], }, - projectNum1: { - title: "标的金额", - key: "projectNum1", + objectsSum: { + title: '标的金额', + key: 'objectsSum', col: { span: 8 }, component: { - name: "a-input-number", - vModel: "value", + name: 'a-input-number', + vModel: 'value', allowClear: false, }, - suffixRender({ form,value }) { - return {getDictObj(DICT_TYPE.contractCurrencyUnit,form.priceType)?.label}; - } + suffixRender({ form, value }) { + return ( + + { + getDictObj(DICT_TYPE.contract_currency_unit, form.priceType) + ?.label + } + + ); + }, }, - projectNum2: { - title: "是否含税", - key: "projectNum2", + isIncludeTax: { + title: '是否含税', + key: 'isIncludeTax', col: { span: 8 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', allowClear: false, dict: dict({ - data: getDictOptions(DICT_TYPE.commonWhether) + data: getDictOptions(DICT_TYPE.common_whether), }), }, }, - projectNum3: { - title: "我方签约人", - key: "projectNum3", + signUserId: { + title: '我方签约人', + key: 'signUserId', col: { span: 8 }, component: { - name: "fs-dict-select", - vModel: "value", + name: 'fs-dict-select', + vModel: 'value', allowClear: false, dict: dict({ - data: [] + data: [], }), }, }, - projectNum4: { - title: "我方签约单位", - key: "projectNum4", + signUnitName: { + title: '我方签约单位', + key: 'signUnitName', col: { span: 24 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', allowClear: false, - readOnly:true + readOnly: true, }, }, projectNum5: { - title: "合同相对人", - key: "projectNum5", + title: '合同相对人', + key: 'projectNum5', col: { span: 16 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractProjectType) + data: getDictOptions(DICT_TYPE.contract_project_type), }), }, conditionalRender: { @@ -91,23 +97,23 @@ export function getFormSchema(_params: any = {}) { }, }, projectNum6: { - title: "公告发布方式", - key: "projectNum6", + title: '公告发布方式', + key: 'projectNum6', col: { span: 8 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', }, }, isBid: { - title: "划分标段", - key: "isBid", + title: '划分标段', + key: 'isBid', col: { span: 24 }, // component: { // name: "fs-dict-radio", // vModel: "value", // dict: dict({ - // data: getDictOptions(DICT_TYPE.sectionType) + // data: getDictOptions(DICT_TYPE.section_type) // }), // }, conditionalRender: { @@ -115,91 +121,96 @@ export function getFormSchema(_params: any = {}) { return true; }, render({ form }) { - //注意此处的v-model写法 - let options1 = getDictOptions(DICT_TYPE.deadlineForPerformance,'string') + //注意此处的v-model写法 + let options1 = getDictOptions( + DICT_TYPE.deadlineForPerformance, + 'string', + ); - return ( -
- - - -
- {form.isBid === 1 && ( - - - - )} -
- ); + return ( +
+ + + +
+ {form.isBid === 1 && ( + + + + )} +
+ ); }, }, }, projectNum7: { - title: "履行地点", - key: "projectNum7", + title: '履行地点', + key: 'projectNum7', col: { span: 16 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', }, }, projectNum8: { - title: "专项号", - key: "projectNum8", + title: '专项号', + key: 'projectNum8', col: { span: 8 }, component: { - name: "a-input", - vModel: "value", + name: 'a-input', + vModel: 'value', }, }, projectNum9: { - title: "纠纷解决方式", - key: "projectNum9", + title: '纠纷解决方式', + key: 'projectNum9', col: { span: 16 }, component: { - name: "fs-dict-radio", - vModel: "value", + name: 'fs-dict-radio', + vModel: 'value', dict: dict({ - data: getDictOptions(DICT_TYPE.disputeSettlementMethods) + data: getDictOptions(DICT_TYPE.dispute_settlement_methods), }), }, }, projectNum10: { - title: "质保金期限", - key: "projectNum10", + title: '质保金期限', + key: 'projectNum10', col: { span: 8 }, component: { - name: "a-input-number", - vModel: "value", + name: 'a-input-number', + vModel: 'value', }, suffixRender({ value }) { return 个月; - } + }, }, projectNum11: { - title: "预付款比例", - key: "projectNum11", + title: '预付款比例', + key: 'projectNum11', col: { span: 16 }, component: { - name: "a-input-number", - vModel: "value", + name: 'a-input-number', + vModel: 'value', }, suffixRender({ value }) { return %; - } - }, - stockPlanMx: { - title: "承办人意见", - key: "stockPlanMx", - col: { span: 24 }, - labelWrap:true, - component: { - name: "a-textarea", - vModel: "value", - autoSize: { minRows: 4, maxRows: 6 } }, }, - } - } - + stockPlanMx: { + title: '承办人意见', + key: 'stockPlanMx', + col: { span: 24 }, + labelWrap: true, + component: { + name: 'a-textarea', + vModel: 'value', + autoSize: { minRows: 4, maxRows: 6 }, + }, + }, + }, + }; } diff --git a/apps/web-contract/src/views/contract/declaration/edit/index.vue b/apps/web-contract/src/views/contract/declaration/edit/index.vue index 078fa6d4..43014692 100644 --- a/apps/web-contract/src/views/contract/declaration/edit/index.vue +++ b/apps/web-contract/src/views/contract/declaration/edit/index.vue @@ -48,7 +48,7 @@ const formBindingByBaseInfo = ref({ }); const formBinding = ref({ - ... getFormSchema(), + ...getFormSchema(), }); function getColumns(): any { @@ -156,11 +156,11 @@ async function handleSave() { let bussinessForm = formRef.value.form; bussinessForm.priceStyleName = getDictObj( - DICT_TYPE.contractPriceStyle, + DICT_TYPE.contract_price_style, bussinessForm.priceStyleId, )?.label; bussinessForm.choiceTypeName = getDictObj( - DICT_TYPE.contractSelectionMethod, + DICT_TYPE.contract_selection_method, bussinessForm.choiceType, )?.label; @@ -256,12 +256,12 @@ async function handleSave() { } newForm.fundDitchName = getDictObj( - DICT_TYPE.contractFundingSource, + DICT_TYPE.contract_funding_source, newForm.fundDitch, )?.label; newForm.priceTypeName = getDictObj( - DICT_TYPE.contractCurrencyUnit, + DICT_TYPE.contract_currency_unit, newForm.priceType, )?.label; diff --git a/apps/web-contract/src/views/contract/declaration/list/crud.tsx b/apps/web-contract/src/views/contract/declaration/list/crud.tsx index ba907fbc..3665db00 100644 --- a/apps/web-contract/src/views/contract/declaration/list/crud.tsx +++ b/apps/web-contract/src/views/contract/declaration/list/crud.tsx @@ -104,7 +104,7 @@ export function getFormSchema(_params: any = {}) { allowClear: true, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractSelectionMethod) + data: getDictOptions(DICT_TYPE.contract_selection_method) }), }, }, @@ -139,7 +139,7 @@ export function getFormSchema(_params: any = {}) { allowClear: true, class: 'min-w-[200px]', dict: dict({ - data: getDictOptions(DICT_TYPE.contractFundingSource) + data: getDictOptions(DICT_TYPE.contract_funding_source) }), }, }, diff --git a/apps/web-contract/src/views/contract/perform/list/crud.tsx b/apps/web-contract/src/views/contract/perform/list/crud.tsx index 400726e8..530a5341 100644 --- a/apps/web-contract/src/views/contract/perform/list/crud.tsx +++ b/apps/web-contract/src/views/contract/perform/list/crud.tsx @@ -48,7 +48,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/perform/temporary-archive/crud.tsx b/apps/web-contract/src/views/contract/perform/temporary-archive/crud.tsx index 400726e8..530a5341 100644 --- a/apps/web-contract/src/views/contract/perform/temporary-archive/crud.tsx +++ b/apps/web-contract/src/views/contract/perform/temporary-archive/crud.tsx @@ -48,7 +48,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx b/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx index 44eab3f0..97ae8811 100644 --- a/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx +++ b/apps/web-contract/src/views/contract/sign-authorization/edit/curd.tsx @@ -87,7 +87,7 @@ export function getFormSchema(_params: any = {}) { col: { span: 24 }, render({ form }) { //注意此处的v-model写法 - let options1 = getDictOptions(DICT_TYPE.disputeSettlementMethods,'string') + let options1 = getDictOptions(DICT_TYPE.dispute_settlement_methods,'string') return (
diff --git a/apps/web-contract/src/views/contract/sign-authorization/edit/index.vue b/apps/web-contract/src/views/contract/sign-authorization/edit/index.vue index 5f7996b5..bb87b01a 100644 --- a/apps/web-contract/src/views/contract/sign-authorization/edit/index.vue +++ b/apps/web-contract/src/views/contract/sign-authorization/edit/index.vue @@ -153,8 +153,8 @@ async function handleSave() { let contractForm = formRefByBaseInfo.value.form; let bussinessForm = formRef.value.form; - bussinessForm.priceStyleName = getDictObj(DICT_TYPE.contractPriceStyle, bussinessForm.priceStyleId)?.label - bussinessForm.choiceTypeName = getDictObj(DICT_TYPE.contractSelectionMethod, bussinessForm.choiceType)?.label; + bussinessForm.priceStyleName = getDictObj(DICT_TYPE.contract_price_style, bussinessForm.priceStyleId)?.label + bussinessForm.choiceTypeName = getDictObj(DICT_TYPE.contract_selection_method, bussinessForm.choiceType)?.label; // 合同附件 { @@ -246,12 +246,12 @@ async function handleSave() { } newForm.fundDitchName = getDictObj( - DICT_TYPE.contractFundingSource, + DICT_TYPE.contract_funding_source, newForm.fundDitch )?.label; newForm.priceTypeName = getDictObj( - DICT_TYPE.contractCurrencyUnit, + DICT_TYPE.contract_currency_unit, newForm.priceType )?.label; diff --git a/apps/web-contract/src/views/contract/sign-authorization/list/crud.tsx b/apps/web-contract/src/views/contract/sign-authorization/list/crud.tsx index 48b48aa0..d8698f63 100644 --- a/apps/web-contract/src/views/contract/sign-authorization/list/crud.tsx +++ b/apps/web-contract/src/views/contract/sign-authorization/list/crud.tsx @@ -31,14 +31,14 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { { field: 'organiza', title: '组织形式', width: 120, slots: { default: ({ row }) => { - return useRender.renderDict(row.organiza, DICT_TYPE.contractOrganizationForm); + return useRender.renderDict(row.organiza, DICT_TYPE.contract_organization_form); } } }, { field: 'fundAllocation', title: '资金流向', width: 100, slots: { default: ({ row }) => { - return useRender.renderDict(row.fundAllocation, DICT_TYPE.contractFundFlow); + return useRender.renderDict(row.fundAllocation, DICT_TYPE.contract_fund_flow); } } }, @@ -74,7 +74,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/contract/sign/list/crud.tsx b/apps/web-contract/src/views/contract/sign/list/crud.tsx index 48b48aa0..d8698f63 100644 --- a/apps/web-contract/src/views/contract/sign/list/crud.tsx +++ b/apps/web-contract/src/views/contract/sign/list/crud.tsx @@ -31,14 +31,14 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns { { field: 'organiza', title: '组织形式', width: 120, slots: { default: ({ row }) => { - return useRender.renderDict(row.organiza, DICT_TYPE.contractOrganizationForm); + return useRender.renderDict(row.organiza, DICT_TYPE.contract_organization_form); } } }, { field: 'fundAllocation', title: '资金流向', width: 100, slots: { default: ({ row }) => { - return useRender.renderDict(row.fundAllocation, DICT_TYPE.contractFundFlow); + return useRender.renderDict(row.fundAllocation, DICT_TYPE.contract_fund_flow); } } }, @@ -74,7 +74,7 @@ export function getFormSchema(_params: any = {}) { class: 'min-w-[180px]', allowClear: true, dict: dict({ - data: getDictOptions(DICT_TYPE.contractOrganizationForm) + data: getDictOptions(DICT_TYPE.contract_organization_form) }), }, autoSearchTrigger: 'enter', diff --git a/apps/web-contract/src/views/system/dict/index.vue b/apps/web-contract/src/views/system/dict/index.vue index 5082ea97..8febe059 100644 --- a/apps/web-contract/src/views/system/dict/index.vue +++ b/apps/web-contract/src/views/system/dict/index.vue @@ -92,7 +92,7 @@ const gridOptions = reactive(gridProps({ { field: 'status', title: '状态', minWidth: 100, slots: { default: ({ row }) => { - return useRender.renderDict(row.status, DICT_TYPE.sysNormalDisable); + return useRender.renderDict(row.status, DICT_TYPE.sys_normal_disable); } } }, diff --git a/apps/web-contract/vite.config.mts b/apps/web-contract/vite.config.mts index fca3eb67..bfc52d36 100644 --- a/apps/web-contract/vite.config.mts +++ b/apps/web-contract/vite.config.mts @@ -2,47 +2,104 @@ import { defineConfig } from '@vben/vite-config'; import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'; import Components from 'unplugin-vue-components/vite'; -import AutoImport from 'unplugin-auto-import/vite' -import { lazyImport, VxeResolver } from 'vite-plugin-lazy-import' +import AutoImport from 'unplugin-auto-import/vite'; +import { lazyImport, VxeResolver } from 'vite-plugin-lazy-import'; +import fs from 'fs'; +import path from 'path'; +import { pathToFileURL } from 'url'; + +async function autoBuildDict() { + return { + name: 'my-plugin', + async handleHotUpdate({ file, server }) { + if (file.endsWith('static.data.js')) { + console.log(`File changed: ${file}`); + const dataPath = path.resolve( + __dirname, + 'src/utils/dict/static.data.js', + ); + const sharedPath = path.resolve(__dirname, 'src/utils/dict/shared.ts'); + + // Append a query parameter to avoid caching + const dataUrl = `${pathToFileURL(dataPath).href}?update=${Date.now()}`; + console.log(`dataUrl: ${dataUrl}`); + + // Import the data + const module = await import(dataUrl); + const data = module.default; + console.log(`data: ${data}`); + + // Create new enum entries with annotations + const enumEntries = Object.entries(data) + .map(([key, { annotation }]) => { + const comment = annotation ? ` /** ${annotation} */\n` : ''; + return `${comment} ${key} = '${key}'`; + }) + .join(',\n'); + + // Create the new enum content + const enumContent = `export enum DICT_TYPE {\n${enumEntries}\n}\n`; + console.log(`sharedPath: ${sharedPath}`); + + // Write the new content to shared.ts + fs.writeFileSync(sharedPath, enumContent); + } + }, + }; +} export default defineConfig(async () => { return { application: {}, - plugins: [ - AutoImport({ - // 自动导入 Vue 相关函数,如:ref, reactive, toRef 等 - imports: ['vue'], - include: [ - /\.[tj]sx?$/, - /\.vue$/, - /\.vue\?vue/, - ], - resolvers: [ - // // 自动导入 Element Plus 相关函数,如:ElMessage, ElMessageBox... (带样式) - // ElementPlusResolver(), - // // 自动导入图标组件 - // IconsResolver({}) - ], - vueTemplate: true, // 是否在 vue 模板中自动导入 - dts: true // (false) 配置文件生成位置,默认是根目录 /auto-imports.d.ts - }), - Components({ - dts: true, - resolvers: [ - AntDesignVueResolver({ - importStyle: false, // css in js - }), - ], - }), - lazyImport({ - resolvers: [ - VxeResolver({ - libraryName: 'vxe-table' - }), - ] - }) - ], + // plugins: [ + // { + // condition: true, + // plugins: async () => { + // return [await build()]; + // }, + // }, + // AutoImport({ + // // 自动导入 Vue 相关函数,如:ref, reactive, toRef 等 + // imports: ['vue'], + // include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/], + // resolvers: [ + // // // 自动导入 Element Plus 相关函数,如:ElMessage, ElMessageBox... (带样式) + // // ElementPlusResolver(), + // // // 自动导入图标组件 + // // IconsResolver({}) + // ], + // vueTemplate: true, // 是否在 vue 模板中自动导入 + // dts: true, // (false) 配置文件生成位置,默认是根目录 /auto-imports.d.ts + // }), + // Components({ + // dts: true, + // resolvers: [ + // AntDesignVueResolver({ + // importStyle: false, // css in js + // }), + // ], + // }), + // lazyImport({ + // resolvers: [ + // VxeResolver({ + // libraryName: 'vxe-table', + // }), + // ], + // }), + // ], vite: { + plugins: [ + autoBuildDict(), + AutoImport({ + // 自动导入 Vue 相关函数,如:ref, reactive, toRef 等 + imports: ['vue'], + include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/], + resolvers: [ + ], + vueTemplate: true, // 是否在 vue 模板中自动导入 + dts: true, // (false) 配置文件生成位置,默认是根目录 /auto-imports.d.ts + }), + ], server: { host: '0.0.0.0', open: false, @@ -52,14 +109,14 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/app/, '/'), // target: `http://10.71.220.24:8083/rl`, - target: `http://192.168.147.164:8083/rl`, + target: `http://192.168.148.88:8083/rl`, ws: true, }, '/api/uc': { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/uc/, '/'), // target: `http://10.71.220.24:8082`, - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, '/api/czg/app': { @@ -73,7 +130,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/czg\/uc/, '/'), // mock代理目标地址 - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, '/api/zp/app': { @@ -87,7 +144,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/zp\/uc/, '/'), // mock代理目标地址 - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, '/api/xmh/app': { @@ -101,7 +158,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/xmh\/uc/, '/'), // mock代理目标地址 - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, }, diff --git a/apps/web-office/.env b/apps/web-office/.env index 0d46c537..e78f5685 100644 --- a/apps/web-office/.env +++ b/apps/web-office/.env @@ -2,4 +2,4 @@ VITE_APP_TITLE=ERP协同办公系统 # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 -VITE_APP_NAMESPACE=erp-office +VITE_APP_NAMESPACE=office diff --git a/apps/web-office/.env.development b/apps/web-office/.env.development index c138f482..1eae9e67 100644 --- a/apps/web-office/.env.development +++ b/apps/web-office/.env.development @@ -7,7 +7,7 @@ VITE_BASE=/ VITE_GLOB_API_URL=/api # 是否开启 Nitro Mock服务,true 为开启,false 为关闭 -VITE_NITRO_MOCK=true +VITE_NITRO_MOCK=false # 是否打开 devtools,true 为打开,false 为关闭 VITE_DEVTOOLS=false diff --git a/apps/web-office/.env.production b/apps/web-office/.env.production index 1c92699b..5993af93 100644 --- a/apps/web-office/.env.production +++ b/apps/web-office/.env.production @@ -14,3 +14,6 @@ VITE_ROUTER_HISTORY=history # 是否注入全局loading VITE_INJECT_APP_LOADING=true + +# 打包后是否生成dist.zip +VITE_ARCHIVER=true diff --git a/apps/web-office/package.json b/apps/web-office/package.json index e5a22cff..726d76ea 100644 --- a/apps/web-office/package.json +++ b/apps/web-office/package.json @@ -17,10 +17,11 @@ "type": "module", "scripts": { "build": "pnpm vite build --mode production", + "build:dev": "pnpm vite build --mode development", "build:analyze": "pnpm vite build --mode analyze", "dev": "pnpm vite --mode development", "dev:prod": "pnpm vite --mode production", - "preview": "vite preview", + "preview": "vite preview --port 4173", "typecheck": "vue-tsc --noEmit --skipLibCheck" }, "imports": { diff --git a/apps/web-office/src/api/request/config.ts b/apps/web-office/src/api/request/config.ts index 6577a11e..50e70181 100644 --- a/apps/web-office/src/api/request/config.ts +++ b/apps/web-office/src/api/request/config.ts @@ -10,7 +10,7 @@ export const ACCESS_TOKEN_FIELD = 'Token' * 适用于同时连接多个后端功能开发,通过设置 proxy_type 值实现‘非重启更新’连接的后端 */ export function getBaseURL(): string { - if (import.meta.env.DEV) { + if (import.meta.env.MODE === 'development') { const proxyType = localStorage.getItem('@@@proxy_type') || ''; // return BASE_URL + "/zzz" return BASE_URL + proxyType diff --git a/apps/web-office/src/layouts/basic.vue b/apps/web-office/src/layouts/basic.vue index 566ed063..49f03dae 100644 --- a/apps/web-office/src/layouts/basic.vue +++ b/apps/web-office/src/layouts/basic.vue @@ -102,7 +102,7 @@ function handleViewAll() { router.push("/user/todo"); } -const isDev = import.meta.env.DEV; +const isDev = import.meta.env.MODE === 'development'; const value = ref(localStorage.getItem("@@@proxy_type") || ""); // /zp function handleMenuClick(e) { console.log(e); @@ -111,6 +111,7 @@ function handleMenuClick(e) { } else { localStorage.setItem("@@@proxy_type", "/" + e.key); } + location.reload() } diff --git a/apps/web-office/src/preferences.ts b/apps/web-office/src/preferences.ts index 63edb3a9..baf82be0 100644 --- a/apps/web-office/src/preferences.ts +++ b/apps/web-office/src/preferences.ts @@ -8,5 +8,6 @@ export const overridesPreferences = defineOverridesPreferences({ // overrides app: { name: import.meta.env.VITE_APP_TITLE, + authPageLayout: 'panel-center', }, }); diff --git a/apps/web-office/src/views/_core/authentication/login.vue b/apps/web-office/src/views/_core/authentication/login.vue index 252a7b96..f0074fe4 100644 --- a/apps/web-office/src/views/_core/authentication/login.vue +++ b/apps/web-office/src/views/_core/authentication/login.vue @@ -68,7 +68,7 @@ const formSchema = computed((): VbenFormSchema[] => { ]; }); -const isDev = import.meta.env.DEV; +const isDev = import.meta.env.MODE === 'development'; function mockLogin(username: string, password: string, isSkip: boolean = true) { authStore.authLogin({ username, diff --git a/apps/web-office/src/views/meeting/start/index.vue b/apps/web-office/src/views/meeting/start/index.vue index b610d571..a777d001 100644 --- a/apps/web-office/src/views/meeting/start/index.vue +++ b/apps/web-office/src/views/meeting/start/index.vue @@ -72,7 +72,9 @@ async function loadAddressorData() { .then(async (res: any) => { for (const item of res.rows) { - item.fileUuidArr = item.fileUuid.split(","); + if(item.fileUuid){ + item.fileUuidArr = item.fileUuid.split(","); + } } addressorData.value = res.rows; @@ -257,7 +259,7 @@ function downloadFile(fileUrl) {
预计发言 {{ addressorData.length }} 个单位
-
    +
    • {{ speaker.addressor.substring(0, 1) }} @@ -366,15 +368,15 @@ function downloadFile(fileUrl) { } .speaker-info:hover { - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + box-shadow: 0 4px 8px rgb(0 0 0 / 10%); } .content-area { - min-height: 150px; - background: #f9fafb; display: flex; align-items: center; justify-content: center; + min-height: 150px; font-size: 1.1em; + background: #f9fafb; } diff --git a/apps/web-office/vite.config.mts b/apps/web-office/vite.config.mts index cb0687db..8bd81f18 100644 --- a/apps/web-office/vite.config.mts +++ b/apps/web-office/vite.config.mts @@ -46,20 +46,20 @@ export default defineConfig(async () => { server: { host: '0.0.0.0', open: false, - port: 9528, + port: 9529, proxy: { '/api/app': { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/app/, '/'), // target: `http://10.71.220.24:8083/rl`, - target: `http://192.168.147.164:8083/rl`, + target: `http://192.168.148.88:8083/rl`, ws: true, }, '/api/uc': { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/uc/, '/'), // target: `http://10.71.220.24:8082`, - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, '/api/czg/app': { @@ -73,7 +73,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/czg\/uc/, '/'), // mock代理目标地址 - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, '/api/zp/app': { @@ -87,7 +87,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/zp\/uc/, '/'), // mock代理目标地址 - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, '/api/xmh/app': { @@ -101,7 +101,7 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/xmh\/uc/, '/'), // mock代理目标地址 - target: `http://192.168.147.164:8082`, + target: `http://192.168.148.88:8082`, ws: true, }, }, diff --git a/internal/common-utils/build.config.ts b/internal/common-utils/build.config.ts new file mode 100644 index 00000000..97e572c5 --- /dev/null +++ b/internal/common-utils/build.config.ts @@ -0,0 +1,7 @@ +import { defineBuildConfig } from 'unbuild'; + +export default defineBuildConfig({ + clean: true, + declaration: true, + entries: ['src/index'], +}); diff --git a/internal/common-utils/package.json b/internal/common-utils/package.json new file mode 100644 index 00000000..8543341a --- /dev/null +++ b/internal/common-utils/package.json @@ -0,0 +1,35 @@ +{ + "name": "pansoft-utils", + "version": "1.0.0", + "private": true, + "type": "module", + "scripts": { + "stub": "pnpm unbuild --stub" + }, + "files": [ + "dist" + ], + "main": "./dist/index.mjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "./dist/*", + "./*" + ] + } + }, + "exports": { + ".": { + "types": "./src/index.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "./*": "./*" + }, + "dependencies": { + "dayjs": "^1.11.13" + }, + "devDependencies": {} +} diff --git a/internal/common-utils/src/index.ts b/internal/common-utils/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/internal/common-utils/src/store/auth.ts b/internal/common-utils/src/store/auth.ts new file mode 100644 index 00000000..e69de29b diff --git a/internal/common-utils/src/store/dict.ts b/internal/common-utils/src/store/dict.ts new file mode 100644 index 00000000..e69de29b diff --git a/internal/common-utils/tsconfig.json b/internal/common-utils/tsconfig.json new file mode 100644 index 00000000..b2ec3b61 --- /dev/null +++ b/internal/common-utils/tsconfig.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@vben/tsconfig/node.json", + "include": ["src"], + "exclude": ["node_modules"] +} diff --git a/package.json b/package.json index 259f1e33..62b7f44e 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "commit": "czg", "dev": "turbo-run dev", "dev:office": "pnpm -F web-office run dev", + "dev:contract": "pnpm -F web-contract run dev", "dev:antd": "pnpm -F @vben/web-antd run dev", "dev:docs": "pnpm -F @vben/docs run dev", "dev:ele": "pnpm -F @vben/web-ele run dev", @@ -55,6 +56,8 @@ "preinstall": "npx only-allow pnpm", "prepare": "is-ci || husky", "preview": "turbo-run preview", + "preview:office": "turbo-run preview --port 4173", + "preview:contract": "turbo-run preview --port 4174", "publint": "vsh publint", "reinstall": "pnpm clean --del-lock && pnpm bootstrap", "test:unit": "vitest", diff --git a/packages/preferences/src/index.ts b/packages/preferences/src/index.ts index f4156250..66d5bf18 100644 --- a/packages/preferences/src/index.ts +++ b/packages/preferences/src/index.ts @@ -1,6 +1,28 @@ import type { Preferences } from '@vben-core/preferences'; import type { DeepPartial } from '@vben-core/typings'; +function isObject(item) { + return item && typeof item === 'object' && !Array.isArray(item); +} + +function mergeDeep(target, source) { + if (!isObject(target) || !isObject(source)) { + return source; + } + + for (const key in source) { + if (isObject(source[key])) { + if (!target[key]) { + Object.assign(target, { [key]: {} }); + } + mergeDeep(target[key], source[key]); + } else { + Object.assign(target, { [key]: source[key] }); + } + } + return target; +} + /** * 如果你想所有的app都使用相同的默认偏好设置,你可以在这里定义 * 而不是去修改 @vben-core/preferences 中的默认偏好设置 @@ -9,31 +31,7 @@ import type { DeepPartial } from '@vben-core/typings'; */ function defineOverridesPreferences(preferences: DeepPartial) { - preferences = { - app: { - accessMode: 'frontend', - // authPageLayout: 'panel-center', - colorGrayMode: false, - colorWeakMode: false, - compact: false, - contentCompact: 'wide', - defaultAvatar: '', - dynamicTitle: true, - // 是否开启检查更新 - enableCheckUpdates: true, - // 检查更新的时间间隔,单位为分钟 - checkUpdatesInterval: 1, - // 开启布局设置按钮 - enablePreferences: false, - enableRefreshToken: false, - isMobile: false, - layout: 'sidebar-nav', - locale: 'zh-CN', - loginExpiredMode: 'page', - name: 'ERP协同办公系统', - preferencesButtonPosition: 'auto', - watermark: false, - }, + return mergeDeep(preferences, { theme: { mode: 'light', builtinType: 'custom', @@ -61,8 +59,7 @@ function defineOverridesPreferences(preferences: DeepPartial) { languageToggle: false, themeToggle: false, }, - }; - return preferences; + }); } export { defineOverridesPreferences }; diff --git a/vben-admin.code-workspace b/vben-admin.code-workspace index be9262c6..565c65c1 100644 --- a/vben-admin.code-workspace +++ b/vben-admin.code-workspace @@ -12,6 +12,10 @@ "name": "web-office", "path": "apps/web-office", }, + { + "name": "pansoft-utils", + "path": "internal/common-utils", + }, { "name": "@vben/commitlint-config", "path": "internal/lint-configs/commitlint-config",