|
@@ -1,16 +1,37 @@
|
|
|
<template>
|
|
|
- <el-dialog :class="'singleDataDialog'" :visible.sync="isShow" width="700px" top="7%" :close-on-click-modal="false"
|
|
|
- :before-close="dialogBeforeClose">
|
|
|
- <el-form :model="fromDataRender" class="singledata" ref="single_form" label-width="80px" :rules="rules">
|
|
|
+ <el-dialog
|
|
|
+ :class="'singleDataDialog'"
|
|
|
+ :visible.sync="isShow"
|
|
|
+ width="700px"
|
|
|
+ top="7%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :before-close="dialogBeforeClose"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="fromDataRender"
|
|
|
+ class="singledata"
|
|
|
+ ref="single_form"
|
|
|
+ label-width="80px"
|
|
|
+ :rules="rules"
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<el-col :span="11">
|
|
|
<el-form-item label="名称" prop="title">
|
|
|
- <el-input v-model="fromDataRender.title" :readonly="!edit" maxlength="20" show-word-limit></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.title"
|
|
|
+ :readonly="!edit"
|
|
|
+ maxlength="20"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="11">
|
|
|
<el-form-item label="行政区划编码" prop="areaCode">
|
|
|
- <el-input v-model="fromDataRender.areaCode" :readonly="!edit" show-word-limit></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.areaCode"
|
|
|
+ :readonly="!edit"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="11">
|
|
@@ -34,55 +55,95 @@
|
|
|
<el-row>
|
|
|
<el-col :span="11">
|
|
|
<el-form-item label="第三方ID" prop="threeId">
|
|
|
- <el-input v-model="fromDataRender.threeId" :readonly="!edit" show-word-limit></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.threeId"
|
|
|
+ :readonly="!edit"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="11">
|
|
|
<el-form-item label="第三方表名" prop="tableName">
|
|
|
- <el-input v-model="fromDataRender.tableName" :readonly="!edit" show-word-limit></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.tableName"
|
|
|
+ :readonly="!edit"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="11">
|
|
|
<el-form-item label="中心经度" prop="centerLon">
|
|
|
- <el-input v-model="fromDataRender.centerLon" :readonly="!edit"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.centerLon"
|
|
|
+ type="number"
|
|
|
+ :readonly="!edit"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="11">
|
|
|
<el-form-item label="中心纬度" prop="centerLat">
|
|
|
- <el-input v-model="fromDataRender.centerLat" :readonly="!edit"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.centerLat"
|
|
|
+ type="number"
|
|
|
+ :readonly="!edit"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
- <el-button v-if="edit" :style="{
|
|
|
- fontSize: '23px',
|
|
|
- padding: '7px',
|
|
|
- float: 'right',
|
|
|
- }" :title="'中心点修改'" @click="openCenterLocation(fromDataRender)" icon="el-icon-location-outline">
|
|
|
+ <el-button
|
|
|
+ v-if="edit"
|
|
|
+ :style="{
|
|
|
+ fontSize: '23px',
|
|
|
+ padding: '7px',
|
|
|
+ float: 'right',
|
|
|
+ }"
|
|
|
+ :title="'中心点修改'"
|
|
|
+ @click="openCenterLocation(fromDataRender)"
|
|
|
+ icon="el-icon-location-outline"
|
|
|
+ >
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row style="margin-bottom: 10px; color: #c9c9c9; padding-left: 100px">
|
|
|
+ 注:中心经度,中心纬度仅可输入数字
|
|
|
+ </el-row>
|
|
|
<el-row v-if="modelParams.geotype != 0">
|
|
|
<el-col :span="22">
|
|
|
<el-form-item label="点集">
|
|
|
<!-- :readonly="!edit" -->
|
|
|
- <el-input v-model="fromDataRender.locations" readonly="false" disabled="false"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.locations"
|
|
|
+ readonly="false"
|
|
|
+ disabled="false"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
- <el-button v-if="edit" :style="{
|
|
|
- fontSize: '23px',
|
|
|
- padding: '7px',
|
|
|
- float: 'right',
|
|
|
- }" :title="'点集修改'" @click="openGeometryLocation(fromDataRender)" icon="el-icon-edit">
|
|
|
+ <el-button
|
|
|
+ v-if="edit"
|
|
|
+ :style="{
|
|
|
+ fontSize: '23px',
|
|
|
+ padding: '7px',
|
|
|
+ float: 'right',
|
|
|
+ }"
|
|
|
+ :title="'点集修改'"
|
|
|
+ @click="openGeometryLocation(fromDataRender)"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ >
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="22">
|
|
|
<el-form-item label="描述" prop="content">
|
|
|
- <el-input v-model="fromDataRender.content" :readonly="!edit" maxlength="100" show-word-limit></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="fromDataRender.content"
|
|
|
+ :readonly="!edit"
|
|
|
+ maxlength="100"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -101,30 +162,56 @@
|
|
|
</el-form-item>
|
|
|
</el-row>-->
|
|
|
<el-row>
|
|
|
- <el-button type="text" style="float: right" @click="changeAdvancedOptionsStatue()">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ style="float: right"
|
|
|
+ @click="changeAdvancedOptionsStatue()"
|
|
|
+ >
|
|
|
高级选项
|
|
|
- <i v-show="!advancedOptionsShow" class="el-icon-caret-bottom el-icon--right"></i>
|
|
|
- <i v-show="advancedOptionsShow" class="el-icon-caret-top el-icon--right"></i>
|
|
|
+ <i
|
|
|
+ v-show="!advancedOptionsShow"
|
|
|
+ class="el-icon-caret-bottom el-icon--right"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ v-show="advancedOptionsShow"
|
|
|
+ class="el-icon-caret-top el-icon--right"
|
|
|
+ ></i>
|
|
|
</el-button>
|
|
|
<!-- el-icon-caret-bottom -->
|
|
|
<!-- el-icon-caret-top -->
|
|
|
</el-row>
|
|
|
<!-- 高级选项 table -->
|
|
|
<div v-if="advancedOptionsShow">
|
|
|
- <el-table :data="listData" :class="['advanceOptionsTable']" max-height="250">
|
|
|
+ <el-table
|
|
|
+ :data="listData"
|
|
|
+ :class="['advanceOptionsTable']"
|
|
|
+ max-height="250"
|
|
|
+ >
|
|
|
<el-table-column label="名称">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input placeholder="例:建筑金额" v-model="scope.row.name" :readonly="!edit"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="例:建筑金额"
|
|
|
+ v-model="scope.row.name"
|
|
|
+ :readonly="!edit"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="内容">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input placeholder="例:14" v-model="scope.row.value" :readonly="!edit"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="例:14"
|
|
|
+ v-model="scope.row.value"
|
|
|
+ :readonly="!edit"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="单位">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input placeholder="例:万元" v-model="scope.row.unit" :readonly="!edit"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="例:万元"
|
|
|
+ v-model="scope.row.unit"
|
|
|
+ :readonly="!edit"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -135,7 +222,10 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" @click="deleteAdvancedOptionsRow(scope.$index, scope)">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ @click="deleteAdvancedOptionsRow(scope.$index, scope)"
|
|
|
+ >
|
|
|
<i class="el-icon-minus"></i>
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -145,22 +235,28 @@
|
|
|
<!-- 高级选项 table end -->
|
|
|
</el-form>
|
|
|
<!-- centerPoint: centerPoint, -->
|
|
|
- <CenterLocation1 v-if="isShowUpdateCenterDialog" v-bind="{
|
|
|
- isShow: isShowUpdateCenterDialog,
|
|
|
- title: '中心点修改',
|
|
|
- centerPoint: centerPoint,
|
|
|
- beforeClose: beforeCloseUpdateCenterDialog,
|
|
|
- updateData: updateDataCenterLocation,
|
|
|
- }"></CenterLocation1>
|
|
|
+ <CenterLocation1
|
|
|
+ v-if="isShowUpdateCenterDialog"
|
|
|
+ v-bind="{
|
|
|
+ isShow: isShowUpdateCenterDialog,
|
|
|
+ title: '中心点修改',
|
|
|
+ centerPoint: centerPoint,
|
|
|
+ beforeClose: beforeCloseUpdateCenterDialog,
|
|
|
+ updateData: updateDataCenterLocation,
|
|
|
+ }"
|
|
|
+ ></CenterLocation1>
|
|
|
|
|
|
- <CenterLocation2 v-if="isShowUpdateGeometryDialog" v-bind="{
|
|
|
- isShow: isShowUpdateGeometryDialog,
|
|
|
- title: '点集',
|
|
|
- geometry: geometry,
|
|
|
- drawType: modelParams.geotype,
|
|
|
- beforeClose: beforeCloseUpdateGeometryDialog,
|
|
|
- updateData: updateDataGeometryLocation,
|
|
|
- }"></CenterLocation2>
|
|
|
+ <CenterLocation2
|
|
|
+ v-if="isShowUpdateGeometryDialog"
|
|
|
+ v-bind="{
|
|
|
+ isShow: isShowUpdateGeometryDialog,
|
|
|
+ title: '点集',
|
|
|
+ geometry: geometry,
|
|
|
+ drawType: modelParams.geotype,
|
|
|
+ beforeClose: beforeCloseUpdateGeometryDialog,
|
|
|
+ updateData: updateDataGeometryLocation,
|
|
|
+ }"
|
|
|
+ ></CenterLocation2>
|
|
|
|
|
|
<span slot="title" class="dialog-title">
|
|
|
<div class="title">
|
|
@@ -190,6 +286,10 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ type: {
|
|
|
+ type: Number,
|
|
|
+ default: 1, //1 新增 2 修改
|
|
|
+ },
|
|
|
title: {
|
|
|
type: String,
|
|
|
default: "",
|
|
@@ -290,12 +390,12 @@ export default {
|
|
|
|
|
|
centerLon: [
|
|
|
{ required: true, message: "请填写中心点经度", trigger: "blur" },
|
|
|
- { validator: checkLon, trigger: 'blur' }
|
|
|
+ { validator: checkLon, trigger: "blur" },
|
|
|
// { type: "number", message: "中心经度必须数字值" },
|
|
|
],
|
|
|
centerLat: [
|
|
|
{ required: true, message: "请填写中心点纬度", trigger: "blur" },
|
|
|
- { validator: checkLat, trigger: 'blur' }
|
|
|
+ { validator: checkLat, trigger: "blur" },
|
|
|
// { type: "number", message: "中心纬度必须数字值" },
|
|
|
],
|
|
|
threeId: [
|
|
@@ -335,7 +435,7 @@ export default {
|
|
|
this.$refs["single_form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
let data;
|
|
|
- if (that.modelParams) {
|
|
|
+ if (that.type == 1) {
|
|
|
data = Object.assign({}, that.fromDataRender, that.modelParams);
|
|
|
data.jsonStr = JSON.stringify(that.listData);
|
|
|
if (data.type == 0)
|
|
@@ -363,7 +463,7 @@ export default {
|
|
|
addSingleData(data) {
|
|
|
let that = this;
|
|
|
// 上传loading
|
|
|
- const loading = this.$createLoading("数据新增中,请勿刷新!")
|
|
|
+ const loading = this.$createLoading("数据新增中,请勿刷新!");
|
|
|
api
|
|
|
.addSingleData(data)
|
|
|
.then((result) => {
|
|
@@ -392,7 +492,7 @@ export default {
|
|
|
updateSingleData(data) {
|
|
|
let that = this;
|
|
|
// 上传loading
|
|
|
- const loading = this.$createLoading("数据更新中,请勿刷新!")
|
|
|
+ const loading = this.$createLoading("数据更新中,请勿刷新!");
|
|
|
api
|
|
|
.updateSingleData(data)
|
|
|
.then((result) => {
|
|
@@ -452,10 +552,9 @@ export default {
|
|
|
} else {
|
|
|
that.$message({
|
|
|
type: "warning",
|
|
|
- message: "当前坐标有误,请正确填写后查看或修改位置"
|
|
|
- })
|
|
|
+ message: "当前坐标有误,请正确填写后查看或修改位置",
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
|
|
|
// 更新 中心点
|
|
@@ -477,7 +576,7 @@ export default {
|
|
|
|
|
|
// 更新 点集
|
|
|
updateDataGeometryLocation(item) {
|
|
|
- this.fromDataRender.locations = item
|
|
|
+ this.fromDataRender.locations = item;
|
|
|
},
|
|
|
|
|
|
// 关闭 点集修改
|
|
@@ -565,7 +664,9 @@ export default {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
- /deep/ .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before {
|
|
|
+ /deep/
|
|
|
+ .el-form-item.is-required:not(.is-no-asterisk)
|
|
|
+ > .el-form-item__label:before {
|
|
|
content: " ";
|
|
|
width: 0px;
|
|
|
margin-right: 0px;
|
|
@@ -576,5 +677,12 @@ export default {
|
|
|
color: #3f9dfe;
|
|
|
font-size: 150%;
|
|
|
}
|
|
|
+ ::v-deep input::-webkit-outer-spin-button,
|
|
|
+ ::v-deep input::-webkit-inner-spin-button {
|
|
|
+ -webkit-appearance: none !important;
|
|
|
+ }
|
|
|
+ ::v-deep input[type="number"] {
|
|
|
+ -moz-appearance: textfield !important;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|