Преглед изворни кода

修复排版提交生成图片样式变形的问题

zhonghuizhen пре 1 година
родитељ
комит
502c1bb5f0

+ 6 - 1
src/views/business/​scheduleManage/edit.vue

@@ -1077,6 +1077,11 @@ export default {
                 })
                 })
             }
             }
             return new Promise((resolve, reject) => {
             return new Promise((resolve, reject) => {
+                // 修改变形样式
+                const abscissaElement = document.querySelector('.abscissa')
+                if (abscissaElement) {
+                    abscissaElement.style.margin = '0 20px 0 90px'
+                }
                 html2canvas(element).then(canvas => {
                 html2canvas(element).then(canvas => {
                     canvasToBlob(canvas).then(blob => {
                     canvasToBlob(canvas).then(blob => {
                         uploadImage(blob).then(fileId => {
                         uploadImage(blob).then(fileId => {
@@ -1335,7 +1340,7 @@ export default {
             width: fit-content;
             width: fit-content;
             overflow-x: auto;
             overflow-x: auto;
             font-size: 14px;
             font-size: 14px;
-            position: relative;
+            //position: relative;
             .abscissa {
             .abscissa {
                 // width: 100%;
                 // width: 100%;
                 margin: 0 20px 0 110px;
                 margin: 0 20px 0 110px;

+ 34 - 3
src/views/business/​scheduleManage/list.vue

@@ -103,9 +103,11 @@ export default {
                 rowHandle: {
                 rowHandle: {
                     effect: 'display',
                     effect: 'display',
                     actions: [
                     actions: [
-                        { key: 'adjust', label: '申请调班', type: 'primary', icon: 'ibps-icon-exchange' },
-                        { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit' },
-                        { key: 'preview', label: '查看', type: 'primary', icon: 'ibps-icon-eye' }
+                        { key: 'adjust', label: '申请调班', type: 'primary', icon: 'ibps-icon-exchange', hidden: false },
+                        { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit', hidden: (row) => {
+                            return !this.isRoleFilter() && this.$store.getters.userId !== row.createBy
+                        } },
+                        { key: 'preview', label: '查看', type: 'primary', icon: 'ibps-icon-eye', hidden: false }
                         // { key: 'report', label: '实验报告', type: 'success', icon: 'ibps-icon-file-text-o' }
                         // { key: 'report', label: '实验报告', type: 'success', icon: 'ibps-icon-file-text-o' }
                     ]
                     ]
                 }
                 }
@@ -156,6 +158,35 @@ export default {
         search () {
         search () {
             this.loadData()
             this.loadData()
         },
         },
+        /**
+         * 判断当前用户是否为超级管理员和高权限角色和专业组组长
+         */
+        isRoleFilter () {
+            const highRoles = this.$store.getters.userInfo.highRoles || [] // 高权限角色
+            const userRole = this.$store.getters.userInfo.role || [] // 用户权限角色
+            let isHighRole = false
+            userRole.forEach(el => {
+                const roleAlias = el.alias
+                if (highRoles.includes(roleAlias)) {
+                    isHighRole = true
+                }
+                if (roleAlias === 'zhsfzr') {
+                    isHighRole = true
+                }
+            })
+            return (this.$store.getters.isSuper || isHighRole)
+        },
+        isZhsfzr () {
+            const userRole = this.$store.getters.userInfo.role || [] // 用户权限角色
+            let isZhsfzrRole = false
+            userRole.forEach(el => {
+                const roleAlias = el.alias
+                if (roleAlias === 'zhsfzr') {
+                    isZhsfzrRole = true
+                }
+            })
+            return isZhsfzrRole
+        },
         /**
         /**
          * 处理按钮事件
          * 处理按钮事件
          */
          */