From 0a48655d2162b709ecb80d249a4085971add6140 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期一, 07 七月 2025 17:26:30 +0800 Subject: [PATCH] 企业微信 --- pages/device/deviceDeils/deviceDeils.vue | 59 ++++++++++++----------------------------------------------- 1 files changed, 12 insertions(+), 47 deletions(-) diff --git a/pages/device/deviceDeils/deviceDeils.vue b/pages/device/deviceDeils/deviceDeils.vue index 3c86bb0..d335a69 100644 --- a/pages/device/deviceDeils/deviceDeils.vue +++ b/pages/device/deviceDeils/deviceDeils.vue @@ -72,19 +72,12 @@ <!-- 涓嬭浇鎸夐挳 --> <image v-show="showBtn" src="/static/icon_down.png" @click="downloadFile(file)" style="height: 25px; width: 25px; margin-right: 10px;"></image> - <!-- <button size="mini" @click="downloadFile(file)"> - <view class="icon-download">涓嬭浇</view> - </button> --> - <!-- 鍒犻櫎鎸夐挳 --> - <image v-show="showBtn" src="/static/icon_del.png" @click="deleteFile(index)" - style="height: 25px; width: 25px;"></image> - </button> </view> </view> </view> <view class="flex margin-bottom-xs"> - <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" - @click="goReportRepair()">鎶ヤ慨</button> + <button v-if="authIncludes('eam:reportRepair:add')" class="flex-sub cu-btn bg-blue margin-sm lg" + hover-class="is-hover" @click="goReportRepair()">鎶ヤ慨</button> <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" @click="goCheck()">鐐规</button> <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" @@ -155,7 +148,13 @@ msg1Title: "" } }, + mounted() { + console.log('浠� store 鑾峰彇鐨� auth:', this.$store.getters.getAuth) + }, computed: { + authList() { + return this.$store.getters.getAuth || [] + }, top() { return this.CustomBar * 2 + 160 }, @@ -181,6 +180,9 @@ this.getFileList() }, methods: { + authIncludes(code) { + return this.authList.some(auth => auth.action === code) + }, downloadFile(item) { uni.showModal({ title: '鎻愮ず', @@ -239,44 +241,6 @@ }); }); }, - - - - - // downFile(item) { - // this.$http.download(this.url.downloadFile, { - // params: { - // id:item.id - // }, - // }).then(res => { - // if (!res) { - // this.$message.warning('鏂囦欢涓嬭浇澶辫触') - // return - // } else { - // let fileName = item.fileName; - // if (typeof window.navigator.msSaveBlob !== 'undefined') { - // window.navigator.msSaveBlob(new Blob([res]), fileName); - // } else { - // let url = window.URL.createObjectURL(new Blob([res])); - // let link = document.createElement('a'); - // link.style.display = 'none'; - // link.href = url; - // link.setAttribute('download', fileName); - // document.body.appendChild(link); - // link.click() - // document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 - // window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 - // } - // } - // }).catch((err) => { - // uni.showToast({ - // title: '鑾峰彇鏂囦欢鍒楄〃澶辫触', - // icon: 'none' - // }); - // }); - // }, - - getFileList() { this.$http.get(this.url.fileList, { params: { @@ -410,6 +374,7 @@ uni.redirectTo({ url: `/pages/reportRepair/reportRepair?equipmentId=${encodeURIComponent(this.id)}` }); + }, /** * 鐐规 -- Gitblit v1.9.3