|
|
@ -24,8 +24,12 @@ |
|
|
|
<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-option v-for="item in serviceTypeOptions" :key="item.value" :label="item.label" |
|
|
|
:value="item.value" /> |
|
|
|
<el-option |
|
|
|
v-for="item in serviceTypeOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
@ -41,29 +45,49 @@ |
|
|
|
<el-form-item label="服务token" prop="serviceToken" style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-input v-model.trim="editDataInfoForm.serviceToken" style="width: 80%"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="editDataInfoForm.serviceType === '030300'" label="服务索引" prop="serviceIndex" |
|
|
|
style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-form-item |
|
|
|
v-if="editDataInfoForm.serviceType === '030300'" |
|
|
|
label="服务索引" |
|
|
|
prop="serviceIndex" |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<el-input v-model="editDataInfoForm.serviceIndex" style="width: 80%"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-show="['030300'].includes(editDataInfoForm.serviceType)" label="样式选择" |
|
|
|
style="font-size: 1rem" :label-width="'120px'"> |
|
|
|
<el-form-item |
|
|
|
v-show="['030300'].includes(editDataInfoForm.serviceType)" |
|
|
|
label="样式选择" |
|
|
|
style="font-size: 1rem" |
|
|
|
:label-width="'120px'" |
|
|
|
> |
|
|
|
<div class="styleBtn"> |
|
|
|
<el-tag type="info" effect="plain" class="style-button" :class="{ |
|
|
|
'style-button-none': editDataInfoForm.relationStyleName, |
|
|
|
}" @click="handleLayerStyleTypeChange"> |
|
|
|
{{ |
|
|
|
editDataInfoForm.relationStyleName |
|
|
|
? editDataInfoForm.relationStyleName |
|
|
|
: "点击选择样式" |
|
|
|
}} |
|
|
|
<el-tag |
|
|
|
type="info" |
|
|
|
effect="plain" |
|
|
|
class="style-button" |
|
|
|
:class="{ |
|
|
|
'style-button-none': editDataInfoForm.relationStyleName, |
|
|
|
}" |
|
|
|
@click="handleLayerStyleTypeChange" |
|
|
|
> |
|
|
|
{{ editDataInfoForm.relationStyleName ? editDataInfoForm.relationStyleName : "点击选择样式" }} |
|
|
|
</el-tag> |
|
|
|
<el-button style="margin-left: 15px" :disabled="editDataInfoForm.relationStyleName === ''" @click=" |
|
|
|
editDataInfoForm.relationStyleName = ''; |
|
|
|
editDataInfoForm.relationStyleId = ''; |
|
|
|
">取消选择样式</el-button> |
|
|
|
<el-button |
|
|
|
style="margin-left: 15px" |
|
|
|
:disabled="editDataInfoForm.relationStyleName === ''" |
|
|
|
@click=" |
|
|
|
editDataInfoForm.relationStyleName = ''; |
|
|
|
editDataInfoForm.relationStyleId = ''; |
|
|
|
" |
|
|
|
>取消选择样式</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<styleListDialogVue :visible="styleDialogVisible" :$currentStyleId="editDataInfoForm.relationStyleId" |
|
|
|
@closeDialog="styleDialogVisible = false" @confirm="handleConfirm"></styleListDialogVue> |
|
|
|
<styleListDialogVue |
|
|
|
:visible="styleDialogVisible" |
|
|
|
:$currentStyleId="editDataInfoForm.relationStyleId" |
|
|
|
@closeDialog="styleDialogVisible = false" |
|
|
|
@confirm="handleConfirm" |
|
|
|
></styleListDialogVue> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-tab-pane> |
|
|
@ -91,14 +115,38 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="scope.row.isEdit" type="primary" icon="el-icon-success" size="mini" |
|
|
|
@click="saveRow(scope.$index)">保存</el-button> |
|
|
|
<el-button v-if="scope.row.isEdit" type="warning" icon="el-icon-error" size="mini" |
|
|
|
@click="cancelRow(scope.$index)">取消</el-button> |
|
|
|
<el-button v-if="!scope.row.isEdit" type="primary" icon="el-icon-edit" size="mini" |
|
|
|
@click="editRow(scope.$index)">编辑</el-button> |
|
|
|
<el-button v-if="!scope.row.isEdit" type="danger" icon="el-icon-delete-solid" size="mini" |
|
|
|
@click="deleteRow(scope.$index)">删除</el-button> |
|
|
|
<el-button |
|
|
|
v-if="scope.row.isEdit" |
|
|
|
type="primary" |
|
|
|
icon="el-icon-success" |
|
|
|
size="mini" |
|
|
|
@click="saveRow(scope.$index)" |
|
|
|
>保存</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
v-if="scope.row.isEdit" |
|
|
|
type="warning" |
|
|
|
icon="el-icon-error" |
|
|
|
size="mini" |
|
|
|
@click="cancelRow(scope.$index)" |
|
|
|
>取消</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
v-if="!scope.row.isEdit" |
|
|
|
type="primary" |
|
|
|
icon="el-icon-edit" |
|
|
|
size="mini" |
|
|
|
@click="editRow(scope.$index)" |
|
|
|
>编辑</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
v-if="!scope.row.isEdit" |
|
|
|
type="danger" |
|
|
|
icon="el-icon-delete-solid" |
|
|
|
size="mini" |
|
|
|
@click="deleteRow(scope.$index)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -113,15 +161,13 @@ |
|
|
|
</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 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="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> |
|
|
@ -137,20 +183,21 @@ |
|
|
|
</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> |
|
|
|
<div class="content"> |
|
|
|
<el-table :data="tableData" stripe style="width: 100%"> |
|
|
|
<el-table-column type="index" :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="serviceNameAlias" label="图层资源名称"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
: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="serviceNameAlias" 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="操作"> |
|
|
@ -160,8 +207,14 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-pagination background layout="prev, pager, next" :current-page.sync="pageOptions.pageNum" |
|
|
|
:total="pageOptions.total" :page-size="pageOptions.pageSize" @current-change="getLayerList"> |
|
|
|
<el-pagination |
|
|
|
background |
|
|
|
layout="prev, pager, next" |
|
|
|
:current-page.sync="pageOptions.pageNum" |
|
|
|
:total="pageOptions.total" |
|
|
|
:page-size="pageOptions.pageSize" |
|
|
|
@current-change="getLayerList" |
|
|
|
> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</el-container> |
|
|
@ -255,6 +308,7 @@ export default { |
|
|
|
"editDataInfoForm.serviceUrl"(val) { |
|
|
|
if (val) { |
|
|
|
if (!this.queryServiceUrlMap.has(val)) { |
|
|
|
debugger; |
|
|
|
this.queryLayerByUrl(val); |
|
|
|
} else { |
|
|
|
this.fieldsTable = this.queryServiceUrlMap.get(val); |
|
|
@ -277,13 +331,9 @@ export default { |
|
|
|
methods: { |
|
|
|
searchField() { |
|
|
|
if (this.fieldValue === "") { |
|
|
|
this.fieldsTable = this.queryServiceUrlMap.get( |
|
|
|
this.editDataInfoForm.serviceUrl |
|
|
|
); |
|
|
|
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() { |
|
|
@ -306,15 +356,11 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
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) { |
|
|
@ -356,8 +402,7 @@ export default { |
|
|
|
if (!reg.test(this.editDataInfoForm.serviceName)) { |
|
|
|
this.$message({ |
|
|
|
type: "info", |
|
|
|
message: |
|
|
|
"格式有误,目录名称仅支持中文、数字、字母、下划线、冒号,最大长度不超过100", |
|
|
|
message: "格式有误,目录名称仅支持中文、数字、字母、下划线、冒号,最大长度不超过100", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
@ -366,10 +411,7 @@ export default { |
|
|
|
extendData: JSON.stringify(this.extendTable), |
|
|
|
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; |
|
|
@ -427,9 +469,7 @@ export default { |
|
|
|
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(() => { |
|
|
@ -455,9 +495,7 @@ 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", |
|
|
@ -471,16 +509,16 @@ export default { |
|
|
|
this.multipleSelection = val; |
|
|
|
}, |
|
|
|
showFieldExtend() { |
|
|
|
return ["021102", "081100", "030300"].includes( |
|
|
|
this.editDataInfoForm.serviceType |
|
|
|
); |
|
|
|
return ["021102", "081100", "030300"].includes(this.editDataInfoForm.serviceType); |
|
|
|
}, |
|
|
|
queryLayerByUrl(url) { |
|
|
|
debugger; |
|
|
|
queryServiceInfoApi(url, { |
|
|
|
type: this.editDataInfoForm.serviceType, |
|
|
|
url: url, |
|
|
|
index: this.editDataInfoForm.serviceIndex, |
|
|
|
name: this.editDataInfoForm.serviceName, |
|
|
|
token: this.editDataInfoForm.serviceToken, |
|
|
|
alias: this.editDataInfoForm.serviceNameAlias, |
|
|
|
}).then((res) => { |
|
|
|
this.fieldsTable = |
|
|
|