From 233afab63fceee850cb0fdd4ae390634404bda22 Mon Sep 17 00:00:00 2001 From: "liu.tao3" Date: Fri, 7 Jul 2023 15:29:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/DataSetManagement/src/index.vue | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/data-room-ui/packages/DataSetManagement/src/index.vue b/data-room-ui/packages/DataSetManagement/src/index.vue index db566f7f..a0c8b3e4 100644 --- a/data-room-ui/packages/DataSetManagement/src/index.vue +++ b/data-room-ui/packages/DataSetManagement/src/index.vue @@ -253,6 +253,10 @@ export default { type: [Array, Object], default: null }, + dataSetList:{ + type:[Array, Object], + default:()=>[] + }, appCode: { type: String, default: '' @@ -299,6 +303,11 @@ export default { } } }, + computed:{ + allType(){ + return this.datasetTypeList.map(item=>item.datasetType).filter(item=>item!='') + } + }, watch: { datasetType (value) { if (value === null) { @@ -455,21 +464,30 @@ export default { } } this.current = 1 - this.getDataList() - this.datasetTypeList = [ - { name: '全部', datasetType: '' }, - { name: '原始数据集', datasetType: 'original', componentName: 'OriginalEditForm' }, - { name: '自助数据集', datasetType: 'custom', componentName: 'CustomEditForm' }, - { name: '存储过程数据集', datasetType: 'storedProcedure', componentName: 'StoredProcedureEditForm' }, - { name: 'JSON数据集', datasetType: 'json', componentName: 'JsonEditForm' }, - { name: '脚本数据集', datasetType: 'script', componentName: 'ScriptEditForm' } - ] + const list=[ + { name: '全部', datasetType: '' }, + { name: '原始数据集', datasetType: 'original', componentName: 'OriginalEditForm' }, + { name: '自助数据集', datasetType: 'custom', componentName: 'CustomEditForm' }, + { name: '存储过程数据集', datasetType: 'storedProcedure', componentName: 'StoredProcedureEditForm' }, + { name: 'JSON数据集', datasetType: 'json', componentName: 'JsonEditForm' }, + { name: '脚本数据集', datasetType: 'script', componentName: 'ScriptEditForm' }, + { name: 'JS数据集', datasetType: 'js', componentName: 'JsDataSet' } + ] + if(this.dataSetList.length!=0){ + this.datasetTypeList=[{ name: '全部', datasetType: '' },...list.filter(item=>this.dataSetList.findIndex(x=>x===item.datasetType)!==-1)] + }else{ + this.datasetTypeList = [ + ...list + ] + } + if (window.BS_CONFIG?.customDatasetComponents && window.BS_CONFIG?.customDatasetComponents.length > 0) { // 将获得到的远程数据集进行组装 window.BS_CONFIG?.customDatasetComponents.forEach((item) => { this.datasetTypeList.push({ name: item.config.name, datasetType: item.config.datasetType, componentName: item.config.componentName }) }) } + this.getDataList() }, // 新增数据集 addDataset () { @@ -487,7 +505,8 @@ export default { current: this.current, size: this.size, moduleCode: this.appCode, - ...this.queryForm + ...this.queryForm, + datasetType:this.queryForm.datasetType===''?[...this.allType]:[this.queryForm.datasetType] }).then((data) => { this.tableData = data.list if (this.isDialog) {