Showing
5 changed files
with
35 additions
and
20 deletions
This diff is collapsed. Click to expand it.
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-11-01 10:18:53 | 2 | * @Date: 2023-11-01 10:18:53 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-11-22 17:29:49 | 4 | + * @LastEditTime: 2023-11-23 10:24:27 |
| 5 | * @FilePath: /vue-flow-editor/doc/selectUserView.vue | 5 | * @FilePath: /vue-flow-editor/doc/selectUserView.vue |
| 6 | * @Description: 成员列表选择控件 | 6 | * @Description: 成员列表选择控件 |
| 7 | --> | 7 | --> |
| ... | @@ -232,7 +232,8 @@ import _ from "lodash"; | ... | @@ -232,7 +232,8 @@ import _ from "lodash"; |
| 232 | import { ElNotification, ElMessage, ElMessageBox } from 'element-plus' | 232 | import { ElNotification, ElMessage, ElMessageBox } from 'element-plus' |
| 233 | 233 | ||
| 234 | const props = defineProps({ | 234 | const props = defineProps({ |
| 235 | - visible: Boolean | 235 | + visible: Boolean, |
| 236 | + list: Array, | ||
| 236 | }); | 237 | }); |
| 237 | const emit = defineEmits(["close", "confirm"]); | 238 | const emit = defineEmits(["close", "confirm"]); |
| 238 | 239 | ||
| ... | @@ -316,8 +317,6 @@ onMounted(async () => { | ... | @@ -316,8 +317,6 @@ onMounted(async () => { |
| 316 | message: role_list.data.msg, | 317 | message: role_list.data.msg, |
| 317 | }); | 318 | }); |
| 318 | } | 319 | } |
| 319 | - // TODO: 查询到的用户选中列表数据,等待接口数据 | ||
| 320 | - userTags.value = [{ id: 35697, name: "西园寺" },{ id: 492081, name: "营员" }]; | ||
| 321 | // Tabs菜单的完整数据结构 | 320 | // Tabs菜单的完整数据结构 |
| 322 | userTabs.value.forEach(item => { | 321 | userTabs.value.forEach(item => { |
| 323 | if (item.type === 'corp-tree') { | 322 | if (item.type === 'corp-tree') { |
| ... | @@ -330,17 +329,6 @@ onMounted(async () => { | ... | @@ -330,17 +329,6 @@ onMounted(async () => { |
| 330 | item.data = roleList.value; | 329 | item.data = roleList.value; |
| 331 | } | 330 | } |
| 332 | }); | 331 | }); |
| 333 | - // 第一项目是组织结构树,默认展开第一个节点 | ||
| 334 | - if (userTabs.value[activeTabIdx.value]['type'] === 'corp-tree') { | ||
| 335 | - if (userTabs.value[activeTabIdx.value]['data'].length) { | ||
| 336 | - // 默认展开第一个节点 | ||
| 337 | - defaultExpandedKeys.value = [userTabs.value[activeTabIdx.value]['data'][0]['id']]; | ||
| 338 | - // 把用户选中的节点注入树结构显示选中状态 | ||
| 339 | - nextTick(() => { | ||
| 340 | - currentCheckedNodeKey.value = userTags.value.map(ele => ele.id); | ||
| 341 | - }); | ||
| 342 | - } | ||
| 343 | - } | ||
| 344 | }); | 332 | }); |
| 345 | 333 | ||
| 346 | watch(() => { | 334 | watch(() => { |
| ... | @@ -369,6 +357,25 @@ watch( | ... | @@ -369,6 +357,25 @@ watch( |
| 369 | } | 357 | } |
| 370 | } | 358 | } |
| 371 | ); | 359 | ); |
| 360 | +watch( | ||
| 361 | + () => props.list, | ||
| 362 | + val => { | ||
| 363 | + if (val) { | ||
| 364 | + userTags.value = val; | ||
| 365 | + // 第一项目是组织结构树,默认展开第一个节点 | ||
| 366 | + if (userTabs.value[activeTabIdx.value]['type'] === 'corp-tree') { | ||
| 367 | + if (userTabs.value[activeTabIdx.value]['data'].length) { | ||
| 368 | + // 默认展开第一个节点 | ||
| 369 | + defaultExpandedKeys.value = [userTabs.value[activeTabIdx.value]['data'][0]['id']]; | ||
| 370 | + // 把用户选中的节点注入树结构显示选中状态 | ||
| 371 | + nextTick(() => { | ||
| 372 | + currentCheckedNodeKey.value = userTags.value.map(ele => ele.id); | ||
| 373 | + }); | ||
| 374 | + } | ||
| 375 | + } | ||
| 376 | + } | ||
| 377 | + } | ||
| 378 | +); | ||
| 372 | 379 | ||
| 373 | /** | 380 | /** |
| 374 | * 点击Tab切换回调 | 381 | * 点击Tab切换回调 | ... | ... |
| ... | @@ -26,9 +26,10 @@ | ... | @@ -26,9 +26,10 @@ |
| 26 | "@vue/composition-api": "^1.7.2", | 26 | "@vue/composition-api": "^1.7.2", |
| 27 | "axios": "^1.6.0", | 27 | "axios": "^1.6.0", |
| 28 | "echarts": "^5.1.2", | 28 | "echarts": "^5.1.2", |
| 29 | - "element-plus": "^2.4.1", | 29 | + "element-plus": "^2.4.2", |
| 30 | "jquery": "^3.7.1", | 30 | "jquery": "^3.7.1", |
| 31 | "lodash": "^4.17.21", | 31 | "lodash": "^4.17.21", |
| 32 | + "qs": "^6.11.2", | ||
| 32 | "sass": "^1.69.4", | 33 | "sass": "^1.69.4", |
| 33 | "sass-loader": "10.1.1", | 34 | "sass-loader": "10.1.1", |
| 34 | "uuid": "^9.0.1", | 35 | "uuid": "^9.0.1", | ... | ... |
yarn-error.log
0 → 100644
This diff could not be displayed because it is too large.
| ... | @@ -3787,10 +3787,10 @@ electron-to-chromium@^1.3.793: | ... | @@ -3787,10 +3787,10 @@ electron-to-chromium@^1.3.793: |
| 3787 | resolved "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.806.tgz?cache=0&sync_timestamp=1628906712766&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.806.tgz" | 3787 | resolved "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.806.tgz?cache=0&sync_timestamp=1628906712766&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.806.tgz" |
| 3788 | integrity sha1-IVAhAPEa6tbFAdHNfyUE8WyTZkI= | 3788 | integrity sha1-IVAhAPEa6tbFAdHNfyUE8WyTZkI= |
| 3789 | 3789 | ||
| 3790 | -element-plus@^2.4.1: | 3790 | +element-plus@^2.4.2: |
| 3791 | - version "2.4.1" | 3791 | + version "2.4.2" |
| 3792 | - resolved "https://mirrors.cloud.tencent.com/npm/element-plus/-/element-plus-2.4.1.tgz#8a5faa69e856d82494b94d77fb485d9e727c8bc1" | 3792 | + resolved "https://mirrors.cloud.tencent.com/npm/element-plus/-/element-plus-2.4.2.tgz#2a24632e0904ccd7bbbd64c269704f6b9969833c" |
| 3793 | - integrity sha512-t7nl+vQlkBKVk1Ag6AufSDyFV8YIXxTFsaya4Nz/0tiRlcz65WPN4WMFeNURuFJleu1HLNtP4YyQKMuS7El8uA== | 3793 | + integrity sha512-E/HwXX7JF1LPvQSjs0fZ8WblIoc0quoXsRXQZiL7QDq7xJdNGSUaXtdk7xiEv7axPmLfEFtxE5du9fFspDrmJw== |
| 3794 | dependencies: | 3794 | dependencies: |
| 3795 | "@ctrl/tinycolor" "^3.4.1" | 3795 | "@ctrl/tinycolor" "^3.4.1" |
| 3796 | "@element-plus/icons-vue" "^2.0.6" | 3796 | "@element-plus/icons-vue" "^2.0.6" |
| ... | @@ -7185,6 +7185,13 @@ qs@6.7.0: | ... | @@ -7185,6 +7185,13 @@ qs@6.7.0: |
| 7185 | resolved "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&sync_timestamp=1616385248556&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz" | 7185 | resolved "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&sync_timestamp=1616385248556&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz" |
| 7186 | integrity sha1-QdwaAV49WB8WIXdr4xr7KHapsbw= | 7186 | integrity sha1-QdwaAV49WB8WIXdr4xr7KHapsbw= |
| 7187 | 7187 | ||
| 7188 | +qs@^6.11.2: | ||
| 7189 | + version "6.11.2" | ||
| 7190 | + resolved "https://mirrors.cloud.tencent.com/npm/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" | ||
| 7191 | + integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== | ||
| 7192 | + dependencies: | ||
| 7193 | + side-channel "^1.0.4" | ||
| 7194 | + | ||
| 7188 | qs@~6.5.2: | 7195 | qs@~6.5.2: |
| 7189 | version "6.5.2" | 7196 | version "6.5.2" |
| 7190 | resolved "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&sync_timestamp=1616385248556&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz" | 7197 | resolved "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&sync_timestamp=1616385248556&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz" | ... | ... |
-
Please register or login to post a comment