|
@@ -0,0 +1,153 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="">
|
|
3
|
+ <el-table
|
|
4
|
+ :row-style="{ color: '#303133' }"
|
|
5
|
+ :header-cell-style="{
|
|
6
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
7
|
+ color: '#606266'
|
|
8
|
+ }"
|
|
9
|
+ :data="dialysis_computer_data"
|
|
10
|
+ border
|
|
11
|
+ fit
|
|
12
|
+ highlight-current-row
|
|
13
|
+ style="width: 100%;min-height:500px;"
|
|
14
|
+ >
|
|
15
|
+ <el-table-column align="center" label="字段名">
|
|
16
|
+ <template slot-scope="scope">
|
|
17
|
+ <span>{{ scope.row.filed_name_cn }}</span>
|
|
18
|
+ </template>
|
|
19
|
+ </el-table-column>
|
|
20
|
+ <el-table-column align="center" label="字段">
|
|
21
|
+ <template slot-scope="scope">
|
|
22
|
+ <span>{{ scope.row.filed_name }}</span>
|
|
23
|
+ </template>
|
|
24
|
+ </el-table-column>
|
|
25
|
+
|
|
26
|
+ <el-table-column align="center" label="是否显示">
|
|
27
|
+ <template slot-scope="scope">
|
|
28
|
+ <span v-if="scope.row.is_show == 1">是</span>
|
|
29
|
+ <span v-if="scope.row.is_show == 2">否</span>
|
|
30
|
+ </template>
|
|
31
|
+ </el-table-column>
|
|
32
|
+
|
|
33
|
+ <el-table-column label="操作" align="center">
|
|
34
|
+ <template slot-scope="scope">
|
|
35
|
+ <el-tooltip
|
|
36
|
+ class="item"
|
|
37
|
+ effect="dark"
|
|
38
|
+ content="不展示"
|
|
39
|
+ placement="top"
|
|
40
|
+ v-if="scope.row.is_show == 1"
|
|
41
|
+ >
|
|
42
|
+ <el-button
|
|
43
|
+ size="small"
|
|
44
|
+ type="danger"
|
|
45
|
+ icon="el-icon-remove-outline"
|
|
46
|
+ @click="handleHide(scope.$index, scope.row)"
|
|
47
|
+ >
|
|
48
|
+ </el-button>
|
|
49
|
+ </el-tooltip>
|
|
50
|
+
|
|
51
|
+ <el-tooltip
|
|
52
|
+ class="item"
|
|
53
|
+ effect="dark"
|
|
54
|
+ content="展示"
|
|
55
|
+ placement="top"
|
|
56
|
+ v-if="scope.row.is_show == 2"
|
|
57
|
+ >
|
|
58
|
+ <el-button
|
|
59
|
+ size="small"
|
|
60
|
+ type="primary"
|
|
61
|
+ icon="el-icon-view"
|
|
62
|
+ @click="handleShow(scope.$index, scope.row)"
|
|
63
|
+ >
|
|
64
|
+ </el-button>
|
|
65
|
+ </el-tooltip>
|
|
66
|
+ </template>
|
|
67
|
+ </el-table-column>
|
|
68
|
+ </el-table>
|
|
69
|
+ </div>
|
|
70
|
+</template>
|
|
71
|
+
|
|
72
|
+<script>
|
|
73
|
+ import { updateFieldIsShow } from "@/api/data";
|
|
74
|
+ import store from "@/store";
|
|
75
|
+
|
|
76
|
+ export default {
|
|
77
|
+ name: "dialysisComputer",
|
|
78
|
+
|
|
79
|
+ props: {
|
|
80
|
+ dialysis_computer_data: {
|
|
81
|
+ type: Array
|
|
82
|
+ }
|
|
83
|
+ },
|
|
84
|
+ methods: {
|
|
85
|
+ handleHide: function(index, row) {
|
|
86
|
+ this.$confirm("是否将该字段设为不可见?", "提示", {
|
|
87
|
+ confirmButtonText: "确 定",
|
|
88
|
+ cancelButtonText: "取 消",
|
|
89
|
+ type: "warning"
|
|
90
|
+ })
|
|
91
|
+ .then(() => {
|
|
92
|
+ updateFieldIsShow(row.id, 2).then(response => {
|
|
93
|
+ if (response.data.state == 1) {
|
|
94
|
+ let params = {
|
|
95
|
+ id: response.data.data.id,
|
|
96
|
+ is_show: response.data.data.is_show
|
|
97
|
+ };
|
|
98
|
+ store.dispatch("updateFiledConfigList", params).then(() => {});
|
|
99
|
+ this.$emit("change", params);
|
|
100
|
+ }
|
|
101
|
+ });
|
|
102
|
+ this.$message({
|
|
103
|
+ type: "success",
|
|
104
|
+ message: "设置成功!"
|
|
105
|
+ });
|
|
106
|
+ })
|
|
107
|
+ .catch(() => {});
|
|
108
|
+ },
|
|
109
|
+ handleShow: function(index, row) {
|
|
110
|
+ this.$confirm("是否将该字段设为可见?", "提示", {
|
|
111
|
+ confirmButtonText: "确 定",
|
|
112
|
+ cancelButtonText: "取 消",
|
|
113
|
+ type: "warning"
|
|
114
|
+ })
|
|
115
|
+ .then(() => {
|
|
116
|
+ updateFieldIsShow(row.id, 1).then(response => {
|
|
117
|
+ if (response.data.state == 1) {
|
|
118
|
+ let params = {
|
|
119
|
+ id: response.data.data.id,
|
|
120
|
+ is_show: response.data.data.is_show
|
|
121
|
+ };
|
|
122
|
+ store.dispatch("updateFiledConfigList", params).then(() => {});
|
|
123
|
+ this.$emit("change", params);
|
|
124
|
+ }
|
|
125
|
+ });
|
|
126
|
+ this.$message({
|
|
127
|
+ type: "success",
|
|
128
|
+ message: "设置成功!"
|
|
129
|
+ });
|
|
130
|
+ })
|
|
131
|
+ .catch(() => {});
|
|
132
|
+ }
|
|
133
|
+ },
|
|
134
|
+ watch: {
|
|
135
|
+
|
|
136
|
+ },
|
|
137
|
+ };
|
|
138
|
+</script>
|
|
139
|
+
|
|
140
|
+<style scoped></style>
|
|
141
|
+<style>
|
|
142
|
+ .el-table td,
|
|
143
|
+ .el-table th.is-leaf,
|
|
144
|
+ .el-table--border,
|
|
145
|
+ .el-table--group {
|
|
146
|
+ border-color: #d0d3da;
|
|
147
|
+ }
|
|
148
|
+ .el-table--border::after,
|
|
149
|
+ .el-table--group::after,
|
|
150
|
+ .el-table::before {
|
|
151
|
+ background-color: #d0d3da;
|
|
152
|
+ }
|
|
153
|
+</style>
|