|
@@ -253,6 +253,10 @@ export default {
|
|
type: [Array, Object],
|
|
type: [Array, Object],
|
|
default: null
|
|
default: null
|
|
},
|
|
},
|
|
|
|
+ dataSetList:{
|
|
|
|
+ type:[Array, Object],
|
|
|
|
+ default:()=>[]
|
|
|
|
+ },
|
|
appCode: {
|
|
appCode: {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
@@ -299,6 +303,11 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed:{
|
|
|
|
+ allType(){
|
|
|
|
+ return this.datasetTypeList.map(item=>item.datasetType).filter(item=>item!='')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
datasetType (value) {
|
|
datasetType (value) {
|
|
if (value === null) {
|
|
if (value === null) {
|
|
@@ -455,21 +464,30 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.current = 1
|
|
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) {
|
|
if (window.BS_CONFIG?.customDatasetComponents && window.BS_CONFIG?.customDatasetComponents.length > 0) {
|
|
// 将获得到的远程数据集进行组装
|
|
// 将获得到的远程数据集进行组装
|
|
window.BS_CONFIG?.customDatasetComponents.forEach((item) => {
|
|
window.BS_CONFIG?.customDatasetComponents.forEach((item) => {
|
|
this.datasetTypeList.push({ name: item.config.name, datasetType: item.config.datasetType, componentName: item.config.componentName })
|
|
this.datasetTypeList.push({ name: item.config.name, datasetType: item.config.datasetType, componentName: item.config.componentName })
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ this.getDataList()
|
|
},
|
|
},
|
|
// 新增数据集
|
|
// 新增数据集
|
|
addDataset () {
|
|
addDataset () {
|
|
@@ -487,7 +505,8 @@ export default {
|
|
current: this.current,
|
|
current: this.current,
|
|
size: this.size,
|
|
size: this.size,
|
|
moduleCode: this.appCode,
|
|
moduleCode: this.appCode,
|
|
- ...this.queryForm
|
|
|
|
|
|
+ ...this.queryForm,
|
|
|
|
+ datasetType:this.queryForm.datasetType===''?[...this.allType]:[this.queryForm.datasetType]
|
|
}).then((data) => {
|
|
}).then((data) => {
|
|
this.tableData = data.list
|
|
this.tableData = data.list
|
|
if (this.isDialog) {
|
|
if (this.isDialog) {
|