From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail.vue | 288 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 288 insertions(+), 0 deletions(-) diff --git a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail.vue b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail.vue new file mode 100644 index 0000000..efb6d23 --- /dev/null +++ b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail.vue @@ -0,0 +1,288 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <!-- <span + slot="photo" + slot-scope="text,record" + > + <Tooltip + placement="top" + title="棰勮鍥剧墖" + > + <img + v-if=" record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif')" + width="30" + height="14" + border="1" + draggable="false" + preview="1" + :preview-text="''" + :src="record.upload.src" + /> + </Tooltip> + <a + v-if="record.upload.path && record.upload.format.toLowerCase()=='pdf'" + href="javascript:;" + @click="view(record.upload)" + > + 棰勮 + </a> + </span> --> + + <template + slot="photo" + slot-scope="text,record" + > + <span + v-if="!text" + style="font-size: 12px;font-style: italic;" + >鏃犲浘鐗�</span> + <img + v-else + :src="getImgView(text)" + :preview="record.id" + height="25px" + alt="" + style="max-width:80px;font-size: 12px;font-style: italic;" + /> + </template> + </a-table> + </div> + <pdf-view ref="pdfview"></pdf-view> + </a-card> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import { preview } from 'vue-photo-preview' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import Vue from 'vue' +import PdfView from '@views/common/PdfView' +import { getFileAccessHttpUrl } from '@/api/manage'; + +export default { + name: "MaintenanceStandardModal", + components: { + Tooltip, + PdfView, + preview, + }, + mixins: [JeecgListMixin], + props: { + maintenanceStandardId: { + type: String, + default: '-1', + required: false + } + }, + watch: { + maintenanceStandardId: { + immediate: true, + handler(val) { + if (!this.maintenanceStandardId) { + this.clearList() + } else { + this.queryParam['maintenanceStandardId'] = val; + this.queryParam['delFlag'] = 0; + this.loadData(1); + } + } + } + }, + data() { + return { + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 100, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '閮ㄤ綅', + align: "center", + dataIndex: 'location', + }, + { + title: '绀烘剰鍥�', + align: "center", + dataIndex: 'photo', + scopedSlots: { customRender: 'photo' }, + }, + { + title: '淇濆吇椤圭洰', + align: "center", + dataIndex: 'name', + + }, + { + title: '淇濆吇鏍囧噯', + align: "center", + dataIndex: 'standard', + + }, + { + title: '鏂规硶', + align: "center", + dataIndex: 'maintenanceMethodName', + + }, + { + title: '宸ュ叿', + align: "center", + dataIndex: 'maintenanceTool', + }, + { + title: '瀹夊叏瑕佹眰', + align: "center", + dataIndex: 'maintenanceRequire', + }, + { + title: '宸ユ椂瀹氶', + align: "center", + dataIndex: 'workingHourQuota', + }, + { + title: '淇濆吇鍛ㄦ湡', + align: "center", + dataIndex: 'maintenanceCycleName', + }, + { + title: '缁翠繚涓撲笟', + align: "center", + dataIndex: 'maintenanceSpecialtyName', + }, + { + title: '缁翠慨淇濆吇瑙掕壊', + align: "center", + dataIndex: 'maintenanceRoleName', + }, + + ], + url: { + list: "/eam/maintenanceStandardDetail/getMaintenanceStandardList",//鏁版嵁鏉ユ簮mom_eam_daily_inspection_standard_detail + }, + } + }, + created() { + }, + computed: { + }, + methods: { + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records || res.result; + for (let i = 0; i < this.dataSource.length; i++) { + let r = this.dataSource[i].upload; + r.src = this.getSrc(this.dataSource[i].upload); + } + if (res.result.total) { + this.ipagination.total = res.result.total; + } else { + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + + getSrc(record) { + + if (!record.path) { + return ''; + } + //鏈湴锛歭ocal\Minio锛歮inio\闃块噷浜戯細alioss + if (record.uploadType == 'local') { + + let ssoLoginFlag = Vue.ls.get("ssoLoginFlag"); + let deployMode = Vue.ls.get("deployMode"); + + if (ssoLoginFlag && deployMode == "container") { + var baseProject = Vue.ls.get("baseProject"); + console.log("baseProject==>" + baseProject) + + var hostname = window.location.protocol + "//" + window.location.host; + var url = hostname + '/' + baseProject + '/sys/common/static'; + return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer']) + } else { + //鏍规嵁鍙戝竷鐘舵�佷慨鏀筯ttps 鎴� http + return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer']) + } + + } else if (record.uploadType == 'alioss') { + + const OSS = require('ali-oss') + const client = new OSS({ + // region浠ユ澀宸炰负渚嬶紙oss-cn-hangzhou锛夛紝鍏朵粬region鎸夊疄闄呮儏鍐靛~鍐欍�� + region: window._CONFIG['region'], + // 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵�鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰昍AM鎺у埗鍙板垱寤篟AM璐﹀彿銆� + accessKeyId: window._CONFIG['accessKeyId'], + accessKeySecret: window._CONFIG['accessKeySecret'], + bucket: window._CONFIG['bucket'], + }) + // object-key琛ㄧず浠嶰SS涓嬭浇鏂囦欢鏃堕渶瑕佹寚瀹氬寘鍚枃浠跺悗缂�鍦ㄥ唴鐨勫畬鏁磋矾寰勶紝渚嬪abc/efg/123.jpg銆� + return client.signatureUrl(record.path) + } + }, + + view(record) { + this.$refs.pdfview.showPdf(record.src); + }, + + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> -- Gitblit v1.9.3