Browse Source

Merge branch 'release-sy-v1.0.0' of ssh://gitlab.datameta.com:2224/project/water/shuili-vue into release-sy-v1.0.0

sy-water-data-board-ui
panyuyi 9 months ago
parent
commit
cf72a270c6
  1. 3
      src/api/aiSupervision/layerConfigApi.js
  2. 300
      src/views/aiSupervision/layerManage/resource/LayerDetails.vue
  3. 33
      src/views/aiSupervision/layerManage/resource/index.vue

3
src/api/aiSupervision/layerConfigApi.js

@ -187,8 +187,9 @@ export function queryServiceInfoApi(url, layer) {
case '081100': case '081100':
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const name = layer.name; const name = layer.name;
const nameArr = name.split(':');
const splitUrl = url?.split('map-')[0]; const splitUrl = url?.split('map-')[0];
const newUrl = `${splitUrl}data-supermap_shuili/rest/data/datasources/shuili/datasets/${name}/fields.json`; const newUrl = `${splitUrl}data-supermap_shuili/rest/data/datasources/shuili/datasets/${nameArr[1]}/fields.json`;
const result = await axios.get(newUrl); const result = await axios.get(newUrl);
if (result.status === 200 && result.data) { if (result.status === 200 && result.data) {
const fields = result.data.fieldNames.map((item) => { const fields = result.data.fieldNames.map((item) => {

300
src/views/aiSupervision/layerManage/resource/LayerDetails.vue

@ -17,207 +17,88 @@
</div> </div>
</div> </div>
<div class="middle"> <div class="middle">
<el-button type="primary" plain @click="dialogFormVisible = true" <el-button type="primary" plain @click="dialogFormVisible = true">添加图层</el-button>
>添加图层</el-button
>
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible"> <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="基础字段" name="1"> <el-tab-pane label="基础字段" name="1">
<el-form :model="editDataInfoForm"> <el-form :model="editDataInfoForm">
<el-form-item <el-form-item label="服务类型" style="font-size: 1rem" :label-width="'120px'">
label="服务类型" <el-select style="width: 80%" v-model="editDataInfoForm.serviceType" placeholder="请选择">
style="font-size: 1rem" <el-option v-for="item in serviceTypeOptions" :key="item.value" :label="item.label"
:label-width="'120px'" :value="item.value" />
>
<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-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="服务名称" prop="serviceName" style="font-size: 1rem" :label-width="'120px'">
label="服务名称" <el-input v-model.trim="editDataInfoForm.serviceName" style="width: 80%"></el-input>
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>
<el-form-item <el-form-item label="服务别名" prop="serviceNameAlias" style="font-size: 1rem" :label-width="'120px'">
label="服务别名" <el-input v-model.trim="editDataInfoForm.serviceNameAlias" style="width: 80%"></el-input>
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>
<el-form-item <el-form-item label="服务地址" prop="serviceUrl" style="font-size: 1rem" :label-width="'120px'">
label="服务地址" <el-input v-model.trim="editDataInfoForm.serviceUrl" style="width: 80%"></el-input>
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>
<el-form-item <el-form-item label="服务token" prop="serviceToken" style="font-size: 1rem" :label-width="'120px'">
label="服务token" <el-input v-model.trim="editDataInfoForm.serviceToken" style="width: 80%"></el-input>
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>
<el-form-item <el-form-item v-if="editDataInfoForm.serviceType === '030300'" label="服务索引" prop="serviceIndex"
v-if="editDataInfoForm.serviceType === '030300'" style="font-size: 1rem" :label-width="'120px'">
label="服务索引" <el-input v-model="editDataInfoForm.serviceIndex" style="width: 80%"></el-input>
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>
<el-form-item <el-form-item v-show="['030300'].includes(editDataInfoForm.serviceType)" label="样式选择"
v-show="['030300'].includes(editDataInfoForm.serviceType)" style="font-size: 1rem" :label-width="'120px'">
label="样式选择"
style="font-size: 1rem"
:label-width="'120px'"
>
<div class="styleBtn"> <div class="styleBtn">
<el-tag <el-tag type="info" effect="plain" class="style-button" :class="{
type="info" 'style-button-none': editDataInfoForm.relationStyleName,
effect="plain" }" @click="handleLayerStyleTypeChange">
class="style-button"
:class="{
'style-button-none': editDataInfoForm.relationStyleName,
}"
@click="handleLayerStyleTypeChange"
>
{{ {{
editDataInfoForm.relationStyleName editDataInfoForm.relationStyleName
? editDataInfoForm.relationStyleName ? editDataInfoForm.relationStyleName
: "点击选择样式" : "点击选择样式"
}} }}
</el-tag> </el-tag>
<el-button <el-button style="margin-left: 15px" :disabled="editDataInfoForm.relationStyleName === ''" @click="
style="margin-left: 15px" editDataInfoForm.relationStyleName = '';
:disabled="editDataInfoForm.relationStyleName === ''" editDataInfoForm.relationStyleId = '';
@click=" ">取消选择样式</el-button>
editDataInfoForm.relationStyleName = '';
editDataInfoForm.relationStyleId = '';
"
>取消选择样式</el-button
>
</div> </div>
<styleListDialogVue <styleListDialogVue :visible="styleDialogVisible" :$currentStyleId="editDataInfoForm.relationStyleId"
:visible="styleDialogVisible" @closeDialog="styleDialogVisible = false" @confirm="handleConfirm"></styleListDialogVue>
:$currentStyleId="editDataInfoForm.relationStyleId"
@closeDialog="styleDialogVisible = false"
@confirm="handleConfirm"
></styleListDialogVue>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="扩展字段" name="2"> <el-tab-pane label="扩展字段" name="2">
<div class="fn-btns"> <div class="fn-btns">
<el-button type="primary" class="btn" @click="addRow" <el-button type="primary" class="btn" @click="addRow">添加</el-button>
>添加</el-button <el-button type="danger" class="btn" @click="deleteRow">删除</el-button>
>
<el-button type="danger" class="btn" @click="deleteRow"
>删除</el-button
>
</div> </div>
<el-table <el-table max-height="400px" :data="extendTable" border @selection-change="handleSelectionChange">
max-height="400px" <el-table-column type="selection" width="50" align="center"></el-table-column>
:data="extendTable"
border
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="50"
align="center"
></el-table-column>
<el-table-column prop="field" label="字段名称"> <el-table-column prop="field" label="字段名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-model="scope.row.field" :disabled="!scope.row.isEdit"></el-input>
v-model="scope.row.field"
:disabled="!scope.row.isEdit"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="alias" label="别名"> <el-table-column prop="alias" label="别名">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-model="scope.row.alias" :disabled="!scope.row.isEdit"></el-input>
v-model="scope.row.alias"
:disabled="!scope.row.isEdit"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="value" label="字段值"> <el-table-column prop="value" label="字段值">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-model="scope.row.value" :disabled="!scope.row.isEdit"></el-input>
v-model="scope.row.value"
:disabled="!scope.row.isEdit"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-if="scope.row.isEdit" type="primary" icon="el-icon-success" size="mini"
v-if="scope.row.isEdit" @click="saveRow(scope.$index)">保存</el-button>
type="primary" <el-button v-if="scope.row.isEdit" type="warning" icon="el-icon-error" size="mini"
icon="el-icon-success" @click="cancelRow(scope.$index)">取消</el-button>
size="mini" <el-button v-if="!scope.row.isEdit" type="primary" icon="el-icon-edit" size="mini"
@click="saveRow(scope.$index)" @click="editRow(scope.$index)">编辑</el-button>
>保存</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="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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -225,22 +106,13 @@
<el-tab-pane label="字段配置" v-if="showFieldExtend()" name="3"> <el-tab-pane label="字段配置" v-if="showFieldExtend()" name="3">
<div class="field-box"> <div class="field-box">
<div class="field-filter"> <div class="field-filter">
<el-input <el-input class="keyword-input" placeholder="请输入搜索字段" v-model="fieldValue" clearable>
class="keyword-input"
placeholder="请输入搜索字段"
v-model="fieldValue"
clearable
>
</el-input> </el-input>
<el-button class="search-btn">搜索</el-button> <el-button class="search-btn">搜索</el-button>
</div> </div>
</div> </div>
<el-table max-height="400px" :data="fieldsTable" border> <el-table max-height="400px" :data="fieldsTable" border>
<el-table-column <el-table-column type="index" width="50" align="center"></el-table-column>
type="index"
width="50"
align="center"
></el-table-column>
<el-table-column prop="field" label="字段名称"> <el-table-column prop="field" label="字段名称">
</el-table-column> </el-table-column>
<el-table-column prop="fieldName" label="字段别名"> <el-table-column prop="fieldName" label="字段别名">
@ -250,18 +122,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="fieldType" label="字段类型"> <el-table-column prop="fieldType" label="字段类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="isShow" label="支持查询" width="80" align="center">
prop="isShow"
label="支持查询"
width="80"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox <el-checkbox v-model="scope.row.isShow" :true-label="1" :false-label="0"></el-checkbox>
v-model="scope.row.isShow"
:true-label="1"
:false-label="0"
></el-checkbox>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -270,34 +133,20 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button> <el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="saveOrUpdateLayer" <el-button type="primary" @click="saveOrUpdateLayer"> </el-button>
> </el-button
>
</div> </div>
</el-dialog> </el-dialog>
<div class="keyword-filter"> <div class="keyword-filter">
<el-input <el-input class="keyword-input" placeholder="请输入内容" v-model="keyword" clearable>
class="keyword-input"
placeholder="请输入内容"
v-model="keyword"
clearable
>
</el-input> </el-input>
<el-button class="search-btn">搜索</el-button> <el-button class="search-btn">搜索</el-button>
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<el-table :data="tableData" stripe style="width: 100%"> <el-table :data="tableData" stripe style="width: 100%">
<el-table-column <el-table-column type="index" :index="(index) =>
type="index" index + (pageOptions.pageNum - 1) * pageOptions.pageSize + 1
:index=" " label="序号" width="50" header-align="center"></el-table-column>
(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 prop="id" label="图层资源目录编号" width="350">
</el-table-column> </el-table-column>
<el-table-column prop="serviceName" label="图层资源目录名称"> <el-table-column prop="serviceName" label="图层资源目录名称">
@ -306,28 +155,13 @@
<el-table-column prop="createUser" label="创建人"> </el-table-column> <el-table-column prop="createUser" label="创建人"> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
size="mini" <el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
@click="handleEdit(scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination background layout="prev, pager, next" :current-page.sync="pageOptions.pageNum"
background :total="pageOptions.total" :page-size="pageOptions.pageSize" @current-change="getLayerList">
layout="prev, pager, next"
:current-page.sync="pageOptions.pageNum"
:total="pageOptions.total"
:page-size="pageOptions.pageSize"
@current-change="getLayerList"
>
</el-pagination> </el-pagination>
</div> </div>
</el-container> </el-container>
@ -518,12 +352,12 @@ export default {
}); });
}, },
async saveOrUpdateLayer() { async saveOrUpdateLayer() {
const reg = /^(\w|[\u4e00-\u9fa5]){3,30}$/g; const reg = /^(?=.{1,30}$)[\u4e00-\u9fa5\w:]+$/;
if (!reg.test(this.editDataInfoForm.serviceName)) { if (!reg.test(this.editDataInfoForm.serviceName)) {
this.$message({ this.$message({
type: "info", type: "info",
message: message:
"格式有误,目录名称仅支持中文、数字、字母、下划线,最大长度不超过30", "格式有误,目录名称仅支持中文、数字、字母、下划线、冒号,最大长度不超过30",
}); });
return; return;
} }
@ -671,29 +505,35 @@ export default {
flex-direction: column; flex-direction: column;
gap: 15px; gap: 15px;
} }
header, header,
.el-container, .el-container,
aside { aside {
background-color: #fff; background-color: #fff;
} }
header { header {
display: flex; display: flex;
align-items: center; align-items: center;
border-radius: 10px; border-radius: 10px;
gap: 10px; gap: 10px;
box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
.el-icon-back { .el-icon-back {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: rgb(135, 231, 140); color: rgb(135, 231, 140);
} }
} }
span { span {
color: #999; color: #999;
font-style: italic; font-style: italic;
font-size: 14px; font-size: 14px;
} }
} }
.el-container { .el-container {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
@ -704,6 +544,7 @@ header {
padding-top: 5px; padding-top: 5px;
border-radius: 3px; border-radius: 3px;
box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
.top { .top {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -711,19 +552,23 @@ header {
padding: 20px 40px; padding: 20px 40px;
width: 100%; width: 100%;
border-bottom: 2px solid #d9d9d9; border-bottom: 2px solid #d9d9d9;
.title { .title {
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
} }
.directoryInfo { .directoryInfo {
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
grid-gap: 5px 10px; grid-gap: 5px 10px;
} }
} }
.middle { .middle {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.keyword-filter { .keyword-filter {
display: flex; display: flex;
border-radius: 4px; border-radius: 4px;
@ -732,14 +577,17 @@ header {
::v-deep .el-input__inner { ::v-deep .el-input__inner {
border: none; border: none;
} }
.search-btn { .search-btn {
border: none; border: none;
border-radius: 0px; border-radius: 0px;
border-left: 1px solid #d9d9d9; border-left: 1px solid #d9d9d9;
} }
} }
.styleBtn { .styleBtn {
display: flex; display: flex;
.style-button-none { .style-button-none {
color: #4b535e; color: #4b535e;
background: #fff; background: #fff;
@ -747,21 +595,25 @@ header {
} }
} }
} }
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
justify-content: space-between; justify-content: space-between;
flex: 1; flex: 1;
.el-pagination { .el-pagination {
text-align: center; text-align: center;
} }
} }
} }
.el-dialog { .el-dialog {
.field-box { .field-box {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
.field-filter { .field-filter {
width: 400px; width: 400px;
margin-bottom: 16px; margin-bottom: 16px;
@ -772,6 +624,7 @@ header {
::v-deep .el-input__inner { ::v-deep .el-input__inner {
border: none; border: none;
} }
.search-btn { .search-btn {
border: none; border: none;
border-radius: 0px; border-radius: 0px;
@ -779,6 +632,7 @@ header {
} }
} }
} }
.fn-btns { .fn-btns {
margin-bottom: 10px; margin-bottom: 10px;
} }

33
src/views/aiSupervision/layerManage/resource/index.vue

@ -23,13 +23,9 @@
</div> </div>
<div class="table"> <div class="table">
<el-table :data="tableData" stripe style="width: 100%"> <el-table :data="tableData" stripe style="width: 100%">
<el-table-column <el-table-column type="index"
type="index" :index="(index) => index + (pageOptions.pageNum - 1) * pageOptions.pageSize + 1" label="序号" width="50"
:index="(index) => index + (pageOptions.pageNum - 1) * pageOptions.pageSize + 1" header-align="center">
label="序号"
width="50"
header-align="center"
>
</el-table-column> </el-table-column>
<el-table-column prop="id" label="图层资源目录编号" width="180"> </el-table-column> <el-table-column prop="id" label="图层资源目录编号" width="180"> </el-table-column>
<el-table-column prop="name" label="图层资源目录名称" width="180"> </el-table-column> <el-table-column prop="name" label="图层资源目录名称" width="180"> </el-table-column>
@ -44,14 +40,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination background layout="prev, pager, next" :current-page.sync="pageOptions.pageNum"
background :total="pageOptions.total" :page-size="pageOptions.pageSize" @current-change="getDirectory">
layout="prev, pager, next"
:current-page.sync="pageOptions.pageNum"
:total="pageOptions.total"
:page-size="pageOptions.pageSize"
@current-change="getDirectory"
>
</el-pagination> </el-pagination>
</div> </div>
</el-main> </el-main>
@ -147,11 +137,11 @@ export default {
}, },
// //
async addOrEditDirectory() { async addOrEditDirectory() {
const reg = /^(\w|[\u4e00-\u9fa5]){3,30}$/g; const reg = /^(?=.{1,30}$)[\u4e00-\u9fa5\w:]+$/;
if (!reg.test(this.currentDirectory.name)) { if (!reg.test(this.currentDirectory.name)) {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '格式有误,目录名称仅支持中文、数字、字母、下划线,最大长度不超过30' message: '格式有误,目录名称仅支持中文、数字、字母、下划线、冒号,最大长度不超过30'
}); });
return; return;
} }
@ -219,17 +209,21 @@ export default {
flex-direction: column; flex-direction: column;
gap: 15px; gap: 15px;
} }
.el-container { .el-container {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
border-radius: 10px; border-radius: 10px;
.el-main { .el-main {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.top { .top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
.el-input__inner { .el-input__inner {
width: 500px; width: 500px;
@ -244,6 +238,7 @@ export default {
::v-deep .el-input__inner { ::v-deep .el-input__inner {
border: none; border: none;
} }
.search-btn { .search-btn {
border: none; border: none;
border-radius: 0px; border-radius: 0px;
@ -251,22 +246,26 @@ export default {
} }
} }
} }
.table { .table {
display: flex; display: flex;
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
justify-content: space-evenly; justify-content: space-evenly;
.el-pagination { .el-pagination {
text-align: center; text-align: center;
} }
} }
} }
} }
header, header,
.el-container, .el-container,
aside { aside {
background-color: #fff; background-color: #fff;
} }
header { header {
display: flex; display: flex;
align-items: center; align-items: center;

Loading…
Cancel
Save