cfort 3 лет назад
Родитель
Сommit
b04a80492c
1 измененных файлов с 12 добавлено и 8 удалено
  1. 12 8
      src/views/system/dashboard/components/new-home.vue

+ 12 - 8
src/views/system/dashboard/components/new-home.vue

@@ -260,7 +260,7 @@
                 let hasDesc = v.includes('#')
                 let res = {
                     name: {
-                        '0': v.includes('(') ? v.split('(')[0] : v,
+                        '0': v.includes('{') ? v.split('{')[0] : v.includes('(') ? v.split('(')[0] : v,
                         '1': v.split('#')[0]
                     },
                     // 无#返回空,有#返回(左边的字符串,
@@ -275,8 +275,8 @@
                 return res[type]['1']
             },
             getUserName (v, list) {
-                let user = list.find(i => i.id_ === v)
-                return user ? user.name_ : ''
+                let user = list.find(i => i.userId === v)
+                return user ? user.userName : ''
             }
         },
         data() {
@@ -303,7 +303,7 @@
                 FlowName: '',
                 posName: '',
                 defaultPagination: { page: 1, limit: 15 },
-                sorts: { createTime: 'DESC' },
+                sorts: { CREATE_TIME_: 'DESC' },
                 timer: null,
                 processName: '',
                 userList: [],
@@ -472,7 +472,8 @@
                 if (this.activeTab === 'finish') {
                     params.end = '1'
                 }
-                return ActionUtils.formatParams(params, pagination, this.sorts)
+                let s = this.activeTab === 'wait' ? {createTime: 'DESC'} : this.sorts
+                return ActionUtils.formatParams(params, pagination, s)
             },
             // 处理表格点击事件
             handleLinkClick(data) {
@@ -489,12 +490,15 @@
             handleClose() {
                 this.drawer = !this.drawer
             },
-            // 文字替换
+            // 文字替换,兼容旧数据
             getParenthesesStr(text) {
                 let result = ''
                 if (!text) return result
-                let regex = /\((.+?)\)/g
-                let options = text.match(regex)
+                let regex1 = /\{(.+?)\}/g
+                let regex2 = /\((.+?)\)/g
+                let options1 = text.match(regex1)
+                let options2 = text.match(regex2)
+                let options = options1 && options1.length ? options1 : options2
                 if (options) {
                     let option = options[0]
                     if (option) {