|
|
@ -17,13 +17,23 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="middle"> |
|
|
|
<el-button type="primary" plain @click="dialogFormVisible = true">添加图层</el-button> |
|
|
|
<el-button type="primary" plain @click="dialogFormVisible = true" |
|
|
|
>添加图层</el-button |
|
|
|
> |
|
|
|
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible"> |
|
|
|
<el-tabs v-model="activeName" type="card"> |
|
|
|
<el-tab-pane label="基础字段" name="1"> |
|
|
|
<el-form :model="editDataInfoForm"> |
|
|
|
<el-form-item label="服务类型" style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-select style="width: 80%" v-model="editDataInfoForm.serviceType" placeholder="请选择"> |
|
|
|
<el-form-item |
|
|
|
label="服务类型" |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
style="width: 80%" |
|
|
|
v-model="editDataInfoForm.serviceType" |
|
|
|
placeholder="请选择" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in serviceTypeOptions" |
|
|
|
:key="item.value" |
|
|
@ -33,14 +43,38 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="服务名称" prop="serviceName" style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-input v-model.trim="editDataInfoForm.serviceName" style="width: 80%"></el-input> |
|
|
|
<el-form-item |
|
|
|
label="服务名称" |
|
|
|
prop="serviceName" |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-model.trim="editDataInfoForm.serviceName" |
|
|
|
style="width: 80%" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="服务别名" prop="serviceNameAlias" style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-input v-model.trim="editDataInfoForm.serviceNameAlias" style="width: 80%"></el-input> |
|
|
|
<el-form-item |
|
|
|
label="服务别名" |
|
|
|
prop="serviceNameAlias" |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-model.trim="editDataInfoForm.serviceNameAlias" |
|
|
|
style="width: 80%" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="服务地址" prop="serviceUrl" style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-input v-model.trim="editDataInfoForm.serviceUrl" style="width: 80%"></el-input> |
|
|
|
<el-form-item |
|
|
|
label="服务地址" |
|
|
|
prop="serviceUrl" |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-model.trim="editDataInfoForm.serviceUrl" |
|
|
|
style="width: 80%" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
v-if="editDataInfoForm.serviceType === '030300'" |
|
|
@ -49,7 +83,10 @@ |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<el-input v-model="editDataInfoForm.serviceIndex" style="width: 80%"></el-input> |
|
|
|
<el-input |
|
|
|
v-model="editDataInfoForm.serviceIndex" |
|
|
|
style="width: 80%" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
v-show="['030300'].includes(editDataInfoForm.serviceType)" |
|
|
@ -62,10 +99,16 @@ |
|
|
|
type="info" |
|
|
|
effect="plain" |
|
|
|
class="style-button" |
|
|
|
:class="{ 'style-button-none': editDataInfoForm.relationStyleName }" |
|
|
|
:class="{ |
|
|
|
'style-button-none': editDataInfoForm.relationStyleName, |
|
|
|
}" |
|
|
|
@click="handleLayerStyleTypeChange" |
|
|
|
> |
|
|
|
{{ editDataInfoForm.relationStyleName ? editDataInfoForm.relationStyleName : '点击选择样式' }} |
|
|
|
{{ |
|
|
|
editDataInfoForm.relationStyleName |
|
|
|
? editDataInfoForm.relationStyleName |
|
|
|
: "点击选择样式" |
|
|
|
}} |
|
|
|
</el-tag> |
|
|
|
<el-button |
|
|
|
style="margin-left: 15px" |
|
|
@ -88,24 +131,46 @@ |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="扩展字段" name="2"> |
|
|
|
<div class="fn-btns"> |
|
|
|
<el-button type="primary" class="btn" @click="addRow">添加</el-button> |
|
|
|
<el-button type="danger" class="btn" @click="deleteRow">删除</el-button> |
|
|
|
<el-button type="primary" class="btn" @click="addRow" |
|
|
|
>添加</el-button |
|
|
|
> |
|
|
|
<el-button type="danger" class="btn" @click="deleteRow" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<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 |
|
|
|
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"> |
|
|
|
<el-input v-model="scope.row.field" :disabled="!scope.row.isEdit"></el-input> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.field" |
|
|
|
:disabled="!scope.row.isEdit" |
|
|
|
></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="alias" label="别名"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.alias" :disabled="!scope.row.isEdit"></el-input> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.alias" |
|
|
|
:disabled="!scope.row.isEdit" |
|
|
|
></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="value" label="字段值"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.value" :disabled="!scope.row.isEdit"></el-input> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.value" |
|
|
|
:disabled="!scope.row.isEdit" |
|
|
|
></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="200"> |
|
|
@ -149,23 +214,43 @@ |
|
|
|
<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 |
|
|
|
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> |
|
|
|
<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="80" align="center"> |
|
|
|
<el-table-column prop="fieldType" label="字段类型"> |
|
|
|
</el-table-column> |
|
|
|
<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> |
|
|
|
<el-checkbox |
|
|
|
v-model="scope.row.isShow" |
|
|
|
:true-label="1" |
|
|
|
:false-label="0" |
|
|
|
></el-checkbox> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -174,11 +259,19 @@ |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveOrUpdateLayer">确 定</el-button> |
|
|
|
<el-button type="primary" @click="saveOrUpdateLayer" |
|
|
|
>确 定</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<div class="keyword-filter"> |
|
|
|
<el-input class="keyword-input" placeholder="请输入内容" v-model="keyword" clearable> </el-input> |
|
|
|
<el-input |
|
|
|
class="keyword-input" |
|
|
|
placeholder="请输入内容" |
|
|
|
v-model="keyword" |
|
|
|
clearable |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
<el-button class="search-btn">搜索</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -186,19 +279,33 @@ |
|
|
|
<el-table :data="tableData" stripe style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
:index="(index) => index + (pageOptions.pageNum - 1) * pageOptions.pageSize + 1" |
|
|
|
:index=" |
|
|
|
(index) => |
|
|
|
index + (pageOptions.pageNum - 1) * pageOptions.pageSize + 1 |
|
|
|
" |
|
|
|
label="序号" |
|
|
|
width="50" |
|
|
|
header-align="center" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column prop="id" label="图层资源目录编号" width="350"> </el-table-column> |
|
|
|
<el-table-column prop="serviceName" label="图层资源目录名称"> </el-table-column> |
|
|
|
<el-table-column prop="id" label="图层资源目录编号" width="350"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="serviceName" label="图层资源目录名称"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="pubDate" label="创建时间"> </el-table-column> |
|
|
|
<el-table-column prop="createUser" label="创建人"> </el-table-column> |
|
|
|
<el-table-column label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> |
|
|
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
@click="handleEdit(scope.$index, scope.row)" |
|
|
|
>编辑</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="danger" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -217,74 +324,74 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import debounce from 'lodash/debounce'; |
|
|
|
import styleListDialogVue from './styleListDialog.vue'; |
|
|
|
import debounce from "lodash/debounce"; |
|
|
|
import styleListDialogVue from "./styleListDialog.vue"; |
|
|
|
import { |
|
|
|
saveOrUpdateLayerApi, |
|
|
|
getLayerListApi, |
|
|
|
deleteLayerApi, |
|
|
|
getDirectoryByIdApi, |
|
|
|
queryServiceInfoApi |
|
|
|
} from '@/api/aiSupervision/layerConfigApi.js'; |
|
|
|
queryServiceInfoApi, |
|
|
|
} from "@/api/aiSupervision/layerConfigApi.js"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
styleListDialogVue |
|
|
|
styleListDialogVue, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableData: [], |
|
|
|
editDataInfoForm: { |
|
|
|
id: '', |
|
|
|
serviceType: '', //服务类型,wms/wmts/wfs/3d tiles/terrain |
|
|
|
serviceUrl: '', //服务地址 |
|
|
|
serviceName: '', //服务名称 |
|
|
|
serviceNameAlias: '', //服务别名 |
|
|
|
serviceIndex: '', //服务索引 |
|
|
|
dirId: '', |
|
|
|
dirNames: '', |
|
|
|
tileSize: '256', |
|
|
|
relationStyleId: '', |
|
|
|
relationStyleName: '' |
|
|
|
id: "", |
|
|
|
serviceType: "", //服务类型,wms/wmts/wfs/3d tiles/terrain |
|
|
|
serviceUrl: "", //服务地址 |
|
|
|
serviceName: "", //服务名称 |
|
|
|
serviceNameAlias: "", //服务别名 |
|
|
|
serviceIndex: "", //服务索引 |
|
|
|
dirId: "", |
|
|
|
dirNames: "", |
|
|
|
tileSize: "256", |
|
|
|
relationStyleId: "", |
|
|
|
relationStyleName: "", |
|
|
|
}, |
|
|
|
directoryInfo: null, // 目录信息 |
|
|
|
dialogTitle: '添加图层', |
|
|
|
dialogTitle: "添加图层", |
|
|
|
serviceTypeOptions: [ |
|
|
|
{ |
|
|
|
value: '021102', |
|
|
|
label: 'ArcGISRest图层' |
|
|
|
value: "021102", |
|
|
|
label: "ArcGISRest图层", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '081100', |
|
|
|
label: 'SuperMapRest图层' |
|
|
|
value: "081100", |
|
|
|
label: "SuperMapRest图层", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '030300', |
|
|
|
label: 'WFS200' |
|
|
|
value: "030300", |
|
|
|
label: "WFS200", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '080100', |
|
|
|
label: 'S3M图层' |
|
|
|
value: "080100", |
|
|
|
label: "S3M图层", |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '', |
|
|
|
label: 'XYZ底图' |
|
|
|
} |
|
|
|
value: "", |
|
|
|
label: "XYZ底图", |
|
|
|
}, |
|
|
|
], |
|
|
|
pageOptions: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 8, |
|
|
|
total: 0 |
|
|
|
total: 0, |
|
|
|
}, |
|
|
|
dialogFormVisible: false, //是否显示对话框 |
|
|
|
keyword: '', |
|
|
|
keyword: "", |
|
|
|
styleDialogVisible: false, //是否显示样式选择对话框 |
|
|
|
activeName: '1', |
|
|
|
activeName: "1", |
|
|
|
extendTable: [], |
|
|
|
multipleSelection: [], |
|
|
|
activeFields: [], |
|
|
|
fieldsTable: [], |
|
|
|
queryServiceUrlMap: new Map(), |
|
|
|
fieldValue: '' |
|
|
|
fieldValue: "", |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -299,7 +406,7 @@ export default { |
|
|
|
this.initData(); |
|
|
|
} |
|
|
|
}, |
|
|
|
'editDataInfoForm.serviceUrl'(val) { |
|
|
|
"editDataInfoForm.serviceUrl"(val) { |
|
|
|
if (val) { |
|
|
|
if (!this.queryServiceUrlMap.has(val)) { |
|
|
|
this.queryLayerByUrl(val); |
|
|
@ -309,7 +416,7 @@ export default { |
|
|
|
} else { |
|
|
|
this.fieldsTable = []; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 使用 lodash 的 debounce 函数创建防抖版本 |
|
|
@ -323,10 +430,14 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
searchField() { |
|
|
|
if (this.fieldValue === '') { |
|
|
|
this.fieldsTable = this.queryServiceUrlMap.get(this.editDataInfoForm.serviceUrl); |
|
|
|
if (this.fieldValue === "") { |
|
|
|
this.fieldsTable = this.queryServiceUrlMap.get( |
|
|
|
this.editDataInfoForm.serviceUrl |
|
|
|
); |
|
|
|
} else { |
|
|
|
this.fieldsTable = this.fieldsTable.filter((item) => item.field.includes(this.fieldValue)); |
|
|
|
this.fieldsTable = this.fieldsTable.filter((item) => |
|
|
|
item.field.includes(this.fieldValue) |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
goBack() { |
|
|
@ -343,30 +454,34 @@ export default { |
|
|
|
this.editDataInfoForm.relationStyleName = row.relationStyleName; |
|
|
|
this.extendTable = (row.extendData && JSON.parse(row.extendData)) || []; |
|
|
|
this.activeFields = row?.fields?.map((item) => item.field) || []; |
|
|
|
this.dialogTitle = '编辑图层'; |
|
|
|
this.dialogTitle = "编辑图层"; |
|
|
|
this.dialogFormVisible = true; |
|
|
|
}, |
|
|
|
|
|
|
|
handleDelete(row) { |
|
|
|
this.$confirm('删除图层将同时删除该图层资源以及关联的图层数据,删除后将不可恢复,是否继续删除?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
this.$confirm( |
|
|
|
"删除图层将同时删除该图层资源以及关联的图层数据,删除后将不可恢复,是否继续删除?", |
|
|
|
"提示", |
|
|
|
{ |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
} |
|
|
|
) |
|
|
|
.then(async () => { |
|
|
|
const res = await deleteLayerApi(row.id); |
|
|
|
if (res.success) { |
|
|
|
this.getLayerList(); |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '删除成功!' |
|
|
|
type: "success", |
|
|
|
message: "删除成功!", |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '已取消删除' |
|
|
|
type: "info", |
|
|
|
message: "已取消删除", |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
@ -377,12 +492,12 @@ export default { |
|
|
|
pageSize: this.pageOptions.pageSize, |
|
|
|
data: { |
|
|
|
serviceName: this.keyword, |
|
|
|
dirId: this.directoryInfo.id |
|
|
|
dirId: this.directoryInfo.id, |
|
|
|
}, |
|
|
|
params: { |
|
|
|
orderBy: 'pub_date', |
|
|
|
sortBy: 'asc' |
|
|
|
} |
|
|
|
orderBy: "pub_date", |
|
|
|
sortBy: "asc", |
|
|
|
}, |
|
|
|
}; |
|
|
|
getLayerListApi(params).then((res) => { |
|
|
|
this.pageOptions.total = res.total; |
|
|
@ -393,17 +508,21 @@ export default { |
|
|
|
const reg = /^(\w|[\u4e00-\u9fa5]){3,30}$/g; |
|
|
|
if (!reg.test(this.editDataInfoForm.serviceName)) { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '格式有误,目录名称仅支持中文、数字、字母、下划线,最大长度不超过30' |
|
|
|
type: "info", |
|
|
|
message: |
|
|
|
"格式有误,目录名称仅支持中文、数字、字母、下划线,最大长度不超过30", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
const params = { |
|
|
|
...this.editDataInfoForm, |
|
|
|
extendData: JSON.stringify(this.extendTable), |
|
|
|
fields: this.fieldsTable |
|
|
|
fields: this.fieldsTable, |
|
|
|
}; |
|
|
|
this.queryServiceUrlMap.set(this.editDataInfoForm.serviceUrl, this.fieldsTable); |
|
|
|
this.queryServiceUrlMap.set( |
|
|
|
this.editDataInfoForm.serviceUrl, |
|
|
|
this.fieldsTable |
|
|
|
); |
|
|
|
await saveOrUpdateLayerApi(params); |
|
|
|
this.getLayerList(); |
|
|
|
this.dialogFormVisible = false; |
|
|
@ -418,55 +537,57 @@ export default { |
|
|
|
this.editDataInfoForm.relationStyleName = val.name; |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
this.editDataInfoForm.id = ''; |
|
|
|
this.editDataInfoForm.serviceUrl = ''; |
|
|
|
this.editDataInfoForm.serviceName = ''; |
|
|
|
this.editDataInfoForm.serviceNameAlias = ''; |
|
|
|
this.editDataInfoForm.serviceIndex = ''; |
|
|
|
this.editDataInfoForm.relationStyleId = ''; |
|
|
|
this.editDataInfoForm.relationStyleName = ''; |
|
|
|
this.editDataInfoForm.id = ""; |
|
|
|
this.editDataInfoForm.serviceUrl = ""; |
|
|
|
this.editDataInfoForm.serviceName = ""; |
|
|
|
this.editDataInfoForm.serviceNameAlias = ""; |
|
|
|
this.editDataInfoForm.serviceIndex = ""; |
|
|
|
this.editDataInfoForm.relationStyleId = ""; |
|
|
|
this.editDataInfoForm.relationStyleName = ""; |
|
|
|
|
|
|
|
this.editDataInfoForm.serviceType = this.serviceTypeOptions[0].value; |
|
|
|
this.editDataInfoForm.dirId = this.directoryInfo.id; |
|
|
|
this.editDataInfoForm.dirNames = this.directoryInfo.name; |
|
|
|
this.editDataInfoForm.tileSize = '256'; |
|
|
|
this.dialogTitle = '添加图层'; |
|
|
|
this.editDataInfoForm.tileSize = "256"; |
|
|
|
this.dialogTitle = "添加图层"; |
|
|
|
}, |
|
|
|
addRow() { |
|
|
|
const editRow = this.extendTable.find((item) => item.isEdit); |
|
|
|
if (editRow) { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '请先保存当前编辑行' |
|
|
|
type: "info", |
|
|
|
message: "请先保存当前编辑行", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.extendTable.push({ |
|
|
|
id: '', |
|
|
|
field: '', |
|
|
|
alias: '', |
|
|
|
value: '', |
|
|
|
isEdit: true |
|
|
|
id: "", |
|
|
|
field: "", |
|
|
|
alias: "", |
|
|
|
value: "", |
|
|
|
isEdit: true, |
|
|
|
}); |
|
|
|
}, |
|
|
|
deleteRow(index) { |
|
|
|
this.$messageBox |
|
|
|
.confirm('是否删除该行数据?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
.confirm("是否删除该行数据?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
if (index !== undefined) { |
|
|
|
this.extendTable.splice(index, 1); |
|
|
|
} else { |
|
|
|
this.extendTable = this.extendTable.filter((item) => !this.multipleSelection.includes(item)); |
|
|
|
this.extendTable = this.extendTable.filter( |
|
|
|
(item) => !this.multipleSelection.includes(item) |
|
|
|
); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '已取消删除' |
|
|
|
type: "info", |
|
|
|
message: "已取消删除", |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
@ -486,11 +607,13 @@ export default { |
|
|
|
} |
|
|
|
// 表格名字校验不重复 |
|
|
|
const name = this.extendTable[index].field; |
|
|
|
const isRepeat = this.extendTable.some((item, i) => item.field === name && i !== index); |
|
|
|
const isRepeat = this.extendTable.some( |
|
|
|
(item, i) => item.field === name && i !== index |
|
|
|
); |
|
|
|
if (isRepeat) { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: '字段名称重复,请重新输入' |
|
|
|
type: "info", |
|
|
|
message: "字段名称重复,请重新输入", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
@ -500,7 +623,9 @@ export default { |
|
|
|
this.multipleSelection = val; |
|
|
|
}, |
|
|
|
showFieldExtend() { |
|
|
|
return ['021102', '081100', '030300'].includes(this.editDataInfoForm.serviceType); |
|
|
|
return ["021102", "081100", "030300"].includes( |
|
|
|
this.editDataInfoForm.serviceType |
|
|
|
); |
|
|
|
}, |
|
|
|
queryLayerByUrl(url) { |
|
|
|
queryServiceInfoApi(url, { |
|
|
@ -508,7 +633,7 @@ export default { |
|
|
|
url: url, |
|
|
|
index: this.editDataInfoForm.serviceIndex, |
|
|
|
name: this.editDataInfoForm.serviceName, |
|
|
|
alias: this.editDataInfoForm.serviceNameAlias |
|
|
|
alias: this.editDataInfoForm.serviceNameAlias, |
|
|
|
}).then((res) => { |
|
|
|
this.fieldsTable = |
|
|
|
res?.fields?.map((item) => { |
|
|
@ -516,13 +641,13 @@ export default { |
|
|
|
field: item.name, |
|
|
|
fieldName: item.alias, |
|
|
|
fieldType: item.type, |
|
|
|
isShow: this.activeFields.includes(item.name) ? 1 : 0 |
|
|
|
isShow: this.activeFields.includes(item.name) ? 1 : 0, |
|
|
|
}; |
|
|
|
}) || []; |
|
|
|
this.queryServiceUrlMap.set(url, this.fieldsTable); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
@ -622,7 +747,7 @@ header { |
|
|
|
.el-dialog { |
|
|
|
.field-box { |
|
|
|
display: flex; |
|
|
|
justify-content: end; |
|
|
|
justify-content: flex-end; |
|
|
|
.field-filter { |
|
|
|
width: 400px; |
|
|
|
margin-bottom: 16px; |
|
|
|