فهرست منبع

受控文件查阅优先级调整

lidie 1 سال پیش
والد
کامیت
60fd2c0e8c
1فایلهای تغییر یافته به همراه66 افزوده شده و 25 حذف شده
  1. 66 25
      src/views/infosManage/fileIE.vue

+ 66 - 25
src/views/infosManage/fileIE.vue

@@ -76,6 +76,20 @@
                                 >{{ scope.row.file_info_ }}</el-tag>
                             </div>
                         </template>
+                        <!-- 阅览/收藏具名插槽 -->
+                        <!-- <template
+                            slot="readStatus"
+                            slot-scope="scope"
+                        >
+                            <img
+                                :src="scope.row.cy_id_ ? openFilePng : closeFilePng"
+                                style="vertical-align: middle; height: 30px;"
+                            > /
+                            <img
+                                :src="scope.row.sc_id_ ? hadColetcPng : noColectPng"
+                                style="vertical-align: middle; height: 30px;"
+                            >
+                        </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;" />
@@ -131,20 +145,28 @@
             :son-data="sonData"
             @getcolse="getcolse"
         />
+        <!-- 图片查阅 -->
+        <!-- <el-image-viewer v-if="picture" :on-close="closeViewer" :url-list="[FlowPic]" /> -->
     </div>
 </template>
 <script>
 import ActionUtils from '@/utils/action'
+// import { getFileType, getFileByUserId } from '@/api/permission/file'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 import FixHeight from '@/mixins/height'
 import IbpsTypeTree from '@/business/platform/cat/type/tree'
+// import { findTreeData } from '@/api/platform/cat/type'
 import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
 import closeFilePng from '@/assets/images/icons/closeFile.png'
 import openFilePng from '@/assets/images/icons/openFile.png'
+// import hadColetcPng from '@/assets/images/icons/hadColetc.png'
+// import noColectPng from '@/assets/images/icons/noColect.png'
 import wordPng from '@/assets/images/icons/word.png'
 import fileTraining from '@/views/component/fileTraining'
+// import column from '@/components/ibps-crud/mixin/column'
 import UpdateFile from './updateFile'
