重构资产管理功能,优化虚拟资产和服务资产配置结构

This commit is contained in:
WUSIJIAN
2025-12-24 17:59:50 +08:00
parent f6a5313037
commit 36baecbee0
3 changed files with 420 additions and 178 deletions

View File

@@ -24,6 +24,7 @@
<div class="table-head">
<span class="col col-name">属性名称</span>
<span class="col col-type">属性类型</span>
<span class="col col-required">必填</span>
<span class="col col-dict">字典</span>
<span class="col col-dict-value">字典值</span>
<span class="col col-ops">操作</span>
@@ -49,6 +50,9 @@
/>
</el-select>
</div>
<div class="col col-required">
<el-switch v-model="attr.required" />
</div>
<div class="col col-dict">
<el-select
v-model="attr.name"
@@ -159,7 +163,6 @@ interface RuleForm {
parentId: string;
name: string;
sort: number;
status: string;
attrs: CustomAttr[];
}
@@ -181,7 +184,6 @@ const ruleForm = reactive<RuleForm>({
parentId: '',
name: '',
sort: 0,
status: 'enabled',
attrs: [],
});
@@ -252,6 +254,7 @@ const addAttr = () => {
ruleForm.attrs.push({
name: '',
type: 'text',
required: true,
options: [],
});
};
@@ -286,7 +289,6 @@ const resetForm = () => {
ruleForm.parentId = '';
ruleForm.name = '';
ruleForm.sort = 0;
ruleForm.status = 'enabled';
ruleForm.attrs = [];
};
@@ -309,7 +311,6 @@ const openDialog = (row?: CategoryRow | string, edit?: boolean) => {
ruleForm.parentId = data.parentId || '';
ruleForm.name = data.name || '';
ruleForm.sort = data.sort || 0;
ruleForm.status = data.status || 'enabled';
// 处理 attrs 中的 options 字段
ruleForm.attrs = (data.attrs || []).map((attr: any) => {
let options = attr.options;
@@ -453,7 +454,7 @@ defineExpose({
.table-head,
.table-row {
display: grid;
grid-template-columns: 1.4fr 1fr 1fr 1.4fr 60px;
grid-template-columns: 1.4fr 1fr 80px 1fr 1.4fr 60px;
align-items: center;
column-gap: 12px;
padding: 12px 16px;