From b4db5d6f91ad2e3833a20c62800455a3f90d6d53 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期四, 18 七月 2024 16:07:27 +0800
Subject: [PATCH] feat:通知弹窗增加阴影

---
 src/views/education/department/list.vue |   62 ++++++++++++++++++++----------
 1 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/src/views/education/department/list.vue b/src/views/education/department/list.vue
index fc0a3a9..884a261 100644
--- a/src/views/education/department/list.vue
+++ b/src/views/education/department/list.vue
@@ -2,22 +2,34 @@
   <div class="app-container">
     <el-form :model="queryParam" ref="queryForm" :inline="true">
       <el-form-item label="閮ㄩ棬锛�">
-        <el-input v-model="queryParam.name"></el-input>
+        <el-input v-model="queryParam.name" size="small"></el-input>
 <!--        <el-select v-model="queryParam.level" placeholder="閮ㄩ棬" clearable="">-->
 <!--          <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>-->
 <!--        </el-select>-->
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" @click="submitForm">鏌ヨ</el-button>
+        <el-button type="primary" @click="submitForm" size="small">鏌ヨ</el-button>
         <router-link :to="{path:'/education/department/edit'}" class="link-left">
-          <el-button type="primary">娣诲姞</el-button>
+          <el-button type="primary" size="small">娣诲姞</el-button>
         </router-link>
       </el-form-item>
     </el-form>
 
-    <el-table v-loading="listLoading" :data="tableData" stripe border fit highlight-current-row style="width: 100%">
+    <el-table
+      v-loading="listLoading"
+      :data="tableData" border fit
+      style="width: 100%"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      :row-class-name="tableRowClassName"
+      row-key="id"
+    >
       <el-table-column prop="name" label="閮ㄩ棬"/>
-      <el-table-column prop="adminName" label="閮ㄩ棬璐熻矗浜�"/>
+      <el-table-column prop="adminNames" label="閮ㄩ棬璐熻矗浜�"/>
+      <el-table-column prop="special" label="鏄惁绠$悊涓夌骇閮ㄩ棬">
+        <template slot-scope="{row}">
+          <el-tag :type="row.special === '1' ? 'success' : 'danger'">{{ row.special === '1' ? '鏄�' : '鍚�' }}</el-tag>
+        </template>
+      </el-table-column>
 <!--      <el-table-column prop="levelName" label="閮ㄩ棬" />-->
       <el-table-column width="400px" label="鎿嶄綔" align="center">
         <template slot-scope="{row}">
@@ -29,15 +41,13 @@
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
-                @pagination="search"/>
 
     <el-dialog
       :title="title"
       :visible.sync="dialogVisible"
       width="400px"
       :before-close="handleClose">
-      <el-select v-model="updateAdminForm.adminId" @change="changSelect" filterable placeholder="閫夋嫨绠$悊鍛�">
+      <el-select v-model="updateAdminForm.adminIds" @change="changSelect" multiple filterable placeholder="閫夋嫨绠$悊鍛�">
         <el-option
           v-for="item in deptUserList"
           :key="item.id"
@@ -69,13 +79,11 @@
       title: '',
       updateAdminForm: {
         id: null,
-        adminId: null
+        adminIds: []
       },
       depart: [],
       queryParam: {
         level: null,
-        pageIndex: 1,
-        pageSize: 10
       },
       listLoading: true,
       tableData: [],
@@ -86,6 +94,12 @@
     this.search()
   },
   methods: {
+    tableRowClassName({row, rowIndex}) {
+      if (row.children && row.children.length > 0) {
+        return 'success-row';
+      }
+      return '';
+    },
     changSelect( value ) {
       this.updateAdminForm.adminId = value
     },
@@ -94,7 +108,7 @@
       this.title = ''
     },
     submitUpdate () {
-      if (!this.updateAdminForm.adminId) {
+      if (!this.updateAdminForm.adminIds) {
         this.$message.warning('璇烽�夋嫨閮ㄩ棬璐熻矗浜�')
         return
       }
@@ -109,7 +123,8 @@
     },
     updateDeptAdmin (row) {
       this.updateAdminForm.id = row.id
-      this.updateAdminForm.adminId = row.adminId
+      this.updateAdminForm.adminIds = row.adminIds
+      console.log(this.updateAdminForm.adminIds, "dd")
       this.title = row.name + '--绠$悊鍛樹慨鏀�'
       this.getUserSelect(row.id)
       this.dialogVisible = true
@@ -122,15 +137,16 @@
     search () {
       this.listLoading = true
       departmentApi.pageList(this.queryParam).then(data => {
-        const re = data.response
-        this.tableData = re.list
-        this.total = re.total
-        this.queryParam.pageIndex = re.pageNum
+        this.tableData = data.response
+        this.tableData.forEach(item => {
+          if (item.adminNames) {
+            item.adminNames = item.adminNames.join("銆�")
+          }
+        })
         this.listLoading = false
 
-        this.depart = data.response.list
-        console.log(this.depart)
-        this.depart.map(item => {
+        this.depart = data.response
+        this.depart.forEach(item => {
           item.key = item.id
           item.value = item.name
         })
@@ -138,7 +154,6 @@
       })
     },
     submitForm () {
-      this.queryParam.pageIndex = 1
       this.search()
     },
     delSubject (row) {
@@ -167,3 +182,8 @@
   }
 }
 </script>
+<style scoped>
+.el-table .success-row {
+  background: oldlace;
+}
+</style>

--
Gitblit v1.8.0