|
@@ -7,6 +7,21 @@
|
|
|
v-show="showSearch"
|
|
|
label-width="68px"
|
|
|
>
|
|
|
+ <el-form-item label="标记物类型" prop="markerType">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.markerType"
|
|
|
+ placeholder="请选择标记物类型"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in markerTypeOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="标记物名称" prop="markerName">
|
|
|
<el-input
|
|
|
v-model="queryParams.markerName"
|
|
@@ -91,6 +106,12 @@
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<!-- <el-table-column label="标记物id" align="center" prop="markerId" /> -->
|
|
|
+ <el-table-column
|
|
|
+ label="类型"
|
|
|
+ align="center"
|
|
|
+ prop="markerType"
|
|
|
+ :formatter="markerTypeFormat"
|
|
|
+ />
|
|
|
<el-table-column label="名称" align="center" prop="markerName" />
|
|
|
<el-table-column label="地址" align="center" prop="address" />
|
|
|
<!-- <el-table-column label="展示图片" align="center" prop="showPictures" /> -->
|
|
@@ -190,8 +211,31 @@
|
|
|
placeholder="请输入营业时间"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="标记物类型" prop="markerType">
|
|
|
+ <el-select
|
|
|
+ v-model="form.markerType"
|
|
|
+ placeholder="请选择标记物类型"
|
|
|
+ @change="markerTypeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in markerTypeOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="标签" prop="labelText">
|
|
|
- <el-input v-model="form.labelText" placeholder="请输入标签" />
|
|
|
+ <!-- <el-input v-model="form.labelText" placeholder="请输入标签" /> -->
|
|
|
+ <el-select v-model="form.labelText" multiple placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in labelList"
|
|
|
+ :key="item.name"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="地图" name="second">
|
|
@@ -284,7 +328,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { listMarker, getMarker, delMarker, addMarker, updateMarker, exportMarker } from "@/api/management/marker";
|
|
|
-
|
|
|
+import { selectLabel } from "@/api/management/label";
|
|
|
export default {
|
|
|
name: "Marker",
|
|
|
data () {
|
|
@@ -311,6 +355,8 @@ export default {
|
|
|
open: false,
|
|
|
// 画图形状字典
|
|
|
shapeTypeOptions: [],
|
|
|
+ // 标记物类型字典
|
|
|
+ markerTypeOptions: [],
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -328,6 +374,7 @@ export default {
|
|
|
tmap: undefined,
|
|
|
map: undefined,
|
|
|
baseUrl: process.env.VUE_APP_BASE_API,
|
|
|
+ labelList: undefined
|
|
|
|
|
|
};
|
|
|
},
|
|
@@ -336,6 +383,9 @@ export default {
|
|
|
this.getDicts("shape_type").then(response => {
|
|
|
this.shapeTypeOptions = response.data;
|
|
|
});
|
|
|
+ this.getDicts("marker_type").then(response => {
|
|
|
+ this.markerTypeOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询标记物管理列表 */
|
|
@@ -347,6 +397,10 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ // 标记物类型字典翻译
|
|
|
+ markerTypeFormat (row, column) {
|
|
|
+ return this.selectDictLabel(this.markerTypeOptions, row.markerType);
|
|
|
+ },
|
|
|
// 画图形状字典翻译
|
|
|
shapeTypeFormat (row, column) {
|
|
|
return this.selectDictLabel(this.shapeTypeOptions, row.shapeType);
|
|
@@ -364,6 +418,7 @@ export default {
|
|
|
reset () {
|
|
|
this.form = {
|
|
|
markerId: null,
|
|
|
+ markerType: null,
|
|
|
markerName: null,
|
|
|
address: null,
|
|
|
showPictures: null,
|
|
@@ -414,6 +469,7 @@ export default {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改标记物管理";
|
|
|
+ this.form.labelText = response.data.labelText.split(",")
|
|
|
|
|
|
});
|
|
|
},
|
|
@@ -421,6 +477,10 @@ export default {
|
|
|
submitForm () {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ if (this.form.labelText) {
|
|
|
+ this.form.labelText = this.form.labelText.join(",")
|
|
|
+ }
|
|
|
+
|
|
|
if (this.form.markerId != null) {
|
|
|
updateMarker(this.form).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
@@ -655,6 +715,15 @@ export default {
|
|
|
|
|
|
this.editor.setActiveOverlay(this.form.shapeType)
|
|
|
}
|
|
|
+ },
|
|
|
+ markerTypeChange (val) {
|
|
|
+ selectLabel(val).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.labelList = res.data;
|
|
|
+ })
|
|
|
+ // selectLabel(this.form.markerType).then(res=>{
|
|
|
+ // console.log(res);
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
};
|