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 @@