Browse Source

文件审批流修改-提交

lxh 11 months ago
parent
commit
35556bb3f6

+ 15 - 8
src/views/vent/performance/approvalPend/approvalPend.data.ts

@@ -1,5 +1,5 @@
 import { BasicColumn } from '/@/components/Table';
-export const  columns:BasicColumn[]=[
+export const columns: BasicColumn[] = [
   {
     title: '序号',
     width: 60,
@@ -48,11 +48,18 @@ export const  columns:BasicColumn[]=[
     align: 'center',
     ellipsis: true,
   },
-  // {
-  //   title: '操作',
-  //   key: 'action',
-  //   width: 200,
-  //   slots: { customRender: 'action' },
-  //   align: 'center',
-  // },
+  {
+    title: '审批操作',
+    dataIndex: 'actionSp',
+    width: 200,
+    align: 'center',
+    slots: { customRender: 'actionSp' },
+  },
+  {
+    title: '文件操作',
+    dataIndex: 'actionWj',
+    width: 200,
+    align: 'center',
+    slots: { customRender: 'actionWj' },
+  },
 ]

+ 242 - 24
src/views/vent/performance/approvalPend/index.vue

@@ -2,20 +2,58 @@
     <div class="approvalPend">
         <a-table size="small" :dataSource="dataSource" :columns="columns" :scroll="{ y: 620 }" :pagination="pagination"
             @change="pageChange">
-
-            <template #action="{ record }">
-                <a-button type="link" style="color:#3DF6FF" @click="getViews">
-                    查看
-                </a-button>
+            <template #actionSp="{ record }">
+                <a class="table-action-link" @click="handleTo(record)">提交</a>
+                <a class="table-action-link" @click="handleSpDetail(record)">审批详情</a>
+                <a class="table-action-link" @click="handleSpRevoke(record)">撤回</a>
+            </template>
+            <template #actionWj="{ record }">
+                <a class="table-action-link" @click="handleEdit(record)">编辑</a>
+                <a class="table-action-link" @click="handleDownLoad(record)">下载</a>
+                <!-- <a-popconfirm title="确定删除?" @confirm="handleDelete(record)">
+                    <a class="table-action-link">删除</a>
+                </a-popconfirm> -->
             </template>
         </a-table>
+        <!-- 审批-提交弹窗 -->
+        <a-modal v-model:visible="visibleTj" centered :width="600" title="提交文件" @ok="handleTjOk"
+            @cancel="handleTjCancel">
+            <a-form :model="formStateTj" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-form-item label="选择审批" :rules="[{ required: true, message: '请选择是否提交' }]">
+                    <a-select v-model:value="formStateTj.file" style="width: 260px">
+                        <a-select-option v-for="file in fileList " :key="file.label" :value="file.value">{{ file.label
+                            }}</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </a-form>
+        </a-modal>
+        <!-- 审批详情弹窗 -->
+        <a-modal v-model:visible="visibleSp" width="1000px" :footer="null" :title="titleSp" centered destroyOnClose>
+            <HistorySp :historySpList="historySpList" :imgSrc="imgSrc" :isShow="isShow" :spInfo="spInfo"
+                @spClose="spClose">
+            </HistorySp>
+        </a-modal>
+        <!-- 审批-撤销申请弹窗 -->
+        <a-modal v-model:visible="visibleCx" centered :width="600" title="撤销申请" @ok="handleCxOk"
+            @cancel="handleCxCancel">
+            <a-textarea v-model:value="revokeDes" placeholder="请输入撤回原因..." :rows="4"
+                style="width:96%;margin:10px;background-color: transparent;color: #fff;" />
+        </a-modal>
+        <DeviceModal :editID="editID" :fileType="fileType" @register="registerDeviceModal" />
+        <CADModal @register="registerCADModal" />
     </div>
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, watch, nextTick, defineProps,onMounted } from 'vue'
+import { ref, reactive, watch, nextTick, defineProps, onMounted, provide, toRaw } from 'vue'
+import HistorySp from '../comment/HistorySp.vue'
+import DeviceModal from '../comment/DeviceModal.vue';
+import CADModal from '../comment/CADModal.vue';
 import { columns } from './approvalPend.data'
-import { getNowUserAgencyData } from '../fileDetail/fileDetail.api';
+import { getNowUserAgencyData, downLoad, listData, commit } from '../fileDetail/fileDetail.api';
+import { historicFlowNew, getHighlightImgNew, getTodoTask, getCancelNew } from '../comment/comment.api'
+import { message } from 'ant-design-vue';
+import { useModal } from '/@/components/Modal';
 
 let props = defineProps({
     selected: {
@@ -36,33 +74,209 @@ let pagination = reactive({
     showSizeChanger: true, // 是否可改变每页显示条数
     pageSizeOptions: ['10', '20', '50',], // 可选的每页显示条数
 })
-let selectedParam=reactive({})
+let selectedParam = reactive({})
+
+//审批详情弹窗数据
+let visibleSp = ref(false)
+let titleSp = ref('审批详情')
+//审批详情历史数据
+let historySpList = reactive<any[]>([])
+let imgSrc = ref('')
+//审批-是否显示撤回/驳回按钮
+let isShow = ref(true)
+//审批通过/驳回参数信息
+let spInfo = reactive({})
+//审批-撤销
+let visibleCx = ref(false)
+let revokeDes = ref('')
+let cxInfo = reactive({})
+const isUpdate = ref(false);
+const record = reactive<Record<string, any>>({});
+provide('formData', record);
+let fileType = ref(''); //文件类型
+let editID = ref(0); //文件ID
+//是否显示文件审批弹窗
+let visibleTj = ref(false)
+//文件审批-弹窗参数
+let formStateTj = reactive({
+    file: '',
+    id: '',
+})
+//文件审批-提交信息弹窗下拉选项数据
+let fileList = reactive<any[]>([])
+// CAD预览相关的逻辑
+let [registerCADModal, { openModal: openCADModal }] = useModal();
+let [registerDeviceModal, { openModal, closeModal }] = useModal();
 
 //获取待办列表数据
 async function getNowUserAgencyDataList() {
-    let res = await getNowUserAgencyData({ pageNo: pagination.current, pageSize: pagination.pageSize, tableName: 'vent.file_server_info', parentId:selectedParam.id || ''})
-    console.log(res,'待办列表--------')
-    dataSource.value=res.records
-    pagination.total=res.total
+    let res = await getNowUserAgencyData({ pageNo: pagination.current, pageSize: pagination.pageSize, tableName: 'vent.file_server_info', parentId: selectedParam.id || '' })
+    console.log(res, '待办列表--------')
+    dataSource.value = res.records
+    pagination.total = res.total
 }
 //分页切换
-function pageChange(val){
-    pagination.current=val.current
-    pagination.pageSize=val.pageSize
+function pageChange(val) {
+    pagination.current = val.current
+    pagination.pageSize = val.pageSize
+    getNowUserAgencyDataList()
+}
+
+// 审批提交
+async function handleTo(data) {
+    visibleTj.value = true
+    let res = await listData({ zx: true, column: 'createTime', order: 'desc', status: 1 })
+    if (res.length != 0) {
+        fileList.length = 0
+        res.forEach(el => {
+            fileList.push({ label: el.name, value: el.id })
+        })
+        formStateTj.id = data.id
+    }
+
+
+}
+//确认提交
+async function handleTjOk() {
+    if (formStateTj.file) {
+        let res = await commit({ procDefId: formStateTj.file, tableId: formStateTj.id, firstGateway: true })
+        if (res == '提交成功') {
+            message.success(res);
+            visibleTj.value = false
+            pagination.current = 1
+            getNowUserAgencyDataList()
+        } else {
+            message.warning(res.message);
+        }
+    } else {
+        message.warning('请先选择要提交的文件!');
+    }
+}
+//取消提交
+function handleTjCancel() {
+    formStateTj.file = ''
+    visibleTj.value = false
+}
+
+//审批通过/驳回弹窗关闭
+function spClose() {
+    visibleSp.value = false
+    pagination.current = 1
+    getNowUserAgencyDataList()
+}
+//审批详情点击
+function handleSpDetail(data) {
+    visibleSp.value = true
+    getTodoTaskShow({ tableId: data.id, tableName: data.tableName })
+    getHistoricFlowNewList({ tableId: data.id, tableName: data.tableName })
+    getHighlightImgNewList({ tableId: data.id, tableName: data.tableName })
+}
+//判断是否显示撤回/驳回按钮
+async function getTodoTaskShow(params) {
+    let res = await getTodoTask({ ...params })
+    spInfo = res
+    if (res.result) {
+        isShow.value = true
+    } else {
+        isShow.value = false
+    }
+}
+//审批详情-审批历史列表
+async function getHistoricFlowNewList(params) {
+    let res = await historicFlowNew({ ...params })
+    if (res.length != 0) {
+        historySpList.length = 0
+        res.forEach(el => {
+            historySpList.push({ name: el.name, username: el.assignees[0].username, deleteReason: el.deleteReason, comment: el.comment, startTime: el.startTime, endTime: el.endTime, status: el.status || '待处理' })
+        })
+    }
+}
+//审批详情-流程轨迹
+async function getHighlightImgNewList(params) {
+    let res = await getHighlightImgNew({ ...params })
+    let imageUrl = window.URL.createObjectURL(res);
+    imgSrc.value = imageUrl
+}
+//审批-撤回提交
+function handleSpRevoke(data) {
+    visibleCx.value = true
+    cxInfo = Object.assign({}, data)
+}
+//审批-撤销-确定
+async function handleCxOk() {
+    let res = await getCancelNew({ reason: revokeDes.value, tableId: cxInfo.id, tableName: cxInfo.tableName })
+    if (res == '操作成功') {
+        message.success(res);
+    } else {
+        message.warning(res.message);
+    }
+    visibleCx.value = false
+    revokeDes.value = ''
+    pagination.current = 1
     getNowUserAgencyDataList()
 }
-//查看
-function getViews(){
-    
+//审批-撤销-取消
+function handleCxCancel() {
+    revokeDes.value = ''
+    visibleCx.value = false
 }
-watch(()=>props.selected,(newV,oldV)=>{
-    console.log(newV,'newV---=======')
-    selectedParam=newV
+
+/**
+ * 编辑事件
+ */
+function handleEdit(data) {
+    isUpdate.value = true;
+    Object.assign(record, toRaw(data));
+    let index = record.fileSuffix.indexOf('.');
+    fileType.value = record.fileSuffix.substring(index + 1);
+    editID.value = record.id;
+    // 根据文件后缀名打开不同的模态框
+    if (['.dwg', '.mxcad'].includes(data.fileSuffix)) {
+        openCADModal(true, {
+            record,
+        });
+    } else {
+        openModal(true, {
+            record,
+        });
+    }
+}
+//下载文件
+function handleDownLoad(record) {
+    downLoad({ id: record.id }).then((res) => {
+        let filename = `${record.fileName}`;
+        downFilePublic(res, filename);
+    });
+}
+// 下载公用方法
+function downFilePublic(content, fileName) {
+    const blob = new Blob([content], { type: 'application/xlsx;charset=UTF-8' }); // 构造一个blob对象来处理数据
+    // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
+    // IE10以上支持blob但是依然不支持download
+    if ('download' in document.createElement('a')) {
+        // 支持a标签download的浏览器
+        const link = document.createElement('a'); // 创建a标签
+        link.download = fileName; // a标签添加属性
+        link.style.display = 'none';
+        link.href = URL.createObjectURL(blob);
+        document.body.appendChild(link);
+        link.click(); // 执行下载
+        URL.revokeObjectURL(link.href); // 释放url
+        document.body.removeChild(link); // 释放标签
+    } else {
+        // 其他浏览器
+        navigator.msSaveBlob(blob, fileName);
+    }
+}
+
+watch(() => props.selected, (newV, oldV) => {
+    console.log(newV, 'newV---=======')
+    selectedParam = newV
     getNowUserAgencyDataList()
-},{
-    deep:true
+}, {
+    deep: true
 })
-onMounted(()=>{
+onMounted(() => {
     getNowUserAgencyDataList()
 })
 
@@ -74,4 +288,8 @@ onMounted(()=>{
     width: 100%;
     height: 100%;
 }
+.zxm-form {
+  padding-top: 20px !important;
+  box-sizing: border-box;
+}
 </style>

+ 15 - 15
src/views/vent/performance/comment/HistorySp.vue

@@ -73,7 +73,11 @@ let pagination = reactive({
 })
 
 //审批通过驳回参数信息
-let spInfos = reactive({})
+let spInfos = reactive({
+    id: '',
+    priority: '',
+    procInstId: '',
+})
 //审批通过
 let visibleTg = ref(false)
 let passDes = ref('')
@@ -97,12 +101,9 @@ function getPass() {
 //审批通过-确认
 async function handleTgOk() {
     let res = await pass({ comment: passDes.value, id: spInfos.id, priority: spInfos.priority, procInstId: spInfos.procInstId, sendEmail: false, sendMessage: true, sendSms: false })
-    if (res.result) {
-        visibleTg.value = false
-        emit('spClose')
-    } else {
-        message.warning(res.message);
-    }
+    visibleTg.value = false
+    emit('spClose')
+    message.warning(res.message || res);
 }
 //审批通过-取消
 function handleTgCancel() {
@@ -116,12 +117,9 @@ function getReject() {
 //确定驳回
 async function handleBhOk() {
     let res = await back({ comment: rejectDes.value, id: spInfos.id, procInstId: spInfos.procInstId, sendEmail: false, sendMessage: true, sendSms: false })
-    if (res.result) {
-        visibleBh.value = false
-        emit('spClose')
-    } else {
-        message.warning(res.message);
-    }
+    visibleBh.value = false
+    emit('spClose')
+    message.warning(res.message || res);
 }
 //取消驳回
 function handleBhCancel() {
@@ -137,8 +135,10 @@ watch(() => props.historySpList, (newV, oldV) => {
     deep: true
 })
 watch(() => props.spInfo, (newV, oldV) => {
-    spInfos = Object.assign({}, newV)
-}, { immediate: true, deep: true })
+    spInfos.id = newV.id
+    spInfos.priority = newV.priority
+    spInfos.procInstId = newV.procInstId
+}, { deep: true })
 
 watch(() => props.imgSrc, (newV, oldV) => {
     imgSrcs.value = newV

+ 11 - 9
src/views/vent/performance/comment/NormalTable.vue

@@ -1,17 +1,19 @@
 <template>
   <div>
     <BasicTable @register="registerTable" :key="resetTable">
-      <template #action="{ record }">
-        <!-- <TableAction :actions="getActions(record)" :dropDownActions="getDropDownAction(record)" /> -->
+      <template #actionSp="{ record }">
         <a class="table-action-link" @click="handleTo(record)">提交</a>
         <a class="table-action-link" @click="handleSpDetail(record)">审批详情</a>
         <a class="table-action-link" @click="handleSpRevoke(record)">撤回</a>
+      </template>
+      <template #actionWj="{ record }">
         <a class="table-action-link" @click="handleEdit(record)">编辑</a>
         <a class="table-action-link" @click="handleDownLoad(record)">下载</a>
         <a-popconfirm title="确定删除?" @confirm="handleDelete(record)">
           <a class="table-action-link">删除</a>
         </a-popconfirm>
       </template>
+     
       <template #bodyCell="{ column, record }">
         <slot name="filterCell" v-bind="{ column, record }"></slot>
       </template>
@@ -181,9 +183,10 @@ const { tableContext, doRequest } = useListPage({
     // },
     striped: true,
     showIndexColumn: true, //是否显示序列号
-    actionColumn: {
-      width: 400,
-    },
+    // actionColumn: {
+    //   width: 200,
+    // },
+    showActionColumn:false,
     useSearchForm: false, //不使用查询条件
     // pagination: false, //不使用分页组件
     beforeFetch: (params) => {
@@ -237,10 +240,9 @@ function handleSpDetail(data) {
 }
 //审批详情-审批历史列表
 async function getHistoricFlowNewList(params) {
+  historySpList.length = 0
   let res = await historicFlowNew({ ...params })
-  console.log(res,'res99999999999999')
   if (res.length != 0) {
-    historySpList.length = 0
     res.forEach(el => {
       historySpList.push({ name: el.name, username: el.assignees[0].username, deleteReason: el.deleteReason, comment: el.comment, startTime: el.startTime, endTime: el.endTime, status: el.status || '待处理' })
     })
@@ -256,8 +258,8 @@ async function getHighlightImgNewList(params) {
 //判断是否显示撤回/驳回按钮
 async function getTodoTaskShow(params) {
   let res = await getTodoTask({ ...params })
-  spInfo = res.result
-  if (spInfo) {
+  spInfo = res
+  if (res.result) {
     isShow.value = true
   } else {
     isShow.value = false

+ 14 - 8
src/views/vent/performance/endEd/endEd.data.ts

@@ -48,12 +48,18 @@ export const  columns:BasicColumn[]=[
     align: 'center',
     ellipsis: true,
   },
- 
-  // {
-  //   title: '操作',
-  //   key: 'action',
-  //   width: 200,
-  //   slots: { customRender: 'action' },
-  //   align: 'center',
-  // },
+  {
+    title: '审批操作',
+    dataIndex: 'actionSp',
+    width: 200,
+    align: 'center',
+    slots: { customRender: 'actionSp' },
+  },
+  {
+    title: '文件操作',
+    dataIndex: 'actionWj',
+    width: 200,
+    align: 'center',
+    slots: { customRender: 'actionWj' },
+  },
 ]

+ 193 - 31
src/views/vent/performance/endEd/index.vue

@@ -2,20 +2,46 @@
     <div class="endEd">
         <a-table size="small" :dataSource="dataSource" :columns="columns" :scroll="{ y: 620 }" :pagination="pagination"
             @change="pageChange">
-
-            <template #action="{ record }">
-                <a-button type="link" style="color:#3DF6FF" @click="getViews">
-                    查看
-                </a-button>
+            <template #actionSp="{ record }">
+                <a class="table-action-link" @click="handleSpDetail(record)">审批详情</a>
+                <a class="table-action-link" @click="handleSpRevoke(record)">撤回</a>
+            </template>
+            <template #actionWj="{ record }">
+                <a class="table-action-link" @click="handleEdit(record)">编辑</a>
+                <a class="table-action-link" @click="handleDownLoad(record)">下载</a>
+                <!-- <a-popconfirm title="确定删除?" @confirm="handleDelete(record)">
+                    <a class="table-action-link">删除</a>
+                </a-popconfirm> -->
             </template>
         </a-table>
+
+        <!-- 审批详情弹窗 -->
+        <a-modal v-model:visible="visibleSp" width="1000px" :footer="null" :title="titleSp" centered destroyOnClose>
+            <HistorySp :historySpList="historySpList" :imgSrc="imgSrc" :isShow="isShow" :spInfo="spInfo"
+                @spClose="spClose">
+            </HistorySp>
+        </a-modal>
+        <!-- 审批-撤销申请弹窗 -->
+        <a-modal v-model:visible="visibleCx" centered :width="600" title="撤销申请" @ok="handleCxOk"
+            @cancel="handleCxCancel">
+            <a-textarea v-model:value="revokeDes" placeholder="请输入撤回原因..." :rows="4"
+                style="width:96%;margin:10px;background-color: transparent;color: #fff;" />
+        </a-modal>
+        <DeviceModal :editID="editID" :fileType="fileType" @register="registerDeviceModal" />
+        <CADModal @register="registerCADModal" />
     </div>
 </template>
 
 <script setup lang="ts">
-import {ref,reactive,watch,nextTick,defineProps,onMounted} from 'vue'
-import {columns} from './endEd.data'
-import { getNowUserApprovedData } from '../fileDetail/fileDetail.api';
+import { ref, reactive, watch, nextTick, defineProps, onMounted, provide, toRaw } from 'vue'
+import HistorySp from '../comment/HistorySp.vue'
+import DeviceModal from '../comment/DeviceModal.vue';
+import CADModal from '../comment/CADModal.vue';
+import { columns } from './endEd.data'
+import { getNowUserApprovedData, downLoad } from '../fileDetail/fileDetail.api';
+import { historicFlowNew, getHighlightImgNew, getTodoTask, getCancelNew } from '../comment/comment.api'
+import { message } from 'ant-design-vue';
+import { useModal } from '/@/components/Modal';
 
 let props = defineProps({
     selected: {
@@ -27,48 +53,184 @@ let props = defineProps({
 })
 
 //已结束列表数据
-let dataSource=ref<any[]>([])
+let dataSource = ref<any[]>([])
 //分页参数配置
 let pagination = reactive({
-  current: 1, // 当前页码
-  pageSize: 10, // 每页显示条数
-  total: 0, // 总条目数,后端返回
-  // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
-  showSizeChanger: true, // 是否可改变每页显示条数
-  pageSizeOptions: ['10', '20', '50',], // 可选的每页显示条数
+    current: 1, // 当前页码
+    pageSize: 10, // 每页显示条数
+    total: 0, // 总条目数,后端返回
+    // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
+    showSizeChanger: true, // 是否可改变每页显示条数
+    pageSizeOptions: ['10', '20', '50',], // 可选的每页显示条数
 })
-let selectedParam=reactive({})
+let selectedParam = reactive({})
+//审批详情弹窗数据
+let visibleSp = ref(false)
+let titleSp = ref('审批详情')
+//审批详情历史数据
+let historySpList = reactive<any[]>([])
+let imgSrc = ref('')
+//审批-是否显示撤回/驳回按钮
+let isShow = ref(true)
+//审批通过/驳回参数信息
+let spInfo = reactive({})
+//审批-撤销
+let visibleCx = ref(false)
+let revokeDes = ref('')
+let cxInfo = reactive({})
+const isUpdate = ref(false);
+const record = reactive<Record<string, any>>({});
+provide('formData', record);
+let fileType = ref(''); //文件类型
+let editID = ref(0); //文件ID
+// CAD预览相关的逻辑
+let [registerCADModal, { openModal: openCADModal }] = useModal();
+let [registerDeviceModal, { openModal, closeModal }] = useModal();
 
 //获取待办列表数据
 async function getNowUserApprovedDataList() {
-    let res = await getNowUserApprovedData({ pageNo: pagination.current, pageSize: pagination.pageSize, tableName: 'vent.file_server_info', parentId:selectedParam.id || ''})
-    console.log(res,'已办列表--------')
-    dataSource.value=res.records
-    pagination.total=res.total
+    let res = await getNowUserApprovedData({ pageNo: pagination.current, pageSize: pagination.pageSize, tableName: 'vent.file_server_info', parentId: selectedParam.id || '' })
+    console.log(res, '已办列表--------')
+    dataSource.value = res.records
+    pagination.total = res.total
 }
 //分页切换
-function pageChange(val){
-    pagination.current=val.current
-    pagination.pageSize=val.pageSize
+function pageChange(val) {
+    pagination.current = val.current
+    pagination.pageSize = val.pageSize
     getNowUserApprovedDataList()
 }
-//查看
-function getViews(){}
-watch(()=>props.selected,(newV,oldV)=>{
-    selectedParam=newV
+//审批通过/驳回弹窗关闭
+function spClose() {
+    visibleSp.value = false
+    pagination.current = 1
+    getNowUserApprovedDataList()
+}
+//审批详情点击
+function handleSpDetail(data) {
+    visibleSp.value = true
+    getTodoTaskShow({ tableId: data.id, tableName: data.tableName })
+    getHistoricFlowNewList({ tableId: data.id, tableName: data.tableName })
+    getHighlightImgNewList({ tableId: data.id, tableName: data.tableName })
+}
+//判断是否显示撤回/驳回按钮
+async function getTodoTaskShow(params) {
+    let res = await getTodoTask({ ...params })
+    spInfo = res
+    if (res.result) {
+        isShow.value = true
+    } else {
+        isShow.value = false
+    }
+}
+//审批详情-审批历史列表
+async function getHistoricFlowNewList(params) {
+    let res = await historicFlowNew({ ...params })
+    if (res.length != 0) {
+        historySpList.length = 0
+        res.forEach(el => {
+            historySpList.push({ name: el.name, username: el.assignees[0].username, deleteReason: el.deleteReason, comment: el.comment, startTime: el.startTime, endTime: el.endTime, status: el.status || '待处理' })
+        })
+    }
+}
+//审批详情-流程轨迹
+async function getHighlightImgNewList(params) {
+    let res = await getHighlightImgNew({ ...params })
+    let imageUrl = window.URL.createObjectURL(res);
+    imgSrc.value = imageUrl
+}
+//审批-撤回提交
+function handleSpRevoke(data) {
+    visibleCx.value = true
+    cxInfo = Object.assign({}, data)
+}
+//审批-撤销-确定
+async function handleCxOk() {
+    let res = await getCancelNew({ reason: revokeDes.value, tableId: cxInfo.id, tableName: cxInfo.tableName })
+    if (res == '操作成功') {
+        message.success(res);
+    } else {
+        message.warning(res.message);
+    }
+    visibleCx.value = false
+    revokeDes.value = ''
+    pagination.current = 1
     getNowUserApprovedDataList()
-},{
-    deep:true
+}
+//审批-撤销-取消
+function handleCxCancel() {
+    revokeDes.value = ''
+    visibleCx.value = false
+}
+
+/**
+ * 编辑事件
+ */
+function handleEdit(data) {
+    isUpdate.value = true;
+    Object.assign(record, toRaw(data));
+    let index = record.fileSuffix.indexOf('.');
+    fileType.value = record.fileSuffix.substring(index + 1);
+    editID.value = record.id;
+    // 根据文件后缀名打开不同的模态框
+    if (['.dwg', '.mxcad'].includes(data.fileSuffix)) {
+        openCADModal(true, {
+            record,
+        });
+    } else {
+        openModal(true, {
+            record,
+        });
+    }
+}
+//下载文件
+function handleDownLoad(record) {
+    downLoad({ id: record.id }).then((res) => {
+        let filename = `${record.fileName}`;
+        downFilePublic(res, filename);
+    });
+}
+// 下载公用方法
+function downFilePublic(content, fileName) {
+    const blob = new Blob([content], { type: 'application/xlsx;charset=UTF-8' }); // 构造一个blob对象来处理数据
+    // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
+    // IE10以上支持blob但是依然不支持download
+    if ('download' in document.createElement('a')) {
+        // 支持a标签download的浏览器
+        const link = document.createElement('a'); // 创建a标签
+        link.download = fileName; // a标签添加属性
+        link.style.display = 'none';
+        link.href = URL.createObjectURL(blob);
+        document.body.appendChild(link);
+        link.click(); // 执行下载
+        URL.revokeObjectURL(link.href); // 释放url
+        document.body.removeChild(link); // 释放标签
+    } else {
+        // 其他浏览器
+        navigator.msSaveBlob(blob, fileName);
+    }
+}
+
+
+watch(() => props.selected, (newV, oldV) => {
+    selectedParam = newV
+    getNowUserApprovedDataList()
+}, {
+    deep: true
 })
-onMounted(()=>{
+onMounted(() => {
     getNowUserApprovedDataList()
 })
 </script>
 
 <style lang="less" scoped>
-.endEd{
+.endEd {
     position: relative;
     width: 100%;
     height: 100%;
 }
+.zxm-form {
+  padding-top: 20px !important;
+  box-sizing: border-box;
+}
 </style>

+ 27 - 3
src/views/vent/performance/fileDetail/fileDetail.data.ts

@@ -5,25 +5,31 @@ export const columns: BasicColumn[] = [
     title: '文件ID',
     dataIndex: 'id',
     ifShow: false,
+    align:'center',
   },
   {
     title: '父文件夹ID',
     dataIndex: 'parentId',
     ifShow: false,
+    align:'center',
   },
   {
     title: '文件名称',
     dataIndex: 'fileName',
+    align:'center',
   },
 
   {
     title: '文件类型',
     dataIndex: 'fileType_dictText',
-    width: 110,
+    width:110,
+    align:'center',
   },
   {
     title: '文件来源',
     dataIndex: 'fileSource',
+    width:160,
+    align:'center',
   },
   // {
   //   title: '是否需要审批',
@@ -33,16 +39,34 @@ export const columns: BasicColumn[] = [
   {
     title: '上传时间',
     dataIndex: 'createTime',
+    width:180,
+    align:'center',
   },
   {
     title: '审批状态',
     dataIndex: 'bpmStatus_dictText',
-    width:110
+    width:110,
+    align:'center',
   },
   {
     title: '当前审批人',
     dataIndex: 'createBy',
-    width: 110,
+    width:110,
+    align:'center',
+  },
+  {
+    title: '审批操作',
+    dataIndex: 'actionSp',
+    width: 200,
+    align: 'center',
+    slots: { customRender: 'actionSp' },
+  },
+  {
+    title: '文件操作',
+    dataIndex: 'actionWj',
+    width: 200,
+    align: 'center',
+    slots: { customRender: 'actionWj' },
   },
  
 ];