pull/1/head
dt_2916866708 11 months ago
parent 6a42423cfb
commit 0f3a7b72d6
  1. 7
      src/api/product/productAttr.js
  2. 3
      src/components/Category/edit.vue
  3. 5
      src/permission.js
  4. 4
      src/store/modules/permission.js
  5. 14
      src/views/product/productClassify/index.vue

@ -8,6 +8,13 @@ export default {
data: page
})
},
classifyUpdate(page) {
return request({
url: `/${service_name}/mallProductClassification/update`,
method: 'post',
data: page
})
},
classifyGetByPage(page) { // 分页查询
return request({
url: `/${service_name}/mallProductClassification/getByPage`,

@ -43,6 +43,7 @@ export default {
},
data() {
return {
model:"add",
loadingBtn: false,
constants: [],
editPram: {
@ -83,7 +84,7 @@ export default {
addTreeListLabelForCasCard(arr, child) {
},
handlerSubmit() {
productApi.classifySave(this.editPram,).then((result) => {
productApi[this.model](this.editPram).then((result) => {
if(result.code==20000){
this.$parent.$parent.editDialogConfig.visible=false;
this.$message.success("添加成功!");

@ -35,8 +35,9 @@ router.beforeEach(async (to, from, next) => {
} else {
try {
await store.dispatch('user/getInfo')
const accessRoutes = await store.dispatch('permission/generateRoutes')
router.addRoutes(accessRoutes)
const accessRoutes = await store.dispatch('permission/generateRoutes');
console.log(accessRoutes,"routerrouterrouter")
router.addRoutes(accessRoutes);
next({ ...to, replace: true })
} catch (error) {
await store.dispatch('user/resetToken')

@ -41,8 +41,8 @@ const actions = {
return new Promise(resolve => {
// 向后端请求路由数据
getRouters().then(res => {
const accessedRoutes = filterAsyncRouter([]||res.data)
accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
const accessedRoutes = filterAsyncRouter(res.data);
accessedRoutes.push({ path: '*', redirect: '/404', hidden: true });
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
})

@ -52,7 +52,9 @@
<el-dropdown>
<el-button type=text>设置<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click="edit(scope.row)">编辑</el-dropdown-item>
<el-dropdown-item >
<span @click="edit(scope.row)">编辑</span>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.level == 1">
<span @click="addClass(scope.row)">新增下级</span>
</el-dropdown-item>
@ -147,6 +149,7 @@ export default {
//
addClass(parent = null) {
this.editDialogConfig.visible = true;
this.$refs.edit.model = "classifySave";
// this.$nextTick(()=>{
// this.$refs.edit.parent = parent;
// });
@ -159,14 +162,15 @@ export default {
},
//
edit(row) {
console.log(row.level);
this.editDialogConfig.visible = true;
this.$nextTick(()=>{
let { level, icon, showFlag, categoryName, sort, parentId } = row;
let { level, icon, showFlag, categoryName, sort, parentId,id } = row;
console.log(this.tableData.find(item=>item==parentId),"categoryName")
if (row.level == 1) {
this.$refs.edit.editPram = Object.assign(this.$refs.edit.editPram, { level, icon, showFlag, categoryName, sort, parentId })
this.$refs.edit.model = "classifyUpdate";
this.$refs.edit.editPram = Object.assign(this.$refs.edit.editPram, { level, icon, showFlag, categoryName, sort, parentId,id })
} else {
this.$refs.edit.editPram = Object.assign(this.$refs.edit.editPram, { level, icon, showFlag,parentCategoryName:this.tableData.find(item=>item==parentId).categoryName, categoryName, sort, parentId })
this.$refs.edit.editPram = Object.assign(this.$refs.edit.editPram, { level, icon, showFlag,parentCategoryName:this.tableData.find(item=>item==parentId).categoryName, categoryName, sort, parentId,id })
}
})
},

Loading…
Cancel
Save