Procházet zdrojové kódy

风机绩效模块修改、table组件修改

yangxiao před 3 roky
rodič
revize
81c8cfa5c8

+ 1 - 1
public/static/config/modeConfig.js

@@ -1,6 +1,6 @@
 
 // 本地联调开关
-const localTest = 0;
+const localTest = 1;
 
 // 服务器地址
 let baseURL = null;

+ 10 - 1
src/components/coms/table/table.vue

@@ -104,11 +104,20 @@ export default {
   },
   // 函数
   methods: {
+    clearCheckBox(time){
+      this.$nextTick(()=>{
+        setTimeout(()=>{
+          const domArray = document.querySelectorAll(".curCheckBox");
+          for(let i=0;i<domArray.length;i++){
+            domArray[i].checked=false;
+          }
+        },(time || 300));
+      });
+    },
     onClick(col, data) {
       if (col.click) col.click(event, data);
     },
     onSort(col) {
-		console.log(col)
       if (col.sortable == true) {
         this.sortCol = col.field;
         switch (this.sortType) {

+ 7 - 3
src/views/Decision/Decision2.vue

@@ -62,7 +62,7 @@
 		<div v-show="detailShow==1">
 			<div class="mg-b-16">
 				<div class="project-table">
-					<Table :data="tableData" :canScroll="false"></Table>
+					<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
 				</div>
 			</div>
 			<el-row class="mg-b-16">
@@ -140,10 +140,13 @@
 							field: "check",
 							is_num: false,
 							is_light: false,
-							template: function() {
-								return "<input class='check' type='CheckBox'/>";
+							template:() => {
+								// return "<el-checkbox v-model='row.checked'></el-checkbox>";
+								return "<input class='check curCheckBox' type='CheckBox' />";
 							},
 							click: function(event, data) {
+                console.log(11111,event)
+                console.log(22222,data)
 								// checkbox 事件
 								// event.target checkbox or td 需进行判断
 								// event.target.checked 判断 checkbox 是否选中
@@ -614,6 +617,7 @@
 				this.value3 = [];
 				this.AjaxCommon();
 				this.XiangMuVal(val);
+        this.$refs.curRef.clearCheckBox()
 			},
 			XiangMuVal(val) {
 				var that = this;

+ 12 - 2
src/views/Home/Home.vue

@@ -4,8 +4,8 @@
       <Col :span="6">
       <Row type="flex">
         <Col :span="24">
-        <com-panel title="银川" sub-title="AM 10:52 实况" icon="fa fa-map-marker">
-          <weather />
+        <com-panel :title="tqmap.name || 'yc'" :sub-title="nowTime + ' 实况'" icon="fa fa-map-marker">
+          <weather :data="tqmap" />
         </com-panel>
         </Col>
       </Row>
@@ -469,12 +469,15 @@ export default {
   data () {
     return {
       timmer: null, // 计时器
+      timmer2:null,
       jczbmap: {},
       wxssmap: {},
       gxkmap: {},
       mxztmap: {},
       planData: {},
       powerData: {},
+      tqmap:{},
+      nowTime:"",
       powerLineChartData: {
         // 图表所用单位
         units: [""],
@@ -652,6 +655,7 @@ export default {
           that.gxkmap = res.data.gxkmap;
           that.mxztmap = res.data.mxztmap;
           that.fcmap = res.data.fcmap;
+          that.tqmap = res.data.tqmap;
 
           that.ForecastPower = [{
             name: "当日预测电量",
@@ -765,17 +769,23 @@ export default {
 
   created () {
     let that = this;
+    that.nowTime = new Date().formatDate("hh:mm:ss");
     that.$nextTick(() => {
       that.requestData(false);
       that.timmer = setInterval(() => {
         that.requestData(false);
       }, that.$store.state.websocketTimeSec);
+      that.timmer2 = setInterval(() => {
+        that.nowTime = new Date().formatDate("hh:mm:ss");
+      }, 1000);
     });
   },
 
   unmounted () {
     clearInterval(this.timmer);
+    clearInterval(this.timmer2);
     this.timmer = null;
+    this.timmer2 = null;
   }
 };
 </script>

+ 1 - 1
src/views/Home/components/map/svg-map-nx.vue

@@ -163,7 +163,7 @@
                 <!-- +5 +12| -->
                 <text x="440" y="77" fill="#919697" font-size="14">牛首山</text>
                 <!-- +70 0 -->
-                <text x="505" y="77" fill="#05bb4c" font-size="14">{{sourceMap.NSS_FDC_zjts}}</text>
+                <text x="505" y="77" fill="#05bb4c" font-size="14">{{sourceMap.NSS_FDC_zjts}}</text>
             </g>
             <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click="clickLabel('DWK_GDC')" @mouseover="mouseover(4)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="570" y="5" />

+ 25 - 8
src/views/Home/components/weather.vue

@@ -3,14 +3,14 @@
   <div class="weather">
     <div class="weather-info">
       <span class="svg-icon">
-        <svg-icon class="weather-icon" svgid="svg-duoyun" />
+        <svg-icon class="weather-icon" :svgid="'svg-' + sourceMap.tqtp" />
       </span>
       <div>
-        <div class="temperature">{{ temperature }} °</div>
+        <div class="temperature">{{ sourceMap.wd }} °</div>
         <div class="other">
-          <span>{{ weather }}</span>
-          <span>{{ windDirection }}</span>
-          <span>{{ windSpeed }}</span>
+          <span>{{ sourceMap.tqmc }}</span>
+          <span>{{ sourceMap.fx }}</span>
+          <span>{{ sourceMap.fs }}</span>
         </div>
       </div>
     </div>
@@ -20,21 +20,21 @@
           <div class="svg-icon svg-icon-sm svg-icon-green other-icon">
             <svg-icon svgid="svg-能见度" />
           </div>
-          <div class="value">{{ visibility }}</div>
+          <div class="value">{{ sourceMap.qxd }}</div>
           <div class="text">能见度</div>
         </Col>
         <Col>
           <div class="svg-icon svg-icon-sm svg-icon-green other-icon">
             <svg-icon svgid="svg-湿度" />
           </div>
-          <div class="value">{{ humidity }}</div>
+          <div class="value">{{ sourceMap.sd }}</div>
           <div class="text">湿度</div>
         </Col>
         <Col>
           <div class="svg-icon svg-icon-sm svg-icon-green other-icon">
             <svg-icon svgid="svg-气压" />
           </div>
-          <div class="value">{{ pressure }}</div>
+          <div class="value">{{ sourceMap.dqyl }}kPa</div>
           <div class="text">气压</div>
         </Col>
         <Col>
@@ -63,9 +63,16 @@ import SvgIcon from "../../../components/coms/icon/svg-icon.vue";
 
 export default {
   components: { Row, Col, SvgIcon },
+  props:{
+    data:{
+      type:Object,
+      default:() => { }
+    }
+  },
   // 数据自己获取天气情况
   data() {
     return {
+      sourceMap:{},
       weather: "阴", // 气象
       temperature: "11", // 温度
       windDirection: "北风", // 风向
@@ -77,6 +84,16 @@ export default {
       sunset: "18:50", // 日落
     };
   },
+
+  mounted(){
+    this.sourceMap=this.data;
+  },
+
+  watch:{
+    data(res){
+      this.sourceMap=res;
+    }
+  }
 };
 </script>