数据库乱搞,定制方案字典本地代码化

This commit is contained in:
aixianling
2023-03-23 11:29:50 +08:00
parent d2a2f5d702
commit c02b19f3eb
2 changed files with 12 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ export default {
default: () => [
{prop: 'label', label: "应用名称"},
{prop: 'project', label: "项目/框架"},
{prop: 'category', label: "分类", dict: "appsCategory"},
{prop: 'category', label: "分类"},
{prop: 'name', label: "模块名"},
]
},
@@ -87,7 +87,7 @@ export default {
const {page, search, action, meta, searchKey, dict, customData} = this
if (meta.length > 0 || customData) {
const reg = new RegExp(search[searchKey])
this.handleTableData(meta.filter(e => reg.test(e.label) || reg.test(e.name) || reg.test(dict.getLabel('appsCategory', e.category))))
this.handleTableData(meta.filter(e => reg.test(e.label) || reg.test(e.name) || reg.test(e.category)))
} else this.instance?.post(action, null, {
params: {...page, ...search}
}).then(res => {
@@ -143,7 +143,6 @@ export default {
}
},
created() {
this.dict.load('appsCategory')
this.$set(this.search, this.searchKey, "")
this.getTableData()
}

View File

@@ -24,7 +24,16 @@ export default {
}
},
created() {
this.dict.load('yesOrNo', 'systemType', 'appsCategory')
this.dict.setStorage([{
key: "systemType",
name: "系统类型",
values: [
{dictValue: "web", dictName: "web端"},
{dictValue: "mp", dictName: "小程序"},
{dictValue: "h5", dictName: "移动端H5"},
]
}])
this.dict.load('yesOrNo')
}
}
</script>