添加应用分类字典,增加定制方案应用概览

This commit is contained in:
aixianling
2022-07-13 10:48:15 +08:00
parent 031faeff50
commit 53bf46fac5
3 changed files with 67 additions and 42 deletions

View File

@@ -10,7 +10,7 @@
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :colConfigs="columns"
:size.sync="page.size" border @getList="getTableData" tableSize="mini">
:size.sync="page.size" border @getList="getTableData" tableSize="mini" :dict="dict">
<el-table-column slot="chb" width="100px">
<template #header>
<el-checkbox v-if="multiple" v-model="selectAll" @change="handleCheckAll"/>
@@ -40,7 +40,7 @@ export default {
default: () => [
{prop: 'label', label: "应用名称"},
{prop: 'project', label: "项目/框架"},
{prop: 'category', label: "分类"},
{prop: 'category', label: "分类", dict: "appsCategory"},
{prop: 'name', label: "模块名"},
]
},
@@ -116,6 +116,7 @@ export default {
}
},
created() {
this.dict.load('appsCategory')
this.$set(this.search, this.searchKey, "")
this.getTableData()
}

View File

@@ -24,7 +24,7 @@ export default {
}
},
created() {
this.dict.load('yesOrNo','systemType')
this.dict.load('yesOrNo', 'systemType', 'appsCategory')
}
}
</script>

View File

@@ -3,6 +3,8 @@
<ai-detail>
<ai-title slot="title" :title="pageTitle" isShowBottomBorder/>
<template #content>
<el-tabs tab-position="left">
<el-tab-pane label="方案设置">
<el-form ref="AddForm" :model="form" size="small" label-width="120px" :rules="rules">
<ai-card title="基本信息">
<template #content>
@@ -44,6 +46,11 @@
</template>
</ai-card>
</el-form>
</el-tab-pane>
<el-tab-pane label="方案应用" lazy>
<ai-table :tableData="appList" :colConfigs="colConfigs" :isShowPagination="false" :dict="dict"/>
</el-tab-pane>
</el-tabs>
</template>
<template #footer>
<el-button @click="back">取消</el-button>
@@ -67,6 +74,17 @@ export default {
computed: {
isEdit: v => !!v.$route.query.id,
pageTitle: v => v.isEdit ? "编辑定制方案" : "新增定制方案",
appList() {
return this.form.appList?.map(e => {
e.category = e.libPath.replace(/^\/[^\/]+\/([^\/]+)\/.+/, '$1')
if (/\/project\//.test(e.libPath)) {
e.project = e.libPath.replace(/.*project\/([^\/]+)\/.+/, '$1')
} else if (/\/core\//.test(e.libPath)) {
e.project = "core"
} else e.project = "standard"
return e
})
}
},
data() {
return {
@@ -77,6 +95,12 @@ export default {
customPath: {required: true, message: "请输入"},
extra: {required: true, message: "请设置主页配置"},
},
colConfigs: [
{prop: 'label', label: "应用名称"},
{prop: 'project', label: "项目/框架"},
{prop: 'category', label: "分类", dict: "appsCategory"},
{prop: 'name', label: "模块名"},
]
}
},
methods: {