Przeglądaj źródła

[bug-687] 检测档案权限控制

cfort 2 lat temu
rodzic
commit
2f67d851f2

+ 108 - 94
src/assets/styles/components/toolbar.scss

@@ -1,104 +1,118 @@
-
 .ibps-toolbar {
-  .el-button+.el-button {
-    margin-left: 5px;
-  }
-  .toolbar-box {
-    padding: 3px;
-    border: 1px solid #ebeef5;
-	float: left;
-  }
-  .buttons {
-    padding: 0;
-    margin-left: 10px;
-    margin-bottom: 5px;
-    float: left;
-  }
-  .tools {
-    padding: 0;
-    padding-right: 5px;
-    float: right;
-  }
-  .header {
-    padding: 5px 0px;
-    background-color: #FFFFFF;
-    border: 1px solid #ebeef5;
-    height: 45px;
-    .tools>a {
-      display: inline-block;
-      font-size: 14px;
-      line-height: 24px;
-      text-decoration: none;
-      color: #d7d7d7;
-      margin-right: 5px;
-      margin-top: 5px;
-    }
-  }
-
-  .search-label:not(.button-div) {
-    display: inline-block;
-    margin-bottom: -5px;
-    margin-right: 5px;
-    font-weight: bold;
-    width: 80px;
-    text-align: right;
-    line-height: 20px;
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    font-size: 13px;
-    color: #939596;
-  }
-  .inline {
-    display: inline-block;
-  }
-  .clear {
-    clear: both;
-  }
-  
-  &--medium {
-    .header {
-      height: 40px;
+    .el-button+.el-button {
+        margin-left: 5px;
     }
-  }
-  &--small {
-    .header {
-      height: 35px;
+    .toolbar-box {
+        padding: 3px;
+        border: 1px solid #ebeef5;
+        float: left;
+    }
+    .buttons {
+        padding: 0;
+        margin-left: 10px;
+        margin-bottom: 5px;
+        float: left;
+    }
+    .tools {
+        padding: 0;
+        padding-right: 5px;
+        float: right;
     }
-  }
-  &--mini {
     .header {
-      height: 30px;
+        padding: 5px 0px;
+        background-color: #FFFFFF;
+        border: 1px solid #ebeef5;
+        height: 45px;
+
+        .tools>a {
+            display: inline-block;
+            font-size: 14px;
+            line-height: 24px;
+            text-decoration: none;
+            color: #d7d7d7;
+            margin-right: 5px;
+            margin-top: 5px;
+        }
+    }
+    .search-label:not(.button-div) {
+        display: inline-block;
+        margin-bottom: -5px;
+        margin-right: 5px;
+        font-weight: bold;
+        width: 80px;
+        text-align: right;
+        line-height: 20px;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        font-size: 13px;
+        color: #939596;
+    }
+    .inline {
+        display: inline-block;
+    }
+    .clear {
+        clear: both;
+    }
+    &--medium {
+        .header {
+            height: 40px;
+        }
+    }
+    &--small {
+        .header {
+            height: 35px;
+        }
+    }
+    &--mini {
+        .header {
+            height: 30px;
+        }
     }
-  }
 }
 
-.ibps-dialog-91{
-	.el-dialog__body{
-	    height:  calc(100vh) !important;
-	    margin: -9px !important;
-	    padding: 0;
-			
-	}
-	.el-dialog__header{
-	  padding: 0px;
-	}
-	.el-dialog__headerbtn i {
-	 font-size: 28px;
-	 font-weight: bold;
-	 background-color: #FFFFFF;
-	 border-radius: 8px;
-	 margin-top: -8px;
-	}
+.ibps-dialog-91, .js-custom-dialog {
+    .el-dialog__body {
+        height: calc(100vh) !important;
+        margin: -9px !important;
+        padding: 0;
+
+    }
+    .el-dialog__header {
+        padding: 0px;
+    }
+    .el-dialog__headerbtn i {
+        font-size: 28px;
+        font-weight: bold;
+        background-color: #FFFFFF;
+        border-radius: 8px;
+        margin-top: -8px;
+    }
+}
+.btn-cover, .js-custom-dialog {
+    height: calc(94vh) !important;
+    .el-dialog__body {
+        overflow: hidden;
+    }
+    .toolbar-cover {
+        background: rgba(255, 255, 255, 0);
+        position: absolute;
+        top: 0;
+        right: 50px;
+        width: 80px;
+        height: 45px;
+        z-index: 99;
+    }
 }
+
 .ibps-actions {
-  .action-icon + .action-icon{
-   margin-left: 2px;
- }
- .el-button+.el-button{
-     margin-left: 5px;
- }
- .el-dropdown{
-   margin:0 5px;
- }
+    .action-icon+.action-icon {
+        margin-left: 2px;
+    }
+    .el-button+.el-button {
+        margin-left: 5px;
+    }
+    .el-dropdown {
+        margin: 0 5px;
+    }
 }

+ 30 - 13
src/business/platform/form/utils/custom/pintText.js

@@ -4,13 +4,14 @@ import "pdfh5/css/pdfh5.css";
 import { snapshoot } from '@/api/platform/file/attachment' //印章,快照
 import { download } from '@/api/platform/file/attachment'
 import ActionUtils from '@/utils/action'
+import store from '@/store'
 
 const getPint = (tableForm, srcUrl) => {
-    var flag = true;
+    let isMobile = false
     if (/Mobi|Android|iPhone|iPad/i.test(navigator.userAgent)) {
-        flag = false
+        isMobile = true
     }
-    if (flag) {
+    if (!isMobile) {
         dialog(
             {
                 data() {
@@ -19,30 +20,46 @@ const getPint = (tableForm, srcUrl) => {
                         data: ''
                     }
                 },
-
-                template: '<div style="height:100%">' +
-                    '<iframe src="' + srcUrl + '"' +
-                    'id="myiframe"  frameborder="0" scrolling="no" height="100%" width="100%"></iframe>' +
-                    '</div>'
+                template: `
+                    <div style="height:100%">
+                        <iframe src="${srcUrl}" id="myiframe" frameborder="0" scrolling="no" height="100%" width="100%"></iframe>
+                    </div>
+                `,
             },
             {
                 dialog: {
                     appendToBody: true,
                     width: '90%',
-                    top: '1vh',
+                    top: '3vh',
                     center: true,
                     title: '',
-                    'custom-class': 'ibps-dialog-91'
-                }
-            }, (tpl) => {
+                    showClose: true,
+                    closeOnClickModal: false,
+                    'custom-class': 'ibps-dialog-91 btn-cover'
+                },
+            },
+            (tpl) => {
                 tableForm.dialogTemplate = tpl
+                const { role } = store.getters.userInfo || {}
+                // 系统管理角色、实验室主任、档案管理员、信息管理角色可下载打印
+                const hasRole = role.some(item => [ 'xtgljs', 'syszr', 'dagly', 'xxgljs'].includes(item.alias))
+                if (hasRole) {
+                    return
+                }
+                setTimeout(() => {
+                    const toolbarCover = document.createElement('div')
+                    toolbarCover.classList.add('toolbar-cover')
+                    toolbarCover.addEventListener('click', () => {
+                        confirm('无权操作,请联系管理员开放相关权限!', '提示')
+                    })
+                    document.querySelector('.btn-cover').children[1].appendChild(toolbarCover)
+                }, 1000)
             }
         ).catch((_this) => {
             _this.visible = false
             tableForm.dialogTemplate = null
         })
     } else {
-
         dialog(
             {
                 data() {

+ 13 - 3
src/components/ibps-file-viewer/index.vue

@@ -125,7 +125,6 @@
                 return PopupManager.getZIndex()
             },
             loadViewer() {
-                console.log(this.optionFile.previewType)
                 var flag = true
                 if (/Mobi|Android|iPhone|iPad/i.test(navigator.userAgent)) {
                     flag = false
@@ -137,9 +136,20 @@
                     this.fileType = 'image'
                 } else if(flag && pdfType.includes(this.fileExt) && this.optionFile.previewType === 'PDFH5'){
                     // 仅特定字段的PDF文件用PDFh5预览,其余PDF文件使用onlyoffice预览
-                    this.fileType = 'pdf'
+                    // this.fileType = 'pdf'
                     this.$nextTick(() => {
-                        this.$refs.viewer.load(this.url)
+                        // this.$refs.viewer.load(this.url)
+                        const newTab = window.open()
+                        const link = newTab.document.createElement('link')
+                        link.rel = 'shortcut icon'
+                        link.type = 'image/x-icon'
+                        link.href = 'favicon.ico'
+                        // newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
+                        newTab.document.write(`<title>文件预览页-${this.title}</title>`)
+                        newTab.document.write('<style>body { margin: 0px; }</style>')
+                        newTab.document.head.appendChild(link)
+                        newTab.document.write(`<iframe src="${this.$baseUrl}lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(this.url)}" style="width:100%; height:100%;" frameborder="0";>`)
+                        this.closeDialog()
                     })
 
                 } else {

+ 27 - 32
src/components/ibps-file-viewer/pdf/index.vue

@@ -1,41 +1,36 @@
 <template>
-  <div
-    class="pdf"
-    :style="{
-      height: height
-    }"
-  >
-    <iframe v-if="pdfUrl" :src="pdfUrl" frameborder="0" style="width: 100%; height: 100%" />
-  </div>
+    <div class="pdf" :style="{height: height}">
+        <iframe v-if="pdfUrl" :src="pdfUrl" frameborder="0" style="width: 100%; height: 100%" />
+    </div>
 </template>
 <script>
 export default {
-  data() {
-    return {
-      pdfUrl: null,
-      height: '450px'
-    }
-  },
-  mounted() {
-    this.height = this.getDialogHeightHeight()
-    window.addEventListener('resize', this.handleDialogHeightResize)
-  },
-  methods: {
-    load(url) {
-      this.pdfUrl = null
-      url = encodeURIComponent(url)
-      this.pdfUrl = `${this.$baseUrl}lib/pdfjs-dist/web/viewer.html?file=${url}`
-    },
-    loadData(data) {
-      this.pdfUrl = null
-      this.pdfUrl = `${this.$baseUrl}lib/pdfjs-dist/web/viewer.html?file=${data}`
+    data () {
+        return {
+            pdfUrl: null,
+            height: '450px'
+        }
     },
-    handleDialogHeightResize() {
-      this.height = this.getDialogHeightHeight()
+    mounted () {
+        this.height = this.getDialogHeightHeight()
+        window.addEventListener('resize', this.handleDialogHeightResize)
     },
-    getDialogHeightHeight() {
-      return ((document.documentElement.clientHeight || document.body.clientHeight) - 60) + 'px'
+    methods: {
+        load (url) {
+            this.pdfUrl = null
+            url = encodeURIComponent(url)
+            this.pdfUrl = `${this.$baseUrl}lib/pdfjs-dist/web/viewer.html?file=${url}&newWindow=true`
+        },
+        loadData (data) {
+            this.pdfUrl = null
+            this.pdfUrl = `${this.$baseUrl}lib/pdfjs-dist/web/viewer.html?file=${data}`
+        },
+        handleDialogHeightResize () {
+            this.height = this.getDialogHeightHeight()
+        },
+        getDialogHeightHeight () {
+            return ((document.documentElement.clientHeight || document.body.clientHeight) - 60) + 'px'
+        }
     }
-  }
 }
 </script>

+ 1 - 21
src/components/ibps-link/dialog.vue

@@ -4,7 +4,7 @@
     :visible.sync="dialogVisible"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
-    :top="dialogTop||'1vh'"
+    :top="dialogTop||'3vh'"
     :width="dialogWidth||'90%'"
     class="js-custom-dialog"
     append-to-body
@@ -89,23 +89,3 @@ export default {
   }
 }
 </script>
-<style lang="scss" >
-.js-custom-dialog{
-  .el-dialog__body{
-      height:  calc(100vh) !important;
-      margin: -9px !important;
-      padding: 0;
-	  overflow: hidden;
-  }
-  .el-dialog__header{
-    padding: 0px;
-  }
-  .el-dialog__headerbtn i {
-   font-size: 28px;
-   font-weight: bold;
-   background-color: #FFFFFF;
-   border-radius: 8px;
-   margin-top: -8px;
-  }
-}
-</style>

+ 0 - 18
src/views/platform/bpmn/bpmInstHis/list-old.vue

@@ -430,24 +430,6 @@
     }
 </script>
 <style lang="scss">
-    .js-custom-dialog {
-        .el-dialog__body {
-            height: calc(100vh) !important;
-            margin: -9px !important;
-            padding: 0px !important;
-            overflow: hidden;
-        }
-        .el-dialog__header {
-            padding: 0px;
-        }
-        .el-dialog__headerbtn i {
-            font-size: 28px;
-            font-weight: bold;
-            background-color: #ffffff;
-            border-radius: 8px;
-            margin-top: -8px;
-        }
-    }
     .main-container .div_test {
         cursor: pointer;
     }

+ 17 - 23
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -57,7 +57,7 @@
                             <!-- <div class="sub_operation">快照</div> -->
                             <ibps-attachment
                                 v-model="snapshotId"
-                                download
+                                :download="hasRole"
                                 readonly
                                 multiple
                                 upload-type="attachment"
@@ -69,7 +69,7 @@
                             <div class="sub_operation ibps-icon-folder-open-o">附件</div>
                             <ibps-attachment
                                 v-model="fileId"
-                                download
+                                :download="hasRole"
                                 readonly
                                 multiple
                                 upload-type="attachment"
@@ -97,7 +97,7 @@
                                                 <ibps-attachment
                                                     v-model="item.beforeImprove"
                                                     placeholder="请选择"
-                                                    :download="true"
+                                                    :download="hasRole"
                                                     :readonly="true"
                                                     accept="*"
                                                     :multiple="true"
@@ -113,7 +113,7 @@
                                                 <ibps-attachment
                                                     v-model="item.afterImprove"
                                                     placeholder="请选择"
-                                                    :download="true"
+                                                    :download="hasRole"
                                                     :readonly="true"
                                                     accept="*"
                                                     :multiple="true"
@@ -488,6 +488,18 @@ export default {
         openReport (path, id) {
             this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
             this.visible = true
+            // 系统管理角色、实验室主任、档案管理员、信息管理角色可下载打印
+            if (this.hasRole) {
+                return
+            }
+            setTimeout(() => {
+                const toolbarCover = document.createElement('div')
+                toolbarCover.classList.add('toolbar-cover')
+                toolbarCover.addEventListener('click', () => {
+                    confirm('无权操作,请联系管理员开放相关权限!', '提示')
+                })
+                document.querySelector('.js-custom-dialog').firstElementChild.children[1].appendChild(toolbarCover)
+            }, 1000)
         },
         getParenthesesStr (text) {
             let result = ''
@@ -641,24 +653,6 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
-    .js-custom-dialog {
-        .el-dialog__body {
-            height: calc(100vh) !important;
-            margin: -9px !important;
-            padding: 0px !important;
-            overflow: hidden;
-        }
-        .el-dialog__header {
-            padding: 0px;
-        }
-        .el-dialog__headerbtn i {
-            font-size: 28px;
-            font-weight: bold;
-            background-color: #ffffff;
-            border-radius: 8px;
-            margin-top: -80px;
-        }
-    }
     .div_operation {
         cursor: pointer;
     }
@@ -695,7 +689,7 @@ export default {
         }
     }
     .content_item {
-        max-height: 200px;
+        // max-height: 200px;
         margin-bottom: 4px;
         &:first-child{
             .sub_content .title {

+ 0 - 21
src/views/platform/bpmn/bpmInstHis/oldFilesUploadList.vue

@@ -663,27 +663,6 @@ export default {
 };
 </script>
 <style lang="scss">
-.js-custom-dialog {
-    .el-dialog__body {
-        height: calc(100vh) !important;
-        margin: -9px !important;
-        padding: 0px !important;
-        overflow: hidden;
-    }
-
-    .el-dialog__header {
-        padding: 0px;
-    }
-
-    .el-dialog__headerbtn i {
-        font-size: 28px;
-        font-weight: bold;
-        background-color: #ffffff;
-        border-radius: 8px;
-        margin-top: -8px;
-    }
-}
-
 .main-container .div_test {
     cursor: pointer;
 }

+ 0 - 22
src/views/platform/bpmn/bpmInstHis/ori-List.vue

@@ -376,28 +376,6 @@ export default {
   }
 }
 </script>
-<style lang="scss" >
-.js-custom-dialog {
-  .el-dialog__body {
-    height: calc(100vh) !important;
-    margin: -9px !important;
-    padding: 0px !important;
-    overflow: hidden;
-  }
-
-  .el-dialog__header {
-    padding: 0px;
-  }
-
-  .el-dialog__headerbtn i {
-    font-size: 28px;
-    font-weight: bold;
-    background-color: #FFFFFF;
-    border-radius: 8px;
-    margin-top: -8px;
-  }
-}
-</style>
 <style>
 .main-container .div_test {
   cursor: pointer;

+ 14 - 2
src/views/platform/bpmn/bpmInstHis/record/component/testingRecord.vue

@@ -245,8 +245,8 @@ export default {
     },
     data () {
         const roleList = this.$store.getters.userInfo.role
-        // 系统管理角色、实验室主任、信息管理角色具有高级权限
-        const hasRole = roleList.some(item => ['xtgljs', 'syszr', 'dagly'].includes(item.alias))
+        // 系统管理角色、实验室主任、档案管理员、信息管理角色具有高级权限
+        const hasRole = roleList.some(item => ['xtgljs', 'syszr', 'dagly', 'xxgljs'].includes(item.alias))
         return {
             searchList,
             reportList,
@@ -392,6 +392,18 @@ export default {
         alertReport (path, id) {
             this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
             this.visible = true
+            // 系统管理角色、实验室主任、档案管理员、信息管理角色可下载打印
+            if (this.hasRole) {
+                return
+            }
+            setTimeout(() => {
+                const toolbarCover = document.createElement('div')
+                toolbarCover.classList.add('toolbar-cover')
+                toolbarCover.addEventListener('click', () => {
+                    confirm('无权操作,请联系管理员开放相关权限!', '提示')
+                })
+                document.querySelector('.js-custom-dialog').firstElementChild.children[1].appendChild(toolbarCover)
+            }, 1000)
         },
         // 文件预览
         preview (file) {