Explorar o código

文件查阅重构

shenqilong hai 1 ano
pai
achega
f3fa36be50

+ 43 - 43
src/api/baseUrl.js

@@ -1,117 +1,117 @@
 import store from '@/store'
 import { BASE_API as baseApi,
-  BASE_GATEWAY_API as gatewayApi,
-  BASE_WEBSOCKET as baseWebsocket,
-  SINGLE, MULTIPLE_DOMAIN, API_DOMAIN_NAMES } from '@/constant'
+    BASE_GATEWAY_API as gatewayApi,
+    BASE_WEBSOCKET as baseWebsocket,
+    SINGLE, MULTIPLE_DOMAIN, API_DOMAIN_NAMES } from '@/constant'
 
 export const SINGLE_APP = () => {
-  if (!store || typeof (store.getters.single) === 'undefined') {
-    return SINGLE
-  }
-  return store.getters.single
+    if (!store || typeof (store.getters.single) === 'undefined') {
+        return SINGLE
+    }
+    return store.getters.single
 }
 
 const getApi = (api, i) => {
-  if (i === null || i === undefined) {
-    i = 0
-  }
-  const domainName = API_DOMAIN_NAMES[i] || API_DOMAIN_NAMES[0] || ''
+    if (i === null || i === undefined) {
+        i = 0
+    }
+    const domainName = API_DOMAIN_NAMES[i] || API_DOMAIN_NAMES[0] || ''
 
-  return api.replace('{DOMAIN}', domainName)
+    return api.replace('{DOMAIN}', domainName)
 }
 
 // 默认url
-export const BASE_API = function(i) {
-  const api = store && store.getters.baseApi ? store.getters.baseApi : baseApi
-  return MULTIPLE_DOMAIN ? getApi(api, i) : api
+export const BASE_API = function (i) {
+    const api = store && store.getters.baseApi ? store.getters.baseApi : baseApi
+    return MULTIPLE_DOMAIN ? getApi(api, i) : api
 }
 // 网关API 解决上传乱码问题
-export const BASE_GATEWAY_API = function(i) {
-  const api = store && store.getters.baseApi ? store.getters.baseApi : gatewayApi
-  return MULTIPLE_DOMAIN ? getApi(api, i) : api
+export const BASE_GATEWAY_API = function (i) {
+    const api = store && store.getters.baseApi ? store.getters.baseApi : gatewayApi
+    return MULTIPLE_DOMAIN ? getApi(api, i) : api
 }
 // websocket地址
 export const BASE_WEBSOCKET_API = (i) => {
-  const api = store && store.getters.websocket ? store.getters.websocket : baseWebsocket
-  return MULTIPLE_DOMAIN ? getApi(api, i) : api
+    const api = store && store.getters.websocket ? store.getters.websocket : baseWebsocket
+    return MULTIPLE_DOMAIN ? getApi(api, i) : api
 }
 export const OAUTH2_BASE_URL = () => {
-  return SINGLE_APP() ? '' : '/oauth2/v3'
+    return SINGLE_APP() ? '' : '/oauth2/v3'
 }
 export const PLATFORM_BASE_URL = () => {
-  return SINGLE_APP() ? '' : '/platform/v3'
+    return SINGLE_APP() ? '' : '/platform/v3'
 }
 
 export const BUSINESS_BASE_URL = () => {
-  return SINGLE_APP() ? '' : '/business/v3'
+    return SINGLE_APP() ? '' : '/business/v3'
 }
 
 // ========== business=================
 
 export const OAUTH2_URL = () => {
-  return OAUTH2_BASE_URL()
+    return OAUTH2_BASE_URL()
 }
 // ========== business=================
 export const FORM_URL = () => {
-  return BUSINESS_BASE_URL()
+    return BUSINESS_BASE_URL()
 }
 
 export const BPMN_URL = () => {
-  return BUSINESS_BASE_URL()
+    return BUSINESS_BASE_URL()
 }
 export const DATA_URL = () => {
-  return BUSINESS_BASE_URL()
+    return BUSINESS_BASE_URL()
 }
 export const CODEGEN_URL = () => {
-  return BUSINESS_BASE_URL()
+    return BUSINESS_BASE_URL()
 }
 
 // ========== PLATFORM_BASE_URL=================
 export const PLATFORM_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const ORG_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const AUTH_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const SAAS_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const CAT_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const JOB_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const SYSTEM_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const LOG_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const MSG_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const MAIL_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const OFFICE_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const SERV_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 
 export const DS_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 export const INFO_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 
 export const SOCKET_URL = () => {
-  return PLATFORM_BASE_URL()
+    return PLATFORM_BASE_URL()
 }
 

+ 23 - 12
src/business/platform/file/attachment/editFile/editor.vue

@@ -1,14 +1,13 @@
 <!--onlyoffice 编辑器-->
 <template>
-    <div>
-        <div id="editorDiv" ref="editor" class="nav" />
-    </div>
+    <div id="editorDiv" ref="editor" class="nav" />
 </template>
 
 <script>
 import { handleDocType } from './editor/editor.js'
 import { showView } from '@/api/platform/file/attachment'
 import { getToken } from '@/utils/auth'
+
 export default {
     name: 'editor',
     props: {
@@ -17,7 +16,12 @@ export default {
             default: () => {
                 return {}
             }
+        },
+        operation_status: {
+            type: String,
+            default: ''
         }
+
     },
     data () {
         return {
@@ -25,6 +29,7 @@ export default {
             newId: '',
             timer: '',
             configKey: ''
+
         }
     },
     watch: {
@@ -77,14 +82,15 @@ export default {
                     key: option.key,
                     title: option.title,
                     permissions: {
-                        comment: true,
-                        download: true,
-                        modifyContentControl: true,
-                        modifyFilter: true,
-                        print: true,
-                        edit: true,
-                        fillForms: true,
-                        review: true
+                        comment: this.operation_status !== 'fileTraining',
+                        download: this.operation_status !== 'fileTraining',
+                        modifyContentControl: this.operation_status !== 'fileTraining',
+                        modifyFilter: this.operation_status !== 'fileTraining',
+                        print: this.operation_status !== 'fileTraining',
+                        edit: this.operation_status !== 'fileTraining',
+                        fillForms: this.operation_status !== 'fileTraining',
+                        review: this.operation_status !== 'fileTraining',
+                        copy: this.copy
                     },
                     url: option.url
                 },
@@ -128,11 +134,13 @@ export default {
                     // },
                     onDocumentReady: () => {
                         console.log('文件加载完成~')
+                        this.hadLoadedFile(0)
                     }
                 },
                 width: '100%',
                 token: getToken(),
-                height: document.body.clientHeight + 'px'
+                // 减去弹窗的顶部标题区域
+                height: document.body.clientHeight - 63 + 'px'
             }
             const docEditor = new DocsAPI.DocEditor('editorDiv', config)
             this.configKey = config.document.key
@@ -153,6 +161,9 @@ export default {
                     })
                 }
             }, 2000)
