diff --git a/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue b/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue index 5ce962fa..dc6bbaea 100644 --- a/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue +++ b/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue @@ -10,8 +10,8 @@ - + :size.sync="page.size" @getList="getTableData" tableSize="mini" :dict="dict" v-bind="$attrs"> + @@ -46,7 +46,9 @@ export default { }, nodeKey: {default: "id"}, searchKey: {default: "name"}, - multiple: Boolean + multiple: Boolean, + disabled: Boolean, + meta: {default: () => []} }, data() { return { @@ -73,25 +75,31 @@ export default { }, methods: { getTableData() { - let {page, search, action, nodeKey} = this - this.instance?.post(action, null, { + const {page, search, action, meta, searchKey, dict} = this + if (meta.length > 0) { + 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)))) + } else this.instance?.post(action, null, { params: {...page, ...search} }).then(res => { if (res?.data) { - const list = res.data.records || res.data || [] - list.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" - }) - this.tableData = list.map(e => ({...e, checked: this.selected.includes(e[nodeKey])})) this.page.total = res.data.total + this.handleTableData(res.data.records || res.data || []) } }) }, + handleTableData(list) { + const {nodeKey} = this + list.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" + }) + this.tableData = list.map(e => ({...e, checked: this.selected.includes(e[nodeKey])})) + }, handleCheck(row) { const {nodeKey} = this if (this.multiple) { diff --git a/project/oms/apps/develop/AppDeployCustom/add.vue b/project/oms/apps/develop/AppDeployCustom/add.vue index 4bb8ed3c..1d9a1472 100644 --- a/project/oms/apps/develop/AppDeployCustom/add.vue +++ b/project/oms/apps/develop/AppDeployCustom/add.vue @@ -34,7 +34,7 @@ @@ -48,7 +48,7 @@ - + @@ -95,12 +95,6 @@ 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: {