浏览代码

修改首页提交人

cfort 3 年之前
父节点
当前提交
28dcfd6d48
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      src/views/system/dashboard/components/new-home.vue

+ 11 - 2
src/views/system/dashboard/components/new-home.vue

@@ -141,12 +141,12 @@
                                     <template slot-scope="scope">{{ scope.row.createBy | getUserName(userList)}}</template>
                                 </el-table-column>
                                 <el-table-column
-                                    v-if="['finish'].includes(activeTab)"
+                                    
                                     show-overflow-tooltip
                                     label="提交人"
                                     width="100"
                                 >
-                                    <template slot-scope="scope">{{ scope.row.updateBy ? scope.row.updateBy : scope.row.createBy | getUserName(userList) }}</template>
+                                    <template slot-scope="scope">{{ getName(scope.row) }}</template>
                                 </el-table-column>
                             </template>
                             <el-table-column
@@ -391,6 +391,15 @@
                     }
                 })
             },
+            getName ({createBy, updateBy}) {
+                const id = updateBy ? updateBy : createBy
+                const { name = '' } = this.$store.getters
+                if (this.activeTab === 'finish') {
+                    let t = this.userList.find(i => i.userId === id)
+                    return t ? t.userName : ''
+                }
+                return name
+            },
             tableRowClassName({ row, rowIndex }) {
                 if (rowIndex % 2 === 1) return 'warning-row'
                 return 'success-row'