Browse Source

版本更新修改

lzw 4 months ago
parent
commit
9986768530

+ 1 - 1
src/components/list.vue

@@ -1495,7 +1495,7 @@ export default {
   left: 13%;
   width: 250px;
   height: 2px;
-  background-color: rgb(137, 137, 137);
+  background-color: #E7E7E7;
 }
 /* .checkbox-left部分 */
 .checkbox-left {

+ 98 - 0
src/components/organList.vue

@@ -0,0 +1,98 @@
+<template>
+    <div class="list_container">
+        <div class="title_examine">
+            <div class="pub_title">组织列表</div>
+        </div>
+        <div class="tableBox">
+            <el-table :data="organizations" stripe border style="width: 100%" :header-cell-style="headerCellStyle">
+                <el-table-column show-overflow-tooltip prop="name" label="组织名称" min-width="45"></el-table-column>
+                <el-table-column show-overflow-tooltip prop="code" label="编码" min-width="45"></el-table-column>
+                <el-table-column show-overflow-tooltip prop="ctime" label="创建时间" min-width="45"></el-table-column>
+                <el-table-column label="操作" width="150px">
+                    <template slot-scope="scope">
+                        <div class="operate">
+                            <button style="color: #308fff;" @click="update(scope.row)">编辑</button>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <!-- 分页组件 -->
+        <el-pagination :current-page="currentPage" :page-size="pageSize" :total="total"
+            @current-change="handlePageChange" layout="total,prev, pager, next, jumper">
+        </el-pagination>
+    </div>
+</template>
+<script>
+import { API_CONFIG } from '@/common/apiConfig';
+export default {
+    name: 'onList',
+    data() {
+        return {
+            organizations: [],
+            currentPage:1,
+            pageSize: 10,
+            total: 0
+        }
+    },
+    methods: {
+        // 表头的背景色
+        headerCellStyle() {
+            return { backgroundColor: "#f1f1f1" };
+        },
+        getOrgan() {
+            let params = [
+                {
+                    functionName: "getOrgan",
+                    page: this.currentPage,
+                    num: this.pageSize,
+                }
+            ];
+            this.$ajax
+                .post(API_CONFIG.baseUrl, params)
+                .then((res) => {
+                    // console.log("返回的数据为:", res.data);  // 检查返回的数据
+                    if (res.data && Array.isArray(res.data[0])) {
+                        // 使用 map() 提取所有组织名称
+                        this.organizations = res.data[0]
+                        this.total = res.data[0][0].num
+                        console.log(this.organizations);
+                        
+                    }
+
+                })
+                .catch((err) => {
+                    this.$message.error("查询失败");
+                    console.error("请求失败,错误信息:", err);
+                });
+        },
+        // 页码扩展按钮
+        handlePageChange(page) {
+            this.currentPage = page;
+            this.getOrgan();
+        },
+    },
+    mounted() {
+        this.getOrgan()
+    }
+}
+</script>
+<style scoped>
+.list_container {
+    width: 100%;
+    height: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    overflow: auto;
+}
+
+.tableBox {
+    margin: 10px 0;
+}
+
+.operate button {
+    background: none;
+    border: none;
+    cursor: pointer;
+}
+</style>

+ 99 - 0
src/components/schoolList.vue

@@ -0,0 +1,99 @@
+<template>
+    <div class="list_container">
+        <div class="title_examine">
+            <div class="pub_title">学校列表</div>
+        </div>
+        <div class="tableBox">
+            <el-table :data="schoolList" stripe border style="width: 100%" :header-cell-style="headerCellStyle">
+                <el-table-column show-overflow-tooltip prop="name" label="学校名称" min-width="45"></el-table-column>
+                <el-table-column show-overflow-tooltip prop="dest" label="组织" min-width="45"></el-table-column>
+                <el-table-column show-overflow-tooltip prop="code" label="编码" min-width="45"></el-table-column>
+                <el-table-column show-overflow-tooltip prop="ctime" label="创建时间" min-width="45"></el-table-column>
+                <el-table-column label="操作" width="150px">
+                    <template slot-scope="scope">
+                        <div class="operate">
+                            <button style="color: #308fff;" @click="update(scope.row)">编辑</button>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <!-- 分页组件 -->
+        <el-pagination :current-page="currentPage" :page-size="pageSize" :total="total"
+            @current-change="handlePageChange" layout="total,prev, pager, next, jumper">
+        </el-pagination>
+    </div>
+</template>
+<script>
+import { API_CONFIG } from '@/common/apiConfig';
+export default {
+    name: 'schoolList',
+    data() {
+        return {
+            schoolList: [],
+            currentPage:1,
+            pageSize: 10,
+            total: 0
+        }
+    },
+    methods: {
+        // 表头的背景色
+        headerCellStyle() {
+            return { backgroundColor: "#f1f1f1" };
+        },
+        getOrgan() {
+            let params = [
+                {
+                    functionName: "getSchoolList",
+                    page: this.currentPage,
+                    num: this.pageSize,
+                }
+            ];
+            this.$ajax
+                .post(API_CONFIG.baseUrl, params)
+                .then((res) => {
+                    // console.log("返回的数据为:", res.data);  // 检查返回的数据
+                    if (res.data && Array.isArray(res.data[0])) {
+                        // 使用 map() 提取所有组织名称
+                        this.schoolList = res.data[0]   
+                        this.total = res.data[0][0].num
+                        // console.log(res.data[0].num);
+                        
+                    }
+
+                })
+                .catch((err) => {
+                    this.$message.error("查询失败");
+                    console.error("请求失败,错误信息:", err);
+                });
+        },
+        // 页码扩展按钮
+        handlePageChange(page) {
+            this.currentPage = page;
+            this.getOrgan();
+        },
+    },
+    mounted() {
+        this.getOrgan()
+    }
+}
+</script>
+<style scoped>
+.list_container {
+    width: 100%;
+    height: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    overflow: auto;
+}
+
+.tableBox {
+    margin: 10px 0;
+}
+
+.operate button {
+    background: none;
+    border: none;
+    cursor: pointer;
+}
+</style>

+ 21 - 8
src/components/versionAdd.vue

@@ -2,7 +2,9 @@
   <div class="list_container">
     <div class="title_examine">
       <div class="pub_title">版本添加</div>
-      <div style="margin-left: auto;"><el-button type="primary" size="small" @click="addVersionm()">新增版本</el-button>
+      <div style="margin-left: auto;">
+        <el-button type="primary" size="small" @click="addVersionm()">新增版本</el-button>
+        <el-button type="primary" size="small" @click="checkDate()">查看日历</el-button>
       </div>
 
     </div>
@@ -26,7 +28,7 @@
           <el-table-column prop="update_desc" label="更新描述" width="180px" class="description"></el-table-column>
           <el-table-column prop="update_details" label="更新详情" width="180px">
             <template #default="scope">
-              <el-tooltip class="item" effect="dark" :content="scope.row.update_details" placement="top">
+              <el-tooltip class="item" effect="dark" :content="scope.row.update_details" placement="left">
                 <div class="cell-ellipsis">{{ scope.row.update_details }}</div>
               </el-tooltip>
             </template>
@@ -241,6 +243,14 @@ export default {
         }
       });
     },