+// import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
 
 export default {
     components: {
@@ -153,6 +175,8 @@ export default {
         UpdateFile,
         'ibps-attachment': IbpsAttachment,
         'file-lookup': fileTraining
+        // IbpsImage: () => import('@/business/platform/file/image'),
+        // ElImageViewer
     },
     mixins: [FixHeight],
     data () {
@@ -200,6 +224,11 @@ export default {
                 // 工具栏
                 toolbars: [
                     { key: 'search' }
+                    // {
+                    //     key: 'colect',
+                    //     label: '收藏或取消收藏',
+                    //     type: 'success'
+                    // }
                 ],
                 // 查询条件
                 searchForm: {
@@ -263,12 +292,15 @@ export default {
                 { prop: 'wen_jian_ming_che', label: '文件名称' }
             ]
             this.listConfig.columns = [
+                // { prop: 'status', label: '阅览 / 收藏', slotName: 'readStatus', width: 100 },
                 // { 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_', label: '版本', width: 65 },
                 { prop: 'file_info_', label: '查阅', slotName: 'wenjinachayue', minWidth: 150 },
                 { prop: 'fa_fang_shi_jian_', label: '发布日期', sortable: 'custom', width: 150 },
+                // { prop: 'read', label: '阅览状态', slotName: 'readStatus', minWidth: 60 },
+                // { prop: 'collect', label: '收藏状态', slotName: 'collectStatus', minWidth: 60 },
                 { prop: 'cha_yue_jie_zhi_s', label: '查阅截止时间', sortable: 'custom', minWidth: 120 }
             ]
         }
@@ -294,8 +326,7 @@ export default {
         unitConversions (str) {
             // 使用正则表达式匹配括号内的数字
             const match = str.match(/((\d+))/)
-            // const match = str.match(/\((\d+)\)/)
-            console.log('match', match)
+            // console.log('match', match)
             // 如果找到了匹配,则返回匹配到的数字;否则返回空字符串
             if (!match) { return }
             if (match[1] < 1024) { return match[0] + match[1] }
@@ -395,7 +426,8 @@ export default {
             // 重复发放的文件,在权限表会存在重复的文件信息
             //   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_,concat(file.file_name_,'.',file.ext_,'(大小:',
+            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')
@@ -420,7 +452,8 @@ export default {
             // 受限文件:结合查阅授权模块的截止时间
             // 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_,concat(file.file_name_,'.',file.ext_,'(',
+            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')
@@ -483,7 +516,7 @@ export default {
             }
             const fileSearchSql = needSelType.join('union all')
             // ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
-            const sql = this.pageKey === 'nbwj' ? `select sq.id,sq.cy_id_,sq.sc_id_,sq.shu_ju_lai_yuan_,sq.file_info_,sq.wen_jian_xi_lei_,sq.wen_jian_bian_hao,sq.wen_jian_ming_che,sq.ban_ben_,COALESCE(wjxz.gai_zhang_fu_jian,sq.fu_jian_) AS fu_jian_,sq.fa_fang_shi_jian_,sq.cha_yue_jie_zhi_s from (${fileSearchSql}) sq LEFT JOIN t_wjxzxdjlb wjxz ON sq.shu_ju_lai_yuan_ = wjxz.id_ ORDER BY sq.wen_jian_bian_hao ${ascDesc},sq.wen_jian_ming_che DESC` : oldRecordSql
+            const sql = this.pageKey === 'nbwj' ? `select sq.id,sq.cy_id_,sq.sc_id_,sq.shu_ju_lai_yuan_,sq.file_info_,sq.wen_jian_xi_lei_,sq.wen_jian_bian_hao,sq.wen_jian_ming_che,sq.ban_ben_,sq.ext_,sq.file_path_,COALESCE(wjxz.gai_zhang_fu_jian,sq.fu_jian_) AS fu_jian_,sq.fa_fang_shi_jian_,sq.cha_yue_jie_zhi_s from (${fileSearchSql}) sq LEFT JOIN t_wjxzxdjlb wjxz ON sq.shu_ju_lai_yuan_ = wjxz.id_ ORDER BY sq.wen_jian_bian_hao ${ascDesc},sq.wen_jian_ming_che DESC` : oldRecordSql
             // console.log(sql, 'sssssssssssssssssss')
             curdPost('sql', sql).then(res => {
                 const tableDatas = res.variables.data
@@ -632,10 +665,10 @@ export default {
                     this.refreshData()
                     break
                 case 'remove':
-                    if (data.length === 0) {
-                        this.$message({
+                    if (!data) {
+                        return this.$message({
                             message: '请选择数据再进行删除',
-                            type: 'error'
+                            type: 'warning'
                         })
                     }
                     // eslint-disable-next-line no-case-declarations
@@ -674,8 +707,8 @@ export default {
             }
         },
         /**
-        * 处理排序
-        */
+         * 处理排序
+         */
         handleSortChange (sort) {
             this.sqlWhere.sorts = sort
             this.getDatas()
@@ -734,11 +767,20 @@ export default {
             this.refreshData()
         },
         handleClickTag (val) {
-            // console.log('val', val)
+            // 查看图片
+            // const type = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']
+            // const isPower = type.includes(val.ext_)
+            // if (isPower) {
+            //     const { baseApi } = this.$store.getters || {}
+            //     const baseUrl = baseApi.replace(/^(https?:\/\/[^\/]+)\/?.*/, '$1/') || baseApi + '/'
+            //     this.picture = true
+            //     this.FlowPic = baseUrl + val.file_path_
+            //     return
+            // }
             // const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
             // this.$common.request('sql', sql).then(res => {
             //     console.log('res', res)
-            //     this.fileInfos = {}// 本人添加
+            //     this.fileInfos = {}
             //     const { data = [] } = res.variables || {}
             //     if (!data.length) {
             //         this.$message.warning('没有可查阅的文件,请查明原因!')
@@ -746,20 +788,17 @@ export default {
             //     }
             //     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_='有效'`
-            // 1
-            const sql = `select wjxzxdjlb.* FROM t_wjxxb wjxxb 
-            LEFT JOIN t_wjxzxdjlb wjxzxdjlb ON 
-            wjxxb.wen_jian_fu_jian_ = wjxzxdjlb.wen_jian_fu_jian_
-            WHERE wjxxb.id_ = '${val.id}' ORDER BY wjxzxdjlb.create_time_ DESC`
+            // 查看文件修订历史记录
+            const sql = `select w.* FROM t_wjxzxdjlb w JOIN (select zuo_fei_cao_zuo_ FROM t_wjxzxdjlb WHERE id_ = (select shu_ju_lai_yuan_ FROM t_wjxxb WHERE id_ = '${val.id}') and zuo_fei_cao_zuo_ IS NOT NULL and zuo_fei_cao_zuo_!='' ) sub ON w.zuo_fei_cao_zuo_ = sub.zuo_fei_cao_zuo_ where w.zuo_fei_cao_zuo_ IS NOT NULL and w.zuo_fei_cao_zuo_!=''and w.shi_fou_guo_shen_='已完成' `
             this.$common.request('sql', sql).then(res => {
                 const list = res.variables.data
-                // console.log('list', list)
+                // console.log('list123', list)
                 list.forEach(el => {
                     const obj = {
                         zId: val.id,
@@ -783,12 +822,14 @@ export default {
             })
         },
         handleFileInfo (val) {
-            let sql = ''
-            if (val.cao_zuo_lei_xing_ === '修订') {
-                sql = `select * from ibps_file_attachment where id_= '${val.xiu_ding_fu_jian_}'`
-            } else {
-                sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
-            }
+            // 修订附件作废附件不再使用,修订在文件附件上操作
+            const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
+            //  let sql = ''
+            // if (val.cao_zuo_lei_xing_ === '修订') {
+            //     sql = `select * from ibps_file_attachment where id_= '${val.xiu_ding_fu_jian_}'`
+            // } else {
+            //     sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
+            // }
             this.$common.request('sql', sql).then(res => {
                 this.fileInfos = {}// 本人添加
                 const { data = [] } = res.variables || {}