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

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

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