diff --git a/buyer/docker.sh b/buyer/docker.sh index e5bdb92f..eb7d259c 100644 --- a/buyer/docker.sh +++ b/buyer/docker.sh @@ -1 +1 @@ -docker build -t registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui-1.0.1:0.0.4 . +docker build -t registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui-4.2.0:0.0.2 . diff --git a/docker-push.sh b/docker-push.sh index 3eb4f674..92b4c75a 100644 --- a/docker-push.sh +++ b/docker-push.sh @@ -1,5 +1,5 @@ -docker push registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui-1.0.1:0.0.4 -docker push registry.cn-beijing.aliyuncs.com/lili-images/wap-ui-1.0.1:0.0.4 -docker push registry.cn-beijing.aliyuncs.com/lili-images/seller-ui-1.0.1:0.0.4 -docker push registry.cn-beijing.aliyuncs.com/lili-images/manager-ui-1.0.1:0.0.4 +docker push registry.cn-beijing.aliyuncs.com/lili-images/buyer-ui-4.2.0:0.0.2 +docker push registry.cn-beijing.aliyuncs.com/lili-images/wap-ui-4.2.0:0.0.2 +docker push registry.cn-beijing.aliyuncs.com/lili-images/seller-ui-4.2.0:0.0.2 +docker push registry.cn-beijing.aliyuncs.com/lili-images/manager-ui-4.2.0:0.0.2 diff --git a/manager/docker.sh b/manager/docker.sh index 5fec3b61..2df364bc 100644 --- a/manager/docker.sh +++ b/manager/docker.sh @@ -1 +1 @@ -docker build -t registry.cn-beijing.aliyuncs.com/lili-images/manager-ui-1.0.1:0.0.4 . +docker build -t registry.cn-beijing.aliyuncs.com/lili-images/manager-ui-4.2.0:0.0.2 . diff --git a/manager/src/views/goods/goods-manage/category.vue b/manager/src/views/goods/goods-manage/category.vue index deacb087..144de5d4 100644 --- a/manager/src/views/goods/goods-manage/category.vue +++ b/manager/src/views/goods/goods-manage/category.vue @@ -2,13 +2,8 @@
- 选择分类: - -
- + - +
@@ -132,19 +127,17 @@ import { saveCategorySpec, getCategoryTree, } from "@/api/goods"; -import TreeTable from "@/views/my-components/tree-table/Table/Table"; + import uploadPicInput from "@/views/my-components/lili/upload-pic-input"; export default { name: "lili-components", components: { - TreeTable, uploadPicInput, }, data() { return { categoryList: [], // 分类列表 - sortCateList: [], //筛选出分类第一级 sortCate: "", //筛选的数据 loading: false, // 加载状态 selectCount: 0, // 选择数量 @@ -184,47 +177,44 @@ export default { { title: "分类名称", key: "name", - minWidth: "120px", + tree: true, }, { title: "状态", key: "deleteFlag", - headerAlign: "center", - type: "template", - template: "deleteFlag", + + slot: "deleteFlag", }, { - title: "佣金(%)", + title: "佣金", key: "commissionRate", - headerAlign: "center", - type: "template", - template: "commissionRate", + + slot: "commissionRate", }, { fixed: "right", title: "操作", key: "action", - align: "left", - headerAlign: "center", - type: "template", - template: "action", + + slot: "action", }, ], tableData: [], categoryIndex: 0, + checkedCategoryChildren: "", //选中的分类子级 }; }, methods: { - changeSortCate(val) { - let way = this.categoryList.find((item, index) => { - if (item.name == val) { - this.categoryIndex = index; - console.log((this.categoryIndex = index)); - return item.name == val; - } - }); - this.tableData = [way]; - }, + // changeSortCate(val) { + // let way = this.categoryList.find((item, index) => { + // if (item.name == val) { + // this.categoryIndex = index; + // console.log((this.categoryIndex = index)); + // return item.name == val; + // } + // }); + // this.tableData = [way]; + // }, init() { this.getAllList(0); this.getBrandList(); @@ -240,7 +230,6 @@ export default { getSpecList() { getSpecificationList().then((res) => { if (res.length != 0) { - this.specifications = res; } }); @@ -379,26 +368,64 @@ export default { }, }); }, + + // 异步手动加载分类名称 + handleLoadData(item, callback) { + console.warn(item); + if (item.level == 0) { + let categoryList = JSON.parse(JSON.stringify(this.categoryList)); + categoryList.forEach((val) => { + if (val.id == item.id) { + val.children.map((child) => { + child._loading = false; + child.children = []; + }); + // 模拟加载 + setTimeout(() => { + callback(val.children); + }, 1000); + } + }); + } else { + this.deepCategoryChildren(item.id, this.categoryList); + console.log(this.checkedCategoryChildren); + setTimeout(() => { + callback(this.checkedCategoryChildren); + }, 1000); + } + }, + + // 通过递归children来实现手动加载数据 + deepCategoryChildren(id, list) { + if (id != "0" && list.length != 0) { + for (let i = 0; i < list.length; i++) { + let item = list[i]; + if (item.id == id) { + this.checkedCategoryChildren = item.children; + return; + } else { + this.deepCategoryChildren(id, item.children); + } + } + } + }, + getAllList(parent_id) { - this.sortCateList = []; this.loading = true; getCategoryTree(parent_id).then((res) => { this.loading = false; if (res.success) { localStorage.setItem("category", JSON.stringify(res.result)); - res.result.forEach((e, index, arr) => { - this.sortCateList.push({ - label: e.name, - value: e.name, - }); - this.sortCate = arr[0].name; + this.categoryList = JSON.parse(JSON.stringify(res.result)); + this.tableData = res.result.map((item) => { + if (item.children.length != 0) { + item.children = []; + item._loading = false; + } + return item; }); - this.categoryList = res.result; - - this.$nextTick(() => { - this.$set(this, "tableData", [res.result[this.categoryIndex]]); - }); + console.log(this.tableData); } }); }, diff --git a/manager/src/views/lili-dialog/template/pages.vue b/manager/src/views/lili-dialog/template/pages.vue index 8a151a3f..659b83cf 100644 --- a/manager/src/views/lili-dialog/template/pages.vue +++ b/manager/src/views/lili-dialog/template/pages.vue @@ -1,10 +1,11 @@