Przeglądaj źródła

防区状态不使用颜色区分

jiawuxian 2 lat temu
rodzic
commit
766979ac48

+ 3 - 3
src/views/menu/protection/components/item.vue

@@ -23,9 +23,9 @@
       </van-cell>
       <van-cell title="布撤防状态" >
         <template #right-icon>
-            <span v-if="data.status==1" style="color:rgb(0,164,46)">布防</span>
-            <span v-else-if="data.status==0" style="color:rgb(215,0,15)">撤防</span>
-            <span v-else>{{getDictLabel(data.status, 'protection_status', '未上报')}}</span>
+            <!-- <span v-if="data.status==1" style="color:rgb(0,164,46)">布防</span>
+            <span v-else-if="data.status==0" style="color:rgb(215,0,15)">撤防</span> -->
+            <span >{{getDictLabel(data.status, 'protection_status', '未上报')}}</span>
         </template>
       </van-cell>
       <van-cell

+ 9 - 4
src/views/menu/protection/detail.vue

@@ -21,9 +21,9 @@
           </template>
           <template slot-scope="{ data }">
             <div class="datarow">
-              <span v-if="data.status == 1" style="color: rgb(0, 164, 46)">布防</span>
-              <span v-else-if="data.status == 0" style="color: rgb(215, 0, 15)">撤防</span>
-              <span v-else>{{ getLabel(data.status, 'protection_status', '未上报') }}</span>
+              <!-- <span v-if="data.status == 1" style="color: rgb(0, 164, 46)">布防</span>
+              <span v-else-if="data.status == 0" style="color: rgb(215, 0, 15)">撤防</span> -->
+              <span >{{ getDictLabel(data.status,  'protection_status', '未上报') }}</span>
               <span>{{ data.updateTime }}</span>
               <span>{{ data.statusUpdatorName }}</span>
             </div>
@@ -39,6 +39,7 @@ import { get, history } from '@/api/protection.js'
 import Card from '@/components/card/index.vue'
 import { getLabel } from '@/utils/optionEx'
 import NavBar from '@/components/NavBar'
+import { mapGetters } from 'vuex'
 export default {
   data() {
     return {
@@ -51,10 +52,14 @@ export default {
         { value: '0', text: '撤防' },
         { value: '1', text: '布防' },
         { value: '2', text: '未知' }
-      ]
+      ],
+      dicts: ["protection_status"]
     }
   },
   components: { NavBar, KList, Card },
+  computed: {
+    ...mapGetters(['dictionary'])
+  },
   mounted() {
     this.getInfo()
   },