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

登录页样式调整,首页代码精简,体系运行记录盒列表缺失数据逻辑补充

cfort пре 2 година
родитељ
комит
a3100c7ad3

+ 24 - 40
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -34,6 +34,7 @@
             @column-link-click="handleLinkClick"
             @pagination-change="handlePaginationChange"
         >
+            <template slot="creator" slot-scope="scope">{{ scope.row.createBy | getUserName(userList) }}</template>
             <template slot="selectCont" slot-scope="scope">
                 <el-popover
                     :ref="'popover2-' + scope.row.id"
@@ -182,6 +183,10 @@ export default {
         getReportName (value) {
             // 通过/与.截取,eg: 43罗湖/L13-LHXBJY-QP-6.4-04 标准菌株管理程序/LHXBJY-QP-6.4-04-FQ-03 标准菌株鉴定验收记录表.rpx
             return value.slice(-value.split('').reverse().join('').indexOf('/'), -value.split('').reverse().join('').indexOf('.') - 1)
+        },
+        getUserName (v, list) {
+            const user = list.find(i => i.userId === v)
+            return user ? user.userName : ''
         }
     },
     mixins: [FixHeight],
@@ -192,7 +197,12 @@ export default {
         }
     },
     data () {
+        const { first = '' } = this.$store.getters.level || {}
+        const { userList = [], deptList = [] } = this.$store.getters || {}
         return {
+            first,
+            userList,
+            deptList,
             width: 210,
             selection: false,
             dialogFormVisible: false,
@@ -244,12 +254,10 @@ export default {
                 },
                 // 表格字段配置
                 columns: [
-                    // { prop: 'subject', label: '任务标题', link: 'dialog', width: 250 },
-                    // { prop: 'tYear', label: '年份', width: 60 },
-                    { prop: 'tDept', label: '部门', width: 90 },
+                    { prop: 'deptName', label: '部门', width: 90 },
                     { prop: 'procDefName', label: '表单名称', sortable: 'custom', formatter: this.replaceFormName, width: 250 },
                     { prop: 'subject', label: '事务说明', formatter: this.getDesc, 'min-width': 300 },
-                    { prop: 'tUser', label: '编制人', width: 80 },
+                    { prop: 'createBy', label: '编制人', width: 80, slotName: 'creator' },
                     { prop: 'endTime', label: '完成时间', sortable: 'custom', dateFormat: 'yyyy-MM-dd hh:mm:ss', width: 150 }
                 ],
                 rowHandle: {
@@ -307,24 +315,24 @@ export default {
             }
             return cellValue.split('#')[1]
         },
+        getInfo (val) {
+            const arr = val.split('#')
+            if (!arr[2]) {
+                return ''
+            }
+            const result = JSON.parse(`{${arr[2]}}`)
+            const t = this.deptList.find(i => i.positionId === result.dept)
+            result.deptName = t ? t.positionName : result.dept
+            return result
+        },
         // 加载数据
         loadData () {
             this.loading = true
             queryClassify(this.getSearcFormData()).then((response) => {
                 const data = response.data && response.data.dataResult
                 data.forEach(item => {
-                    const temp = this.getParenthesesStr(item.subject)
-                    // 如果是年度计划, 标题编辑中取年份, 去除默认给与的年份
-                    if (temp.length === 4) {
-                        // 判断截取内容是否为数字,如果不是则截取创建时间的作为年份
-                        item.tYear = isNaN(Number(temp[0])) ? item.createTime.slice(0, 4) : temp[0]
-                        item.tDept = temp[2]
-                        item.tUser = temp[3]
-                    } else if (temp.length > 1) {
-                        item.tYear = isNaN(Number(temp[0])) ? item.createTime.slice(0, 4) : temp[0]
-                        item.tDept = temp[1]
-                        item.tUser = temp[2]
-                    }
+                    const temp = this.getInfo(item.subject)
+                    item.deptName = temp ? temp.deptName : ''
                 })
                 ActionUtils.handleListData(this, response.data)
                 this.loading = false
@@ -467,30 +475,6 @@ export default {
             this.srcUrl = `${this.$reportPath.replace('show', 'pdf')}${path}&id_=${id}`
             this.visible = true
         },
-        getParenthesesStr (text) {
-            let result = ''
-            if (!text) return result
-            // 新数据年份、部门、发起人以{}包裹
-            const regex1 = /\{(.+?)\}/g
-            // 旧数据年份、部门、发起人以()包裹
-            const regex2 = /\((.+?)\)/g
-            const options1 = text.match(regex1)
-            const options2 = text.match(regex2)
-            const options = options1 && options1.length ? options1 : options2
-            if (options) {
-                const option = options[0]
-                if (option) {
-                    result = option.substring(1, option.length - 1)
-                }
-                if (options[1]) {
-                    const yersOption = options[1]
-                    if (yersOption) {
-                        result = result + '/' + yersOption.substring(1, yersOption.length - 1)
-                    }
-                }
-            }
-            return result.split('/')
-        },
         // 获取格式化参数
         getSearcFormData () {
             const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}

+ 12 - 0
src/views/platform/bpmn/bpmTask/list.vue

@@ -200,10 +200,22 @@
             this.loadData()
         },
         methods: {
+            removeDesc (str) {
+                const parts = str.split('#')
+                if (parts.length > 2) {
+                    return parts.slice(0, 2).join('#') + '#'
+                } else {
+                    return str
+                }
+            },
             // 加载数据
             loadData() {
                 this.loading = true
                 queryPageList(this.getSearcFormData()).then(response => {
+                    const { dataResult = [] } = response.data || {}
+                    dataResult.forEach(i => {
+                        i.subject = this.removeDesc(i.subject)
+                    })
                     ActionUtils.handleListData(this, response.data)
                     this.loading = false
                 }).catch(() => {

+ 4 - 25
src/views/system/dashboard/components/workbench.vue

@@ -186,10 +186,13 @@ export default {
     },
     data () {
         const { first = '' } = this.$store.getters.level || {}
+        const { userList = [], deptList = [] } = this.$store.getters || {}
         return {
             first,
             tabList,
             stateOption,
+            userList,
+            deptList: [],
             pkKey: 'id',
             taskId: '', // 编辑dialog需要使用
             waiJian: '', // 编辑dialog需要使用
@@ -206,8 +209,6 @@ export default {
             FlowName: '',
             posName: '',
             timer: null,
-            userList: [],
-            positionList: [],
             orgInfo: {},
             activeTab: tabList[0].key,
             height: document.body.clientHeight,
@@ -317,8 +318,6 @@ export default {
     },
     mounted: function () {
         this.getData(this.activeTab)
-        this.getUserList()
-        this.getPositionList()
         this.getOrgInfo()
         if (this.timer) {
             clearInterval(this.timer)
@@ -337,26 +336,6 @@ export default {
         clearInterval(this.timer)
     },
     methods: {
-        // 获取系统用户信息
-        getUserList () {
-            const { userList } = this.$store.getters
-            // store中有则无需请求
-            if (userList && userList.length) {
-                this.userList = userList
-                return
-            }
-            const sql = `select id_ as userId, name_ as userName, mobile_ as phone from ibps_party_employee where status_ = 'actived'`
-            this.$common.request('sql', sql).then(res => {
-                this.userList = res.variables && res.variables.data
-            })
-        },
-        // 获取系统部门信息
-        getPositionList () {
-            const sql = `select id_ as positionId, name_ as positionName from ibps_party_entity where party_type_ = 'position' and path_ like '%${this.first}%'`
-            this.$common.request('sql', sql).then(res => {
-                this.positionList = res.variables && res.variables.data
-            })
-        },
         // 获取用户部门信息
         getOrgInfo () {
             const { org = {}} = this.$store.getters
@@ -394,7 +373,7 @@ export default {
                 return ''
             }
             const result = JSON.parse(`{${arr[2]}}`)
-            const t = this.positionList.find(i => i.positionId === result.dept)
+            const t = this.deptList.find(i => i.positionId === result.dept)
             result.deptName = t ? t.positionName : result.dept
             return result[arg]
         },

+ 8 - 5
src/views/system/login/page.vue

@@ -82,7 +82,8 @@ export default {
         }
 
         .jbd-login-page-main {
-            margin: 0 auto;
+            margin-left: 180px;
+            // margin: 0 auto;
             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
             padding: 10px 20px;
             //margin-left: 50px;
@@ -152,7 +153,8 @@ export default {
         }
 
         .jbd-login-page-main {
-            margin: 0 auto;
+            // margin: 0 auto;
+            margin-left: 150px;
             // margin-top: 0px;
             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
             padding: 10px 20px;
@@ -179,7 +181,7 @@ export default {
             height: 100%;
             overflow: hidden;
             border: 0;
-            padding: 0 7.5%;
+            padding: 0 2.5%;
         }
         .footerclass{
             width: 80%;
@@ -223,7 +225,8 @@ export default {
         }
 
         .jbd-login-page-main {
-            margin: 0 auto;
+            // margin: 0 auto;
+            margin-left: 150px;
             // margin-top: 0px;
             box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
             padding: 10px 20px;
@@ -251,7 +254,7 @@ export default {
             height: 100%;
             overflow: hidden;
             border: 0;
-            padding: 0 7.5%;
+            padding: 0 2.5%;
         }
         .footerclass{
             width: 80%;