Pārlūkot izejas kodu

调整数值列居右

baiyanting 1 gadu atpakaļ
vecāks
revīzija
9590985218
1 mainītis faili ar 9 papildinājumiem un 10 dzēšanām
  1. 9 10
      src/components/qushi/qushiDialog.vue

+ 9 - 10
src/components/qushi/qushiDialog.vue

@@ -133,9 +133,8 @@
           stripe
         >
           <el-table-column
-            :align="
-              item.code == 'tagName' || item.code == 'name' ? 'left' : 'center'
-            "
+            header-align="center"
+            :align="item.align"
             v-for="item in tableHeader"
             :key="item.code"
             :prop="item.code"
@@ -298,13 +297,13 @@ export default {
   data() {
     return {
       tableHeader: [
-        { title: "指标名称", code: "name", width: 500 },
-        { title: "描述", code: "tagName", width: 400 },
-        { title: "快照时间", code: "dateTime", width: 200 },
-        { title: "快照值", code: "value" },
-        { title: "最大值", code: "maxvalue" },
-        { title: "最小值", code: "minvalue" },
-        { title: "平均值", code: "avgvalue" },
+        { title: "指标名称", code: "name", width: 500, align: "left" },
+        { title: "描述", code: "tagName", width: 400, align: "left" },
+        { title: "快照时间", code: "dateTime", width: 200, align: "center" },
+        { title: "快照值", code: "value", align: "right" },
+        { title: "最大值", code: "maxvalue", align: "right" },
+        { title: "最小值", code: "minvalue", align: "right" },
+        { title: "平均值", code: "avgvalue", align: "right" },
       ],
       value: true,
       dialogVisibles: false,