|
@@ -52,7 +52,13 @@
|
|
|
<el-table-column label="分区名称" align="left" prop="zoningName" />
|
|
|
<el-table-column label="分区编码" align="center" prop="zoningCode" width="200" />
|
|
|
<el-table-column label="所在建筑" align="left" prop="areaPath" />
|
|
|
- <el-table-column label="区块标签" align="center" prop="tagNames" />
|
|
|
+ <el-table-column label="区块标签" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-for="tag in scope.row.tagNames" :key="tag" :style="getTagStyle(tag)" class="tag-label">
|
|
|
+ {{ tag }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['basecfg:zoning:edit']">
|
|
@@ -174,6 +180,7 @@ export default {
|
|
|
this.getEmsTag('Area')
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
formatDict(val, options, key = 'code', text = 'name') {
|
|
|
let name = ''
|
|
|
this[options].forEach(item => {
|
|
@@ -183,14 +190,26 @@ export default {
|
|
|
})
|
|
|
return name
|
|
|
},
|
|
|
+ getTagStyle(tag) {
|
|
|
+ const styleMap = {
|
|
|
+ '公共区域': 'background-color: rgb(255,255,125); color: rgb(109,109,150); padding: 4px 8px; border-radius: 4px; width: 80px; height: 30px; margin: 4px 8px 4px 0; display: inline-block; vertical-align: top;',
|
|
|
+ '商户区域': 'background-color: rgb(206,206,255); color: rgb(109,109,150); padding: 4px 8px; border-radius: 4px; width: 80px; height: 30px; margin: 4px 8px 4px 0; display: inline-block; vertical-align: top;',
|
|
|
+ '热点区域': 'background-color: rgb(203,255,99); color: rgb(109,109,150); padding: 4px 8px; border-radius: 4px; width: 80px; height: 30px; margin: 4px 8px 4px 0; display: inline-block; vertical-align: top;'
|
|
|
+ };
|
|
|
+ return styleMap[tag] || 'background-color: #FFFFFF; color: #000000; padding: 4px 8px; border-radius: 4px; width: 80px; height: 30px; margin: 4px 8px 4px 0; display: inline-block; vertical-align: top;';
|
|
|
+ },
|
|
|
/** 查询建筑区域划分列表 */
|
|
|
getList() {
|
|
|
- this.loading = true
|
|
|
+ this.loading = true;
|
|
|
listZoning(this.queryParams).then(response => {
|
|
|
- this.zoningList = response.rows
|
|
|
- this.total = response.total
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ this.zoningList = response.rows.map(item => {
|
|
|
+ // 将 tagNames 字符串转换为数组
|
|
|
+ item.tagNames = item.tagNames.split(',').map(tag => tag.trim());
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
/** 查询区域树结构 */
|
|
|
getAreaTree(tier) {
|
|
@@ -320,3 +339,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
+
|