From ac1f8e130c8753d0a69f1e83d698c46d13c63044 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 20 三月 2025 17:46:50 +0800
Subject: [PATCH] 在库项目计划开工时间
---
src/components/flow/User/index.vue | 100 +++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 86 insertions(+), 14 deletions(-)
diff --git a/src/components/flow/User/index.vue b/src/components/flow/User/index.vue
index 31ce534..5109608 100644
--- a/src/components/flow/User/index.vue
+++ b/src/components/flow/User/index.vue
@@ -102,6 +102,10 @@
default: 'multiple',
required: true
},
+ num: {
+ required: true,
+ type: Number
+ }
},
data() {
return {
@@ -163,36 +167,104 @@
},
selectValues: {
handler(newVal) {
- if (StrUtil.isNotBlank(newVal)) {
- if (newVal instanceof Number) {
- this.radioSelected = newVal
+ if (newVal) {
+ if (this.checkType === 'multiple') {
+ this.selectUserList = newVal.map(item => parseInt(item))
} else {
- this.selectUserList = newVal;
+ this.radioSelected = parseInt(newVal)
}
}
},
immediate: true
},
userList: {
+ deep: true,
handler(newVal) {
- if (StrUtil.isNotBlank(newVal) && this.selectUserList.length > 0) {
+ console.log(newVal, "鏁板瓧")
+ console.log(this.selectValues, "浼犲叆鐨勫�兼槸")
+ if (this.checkType !== 'multiple') {
+ console.log(this.userList, "浼犲叆鐨勫�兼槸")
+ if (this.radioSelected && this.userList.length > 0) {
this.$nextTick(() => {
this.$refs.dataTable.clearSelection();
- this.selectUserList?.split(',').forEach(key => {
- this.$refs.dataTable.toggleRowSelection(newVal.find(
- item => key == item.userId
- ), true)
- });
+ newVal.forEach(item => {
+ console.log(this.radioSelected === item.userId, 123)
+ if (this.radioSelected === item.userId) {
+ this.$refs.dataTable.toggleRowSelection(item)
+ }
+ })
});
+ }
+ } else {
+ this.$nextTick(() => {
+ this.$refs.dataTable.clearSelection();
+ this.selectUserList.forEach(key => {
+ newVal.forEach(item => {
+ if (key === item.userId) {
+ this.$refs.dataTable.toggleRowSelection(item)
+ }
+ })
+ });
+ });
}
- }
- }
+
+ // if (StrUtil.isNotBlank(newVal)) {
+ //
+ // if (typeof newVal == "number" || typeof newVal == "string") {
+ // console.log("杩涜繖")
+ //
+ // } else {
+ // console.log("涓嶅簲璇ヨ繘鐫�")
+ //
+ // console.log("鐢ㄦ埛鍥炴樉", this.selectUserList)
+ // }
+ // }
+ },
+ // immediate: true
+ },
+ // userList: {
+ // // handler(newVal) {
+ // // console.log(this.radioSelected, "鍗曢�夊��")
+ // // if (this.checkType !== 'multiple') {
+ // //
+ // // } else {
+ // // console.log("this.selectUserList",this.selectUserList ,typeof this.selectUserList)
+ // //
+ // // }
+ // // }
+ // }
},
- created() {
+ mounted() {
this.getList();
this.getDeptTree();
},
methods: {
+ setChecked() {
+ if (this.checkType !== 'multiple') {
+ this.radioSelected = this.selectValues
+ this.$nextTick(() => {
+ this.$refs.dataTable.clearSelection();
+ this.userList.forEach(item => {
+ if (parseInt(this.radioSelected) === item.userId) {
+ this.$refs.dataTable.toggleRowSelection(item)
+ }
+ })
+ });
+ } else {
+ this.selectUserList = this.selectValues;
+ this.$nextTick(() => {
+ this.$refs.dataTable.clearSelection();
+ this.selectUserList.forEach(key => {
+ this.userList.forEach(item => {
+ if (parseInt(key) === item.userId) {
+ this.$refs.dataTable.toggleRowSelection(item)
+ }
+ })
+ });
+ });
+ }
+
+ },
/** 鏌ヨ鐢ㄦ埛鍒楄〃 */
getList() {
this.loading = true;
@@ -229,7 +301,7 @@
},
// 鍗曢�夋閫変腑鏁版嵁
handleSingleUserSelect(selection) {
- this.radioSelected = selection.userId;//鐐瑰嚮褰撳墠琛屾椂,radio鍚屾牱鏈夐�変腑鏁堟灉
+ // this.radioSelected = selection.userId;//鐐瑰嚮褰撳墠琛屾椂,radio鍚屾牱鏈夐�変腑鏁堟灉
this.$emit('handleUserSelect', selection);
},
/** 鎼滅储鎸夐挳鎿嶄綔 */
--
Gitblit v1.8.0