|
|
@ -146,7 +146,14 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="字段配置" name="3"> |
|
|
|
<el-tab-pane label="字段配置" v-if="showFieldExtend()" name="3"> |
|
|
|
<div class="field-box"> |
|
|
|
<div class="field-filter"> |
|
|
|
<el-input class="keyword-input" placeholder="请输入搜索字段" v-model="fieldValue" clearable> |
|
|
|
</el-input> |
|
|
|
<el-button class="search-btn">搜索</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table max-height="400px" :data="fieldsTable" border> |
|
|
|
<el-table-column type="index" width="50" align="center"></el-table-column> |
|
|
|
<el-table-column prop="field" label="字段名称"> </el-table-column> |
|
|
@ -156,7 +163,7 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="fieldType" label="字段类型"> </el-table-column> |
|
|
|
<el-table-column prop="isShow" label="是否支持查询" width="50"> |
|
|
|
<el-table-column prop="isShow" label="支持查询" width="80" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-checkbox v-model="scope.row.isShow" :true-label="1" :false-label="0"></el-checkbox> |
|
|
|
</template> |
|
|
@ -276,13 +283,17 @@ export default { |
|
|
|
multipleSelection: [], |
|
|
|
activeFields: [], |
|
|
|
fieldsTable: [], |
|
|
|
queryServiceUrlMap: new Map() |
|
|
|
queryServiceUrlMap: new Map(), |
|
|
|
fieldValue: '' |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
keyword() { |
|
|
|
this.debouncedGetLayerList(); |
|
|
|
}, |
|
|
|
fieldValue() { |
|
|
|
this.searchField(); |
|
|
|
}, |
|
|
|
dialogFormVisible(val) { |
|
|
|
if (val === false) { |
|
|
|
this.initData(); |
|
|
@ -291,21 +302,12 @@ export default { |
|
|
|
'editDataInfoForm.serviceUrl'(val) { |
|
|
|
if (val) { |
|
|
|
if (!this.queryServiceUrlMap.has(val)) { |
|
|
|
queryServiceInfoApi(val).then((res) => { |
|
|
|
this.fieldsTable = |
|
|
|
res?.fields?.map((item) => { |
|
|
|
return { |
|
|
|
field: item.name, |
|
|
|
fieldName: item.alias, |
|
|
|
fieldType: item.type, |
|
|
|
isShow: this.activeFields.includes(item.name) ? 1 : 0 |
|
|
|
}; |
|
|
|
}) || []; |
|
|
|
this.queryServiceUrlMap.set(val, this.fieldsTable); |
|
|
|
}); |
|
|
|
this.queryLayerByUrl(val); |
|
|
|
} else { |
|
|
|
this.fieldsTable = this.queryServiceUrlMap.get(val); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.fieldsTable = []; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -320,6 +322,13 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
searchField() { |
|
|
|
if (this.fieldValue === '') { |
|
|
|
this.fieldsTable = this.queryServiceUrlMap.get(this.editDataInfoForm.serviceUrl); |
|
|
|
} else { |
|
|
|
this.fieldsTable = this.fieldsTable.filter((item) => item.field.includes(this.fieldValue)); |
|
|
|
} |
|
|
|
}, |
|
|
|
goBack() { |
|
|
|
this.$router.go(-1); |
|
|
|
}, |
|
|
@ -489,6 +498,29 @@ export default { |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
this.multipleSelection = val; |
|
|
|
}, |
|
|
|
showFieldExtend() { |
|
|
|
return ['021102', '081100', '030300'].includes(this.editDataInfoForm.serviceType); |
|
|
|
}, |
|
|
|
queryLayerByUrl(url) { |
|
|
|
queryServiceInfoApi(url, { |
|
|
|
type: this.editDataInfoForm.serviceType, |
|
|
|
url: url, |
|
|
|
index: this.editDataInfoForm.serviceIndex, |
|
|
|
name: this.editDataInfoForm.serviceName, |
|
|
|
alias: this.editDataInfoForm.serviceNameAlias |
|
|
|
}).then((res) => { |
|
|
|
this.fieldsTable = |
|
|
|
res?.fields?.map((item) => { |
|
|
|
return { |
|
|
|
field: item.name, |
|
|
|
fieldName: item.alias, |
|
|
|
fieldType: item.type, |
|
|
|
isShow: this.activeFields.includes(item.name) ? 1 : 0 |
|
|
|
}; |
|
|
|
}) || []; |
|
|
|
this.queryServiceUrlMap.set(url, this.fieldsTable); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
@ -588,6 +620,26 @@ header { |
|
|
|
} |
|
|
|
} |
|
|
|
.el-dialog { |
|
|
|
.field-box { |
|
|
|
display: flex; |
|
|
|
justify-content: end; |
|
|
|
.field-filter { |
|
|
|
width: 400px; |
|
|
|
margin-bottom: 16px; |
|
|
|
display: flex; |
|
|
|
border-radius: 4px; |
|
|
|
border: 1px solid #d9d9d9; |
|
|
|
|
|
|
|
::v-deep .el-input__inner { |
|
|
|
border: none; |
|
|
|
} |
|
|
|
.search-btn { |
|
|
|
border: none; |
|
|
|
border-radius: 0px; |
|
|
|
border-left: 1px solid #d9d9d9; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.fn-btns { |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|