Files
Web_BAI_Manage_ApiServer/front-end/mock/controller/dictionaryManagement.js
XuJiacheng 9a387f3eec feat: 初始化项目结构并添加基础配置
添加前后端基础项目结构,包括.gitignore、package.json等配置文件
实现前端基础功能模块,包括路由、状态管理、API请求封装等
添加前端UI组件库和样式体系
配置开发环境Mock系统和构建工具链
2026-03-18 14:03:35 +08:00

115 lines
3.1 KiB
JavaScript

module.exports = [
{
url: '/dictionaryManagement/getTree',
type: 'get',
response() {
return {
code: 200,
msg: 'success',
data: {
total: 999,
list: [
{
id: 'root',
key: 'root',
label: '全部字典',
children: [
{
id: '@id',
key: 'sex',
label: '性别',
},
{
id: '@id',
key: 'type',
label: '类型',
},
],
},
],
},
}
},
},
{
url: '/dictionaryManagement/getList',
type: 'get',
response: (config) => {
const { key, parentKey } = config.query
const list1 = [
{
parentKey: 'sex',
id: '@id',
lable: '性别',
key: '1',
value: '男',
},
{
parentKey: 'sex',
id: '@id',
lable: '性别',
key: '2',
value: '女',
},
]
const list2 = [
{
parentKey: 'type',
id: '@id',
lable: '类型',
key: '1',
value: '新闻',
},
{
parentKey: 'type',
id: '@id',
lable: '类型',
key: '2',
value: '知识',
},
]
if (parentKey) {
return {
code: 200,
msg: 'success',
data: {
list: parentKey === 'sex' ? list1 : list2,
},
}
}
return {
code: 200,
msg: 'success',
data: {
list:
!key || key === 'root'
? []
: key === 'sex'
? list1
: list2,
},
}
},
},
{
url: '/dictionaryManagement/doEdit',
type: 'post',
response: () => {
return {
code: 200,
msg: '模拟保存成功',
}
},
},
{
url: '/dictionaryManagement/doDelete',
type: 'post',
response: () => {
return {
code: 200,
msg: '模拟删除成功',
}
},
},
]