+        },
+        hadLoadedFile (v) {
+            this.$emit('hadLoadedFile', v)
         }
     }
 }

+ 65 - 41
src/business/platform/file/attachment/editFile/fView.vue

@@ -1,55 +1,79 @@
+<!--
+ * @Descripttion: 表单/数据模板脚本:
+ * @version: 1.0
+ * @Author: Liu_jiaYin
+ * @Date: 2023-11-17 16:40:46
+ * @LastEditors: Do not edit
+ * @LastEditTime: 2024-03-07 08:51:52
+-->
 <template>
     <div>
-        <editor :option="option" @updateFile="updateFile" />
+        <editor ref="editor" :option="option" :operation_status="operation_status" :copy="copy" @updateFile="updateFile" @hadLoadedFile="hadLoadedFile" />
     </div>
 </template>
 
 <script>
-    import editor from './editor'
-    export default {
-        name: 'fView',
-        components: { editor },
-        props: {
-            optionFile: {
-                type: Object,
-                default: () => {
-                    return {}
-                }
+import editor from './editor'
+export default {
+    name: 'f-view',
+    components: { editor },
+    props: {
+        optionFile: {
+            type: Object,
+            default: () => {
+                return {}
             }
         },
-        data() {
-            return {
-                option: {
-                    url: '',
-                    isEdit: true,
-                    fileType: '',
-                    title: '',
-                    user: {
-                        id: '',
-                        name: ''
-                    },
-                    mode: 'edit',
-                    editUrl: '',
-                    key: ''
-                }
+        // eslint-disable-next-line vue/prop-name-casing
+        operation_status: {
+            type: String,
+            default: ''
+        },
+        copy: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data () {
+        return {
+            option: {
+                url: '',
+                isEdit: true,
+                fileType: '',
+                title: '',
+                user: {
+                    id: '',
+                    name: ''
+                },
+                mode: 'edit',
+                editUrl: '',
+                key: ''
             }
+        }
+    },
+    // 创建定时任务,开始查询是否有对应key
+    created () {
+        this.option.user.id = this.$store.getters.userId
+        this.option.user.name = this.$store.getters.name
+        this.getFile()
+    },
+    methods: {
+        updateFile (data) {
+            this.$emit('updateFile', data)
         },
-        // 创建定时任务,开始查询是否有对应key
-        created() {
-            this.option.user.id = this.$store.getters.userId
-            this.option.user.name = this.$store.getters.name
-            this.getFile()
+        getFile () {
+            this.option.url = this.optionFile.url // 下载地址
+            this.option.editUrl = this.optionFile.editUrl // 回调接口url
+            this.option.title = this.optionFile.title // 文件名称
+            this.option.fileType = this.optionFile.fileType // 类型
         },
-        methods: {
-            updateFile(data) {
-                this.$emit('updateFile', data)
-            },
-            getFile() {
-                this.option.url = this.optionFile.url // 下载地址
-                this.option.editUrl = this.optionFile.editUrl // 回调接口url
-                this.option.title = this.optionFile.title // 文件名称
-                this.option.fileType = this.optionFile.fileType // 类型
-            }
+        hadLoadedFile (v) {
+            this.$emit('hadLoadedFile', v)
+        },
+        destoryZiComponent () {
+            const editor = this.$refs.editor
+            editor.clearTimer()
         }
     }
+}
 </script>

+ 36 - 36
src/constant.js

@@ -2,16 +2,16 @@
  * 常量配置
  *
  */
-import env from "@/env";
+import env from '@/env'
 /**
  * 读取静态配置
  * @private
  */
-const __IBPS_CONFIG__ = window.__IBPS_CONFIG__ || {};
+const __IBPS_CONFIG__ = window.__IBPS_CONFIG__ || {}
 
-export default __IBPS_CONFIG__;
+export default __IBPS_CONFIG__
 
-const enableConfig = __IBPS_CONFIG__.ENABLE_CONFIG || false;
+const enableConfig = __IBPS_CONFIG__.ENABLE_CONFIG || false
 
 /**
  * 接口服务器
@@ -19,66 +19,66 @@ const enableConfig = __IBPS_CONFIG__.ENABLE_CONFIG || false;
  */
 export const BASE_URL = enableConfig
     ? __IBPS_CONFIG__.BASE_URL || env.VUE_APP_BASE_URL
-    : env.VUE_APP_BASE_URL;
+    : env.VUE_APP_BASE_URL
 export const PUBLIC_URL = enableConfig
     ? __IBPS_CONFIG__.PUBLIC_URL || env.VUE_APP_BASE_URL
-    : env.VUE_APP_BASE_URL;
+    : env.VUE_APP_BASE_URL
 export const INTRANET_URL = enableConfig
     ? __IBPS_CONFIG__.INTRANET_URL || env.VUE_APP_BASE_URL
-    : env.VUE_APP_BASE_URL;
+    : env.VUE_APP_BASE_URL
 export const BASE_API = enableConfig
     ? __IBPS_CONFIG__.BASE_API || env.VUE_APP_BASE_API
-    : env.VUE_APP_BASE_API;
+    : env.VUE_APP_BASE_API
 export const BASE_GATEWAY_API = enableConfig
     ? __IBPS_CONFIG__.BASE_GATEWAY_API || env.VUE_APP_BASE_GATEWAY_API
-    : env.VUE_APP_BASE_GATEWAY_API;
+    : env.VUE_APP_BASE_GATEWAY_API
 export const BASE_WEBSOCKET = enableConfig
     ? __IBPS_CONFIG__.BASE_WEBSOCKET || env.VUE_APP_BASE_WEBSOCKET
-    : env.VUE_APP_BASE_WEBSOCKET;
+    : env.VUE_APP_BASE_WEBSOCKET
 export const BASE_REPORT_API = enableConfig
     ? __IBPS_CONFIG__.BASE_REPORT_API || env.VUE_APP_BASE_REPORT_API
-    : env.VUE_APP_BASE_REPORT_API;
-export const BASE_SEAL_API = __IBPS_CONFIG__.BASE_SEAL_API || "";
+    : env.VUE_APP_BASE_REPORT_API
+export const BASE_SEAL_API = __IBPS_CONFIG__.BASE_SEAL_API || ''
 
-export const SINGLE = __IBPS_CONFIG__.SINGLE || false;
-export const API_DOMAIN_NAMES = __IBPS_CONFIG__.API_DOMAIN_NAMES || [];
-export const MULTIPLE_DOMAIN = __IBPS_CONFIG__.MULTIPLE_DOMAIN || false;
+export const SINGLE = __IBPS_CONFIG__.SINGLE || false
+export const API_DOMAIN_NAMES = __IBPS_CONFIG__.API_DOMAIN_NAMES || []
+export const MULTIPLE_DOMAIN = __IBPS_CONFIG__.MULTIPLE_DOMAIN || false
 
 // ================认证中心=====================
 
-export const GRANT_TYPE = __IBPS_CONFIG__.GRANT_TYPE || "";
-export const CLIENT_ID = __IBPS_CONFIG__.CLIENT_ID || "";
-export const CLIENT_SECRET = __IBPS_CONFIG__.CLIENT_SECRET || "";
+export const GRANT_TYPE = __IBPS_CONFIG__.GRANT_TYPE || ''
+export const CLIENT_ID = __IBPS_CONFIG__.CLIENT_ID || ''
+export const CLIENT_SECRET = __IBPS_CONFIG__.CLIENT_SECRET || ''
 
 // ================请求头=====================
 export const HEADER_TOKEN_KEY =
-    __IBPS_CONFIG__.HEADER_TOKEN_KEY || "X-Authorization-access_token";
-export const FORM_TOKEN_KEY = __IBPS_CONFIG__.TOKEN_KEY || "access_token";
+    __IBPS_CONFIG__.HEADER_TOKEN_KEY || 'X-Authorization-access_token'
+export const FORM_TOKEN_KEY = __IBPS_CONFIG__.TOKEN_KEY || 'access_token'
 export const HEADER_SYSTEM_ID =
-    __IBPS_CONFIG__.HEADER_SYSTEM_ID || "X-Authorization-systemid";
+    __IBPS_CONFIG__.HEADER_SYSTEM_ID || 'X-Authorization-systemid'
 export const HEADER_TENANT_ID =
-    __IBPS_CONFIG__.HEADER_TENANT_ID || "X-Authorization-tenantid";
-export const TENANT_ID = __IBPS_CONFIG__.TENANT_ID || "tenant_id";
+    __IBPS_CONFIG__.HEADER_TENANT_ID || 'X-Authorization-tenantid'
+export const TENANT_ID = __IBPS_CONFIG__.TENANT_ID || 'tenant_id'
 
 // ================Cookies 存储=====================
-export const UUID_KEY = __IBPS_CONFIG__.UUID_KEY || "uuid";
-export const LANG_KEY = __IBPS_CONFIG__.LANG_KEY || "lang";
+export const UUID_KEY = __IBPS_CONFIG__.UUID_KEY || 'uuid'
+export const LANG_KEY = __IBPS_CONFIG__.LANG_KEY || 'lang'
 
-export const TOKEN_STORE = __IBPS_CONFIG__.TOKEN_STORE || "default";
-export const TOKEN_DOMAIN = __IBPS_CONFIG__.TOKEN_DOMAIN || "bpmhome.cn";
+export const TOKEN_STORE = __IBPS_CONFIG__.TOKEN_STORE || 'default'
+export const TOKEN_DOMAIN = __IBPS_CONFIG__.TOKEN_DOMAIN || 'bpmhome.cn'
 export const TOKEN_STORE_PREFIX =
-    __IBPS_CONFIG__.TOKEN_STORE_PREFIX || "default";
-export const TOKEN_STORE_KEY = __IBPS_CONFIG__.TOKEN_STORE_KEY || "token";
+    __IBPS_CONFIG__.TOKEN_STORE_PREFIX || 'default'
+export const TOKEN_STORE_KEY = __IBPS_CONFIG__.TOKEN_STORE_KEY || 'token'
 export const REFRESH_TOKEN_STORE_KEY =
-    __IBPS_CONFIG__.REFRESH_TOKEN_STORE_KEY || "refresh_token";
+    __IBPS_CONFIG__.REFRESH_TOKEN_STORE_KEY || 'refresh_token'
 
-export const TRANSFER_DATA = __IBPS_CONFIG__.TRANSFER_DATA || "transfer";
+export const TRANSFER_DATA = __IBPS_CONFIG__.TRANSFER_DATA || 'transfer'
 
-export const I18N_LOCALE = __IBPS_CONFIG__.I18N_LOCALE || "zh-CN";
+export const I18N_LOCALE = __IBPS_CONFIG__.I18N_LOCALE || 'zh-CN'
 export const I18N_FALLBACK_LOCALE =
-    __IBPS_CONFIG__.I18N_FALLBACK_LOCALE || "zh-CN";
+    __IBPS_CONFIG__.I18N_FALLBACK_LOCALE || 'zh-CN'
 
-export const ELEMENT_COLOR = __IBPS_CONFIG__.ELEMENT_COLOR || "#409EFF";
+export const ELEMENT_COLOR = __IBPS_CONFIG__.ELEMENT_COLOR || '#409EFF'
 export const SYSTEM_NAME =
-    __IBPS_CONFIG__.SYSTEM_NAME || "17025实验室质量管理系统";
-export const REPORT_PATH = __IBPS_CONFIG__.REPORT_PATH || "";
+    __IBPS_CONFIG__.SYSTEM_NAME || '17025实验室质量管理系统'
+export const REPORT_PATH = __IBPS_CONFIG__.REPORT_PATH || ''

+ 4 - 1
src/plugins/ibps/index.js

@@ -38,8 +38,9 @@ import pluginLog from '@/plugins/log'
 import pluginOpen from '@/plugins/open'
 // 平台配置文件
 import setting from '@/setting.js'
-import { BASE_URL, BASE_SEAL_API, REPORT_PATH } from '@/constant'
+import { BASE_URL, BASE_SEAL_API, REPORT_PATH, INTRANET_URL } from '@/constant'
 import env from '@/env'
+import { BASE_API, SYSTEM_URL } from '@/api/baseUrl'
 
 export default {
     async install (Vue, options) {
@@ -50,6 +51,8 @@ export default {
         Vue.prototype.$nodeEnv = env.NODE_ENV
         // 当前环境变量
         Vue.prototype.$env = env
+        // onlyofficeUrl,开发环境使用当前环境api,生产环境固定使用INTRANET_URL
+        Vue.prototype.$onlyofficeApi = env.NODE_ENV === 'development' ? BASE_API() : `${INTRANET_URL}ibps` + SYSTEM_URL()
 
         // 当前的 baseUrl   简化代码中 env.VUE_APP_PUBLIC_PATH 取值
         Vue.prototype.$baseUrl = env.VUE_APP_PUBLIC_PATH || '/'

+ 27 - 65
src/views/component/fileTraining/index.vue

@@ -7,19 +7,6 @@
  * @LastEditTime: 2024-04-26 16:04:02
 -->
 <template>
-    <!-- <el-dialog
-        :visible.sync="dialogVisible"
-        fullscreen
-        :title="title"
-        append-to-body
-        custom-class="ibps-file-preview-dialog"
-    >
-        <div>
-            <fView v-if="refresh" ref="fvView" :option-file="optionFile" :operation_status="operation_status" @hadLoadedFile="hadLoadedFile" />
-        </div>
-    </el-dialog> -->
-
-    <!--个人修改  -->
     <el-dialog
         :visible.sync="dialogVisible"
         fullscreen
@@ -55,7 +42,7 @@
                             >确定</el-button>
                         </div>
                         <el-button
-                            v-if="deleteShow"
+
                             slot="reference"
                             type="danger"
                             icon="el-icon-delete"
@@ -74,7 +61,7 @@
                         @click="hideLeft"
                     >{{ leftContent }}</el-button>
                     <el-button
-                        v-if="updateShow"
+
                         type="primary"
                         icon="el-icon-download"
                         @click="updateFile"
@@ -95,7 +82,7 @@
                         <el-timeline-item
                             v-for="(activity, index) in leftData"
                             :key="index"
-                            :timestamp="'发布日期:' + activity.fa_bu_shi_jian_"
+                            :timestamp="'发布日期:' + activity.fa_fang_ri_qi_"
                             :type="index === activeIndex ? type : ''"
                             @click.stop.native="toggleActive(activity, index)"
                         >
@@ -164,7 +151,6 @@
                     ref="fvView"
                     :option-file="optionFile"
                     :operation_status="operation_status"
-                    :copy="updateShow"
                     @hadLoadedFile="hadLoadedFile"
                 /></el-col>
             </el-row>
@@ -195,7 +181,6 @@
  * 3、压缩包支持
  */
 import fView from '@/business/platform/file/attachment/editFile/fView.vue'
-import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
 import ViewFile from '@/views/viewFile/index.vue'
 import Template from '@/business/platform/form/form-print/template.vue'
 import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
@@ -217,29 +202,24 @@ export default {
             type: Boolean,
             default: false
         },
-        // fileInfos: {
-        //     type: Object,
-        //     default: () => {}
-        // },
+
         fileInfos: {
             type: Array,
             default: () => {}
         }
-        // template: {
-        //     type: Object,
-        //     default: () => {}
-        // }
+
     },
     data () {
-        const { userList, userId, role, isSuper } = this.$store.getters
+        const { userList, userId, positionList, isSuper } = this.$store.getters
+        const role = positionList
         // const userId = this.$store.getters.userInfo.employee.id// 本人修改
 
         return {
             activeName: 1,
-            updateShow: false,
+
             type: 'success',
             curFileName: '',
-            curZid: '',
+            curid: '',
             timeId: '',
             dialogVisible: false,
             operation_status: 'fileTraining',
@@ -273,11 +253,9 @@ export default {
             role: role,
             isSuper: isSuper,
             deleteVisible: false,
-            deleteShow: false,
             leftContent: '隐藏修订历史'
         }
     },
-    // 本人修改
     computed: {
         computedSpan () {
             return this.leftShow ? 20 : 24
@@ -306,7 +284,7 @@ export default {
                 this.leftContent = '显示修订历史'
             }
         },
-        // 本人修改
+
         fileInfos: {
             handler (newVal) {
                 this.leftData = newVal
@@ -323,11 +301,8 @@ export default {
                 temp.forEach((val) => {
                     this.fileShow(temp[0])
                 })
-                // newVal.forEach(val => {
-                //     this.fileShow(val)
-                // })
             },
-            deep: true, // 深度监听,确保对象属性变化也能触发(本人修改)
+            deep: true,
             immediate: true
         },
 
@@ -365,14 +340,6 @@ export default {
         // 页面切换时改变计时状态
         document.addEventListener('visibilitychange', this.handlePageChange)
         this.checkDialogBody()
-        const roleKey = ['xtgljs']
-        const curRole = this.role.map((i) => i.alias)
-        const isPower = curRole.some((item) => roleKey.includes(item))
-        this.deleteShow = !!(isPower || this.isPower)
-        const hasRole = localStorage.getItem('hasHighRole') === '1'
-        if (this.isSuper || hasRole) {
-            this.updateShow = true
-        }
     },
     methods: {
         getUserName (data) {
@@ -425,8 +392,8 @@ export default {
         },
         hadLoadedFile (v) {
             // 计时开始,添加查看记录
-            if (!this.curZid) {
-                this.handleAdd(this.leftData[0]?.zId, 0)
+            if (!this.curid) {
+                this.handleAdd(this.leftData[0]?.id, 0)
             }
             this.setBrowseTime()
             this.hadLoad = true
@@ -464,10 +431,9 @@ export default {
                 this.clearTimeSet = null
             }
         },
-        // 本人修改
-        // id转换
+
         async idChange (id) {
-            const sql = `select id_ FROM t_wjylb WHERE id_ = '${id}'`
+            const sql = `select id_ FROM t_wjylb WHERE  wen_jian_zhu_jian= '${id}'`
             return new Promise((resolve, reject) => {
                 this.$common
                     .request('sql', sql)
@@ -489,11 +455,11 @@ export default {
             // 切换文件修订历史时,保存上一个文件查看记录,新增当前文件查看记录
             if (this.browseTime && this.browseTime > 0 && this.timeId) {
                 this.handleUpdate()
-                this.handleAdd(this.curZid || this.leftData[0]?.zId, 0)
+                this.handleAdd(this.curid || this.leftData[0]?.id, 0)
             }
             this.activeIndex = index
             this.digData = activity
-            this.curZid = activity.zid
+            this.curid = activity.id
             this.fileShow(activity)
             if (this.browseTime >= 30) {
                 this.upFunc(this.tmpId, this.browseTime)
@@ -506,17 +472,14 @@ export default {
             // this.$forceUpdate()// 触发监听器
         },
         // 阅读量函数
-        // async checkNum (activity) {
-        //     const sql = `select t_wjcyjl.* from t_wjcyjl
-        //         INNER JOIN t_wjylb ON t_wjcyjl.parent_id_ = t_wjylb.id_
-        //         WHERE t_wjxxb.shu_ju_lai_yuan_ = '${activity.id}' order by create_time_ desc`
-        //     // const sql1 = `select * from t_wjcyjl where parent_id_= '${activity.id}' order by create_time_ desc`
-        //     await this.$common.request('sql', sql).then((res) => {
-        //         const { data = [] } = res.variables || {}
-        //         this.lookNum = data.length
-        //         this.showList = data
-        //     })
-        // },
+        async checkNum (activity) {
+            const sql = `select * from t_wjcyjl  WHERE t_wjcyjl.parent_id_ = '${activity.id}' order by create_time_ desc`
+            await this.$common.request('sql', sql).then((res) => {
+                const { data = [] } = res.variables || {}
+                this.lookNum = data.length
+                this.showList = data
+            })
+        },
         handleAdd (fileId, time) {
             const addParams = {
                 tableName: 't_wjcyjl',
@@ -544,8 +507,7 @@ export default {
                             id_: this.timeId
                         },
                         param: {
-                            // shi_chang_: this.browseTime
-                            shi_chang_: 20
+                            shi_chang_: this.browseTime
                         }
                     }
                 ]
@@ -609,7 +571,7 @@ export default {
             if (this.isSuper || isPower) {
                 const deleteParams = {
                     tableName: 't_wjxxb',
-                    paramWhere: { id_: this.leftData[0].zId }
+                    paramWhere: { id_: this.leftData[0].id }
                 }
                 curdPost('delete', deleteParams).then(() => {
                     this.$message({

+ 49 - 443
src/views/infosManage/fileIE.vue

@@ -81,64 +81,12 @@
                                 >{{ scope.row.file_info_ }}</el-tag>
                             </div>
                         </template>
-                        <template
-                            v-if="showCaoZuoColumn"
-                            slot="caozuo"
-                            slot-scope="scope"
-                        >
-                            <div
-                                style="color: #1e90ff"
-                                class="hover-hand"
-                                @click="updateDate(scope)"
-                            >
-                                <i
-                                    class="el-icon-edit-outline"
-                                    style="cursor: pointer"
-                                />
-                                <span style="cursor: pointer"> 更新</span>
-                            </div>
-                        </template>
-                        <template
-                            slot="customButton"
-                            slot-scope="{row}"
-                        >
-                            <el-button type="text" icon="el-icon-edit-outline" @click="goEdit(row)">修改</el-button>
-                        </template>
+
                     </ibps-crud>
                 </template>
             </ibps-container>
-            <bpmn-formrender
-                :visible="dialogFormVisible"
-                :template-key="templateKey"
-                :def-id="defId"
-                :pk-value="pkValue"
-                :form-key="formKey"
-                :add-data-cont="addDataCont"
-                @close="closeHandle"
-            />
 
-            <el-dialog
-                :close-on-click-modal="false"
-                :close-on-press-escape="false"
-                :top="'3vh'"
-                :width="'90%'"
-                class="js-custom-dialog"
-                append-to-body
-                :fullscreen="false"
-                :visible.sync="visible"
-            >
-                <iframe
-                    :src="srcUrl"
-                    :height="'100%'"
-                    :width="'100%'"
-                    frameborder="0"
-                    scrolling="no"
-                />
-            </el-dialog>
-            <!-- <file-lookup
-                :visible="dialogVisible"
-                :file-infos="fileInfos"
-            /> -->
+            <!-- 查看修订历史 -->
             <file-lookup
                 v-if="dialogVisible"
                 :visible="dialogVisible"
@@ -146,21 +94,7 @@
                 @colseVisible="colseVisible"
             />
         </div>
-        <UpdateFile
-            v-if="dialogFormVisibles"
-            :visidial="dialogFormVisibles"
-            :son-data="sonData"
-            @getcolse="getcolse"
-        />
-        <data-template-formrender-dialog
-            :visible="editDialogVisible"
-            form-key="ywyxjlb"
-            :pk-value="editPkValue"
-            :toolbars="editToolbars"
-            :readonly="false"
-            :add-data-cont="addDataCont"
-            @close="editClose"
-        />
+
     </div>
 </template>
 <script>
@@ -189,16 +123,8 @@ export default {
     },
     mixins: [FixHeight],
     data () {
-        const { isSuper, deptList = [], role } = this.$store.getters || {}
-        const hasRole = localStorage.getItem('hasHighRole') === '1'
-        const depArrs = deptList.map(
-            (i) => `wj.bian_zhi_bu_men_ like '${i.positionId}'`
-        )
         return {
-            role,
-            isSuper,
-            hasRole,
-            depArrs,
+
             dialogFormVisibles: false,
             fileLookShow: false,
             sonData: '',
@@ -217,7 +143,7 @@ export default {
             pkValue: '',
             templateKey: 'ywyxjlsc',
             visible: false,
-            categoryKey: '',
+            categoryKey: 'FILE_TYPE',
             tableTitle: '',
             listData: [],
             selectListData: [],
@@ -241,10 +167,7 @@ export default {
                 // 表格字段配置
                 columns: []
             },
-            //   listOptions: {
-            //     border: true,
-            //     stripe: true
-            //   },
+
             pagination: {
                 limit: 20,
                 page: 1
@@ -293,118 +216,21 @@ export default {
         }
     },
     created () {
-        this.pageKey = this.$route.name
-        this.categoryKey = this.pageKey === 'skwjcy' ? 'FILE_TYPE' : 'FLOW_TYPE'
-        this.userId = this.$store.getters.userInfo.employee.id
-        const roleList = this.$store.getters.userInfo.role
-        // 系统管理角色添加删除按钮
-        const hasRole = roleList.some((item) => item.name === '系统管理角色')
-        if (this.pageKey === 'wjkzgl-ywyxjlsc' || this.pageKey === 'ywtxyxjl') {
-            // 系统管理角色不做分类过滤
-            this.listConfig.toolbars.push({ key: 'remove' })
-            this.selection = true
-        }
-        if (this.pageKey === 'skwjcy') {
-            this.listConfig.searchForm.forms = [
-                { prop: 'wen_jian_bian_hao', label: '文件编号' },
-                { prop: 'wen_jian_ming_che', label: '文件名称' }
-            ]
-            this.listConfig.columns = [
-                // { prop: 'wen_jian_xi_lei_', label: '文件细类', sortable: 'custom', minWidth: 100 },
-                {
-                    prop: 'wen_jian_bian_hao',
-                    label: '文件编号',
-                    sortable: 'custom',
-                    width: 150
-                },
-                { prop: 'wen_jian_ming_che', label: '文件名称', minWidth: 150 },
-                { prop: 'ban_ben_hao_', label: '版本', width: 65 },
-                {
-                    prop: 'file_info_',
-                    label: '查阅',
-                    slotName: 'wenjinachayue',
-                    minWidth: 150
-                },
-                {
-                    prop: 'fa_bu_xiu_ding_zu',
-                    label: '发布日期',
-                    sortable: 'custom',
-                    width: 150
-                },
-                {
-                    prop: 'cha_yue_jie_zhi_s',
-                    label: '查阅截止时间',
-                    sortable: 'custom',
-                    minWidth: 120
-                }
-            ]
-        }
-        if (this.pageKey === 'wjkzgl-ywyxjlsc' || this.pageKey === 'ywtxyxjl') {
-            this.listConfig.searchForm.forms = [
-                {
-                    prop: 'nian_du_',
-                    label: '记录月份',
-                    fieldType: 'date',
-                    dateType: 'year',
-                    width: 50
-                },
-                {
-                    prop: 'bian_zhi_shi_jian',
-                    label: '上传时间',
-                    fieldType: 'daterange',
-                    width: 200
-                },
-                { prop: 'org_name', label: '部门', fieldType: 'slot', slotName: 'position' },
-                { prop: 'biao_dan_ming_che', label: '表单名称', width: 150 },
-                { prop: 'shi_wu_shuo_ming_', label: '事务说明', width: 150 }
-            ]
-            this.listConfig.columns = [
-                // { prop: 'fen_lei_', label: '表单分类', width: 120 },
-                {
-                    prop: 'nian_du_',
-                    label: '记录年份',
-                    dateFormat: 'yyyy-MM',
-                    width: 100
-                },
-                { prop: 'org_name', label: '部门', width: 100 },
-                { prop: 'biao_dan_ming_che', label: '表单名称', width: 250 },
-                { prop: 'shi_wu_shuo_ming_', label: '事务说明', width: 250 },
-                {
-                    prop: 'fu_jian_',
-                    label: '附件',
-                    slotName: 'file',
-                    minWidth: 250
-                },
-                { prop: 'bian_zhi_shi_jian', label: '上传时间', width: 140 },
-                { prop: 'ry_name', label: '上传人', width: 90 }
-            ]
-            const roleList = ['xtgljs', 'wjglzzc', 'wjgly'] // 系统管理员 文件管理组组长 文件管理员可修改
-            const hasRole = this.role.some(r => roleList.includes(r.alias))
-            if (hasRole) this.listConfig.columns.push({ prop: '', label: '操作', width: 100, slotName: 'customButton' })
-        }
+        this.listConfig.searchForm.forms = [
+            { prop: 'wen_jian_bian_hao', label: '文件编号' },
+            { prop: 'wen_jian_ming_che', label: '文件名称' }
+        ]
+        this.listConfig.columns = [
+            { prop: 'wen_jian_bian_hao', label: '文件编号', sortable: 'custom', width: 150 },
+            { prop: 'wen_jian_ming_che', label: '文件名称', minWidth: 150 },
+            { prop: 'ban_ben_hao_', label: '版本', width: 65 },
+            { prop: 'file_info_', label: '查阅', slotName: 'wenjinachayue', minWidth: 150 },
+            { prop: 'fa_bu_xiu_ding_zu', label: '发布日期', sortable: 'custom', width: 150 }
+
+        ]
     },
     methods: {
-        editClose (visible) {
-            this.editDialogVisible = visible
-            this.refreshData()
-        },
-        goEdit (row) {
-            this.editPkValue = row.id_
-            this.editDialogVisible = true
-        },
-        unitConversions (str) {
-            // 使用正则表达式匹配括号内的数字
-            const match = str.match(/((\d+))/)
-            // console.log('match', match)
-            // 如果找到了匹配,则返回匹配到的数字;否则返回空字符串
-            if (!match) {
-                return
-            }
-            if (match[1] < 1024) {
-                return match[0] + match[1]
-            }
-            return match[0] + (match[1] / 1024).toFixed(2) + 'M'
-        },
+
         colseVisible (val) {
             this.dialogVisible = val
         },
@@ -431,212 +257,8 @@ export default {
             this.loading = true
         },
         getDatas () {
-            const { comAuthority, buMenAuthority, authority } =
-                this.fileTypesDatas
-            // fileType存放点击文件id,如有孩子,则还有孩子id
             const { fileType, sorts } = this.sqlWhere
-            this.listData = []
-            let wheres1 = '' // 共用
-            let wheres2 = '' // 部门
-            let wheres3 = '' // 受限
-
-            let start = ''
-            const positionsDatas = this.$store.getters.userInfo.positions
-            const needSelType = []
-            if (this.$store.getters.userInfo.positions === 0) {
-                this.$message({
-                    message: '该账户并没有所属部门,请先归属部门再来操作。',
-                    type: 'error'
-                })
-                return
-            }
-            for (var i in this.searchWhere) {
-                if (i === 'b') {
-                    start = this.searchWhere[i]
-                }
-                if (i === 'i') {
-                    wheres1 =
-                        wheres1 +
-                        ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                    wheres2 =
-                        wheres2 +
-                        ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                    wheres3 =
-                        wheres3 +
-                        ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                }
-                if (i !== 'i' && i !== 'b') {
-                    const likeWhere =
-                        i === 'nian_du_'
-                            ? this.searchWhere[i].getFullYear()
-                            : this.searchWhere[i]
-                    wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
-                    wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
-                    wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
-                }
-            }
-            // fileType存放文件的id和有孩子的id
-            if (fileType) {
-                if (this.pageKey === 'skwjcy') {
-                    if (comAuthority.length !== 0) {
-                        wheres1 =
-                            wheres1 +
-                            ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
-                    }
-                    if (buMenAuthority.length !== 0) {
-                        let orSql = ''
-                        positionsDatas.forEach((item, index) => {
-                            orSql += `${
-                                index === 0 ? '' : 'OR'
-                            } wj.quan_xian_xin_xi_ LIKE '%${item.id}%'`
-                        })
-                        wheres2 =
-                            wheres2 +
-                            ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
-                    }
-                    if (authority.length !== 0) {
-                        wheres3 =
-                            wheres3 +
-                            ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
-                    }
-                } else {
-                    wheres1 =
-                        wheres1 +
-                        ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
-                }
-            }
-            let ascDesc = 'desc'
-            if (sorts && JSON.stringify(sorts) !== '{}') {
-                wheres1 =
-                    wheres1 +
-                    ` order by  ${sorts.sortBy}  ${
-                        sorts.order === 'ascending' ? 'asc' : 'desc'
-                    }`
-                wheres2 =
-                    wheres2 +
-                    ` order by  ${sorts.sortBy}  ${
-                        sorts.order === 'ascending' ? 'asc' : 'desc'
-                    }`
-                ascDesc = sorts.order === 'ascending' ? 'asc' : 'desc'
-            }
-            const isSuper = this.$store.getters.isSuper
-            const roleLists = this.$store.getters.userInfo.role
-            const roleKey = ['wjgly']
-            const curRole = roleLists.map((i) => i.alias)
-            const isPower = curRole.some((i) => roleKey.includes(i))
-            // 重复发放的文件,在权限表会存在重复的文件信息
-            //   let fileSearchSql = `select  wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,qx.bian_zhi_shi_jian
-            //    FROM (SELECT *FROM (SELECT * FROM t_wjcysqb  ORDER BY create_time_ DESC LIMIT 99999999) a GROUP BY a.yong_hu_id_,a.wen_jian_id_) qx LEFT JOIN t_wjxxb wj ON qx.wen_jian_id_=wj.wen_jian_fu_jian_ WHERE qx.yong_hu_id_='${this.userId}' AND qx.shou_quan_='1' ${wheres1} GROUP BY qx.yong_hu_id_,qx.wen_jian_id_`
-            const selectSql = `select  wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,wj.shu_ju_lai_yuan_ AS shu_ju_lai_yuan_,file.ext_ AS ext_,
-			file.FILE_PATH_ AS file_path_,concat(file.file_name_,'.',file.ext_,'(大小:',
-               CASE
-                WHEN file.total_bytes_ >= 1024 * 1024 THEN CONCAT(ROUND(file.total_bytes_ / (1024.0 * 1024), 2), ' M')
-                WHEN file.total_bytes_ >= 1024 THEN CONCAT(ROUND(file.total_bytes_ / 1024.0, 2), ' K')
-                ELSE CONCAT(file.total_bytes_, 'B')
-            END
-            ,')') as file_info_,
-            wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,'' AS cha_yue_jie_zhi_s  from`
-
-            // const selectSql = `select  wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
-            // wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,"" AS cha_yue_jie_zhi_s  from`
-            const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
-            left join (select id_,parent_id_ from t_wjscjl group by parent_id_) sc on sc.parent_id_ = wj.id_
-            left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_`
-            // 内外部文件查阅时候查所有文件
-            const allSql = ``
-            // 共用文件
-            const comSql = `${selectSql} t_wjxxb wj ${leftSql} 
-             where wj.shi_fou_guo_shen_ ='有效' and (${this.depArrs.join(
-        ' or '
-    )}) ${wheres1} `
-            // 部门权限文件
-            const buMenSql = `${selectSql}  t_wjxxb wj ${leftSql}
-            where wj.shi_fou_guo_shen_ in ('有效','使用') ${wheres2} `
-            // 受限文件:结合查阅授权模块的截止时间
-            // select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
-
-            const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,wj.shu_ju_lai_yuan_ AS shu_ju_lai_yuan_,file.ext_ AS ext_,
-			file.FILE_PATH_ AS file_path_,concat(file.file_name_,'.',file.ext_,'(',
-                     CASE
-                    WHEN file.total_bytes_ >= 1024 * 1024 THEN CONCAT(ROUND(file.total_bytes_ / (1024.0 * 1024), 2), ' M')
-                    WHEN file.total_bytes_ >= 1024 THEN CONCAT(ROUND(file.total_bytes_ / 1024.0, 2), ' K')
-                    ELSE CONCAT(file.total_bytes_, 'B')
-                END
-                ,')') as file_info_,
-                wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,sq.cha_yue_jie_zhi_s  from
-            t_wjxxb wj
-            left join (select *from t_skwjcysqsqzb order by create_time_ desc limit 1) sq on wj.id_=sq.wen_jian_id_
-            ${leftSql}
-            WHERE wj.shi_fou_guo_shen_ ='有效'and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
-            and wj.quan_xian_xin_xi_ like '%${this.userId}%'  ${wheres3} `
-            // and (${isPower} or wj.quan_xian_xin_xi_ like '%${this.userId}%')  ${wheres3}
-            // 深圳三院(受限文件查阅权限)
-            //     const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,
-            //     CONCAT(file.file_name_, '.', file.ext_, '(',
-            //     CASE
-            //        WHEN file.total_bytes_ >= 1024 * 1024 THEN CONCAT(ROUND(file.total_bytes_ / (1024.0 * 1024), 2), ' M')
-            //        WHEN file.total_bytes_ >= 1024 THEN CONCAT(ROUND(file.total_bytes_ / 1024.0, 2), ' K')
-            //        ELSE CONCAT(file.total_bytes_, 'B')
-            //     END
-            //  , ')') as file_info_,wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,sq.cha_yue_jie_zhi_s FROM t_wjxxb wj
-            //  LEFT JOIN (SELECT * FROM t_skwjcysqsqzb ORDER BY create_time_ DESC LIMIT 1) sq ON wj.id_ = sq.wen_jian_id_ ${leftSql}
-            //  WHERE wj.shi_fou_guo_shen_ = '有效' AND (${isSuper} OR ${isPower}
-            // 	OR EXISTS (SELECT 1 FROM t_wjxdzb wjxdzb
-            // 		JOIN t_wjxzxdjlb wjxzxdjlb ON wjxdzb.id_ = wjxzxdjlb.parent_id_
-            // 		JOIN t_wjxxb wjxxb ON wjxxb.shu_ju_lai_yuan_ = wjxzxdjlb.id_
-            // 	WHERE wjxxb.id_ = wj.id_  AND CONCAT_WS(',',
-            //         IF ( wjxdzb.bian_zhi_ren_ != '', wjxdzb.bian_zhi_ren_, NULL ),
-            // 		IF( wjxdzb.zhu_shen_he_ren_ != '', wjxdzb.zhu_shen_he_ren_, NULL ),
-            // 		IF( wjxdzb.zhu_shen_pi_ren_ != '', wjxdzb.zhu_shen_pi_ren_, NULL )
-            // 		) LIKE '%${this.userId}%'
-            // 	)
-            // ) ${wheres3}`
-            const sqlArr = [comSql, buMenSql, authoritySql]
-            let oldRecordSql = ''
-            const buMenWhere = []
-            if (this.pageKey !== 'skwjcy') {
-                if (this.$store.getters.deptList.length !== 0) {
-                    // eslint-disable-next-line no-redeclare
-                    if (this.pos) {
-                        for (var a of this.pos.split(',')) {
-                            buMenWhere.push(
-                                `bian_zhi_bu_men_ like '%${a}%'`
-                            )
-                        }
-                    } else {
-                        for (var b of this.$store.getters.deptList) {
-                            buMenWhere.push(
-                                `bian_zhi_bu_men_ like '%${b.positionId}%'`
-                            )
-                        }
-                    }
-
-                    oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj 
-                    left join ibps_party_employee ee on wj.bian_zhi_ren_ = ee.id_ 
-                    LEFT JOIN ibps_party_entity en ON en.id_= bian_zhi_bu_men_ 
-                    where (${buMenWhere.join(
-        ' or '
-    )}) ${wheres1}  order by bian_zhi_shi_jian desc`
-                } else {
-                    console.log('没有部门组织')
-                    return
-                }
-            }
-            // eslint-disable-next-line no-redeclare
-            for (var i in Object.keys(this.fileTypesDatas)) {
-                var key = Object.keys(this.fileTypesDatas)[i] // key
-                var value = this.fileTypesDatas[key] // value
-                if (value.length !== 0) {
-                    needSelType.push(`(${sqlArr[i]})`)
-                }
-            }
-            const fileSearchSql = needSelType.join('union all')
-            // ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
-            const sql =
-                this.pageKey === 'skwjcy'
-                    ? `select wj.id_, wj.wen_jian_ming_che, wj.wen_jian_bian_hao, wj.ban_ben_hao_, wj.fa_bu_xiu_ding_zu, wj.xin_wen_jian_fu_j, wj.wen_jian_lei_xing, wj.wen_jian_zhu_jian, wj.wen_jian_fen_lei_ , concat(file.file_name_,'.',file.ext_,'(大小:',                CASE                 WHEN file.total_bytes_ >= 1024 * 1024 THEN CONCAT(ROUND(file.total_bytes_ / (1024.0 * 1024), 2), ' M')                 WHEN file.total_bytes_ >= 1024 THEN CONCAT(ROUND(file.total_bytes_ / 1024.0, 2), ' K')                 ELSE CONCAT(file.total_bytes_, 'B')             END             ,')') as file_info_ from t_wjylb wj  left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_ where wj.shi_fou_guo_shen_ ='有效' and  wj.fa_fang_ri_qi_ is not null and  wj.fa_fang_ri_qi_ <> '' and ( wj.wen_jian_wai_jian = '0' or  wj.wen_jian_wai_jian = '2') and  wj.fen_lei_id_ = '${fileType}' `
-                    : oldRecordSql
-            // console.log(sql, 'sssssssssssssssssss')
+            const sql = `select wj.id_, wj.wen_jian_ming_che, wj.wen_jian_bian_hao, wj.ban_ben_hao_, wj.fa_bu_xiu_ding_zu, wj.xin_wen_jian_fu_j, wj.wen_jian_lei_xing, wj.wen_jian_zhu_jian, wj.wen_jian_fen_lei_ , concat(file.file_name_,'.',file.ext_,'(大小:',                CASE                 WHEN file.total_bytes_ >= 1024 * 1024 THEN CONCAT(ROUND(file.total_bytes_ / (1024.0 * 1024), 2), ' M')                 WHEN file.total_bytes_ >= 1024 THEN CONCAT(ROUND(file.total_bytes_ / 1024.0, 2), ' K')                 ELSE CONCAT(file.total_bytes_, 'B')             END             ,')') as file_info_ from t_wjylb wj  left join ibps_file_attachment file on file.id_ = wj.xin_wen_jian_fu_j  where wj.shi_fou_guo_shen_ ='有效' and  wj.fa_fang_ri_qi_ is not null and  wj.fa_fang_ri_qi_ <> '' and ( wj.wen_jian_wai_jian = '0' or  wj.wen_jian_wai_jian = '2') and  FIND_IN_SET (wj.fen_lei_id_,'${fileType}') `
             curdPost('sql', sql)
                 .then((res) => {
                     const tableDatas = res.variables.data
@@ -663,7 +285,6 @@ export default {
                     this.listData = []
                 })
         },
-        //  and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
         refreshData () {
             this.listData = []
             this.getSearcFormData()
@@ -775,6 +396,7 @@ export default {
             this.sqlWhere = {
                 fileType: fileTypes.join(',')
             }
+
             this.getDatas()
         },
         // 开启表单页面
@@ -917,46 +539,23 @@ export default {
             this.refreshData()
         },
         handleClickTag (val) {
-            // this.$common.request('sql', sql).then(res => {
-            //     console.log('res', res)
-            //     this.fileInfos = {}
-            //     const { data = [] } = res.variables || {}
-            //     if (!data.length) {
-            //         this.$message.warning('没有可查阅的文件,请查明原因!')
-            //         return
-            //     }
-            //     this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_ }
-            //     this.dialogVisible = true
-            // 查看文件
             this.fileArray = []
-            // this.handleFileInfo(val)
-            const sql1 = `select t_wjxxb.*, t_wjxzxdjlb.xiu_ding_ban_ben_, t_wjxzxdjlb.xiu_ding_nei_rong,t_wjxzxdjlb.yuan_yin_
-            from  t_wjxxb
-            INNER JOIN t_wjxzxdjlb ON  t_wjxxb.shu_ju_lai_yuan_ = t_wjxzxdjlb.id_ WHERE  tou_ban_wen_jian_='${val.id}' AND t_wjxxb.shi_fou_guo_shen_='有效'`
             // 查看文件修订历史记录
-            const sql = `select * FROM t_wjylb where wen_jian_zhu_jian = '${val.wen_jian_zhu_jian}' or yuan_shi_id_ = '${val.wen_jian_zhu_jian}'`
+            const sql = `select * FROM t_wjylb where wen_jian_zhu_jian = '${val.wen_jian_zhu_jian}' or yuan_shi_id_ = '${val.wen_jian_zhu_jian}' and shi_fou_guo_shen_ = '有效' and wen_jian_wai_jian <> '1'`
             this.$common.request('sql', sql).then(async (res) => {
                 const list = res.variables.data
                 for (let i = 0; i < list.length; i++) {
                     const el = list[i]
                     const obj = {
-                        zId: val.id_,
-                        id: el.id_,
+                        id: el.wen_jian_zhu_jian,
                         wen_jian_ming_che: el.wen_jian_ming_che,
                         ban_ben_: el.ban_ben_,
-                        // fu_jian_: el.wen_jian_fu_jian_,
-                        fu_jian_: el.xin_wen_jian_fu_j,
+                        xin_wen_jian_fu_j: el.xin_wen_jian_fu_j,
                         xiu_ding_nei_rong: el.xiu_ding_nei_rong,
                         yuan_yin_: el.xiu_ding_zuo_fei_,
-                        fa_fang_shi_jian_: el.fa_fang_ri_qi_,
-                        fa_bu_shi_jian_: el.fa_fang_ri_qi_,
-                        xiu_ding_ban_ben_: el.ban_ben_hao_,
-                        xiu_ding_wen_jian_: el.xiu_ding_wen_jian_,
+                        fa_fang_ri_qi_: el.fa_fang_ri_qi_,
                         wen_jian_bian_hao: el.wen_jian_bian_hao,
-                        bian_zhi_ren_: el.bian_zhi_ren_,
-                        cao_zuo_lei_xing_: el.cao_zuo_lei_xing_,
-                        xiu_ding_fu_jian_: el.xiu_ding_fu_jian_,
-                        zhen_fu_jian_: el.fu_jian_
+                        bian_zhi_ren_: el.bian_zhi_ren_
                     }
                     await this.handleFileInfo(obj)
                 }
@@ -966,37 +565,44 @@ export default {
         },
         async handleFileInfo (val) {
             // 修订附件作废附件不再使用,修订在文件附件上操作
-            const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
+            const sql = `select * from ibps_file_attachment where id_= '${val.xin_wen_jian_fu_j}'`
             const res = await this.$common.request('sql', sql)
-            this.fileInfos = {} // 本人添加
+            this.fileInfos = {}
             const { data = [] } = res.variables || {}
             if (!data.length) {
                 this.$message.warning('没有可查阅的文件,请查明原因!')
                 return
             }
+
             this.fileInfos = {
                 id: val.id,
                 FILE_NAME_: val.wen_jian_ming_che,
                 fileInfos: data[0],
-                func: this.handleUpdate,
                 ban_ben_: val.ban_ben_,
-                xiu_ding_nei_rong: val.xiu_ding_nei_rong
-                    ? val.xiu_ding_nei_rong
-                    : '',
+                xiu_ding_nei_rong: val.xiu_ding_nei_rong ? val.xiu_ding_nei_rong : '',
                 yuan_yin_: val.yuan_yin_ ? val.yuan_yin_ : '',
-                xiu_ding_ban_ben_: val.xiu_ding_ban_ben_
-                    ? val.xiu_ding_ban_ben_
-                    : '',
                 wen_jian_bian_hao: val.wen_jian_bian_hao,
-                fa_fang_shi_jian_: val.fa_fang_shi_jian_,
-                bian_zhi_ren_: val.bian_zhi_ren_,
-                cao_zuo_lei_xing_: val.cao_zuo_lei_xing_,
-                zId: val.zId,
-                xiu_ding_fu_jian_: val.xiu_ding_fu_jian_,
-                zhen_fu_jian_: val.zhen_fu_jian_,
-                fa_bu_shi_jian_: val.fa_bu_shi_jian_
+                fa_fang_ri_qi_: val.fa_fang_ri_qi_,
+                bian_zhi_ren_: val.bian_zhi_ren_
+
             }
             this.fileArray.push(this.fileInfos)
+        },
+        handleUpdate (fileId, time) {
+            const addParams = {
+                tableName: 't_wjcyjl',
+                paramWhere: [
+                    {
+                        bian_zhi_ren_: this.userId,
+                        bian_zhi_shi_jian: this.$common.getDateNow(19),
+                        parent_id_: fileId,
+                        shi_chang_: time
+                    }
+                ]
+            }
+            curdPost('add', addParams).then((res) => {
+                this.refreshData()
+            })
         }
 
     }