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/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer.vue | 844 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 844 insertions(+), 0 deletions(-)
diff --git a/src/views/eam/modules/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer.vue b/src/views/eam/modules/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer.vue
new file mode 100644
index 0000000..96b8538
--- /dev/null
+++ b/src/views/eam/modules/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer.vue
@@ -0,0 +1,844 @@
+<template>
+ <a-drawer
+ :title="title"
+ :width="drawerWidth"
+ :visible="visible"
+ @close="handleCancel"
+ :confirmLoading="confirmLoading"
+ :maskClosable="maskClosable"
+ >
+ <a-card :style="getBackground()">
+ <template>
+ <a-card>
+ <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+ <a-row :style="{textAlign:'left'}">
+ <a-button
+ :style="{marginRight: '8px'}"
+ @click="handleSW"
+ :disabled=SWbuttonDistable
+ type="primary"
+ v-has="'specialtyMaintenanceOrder:SW'"
+ >寮�宸�</a-button>
+ <a-button
+ :style="{marginRight: '8px'}"
+ @click="handleReport"
+ :disabled="buttonDistable"
+ type="primary"
+ v-has="'specialtyMaintenanceOrder:report'"
+ >鎶ュ伐</a-button>
+ <a-button
+ :style="{marginRight: '8px'}"
+ @click="handleReset"
+ :disabled="revocationDistable"
+ type="primary"
+ v-has="'specialtyMaintenanceOrder:reset'"
+ >鎾ら攢</a-button>
+ </a-row>
+ </div>
+ <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+ <a-row :gutter="24">
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="鐘舵��"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.statusName }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="淇濆吇宸ュ崟鍙�"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.num }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="淇濆吇绫诲瀷"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.maintenanceTypeName }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ <a-row :gutter="24">
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="瀵硅薄閮ㄩ棬"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.departName }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="缁翠繚鏂瑰紡"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hight"
+ >{{ this.model.maintenanceMode }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="璐d换鐝粍"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.teamName }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ </div>
+ <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+ <a-row :gutter="24">
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="璁惧缂栧彿"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.equipmentNum }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="璁惧鍚嶇О"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.equipmentName }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ <a-col :span="8">
+ <a-form-item
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ label="璁惧鍨嬪彿"
+ class="hightColor"
+ >
+ <span
+ v-if="this.model != null"
+ class="hightColor"
+ >{{ this.model.equipmentModel }}</span>
+ <span
+ v-else
+ class="frozenRowClass"
+ >-</span>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ <a-row :gutter="24">
+ <a-col :span="12">
+ <a-pagination
+ class="hightColor"
+ v-model="currentPage"
+ :total="total"
+ :show-total="(total, range) => `鍏辫 ${total} 鍙拌澶嘸"
+ :page-size="pageSize"
+ @change="onChange"
+ >
+ </a-pagination>
+ </a-col>
+
+ </a-row>
+ </div>
+ <a-tabs
+ type="card"
+ defaultActiveKey="1"
+ >
+ <a-tab-pane
+ tab='淇濆吇鏄庣粏'
+ key="1"
+ class="hightColor"
+ >
+
+ <div>
+ <a-table
+ ref="table"
+ size="middle"
+ bordered
+ rowKey="id"
+ :columns="columns"
+ :dataSource="dataSource"
+ :loading="loading"
+ @change="handleTableChange"
+ :pagination="ipagination"
+ :scroll="{ x: 'calc(1200px + 50%)', y: 900 }"
+ >
+ <!-- :scroll="{x:true}" -->
+ <template
+ slot="imgSlot"
+ 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>
+ </a-tab-pane>
+
+ <a-tab-pane
+ tab='璁″垝鐢ㄦ枡'
+ key="2"
+ >
+ <div
+ class="table-operator"
+ style="margin:-16px"
+ >
+ <maintenance-standard-planning-material :maintenanceStandardId='maintenanceStandardId' />
+ </div>
+ </a-tab-pane>
+ <a-tab-pane
+ tab='鍗遍櫓闃叉帶'
+ key="3"
+ >
+ <div
+ class="table-operator"
+ style="margin:-16px"
+ >
+ <maintenance-standard-safety-requirement :maintenanceStandardId='maintenanceStandardId' />
+ </div>
+ </a-tab-pane>
+ <a-tab-pane
+ tab='浣滀笟鎸囧涔�'
+ key="4"
+ >
+ <div
+ class="table-operator"
+ style="margin:-16px"
+ >
+ <maintenance-standard-work-instruction :maintenanceStandardId='maintenanceStandardId' />
+ </div>
+ </a-tab-pane>
+ <a-tab-pane
+ tab='瀹為檯鐢ㄦ枡'
+ key="5"
+ >
+ <div
+ class="table-operator"
+ style="margin:-16px"
+ >
+ <actual-material-edit-table
+ ref="actualMaterialTabel"
+ :specialyMaintenanceOrderId="this.model.id"
+ :specialyMaintenanceOrderStatus="this.model.status"
+ :equipmentId="this.model.equipmentId"
+ ></actual-material-edit-table>
+ </div>
+ </a-tab-pane>
+ <a-tab-pane
+ tab='瀹為檯宸ユ椂'
+ key="6"
+ >
+ <div
+ class="table-operator"
+ style="margin:-16px"
+ >
+ <actual-work-hours-edit-table
+ :specialyMaintenanceOrderId="this.model.id"
+ :specialyMaintenanceOrderStatus="this.model.status"
+ :equipmentId="this.model.equipmentId"
+ :teamId="this.model.teamId"
+ ></actual-work-hours-edit-table>
+ </div>
+ </a-tab-pane>
+
+ <a-tab-pane
+ tab='淇濆吇璺嚎鍥�'
+ key="8"
+ class="hightColor"
+ >
+ <div
+ class="table-operator"
+ style="margin:-16px"
+ >
+ <photo-preview :specialtyMaintenancePlanId='specialtyMaintenancePlanId' />
+ </div>
+ </a-tab-pane>
+ </a-tabs>
+ </a-card>
+ </template>
+ </a-card>
+
+ <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+ <a-row :style="{textAlign:'right'}">
+ <a-button
+ :style="{marginRight: '8px'}"
+ @click="handleCancel"
+ >
+ 鍙栨秷
+ </a-button>
+ <a-button
+ :style="{marginRight: '8px'}"
+ @click="handleTS"
+ :disabled="buttonDistable"
+ type="primary"
+ v-if="false"
+ >鏆傚瓨</a-button>
+ <a-button
+ @click="handleOk"
+ :disabled="buttonDistable"
+ type="primary"
+ v-if="false"
+ >淇濆瓨</a-button>
+ </a-row>
+ </div>
+ </a-drawer>
+</template>
+
+<script>
+import PhotoPreview from './PhotoPreview'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { requestPut, getAction, downFile } 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';
+
+import MaintenanceStandardPlanningMaterial from './MaintenanceStandardPlanningMaterial'
+import MaintenanceStandardSafetyRequirement from './MaintenanceStandardSafetyRequirement'
+import MaintenanceStandardWorkInstruction from './MaintenanceStandardWorkInstruction'
+import ActualMaterialEditTable from './ActualMaterialEditTable.vue'
+import ActualWorkHoursEditTable from './ActualWorkHoursEditTable.vue'
+
+export default {
+ name: 'SpecialyInspectionOrderExeDrawer',
+ mixins: [JeecgListMixin],
+ components: {
+ PhotoPreview,
+ PdfView,
+ preview,
+ Tooltip,
+ MaintenanceStandardPlanningMaterial,
+ MaintenanceStandardSafetyRequirement,
+ MaintenanceStandardWorkInstruction,
+ ActualMaterialEditTable,
+ ActualWorkHoursEditTable
+ },
+ data() {
+ return {
+ pageSizeOptions: ['1'],
+ currentPage: 1,
+ pageSize: 1,
+ total: 10,
+
+ title: "涓撲笟宸ュ崟鎵ц",
+ visible: false,
+ maskClosable: true,
+ confirmLoading: false,
+ drawerWidth: "100%",
+ buttonDistable: false,
+ SWbuttonDistable: false,
+ revocationDistable: false,
+ currentNodeSelect: '',
+ specialtyMaintenancePlanId: '',
+ maintenanceStandardId: '-1',
+ dataSource: [],
+ model: {},
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 6 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 18 },
+ },
+ columns: [
+ {
+ title: '#',
+ dataIndex: '',
+ key: 'rowIndex',
+ align: 'center',
+ customRender: function (t, r, index) {
+ return parseInt(index) + 1
+ },
+ width: 60,
+ },
+ {
+ title: '閮ㄤ綅',
+ align: 'center',
+ dataIndex: 'location',
+ },
+ // class: "notshow"
+ {
+ title: '绀烘剰鍥�',
+ align: 'center',
+ dataIndex: 'photo',
+ scopedSlots: { customRender: 'imgSlot' },
+ },
+ // class: "notshow"
+ {
+ title: '淇濆吇椤圭洰',
+ align: 'center',
+ dataIndex: 'maintenanceProjectNum',
+ },
+ {
+ 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',
+ },
+ ],
+ url: {
+ // save: "/eam/specialtyInspectionOrderDetail/save",
+ // edit: "/eam/specialtyInspectionOrderDetail/edit",
+ list: "/eam/specialtyMaintenanceOrderDetail/getSpecialtyMaintenanceOrderDetailList",
+ getEquipmentTotalByOrderId: "/eam/specialtyMaintenanceOrderDetail/getEquipmentTotalByOrderId",
+ urlDownload: window._CONFIG['staticDomainURL'],
+ download: '/sys/upload/downloadFile',
+ editStatus: "/eam/specialtyMaintenanceOrder/editStatus",
+ revocation: "/eam/specialtyMaintenanceOrder/revocation",
+ report: "/eam/specialtyMaintenanceOrder/report",
+ },
+ }
+ },
+ mounted() {
+ this.$bus.$on('closeDrawer', (data) => {
+ this.visible = false;
+ })
+ },
+
+ methods: {
+
+ onChange(page, pageSize) {
+ this.queryParam.specialtyMaintenanceOrderId = this.specialtyMaintenanceOrderId
+ this.queryParam.pageSize = pageSize
+ this.queryParam.pageNo = page
+ this.getEquipmentTotal()
+ },
+
+ handleShow(record) {
+ this.model = Object.assign({}, record);
+ this.dataSource = []
+ this.visible = true;
+ this.currentPage = 1
+ this.specialtyMaintenancePlanId = record.specialtyMaintenancePlanId
+ this.specialtyMaintenanceOrderId = record.id
+ this.queryParam.specialtyMaintenanceOrderId = record.id
+ this.queryParam.pageSize = 1
+ this.queryParam.pageNo = 1
+ this.getEquipmentTotal()
+ },
+ getEquipmentTotal() {
+ var params = this.queryParam;//鏌ヨ鏉′欢
+ getAction(this.url.getEquipmentTotalByOrderId, params).then((res) => {
+ if (res.success) {
+ this.total = res.result.total
+ this.model.equipmentNum = res.result.records[0].equipmentNum
+ this.model.equipmentName = res.result.records[0].equipmentName
+ this.model.equipmentModel = res.result.records[0].equipmentModel
+ this.model.equipmentId = res.result.records[0].equipmentId
+ this.queryParam.equipmentId = res.result.records[0].equipmentId
+ this.loadData1(1)
+ } else {
+ this.$message.warning(res.message)
+ }
+ }).finally(() => {
+
+ })
+ },
+ loadData1(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) {
+ for (let i = 0; i < res.result.records.length; i++) {
+ this.maintenanceStandardId = res.result.records[i].maintenanceStandardId;
+ let r = res.result.records[i].sketchPhoto;
+ r.src = this.getSrc(res.result.records[i].sketchPhoto);
+ }
+ //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+ this.dataSource = res.result.records || res.result;
+ 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
+ })
+ },
+
+ modalFormOk() {
+ this.getEquipmentTotal()
+ //娓呯┖鍒楄〃閫変腑
+ this.onClearSelected()
+ },
+ loadData() {
+ // this.getEquipmentTotal()
+ },
+ getBackground() {
+ return "background-color:rgba(127, 127, 127,0.08)";
+ },
+ handleCancel() {
+ this.$emit('ok');
+ this.alterFlag = new Date();
+ this.close()
+ },
+ close() {
+ this.visible = false;
+ },
+ //鏆傚瓨
+ handleTS() {
+ const that = this;
+ that.confirmLoading = true;
+ let formData = Object.assign(this.model);
+ formData.specialtyInspectionOrderDetails = that.dataSource
+ requestPut(this.url.edit, formData).then((res) => {
+ if (res.success) {
+ that.$message.success("鏆傚瓨鎴愬姛!");
+ that.getEquipmentTotal()
+ that.$emit('ok');
+ that.alterFlag = new Date();
+ } else {
+ that.$message.warning(res.message);
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ // that.close();
+ })
+ },
+ //寮�宸�
+ handleSW() {
+ const that = this;
+ that.confirmLoading = true;
+ this.$confirm({
+ title: '淇濆吇宸ュ崟寮�宸�',
+ content: '鎻愮ず锛氬紑宸ュ悗鏃犳硶鎾ゅ洖锛岃璋ㄦ厧鎿嶄綔锛�',
+ okText: '纭',
+ cancelText: '鍙栨秷',
+ onOk() {
+ requestPut(that.url.editStatus, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
+ if (res.success) {
+ that.model.status = '4'
+ that.$message.success("宸ュ崟寮�宸ユ垚鍔燂紒")
+ that.getEquipmentTotal()
+ that.buttonDistable = false
+ that.revocationDistable = true
+ that.SWbuttonDistable = true
+ } else {
+ that.$message.warning("宸ュ崟寮�宸ュけ璐ワ紒")
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ // that.close();
+ })
+ },
+ })
+ },
+ //鎶ュ伐
+ handleReport() {
+ var actualMaterials = this.$refs.actualMaterialTabel.dataSource;
+ for (var i = 0; i < actualMaterials.length; i++) {
+ if (actualMaterials[i].isLock == 'no') {
+ this.$message.warn("瀹為檯鐢ㄦ枡绗�" + (i + 1) + "琛屽皻鏈攣鏂欙紝璇烽攣鏂欏悗鍐嶈繘琛屾姤宸�");
+ return false;
+ }
+ }
+ const that = this;
+ that.confirmLoading = true;
+ this.$confirm({
+ title: '淇濆吇宸ュ崟鎶ュ伐',
+ content: '鎻愮ず锛氭姤宸ュ悗鐐规瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�',
+ okText: '纭',
+ cancelText: '鍙栨秷',
+ onOk() {
+ requestPut(that.url.report, { id: that.specialtyMaintenanceOrderId, status: '5' }).then((res) => {
+ if (res.success) {
+ that.model.status = '5'
+ that.$message.success(res.message)
+ that.getEquipmentTotal()
+ that.buttonDistable = false
+ that.revocationDistable = true
+ that.SWbuttonDistable = true
+ that.$emit('ok');
+ that.alterFlag = new Date();
+ that.close();
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ //
+ })
+ },
+ })
+ },
+ //鎾ら攢
+ handleReset() {
+ const that = this;
+ that.confirmLoading = true;
+ this.$confirm({
+ title: '瀹屽伐鎾ら攢',
+ content: '鎻愮ず锛氬畬宸ユ挙閿�鍚庡彲缁х画鎶ュ伐鎿嶄綔锛�',
+ okText: '纭',
+ cancelText: '鍙栨秷',
+ onOk() {
+ requestPut(that.url.revocation, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
+ if (res.success) {
+ that.model.status = '4'
+ that.$message.success(res.message)
+ that.getEquipmentTotal()
+ that.buttonDistable = false
+ that.revocationDistable = true
+ that.SWbuttonDistable = true
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ // that.close();
+ })
+ },
+ })
+ },
+ //淇濆瓨
+ handleOk() {
+ const that = this;
+ that.confirmLoading = true;
+ let formData = Object.assign(this.model);
+ for (let i = 0; i < that.dataSource.length; i++) {
+ let o = this.dataSource[i]
+ if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') {
+ that.$message.warning('璇疯緭鍏ョ偣妫�缁撴灉锛�')
+ that.confirmLoading = false;
+ return
+ }
+ if (o.treatmentMeasure == null || o.treatmentMeasure == '') {
+ that.$message.warning('璇烽�夋嫨寮傚父澶勭疆锛�')
+ that.confirmLoading = false;
+ return
+ }
+ }
+ formData.specialtyInspectionOrderDetails = that.dataSource
+ requestPut(this.url.save, formData).then((res) => {
+ if (res.success) {
+ that.$message.success("淇濆瓨鎴愬姛!");
+ that.getEquipmentTotal()
+ that.$emit('ok');
+ that.alterFlag = new Date();
+ } else {
+ that.$message.warning("淇濆瓨澶辫触!");
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ // that.close();
+ })
+ },
+
+ view(record) {
+ this.$refs.pdfview.showPdf(record.src);
+ },
+
+ handleDownload(record) {
+ downFile(this.url.download, { id: record.upload.id }).then((res) => {
+ if (!res) {
+ this.$message.warning('鏂囦欢涓嬭浇澶辫触')
+ return
+ } else {
+ let fileName = record.upload.name;
+ 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瀵硅薄
+ }
+ }
+ })
+ },
+
+ 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)
+ }
+ },
+ },
+
+}
+</script>
+
+<style scoped>
+@import '~@assets/less/common.less';
+.hightColor {
+ height: 10%;
+ font-weight: bold;
+ font-size: 20px;
+ color: #1b1e1e;
+}
+.frozenRowClass {
+ color: #c9c9c9;
+}
+.fontweight {
+ font-weight: bold;
+}
+.hight {
+ color: #f5222d;
+}
+/deep/ .red {
+ color: red;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3