fix(F006): 行业管理切到企业认证所属行业 type=5 + 放宽层级到5级
This commit is contained in:
parent
ef81427840
commit
83f80fd96c
@ -3,7 +3,7 @@
|
||||
* F006 行业/资讯分类 - 树形增删改完整版 (2026-08-18 从只读升级为可交付)
|
||||
*
|
||||
* 复用 CategoryGoodListView(商品分类) 树形 CRUD 范式 + 企业/用户列表新版 UI 标准
|
||||
* props.type: 1=行业 3=资讯分类 (保持现状数据源)
|
||||
* props.type: 5=行业(企业认证所属行业) 3=资讯分类
|
||||
*
|
||||
* 后端端点 (ApiCategoryController /other/category):
|
||||
* GET list?type= 平铺列表 (前端按 pid 组装树; categoryDeepPageList 返回平铺不组装, 勿用)
|
||||
@ -35,7 +35,7 @@ interface Category {
|
||||
}
|
||||
|
||||
const props = defineProps<{ type?: number; title?: string }>()
|
||||
const TITLES: Record<number, string> = { 1: '行业管理', 3: '资讯分类' }
|
||||
const TITLES: Record<number, string> = { 5: '行业管理', 3: '资讯分类' }
|
||||
const pageTitle = computed(() => props.title || TITLES[props.type ?? 1] || '分类管理')
|
||||
const catType = computed(() => props.type ?? 1)
|
||||
|
||||
@ -111,7 +111,7 @@ const editForm = reactive({ id: '', name: '', level: 1, pid: '0', sort: 0, statu
|
||||
|
||||
function onAdd(parent?: Category) {
|
||||
editMode.value = 'add'
|
||||
const lvl = parent ? Math.min(parent.level + 1, 3) : 1
|
||||
const lvl = parent ? Math.min(parent.level + 1, 5) : 1
|
||||
editForm.id = ''
|
||||
editForm.pid = parent?.id || '0'
|
||||
editForm.name = ''
|
||||
@ -233,7 +233,7 @@ onMounted(load)
|
||||
<TableActions
|
||||
:row="row"
|
||||
:actions="[
|
||||
{ label: '添加子级', type: 'primary', when: (r: any) => (r.level || 1) < 3, onClick: onAdd },
|
||||
{ label: '添加子级', type: 'primary', when: (r: any) => (r.level || 1) < 5, onClick: onAdd },
|
||||
{ label: '编辑', type: 'primary', onClick: onEdit },
|
||||
{ label: (r: any) => r.status === 0 ? '停用' : '启用', type: (r: any) => r.status === 0 ? 'warning' : 'success', onClick: toggleStatus },
|
||||
{ label: '删除', type: 'danger', divided: true, onClick: onDelete }
|
||||
|
||||
@ -216,7 +216,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{ path: '/sys/operation/association', component: () => import('@/modules/sys/operation/OperationListView.vue'), props: () => ({ type: 4 }), meta: { title: '行业协会运营' } },
|
||||
// 3 个资讯类 (P1: information -> 真 view, industry/categoryZX 404 保留 mock)
|
||||
{ path: '/other/information', component: () => import('@/modules/other/information/InformationListView.vue'), meta: { title: '资讯列表' } },
|
||||
{ path: '/other/industry', component: () => import('@/modules/other/category/CategoryDeepListView.vue'), props: { type: 1, title: '行业管理' }, meta: { title: '行业' } },
|
||||
{ path: '/other/industry', component: () => import('@/modules/other/category/CategoryDeepListView.vue'), props: { type: 5, title: '行业管理' }, meta: { title: '行业' } },
|
||||
{ path: '/other/category/zx', component: () => import('@/modules/other/category/CategoryDeepListView.vue'), props: { type: 3, title: '资讯分类' }, meta: { title: '资讯分类' } },
|
||||
// devtools 5 个
|
||||
{ path: '/devtools/baseclass', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'devtools-baseclass' }), meta: { title: '基类配置' } },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user