Эх сурвалжийг харах

* 数字化施工国际化

chen.cheng 4 сар өмнө
parent
commit
53ded5e826

+ 20 - 163
src/utils/EnumConst.js

@@ -1,163 +1,20 @@
-export const COMP_CODE = {
-  index_ctl: 'index_ctl',
-  index_swip: 'index_swip',
-  my: 'my',
-};
-export const ICON_CFG = {
-  file_icon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg',
-  login_bg: '/profile/upload/2024/08/17/head-bg_20240817230007A002.png',
-};
-
-export const CONTENT_TYPE = {
-  news: 1,
-  conference: 6,
-  theme: 4,
-  conferenceMaterials: 5,
-};
-
-export const MEETING_TYPE = {
-  1: {
-    name: '大会报名',
-    value: '1',
-  },
-  2: {
-    name: '会场调研',
-    value: '2',
-  },
-  3: {
-    name: '主题研讨',
-    value: '3',
-  },
-  meeting: {
-    name: '会议报名',
-    value: '1',
-  },
-  theme: {
-    name: '主题研讨',
-    value: '3',
-  },
-  conference: {
-    name: '会场调研',
-    value: '2',
-  },
-};
-
-export const USR_TYPE_LIST = [
-  {
-    value: '1',
-    name: '大会代表',
-  },
-  {
-    value: '2',
-    name: '随行人员',
-  },
-];
-
-export const USR_TYPE = {
-  1: {
-    name: '大会代表',
-    value: '1',
-  },
-  2: {
-    name: '随行人员',
-    value: '2',
-  },
-
-};
-export const FILE_ICON = {
-  doc: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
-  docx: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
-  xls: '/profile/upload/2024/08/20/excel_20240820110613A006.svg',
-  xlsx: '/profile/upload/2024/08/20/excel_20240820110613A006.svg',
-  txt: '/profile/upload/2024/08/20/text_20240820110711A010.svg',
-  text: '/profile/upload/2024/08/20/text_20240820110711A010.svg',
-  ppt: '/profile/upload/2024/08/20/ppt_20240820110657A009.svg',
-  pptx: '/profile/upload/2024/08/20/ppt_20240820110657A009.svg',
-  pdf: '/profile/upload/2024/08/20/pdf_20240820110643A008.svg',
-  png: '/profile/upload/2024/08/20/image_20240820110632A007.svg',
-  mp4: '/profile/upload/2024/08/20/video_20240820110721A011.svg',
-  defIcon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg',
-};
-export const SYS_YES_NO = {
-  '0': {
-    name: '是',
-    value: 0,
-  },
-  '1': {
-    name: '否',
-    value: 1,
-  },
-};
-export const REVIEW_STATUS = {
-  '0': {
-    name: '审核通过',
-    value: '0',
-    tag: 'success',
-    tip: 32,
-    color: 'green',
-  },
-  '1': {
-    name: '审核不通过',
-    value: '1',
-    tag: 'error',
-    tip: 33,
-    color: 'red',
-  },
-  '2': {
-    name: '待审核',
-    value: '2',
-    tag: 'warning',
-    color: 'orange',
-  },
-  'pass': {
-    name: '审核通过',
-    value: '0',
-    tag: 'success',
-  },
-  'noPass': {
-    name: '审核不通过',
-    value: '1',
-    tag: 'error',
-  },
-  'wait': {
-    name: '待审核',
-    value: '2',
-    tag: 'warning',
-  },
-};
-
-export const TFC_TYPE = {
-  1: {
-    name: '铁路',
-    value: 1,
-  },
-  2: {
-    name: '航空',
-    value: 2,
-  },
-  3: {
-    name: '公路',
-    value: 3,
-  },
-};
-
-export const TFC_INFO = {
-
-  1: {
-    name: '车次',
-    value: 1,
-  },
-  2: {
-    name: '航班号',
-    value: 2,
-  },
-  3: {
-    name: '高速公路出入口',
-    value: 3,
-  },
-};
-
-export const FORM_MOD = {
-  add: 'add',
-  modify: 'mod',
-};
+export const MachineStatus = {
+  "00": {
+    label: "online",
+    color: "#5cb85c",
+  },
+  "01": {
+    label: "offline",
+    color: "#a8a8a8"
+  },
+  "online": {
+    label: "online",
+    color: "#5cb85c",
+    code: "00"
+  },
+  "offline": {
+    label: "offline",
+    color: "#a8a8a8",
+    code: "01"
+  }
+}

+ 13 - 0
src/views/cons/screen/index.scss

@@ -134,6 +134,19 @@
           letter-spacing: 1px;
           cursor: pointer;
 
+          &.selected-item {
+            border: 1px solid #4EBBCD;
+            border-radius: 4px;
+          }
+
+          .machine-status {
+            display: inline-block;
+            width: 10px;
+            height: 10px;
+            border-radius: 100%;
+            margin-right: 10px;
+          }
+
           &:nth-child(odd) {
             background: #012748;
           }

+ 28 - 6
src/views/cons/screen/index.vue

@@ -20,15 +20,22 @@
         </div>
         <div class="machine-list">
           <div class="list-container-title">
-            {{ $t("screen.machineList") }}<span v-if="loading" style="font-size: 10px;color: #fefefe;margin-left: 10px">{{
-              $t("common.loading")
-            }}</span>
+            {{ $t("screen.machineList") }}
+            <span v-if="loading" style="font-size: 10px;color: #fefefe;margin-left: 10px">
+              {{
+                $t("common.loading")
+              }}
+            </span>
           </div>
           <div class="content-list infinite-list-wrapper"
                v-infinite-scroll="loadMachine"
                :infinite-scroll-disabled="disabled"
           >
-            <div v-for="item in machineList" class="list-item" :key="item.id" @click="handleMachineClick(item)">
+            <div v-for="item in machineList"
+                 :class="{'list-item':true,'selected-item': selectMachine && item.id===selectMachine.id}"
+                 :key="item.id" @click="handleMachineClick(item)">
+              <i class="machine-status"
+                 :style="{backgroundColor: MachineStatus[item.status].color }"/>
               {{ item.name }}({{ item.machineNum }})
             </div>
             <p v-if="noMore" class="no-more" style="margin-top: auto">{{ $t("common.noMore") }}</p>
@@ -109,6 +116,7 @@ import MachineIndex from "@/views/cons/screen/MachineIndex.vue";
 import PileHoleDetail from "@/views/cons/screen/PileHoleDetail.vue";
 import {copyObj} from "@/utils";
 import pileMachine from "./img/pile-machine.svg"
+import {MachineStatus} from "@/utils/EnumConst";
 
 export default {
   components: {
@@ -129,6 +137,9 @@ export default {
     },
   },
   computed: {
+    MachineStatus() {
+      return MachineStatus
+    },
     noMore() {
       return this.count >= 100
     },
@@ -143,7 +154,7 @@ export default {
     searchVal(val) {
       this.searchValOnchange()
     },
-    machineOriList(val) {
+    onlineMachine(val) {
       val && this.addMachineMarker()
     }
   },
@@ -262,7 +273,7 @@ export default {
       });
     },
     addMachineMarker() {
-      this.machineOriList.forEach(item => {
+      this.onlineMachine.forEach(item => {
         let marker = new BDLayers.Lib.Overlays.Marker(`marker${item.id}`, [item.lng, item.lat], {
           symbol: {
             'textName': `${item.name}`,
@@ -333,6 +344,17 @@ export default {
     },
     handleClick(e) {
     },
+    handleMachineClick(item) {
+      if (item.status === MachineStatus.offline.code) {
+        return;
+      }
+      if (this.selectMachine && this.selectMachine.id === item.id) {
+        this.locationClose()
+        return
+      }
+      this.locationMachine(item)
+      this.selectMachine = item
+    },
     locationMachine(selectMachine) {
       this.mapIns.flyToPoint([selectMachine.lng, selectMachine.lat], {duration: 1000})
     },