From aa8e7c86a561d905b743a6ceacc8fb0fe7ac6810 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 18 二月 2025 17:43:50 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/performance/class/index.vue | 211 ++++++++++++++++++++++------------------------------ 1 files changed, 91 insertions(+), 120 deletions(-) diff --git a/src/views/performance/class/index.vue b/src/views/performance/class/index.vue index fe9c55e..18e6ed2 100644 --- a/src/views/performance/class/index.vue +++ b/src/views/performance/class/index.vue @@ -67,15 +67,14 @@ <el-button size="small" type="primary" - v-if="listPower" + v-if="checkPermi(['performance:class:time'])" @click="configTime" - :loading="downLoading" >鏃堕棿閰嶇疆</el-button > <el-button size="small" type="primary" - v-if="downPower" + v-if="checkPermi(['performance:class:down'])" @click="handleDown" :loading="downLoading" >瀵� 鍑�</el-button @@ -84,7 +83,7 @@ size="small" type="primary" @click="schedulingVisible = true" - v-if="addPower" + v-if="checkPermi(['performance:class:add'])" >鎺� 鐝�</el-button > </div> @@ -106,9 +105,18 @@ v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null" > - <div class="user-pic">{{ item.name.charAt(0) }}</div> + <div class="user-pic"> + {{ item.name ? item.name.charAt(0) : "" }} + </div> <div class="user-info"> - <p style="font-size: 14px; color: #3a7bfa; line-height: 24px"> + <p + style=" + font-size: 14px; + color: #3a7bfa; + line-height: 24px; + margin: 0; + " + > {{ item.name }} </p> <p @@ -119,13 +127,14 @@ white-space: nowrap; width: 150px; overflow-x: show; + margin: 0; " > 鏃�:{{ item.day0 }},涓�:{{ item.day1 }},澶�:{{ item.day2 }},浼�:{{ item.day3 }},鍋�:{{ item.day4 }},宸�:{{ item.day6 }} </p> - <p style="margin-top: 4px"> + <p style="margin-top: 4px; margin: 0"> <span style=" color: #999999; @@ -158,7 +167,7 @@ > <span class="month" - style="position: absolute; top: 4px" + style="position: absolute; top: 0px" v-if="item.week == '鍛ㄦ棩'" >{{ item.weekNum }}鍛�</span > @@ -185,7 +194,7 @@ trigger="click" placement="bottom" @command="(e) => handleCommand(e, m)" - :disabled="!upPower" + :disabled="!checkPermi(['performance:class:edit'])" style="width: 100%; height: 100%; cursor: pointer" > <div @@ -212,8 +221,8 @@ <el-dropdown-item v-for="(n, j) in classType" :key="'h' + j" - :command="n.value" - >{{ n.label }}</el-dropdown-item + :command="n.dictValue" + >{{ n.dictLabel }}</el-dropdown-item > </el-dropdown-menu> </el-dropdown> @@ -242,9 +251,18 @@ v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null" > - <div class="user-pic">{{ item.name.charAt(0) }}</div> + <div class="user-pic"> + {{ item.name ? item.name.charAt(0) : "" }} + </div> <div class="user-info"> - <p style="font-size: 14px; color: #3a7bfa; line-height: 24px"> + <p + style=" + font-size: 14px; + color: #3a7bfa; + line-height: 24px; + margin: 0; + " + > {{ item.name }} </p> <p @@ -255,13 +273,14 @@ white-space: nowrap; width: 150px; overflow-x: show; + margin: 0; " > 鏃�:{{ item.day0 }},涓�:{{ item.day1 }},澶�:{{ item.day2 }},浼�:{{ item.day3 }},鍋�:{{ item.day4 }},宸�:{{ item.day6 }} </p> - <p style="margin-top: 4px"> + <p style="margin-top: 4px; margin: 0"> <span style=" color: #999999; @@ -358,9 +377,9 @@ > <el-option v-for="obj in timeTypeList" - :key="obj.value" - :label="obj.label" - :value="obj.value" + :key="obj.dictValue" + :label="obj.dictLabel" + :value="obj.dictValue" > </el-option> </el-select> @@ -492,9 +511,9 @@ > <el-option v-for="item in classType" - :key="item.value" - :label="item.label" - :value="item.value" + :key="item.dictValue" + :label="item.dictLabel" + :value="item.dictValue" > </el-option> </el-select> @@ -523,14 +542,11 @@ exportFile, obtainItemParameterList, update, - selectUserList, + selectUserCondition, } from "@/api/performance/class"; export default { data() { return { - addPower: true, - upPower: true, - downPower: true, query: { userName: "", laboratory: "", @@ -613,7 +629,6 @@ configTimeVisibleLoading: false, // 鏃堕棿閰嶇疆寮规loading timeTypeList: [], timeQuery: [], - listPower: false, }; }, watch: { @@ -652,7 +667,7 @@ this.monthList.push(i); } this.monthList.reverse(); - this.getPower(); + // this.getPower(); }, methods: { refresh() { @@ -797,31 +812,6 @@ }); }); }, - getPower() { - let power = JSON.parse(sessionStorage.getItem("power")); - let add = false; - let up = false; - let down = false; - let listPower = false; - for (var i = 0; i < power.length; i++) { - if (power[i].menuMethod == "performanceShiftUpdate") { - up = true; - } - if (power[i].menuMethod == "delDeviceParameter") { - down = true; - } - if (power[i].menuMethod == "performanceShiftAdd") { - add = true; - } - if (power[i].menuMethod == "shiftTimeList") { - listPower = true; - } - } - this.addPower = add; - this.upPower = up; - this.downPower = down; - this.listPower = listPower; - }, onMouseEnter(index) { this.currentUserIndex = index; }, @@ -854,18 +844,22 @@ endWeek, userId: this.schedulingQuery.userId.join(","), shift: this.schedulingQuery.shift, - }).then((res) => { - this.loading = false; - if (res.code == 201) return; - this.$message.success("鎿嶄綔鎴愬姛"); - this.schedulingVisible = false; - this.schedulingQuery = { - week: "", - userId: null, - shift: "", - }; - this.refresh(); - }); + }) + .then((res) => { + this.loading = false; + if (res.code == 201) return; + this.$message.success("鎿嶄綔鎴愬姛"); + this.schedulingVisible = false; + this.schedulingQuery = { + week: "", + userId: null, + shift: "", + }; + this.refresh(); + }) + .catch((err) => { + this.loading = false; + }); }, configTime() { this.getDicts("sys_class_type").then((response) => { @@ -883,10 +877,10 @@ res.data.forEach((item) => { item.isEdit = false; const index = this.timeTypeList.findIndex( - (val) => val.value === item.shift + (val) => val.dictValue === item.shift ); if (index > -1) { - item.type = this.timeTypeList[index].label; + item.type = this.timeTypeList[index].dictLabel; } }); this.timeQuery = res.data; @@ -909,10 +903,10 @@ saveEdit(item, index) { if (item.shift) { const index = this.timeTypeList.findIndex( - (val) => val.value === item.shift + (val) => val.dictValue === item.shift ); if (index > -1) { - item.type = this.timeTypeList[index].label; + item.type = this.timeTypeList[index].dictLabel; } } delete item.orderBy; @@ -975,20 +969,24 @@ userName: this.query.userName, laboratory: this.query.laboratory, isMonth: this.query.month ? true : false, - }).then((res) => { - this.$message.success("涓嬭浇鎴愬姛"); - this.downLoading = false; - const blob = new Blob([res], { - type: "application/force-download", + }) + .then((res) => { + this.$message.success("涓嬭浇鎴愬姛"); + this.downLoading = false; + const blob = new Blob([res], { + type: "application/force-download", + }); + let fileName = ""; + if (this.query.month) { + fileName = year + "-" + this.query.month + " 鐝淇℃伅"; + } else { + fileName = year + " 鐝姹囨��"; + } + this.$download.saveAs(blob, fileName + ".xlsx"); + }) + .catch((err) => { + this.downLoading = false; }); - let fileName = ""; - if (this.query.month) { - fileName = year + "-" + this.query.month + " 鐝淇℃伅"; - } else { - fileName = year + " 鐝姹囨��"; - } - this.$download.saveAs(blob, fileName + ".xlsx"); - }); }, selectEnumByCategory() { this.getDicts("sys_class_type").then((response) => { @@ -1033,63 +1031,35 @@ } }, getUsers() { - selectUserList({ - current: -1, - size: -1, - }).then((res) => { + selectUserCondition().then((res) => { if (res.code === 201) { return; } - let arr = res.data.body.records; + let arr = res.data; this.personList = arr; }); }, getDayByDic(e) { - let obj = this.classType.find((m) => m.label == e); + let obj = this.classType.find((m) => m.dictLabel == e); if (obj) { - return obj.value; + return obj.dictValue; } }, getShiftByDic(e) { - let obj = this.classType.find((m) => m.value == e); + let obj = this.classType.find((m) => m.dictValue == e); if (obj) { - return obj.label; + return obj.dictLabel; } return "鏃�"; - }, - scrollInit() { - // 鑾峰彇瑕佺粦瀹氫簨浠剁殑鍏冪礌 - const nav = document.getElementById("nav"); - var flag; // 榧犳爣鎸変笅 - var downX; // 榧犳爣鐐瑰嚮鐨剎涓嬫爣 - var scrollLeft; // 褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲� - nav.addEventListener("mousedown", function (event) { - flag = true; - downX = event.clientX; // 鑾峰彇鍒扮偣鍑荤殑x涓嬫爣 - scrollLeft = this.scrollLeft; // 鑾峰彇褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲� - }); - nav.addEventListener("mousemove", function (event) { - if (flag) { - // 鍒ゆ柇鏄惁鏄紶鏍囨寜涓嬫粴鍔ㄥ厓绱犲尯鍩� - var moveX = event.clientX; // 鑾峰彇绉诲姩鐨剎杞� - var scrollX = moveX - downX; // 褰撳墠绉诲姩鐨剎杞翠笅鏍囧噺鍘诲垰鐐瑰嚮涓嬪幓鐨剎杞翠笅鏍囧緱鍒伴紶鏍囨粦鍔ㄨ窛绂� - this.scrollLeft = scrollLeft - scrollX; // 榧犳爣鎸変笅鐨勬粴鍔ㄦ潯鍋忕Щ閲忓噺鍘诲綋鍓嶉紶鏍囩殑婊戝姩璺濈 - } - }); - // 榧犳爣鎶捣鍋滄鎷栧姩 - nav.addEventListener("mouseup", function () { - flag = false; - }); - // 榧犳爣绂诲紑鍏冪礌鍋滄鎷栧姩 - nav.addEventListener("mouseleave", function (event) { - flag = false; - }); }, }, }; </script> <style scoped> +.class-page { + padding: 10px; +} .form_title { height: 36px; display: flex; @@ -1127,7 +1097,7 @@ } .center { width: 100%; - height: calc(100% - 100px); + height: calc(100vh - 220px); background-color: #fff; overflow-y: auto; display: flex; @@ -1161,8 +1131,8 @@ min-height: calc(100% - 10px); /* 瑙嗗彛楂樺害 */ } .content-title { - height: 52px; - line-height: 52px; + height: 58px; + line-height: 58px; border-bottom: 1px solid #eeeeee; } .content-title-right { @@ -1194,6 +1164,7 @@ .content-title-item .day { font-size: 14px; color: #333333; + margin-right: 4px; } .content-title-item .week { font-size: 12px; -- Gitblit v1.9.3