Commit b5334e6d authored by lijin's avatar lijin

增加标题组管理页面

parent 77df13d1
import axios from 'axios'
// 获取所有标题组
export function getTitleGroupList() {
return axios.get(process.env.PUTIN_API + '/title-groups')
.then(response => {
return response.data
})
}
// 获取单个标题组
export function getTitleGroupById(id) {
return axios.get(`${process.env.PUTIN_API}/title-groups/${id}`)
.then(response => {
return response.data
})
}
// 创建标题组
export function createTitleGroup(data) {
return axios.post(`${process.env.PUTIN_API}/title-groups`, data)
.then(response => {
return response.data
})
}
// 更新标题组
export function updateTitleGroup(id, data) {
return axios.put(`${process.env.PUTIN_API}/title-groups/${id}`, data)
.then(response => {
return response.data
})
}
// 删除标题组
export function deleteTitleGroup(id) {
return axios.delete(`${process.env.PUTIN_API}/title-groups/${id}`)
.then(response => {
return response.data
})
}
...@@ -48,9 +48,14 @@ export default { ...@@ -48,9 +48,14 @@ export default {
async fetchOptions() { async fetchOptions() {
try { try {
const response = await axios.get(process.env.PUTIN_API + '/location-groups') const response = await axios.get(process.env.PUTIN_API + '/location-groups')
this.options = response.data if (response.data.status === 200) {
this.options = response.data.result.data
} else {
this.$message.error('获取地域组失败')
}
} catch (error) { } catch (error) {
console.error('Failed to fetch location groups:', error) console.error('Failed to fetch location groups:', error)
this.$message.error('获取地域组失败:' + error.message)
} }
}, },
handleChange(values) { handleChange(values) {
......
...@@ -48,7 +48,11 @@ export default { ...@@ -48,7 +48,11 @@ export default {
async fetchOptions() { async fetchOptions() {
try { try {
const response = await axios.get(process.env.PUTIN_API + '/title-groups') const response = await axios.get(process.env.PUTIN_API + '/title-groups')
this.options = response.data if (response.data.status === 200) {
this.options = response.data.result.data || []
} else {
console.error('Failed to fetch title groups: API returned non-200 status')
}
} catch (error) { } catch (error) {
console.error('Failed to fetch title groups:', error) console.error('Failed to fetch title groups:', error)
} }
......
This diff is collapsed.
...@@ -138,6 +138,12 @@ export const constantRouterMap = [ ...@@ -138,6 +138,12 @@ export const constantRouterMap = [
component: () => import('@/views/locationGroup/LocationGroupManage'), component: () => import('@/views/locationGroup/LocationGroupManage'),
meta: { title: '地域组管理' } meta: { title: '地域组管理' }
}, },
{
path: '/assetManagement/title-group',
name: 'assetManagement.title-group',
component: () => import('@/views/titleGroup/TitleGroupManage'),
meta: { title: '标题组管理' }
},
] ]
}, },
......
...@@ -337,9 +337,9 @@ export default { ...@@ -337,9 +337,9 @@ export default {
]) ])
app.data.forEach(item => this.groupNameMaps.app.set(item.id, item.name)) app.data.forEach(item => this.groupNameMaps.app.set(item.id, item.name))
location.data.forEach(item => this.groupNameMaps.location.set(item.id, item.name)) location.data.result.data.forEach(item => this.groupNameMaps.location.set(item.id, item.name))
material.data.forEach(item => this.groupNameMaps.material.set(item.id, item.name)) material.data.forEach(item => this.groupNameMaps.material.set(item.id, item.name))
title.data.forEach(item => this.groupNameMaps.title.set(item.id, item.name)) title.data.result.data.forEach(item => this.groupNameMaps.title.set(item.id, item.name))
description.data.forEach(item => this.groupNameMaps.description.set(item.id, item.name)) description.data.forEach(item => this.groupNameMaps.description.set(item.id, item.name))
} catch (error) { } catch (error) {
console.error('获取组名称失败:', error) console.error('获取组名称失败:', error)
......
...@@ -316,7 +316,7 @@ export default { ...@@ -316,7 +316,7 @@ export default {
menuCode: "game.Overview,android", menuCode: "game.Overview,android",
}; };
const response = await getSelectApps(params); const response = await getSelectApps(params);
if (response && response.result) { if (response.status === 200) {
this.selectApps = response.result.data || []; this.selectApps = response.result.data || [];
} }
} catch (error) { } catch (error) {
...@@ -340,6 +340,7 @@ export default { ...@@ -340,6 +340,7 @@ export default {
}; };
const response = await getBusinText(params); const response = await getBusinText(params);
if (response && response.result) { if (response && response.result) {
this.tableData = response.result.data.content || []; this.tableData = response.result.data.content || [];
this.total = response.result.data.total || 0; this.total = response.result.data.total || 0;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<el-menu-item index="/assetManagement/app-group">产品组管理</el-menu-item> <el-menu-item index="/assetManagement/app-group">产品组管理</el-menu-item>
<el-menu-item index="/assetManagement/location-group">地域组管理</el-menu-item> <el-menu-item index="/assetManagement/location-group">地域组管理</el-menu-item>
<el-menu-item index="/assetManagement/createDelivery">素材组</el-menu-item> <el-menu-item index="/assetManagement/createDelivery">素材组</el-menu-item>
<el-menu-item index="/assetManagement/createDelivery">标题组</el-menu-item> <el-menu-item index="/assetManagement/title-group">标题组管理</el-menu-item>
<el-menu-item index="/assetManagement/createDelivery">描述组</el-menu-item> <el-menu-item index="/assetManagement/createDelivery">描述组</el-menu-item>
</el-submenu> </el-submenu>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment