Browse Source

feature(sa): 增加10寸屏支持

sunmiao 4 years ago
parent
commit
04410715f6

+ 16 - 1
frontend_sa/README.md

@@ -1,3 +1,18 @@
 # Quasar App
 
-> WIP
+> quasar dev
+> quasar build
+
+
+
+## 测试运行
+http://localhost:8080/#/?code=报警器编号
+
+## 发布
+http://mcs_sa.labsop.cn/#/?code=报警器编号
+
+## 10寸屏发布
+http://mcs_sa.labsop.cn/#/?code=报警器编号&screen=10
+
+
+

+ 36 - 0
frontend_sa/package.json

@@ -0,0 +1,36 @@
+{
+  "name": "mcs_sa",
+  "version": "0.0.1",
+  "description": "mcs_sa",
+  "productName": "mcs_sa",
+  "cordovaId": "org.cordova.quasar.app",
+  "author": "sunmiao <sunmiao@dashoo.cn>",
+  "private": true,
+  "scripts": {
+    "lint": "eslint --ext .js,.vue src",
+    "test": "echo \"No test specified\" && exit 0"
+  },
+  "dependencies": {
+    "@quasar/extras": "^1.0.0",
+    "axios": "^0.19.0",
+    "echarts": "^4.2.1",
+    "quasar": "^1.0.0-beta.0",
+    "v-charts": "^1.19.0"
+  },
+  "devDependencies": {
+    "@quasar/app": "^1.0.0-beta.0",
+    "@vue/eslint-config-standard": "^4.0.0",
+    "babel-eslint": "^10.0.1",
+    "eslint": "^5.10.0",
+    "eslint-loader": "^2.1.1",
+    "eslint-plugin-vue": "^5.0.0"
+  },
+  "engines": {
+    "node": ">= 8.9.0",
+    "npm": ">= 5.6.0",
+    "yarn": ">= 1.6.0"
+  },
+  "browserslist": [
+    "last 1 version, not dead, ie >= 11"
+  ]
+}

+ 2 - 2
frontend_sa/quasar.conf.js

@@ -74,10 +74,10 @@ module.exports = function (ctx) {
       env: ctx.dev
         ? { // so on dev we'll have
           // API: JSON.stringify('http://192.168.1.42:8022')
-          API: JSON.stringify('http://47.92.238.200:8022')
+          API: JSON.stringify('http://1.117.158.212:8022')
         }
         : { // and on build (production):
-          API: JSON.stringify('http://47.92.238.200:8022')
+          API: JSON.stringify('http://1.117.158.212:8022')
         },
       scopeHoisting: true,
       // vueRouterMode: 'history',

+ 6 - 0
frontend_sa/src/layouts/MyLayout.vue

@@ -39,6 +39,7 @@ export default {
   },
   mounted () {
     this.code = this.$route.query.code
+
     if (this.code === '90101001') {
       this.name = '山东省立医院'
     } else if (this.code === '90101002') {
@@ -46,6 +47,11 @@ export default {
     } else if (this.code === '90101006') {
       this.name = '山东省耳鼻喉医院'
     }
+
+    var screen = this.$route.query.screen
+    if (screen === '10') {
+      this.$router.push('/index10?code=' + this.code)
+    }
   },
   methods: {
     openURL

+ 0 - 304
frontend_sa/src/pages/Index1.vue

@@ -1,304 +0,0 @@
-<template>
-  <q-page padding>
-    <!-- content -->
-    <div class="q-pa-md">
-      <div class="column ">
-        <div class="q-pa-md">
-          <div class="row q-col-gutter-x-xs q-col-gutter-y-lg" v-touch-swipe.horizontal="userHasSwiped">
-            <div class="col-4" v-for="(v, index) in equipmentlist" :key="`none-${index}`" style="max-width: 16%">
-              <q-card
-                class="my-card bg-blue-2"
-              >
-                <q-item>
-                  <q-item-section avatar>
-                    <q-avatar>
-                      <img src="https://cdn.quasar.dev/img/avatar2.jpg">
-                      <audio id="soundjb"><source src="../statics/raw/jb.wav"></audio>
-                    </q-avatar>
-                  </q-item-section>
-                  <q-item-section>
-                    <q-item-label>{{v.Name}}</q-item-label>
-                    <q-item-label caption>{{v.Code}}</q-item-label>
-                  </q-item-section>
-                </q-item>
-                <q-separator inset />
-                <q-card-section style="height :220px"><ve-gauge :data="chartDatas[index]" :settings="chartSettings[index]"></ve-gauge></q-card-section>
-                <div class="row">
-                  <div class="col-8"> <div class="text-subtitle3" style="margin-left:15px;">Time:{{v.DataTime}}</div></div>
-                  <div class="col-4"> <img :src="getLevelv(v.Levelv)" style="width:30px;float:right;margin-right:15px;"><img :src="getLevelSignal(v.LevelSignal)"  style="float:right;margin-right:10px;width:30px;"></div>
-                </div>
-              </q-card>
-            </div>
-          </div>
-          <div class="q-pa-lg flex flex-center">
-            <q-pagination
-              input
-              v-model="currentPage"
-              :min="1"
-              :max="maxsize()"
-              @input="HandChange()"
-            />
-          </div>
-          <q-separator spaced/>
-          <div class="row q-col-gutter-xs">
-            <div class="col" v-for="n in 5" :key="`xs-${n}`">
-            </div>
-          </div>
-        </div>
-        <div class="col">
-          <div class="q-gutter-md">
-            <q-carousel
-              v-model="slide"
-              transition-prev="scale"
-              transition-next="scale"
-              swipeable
-              animated
-              control-color="white"
-              navigation
-              padding
-              arrows
-              height="200px"
-              class="bg-primary text-white shadow-1 rounded-borders"
-            >
-            <q-btn
-            push round dense color="orange" text-color="black" icon="arrow_left"
-            @click="$refs.carousel.previous()"
-          />
-              <q-carousel-slide name="tv0" v-if="lorem[0]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[0] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv1" v-if="lorem[1]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[1] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv2" v-if="lorem[2]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[2] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv3" v-if="lorem[3]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[3] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv4" v-if="lorem[4]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[4] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv5" v-if="lorem[5]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[5] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv6" v-if="lorem[6]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[6] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv7" v-if="lorem[7]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[7] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv8" v-if="lorem[8]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[8] }}</div>
-              </q-carousel-slide>
-              <q-carousel-slide name="tv9" v-if="lorem[9]" class="column no-wrap flex-center">
-                <q-icon name="warning" size="56px"/>
-                <div class="q-mt-md text-center">{{ lorem[9] }}</div>
-              </q-carousel-slide>
-              <template v-slot:control>
-        <q-carousel-control
-          position="bottom-right"
-          :offset="[18, 18]"
-        > 
-          <q-btn
-            push round dense color="white" text-color="primary"
-            :icon="fullscreen ? 'fullscreen_exit' : 'fullscreen'"
-            @click="startComputing(1)"
-          />
-        </q-carousel-control>
-      </template>
-            </q-carousel>
-          </div>
-        </div>
-      </div>
-    </div>
-  </q-page>
-</template>
-
-<script>
-import { channel, trigger } from '@/api/channel'
-export default {
-  // name: 'PageName',
-  data () {
-    return {
-      // 分页参数
-      loading1: false,
-      fullscreen: false,
-      percentage1: 0,
-      size: 12,
-      currentPage: 1,
-      currentItemCount: 0,
-      chartSettings: [],
-      equipmentlist: [],
-      chartDatas: [],
-      man: 0,
-      slide: '1',
-      lorem: []
-    }
-  },
-  mounted () {
-    let codem = this.$route.params.opera
-    console.log(this.$route.query.code,codem)
-    setInterval(() => {
-      this.trigger_history()
-    }, 6000)
-    this.initdate()
-  },
-  methods: {
-    initdate () {
-      let params = {
-        _currentPage: this.currentPage,
-        _size: this.size
-      }
-      channel('90101001', params)
-        .then(res => {
-          console.log(res, 'res.data')
-          this.equipmentlist = res.items
-          this.currentItemCount = res.currentItemCount
-          // this.equipmentlist = res
-          let chartDatas = []
-          for (var i = 0; i < this.equipmentlist.length; i++) {
-            let chartdata = {
-              columns: ['type', 'value'],
-              rows: [
-                { type: 't', value: -10.5 }
-                // { type: 'hum', value: 60.3 }
-              ]
-            }
-            chartdata.rows[0].value = this.equipmentlist[i].Temperature
-            // chartdata.rows[1].value = this.equipmentlist[i].Humidity
-            chartDatas.push(chartdata)
-            if (this.equipmentlist[i].MaxValue === 0) {
-              this.equipmentlist[i].MaxValue = this.equipmentlist[i].Temperature + 20
-            }
-            if (this.equipmentlist[i].MinValue === 0) {
-              this.equipmentlist[i].MinValue = this.equipmentlist[i].Temperature - 25
-            }
-            let chartSetting = {
-              dataName: {
-                't': ''
-                // 'hum': '%'
-              },
-              seriesMap: {
-                't': {
-                  center: ['50%', '30%'],
-                  min: this.equipmentlist[i].MinValue,
-                  max: this.equipmentlist[i].MaxValue,
-                  splitNumber: 5,
-                  axisLine: {
-                    lineStyle: {
-                      // color: [[0.1, '#ff5a5c'], [0.9, '#70ffb3'], [1, '#ff5a5c']]
-                      color: [[0.1, '#ff4500'], [0.9, '#1e90ff'], [1, '#ff4500']]
-                    }
-                  }
-                }
-                // 'hum': {
-                //   center: ['85%', '10%'],
-                //   radius: '30%',
-                //   startAngle: 135,
-                //   endAngle: 45,
-                //   splitNumber: 2,
-                //   min: 0,
-                //   max: 100,
-                //   pointer: {
-                //     width: 2,
-                //     shadowColor: '#d8e300',
-                //     shadowBlur: 5
-                //   }
-                // }
-              }
-            }
-            this.chartSettings.push(chartSetting)
-          }
-          this.chartDatas = chartDatas
-          console.log('data=', this.equipmentlist)
-        })
-        .catch(err => console.log('err=', err))
-    },
-    maxsize () {
-      return Math.ceil(this.currentItemCount / this.size)
-    },
-    userHasSwiped (obj) {
-      if (obj.direction === 'right' && this.currentPage > 1) {
-        this.currentPage -= 1
-      }
-      if (obj.direction === 'left' && this.currentPage < this.maxsize()) {
-        this.currentPage += 1
-      }
-      console.log(obj, this.currentPage)
-      this.initdate()
-    },
-    HandChange () {
-      this.initdate()
-    },
-    trigger_history () {
-      trigger('90101001')
-        .then(res => {
-          if (res.length > 0) {
-            document.getElementById('soundjb').play()
-          }
-          if (this.lorem.length >= 9) {
-            for (var y = 0; y < (res.length); y++) {
-              this.lorem[this.man] = res[y]
-              this.man = this.man + 1
-              if (this.man > 9) {
-                this.man = 0
-              }
-            }
-          } else {
-            if (res.length > 0) {
-              for (var i = 0; i < res.length; i++) {
-                if (this.lorem.length === 10) {
-                  this.lorem[this.man] = res[i]
-                  this.man = this.man + 1
-                } else {
-                  this.lorem.push(res[i])
-                }
-              }
-            }
-          }
-        })
-        .catch(err => console.log('err=', err))
-    },
-    startComputing (id) {
-      this.lorem = []
-      this[`loading${id}`] = true
-      this[`percentage${id}`] = 0
-      this[`interval${id}`] = setInterval(() => {
-        this[`percentage${id}`] += Math.floor(Math.random() * 8 + 10)
-        if (this[`percentage${id}`] >= 100) {
-          clearInterval(this[`interval${id}`])
-          this[`loading${id}`] = false
-        }
-      }, 400)
-    },
-    getLevelv (v) {
-      return '../statics/images/dianchi_' + v + '.png'
-    },
-    getLevelSignal (v) {
-      return '../statics/images/signal_' + v + '.png'
-    }
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-  .my-card {
-    width: 100%;
-    max-width: 400px;
-    min-width: 250px;
-  }
-
-  .my-card2 {
-    width: 100%;
-  }
-</style>

+ 484 - 0
frontend_sa/src/pages/Index10.vue

@@ -0,0 +1,484 @@
+<template>
+  <q-page >
+    <!-- content -->
+    <div class="q-pa-md">
+      <div class="column ">
+        <div class="q-pa-md">
+          <div class="row q-col-gutter" v-touch-swipe.horizontal="userHasSwiped">
+            <div class="col-3" v-for="(v, index) in equipmentlist" :key="`none-${index}`" style="max-width: 19%;margin:5px;">
+              <q-card
+                class="my-card bg-blue-2"
+              >
+                <q-item>
+                  <q-item-section avatar>
+                    <q-avatar>
+                      <img src="../statics/images/online0.png" v-if="v.Online === 0" style="width:20px;height:20px">
+                      <img src="../statics/images/online1.png" v-if="v.Online === 1" style="width:20px;height:20px">
+                      <audio id="soundjb"><source src="../statics/raw/jb1.mp3"></audio>
+                    </q-avatar>
+                  </q-item-section>
+                  <q-item-section>
+                    <q-item-label>{{v.Name}}</q-item-label>
+                    <q-item-label caption>{{v.Code}}</q-item-label>
+                  </q-item-section>
+                </q-item>
+                <q-separator inset />
+                <q-card-section style="height :280px"><ve-gauge :data="chartDatas[index]" :settings="chartSettings[index]"></ve-gauge></q-card-section>
+                <div class="row">
+                  <div class="col-8"> <div class="text-subtitle3" style="margin-left:15px;">{{v.DataTime}}</div></div>
+                  <div class="col-4"> <img :src="getLevelv(v.Levelv)" style="width:20px;float:left;margin-right:10px;"><img :src="getLevelSignal(v.LevelSignal)"  style="float:left;margin-right:10px;width:30px;"></div>
+                </div>
+              </q-card>
+            </div>
+          </div>
+          <div class="q-pa-lg flex flex-center">
+            <q-pagination
+              input
+              v-model="currentPage"
+              :min="1"
+              :max="maxsize()"
+              @input="HandChange()"
+            />
+          </div>
+          <q-separator spaced/>
+          <div class="row q-col-gutter-xs" style="margin:-30px;">
+            <div class="col" v-for="n in 5" :key="`xs-${n}`">
+            </div>
+          </div>
+        </div>
+        <div  >
+          <div >
+            <q-carousel
+              v-model="slide"
+              transition-prev="scale"
+              transition-next="scale"
+              swipeable
+              animated
+              control-color="white"
+              navigation
+              padding
+              arrows
+              height="180px"
+              class="bg-primary text-white shadow-1 rounded-borders"
+            >
+            <q-btn
+            push round dense color="orange" text-color="black" icon="arrow_left"
+            @click="$refs.carousel.previous()"
+          />
+              <q-carousel-slide name="tv00" v-if="lorem2 === 0" class="column no-wrap flex-center">
+                <q-icon name="style" size="56px"/>
+                 <div class="text-h4" >设备正常</div>
+                 <div class="text-subtitle1">无报警</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv0" v-if="lorem[0]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                 <div class="text-h4 text-red text-red">{{ lorem[0] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv1" v-if="lorem[1]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-center text-red">{{ lorem[1] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv2" v-if="lorem[2]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[1] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv3" v-if="lorem[3]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[3] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv4" v-if="lorem[4]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[4] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv5" v-if="lorem[5]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[5] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv6" v-if="lorem[6]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[6] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv7" v-if="lorem[7]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[7] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv8" v-if="lorem[8]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red text-center">{{ lorem[8] }}</div>
+              </q-carousel-slide>
+              <q-carousel-slide name="tv9" v-if="lorem[9]" class="column no-wrap flex-center">
+                <q-icon name="warning" size="56px" color="red"/>
+                <div class="text-h4 text-red  text-center">{{ lorem[9] }}</div>
+              </q-carousel-slide>
+              <template v-slot:control>
+        <q-carousel-control
+          position="bottom-right"
+          :offset="[18, 18]"
+        >
+          <q-btn
+            push round dense color="orange" text-color="black" icon="arrow_right" style=""
+            @click="stop()"
+          />
+          <q-btn
+            push round dense color="white" text-color="primary" style=" float:right;margin-right:50px;"
+            :icon="fullscreen ? 'fullscreen_exit' : 'fullscreen'"
+            @click="startComputing(1)"
+          />
+        </q-carousel-control>
+      </template>
+            </q-carousel>
+          </div>
+        </div>
+      </div>
+    </div>
+  </q-page>
+</template>
+
+<script>
+import { channel, trigger } from '@/api/channel'
+export default {
+  // name: 'PageName',
+  data () {
+    return {
+      isPlaying: false,
+      fullscreen: false,
+      code: '',
+      // 分页参数
+      loading1: false,
+      percentage1: 0,
+      size: 5,
+      asd: true,
+      currentPage: 1,
+      currentItemCount: 0,
+      chartSettings: [],
+      equipmentlist: [],
+      chartDatas: [],
+      chartdata: [],
+      man: 0,
+      slide: 'tv00',
+      lorem: [],
+      lorem2: 0
+    }
+  },
+  mounted () {
+    this.code = this.$route.query.code
+    // this.code = '90101001'
+    setInterval(() => {
+      this.trigger_history(this.code)
+    }, 180000)
+    this.initdate()
+    setInterval(() => {
+      if (this.currentItemCount > 5) {
+        if (this.currentPage === 1) {
+          this.currentPage = 2
+          // if (this.code === '90101002') {
+          //   this.asd = false
+          // }
+        } else {
+          // this.asd = true
+          this.currentPage = 1
+        }
+      }
+      this.initdate()
+    }, 33333)
+
+    // this.initdate()
+  },
+  methods: {
+    initdate () {
+      let params = {
+        _currentPage: this.currentPage,
+        _size: this.size
+      }
+      channel(this.code, params)
+        .then(res => {
+          this.equipmentlist = res.items
+          this.currentItemCount = res.currentItemCount
+          // this.equipmentlist = res
+          let chartDatas = []
+          this.chartSettings = []
+
+          for (var i = 0; i < this.equipmentlist.length; i++) {
+            console.log('-----this.equipmentlist[i].DataItem--------', this.equipmentlist[i].DataItem)
+            if (this.equipmentlist[i].DataItem === 6) {
+              this.chartdata = {
+                columns: ['type', 'value'],
+                rows: [
+                  { type: 't', value: -10.5 }
+                  // { type: 'hum', value: 60.3 }
+                ]
+              }
+              this.chartdata.rows[0].value = this.equipmentlist[i].Temperature
+              if (this.equipmentlist[i].MaxValue === 0) {
+                this.equipmentlist[i].MaxValue = this.equipmentlist[i].Temperature + 20
+              }
+              if (this.equipmentlist[i].MinValue === 0) {
+                this.equipmentlist[i].MinValue = this.equipmentlist[i].Temperature - 25
+              }
+              let chartSetting = {
+                dataName: {
+                  't': '℃'
+                  // 'hum': '%'
+                },
+                seriesMap: {
+                  't': {
+                    radius: '100%',
+                    center: ['50%', '37%'],
+                    min: this.equipmentlist[i].MinValue,
+                    max: this.equipmentlist[i].MaxValue,
+                    splitNumber: 5,
+                    axisLine: {
+                      lineStyle: {
+                        // color: [[0.1, '#ff5a5c'], [0.9, '#70ffb3'], [1, '#ff5a5c']]
+                        color: [[0.1, '#ff4500'], [0.9, '#1e90ff'], [1, '#ff4500']]
+                      }
+                    },
+                    detail: {
+                      offsetCenter: [0, '60%']
+                    }
+                  }
+                }
+              }
+
+              chartDatas.push(this.chartdata)
+              this.chartSettings.push(chartSetting)
+            } else if (this.equipmentlist[i].DataItem === 17) {
+              this.chartdata = {
+                columns: ['type', 'value'],
+                rows: [
+                  { type: 't', value: -10.5 }
+                  // { type: 'hum', value: 60.3 }
+                ]
+              }
+              this.equipmentlist[i].Levelv = 4
+              this.chartdata.rows[0].value = this.equipmentlist[i].O2
+              let chartSetting = {
+                dataName: {
+                  't': '%'
+                },
+                seriesMap: {
+                  't': {
+                    center: ['40%', '32%'],
+                    min: 0,
+                    max: 24,
+                    splitNumber: 5,
+                    axisLine: {
+                      lineStyle: {
+                        color: [[0.1, '#ff4500'], [0.9, '#1e90ff'], [1, '#ff4500']]
+                      }
+                    }
+                  }
+                }
+              }
+              chartDatas.push(this.chartdata)
+              this.chartSettings.push(chartSetting)
+            } else if (this.equipmentlist[i].DataItem === 26) {
+              this.chartdata = {
+                columns: ['type', 'value'],
+                rows: [
+                  { type: 't', value: -10.5 }
+                  // { type: 'hum', value: 60.3 }
+                ]
+              }
+              this.equipmentlist[i].Levelv = 4
+              this.chartdata.rows[0].value = this.equipmentlist[i].CO2
+              let chartSetting = {
+                dataName: {
+                  't': '%'
+                },
+                seriesMap: {
+                  't': {
+                    radius: '100%',
+                    center: ['50%', '37%'],
+                    min: 0,
+                    max: 20,
+                    splitNumber: 5,
+                    axisLine: {
+                      lineStyle: {
+                        color: [[0.1, '#1e90ff'], [0.9, '#1e90ff'], [1, '#1e90ff']]
+                      }
+                    }
+                  }
+                }
+              }
+              chartDatas.push(this.chartdata)
+              this.chartSettings.push(chartSetting)
+            } else if (this.equipmentlist[i].DataItem === 0) {
+              this.chartdata = {
+                columns: ['type', 'value'],
+                rows: [
+                  { type: 't', value: -10.5 },
+                  { type: 'hum', value: 60.3 }
+                ]
+              }
+              this.chartdata.rows[0].value = this.equipmentlist[i].Temperature
+              this.chartdata.rows[1].value = this.equipmentlist[i].Humidity
+              if (this.equipmentlist[i].MaxValue === 0) {
+                this.equipmentlist[i].MaxValue = this.equipmentlist[i].Temperature + 20
+              }
+              if (this.equipmentlist[i].MinValue === 0) {
+                this.equipmentlist[i].MinValue = this.equipmentlist[i].Temperature - 25
+              }
+              let chartSetting = {
+                dataName: {
+                  't': '℃',
+                  'hum': '%'
+                },
+                seriesMap: {
+                  't': {
+                    radius: '100%',
+                    center: ['50%', '37%'],
+                    min: this.equipmentlist[i].MinValue,
+                    max: this.equipmentlist[i].MaxValue,
+                    splitNumber: 5,
+                    axisLine: {
+                      lineStyle: {
+                        // color: [[0.1, '#ff5a5c'], [0.9, '#70ffb3'], [1, '#ff5a5c']]
+                        color: [[0.1, '#ff4500'], [0.9, '#1e90ff'], [1, '#ff4500']]
+                      }
+                    },
+                    detail: {
+                      offsetCenter: [0, '60%']
+                    }
+                  },
+                  'hum': {
+                    center: ['85%', '9%'],
+                    radius: '25%',
+                    startAngle: 135,
+                    endAngle: 40,
+                    splitNumber: null,
+                    min: 0,
+                    max: 100,
+                    pointer: {
+                      color: [[0.2, '#ff4500'], [0.8, '#ff4500'], [1, '#ff4500']],
+                      width: 2,
+                      // shadowColor: '#d8e300',
+                      shadowColor: '#fff',
+                      shadowBlur: 5
+                    },
+                    axisLine: {
+                      lineStyle: {
+                        // color: [[0.1, '#ff5a5c'], [0.9, '#70ffb3'], [1, '#ff5a5c']]
+                        color: [[0.1, '#42a1eb'], [0.9, '#42a1eb'], [1, '#42a1eb']]
+                      }
+                    }
+                  }
+                }
+              }
+
+              chartDatas.push(this.chartdata)
+              this.chartSettings.push(chartSetting)
+            }
+          }
+          this.chartDatas = chartDatas
+        })
+        .catch(err => console.log('err=', err))
+    },
+    maxsize () {
+      return Math.ceil(this.currentItemCount / this.size)
+    },
+    userHasSwiped (obj) {
+      if (obj.direction === 'right' && this.currentPage > 1) {
+        this.currentPage -= 1
+      }
+      if (obj.direction === 'left' && this.currentPage < this.maxsize()) {
+        this.currentPage += 1
+      }
+      console.log(obj, this.currentPage)
+      this.initdate()
+    },
+    HandChange () {
+      // console.log('------this.currentPage------', this.currentPage)
+      // if (this.code === '90101002' && this.currentPage === 1) {
+      //   this.asd = true
+      // } else if (this.code === '90101002' && this.currentPage === 2) {
+      //   this.asd = true
+      // }
+      this.initdate()
+    },
+    play () {
+      var audio = document.querySelector('#soundjb')
+      if (!this.isPlaying) {
+        audio.play()
+        this.isPlaying = true
+      }
+    },
+    stop () {
+      var audio = document.querySelector('#soundjb')
+      if (this.isPlaying) {
+        audio.pause()
+        audio.currentTime = 0
+      }
+    },
+    trigger_history (code) {
+      trigger(code)
+        .then(res => {
+          if (res.length > 0) {
+            this.isPlaying = false
+            this.slide = 'tv0'
+            this.lorem2 = 1
+            this.play()
+          }
+          if (this.lorem.length >= 9) {
+            for (var y = 0; y < (res.length); y++) {
+              this.lorem[this.man] = res[y]
+              this.man = this.man + 1
+              if (this.man > 9) {
+                this.man = 0
+              }
+            }
+          } else {
+            if (res.length > 0) {
+              for (var i = 0; i < res.length; i++) {
+                if (this.lorem.length === 10) {
+                  this.lorem[this.man] = res[i]
+                  this.man = this.man + 1
+                } else {
+                  this.lorem.push(res[i])
+                }
+              }
+            }
+          }
+        })
+        .catch(err => console.log('err=', err))
+    },
+    startComputing (id) {
+      this.stop()
+      this.lorem = []
+      this.lorem2 = 0
+      this.slide = 'tv00'
+      this[`loading${id}`] = true
+      this[`percentage${id}`] = 0
+      this[`interval${id}`] = setInterval(() => {
+        this[`percentage${id}`] += Math.floor(Math.random() * 8 + 10)
+        if (this[`percentage${id}`] >= 100) {
+          clearInterval(this[`interval${id}`])
+          this[`loading${id}`] = false
+        }
+      }, 400)
+    },
+    getLevelv (v) {
+      return '../statics/images/dianchi_' + v + '.png'
+    },
+    getLevelSignal (v) {
+      return '../statics/images/signal_' + v + '.png'
+    }
+  }
+}
+</script>
+
+<style lang="stylus" scoped>
+  .my-card {
+    width: 100%;
+    min-width: 220px;
+  }
+
+  .my-card2 {
+    width: 100%;
+  }
+  .none-class{
+    margin-top:320px;
+  }
+  .block-class{
+  }
+</style>

+ 0 - 68
frontend_sa/src/pages/MyNewPage1.vue

@@ -1,68 +0,0 @@
-<template>
-  <div class="q-pa-md row items-start q-gutter-md">
-    <q-card class="my-card">
-      <q-card-section>
-        {{ lorem }}
-      </q-card-section>
-    </q-card>
-
-    <q-card
-      class="my-card text-white"
-      style="background: radial-gradient(circle, #35a2ff 0%, #014a88 100%)"
-    >
-      <q-card-section>
-        <div class="text-h6">Our Changing Planet</div>
-        <div class="text-subtitle2">by John Doe</div>
-      </q-card-section>
-
-      <q-card-section>
-        {{ lorem }}
-      </q-card-section>
-    </q-card>
-
-    <q-card dark bordered class="bg-grey-9 my-card">
-      <q-card-section>
-        <div class="text-h6">Our Changing Planet</div>
-        <div class="text-subtitle2">by John Doe</div>
-      </q-card-section>
-
-      <q-separator dark inset />
-
-      <q-card-section>
-        {{ lorem }}
-      </q-card-section>
-    </q-card>
-
-    <q-card flat bordered class="my-card">
-      <q-card-section>
-        <div class="text-h6">Our Changing Planet</div>
-      </q-card-section>
-
-      <q-card-section>
-        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
-        tempor incididunt ut labore et dolore magna aliqua.
-      </q-card-section>
-
-      <q-separator inset />
-
-      <q-card-section>
-        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
-        tempor incididunt ut labore et dolore magna aliqua.
-      </q-card-section>
-    </q-card>
-  </div>
-</template>
-<script>
-export default {
-  data () {
-    return {
-      lorem: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
-    }
-  }
-}
-</script>
-<style lang="stylus" scoped>
-.my-card
-  width 100%
-  max-width 250px
-</style>

+ 2 - 1
frontend_sa/src/router/routes.js

@@ -4,7 +4,8 @@ const routes = [
     path: '/',
     component: () => import('layouts/MyLayout.vue'),
     children: [
-      { path: '', component: () => import('pages/Index.vue') }
+      { path: '', component: () => import('pages/Index.vue') },
+      { path: '/index10', component: () => import('pages/Index10.vue') }
     ]
   }
 ]

BIN
frontend_sa/src/statics/images/dianchi_0.png


+ 1 - 1
frontend_sa/yarn.lock

@@ -6042,7 +6042,7 @@ strip-ansi@5.2.0, strip-ansi@^5.0.0, strip-ansi@^5.1.0:
   dependencies:
     ansi-regex "^4.1.0"
 
-strip-ansi@=3.0.1, strip-ansi@^3.0.0, strip-ansi@^3.0.1:
+strip-ansi@^3.0.0, strip-ansi@^3.0.1:
   version "3.0.1"
   resolved "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
   dependencies:

+ 36 - 0
frontend_sa10/package.json

@@ -0,0 +1,36 @@
+{
+  "name": "mcs_sa",
+  "version": "0.0.1",
+  "description": "mcs_sa",
+  "productName": "mcs_sa",
+  "cordovaId": "org.cordova.quasar.app",
+  "author": "sunmiao <sunmiao@dashoo.cn>",
+  "private": true,
+  "scripts": {
+    "lint": "eslint --ext .js,.vue src",
+    "test": "echo \"No test specified\" && exit 0"
+  },
+  "dependencies": {
+    "@quasar/extras": "^1.0.0",
+    "axios": "^0.19.0",
+    "echarts": "^4.2.1",
+    "quasar": "^1.0.0-beta.0",
+    "v-charts": "^1.19.0"
+  },
+  "devDependencies": {
+    "@quasar/app": "^1.0.0-beta.0",
+    "@vue/eslint-config-standard": "^4.0.0",
+    "babel-eslint": "^10.0.1",
+    "eslint": "^5.10.0",
+    "eslint-loader": "^2.1.1",
+    "eslint-plugin-vue": "^5.0.0"
+  },
+  "engines": {
+    "node": ">= 8.9.0",
+    "npm": ">= 5.6.0",
+    "yarn": ">= 1.6.0"
+  },
+  "browserslist": [
+    "last 1 version, not dead, ie >= 11"
+  ]
+}

+ 2 - 0
frontend_sa10/src/layouts/MyLayout.vue

@@ -43,6 +43,8 @@ export default {
       this.name = '山东省立医院'
     } else if (this.code === '90101002') {
       this.name = '山东省妇幼保健院'
+    } else if (this.code === '90101006') {
+      this.name = '山东省耳鼻喉医院'
     }
   },
   methods: {

+ 5 - 0
frontend_sa10/src/pages/Index.vue

@@ -115,9 +115,14 @@
           position="bottom-right"
           :offset="[18, 18]"
         >
+          <q-btn
+            push round dense color="orange" text-color="black" icon="arrow_right" style=""
+            @click="stop()"
+          />
           <q-btn
             push round dense color="white" text-color="primary" style=" float:right;margin-right:50px;"
             :icon="fullscreen ? 'fullscreen_exit' : 'fullscreen'"
+            @click="startComputing(1)"
           />
         </q-carousel-control>
       </template>

BIN
frontend_sa10/src/statics/images/dianchi_0.png