From a1fb7d5473505c08cd0a20f68d3007c6efd383ff Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期五, 10 十一月 2023 13:40:46 +0800
Subject: [PATCH] 油烟
---
src/views/operate/fivepack/threepack/components/updateUser/index.vue | 66 ++++++++++++++++-----------------
1 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/src/views/operate/fivepack/threepack/components/updateUser/index.vue b/src/views/operate/fivepack/threepack/components/updateUser/index.vue
index 4bf856b..2717eb6 100644
--- a/src/views/operate/fivepack/threepack/components/updateUser/index.vue
+++ b/src/views/operate/fivepack/threepack/components/updateUser/index.vue
@@ -206,15 +206,22 @@
const result = await getVideoPoint({ current: 1, size: 1000 });
this.relationVideoList = result.records;
- if (this.storeInfo) {
- this.$set(this, "store", this.storeInfo);
- if (this.storeInfo && this.isStorePage) {
- this.store.relationVideo = this.store.videoPoint.name;
- }
- }
-
if (!this.isView()) {
await this.getShopTypeList();
+ }
+
+ if (this.storeInfo) {
+ this.$set(this, "store", this.storeInfo);
+ if (this.storeInfo && this.isStorePage && this.store.videoPoint) {
+ this.store.relationVideo = this.store.videoPoint.name;
+ }
+
+ const selectedStoreType = this.getSelectedStoreType(this.shopTypeList);
+
+ this.$set(this.store, "type", [
+ selectedStoreType.parentId,
+ selectedStoreType.id,
+ ]);
}
},
@@ -243,20 +250,6 @@
}
});
},
-
- async created() {
- if (this.storeInfo) {
- this.$set(this, 'store', this.storeInfo);
- const result = await getVideoPoint({ current: 1, size: 100 });
- this.relationVideoList = result.records;
- if (this.storeInfo && this.isStorePage) {
- this.store.relationVideo = this.store.videoPoint.name;
- }
- if (!this.isView()) {
- await this.getShopTypeList();
- }
- }
- },
isView() {
return this.dialogType === "view";
@@ -270,16 +263,6 @@
async getShopTypeList() {
let arr = await getCodeList("16");
this.shopTypeList = this.createShopTypeTree(arr);
-
- if (this.dialogType === "update") {
- const selectedStoreType = arr.find(
- (item) => item.name === this.store.typeName
- );
- this.$set(this.store, "type", [
- selectedStoreType.parentId,
- selectedStoreType.id,
- ]);
- }
},
// 鍒涘缓鍟嗛摵绫诲瀷鏍�
@@ -303,6 +286,21 @@
return treeRoot;
}
},
+ getSelectedStoreType(shopTypeList) {
+ let selectedItem = null;
+ shopTypeList.forEach((item) => {
+
+ if (item.name === this.store.typeName) {
+ selectedItem = item;
+ } else if (item.children) {
+ let selected = this.getSelectedStoreType(item.children);
+ if (selected) {
+ selectedItem = selected;
+ }
+ }
+ });
+ return selectedItem;
+ },
},
beforeDestroy() {
@@ -314,12 +312,12 @@
<style lang="scss" scoped>
.updateUser {
border-radius: 1px;
- background-color: #09152f;
+ // background-color: #09152f;
main {
text-align: left;
padding: 0 55px;
- background-color: #09152f;
+ background-color: #ffffff;
.mainContent {
display: flex;
@@ -364,7 +362,7 @@
}
.updateUser::v-deep .el-input__inner {
- background-color: #09152f;
+ // background-color: #09152f;
border: 1px solid #17324c;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0