Преглед изворни кода

1.1 批量升级 可维护 编辑 删除

64060764@qq.com пре 1 година
родитељ
комит
81a518e53a

+ 6 - 0
src/js/api.js

@@ -44,3 +44,9 @@ export function getCityList(data) {
 export function getAreaList(data) {
 	return post(base + "area/list", data);
 }
+
+//
+export function getReportTitle(data){
+	return post(base +'report/content/detail',data)
+}
+

+ 7 - 1
src/views/equip-management/edit-box/index.vue

@@ -2379,12 +2379,17 @@
                         <custom-input-number class="form-input-s" :watchObj="activeOperateEnd.cbMainComAdd" v-model="activeOperateEnd.cbMainComAdd" :precision="0"></custom-input-number>
                       </el-form-item>
                     </el-col>
+<!--                    <div v-if="this.activeOperateEnd.endDeviceOption != undefined">{{this.activeOperateEnd.endDeviceOption.length}}</div>-->
+<!--                    <div v-else>this.activeOperateEnd.endDeviceOption == undefined</div>-->
+<!--                    <div>{{this.activeOperateEnd.endDeviceOption.length}}</div>-->
+<!--                    <div>{{this.activeOperateEnd.endDeviceOption[0].cbAddrOffset}}</div>-->
 
-                    <el-col class="w-percent-20" v-if="">ddd
+                    <el-col class="w-percent-20" v-if="this.activeOperateEnd.endDeviceOption != undefined && this.activeOperateEnd.endDeviceOption[0].cbAddrOffset>0">对应插件偏移量非0才显示
                       <el-form-item label="二级地址">
                         <custom-input-number class="form-input-s" :watchObj="activeOperateEnd.cbSecondAddr" v-model="activeOperateEnd.cbSecondAddr" :precision="0"></custom-input-number>
                       </el-form-item>
                     </el-col>
+<!--                    <div>{{this.activeOperateEnd.endDeviceOption[0].cbAddrOffset}}{{this.activeOperateEnd.endDeviceOption[0].cbAddrOffset>0}}</div>-->
 
                   </el-row>
                 </div>
@@ -8092,6 +8097,7 @@ export default {
         if (res.code === 200) {
           this.activeOperateEnd.endDeviceOption =
             res.result.apparatus_model_list;
+          console.log(this.activeOperateEnd.endDeviceOption);
           this.activeOperateEnd.cbMixinPlugin = res.result.plugin_id;
         }
       }

+ 44 - 4
src/views/equip-management/report/list.vue

@@ -102,7 +102,7 @@
 					</el-table-column>
 
 					<!-- 主机列 Begin -->
-					<el-table-column label="主机控制器" align="center" width="60">
+					<el-table-column label="" align="center" width="60" :render-header="(h, obj) => renderHeader(h, obj, '主机控制器')">
 						<el-table-column prop="host_order" label="编号" align="center" width="60">
 							<template slot-scope="scope">
 								<span>{{ scope.row.host_order || '/' }}</span>
@@ -166,7 +166,7 @@
 					<!-- 主机列 End -->
 
 					<!-- 新风机列 Begin -->
-					<el-table-column label="新风机控制器" align="center" width="60">
+					<el-table-column label="" align="center" width="60" :render-header="(h, obj) => renderHeader(h, obj, '新风机控制器')">
 						<el-table-column prop="nt_order" label="编号" align="center" width="60">
 							<template slot-scope="scope">
 								<span>{{ scope.row.nt_order || '/' }}</span>
@@ -231,7 +231,7 @@
 					<!-- 新风机列 End -->
 
 					<!-- 换热站列 Begin -->
-					<el-table-column label="换热站控制器" align="center" width="60">
+					<el-table-column label="" align="center" width="60" :render-header="(h, obj) => renderHeader(h, obj, '换热站控制器')">
 						<el-table-column prop="hex_order" label="编号" align="center" width="60">
 							<template slot-scope="scope">
 								<span>{{ scope.row.hex_order || '/' }}</span>
@@ -308,7 +308,7 @@
 					<!-- 换热站列 End -->
 
 					<!-- 末端列 Begin -->
-					<el-table-column label="末端控制器" align="center" width="60">
+					<el-table-column label="" align="center" width="60" :render-header="(h, obj) => renderHeader(h, obj, '末端控制器')">
 						<!-- <el-table-column prop="end_order" label="编号" align="center" width="60" /> -->
 						<el-table-column prop="end_exception_num" label="通讯异常数量" align="center" width="120">
 							<template slot-scope="scope">
@@ -389,6 +389,10 @@
 				<el-dialog :title="dialog.title" :visible.sync="dialog.show" width="60%">
 					<pop-more-table :visible="dialog.show" :tableData="dialog.tableData" :columns="dialog.tableColumns"></pop-more-table>
 				</el-dialog>
+
+				<el-dialog :title="titleTxt" :visible.sync="showTitle" width="60%">
+<div style="margin: 20px">{{this.Title}}</div>
+				</el-dialog>
 			</div>
 		</div>
 
@@ -408,6 +412,7 @@ import Vue from 'vue';
 import ScrollBar from '../../../js/scrollbar.js';
 import "perfect-scrollbar/css/perfect-scrollbar.css";
 import {getAreaList, getCityList, getProvinceList} from "../../../js/api";
+import {getReportTitle} from "@/js/api";
 Vue.directive('fixed-scroll', ScrollBar);
 
 export default {
@@ -578,6 +583,9 @@ export default {
 			faultMap: define.faultDict,
 			runStatOptions: define.runStatOpts,
 			runModeOptions: define.runModeOpts,
+			showTitle:false,
+			Title:'',
+			titleTxt:'',
 			dialog: {
 				show: false,
 				title: '',
@@ -600,6 +608,38 @@ export default {
 	// 	}
 	// },
 	methods: {
+		renderHeader(h, { column, $index }, type){
+			let that = this;
+			return h(
+					'div',[
+						// 列名称
+						h('span', column.label),
+						// 按钮
+						h('el-button', {
+							props: {
+								type: 'text',
+								size: 'medium',
+							},
+							style: 'margin-left: 5px;',
+							on: {
+								click: async function () {
+									// that.clickButton(type);
+									const res = await getReportTitle({title:type});
+									if (res.code === 200) {
+										//this.provinceOption = res.result;
+										// alert(res.result.Content);
+										console.log(res.result.Content);
+										that.showTitle = true;
+										that.Title = res.result.Content;
+										that.titleTxt = type;
+									}
+									//alert(type);
+								}
+							}
+						}, type)
+					],
+			)
+		},
 		changeSort(val){
 			console.log('changeSort.val is:', val,val.prop,val.order)
 

+ 14 - 4
src/views/inner-management/gateway/index.vue

@@ -248,8 +248,13 @@
                     <el-button
                             class="make-sure-button"
                             type="danger"
-                            @click="makeSureAddOperate1()"
-                    >确 认</el-button>
+                            @click="makeSureAddOperate1('delay')"
+                    >定时升级</el-button>
+                    <el-button
+                            class="make-sure-button"
+                            type="success"
+                            @click="makeSureAddOperate1('now')"
+                    >立即升级</el-button>
                 </div>
             </div>
 
@@ -443,11 +448,16 @@
                     this.deleteRows([row])
                 }
             },
-            async makeSureAddOperate1() {
+            async makeSureAddOperate1(val) {
                 console.log('downloadurl is:',this.download_url);
                 console.log('signData is:', this.signData);
                 console.log(this.batch_update_time);
-                this.formData.select_time = this.batch_update_time;
+                if (val === 'delay')
+                {this.formData.select_time = this.batch_update_time;}
+                else if (val === 'now'){
+                    this.formData.select_time = 'now'
+                }
+
                 this.formData.name = this.name;
                 this.formData.version = this.version;
                 this.formData.gateway_version = this.download_url;

+ 40 - 4
src/views/inner-management/version-update/index.vue

@@ -80,7 +80,12 @@
                         <div class="label">任务名称</div>
                         <div>
                             <!--v-model="this.currentRow.name"-->
-                            <el-input style="width: 300px"
+                            <el-input style="width: 300px" v-model="this.currentRow.name"
+                                      v-if="new Date().getTime()>new Date(this.currentRow.batch_update_select_time).getTime()"
+                                      disabled
+                            >
+                            </el-input>
+                            <el-input v-else style="width: 300px"  v-model="this.currentRow.name"
 
                             >
                             </el-input>
@@ -90,12 +95,22 @@
                     <div class="form-item">
                         <div class="label">升级时间</div>
                         <div>
-                                                        {{this.currentRow.batch_update_select_time}}
+<!--                                                        {{this.currentRow.batch_update_select_time}}-->
                                                         <el-date-picker style="width: 300px"
+                                                                v-if="new Date().getTime()>new Date(this.currentRow.batch_update_select_time).getTime()"
+                                                                        disabled="true"
                                                                 v-model="this.currentRow.batch_update_select_time"
                                                                 type="datetime"
                                                                 placeholder="选择日期时间">
                                                         </el-date-picker>
+
+                            <el-date-picker style="width: 300px" v-else
+                                            disabled="false"
+                                            v-model="this.currentRow.batch_update_select_time"
+                                            type="datetime"
+                                            placeholder="选择日期时间">
+                            </el-date-picker>
+
                         </div>
                     </div>
                     <div class="form-item">
@@ -134,10 +149,29 @@
                 <div class="make-sure-container">
                     <el-button
                             class="make-sure-button"
-                            type="danger"
+                            type="danger" v-if="new Date().getTime()>new Date(this.currentRow.batch_update_select_time).getTime()"
+                            disabled
+                            @click="makeSureAddOperate1()"
+                    >确 认</el-button>
+                    <el-button
+                            class="make-sure-button"
+                            type="danger" v-else
                             @click="makeSureAddOperate1()"
                     >确 认</el-button>
                 </div>
+<!--                <div class="make-sure-container">-->
+<!--                    <el-button-->
+<!--                            class="make-sure-button"-->
+<!--                            type="success" v-if="new Date().getTime()>new Date(this.currentRow.batch_update_select_time).getTime()"-->
+<!--                            disabled-->
+<!--                            @click="makeSureAddOperate1()"-->
+<!--                    >立即升级</el-button>-->
+<!--                    <el-button-->
+<!--                            class="make-sure-button"-->
+<!--                            type="success" v-else-->
+<!--                            @click="makeSureAddOperate1()"-->
+<!--                    >立即升级</el-button>-->
+<!--                </div>-->
             </div>
             <el-table :data="updateRecordList">
                 <el-table-column label="序号" width="60" align="center">
@@ -265,6 +299,7 @@
                     box_name:'namexx'
                 }],
                 randomKey: Math.random(),
+                currentRow:{},
             };
         },
         methods: {
@@ -378,7 +413,7 @@
                     type: "warning"
                 }).then(async () => {
                     const res = await versionUpdateDelete({
-                        id: row.id
+                        task_id: row.task_id
                     });
                     if (res.code === 200) {
                         this.$notify({
@@ -395,6 +430,7 @@
                     cancelButtonText: "取消",
                     type: "warning"
                 }).then(async () => {
+                    console.log('///////remove from task',row)
                     const res = await versionUpdateRemove({
                         task_id: row.task_id,
                         btk_gateway_version_auto_id: row.btk_gateway_version_auto_id,