From ac0b790363a71d5b2b9433db784e7a95940647df Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Mon, 22 Dec 2025 14:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B5=84=E4=BA=A7=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=92=8C=E5=88=86=E7=B1=BB=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD,=E5=AE=8C=E5=96=84=E8=99=9A=E6=8B=9F=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/assets/category/index.ts | 8 + .../assets/asset/component/editAsset.vue | 67 +++- .../category/component/editCategory.vue | 368 +++++++++++++----- 3 files changed, 334 insertions(+), 109 deletions(-) diff --git a/src/api/assets/category/index.ts b/src/api/assets/category/index.ts index f9f491b..b8f7316 100644 --- a/src/api/assets/category/index.ts +++ b/src/api/assets/category/index.ts @@ -20,6 +20,14 @@ export function getCategory(id: string) { }); } +// 获取属性类型选项 +export function getCategoryAttrTypeOptions() { + return newService({ + url: '/assets/category/getCategoryAttrTypeOptions', + method: 'get', + }); +} + // 新增分类 export function addCategory(data: object) { return newService({ diff --git a/src/views/assets/asset/component/editAsset.vue b/src/views/assets/asset/component/editAsset.vue index 196b422..b929a98 100644 --- a/src/views/assets/asset/component/editAsset.vue +++ b/src/views/assets/asset/component/editAsset.vue @@ -215,8 +215,42 @@ 虚拟资产配置 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -275,8 +309,12 @@
- - + + + + + + @@ -330,6 +368,7 @@ interface TimeSlot { } interface Exception { + exceptionType: 'date' | 'dayOfWeek'; date: string; status: number; reason: string; @@ -360,7 +399,10 @@ interface RuleForm { }; }; virtualAssetConfig: { - virtualAssetId: string; + method: string; + requestURL: string; + authType: string; + authConfig: string; }; serviceAssetConfig: { schedule: { @@ -424,7 +466,10 @@ const getInitialForm = (): RuleForm => ({ }, }, virtualAssetConfig: { - virtualAssetId: '', + method: 'GET', + requestURL: '', + authType: 'none', + authConfig: '', }, serviceAssetConfig: { schedule: { @@ -490,6 +535,7 @@ const removeTimeSlot = (index: number) => { // 例外日期操作 const addException = () => { ruleForm.serviceAssetConfig.schedule.exceptions.push({ + exceptionType: 'date', date: '', status: 1, reason: '', @@ -501,6 +547,15 @@ const removeException = (index: number) => { ruleForm.serviceAssetConfig.schedule.exceptions.splice(index, 1); }; +// 例外类型切换时清空对应字段 +const onExceptionTypeChange = (exc: Exception) => { + if (exc.exceptionType === 'date') { + exc.dayOfWeek = ''; + } else { + exc.date = ''; + } +}; + // 重置表单 const resetForm = () => { const initial = getInitialForm(); diff --git a/src/views/assets/category/component/editCategory.vue b/src/views/assets/category/component/editCategory.vue index 390f850..0f9ae7a 100644 --- a/src/views/assets/category/component/editCategory.vue +++ b/src/views/assets/category/component/editCategory.vue @@ -1,6 +1,6 @@