+    checkDate() {
+      this.$router.push({
+        path: '/updateDate',
+        query: {
+          versType: this.type
+        }
+      });
+    },
     formatDate() {
       // 使用示例
       const today = new Date(); // 获取当前日期
@@ -311,12 +321,15 @@ export default {
         .post(API_CONFIG.baseUrl, params)
         .then((res) => {
           console.log("👉", res.data);
-          this.tableData = res.data[0];
-          this.total = res.data[0][0].num;
-          this.countFormal = res.data[1][0].countFormal;
-          this.countBeta = res.data[1][0].countBeta;
-          this.countHk = res.data[1][0].countHk;
-          this.countCom = res.data[1][0].countCom;
+          this.tableData = res.data[0] || [];
+          this.total = (res.data[0] && res.data[0][0] && res.data[0][0].num) || 0;
+
+          this.countFormal = (res.data[1] && res.data[1][0] && res.data[1][0].countFormal) || 0;
+          this.countBeta = (res.data[1] && res.data[1][0] && res.data[1][0].countBeta) || 0;
+          this.countHk = (res.data[1] && res.data[1][0] && res.data[1][0].countHk) || 0;
+          this.countCom = (res.data[1] && res.data[1][0] && res.data[1][0].countCom) || 0;
+          console.log("我被调用了");
+
         })
         .catch((err) => {
           console.log(err);

+ 12 - 0
src/router/index.js

@@ -4,6 +4,8 @@ import HomeView from '../views/HomeView.vue';
 import UserList from '@/components/list.vue'; // 账号列表组件
 import UserExamine from '@/components/examine.vue'; // 账号审核组件.
 import VersionAdd from '@/components/versionAdd.vue';//版本添加组件
+import OrganList from '@/components/organList.vue';
+import SchoolList from '@/components/schoolList.vue';
 import versionInstr from '@/views/versionInstr.vue';//版本说明组件
 import updateDate from '@/views/updateDate.vue';
 
@@ -41,6 +43,16 @@ const routes = [
         name: 'VersionAdd',
         component: VersionAdd,
       },
+      {
+        path: 'organ-list',
+        name: 'organList',
+        component: OrganList,
+      },
+      {
+        path: 'school-list',
+        name: 'schoolList',
+        component: SchoolList,
+      },
     ],
   },
   {

+ 5 - 5
src/store/modules/user.js

@@ -59,11 +59,11 @@ const actions = {
           resolve(_user.userid);
         })
         .catch((error) => {
-          // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
-          // commit("SET_ID", _user.userid);
-          // commit("SET_TOKEN", _user.userid);
-          // setToken(_user.userid);
-          // resolve(_user.userid);
+          var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
+          commit("SET_ID", _user.userid);
+          commit("SET_TOKEN", _user.userid);
+          setToken(_user.userid);
+          resolve(_user.userid);
           reject(error);
         });
     });

