From a689af1348938afd3b4506aad9b6d5057193e25d Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期五, 27 五月 2022 09:59:00 +0800 Subject: [PATCH] bug修复 --- src/views/personalCenter/components/Content.vue | 9 .gitignore | 1 src/views/personalCenter/components/BasicInfo.vue | 45 +- vue.config.js | 5 src/views/hashrate/CameraManage/index.vue | 21 src/views/productDetail/components/ConfirmOrder.vue | 12 src/Pool/VideoRuleData.ts | 8 src/components/canvas/index.vue | 60 +- src/views/product/components/ProductContent.vue | 1 src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue | 26 + src/views/index/index.vue | 22 - src/components/Connect.vue | 25 + src/views/personalCenter/components/OrderMng.vue | 183 ++++++--- src/views/personalCenter/components/SubAccount.vue | 133 ++++-- src/api/camera.ts | 6 src/api/order.ts | 4 src/views/personalCenter/components/LeftMenu.vue | 3 src/components/CameraLeft.vue | 2 src/views/hashrate/AlgManage/index.vue | 4 src/views/hashrate/CameraManage/CameraRules/components/RuleItem.vue | 4 src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue | 21 saas_v1.0.rar | 0 src/views/equipmentManagement/equipmentList/components/FormList.vue | 81 +++ src/components/IndexHeader.vue | 13 src/views/productDetail/components/PayCard.vue | 33 + src/views/hashrate/hashrateDetail/index.vue | 4 src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue | 131 +++--- src/views/equipmentManagement/equipmentDetail/index.vue | 10 src/views/hashrate/CameraManage/CameraRules/components/scene/SlideScene.vue | 2 src/views/hashrate/HashManage/components/HashCard.vue | 4 src/views/register/components/SelectType.vue | 32 + src/scripts/httpRequest.ts | 12 src/views/hashrate/CameraManage/CameraInfo/index.vue | 38 + src/views/product/components/productCard.vue | 47 ++ package.json | 1 src/views/hashrate/CameraManage/CameraRules/index.vue | 101 ++++- src/views/equipmentManagement/equipmentDetail/components/FormArea.vue | 2 src/views/productDetail/components/UploadBox.vue | 3 src/App.vue | 4 src/api/device.js | 10 40 files changed, 765 insertions(+), 358 deletions(-) diff --git a/.gitignore b/.gitignore index 6238331..9f96563 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules /dist package-lock.json +vue.config.js # local env files .env.local diff --git a/package.json b/package.json index a9c13bf..fc667f2 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "less-loader": "^5.0.0", "lib-flexible": "^0.3.2", "moment": "~2.22.1", + "numeral": "^2.0.6", "pug": "^2.0.4", "pug-plain-loader": "^1.0.0", "qs": "^6.8.0", diff --git a/saas_v1.0.rar b/saas_v1.0.rar new file mode 100644 index 0000000..4c2b697 --- /dev/null +++ b/saas_v1.0.rar Binary files differ diff --git a/src/App.vue b/src/App.vue index 904307e..c15d544 100644 --- a/src/App.vue +++ b/src/App.vue @@ -105,7 +105,7 @@ height: 32px; line-height: 32px; - ::v-deep input { + input { height: 32px; } @@ -113,7 +113,7 @@ line-height: 32px; } - ::v-deep .el-icon-arrow-up { + .el-icon-arrow-up { height: 32px; } } diff --git a/src/Pool/VideoRuleData.ts b/src/Pool/VideoRuleData.ts index a49fec8..78bf26f 100644 --- a/src/Pool/VideoRuleData.ts +++ b/src/Pool/VideoRuleData.ts @@ -11,6 +11,8 @@ public canvasData: object; public baseImg: string; public cameraName: string; + public type:number; + public rtsp:string; public camearInfo: object; public loading: boolean; @@ -28,6 +30,8 @@ this.baseImg = ""; this.cameraId = id ? id : ""; this.cameraName = ""; + this.rtsp = ""; + this.type = 0; this.selectTask = []; this.polygonData = []; this.canvasData = { @@ -80,9 +84,13 @@ const rsp: any = await getCameraInfo(this.cameraId); if (rsp.success) { this.cameraName = rsp.data.name ? rsp.data.name : ""; + this.rtsp = rsp.data.rtsp ? rsp.data.rtsp : ""; + this.type = rsp.data.type ? rsp.data.type : 0; } } catch { this.cameraName = ""; + this.type = 0 + this.rtsp = '' } } else { const rsp: any = await findAllFileByStackId({ stackId: this.cameraId }); diff --git a/src/api/camera.ts b/src/api/camera.ts index d2f33a5..0510362 100644 --- a/src/api/camera.ts +++ b/src/api/camera.ts @@ -66,11 +66,11 @@ }); }; -export const updateSnapshot = (cameraId: string) => { +export const updateSnapshot = (data: any) => { return request({ url: "/saas/api-s/camera/updateSnapshotUrl", - method: "get", - params: { cameraId: cameraId } + method: "post", + data:data }); }; diff --git a/src/api/device.js b/src/api/device.js index 8214771..bd1cdc0 100644 --- a/src/api/device.js +++ b/src/api/device.js @@ -42,6 +42,16 @@ }); }; +/* 瀵煎嚭璁惧鍒楄〃 */ +export const exportDevListExcel = (data) => { + return request({ + url: "/saas/api-d/device/exportDevListExcel", + method: "post", + data, + responseType: "blob", + }); +}; + /* 瑙g粦璁惧 param diff --git a/src/api/order.ts b/src/api/order.ts index dfbd7b9..740ac42 100644 --- a/src/api/order.ts +++ b/src/api/order.ts @@ -1,4 +1,4 @@ -import request from "./index" +import request from "@/scripts/httpRequest"; import qs from "qs"; /* 鏌ヨ璁㈠崟鍒楄〃 @@ -108,7 +108,7 @@ }); export const getAuthFile = (data: any) => request({ - url:'/data/api-s/getAuthorizationFile', + url:'/saas/api-s/saasOrder/downloadOrderExcel', method: 'post', data, responseType: "blob" diff --git a/src/components/CameraLeft.vue b/src/components/CameraLeft.vue index 31ee1e8..4a983f6 100644 --- a/src/components/CameraLeft.vue +++ b/src/components/CameraLeft.vue @@ -989,7 +989,7 @@ z-index: 2; font-size: 16px; position: absolute; - top: 62px; + top: 59px; cursor: pointer; button { border: 0px; diff --git a/src/components/Connect.vue b/src/components/Connect.vue index 7377522..222120c 100644 --- a/src/components/Connect.vue +++ b/src/components/Connect.vue @@ -30,7 +30,7 @@ > <span class="iconfont"></span>鑱旂郴鎴戜滑 </div> - <div class="backToTop iconfont" @click="backToTop"></div> + <div class="backToTop iconfont" v-if="showConnect" @click="backToTop"></div> </div> </template> @@ -39,7 +39,14 @@ data() { return { isShowConnectBox: false, //鍥哄畾瀹氫綅寮瑰眰 + showConnect: false, //鏄剧ず鑱旂郴鎴戜滑涓庡洖鍒伴《閮� }; + }, + created() { + window.addEventListener("scroll", this.scrollListener); + }, + destroyed() { + window.removeEventListener("scroll", this.scrollListener); }, methods: { // 鍥炲埌椤堕儴 @@ -72,6 +79,22 @@ _this.isShowConnectBox = false; }, 100); }, + //娣诲姞婊氬姩鐩戝惉 + scrollListener() { + //椤甸潰婊戝姩瑙﹀彂浜嬩欢 (婊氬姩鏉$Щ鍔ㄥ垯璋冪敤鏄惁鏄剧ず杩斿洖椤堕儴鎸夐挳浜嬩欢) + var a = document.documentElement.clientHeight; // 婊氬姩瀹瑰櫒鐨勫彲瑙嗛珮 + var b = document.documentElement.scrollTop; // 婊氬姩鏉¤窛绂婚《閮ㄧ殑楂樺害 + var c = document.documentElement.scrollHeight; // 婊氬姩瀹瑰櫒鐨勬暣涓珮搴� + + if (c === a + b) { + //褰撴粴鍔ㄥ鍣ㄧ殑鍙楂�+婊氬姩瀹瑰櫒婊氬姩浜嗙殑楂樺害锛堟粴鍔ㄦ潯椤堕儴璺濈婊氬姩瀹瑰櫒椤堕儴鐨勮窛绂伙級 = 婊氬姩瀹瑰櫒鐨勬暣涓珮搴︽椂锛岃鏄庢粴鍔ㄦ潯鍒板簳浜� + this.showConnect = true; + } else { + this.showConnect = false; + } + + //妫�鏌ユ粴鍔ㄦ潯鏄惁鍦ㄩ《閮紝鎺у埗杩斿洖椤堕儴鎸夐挳鐨勯殣钘忓拰鏄剧ず + }, }, }; </script> diff --git a/src/components/IndexHeader.vue b/src/components/IndexHeader.vue index badc01c..72d3d59 100644 --- a/src/components/IndexHeader.vue +++ b/src/components/IndexHeader.vue @@ -86,9 +86,7 @@ </li> <li> - <div class="label"> - <router-link to="/personalCenter">璁㈠崟绠$悊</router-link> - </div> + <div class="label" @click="jump(1)">璁㈠崟绠$悊</div> </li> <li> @@ -213,6 +211,15 @@ }); }); }, + + jump(id) { + this.$router.push({ + path: "/personalCenter", + query: { + id: id, + }, + }); + }, }, }; </script> diff --git a/src/components/canvas/index.vue b/src/components/canvas/index.vue index b7266ef..016dc18 100644 --- a/src/components/canvas/index.vue +++ b/src/components/canvas/index.vue @@ -79,9 +79,8 @@ }, type: Object, }, - currentCameraId: { - type: String, - default: "", + currentCamera: { + type: Object, }, snapshot_url: { type: String, @@ -116,9 +115,14 @@ return this.snapshot_url.replace("/opt/vasystem", ""); } + if (this.snapshot_url.indexOf("data:image/png;base64,") != -1) { + return `${this.snapshot_url}`; + } + if (this.sourceType == 2) { return `${this.snapshot_url}`; } else { + console.log(this.snapshot_url); return `/httpImage/${this.snapshot_url}`; } } else { @@ -148,7 +152,6 @@ watch: { loading: { handler(newVal, oldVal) { - // console.log(newVal,'loading') if (newVal) { this.baseImg = ""; this.refresh(); @@ -182,30 +185,30 @@ async getCanvasPic() { // this.$emit('changeBaseImg',this.currentCameraId) this.$emit("changeLoading", true); - if (this.currentCameraId) { + if (this.currentCamera.cameraId) { let _this = this; - await updateSnapshot(this.currentCameraId) - .then((res) => { - if (res.data.cameraId === _this.currentCameraId) { - this.baseImg = res.data.snapshotUrl; - this.$emit( - "refresh", - res.data.snapshotUrl, - _this.currentCameraId - ); - this.$forceUpdate(); - this.$notify({ - type: "success", - message: "搴曞浘宸插埛鏂�", - }); - } - }) - .catch((err) => { - this.$notify({ - type: "error", - message: "搴曞浘鍒锋柊澶辫触", + + await updateSnapshot({ + id: _this.currentCamera.cameraId, + name: _this.currentCamera.cameraName, + type: _this.currentCamera.type, + rtsp: _this.currentCamera.rtsp, + }).then((res) => { + if (res.data.cameraId === _this.currentCamera.cameraId) { + _this.baseImg = "data:image/png;base64," + res.data.base64; + _this.$emit( + "refresh", + _this.baseImg, + _this.currentCamera.cameraName + ); + _this.$forceUpdate(); + _this.$notify({ + type: "success", + message: "搴曞浘宸插埛鏂�", }); - }); + } + }); + this.$emit("changeLoading", false); } }, @@ -523,8 +526,9 @@ ctx.restore(); }, async refresh() { - // console.log(this.loading,'鍒锋柊搴曞浘',this.snapshot_url) - if (!this.currentCameraId) { + console.log("鍒锋柊搴曞浘"); + if (!this.currentCamera.cameraId) { + console.log("娌″埛鏂�"); return false; } // await this.$emit('changeLoading', true) diff --git a/src/scripts/httpRequest.ts b/src/scripts/httpRequest.ts index 97b48e4..95a6c30 100644 --- a/src/scripts/httpRequest.ts +++ b/src/scripts/httpRequest.ts @@ -79,6 +79,16 @@ // window.sessionStorage.setItem('policeCameravideoIsLoginTimeout', JSON.stringify(true)) // } + var disposition = res.headers["content-disposition"]; + if(disposition) { + var fileName = disposition.substring(disposition.indexOf("=") + 1); + console.log(res); + + return { + fileName:fileName, + body:res + } + } return res.data ? res.data : {} @@ -170,4 +180,6 @@ return Promise.reject(errJson) } ) + +Axios.defaults.timeout = 10000 export default Axios diff --git a/src/views/equipmentManagement/equipmentDetail/components/FormArea.vue b/src/views/equipmentManagement/equipmentDetail/components/FormArea.vue index a973aea..391eb76 100644 --- a/src/views/equipmentManagement/equipmentDetail/components/FormArea.vue +++ b/src/views/equipmentManagement/equipmentDetail/components/FormArea.vue @@ -38,7 +38,7 @@ <div class="formApplication"> <div class="formHead"> 搴旂敤鍗曞厓<span class="des" - >姝e湪杩涜{{ data.algos && data.apps.length }}涓簲鐢ㄥ崟鍏�</span + >姝e湪杩涜{{ data.apps && data.apps.length }}涓簲鐢ㄥ崟鍏�</span > </div> <el-table :data="data.apps" stripe style="width: 100%"> diff --git a/src/views/equipmentManagement/equipmentDetail/index.vue b/src/views/equipmentManagement/equipmentDetail/index.vue index 18f3c04..04b4a5d 100644 --- a/src/views/equipmentManagement/equipmentDetail/index.vue +++ b/src/views/equipmentManagement/equipmentDetail/index.vue @@ -220,7 +220,8 @@ <div class="hardWare_row"> <div class="item"> <div class="label">web鐗堟湰</div> - <div class="data">{{ detailData.webVersion }}</div> + <!-- <div class="data">{{ detailData.webVersion }}</div> --> + <div class="data">2.0.0</div> </div> <div class="item"> @@ -395,8 +396,13 @@ //鑾峰彇绠楁硶鎵�鍗犺祫婧� async showProcesses() { const res = await showProcesses({ userId: this.userId, nodeId: this.id }); - console.log(res.data); this.deviceProcesses = res.data; + if (!this.deviceProcesses.algos) { + this.deviceProcesses.algos = []; + } + if (!this.deviceProcesses.apps) { + this.deviceProcesses.apps = []; + } }, //鑾峰彇璁惧鏃堕棿鎴� async getTime() { diff --git a/src/views/equipmentManagement/equipmentList/components/FormList.vue b/src/views/equipmentManagement/equipmentList/components/FormList.vue index ce47fc3..dda4626 100644 --- a/src/views/equipmentManagement/equipmentList/components/FormList.vue +++ b/src/views/equipmentManagement/equipmentList/components/FormList.vue @@ -44,7 +44,7 @@ <div class="button add" @click="isShowAdd = true"> <span>+</span>娣诲姞璁惧 </div> - <div class="button export"> + <div class="button export" @click="exportFile"> <span class="iconfont"></span>瀵煎嚭 </div> </div> @@ -101,7 +101,7 @@ </el-table-column> <el-table-column label="鎵�灞為泦缇�" show-overflow-tooltip min-width="154"> - <template> -- </template> + <template slot-scope="scope"> {{ scope.row.clusterName }} </template> </el-table-column> <el-table-column label="鐘舵��" min-width="70"> @@ -195,7 +195,11 @@ </template> <script> -import { findDevList, findClustersBySearch } from "@/api/device"; +import { + findDevList, + findClustersBySearch, + exportDevListExcel, +} from "@/api/device"; import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox"; import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox"; import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox"; @@ -379,6 +383,7 @@ clearSearch() { this.searchTime = this.getDateInit(); this.inputText = ""; + this.cluster = ""; this.searchingBtn(); }, @@ -398,6 +403,54 @@ } this.activeEquipment = equipment; this.showJoin = true; + }, + + //瀵煎嚭鍒楄〃鏂囦欢 + async exportFile() { + let param = {}; + + if (!this.searchTime) { + param = { + page: this.page, + size: this.size, + startTime: "", + endTime: "", + clusterId: this.cluster, + inputText: this.inputText, + }; + } else { + param = { + page: this.page, + size: this.size, + startTime: this.searchTime[0], + endTime: this.searchTime[1], + clusterId: this.cluster, + inputText: this.inputText, + }; + } + const result = await exportDevListExcel(param); + + var blob = new Blob([result.body.data], { + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", + }), + Temp = document.createElement("a"); + + Temp.href = window.URL.createObjectURL(blob); + + console.log(result); + console.log(result.fileName); + + Temp.download = window.decodeURI(result.fileName); + + Temp.setAttribute("download", result.fileName); + + document.body.appendChild(Temp); + + Temp.click(); + + document.body.removeChild(Temp); + + window.URL.revokeObjectURL(Temp); }, }, mounted() { @@ -428,7 +481,7 @@ .cluster { .el-select { - width: 200px; + width: 190px; height: 40px; line-height: 40px; @@ -469,7 +522,7 @@ } .el-input ::v-deep { - width: 280px; + width: 270px; height: 40px; margin-left: 10px; margin-right: 20px; @@ -487,7 +540,7 @@ } .el-date-editor { - width: 318px; + width: 340px; height: 40px; margin-left: 10px; margin-right: 20px; @@ -503,7 +556,7 @@ } .searchBtn { - width: 120px; + width: 110px; height: 40px; line-height: 40px; text-align: center; @@ -513,7 +566,7 @@ } .resetBtn { - width: 120px; + width: 110px; height: 40px; line-height: 40px; text-align: center; @@ -616,7 +669,7 @@ .el-pagination ::v-deep { margin-top: 30px; - text-align: center; + text-align: right; height: 24px; .el-pagination__sizes { margin-right: 0; @@ -650,6 +703,16 @@ border-color: #0065ff; } } + + .el-pagination__jump { + margin-left: 12px; + .el-pagination__editor { + width: 37px; + input { + width: 32px; + } + } + } } } </style> diff --git a/src/views/hashrate/AlgManage/index.vue b/src/views/hashrate/AlgManage/index.vue index 71f24a5..0b1289c 100644 --- a/src/views/hashrate/AlgManage/index.vue +++ b/src/views/hashrate/AlgManage/index.vue @@ -75,7 +75,7 @@ > <img src="/images/hashrate/绠楁硶绠$悊绌洪〉闈�.png" alt="" /> <div class="des"> - 鏆傛湭瀹夎绠楁硶锛屼粠宸︿晶绠楁硶涓績鎷栧埌绠楁硶鍒版澶勶紝鍗冲彲瀹夎 + 鏆傛湭瀹夎绠楁硶锛屼粠宸︿晶绠楁硶涓績绠楁硶鍒版澶勶紝鍗冲彲瀹夎 </div> </div> </div> @@ -261,7 +261,7 @@ if (res && res.success) { this.$notify({ type: "success", - message: "鎿嶄綔鎴愬姛", + message: res.msg, }); } }, diff --git a/src/views/hashrate/CameraManage/CameraInfo/index.vue b/src/views/hashrate/CameraManage/CameraInfo/index.vue index 62665ae..a49ad6e 100644 --- a/src/views/hashrate/CameraManage/CameraInfo/index.vue +++ b/src/views/hashrate/CameraManage/CameraInfo/index.vue @@ -448,8 +448,8 @@ sensors: this.form.sensors, areaid: this.form.areaid, }; - tem.camera.clusterId = this.TreeDataPool.clusterId; - tem.camera.devId = this.TreeDataPool.devId; + tem.camera.clusterId = sessionStorage.getItem("clusterId"); + tem.camera.devId = sessionStorage.getItem("devId"); updateCameraInfo(tem) .then((rsp) => { @@ -476,12 +476,7 @@ }); } }) - .catch((err) => { - this.$notify({ - type: "error", - message: err.msg, - }); - }); + .catch((err) => {}); } else { this.form.areaid = this.addParentId; @@ -490,8 +485,8 @@ sensors: this.form.sensors, areaid: this.form.areaid, }; - tem.camera.clusterId = this.TreeDataPool.clusterId; - tem.camera.devId = this.TreeDataPool.devId; + tem.camera.clusterId = sessionStorage.getItem("clusterId"); + tem.camera.devId = sessionStorage.getItem("devId"); createCamera(tem) .then((rsp) => { if (rsp.success) { @@ -499,7 +494,7 @@ type: "success", message: "鎽勫儚鏈烘坊鍔犳垚鍔燂紒", }); - this.TreeDataPool.selectedNode = rsp.data; + this.TreeDataPool.selectedNode = rsp.data.camera; this.TreeDataPool.fetchTreeData(); // 鍚庣杩斿洖缁撴灉涓�0锛屾煡璇㈠悗涓�4 this.TreeDataPool.selectedNode.type = "4"; @@ -560,6 +555,13 @@ cancelButtonClass: "comfirm-class-cancle", confirmButtonClass: "comfirm-class-sure", }).then(() => { + if (!this.form.id) { + this.$notify({ + type: "warning", + message: "灏氭湭娣诲姞鎽勫儚鏈�", + }); + return; + } delCamera({ id: this.form.id, clusterId: this.TreeDataPool.clusterId, @@ -609,6 +611,20 @@ addDevice(node) { this.isAdd = true; this.addParentId = node; + this.resolutionList = [ + { + label: "鏈満鍒嗚鲸鐜�", + value: "0*0", + }, + { + label: "1920*1080", + value: "1920*1080", + }, + { + label: "2688*1520", + value: "2688*1520", + }, + ]; this.initFormData(); }, }, diff --git a/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue b/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue index 101188a..89a9593 100644 --- a/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue +++ b/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue @@ -7,9 +7,9 @@ <div class="close iconfont" @click="close"></div> - <el-form :model="ruleForm"> + <el-form :model="ruleForm" :rules="rules" ref="form"> <div class="label">鍦烘櫙鍚嶇О</div> - <el-form-item> + <el-form-item prop="scene_name"> <el-input class="h32" v-model="ruleForm.scene_name" @@ -34,7 +34,7 @@ </el-form-item> <div class="label">鏃堕棿娈�</div> - <el-form-item> + <el-form-item prop="time_rule_id"> <el-select class="h32 left" v-model="ruleForm.time_rule_id" @@ -148,6 +148,14 @@ value: 5, }, ], + rules: { + scene_name: [ + { required: true, message: "璇疯緭鍏ュ満鏅悕绉�", trigger: "blur" }, + ], + time_rule_id: [ + { required: true, message: "璇烽�夋嫨鏃堕棿娈�", trigger: "blur" }, + ], + }, soundPath: "", togglePlay: true, eventAudio: new Audio(), @@ -220,9 +228,15 @@ this.$emit("close"); }, save() { - this.$emit("save", { - action: this.editData.type ? "edit" : "add", - data: this.ruleForm, + this.$refs["form"].validate((valid) => { + if (valid) { + this.$emit("save", { + action: this.editData.type ? "edit" : "add", + data: this.ruleForm, + }); + } else { + return false; + } }); }, }, diff --git a/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue b/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue index 7990282..78c7d24 100644 --- a/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue +++ b/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue @@ -1,60 +1,56 @@ <template> - <div class="CameraBox"> - <div v-if="cameras"> - <div v-for="(camera, index) in cameraArr" :key="index" class="boxItem"> - <div class="header"> - <i class="iconfont"></i> - <div class="name">{{ camera.cameraName }}</div> - <el-switch - v-model="camera.analytics" - @change="pollEnable($event, index)" - active-color="#D4E3FA" - inactive-color="#E9EBEE" - :width="56" - > - </el-switch> - </div> - - <div class="body"> - <div class="row" v-if="camera.analytics"> - <div class="label">澶勭悊鏂瑰紡:</div> - <div - class="button pollingBtn" - :class="{ active: !camera.dealWay }" - @click="changePoll(false, index)" - > - 杞 - </div> - <div - class="button realtimeBtn" - :class="{ active: camera.dealWay }" - @click="changePoll(true, index)" - > - 瀹炴椂 - </div> - </div> - <div class="row"> - <div class="label">鍒嗚鲸鐜�:</div> - <div class="data"> - {{ - !camera.camearInfo.resolutionWidth || - !camera.camearInfo.resolutionHeight || - camera.camearInfo.resolutionWidth == 0 || - camera.camearInfo.resolutionHeight == 0 - ? "鏈満鍒嗚鲸鐜�" - : `${camera.camearInfo.resolutionWidth} * ${camera.camearInfo.resolutionHeight}` - }} - </div> - </div> - </div> + <div class="CameraBox" v-if="cameras"> + <div v-for="(camera, index) in cameraArr" :key="index" class="boxItem"> + <div class="header"> + <i class="iconfont"></i> + <div class="name">{{ camera.cameraName }}</div> + <el-switch + v-model="camera.analytics" + @change="pollEnable($event, index)" + active-color="#D4E3FA" + inactive-color="#E9EBEE" + :width="56" + > + </el-switch> </div> - <div class="footer"> - <div class="button addModel">娣诲姞鍒版ā鏉�</div> - <div class="button addRule" @click="addRule">娣诲姞鏂板満鏅�</div> + + <div class="body"> + <div class="row" v-if="camera.analytics"> + <div class="label">澶勭悊鏂瑰紡:</div> + <div + class="button pollingBtn" + :class="{ active: !camera.dealWay }" + @click="changePoll(false, index)" + > + 杞 + </div> + <div + class="button realtimeBtn" + :class="{ active: camera.dealWay }" + @click="changePoll(true, index)" + > + 瀹炴椂 + </div> + </div> + <div class="row"> + <div class="label">鍒嗚鲸鐜�:</div> + <div class="data"> + {{ + !camera.camearInfo.resolutionWidth || + !camera.camearInfo.resolutionHeight || + camera.camearInfo.resolutionWidth == 0 || + camera.camearInfo.resolutionHeight == 0 + ? "鏈満鍒嗚鲸鐜�" + : `${camera.camearInfo.resolutionWidth} * ${camera.camearInfo.resolutionHeight}` + }} + </div> + </div> </div> </div> - - <div class="empty" v-else>鏆傛湭鑾峰緱鎽勫儚鏈轰俊鎭�</div> + <div class="footer"> + <div class="button addModel">娣诲姞鍒版ā鏉�</div> + <div class="button addRule" @click="addRule">娣诲姞鏂板満鏅�</div> + </div> </div> </template> @@ -68,15 +64,16 @@ type: Array, }, }, - created() { - this.getCameraInfo(); - }, data() { return { cameraArr: [], }; }, + created() { + this.getCameraInfo(); + }, + computed: {}, methods: { //鏄惁杩涜瑙嗛鍒嗘瀽澶勭悊 pollEnable(row, index) { @@ -112,7 +109,6 @@ message: "閰嶇疆澶辫触", }); } - this.TreeDataPool.fetchTreeData(); }); } // this.PollData.statisticTaskInfo(); @@ -127,14 +123,10 @@ this.cameraArr[index].cameraId && this.cameraArr[index].cameraId !== undefined ) { - console.log(1); if (this.PollData.RealTimeSum < this.PollData.channelTotal) { if (row) { - console.log(2); this.cameraArr[index].dealWay = true; } else { - console.log(3); - this.cameraArr[index].dealWay = false; } changeRunType({ @@ -174,7 +166,7 @@ }); } } - this.TreeDataPool.fetchTreeData(); + // this.TreeDataPool.fetchTreeData(); // this.PollData.statisticTaskInfo(); } }, @@ -185,11 +177,19 @@ }, getCameraInfo() { - this.cameraArr = []; + if (this.cameras.length <= 0) { + return; + } + + let arr = []; + this.cameras.forEach(async (id) => { + if (!id) { + return; + } const rsp = await getCameraInfo(id); if (rsp.success) { - this.cameraArr.push({ + arr.push({ cameraId: rsp.data.id, cameraName: rsp.data.name ? rsp.data.name : "", analytics: rsp.data.runType !== -1 ? true : false, @@ -201,6 +201,9 @@ }); } }); + + this.cameraArr = arr; + this.$forceUpdate(); }, }, watch: { diff --git a/src/views/hashrate/CameraManage/CameraRules/components/RuleItem.vue b/src/views/hashrate/CameraManage/CameraRules/components/RuleItem.vue index f8d8476..ec5357d 100644 --- a/src/views/hashrate/CameraManage/CameraRules/components/RuleItem.vue +++ b/src/views/hashrate/CameraManage/CameraRules/components/RuleItem.vue @@ -80,7 +80,7 @@ <div class="empty" @dragover="dragover($event)" @drop="drop" v-else> <img src="/images/hashrate/鏈厤缃畻娉曠┖椤甸潰.png" alt="" /> <div class="des"> - 鏆傛湭閰嶇疆绛栫暐锛岀偣鍑讳笂鏂规搷浣滈潰鏉挎寜閽紝浠庢搷浣滈潰鏉挎嫋鍒扮畻娉曞埌姝ゅ锛屽嵆鍙厤缃� + 鏆傛湭閰嶇疆绛栫暐锛岀偣鍑讳笂鏂规搷浣滈潰鏉挎寜閽紝浠庢搷浣滈潰鏉挎嫋鍔ㄧ畻娉曞埌姝ゅ锛屽嵆鍙厤缃� </div> </div> </div> @@ -196,6 +196,8 @@ this.rule.rules[index].rule_with_pre = ""; } + this.update(); + console.log(this.rule.rules); }, backToOrigin() { diff --git a/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue b/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue index 166d1cc..5877a6b 100644 --- a/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue +++ b/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue @@ -59,7 +59,11 @@ :key="item.id" :class="{ active: activeTabObj.id === item.id }" > - <div class="tab" @click="chooseTab(item)"> + <div + class="tab" + @click="chooseTab(item)" + @dblclick="chooseEdit(item)" + > {{ item.name }} </div> <div class="iconfont del" @click="handleTabsEdit(item.id, 'remove')"> @@ -176,6 +180,17 @@ time_rule: JSON.parse(data.time_rule), }; }); + }, + chooseEdit(data) { + this.$prompt("璇疯緭鍏ユ柊鐨勫満鏅悕绉�", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + }) + .then(({ value }) => { + this.activeTabObj.name = value; + this.save(); + }) + .catch(() => {}); }, handleTabsEdit(tabId, action) { @@ -325,10 +340,6 @@ this.isAdding = false; }) .catch(() => { - this.$notify({ - type: "warning", - message: rsp.msg, - }); this.isAdding = false; }); }, diff --git a/src/views/hashrate/CameraManage/CameraRules/components/scene/SlideScene.vue b/src/views/hashrate/CameraManage/CameraRules/components/scene/SlideScene.vue index 20878a5..eead63b 100644 --- a/src/views/hashrate/CameraManage/CameraRules/components/scene/SlideScene.vue +++ b/src/views/hashrate/CameraManage/CameraRules/components/scene/SlideScene.vue @@ -8,7 +8,7 @@ :options="swiperOption" class="swiper-box-container" > - <swiper-slide v-for="item in sceneData" :key="item.id + 's'"> + <swiper-slide v-for="(item, index) in sceneData" :key="index + 's'"> <div class="wrap-box"> <div class="inner" v-if="item.rules"> <div class="scenario-icon"> diff --git a/src/views/hashrate/CameraManage/CameraRules/index.vue b/src/views/hashrate/CameraManage/CameraRules/index.vue index 595de68..6c3c454 100644 --- a/src/views/hashrate/CameraManage/CameraRules/index.vue +++ b/src/views/hashrate/CameraManage/CameraRules/index.vue @@ -56,7 +56,7 @@ :disabled="false" :snapshot_url="Camera.baseImg" :canvasDataShow="Camera.canvasData" - :currentCameraId="Camera.cameraId" + :currentCamera="Camera" :loading="Camera.loading" :canvasWidth="canvasWidth" :canvasHeight="canvasHeight" @@ -92,14 +92,14 @@ v-loading="loading" element-loading-text="鍒锋柊涓紝璇风◢绛�..." element-loading-background="rgba(0, 0, 0, 0.8)" - :divId="data.cameraId" + :divId="data.camera.cameraId" :isShowDrawArrow="true" :isLink="true" :disabled="false" :loading="data.loading" :snapshot_url="data.baseImg" :canvasDataShow="data.canvasData" - :currentCameraId="data.cameraId" + :currentCamera="data.camera" @changeLoading="changeLoading" @refresh="refresh2" ></polygon-canvas> @@ -178,7 +178,7 @@ <!-- 鎽勫儚鏈� --> <LinkageCameraBox :cameras="item.cameraIds" - @addLinkageRule="addLinkageRule" + @addLinkageRule="addLinkageRule(item.cameraIds)" ></LinkageCameraBox> <div class="Anchor" :id="'linkage_camera' + index"></div> @@ -189,7 +189,7 @@ :rule="item" @edit="editRules(item, index, 'linkage')" @addSdk="addSdk('linkage', index)" - @backToOrigin="backToOrigin('linkage', index)" + @backToOrigin="backToOrigin('linkage', index, item.cameraIds)" @editSdk="editSdk($event, 'linkage', index)" @deletRule="deletRule('linkage', index)" :id="'linkage_' + index" @@ -198,9 +198,27 @@ </div> </template> - <div class="empty" @click="addLinkageRule" v-else> + <div + class="empty" + v-if="linkageRule.length <= 0 && !TreeDataPool.multiple" + > <img src="/images/hashrate/鑱斿姩鍦烘櫙绌洪〉闈�.png" alt="" /> <div class="des">鏆傛棤鑱斿姩鍦烘櫙</div> + </div> + + <div + class="newCameraArea" + v-if="linkageRule.length <= 0 && TreeDataPool.multiple" + > + <LinkageCameraBox + :cameras="CarmerasId" + @addLinkageRule="addLinkageRule(CarmerasId)" + ></LinkageCameraBox> + + <div class="empty"> + <img src="/images/hashrate/鑱斿姩鍦烘櫙绌洪〉闈�.png" alt="" /> + <div class="des">鏆傛棤鑱斿姩鍦烘櫙</div> + </div> </div> </div> @@ -286,6 +304,13 @@ selectedCameraIds() { return this.TreeDataPool.selectedNodes; }, + CarmerasId() { + let arr = []; + this.Carmeras.forEach((item) => { + arr.push(item.cameraId); + }); + return arr; + }, }, data() { return { @@ -328,6 +353,8 @@ prevEl: ".swiper-next-border", }, }, + showNewLinkage: false, + newLinkageIds: [], // swiperOption: { // slidesPerView: 5, @@ -471,6 +498,7 @@ this.$refs.canvas.showModal(); } }, + getCanvasData(data) { let polyon = { ...data }; polyon.camera_id = this.Camera.cameraId; @@ -484,8 +512,12 @@ let carmeras = this.Carmeras; for (let i = 0; i < carmeras.length; i++) { swipers = swipers.concat({ - cameraId: carmeras[i].cameraId, - name: carmeras[i].camearInfo.name, + camera: { + cameraId: carmeras[i].cameraId, + cameraName: carmeras[i].cameraName, + type: carmeras[i].type, + rtsp: carmeras[i].rtsp, + }, baseImg: carmeras[i].baseImg ? carmeras[i].baseImg : undefined, canvasData: carmeras[i].canvasData, loading: carmeras[i].loading, @@ -494,6 +526,7 @@ this.swipercanvasData = swipers; }, refresh(url) { + console.log(url); this.Camera.baseImg = url; }, refresh2(url, id) { @@ -538,16 +571,19 @@ this.runType = element.run_type; } }); - - // 鑾峰彇娣峰悎鍦烘櫙 - this.showRules(id); }, // 鑾峰彇娣峰悎鍦烘櫙 showRules(id) { + if (!id) { + return; + } + if (typeof id === "string") { + id = [id]; + } let rules = []; - getLinkSceneRule({ cameraIds: [id] }) + getLinkSceneRule({ cameraIds: id }) .then((rsp) => { if (rsp && rsp.success) { rules = rsp.data.rules; @@ -781,14 +817,15 @@ this.showAddBox = true; }, - addLinkageRule() { - if (this.Carmeras.length < 2) { + addLinkageRule(ids) { + if (ids.length < 2) { this.$message({ message: "璇疯嚦灏戦�夋嫨涓ゅ彴鎽勫儚鏈�", type: "warning", }); return; } + this.newLinkageIds = ids; this.ruleType = "linkage"; this.showAddBox = true; }, @@ -808,13 +845,7 @@ }); } else { //鑱斿姩鍦烘櫙 - let arr = [this.Camera.cameraId]; - this.Carmeras.forEach((item) => { - if (item.cameraId != this.Camera.cameraId) { - arr.push(item.cameraId); - } - }); - newRule.data.cameraIds = arr; + newRule.data.cameraIds = this.newLinkageIds; this.linkageRule.push(newRule.data); this.$nextTick(() => { this.connectLine2(); @@ -854,6 +885,7 @@ } this.showAddBox = false; + this.$forceUpdate(); } this.editData = {}; }, @@ -912,7 +944,7 @@ }, //鍙栨秷淇敼 - async backToOrigin(type, index) { + async backToOrigin(type, index, ids) { if (type === "separate") { const rsp = await getCameraSceneRule({ cameraId: this.Camera.cameraId, @@ -931,7 +963,7 @@ this.$forceUpdate(); this.connectLine(); } else { - getLinkSceneRule({ cameraIds: [this.Camera.cameraId] }).then((rsp) => { + getLinkSceneRule({ cameraIds: ids }).then((rsp) => { if (rsp && rsp.success) { let rules = rsp.data.rules ? rsp.data.rules : []; if (rules[index]) { @@ -1226,6 +1258,29 @@ } } + .newCameraArea { + display: flex; + .empty { + margin-left: 60px; + width: 1220px; + height: 198px; + border: 1px solid #c0c5cc; + border-radius: 5px; + text-align: center; + background: #f0f5fa; + img { + margin-top: 14px; + width: 250px; + height: 150px; + } + + .des { + margin-top: 2px; + color: #666; + } + } + } + ::v-deep .sourcePoint { margin-top: -4px; margin-left: -6px; diff --git a/src/views/hashrate/CameraManage/index.vue b/src/views/hashrate/CameraManage/index.vue index 9396978..ce7ff42 100644 --- a/src/views/hashrate/CameraManage/index.vue +++ b/src/views/hashrate/CameraManage/index.vue @@ -86,21 +86,36 @@ } } else if (this.activeTab === "鍦烘櫙閰嶇疆") { this.$refs.sepRule.initCameraData(node.id); + if (!this.TreeDataPool.multiple) { + this.$refs.sepRule.showRules(node.id); + } } }, "TreeDataPool.selectedNodes": { - handler(nodes) { + handler(nodes, oldVal) { if (this.activeTab == "鍦烘櫙閰嶇疆") { - console.log(this.TreeDataPool.multiple); // this.$refs.sepRule.initCameraData(nodes[nodes.length - 1]); let CameraArr = []; + let CameraIds = []; nodes.forEach((id) => { let newCamera = new VideoRuleData(id); CameraArr.push(newCamera); + CameraIds.push(id); }); this.$refs.sepRule.Carmeras = CameraArr; + if ( + nodes.length == 1 && + oldVal.length == 1 && + nodes[0] == oldVal[0] + ) { + return; + } + if (this.TreeDataPool.multiple && oldVal[0]) { + this.$refs.sepRule.showRules(CameraIds); + } + console.log(CameraArr); } }, @@ -123,7 +138,6 @@ }, }, created() { - console.log("------------"); this.getCluster(); this.TreeDataPool.readonly = false; @@ -178,6 +192,7 @@ } else if (tab === "鍦烘櫙閰嶇疆") { if (this.TreeDataPool.treeActiveName == "camera") { this.$refs.sepRule.initCameraData(this.TreeDataPool.selectedNode.id); + this.$refs.sepRule.showRules(this.TreeDataPool.selectedNode.id); } else if (this.TreeDataPool.treeActiveName == "dataStack") { this.$refs.sepRule.initCameraData(this.DataStackPool.selectedDir.id); } diff --git a/src/views/hashrate/HashManage/components/HashCard.vue b/src/views/hashrate/HashManage/components/HashCard.vue index 7a6ec85..cb0fcd5 100644 --- a/src/views/hashrate/HashManage/components/HashCard.vue +++ b/src/views/hashrate/HashManage/components/HashCard.vue @@ -39,8 +39,8 @@ </div> </div> <div class="detailItem"> - <div class="label"> - <span class="iconfont"></span>鍥犳湭鐭ュ師鍥犳湭鈥� + <div class="label" title="鍥犳湭鐭ュ師鍥犳湭澶勭悊"> + <span class="iconfont"></span>鍥犳湭鐭ュ師鍥犳湭澶勭悊 </div> <div class="data"> <span class="number">{{ hashrate.noDeal }}</span diff --git a/src/views/hashrate/hashrateDetail/index.vue b/src/views/hashrate/hashrateDetail/index.vue index e4ea617..7e69296 100644 --- a/src/views/hashrate/hashrateDetail/index.vue +++ b/src/views/hashrate/hashrateDetail/index.vue @@ -66,6 +66,10 @@ min-width: 1346px; background-color: rgb(243, 245, 248); + .fullScreenheart { + min-height: calc(100vh - 210px); + } + .el-breadcrumb { margin-top: 48px; margin-bottom: 24px; diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 2be6e4e..d20f751 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -136,10 +136,6 @@ this.getBanner(); this.getRecommend(); this.getModule(); - window.addEventListener("scroll", this.scrollListener); - }, - destroyed() { - window.removeEventListener("scroll", this.scrollListener); }, data() { return { @@ -365,7 +361,6 @@ timer: null, //鍚戜笂鍥炴粴鍔ㄧ敾 ConnectTimer: null, // 鎺у埗寮瑰眰鐨勫畾鏃跺櫒 bannerList: [], - showConnect: false, //鏄剧ず鑱旂郴鎴戜滑涓庡洖鍒伴《閮� }; }, methods: { @@ -402,22 +397,7 @@ this.activeCommend = id; this.getRecommend(); }, - //娣诲姞婊氬姩鐩戝惉 - scrollListener() { - //椤甸潰婊戝姩瑙﹀彂浜嬩欢 (婊氬姩鏉$Щ鍔ㄥ垯璋冪敤鏄惁鏄剧ず杩斿洖椤堕儴鎸夐挳浜嬩欢) - var a = document.documentElement.clientHeight; // 婊氬姩瀹瑰櫒鐨勫彲瑙嗛珮 - var b = document.documentElement.scrollTop; // 婊氬姩鏉¤窛绂婚《閮ㄧ殑楂樺害 - var c = document.documentElement.scrollHeight; // 婊氬姩瀹瑰櫒鐨勬暣涓珮搴� - - if (c === a + b) { - //褰撴粴鍔ㄥ鍣ㄧ殑鍙楂�+婊氬姩瀹瑰櫒婊氬姩浜嗙殑楂樺害锛堟粴鍔ㄦ潯椤堕儴璺濈婊氬姩瀹瑰櫒椤堕儴鐨勮窛绂伙級 = 婊氬姩瀹瑰櫒鐨勬暣涓珮搴︽椂锛岃鏄庢粴鍔ㄦ潯鍒板簳浜� - this.showConnect = true; - } else { - this.showConnect = false; - } - - //妫�鏌ユ粴鍔ㄦ潯鏄惁鍦ㄩ《閮紝鎺у埗杩斿洖椤堕儴鎸夐挳鐨勯殣钘忓拰鏄剧ず - }, + }, beforeRouteLeave(to, from, next) { let userInfo = sessionStorage.getItem("userInfo"); diff --git a/src/views/personalCenter/components/BasicInfo.vue b/src/views/personalCenter/components/BasicInfo.vue index eb5bb7e..37911bf 100644 --- a/src/views/personalCenter/components/BasicInfo.vue +++ b/src/views/personalCenter/components/BasicInfo.vue @@ -14,7 +14,7 @@ <el-form-item label="鐢ㄦ埛鍚�" prop="username"> <el-input v-model="userInfo.username" style="width: 200px"></el-input> </el-form-item> - <el-form-item label="娉ㄥ唽绫诲瀷" prop="type"> + <el-form-item label="娉ㄥ唽绫诲瀷" prop="userType"> <el-radio-group v-model="userInfo.userType"> <el-radio :label="1">涓汉</el-radio> <el-radio :label="2">鍏徃</el-radio> @@ -55,7 +55,6 @@ v-model="userInfo.address" :props="options" style="width: 410px" - @change="handleChange" ></el-cascader> </el-form-item> <el-form-item label="鎵嬫満鍙�" prop="phoneNum"> @@ -120,7 +119,7 @@ userId: "", username: "", phoneNum: "", - type: "", // 鏅�氱敤鎴疯繕鏄紑鍙戣�� + type: 1, // 鏅�氱敤鎴疯繕鏄紑鍙戣�� userType: 1, // 涓汉杩樻槸鍏徃 industryId: "", address: [110100, 110105], @@ -146,16 +145,16 @@ activeEquipment: null, //澶勭悊涓殑璁惧 rules: { trueName: [ - { required: true, message: "璇峰~鍐欑湡瀹炲鍚�", trigger: "change" }, + { required: true, message: "璇峰~鍐欑湡瀹炲鍚�", trigger: "blur" }, ], username: [ - { required: true, message: "璇峰~鍐欑敤鎴峰悕", trigger: "change" }, + { required: true, message: "璇峰~鍐欑敤鎴峰悕", trigger: "blur" }, ], phoneNum: [ - { required: true, message: "璇峰~鍐欐墜鏈哄彿", trigger: "change" }, + { required: true, message: "璇峰~鍐欐墜鏈哄彿", trigger: "blur" }, ], - type: [ - { required: true, message: "璇烽�夋嫨娉ㄥ唽绫诲瀷", trigger: "change" }, + userType: [ + { required: true, message: "璇烽�夋嫨娉ㄥ唽绫诲瀷", trigger: "blur" }, ], }, }; @@ -177,19 +176,23 @@ } }, save() { - this.userInfo.provinceId = this.userInfo.address[0]; - this.userInfo.areaId = this.userInfo.address[1]; - entireUserInfo(this.userInfo) - .then((res) => { - this.$notify.success("璐︽埛淇℃伅淇濆瓨鎴愬姛"); - // this.$emit("gotolist") - }) - .catch((err) => { - if (err && err.status == 401) { - return; - } - this.$notify.error("璐︽埛淇℃伅淇濆瓨澶辫触"); - }); + this.$refs["ruleForm"].validate((valid) => { + if (valid) { + this.userInfo.provinceId = this.userInfo.address[0]; + this.userInfo.areaId = this.userInfo.address[1]; + entireUserInfo(this.userInfo) + .then((res) => { + this.$notify.success("璐︽埛淇℃伅淇濆瓨鎴愬姛"); + // this.$emit("gotolist") + }) + .catch((err) => { + if (err && err.status == 401) { + return; + } + this.$notify.error("璐︽埛淇℃伅淇濆瓨澶辫触"); + }); + } + }); }, // 璺冲埌璁惧璇︽儏 checkDetail(row) { diff --git a/src/views/personalCenter/components/Content.vue b/src/views/personalCenter/components/Content.vue index 01865be..3d65390 100644 --- a/src/views/personalCenter/components/Content.vue +++ b/src/views/personalCenter/components/Content.vue @@ -20,6 +20,9 @@ window._AMapSecurityConfig = { securityJsCode: "768ab79bdc4075aa082bc070c53bb3c4", }; + if (this.$route.query && this.$route.query.id) { + this.activeIndex = this.$route.query.id; + } }, mounted() {}, components: { @@ -51,9 +54,9 @@ mChange(i) { this.activeIndex = i; }, - gotolist(){ - this.mChange(4) - } + gotolist() { + this.mChange(4); + }, }, }; </script> diff --git a/src/views/personalCenter/components/LeftMenu.vue b/src/views/personalCenter/components/LeftMenu.vue index 905dadd..495d8dc 100644 --- a/src/views/personalCenter/components/LeftMenu.vue +++ b/src/views/personalCenter/components/LeftMenu.vue @@ -24,6 +24,9 @@ export default { created() { this.userInfo = JSON.parse(sessionStorage.getItem("userInfo")); + if (this.$route.query && this.$route.query.id) { + this.activeIndex = this.$route.query.id; + } }, data() { return { diff --git a/src/views/personalCenter/components/OrderMng.vue b/src/views/personalCenter/components/OrderMng.vue index 9e9f084..289ad15 100644 --- a/src/views/personalCenter/components/OrderMng.vue +++ b/src/views/personalCenter/components/OrderMng.vue @@ -26,7 +26,7 @@ <div class="button searchBtn" @click="searchingBtn">鎼滅储</div> <div class="button resetBtn" @click="clearSearch">閲嶇疆</div> </div> - <div class="to-excel"> + <div class="to-excel" @click="exportList"> <span class="iconfont"></span> <span>瀵煎嚭</span> </div> </div> @@ -237,7 +237,7 @@ </template> <script> -import { getOrders } from "@/api/order"; +import { getOrders, getAuthFile } from "@/api/order"; import { getOrderById } from "@/api/product"; export default { @@ -285,82 +285,86 @@ let param = { page: this.page, size: this.size, - startTime: this.searchTime[0], - endTime: this.searchTime[1], + startTime: this.searchTime ? this.searchTime[0] : "", + endTime: this.searchTime ? this.searchTime[1] : "", inputText: this.inputText, productBaseId: "0", orderName: "", orderType: "", status: 0, }; - getOrders(param).then((res) => { - this.dataList = res.data.list.map((item, indez) => { - let status = ""; - switch (item.orderStatus) { - case -1: - status = "宸插彇娑�"; - break; - case 0: - status = "鏈笅鍗�"; - break; - case 1: - status = "寰呮敮浠�"; - break; - case 2: - status = "宸叉敮浠�"; - break; - case 11: - status = "瀹℃牳涓�"; - break; - case 12: - status = "宸查┏鍥�"; - break; - default: - status = ""; - } - let name = ""; - let downFlag = false; - let products = []; - item.products.forEach((every, index) => { - // 鍒ゆ柇鏈鍗曟槸鍚﹀瓨鍦ㄥ彲涓嬭浇鐨勫唴瀹癸紙杞欢锛宻dk锛� - if (every.productType == 1 || every.productType == 3) { - downFlag = true; + getOrders(param) + .then((res) => { + this.dataList = res.data.list.map((item, indez) => { + let status = ""; + switch (item.orderStatus) { + case -1: + status = "宸插彇娑�"; + break; + case 0: + status = "鏈笅鍗�"; + break; + case 1: + status = "寰呮敮浠�"; + break; + case 2: + status = "宸叉敮浠�"; + break; + case 11: + status = "瀹℃牳涓�"; + break; + case 12: + status = "宸查┏鍥�"; + break; + default: + status = ""; } - // 褰掔被浜у搧鍜屾縺娲荤爜浠ヤ緵涓嬭浇 - products.push({ - productId: every.productId, - productName: every.productName, - activateCode: every.activateCode, - productTypeName: every.productTypeName, + let name = ""; + let downFlag = false; + let products = []; + item.products.forEach((every, index) => { + // 鍒ゆ柇鏈鍗曟槸鍚﹀瓨鍦ㄥ彲涓嬭浇鐨勫唴瀹癸紙杞欢锛宻dk锛� + if (every.productType == 1 || every.productType == 3) { + downFlag = true; + } + // 褰掔被浜у搧鍜屾縺娲荤爜浠ヤ緵涓嬭浇 + products.push({ + productId: every.productId, + productName: every.productName, + activateCode: every.activateCode, + productTypeName: every.productTypeName, + }); + if (index == 0) { + name += every.productName + "(" + every.productTypeName + ")"; + } else { + name += + " / " + every.productName + "(" + every.productTypeName + ")"; + } }); - if (index == 0) { - name += every.productName + "(" + every.productTypeName + ")"; - } else { - name += - " / " + every.productName + "(" + every.productTypeName + ")"; - } + return { + id: item.id, + sn: item.sn, + name: name, + source: item.source == 0 ? "婵�娲荤爜涓嬭浇" : "绾夸笂璐拱", + createTime: item.createTime, + status: status, + orderStatus: item.orderStatus, + orderMoney: item.orderMoney, + payMethod: item.payMethod, + code: + item.products.length > 1 ? "-" : item.products[0].activateCode, + canDownLoad: downFlag, + products: products, + }; }); - return { - id: item.id, - sn: item.sn, - name: name, - source: item.source == 0 ? "婵�娲荤爜涓嬭浇" : "绾夸笂璐拱", - createTime: item.createTime, - status: status, - orderStatus: item.orderStatus, - orderMoney: item.orderMoney, - payMethod: item.payMethod, - code: - item.products.length > 1 ? "-" : item.products[0].activateCode, - canDownLoad: downFlag, - products: products, - }; + this.total = res.data.total; + if (res.data.total <= this.size) { + this.page = 1; + } + }) + .catch((err) => { + this.$notify.error(err.msg); }); - this.total = res.data.total; - if (res.data.total <= this.size) { - this.page = 1; - } - }); }, //鍒嗛〉鍔熻兘 handleSizeChange(size) { @@ -392,7 +396,9 @@ }, clearSearch() { + debugger; this.searchTime = this.getDateInit(); + debugger; this.inputText = ""; this.searchingBtn(); }, @@ -505,6 +511,46 @@ openImg(url) { window.open("http://" + url); }, + + async exportList() { + let param = { + page: this.page, + size: this.size, + startTime: this.searchTime ? this.searchTime[0] : "", + endTime: this.searchTime ? this.searchTime[1] : "", + inputText: this.inputText, + productBaseId: "0", + orderName: "", + orderType: "", + status: 0, + }; + + const result = await getAuthFile(param); + + console.log(result); + + var blob = new Blob([result.body.data], { + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", + }), + Temp = document.createElement("a"); + + Temp.href = window.URL.createObjectURL(blob); + + console.log(result); + console.log(result.fileName); + + Temp.download = window.decodeURI(result.fileName); + + Temp.setAttribute("download", result.fileName); + + document.body.appendChild(Temp); + + Temp.click(); + + document.body.removeChild(Temp); + + window.URL.revokeObjectURL(Temp); + }, }, mounted() {}, }; @@ -557,6 +603,7 @@ align-items: center; justify-content: center; margin-left: 195px; + cursor: pointer; } .resetBtn { width: 60px; diff --git a/src/views/personalCenter/components/SubAccount.vue b/src/views/personalCenter/components/SubAccount.vue index bba3c6c..dc001bc 100644 --- a/src/views/personalCenter/components/SubAccount.vue +++ b/src/views/personalCenter/components/SubAccount.vue @@ -43,11 +43,9 @@ <el-table id="multipleTable" ref="multipleTable" - tooltip-effect="dark" :data="dataList" :fit="true" :default-sort="{ prop: 'createTime', order: 'descending' }" - :stripe="true" > <el-table-column label="搴忓彿" width="55" class-name="index"> <template slot-scope="scope">{{ @@ -69,8 +67,15 @@ <span>{{ scope.row.userType == 1 ? "涓汉" : "鍏徃" }}</span> </template> </el-table-column> + <el-table-column prop="authDuration" label="鎺堟潈鏃堕暱"> + <template slot-scope="scope"> + <span>{{ scope.row.authDuration + " 骞�" }} </span> + </template> </el-table-column> + + <!-- <el-table-column prop="authDuration" label="鎺堟潈鏃堕暱"> + </el-table-column> --> <el-table-column prop="dataNames" label="鏉冮檺"> </el-table-column> <el-table-column label="鐘舵��"> @@ -121,7 +126,7 @@ <el-form-item label="瀵嗙爜" prop="password"> <el-input v-model="ruleForm.password" style="width: 350px"></el-input> </el-form-item> - <el-form-item label="閲嶇疆瀵嗙爜" prop="isChangePwd"> + <el-form-item label="閲嶇疆瀵嗙爜"> <el-checkbox v-model="ruleForm.isChangePwd" >棣栨鐧婚檰淇敼瀵嗙爜</el-checkbox > @@ -133,11 +138,11 @@ <el-form-item label="濮撳悕" prop="trueName"> <el-input v-model="ruleForm.trueName" style="width: 350px"></el-input> </el-form-item> - <el-form-item label="閭" prop="email"> + <el-form-item label="閭"> <el-input v-model="ruleForm.email" style="width: 350px"></el-input> </el-form-item> - <el-form-item label="琛屼笟" prop="industryId"> + <el-form-item label="琛屼笟"> <el-select v-model="ruleForm.industryId" placeholder="璇烽�夋嫨琛屼笟" @@ -151,15 +156,14 @@ ></el-option> </el-select> </el-form-item> - <el-form-item label="鍦板尯" prop="address"> + <el-form-item label="鍦板尯"> <el-cascader v-model="ruleForm.address" :props="options" style="width: 350px" - @change="handleChange" ></el-cascader> </el-form-item> - <el-form-item label="鎺堟潈鏃堕暱" prop="authDuration"> + <el-form-item label="鎺堟潈鏃堕暱"> <el-select v-model="ruleForm.authDuration" style="width: 350px" @@ -172,8 +176,6 @@ </el-form-item> <el-form-item label="鐢ㄦ埛鏉冮檺" prop="menuIds" class="user-tree"> - <!-- <TreeBox :defaultProp="defaultProp" :treeData="sysMenus"></TreeBox> --> - <!-- <TreeBox :defaultProp="defaultProp2" :treeData="data2"></TreeBox> --> <div class="tree-box"> <div class="t">鑿滃崟鏉冮檺</div> <el-tree @@ -234,6 +236,18 @@ StepsCard, }, data() { + const validateTree = (rule, value, callback) => { + if ( + this.ruleForm.menuIds && + this.ruleForm.dataIds && + this.ruleForm.menuIds.length > 0 && + this.ruleForm.dataIds.length > 0 + ) { + callback(); + } else { + callback(new Error("璇烽�夎彍鍗曟潈闄愬拰鏁版嵁鏉冮檺")); + } + }; return { searchTime: [ this.$moment().format("YYYY-MM-DD 00:00:00"), @@ -311,17 +325,15 @@ dataIds: [], }, rules: { - name: [ - { required: true, message: "璇疯緭鍏ユ椿鍔ㄥ悕绉�", trigger: "blur" }, - { min: 3, max: 5, message: "闀垮害鍦� 3 鍒� 5 涓瓧绗�", trigger: "blur" }, + username: [ + { required: true, message: "璇疯緭鍏ョ敤鎴峰悕", trigger: "blur" }, ], - region: [ - { required: true, message: "璇烽�夋嫨娲诲姩鍖哄煙", trigger: "change" }, + password: [{ required: true, message: "璇疯緭鍏ュ瘑鐮�", trigger: "blur" }], + userType: [ + { required: true, message: "璇烽�夋嫨鐢ㄦ埛绫诲瀷", trigger: "blur" }, ], - resource: [ - { required: true, message: "璇烽�夋嫨娲诲姩璧勬簮", trigger: "change" }, - ], - desc: [{ required: true, message: "璇峰~鍐欐椿鍔ㄥ舰寮�", trigger: "blur" }], + trueName: [{ required: true, message: "璇疯緭鍏ュ鍚�", trigger: "blur" }], + menuIds: [{ validator: validateTree, trigger: "blur" }], }, sysMenus: [], DataTree: [], @@ -354,9 +366,9 @@ } }); }, - addSubCount(){ - this.isShowAdd = true - this.resetUser() + addSubCount() { + this.isShowAdd = true; + this.resetUser(); }, editUser(row) { this.isShowAdd = true; @@ -385,13 +397,16 @@ trueName: "", email: "", isChangePwd: false, + address: [], industryId: "", areaId: "", provinceId: "", authDuration: "", }; - this.$refs.treeMenus.setCheckedKeys([]); - this.$refs.treeData.setCheckedKeys([]); + this.$nextTick(() => { + this.$refs.treeMenus.setCheckedKeys([]); + this.$refs.treeData.setCheckedKeys([]); + }); }, async getIndustrys() { let res = await getDic(); @@ -404,34 +419,41 @@ saveSubUser() { this.ruleForm.menuIds = this.$refs.treeMenus.getCheckedKeys(); this.ruleForm.dataIds = this.$refs.treeData.getCheckedKeys(); - let json = { - id: this.isEditing ? this.ruleForm.id : "", - username: this.ruleForm.username, - password: this.ruleForm.password, - isChangePwd: this.ruleForm.isChangePwd, - userType: this.ruleForm.userType, - trueName: this.ruleForm.trueName, - email: this.ruleForm.email, - industryId: this.ruleForm.industryId, - areaId: this.ruleForm.address[1], - authDuration: this.ruleForm.authDuration, - menuIds: this.ruleForm.menuIds, - dataIds: this.ruleForm.dataIds, - }; - saveSubUser(json) - .then((res) => { - if (res.success) { - this.$notify.success(res.data) - this.isShowAdd = false; - this.isEditing = false; - this.findUserList(); - } else { - this.$notify.error(res.msg); - } - }) - .catch((err) => { - this.$notify.error(err.message); - }); + this.$refs["ruleForm"].validate((valid) => { + if (valid) { + let json = { + id: this.isEditing ? this.ruleForm.id : "", + username: this.ruleForm.username, + password: this.ruleForm.password, + isChangePwd: this.ruleForm.isChangePwd, + userType: this.ruleForm.userType, + trueName: this.ruleForm.trueName, + email: this.ruleForm.email, + industryId: this.ruleForm.industryId, + areaId: + this.ruleForm.address.length == 2 ? this.ruleForm.address[1] : "", + authDuration: this.ruleForm.authDuration, + menuIds: this.ruleForm.menuIds, + dataIds: this.ruleForm.dataIds, + }; + saveSubUser(json) + .then((res) => { + if (res.success) { + this.$notify.success(res.data); + this.isShowAdd = false; + this.isEditing = false; + this.findUserList(); + } else { + this.$notify.error(res.msg); + } + }) + .catch((err) => { + this.$notify.error(err.data.msg); + }); + } else { + return false; + } + }); }, findUserList() { findUserList({ @@ -495,10 +517,12 @@ //鍒嗛〉鍔熻兘 handleSizeChange(size) { this.size = size; + this.findUserList(); }, //鍒嗛〉鍔熻兘 refrash(page) { this.page = page; + this.findUserList(); }, //瑙g粦鎸夐挳 @@ -590,6 +614,11 @@ border-color: #c0c5cc; } .user-tree { + .el-form-item__label:before { + content: "*"; + color: #f52323; + margin-right: 4px; + } .el-form-item__content { display: flex; .tree-box { diff --git a/src/views/product/components/ProductContent.vue b/src/views/product/components/ProductContent.vue index 5b4436e..d7280ee 100644 --- a/src/views/product/components/ProductContent.vue +++ b/src/views/product/components/ProductContent.vue @@ -259,6 +259,7 @@ font-size: 14px; border-radius: 0; border: 1px solid #fff; + color: #3d3d3d; &.selected { border: 1px solid #0065ff; diff --git a/src/views/product/components/productCard.vue b/src/views/product/components/productCard.vue index 8df9f91..8d69278 100644 --- a/src/views/product/components/productCard.vue +++ b/src/views/product/components/productCard.vue @@ -9,9 +9,18 @@ <div class="right"> <div class="name">{{ data.productName }}</div> <div class="tagList"> - <span class="tag" v-for="(name, index) in labels" :key="index">{{ - name - }}</span> + <span + class="tag" + v-for="(name, index) in labels" + :key="index" + :class="{ + red: name === '杞欢', + orange: name === '搴旂敤', + lightBlue: name === 'SDK', + blue: name === '浜у搧瀵嗛挜', + }" + >{{ name }}</span + > </div> </div> </div> @@ -39,6 +48,18 @@ name: this.data.productName, }, }); + }, + getColor(name) { + switch (name) { + case "绠楁硶": + return "red"; + case "搴旂敤": + return "orange"; + case "浜戞湇鍔�": + return "lightBlue"; + case "杈圭紭璁$畻璁惧": + return "blue"; + } }, }, }; @@ -91,6 +112,26 @@ padding: 2px 5px; border: 1px solid #ff5033; color: #ff5033; + + &.red { + color: #ff4f32; + border-color: #ff4f32; + } + + &.orange { + color: #ff9500; + border-color: #ff9500; + } + + &.lightBlue { + color: #00bee7; + border-color: #00bee7; + } + + &.blue { + color: #0064ff; + border-color: #0064ff; + } } } } diff --git a/src/views/productDetail/components/ConfirmOrder.vue b/src/views/productDetail/components/ConfirmOrder.vue index 23226d8..dc91025 100644 --- a/src/views/productDetail/components/ConfirmOrder.vue +++ b/src/views/productDetail/components/ConfirmOrder.vue @@ -30,13 +30,13 @@ >{{ item + " " }}</span > </p> - <p> + <p v-if="scope.row.ChCount"> 閫氶亾鏁伴噺锛� - <span>{{ scope.row.chCount || 0 }}</span> + <span>{{ scope.row.ChCount }}</span> </p> - <p> + <p v-if="scope.row.authCount"> 鎺堟潈鏁伴噺锛� - <span>{{ scope.row.authCount || 0 }}</span> + <span>{{ scope.row.authCount }}</span> </p> <p v-if="scope.row.sdkNames.length > 0"> 绠楁硶锛� @@ -47,6 +47,10 @@ > </p> <p> + 璐拱鏁伴噺 + <span>{{ scope.row.devCount }}</span> + </p> + <p> 鏈嶅姟鏃堕暱锛� <span>{{ scope.row.serveYear + "骞�" }}</span> </p> diff --git a/src/views/productDetail/components/PayCard.vue b/src/views/productDetail/components/PayCard.vue index 11c0f36..91c8931 100644 --- a/src/views/productDetail/components/PayCard.vue +++ b/src/views/productDetail/components/PayCard.vue @@ -319,6 +319,7 @@ import { getReleaseProduct } from "@/api/product"; import { resumeOrder } from "@/api/shopcart"; import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder"; +import { resumePay } from "@/api/order"; export default { props: { @@ -328,6 +329,9 @@ ConfirmOrder, }, created() { + this.data = this.dataInfo.data; + this.labels = this.dataInfo.labels; + this.cartItem.id = this.data.id; this.getDevList(); if (this.dataInfo.data.pics.length > 0) { this.activeImg.url = this.dataInfo.data.pics[0].url; @@ -336,8 +340,8 @@ }, data() { return { - data: this.dataInfo.data, - labels: this.dataInfo.labels, + data: {}, + labels: [], cartItem: { id: "", productName: "", @@ -539,6 +543,27 @@ }).then((res) => { if (res.success) { this.orderId = res.data.orderId; + + if (this.cartItem.totalPrice == 0) { + resumePay({ orderId: this.orderId, payMethod: 5 }).then((res) => { + if (res.success) { + this.$router.push({ + path: "/personalCenter", + query: { + id: 1, + }, + }); + this.$notify({ + type: "success", + message: "鎴愬姛璇曠敤", + duration: 2500, + offset: 57, + }); + } + }); + return; + } + this.showOrder = true; } }); @@ -742,6 +767,10 @@ border: 1px solid #c0c5cc; border-radius: 0; } + + .el-tag { + margin-top: 0; + } } } diff --git a/src/views/productDetail/components/UploadBox.vue b/src/views/productDetail/components/UploadBox.vue index 3c29672..cbfd153 100644 --- a/src/views/productDetail/components/UploadBox.vue +++ b/src/views/productDetail/components/UploadBox.vue @@ -72,9 +72,10 @@ <el-image class="preview" v-if="item.appendix" - :src="`/httpImage/${item.appendix}`" + :src="`http://${item.appendix}`" fit="contain" ></el-image> + <div class="el-upload__text"> <i class="el-icon-plus"></i> <span class="words"> diff --git a/src/views/register/components/SelectType.vue b/src/views/register/components/SelectType.vue index 5c8aeb6..c6cb5f2 100644 --- a/src/views/register/components/SelectType.vue +++ b/src/views/register/components/SelectType.vue @@ -7,26 +7,30 @@ :validate-on-rule-change="false" label-width="76px" > - <el-form-item label="绫诲瀷" prop="type"> + <el-form-item label="绫诲瀷" prop="userType"> <el-radio-group - v-model="info.type" + v-model="info.userType" style="float: left; margin-top: 15px" > <el-radio :label="1">涓汉</el-radio> <el-radio :label="2">鍏徃</el-radio> </el-radio-group> </el-form-item> - <el-form-item label="鐪熷疄濮撳悕" prop="trueName" v-show="info.type == '1'"> + <el-form-item + label="鐪熷疄濮撳悕" + prop="trueName" + v-show="info.userType == '1'" + > <el-input v-model="info.trueName" placeholder="璇疯緭鍏�"></el-input> </el-form-item> <el-form-item label="鍏徃鍚嶇О" prop="companyName" - v-show="info.type == '2'" + v-show="info.userType == '2'" > <el-input v-model="info.companyName" placeholder="璇疯緭鍏�"></el-input> </el-form-item> - <el-form-item label="鑱旂郴浜�" prop="contact" v-show="info.type == '2'"> + <el-form-item label="鑱旂郴浜�" prop="contact" v-show="info.userType == '2'"> <el-input v-model="info.contact" placeholder="璇疯緭鍏�"></el-input> </el-form-item> <el-form-item label="閭" prop="email"> @@ -124,9 +128,9 @@ }, computed: { infoRules() { - if (this.info.type == 1) { + if (this.info.userType == 1) { return { - type: [{ required: true, message: "璇烽�夋嫨绫诲瀷" }], + userType: [{ required: true, message: "璇烽�夋嫨绫诲瀷" }], trueName: [ { required: true, message: "璇峰~鍐欑湡瀹炲鍚�", trigger: "change" }, ], @@ -134,7 +138,7 @@ }; } else { return { - type: [{ required: true, message: "璇烽�夋嫨绫诲瀷" }], + userType: [{ required: true, message: "璇烽�夋嫨绫诲瀷" }], companyName: [ { required: true, message: "璇峰~鍐欏叕鍙稿悕绉�", trigger: "change" }, ], @@ -146,11 +150,15 @@ } }, disabled() { - if (this.info.type == 1 && this.info.trueName) { + if (this.info.userType == 1 && this.info.trueName) { return false; } - if (this.info.type == 2 && this.info.companyName && this.info.contact) { + if ( + this.info.userType == 2 && + this.info.companyName && + this.info.contact + ) { return false; } @@ -403,5 +411,9 @@ width: 230px; height: 175px; } + + .el-scrollbar__view { + overflow: hidden; + } } </style> \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 719e360..b70d2fa 100644 --- a/vue.config.js +++ b/vue.config.js @@ -23,10 +23,9 @@ "/httpImage": { //target: "http://bsic.asuscomm.com:7003", // target: "http://222.128.87.51:7003", - target: "http://192.168.20.10:7009", - // target: "http://192.168.20.117:7080", + // target: "http://192.168.20.10:7009", // target: "http://192.168.20.189:7009", - // target: "http://192.168.20.117:7080", + target: "http://192.168.20.117:7080", changeOrigin: true, //寮�鍚唬鐞� }, -- Gitblit v1.8.0