From d31ea14284714a88d86cb5342895081dbeab062f Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Thu, 11 Jan 2024 10:51:18 +0800
Subject: [PATCH] 更新

---
 src/views/evaluate/components/secondRoundResult.vue |  208 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 163 insertions(+), 45 deletions(-)

diff --git a/src/views/evaluate/components/secondRoundResult.vue b/src/views/evaluate/components/secondRoundResult.vue
index f2c8c5d..97c17c9 100644
--- a/src/views/evaluate/components/secondRoundResult.vue
+++ b/src/views/evaluate/components/secondRoundResult.vue
@@ -1,10 +1,42 @@
 <template>
-    <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" @current-change="currentChange"
-        @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
-        <template #menu-left>
-            <!-- <el-button type="success" plain icon="el-icon-download" @click="handleExport">导出</el-button> -->
-        </template>
-    </avue-crud>
+    <template v-if="!type()">
+        <ul class="type-list">
+            <li class="type-item">
+                <div class="title">类别</div>
+                <div class="introduction">认定标准</div>
+                <div class="number">名额</div>
+                <div class="tool">操作</div>
+            </li>
+            <li class="type-item" v-for="(item, index) in data" :key="index">
+                <div class="title">{{ item.category.categoryName }}</div>
+                <el-tooltip effect="dark" placement="top">
+                    <template #content>
+                        <p style="max-width: 500px;">{{ item.category.standard }}</p>
+                    </template>
+                    <div class="introduction">
+                        {{ item.category.standard }}
+                    </div>
+                </el-tooltip>
+
+                <div class="number">{{ item.category.peopleNum }}人</div>
+                <div class="tool">
+                    <el-button type="primary" text icon="el-icon-view" @click="view(item)">查看最终结果</el-button>
+                </div>
+            </li>
+        </ul>
+        <el-dialog v-model="dialogParams.visible" :title="dialogParams.title">
+            <avue-crud :option="dialogOption" :table-loading="dialogLoading" :data="dialogParams.data" @on-load="onLoad">
+        </avue-crud>
+        </el-dialog>
+    </template>
+    <template v-else>
+        <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page"
+            @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+            <template #menu-left>
+                <el-button type="success" plain icon="el-icon-download" @click="handleExport">导出</el-button>
+            </template>
+        </avue-crud>
+    </template>
 </template>
 
 <script>
@@ -25,6 +57,7 @@
     data() {
         return {
             loading: true,
+            dialogLoading: true,
             query: {},
             page: {
                 pageSize: 10,
@@ -48,42 +81,64 @@
                 menuWidth: 150,
                 menu: false,
                 dialogClickModal: false,
-                column: []
+                column: [
+                    {
+                        label: '部门',
+                        prop: 'user_name',
+                        type: 'input'
+                    },
+                    {
+                        label: '票数',
+                        prop: 'voteNum',
+                        type: 'input'
+                    }
+                ]
             },
-            defaultColumn: [
-                {
-                    label: '姓名',
-                    prop: 'user_name',
-                    type: 'input'
-                },
-                {
-                    label: '部门',
-                    prop: 'user_name',
-                    type: 'input'
-                },
-                {
-                    label: '职位',
-                    prop: 'dept_name',
-                    type: 'input'
-                },
-                {
-                    label: '票数',
-                    prop: 'voteNum',
-                    type: 'input'
-                },
-            ],
-            sectionColumn: [
-                {
-                    label: '部门',
-                    prop: 'user_name',
-                    type: 'input'
-                },
-                {
-                    label: '票数',
-                    prop: 'voteNum',
-                    type: 'input'
-                },
-            ],
+            dialogOption: {
+                height: '400',
+                calcHeight: 30,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 6,
+                border: true,
+                index: true,
+                viewBtn: false,
+                addBtn: false,
+                editBtn: false,
+                delBtn: false,
+                viewBtn: false,
+                header: false,
+                menuWidth: 150,
+                menu: false,
+                dialogClickModal: false,
+                column: [
+                    {
+                        label: '姓名',
+                        prop: 'user_name',
+                        type: 'input'
+                    },
+                    {
+                        label: '部门',
+                        prop: 'user_name',
+                        type: 'input'
+                    },
+                    {
+                        label: '职位',
+                        prop: 'dept_name',
+                        type: 'input'
+                    },
+                    {
+                        label: '票数',
+                        prop: 'voteNum',
+                        type: 'input'
+                    }
+                ]
+            },
+            dialogParams: {
+                visible: false,
+                title: '',
+                data: {}
+            },
             data: []
         }
     },
@@ -111,17 +166,24 @@
             };
             getFinallyResult(page.currentPage, page.pageSize, id).then(res => {
                 const data = res.data.data;
-                this.page.total = data.total || '';
-                this.data = data.records || [];
+                this.data = data || [];
                 this.loading = false;
             });
         },
+        view(result) {
+            const { category, resultList } = result
+            this.dialogParams = {
+                visible: true,
+                title: `最终结果(${category.categoryName })`,
+                data: resultList
+            }
+            this.dialogLoading = false
+        }
     },
     watch: {
         'params.data': {
             handler(value) {
                 this.onLoad(this.page)
-                this.option.column = (this.type() ? this.sectionColumn : this.defaultColumn)
             },
             deep: true
         }
@@ -129,4 +191,60 @@
 }
 </script>
 
-<style lang="scss" scoped></style>
\ No newline at end of file
+<style lang="scss" scoped>
+$borderColor: var(--el-border-color);
+
+.type-list {
+    margin: 0;
+    padding: 0;
+    list-style-type: none;
+    width: 100%;
+    border: 1px solid $borderColor;
+    border-radius: var(--el-border-radius-base);
+    box-sizing: border-box;
+
+    .type-item {
+        display: flex;
+        height: 40px;
+        line-height: 40px;
+        text-align: center;
+
+        div {
+            border-bottom: 1px solid $borderColor;
+            flex-shrink: 0;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+        }
+
+        .title {
+            flex: 2;
+        }
+
+        .introduction {
+            flex: 5;
+            flex-shrink: 0;
+
+            border: {
+                right: 1px solid $borderColor;
+                left: 1px solid $borderColor;
+            }
+        }
+
+        .number {
+            flex: 1;
+        }
+
+        .tool {
+            flex: 2;
+            border-left: 1px solid $borderColor;
+        }
+
+        &:last-child {
+            div {
+                border-bottom: 0;
+            }
+        }
+    }
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3