|
|
@ -91,7 +91,7 @@ |
|
|
|
<el-button type="primary" class="btn" @click="addRow">添加</el-button> |
|
|
|
<el-button type="danger" class="btn" @click="deleteRow">删除</el-button> |
|
|
|
</div> |
|
|
|
<el-table :data="extendTable" border @selection-change="handleSelectionChange"> |
|
|
|
<el-table max-height="400px" :data="extendTable" border @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="50" align="center"></el-table-column> |
|
|
|
<el-table-column prop="field" label="字段名称"> |
|
|
|
<template slot-scope="scope"> |
|
|
@ -146,6 +146,23 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="字段配置" name="3"> |
|
|
|
<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> |
|
|
|
<el-table-column prop="fieldName" label="字段别名"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.fieldName"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="fieldType" label="字段类型"> </el-table-column> |
|
|
|
<el-table-column prop="isShow" label="是否支持查询" width="50"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-checkbox v-model="scope.row.isShow" :true-label="1" :false-label="0"></el-checkbox> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
@ -199,7 +216,8 @@ import { |
|
|
|
saveOrUpdateLayerApi, |
|
|
|
getLayerListApi, |
|
|
|
deleteLayerApi, |
|
|
|
getDirectoryByIdApi |
|
|
|
getDirectoryByIdApi, |
|
|
|
queryServiceInfoApi |
|
|
|
} from '@/api/aiSupervision/layerConfigApi.js'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
@ -255,7 +273,8 @@ export default { |
|
|
|
styleDialogVisible: false, //是否显示样式选择对话框 |
|
|
|
activeName: '1', |
|
|
|
extendTable: [], |
|
|
|
multipleSelection: [] |
|
|
|
multipleSelection: [], |
|
|
|
fieldsTable: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -266,6 +285,21 @@ export default { |
|
|
|
if (val === false) { |
|
|
|
this.initData(); |
|
|
|
} |
|
|
|
}, |
|
|
|
'editDataInfoForm.serviceUrl'(val) { |
|
|
|
if (val && this.fieldsTable.length === 0) { |
|
|
|
queryServiceInfoApi(val).then((res) => { |
|
|
|
this.fieldsTable = |
|
|
|
res?.fields?.map((item) => { |
|
|
|
return { |
|
|
|
field: item.name, |
|
|
|
fieldName: item.alias, |
|
|
|
fieldType: item.type, |
|
|
|
isShow: 0 |
|
|
|
}; |
|
|
|
}) || []; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -292,6 +326,7 @@ export default { |
|
|
|
this.editDataInfoForm.relationStyleId = row.relationStyleId; |
|
|
|
this.editDataInfoForm.relationStyleName = row.relationStyleName; |
|
|
|
this.extendTable = (row.extendData && JSON.parse(row.extendData)) || []; |
|
|
|
this.fieldsTable = row?.fields || []; |
|
|
|
this.dialogTitle = '编辑图层'; |
|
|
|
this.dialogFormVisible = true; |
|
|
|
}, |
|
|
@ -349,11 +384,14 @@ export default { |
|
|
|
} |
|
|
|
const params = { |
|
|
|
...this.editDataInfoForm, |
|
|
|
extendData: JSON.stringify(this.extendTable) |
|
|
|
extendData: JSON.stringify(this.extendTable), |
|
|
|
fields: this.fieldsTable |
|
|
|
}; |
|
|
|
await saveOrUpdateLayerApi(params); |
|
|
|
this.getLayerList(); |
|
|
|
this.dialogFormVisible = false; |
|
|
|
this.fieldsTable = []; |
|
|
|
this.extendTable = []; |
|
|
|
}, |
|
|
|
handleLayerStyleTypeChange() { |
|
|
|
this.styleDialogVisible = true; |
|
|
|