+ 8 - 2
src/views/HomeView.vue

@@ -16,9 +16,15 @@
           <router-link class="menu_left" to="/user-examine">
             <i class="el-icon-edit"></i>账号审核
           </router-link>
-          <router-link class="menu_left" to="/version-add">
-            <i class="el-icon-document-add"></i>版本添加
+          <router-link class="menu_left" to="/organ-list">
+            <i class="el-icon-office-building"></i>组织列表
           </router-link>
+          <router-link class="menu_left" to="/school-list">
+            <i class="el-icon-school"></i>学校列表
+          </router-link>
+          <!-- <router-link class="menu_left" to="/version-add">
+            <i class="el-icon-office-building"></i>版本更新
+          </router-link> -->
         </ul>
       </div>
       <div class="table-container">

+ 17 - 9
src/views/updateDate.vue

@@ -9,13 +9,14 @@
         <div class="DateUpda_area">
             <div class="Date_left">
                 <div class="D_l_title">
-                    <img src="../assets/left_arrow.png">
+                    <img src="../assets/left_arrow.png" @click="handleClick" style="cursor: pointer;">
                     <div class="D_l_text">更新日历</div>
                 </div>
                 <div class="D_l_content">
                     <div class="D_l_head">
                         <div class="head_left" :class="{ 'active': isSelectActive }">选择年份:
-                            <el-select v-model="value" placeholder="" style="width: 86px;" @focus="handleFocus" @blur=handleBlur>
+                            <el-select v-model="value" placeholder="" style="width: 86px;" @focus="handleFocus"
+                                @blur=handleBlur>
                                 <el-option v-for="item in options" :key="item.value" :label="item.label"
                                     :value="item.value">
                                 </el-option>
@@ -43,7 +44,7 @@
                 </div>
                 <div class="update_count">最高月更新频次:<div style="font-family: DIN Alternate;">
                         {{ getMostUpdatedMonth.month ? `${getMostUpdatedMonth.month} 月 (${getMostUpdatedMonth.count} 次)`
-                        : '暂无数据' }}
+                            : '暂无数据' }}
                     </div>
                 </div>
                 <div class="update_number">版本数量:<div style="font-family: DIN Alternate;">{{
@@ -152,6 +153,11 @@ export default {
 
     },
     methods: {
+        handleClick() {
+            // 处理返回操作,例如返回到上一个页面
+            this.$router.go(-1);
+
+        },
         generateYears() {
             const currentYear = new Date().getFullYear(); // 获取当前年份
             this.options = Array.from({ length: 5 }, (_, i) => {
@@ -229,10 +235,10 @@ export default {
                 .then((res) => {
                     this.datesData = res.data[0];
                     // console.log("👉", this.highlightDates);
-                    const type = this.$route.query.type;
-                    console.log("我是type", type);
+                    const versType = this.$route.query.versType;
+                    console.log("我是type", versType);
 
-                    this.filteredData = this.datesData.filter(item => item.update_version === type);
+                    this.filteredData = this.datesData.filter(item => item.update_version === versType);
                     console.log("filteredData", this.filteredData);
 
                     // 提取 update_at 字段并添加到 highlightDates 数组中
@@ -253,14 +259,16 @@ body {
     overflow: hidden;
     /* 禁止页面滚动 */
 }
-.DateUpda{
+
+.DateUpda {
     height: 100%;
     overflow: hidden;
 }
+
 .DateUpda_area {
     display: flex;
     justify-content: space-between;
-    height: calc(100% - 54px); 
+    height: calc(100% - 54px);
 }
 
 .DateUpda_head {
@@ -425,7 +433,7 @@ body {
 .day {
     width: 30px;
     height: 30px;
-    background-color: #E2EEFF;
+    background-color: #f1f1f1;
     display: flex;
     justify-content: center;
     align-items: center;