From 4b96aa60686f3b4e03ece37d676c24cc103539fe Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 27 九月 2024 17:55:52 +0800
Subject: [PATCH] 动态列迁移
---
src/views/system/point/index.vue | 21 +++++++++++++++++++++
src/components/RightToolbar/index.vue | 6 +++---
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue
index f0f9310..d3e9afd 100644
--- a/src/components/RightToolbar/index.vue
+++ b/src/components/RightToolbar/index.vue
@@ -7,7 +7,7 @@
<el-tooltip class="item" effect="dark" content="鍒锋柊" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
</el-tooltip>
- <el-tooltip v-show="$route.path.includes('equipment')" class="item" effect="dark" content="鑷畾涔夊垪" placement="top">
+ <el-tooltip v-show="$route.path.includes('point')" class="item" effect="dark" content="鑷畾涔夊垪" placement="top">
<el-button size="mini" circle icon="el-icon-collection-tag" @click="addDynamicColumn()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="鏄鹃殣鍒�" placement="top" v-if="columns">
@@ -115,7 +115,7 @@
}
},
created() {
- if (this.$route.path.includes("equipment")) {
+ if (this.$route.path.includes("point")) {
this.getDyColumn()
}
if (this.showColumnsType == 'transfer') {
@@ -131,7 +131,7 @@
getDyColumn() {
// 鏌ヨ鍔ㄦ�佸垪
let params = {
- tableName: 't_monitor'
+ tableName: 't_yw_point'
}
getDynamicColumnList(params).then(res => {
this.dynamicColumnList = res.data
diff --git a/src/views/system/point/index.vue b/src/views/system/point/index.vue
index 5f162cf..ef120cf 100644
--- a/src/views/system/point/index.vue
+++ b/src/views/system/point/index.vue
@@ -110,6 +110,11 @@
<el-table-column label="杩愮淮鍗曚綅" align="center" prop="unitName" />
<el-table-column label="鐩戠閮ㄩ棬" align="center" prop="deptName" />
<el-table-column label="澶囨敞" align="center" prop="remark" />
+ <el-table-column v-for="(column, index) in dynamicColumnList" :key="index" :label="column.labelValue" :prop="column.propName" align="center">
+ <template slot-scope="scope">
+ {{ getDynamicValue(scope.row, column.propName) }}
+ </template>
+ </el-table-column>
<el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@@ -235,6 +240,7 @@
</template>
<script>
+import { addDynamicColumn, deleteDynamicColumnById, editDynamicColumn, getDynamicColumnList } from '@/api/platform/dynamicColumn'
import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData, timeRange } from "@/api/platform/point";
import { unitSelect } from "@/api/platform/unit";
import { getCascader } from '@/api/platform/region'
@@ -245,6 +251,7 @@
dicts: ['point_tag', 'area_code'],
data() {
return {
+ dynamicColumnList: [],
needUpdateUnit: false,
importantTag: false,
provinceTag: false,
@@ -328,8 +335,22 @@
this.getUnitSelect();
// this.getCascader();
this.getDeptCascader();
+ this.getDyColumn()
},
methods: {
+ getDyColumn() {
+ // 鏌ヨ鍔ㄦ�佸垪
+ let params = {
+ tableName: 't_yw_point'
+ }
+ getDynamicColumnList(params).then(res => {
+ this.dynamicColumnList = res.data
+ })
+ },
+ getDynamicValue(row, propName) {
+ let target = row.dynamicColumnList.filter(item => item.propName === propName)
+ return target && target.length > 0 ? target[0].columnValue : ''
+ },
getTagText(row) {
let text = '';
--
Gitblit v1.8.0