提交 342c8b96 authored 作者: 王鹏飞's avatar 王鹏飞

内容管理列表增加类型选择

上级 f6529389
......@@ -117,9 +117,14 @@ export default {
hasDelete() {
return this.permissions.includes('content-function-advert-delete')
},
// 项目列表
projectList() {
return this.$store.state.user.projects
},
// 类型列表
typeList() {
return this.$store.state.app.typeList
},
drawTitle() {
if (this.drawFormOptions.type === 'create') return '新建广告'
else if (this.drawFormOptions.type === 'edit') return '编辑广告'
......@@ -299,6 +304,9 @@ export default {
}
})
}
},
beforeMount() {
this.$store.dispatch('app/getTypeList', 2)
}
}
</script>
......
......@@ -110,9 +110,14 @@ export default {
hasDelete() {
return this.permissions.includes('content-function-acticle-delete')
},
// 项目列表
projectList() {
return this.$store.state.user.projects
},
// 类型列表
typeList() {
return this.$store.state.app.typeList
},
drawTitle() {
if (this.drawFormOptions.type === 'create') return '新建文章'
else if (this.drawFormOptions.type === 'edit') return '编辑文章'
......@@ -293,6 +298,9 @@ export default {
}
})
}
},
beforeMount() {
this.$store.dispatch('app/getTypeList', 1)
}
}
</script>
......
......@@ -97,9 +97,14 @@ export default {
hasDelete() {
return this.permissions.includes('content-function-imgtext-delete')
},
// 项目列表
projectList() {
return this.$store.state.user.projects
},
// 类型列表
typeList() {
return this.$store.state.app.typeList
},
drawTitle() {
const type = this.drawFormOptions.type
if (type === 'create') return '新建图文'
......@@ -258,6 +263,9 @@ export default {
}
})
}
},
beforeMount() {
this.$store.dispatch('app/getTypeList', 3)
}
}
</script>
......
import Cookies from 'js-cookie'
import { getProjectContentTypeList } from '@/api/contentManage'
const state = {
sidebar: {
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
withoutAnimation: false
}
},
typeList: []
}
const mutations = {
......@@ -16,12 +18,22 @@ const mutations = {
} else {
Cookies.set('sidebarStatus', 0)
}
},
SET_TYPELIST: (state, list) => {
console.log(list)
state.typeList = list
}
}
const actions = {
toggleSideBar({ commit }) {
commit('TOGGLE_SIDEBAR')
},
getTypeList({ commit }, type, id) {
getProjectContentTypeList(type, id).then(res => {
const data = res.data
commit('SET_TYPELIST', data)
})
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论