Sfoglia il codice sorgente

提交相关代码

Lijy 11 mesi fa
parent
commit
3b9ed94355

+ 22 - 40
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -268,46 +268,12 @@
 
             <el-table-column prop="participator" :label="$t('participants')" :min-width="user.company.packageCustomer != 1 ? '100' : '300'" sortable v-if="user.company.packageProject==0">
                 <template slot-scope="scope">
-                    <!-- <v-for v-for="par in scope.row.participator" :key="par.id" >
-                        <el-link style="margin-right:10px;" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
-                    </v-for> -->
-                    <div v-if="scope.row.participator.length > 5">
-                        <el-popover placement="top" width="500" trigger="hover" v-if="scope.row.participator.length > 0">
-                            <span v-for="par in scope.row.participator" :key="par.id">
-                                <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
-                                    <span v-if="user.userNameNeedTranslate != 1">
-                                        {{par.name}}
-                                    </span>
-                                    <span v-if="user.userNameNeedTranslate == 1">
-                                        <TranslationOpenDataText type='userName' :openid='par.name'></TranslationOpenDataText>
-                                    </span>
-                                </el-link>
-                            </span>
-                            <div slot="reference" class="addss">
-                                <span v-for="par in scope.row.participator" :key="par.id">
-                                    <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
-                                        <span v-if="user.userNameNeedTranslate != 1">
-                                            {{par.name}}
-                                        </span>
-                                        <span v-if="user.userNameNeedTranslate == 1">
-                                            <TranslationOpenDataText type='userName' :openid='par.name'></TranslationOpenDataText>
-                                        </span>
-                                    </el-link>
-                                </span>
-                            </div>
-                        </el-popover>
-                    </div>
-                    <div v-else>
-                        <span v-for="par in scope.row.participator" :key="par.id" >
-                            <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate != 1">
-                                {{par.name}}
-                            </el-link>
-                            <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate == 1">
-                                <TranslationOpenDataText type='userName' :openid='par.name'></TranslationOpenDataText>
-                            </el-link>
-                        </span>
-                    </div>
-                    
+                    <span v-if="(scope.row.participator || []).length > 0">
+                        <el-link type="primary" @click="showAllparticipator(scope.row)">
+                            <TranslationOpenDataText type='userName' :openid='scope.row.participator[0].name'></TranslationOpenDataText>
+                            <span v-if="scope.row.participator.length > 1">...</span>
+                        </el-link>
+                    </span>
                 </template>
             </el-table-column>
             <!-- 客户管理 -->
@@ -1749,6 +1715,15 @@
                 </div>
             </el-dialog>
         </el-dialog>
+
+        <!-- 参与人 -->
+        <el-dialog :title="participatorVisibleTitle" :visible.sync="participatorVisible" width="50%" :before-close="handleClose">
+            <div>
+                <el-link type="primary" style="margin-right:10px;" v-for="(item, index) in participatorValue" :key="index" @click="showUser(item.id)">
+                    <TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText>
+                </el-link>
+            </div>
+        </el-dialog>
     </section>
 </template>
 <style scoped>
@@ -2057,6 +2032,8 @@ a {
                 setTemplateDialog: false,
                 selectedGroup:{},
                 changeParticipation:false,
+                participatorVisible: false,
+                participatorValue: []
             };
         },
         // 过滤器
@@ -2108,6 +2085,11 @@ a {
             })
         },
         methods: {
+            showAllparticipator(item) {
+                this.participatorVisibleTitle = item.projectName + ' -- 参与人'
+                this.participatorValue = item.participator || []
+                this.participatorVisible = true
+            },
             // 批量导入任务
             importTask(item) {
                 //首先判断文件类型