diff --git a/view/catch-admin/docs/add-page-loading-animate.md b/view/catch-admin/docs/add-page-loading-animate.md deleted file mode 100644 index dfe4919..0000000 --- a/view/catch-admin/docs/add-page-loading-animate.md +++ /dev/null @@ -1,31 +0,0 @@ -为首屏增加 加载动画 -==== - - - -## 需求 - -> 为了缓解用户第一次访问时,加载 JS 过大所导致用户等待白屏时间过长导致的用户体验不好,进行的一个优化动效。 - - - -## 实现方案 - -1. 将 动画加载 dom 元素放在 #app 内,Vue 生命周期开始时,会自动清掉 #app 下的所有元素。 -2. 将 动画加载 dom 元素放在 body 下,Vue 生命周期开始时 App.vue (created, mounted) 调用 `@/utils/utll` 下的 removeLoadingAnimate(#id, timeout) 则会移除加载动画 - -最后一步: -​ 将样式插入到 `public/index.html` 文件的 `` 最好写成内联 `` - - - ----- - -目前提供有两个样式,均在 `public/loading` 文件夹内。且 pro 已经默认使用了一套 loading 动画方案,可以直接参考 `public/index.html` - - -## 写在最后 - -目前 pro 有页面 overflow 显示出浏览器滚动条时,页面会抖动一下的问题。 - -欢迎各位提供能解决的方案和实现 demo。如果在条件允许的情况下,建议请直接使用 pro 进行改造,也欢迎直接 PR 到 pro 的仓库 diff --git a/view/catch-admin/docs/load-on-demand.md b/view/catch-admin/docs/load-on-demand.md deleted file mode 100644 index c920caa..0000000 --- a/view/catch-admin/docs/load-on-demand.md +++ /dev/null @@ -1,95 +0,0 @@ -按需加载 减小打包 -==== - - - -## 按需引入组件依赖 - -`Ant Design Pro Vue` 默认编码工作并不支持按需引入,不过可以通过以下操作结合 [Ant Design Of Vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/) 官方文档来进行按需引入。 - -- 增加项目按需引入依赖 -- 修改引入组件方式 - - - -1. 增加按需引入所需依赖 `babel-plugin-import` -并且修改文件 `babel.config.js` - ```ecmascript 6 - module.exports = { - presets: [ - '@vue/app' - ], - plugins: [ - [ "import", { - "libraryName": "ant-design-vue", - "libraryDirectory": "es", - "style": "css" - } ] - ] - } - ``` - - -2. 修改引入组件方式 (注意,这只是一个例子,请完整引入你所需要的组件) - - 文件 `@/core/lazy_lib/component_use.js` - - ```javascript - import Vue from 'vue' - import { - Input, - Button, - Select, - Card, - Form, - Row, - Col, - Modal, - Table, - notification - } from 'ant-design-vue' - - Vue.use(Input) - Vue.use(Button) - Vue.use(Select) - Vue.use(Card) - Vue.use(Form) - Vue.use(Row) - Vue.use(Col) - Vue.use(Modal) - Vue.use(Table) - Vue.use(notification) - - Vue.prototype.$notification = notification; - ``` - - -3. 最后在 `main.js` 中引入 `@/core/lazy_use.js` 文件即可,如下 - - ```javascript - - import Vue from 'vue' - import App from './App' - - // 引入 按需组件的统一引入文件 - import './core/lazy_use' - - import './style/index.less' - - - Vue.config.productionTip = false - - new Vue({ - render: h => h(App), - }).$mount('#app') - - ``` - - - -## 其他 减少打包大小 - - - -1. Ant Design Vue 1.2.x 版本起,采用的 ant-design 官方方案 svg Icon 组件,整个项目打包会变大很多,图标进行按需加载可参考 https://github.com/HeskeyBaozi/reduce-antd-icons-bundle-demo -2. moment 按需加载 可参考 https://github.com/jmblog/how-to-optimize-momentjs-with-webpack diff --git a/view/catch-admin/docs/multi-tabs.md b/view/catch-admin/docs/multi-tabs.md deleted file mode 100644 index 94032f0..0000000 --- a/view/catch-admin/docs/multi-tabs.md +++ /dev/null @@ -1,28 +0,0 @@ -多(页签)标签 模式 -==== - - -## 让框架支持打开的页面增加多标签,可随时切换 - -### 关于如何移除该功能 组件 - 1. 移除 `/src/layouts/BasicLayout.vue` L44, L69, L80 - ```vue - // L44 - - - // L69 - import MultiTab from '@/components/MultiTab' - - // L80 - MultiTab, - ``` - 2. 移除 `/src/config/defaultSettings.js` L25 - - 3. 移除 `src/store/modules/app.js` L27, L76-L79, L118-L120 - - 4. 移除 `src/utils/mixin.js` L21 - - 5. 删除组件目录 `src/components/MultiTab` - -> 以上 `L x` 均代表行N ,如 L3 = 行3 - diff --git a/view/catch-admin/docs/webpack-bundle-analyzer.md b/view/catch-admin/docs/webpack-bundle-analyzer.md deleted file mode 100644 index c313767..0000000 --- a/view/catch-admin/docs/webpack-bundle-analyzer.md +++ /dev/null @@ -1,40 +0,0 @@ -先增加依赖 - -```bash -// npm -$ npm install --save-dev webpack-bundle-analyzer - -// or yarn -$ yarn add webpack-bundle-analyzer -D -``` - -配置文件 `vue.config.js` 增加 `configureWebpack.plugins` 参数 - -``` -const path = require('path') -const webpack = require('webpack') -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin - -function resolve (dir) { - return path.join(__dirname, dir) -} - -// vue.config.js -module.exports = { - configureWebpack: { - plugins: [ - // Ignore all locale files of moment.js - new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), - // 依赖大小分析工具 - new BundleAnalyzerPlugin(), - ] - }, - - - ... -} -``` - - - -启动 `cli` 的 `build` 命令进行项目编译,编译完成时,会自动运行一个 http://localhost:8888 的地址,完整显示了支持库依赖 \ No newline at end of file diff --git a/view/catch-admin/src/mock/index.js b/view/catch-admin/src/mock/index.js deleted file mode 100644 index 3ce8fdf..0000000 --- a/view/catch-admin/src/mock/index.js +++ /dev/null @@ -1,23 +0,0 @@ -import { isIE } from '@/utils/util' - -// 判断环境不是 prod 或者 preview 是 true 时,加载 mock 服务 -if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_PREVIEW === 'true') { - if (isIE()) { - console.error('ERROR: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.') - } - // 使用同步加载依赖 - // 防止 vuex 中的 GetInfo 早于 mock 运行,导致无法 mock 请求返回结果 - console.log('mock mounting') - const Mock = require('mockjs2') - require('./services/auth') - require('./services/user') - require('./services/manage') - require('./services/other') - require('./services/tagCloud') - require('./services/article') - - Mock.setup({ - timeout: 800 // setter delay time - }) - console.log('mock mounted') -} diff --git a/view/catch-admin/src/mock/services/article.js b/view/catch-admin/src/mock/services/article.js deleted file mode 100644 index 57199ef..0000000 --- a/view/catch-admin/src/mock/services/article.js +++ /dev/null @@ -1,89 +0,0 @@ -import Mock from 'mockjs2' -import { builder, getQueryParameters } from '../util' - -const titles = [ - 'Alipay', - 'Angular', - 'Ant Design', - 'Ant Design Pro', - 'Bootstrap', - 'React', - 'Vue', - 'Webpack' -] - -const avatar = ['https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', - 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', - 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', - 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', - 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png' -] - -const covers = [ - 'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png', - 'https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png', - 'https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png', - 'https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png' -] - -const owner = [ - '付小小', - '吴加好', - '周星星', - '林东东', - '曲丽丽' -] - -const content = '段落示意:蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。' -const description = '在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。' -const href = 'https://ant.design' - -const article = (options) => { - const queryParameters = getQueryParameters(options) - console.log('queryParameters', queryParameters) - if (queryParameters && !queryParameters.count) { - queryParameters.count = 5 - } - const data = [] - for (let i = 0; i < queryParameters.count; i++) { - const tmpKey = i + 1 - const num = parseInt(Math.random() * (4 + 1), 10) - data.push({ - id: tmpKey, - avatar: avatar[num], - owner: owner[num], - content: content, - star: Mock.mock('@integer(1, 999)'), - percent: Mock.mock('@integer(1, 999)'), - like: Mock.mock('@integer(1, 999)'), - message: Mock.mock('@integer(1, 999)'), - description: description, - href: href, - title: titles[ i % 8 ], - updatedAt: Mock.mock('@datetime'), - members: [ - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png', - name: '曲丽丽', - id: 'member1' - }, - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png', - name: '王昭君', - id: 'member2' - }, - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png', - name: '董娜娜', - id: 'member3' - } - ], - activeUser: Math.ceil(Math.random() * 100000) + 100000, - newUser: Math.ceil(Math.random() * 1000) + 1000, - cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)] - }) - } - return builder(data) -} - -Mock.mock(/\/list\/article/, 'get', article) diff --git a/view/catch-admin/src/mock/services/auth.js b/view/catch-admin/src/mock/services/auth.js deleted file mode 100644 index 25637c2..0000000 --- a/view/catch-admin/src/mock/services/auth.js +++ /dev/null @@ -1,50 +0,0 @@ -import Mock from 'mockjs2' -import { builder, getBody } from '../util' - -const username = ['admin', 'super'] -// 强硬要求 ant.design 相同密码 -// '21232f297a57a5a743894a0e4a801fc3', -const password = ['8914de686ab28dc22f30d3d8e107ff6c'] // admin, ant.design - -const login = (options) => { - const body = getBody(options) - console.log('mock: body', body) - if (!username.includes(body.username) || !password.includes(body.password)) { - return builder({ isLogin: true }, '账户或密码错误', 401) - } - - return builder({ - 'id': Mock.mock('@guid'), - 'name': Mock.mock('@name'), - 'username': 'admin', - 'password': '', - 'avatar': 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png', - 'status': 1, - 'telephone': '', - 'lastLoginIp': '27.154.74.117', - 'lastLoginTime': 1534837621348, - 'creatorId': 'admin', - 'createTime': 1497160610259, - 'deleted': 0, - 'roleId': 'admin', - 'lang': 'zh-CN', - 'token': '4291d7da9005377ec9aec4a71ea837f' - }, '', 200, { 'Custom-Header': Mock.mock('@guid') }) -} - -const logout = () => { - return builder({}, '[测试接口] 注销成功') -} - -const smsCaptcha = () => { - return builder({ captcha: Mock.mock('@integer(10000, 99999)') }) -} - -const twofactor = () => { - return builder({ stepCode: Mock.mock('@integer(0, 1)') }) -} - -Mock.mock(/\/auth\/login/, 'post', login) -Mock.mock(/\/auth\/logout/, 'post', logout) -Mock.mock(/\/account\/sms/, 'post', smsCaptcha) -Mock.mock(/\/auth\/2step-code/, 'post', twofactor) diff --git a/view/catch-admin/src/mock/services/manage.js b/view/catch-admin/src/mock/services/manage.js deleted file mode 100644 index 10181ec..0000000 --- a/view/catch-admin/src/mock/services/manage.js +++ /dev/null @@ -1,252 +0,0 @@ -import Mock from 'mockjs2' -import { builder, getQueryParameters } from '../util' - -const totalCount = 5701 - -const serverList = (options) => { - const parameters = getQueryParameters(options) - - const result = [] - const pageNo = parseInt(parameters.pageNo) - const pageSize = parseInt(parameters.pageSize) - const totalPage = Math.ceil(totalCount / pageSize) - const key = (pageNo - 1) * pageSize - const next = (pageNo >= totalPage ? (totalCount % pageSize) : pageSize) + 1 - - for (let i = 1; i < next; i++) { - const tmpKey = key + i - result.push({ - key: tmpKey, - id: tmpKey, - no: 'No ' + tmpKey, - description: '这是一段描述', - callNo: Mock.mock('@integer(1, 999)'), - status: Mock.mock('@integer(0, 3)'), - updatedAt: Mock.mock('@datetime'), - editable: false - }) - } - - return builder({ - pageSize: pageSize, - pageNo: pageNo, - totalCount: totalCount, - totalPage: totalPage, - data: result - }) -} - -const projects = () => { - return builder({ - 'data': [{ - id: 1, - cover: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', - title: 'Alipay', - description: '那是一种内在的东西, 他们到达不了,也无法触及的', - status: 1, - updatedAt: '2018-07-26 00:00:00' - }, - { - id: 2, - cover: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', - title: 'Angular', - description: '希望是一个好东西,也许是最好的,好东西是不会消亡的', - status: 1, - updatedAt: '2018-07-26 00:00:00' - }, - { - id: 3, - cover: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', - title: 'Ant Design', - description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆', - status: 1, - updatedAt: '2018-07-26 00:00:00' - }, - { - id: 4, - cover: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', - title: 'Ant Design Pro', - description: '那时候我只会想自己想要什么,从不想自己拥有什么', - status: 1, - updatedAt: '2018-07-26 00:00:00' - }, - { - id: 5, - cover: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', - title: 'Bootstrap', - description: '凛冬将至', - status: 1, - updatedAt: '2018-07-26 00:00:00' - }, - { - id: 6, - cover: 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', - title: 'Vue', - description: '生命就像一盒巧克力,结果往往出人意料', - status: 1, - updatedAt: '2018-07-26 00:00:00' - } - ], - 'pageSize': 10, - 'pageNo': 0, - 'totalPage': 6, - 'totalCount': 57 - }) -} - -const activity = () => { - return builder([{ - id: 1, - user: { - nickname: '@name', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png' - }, - project: { - name: '白鹭酱油开发组', - action: '更新', - event: '番组计划' - }, - time: '2018-08-23 14:47:00' - }, - { - id: 1, - user: { - nickname: '蓝莓酱', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png' - }, - project: { - name: '白鹭酱油开发组', - action: '更新', - event: '番组计划' - }, - time: '2018-08-23 09:35:37' - }, - { - id: 1, - user: { - nickname: '@name', - avatar: '@image(64x64)' - }, - project: { - name: '白鹭酱油开发组', - action: '创建', - event: '番组计划' - }, - time: '2017-05-27 00:00:00' - }, - { - id: 1, - user: { - nickname: '曲丽丽', - avatar: '@image(64x64)' - }, - project: { - name: '高逼格设计天团', - action: '更新', - event: '六月迭代' - }, - time: '2018-08-23 14:47:00' - }, - { - id: 1, - user: { - nickname: '@name', - avatar: '@image(64x64)' - }, - project: { - name: '高逼格设计天团', - action: 'created', - event: '六月迭代' - }, - time: '2018-08-23 14:47:00' - }, - { - id: 1, - user: { - nickname: '曲丽丽', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png' - }, - project: { - name: '高逼格设计天团', - action: 'created', - event: '六月迭代' - }, - time: '2018-08-23 14:47:00' - } - ]) -} - -const teams = () => { - return builder([{ - id: 1, - name: '科学搬砖组', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png' - }, - { - id: 2, - name: '程序员日常', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png' - }, - { - id: 1, - name: '设计天团', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png' - }, - { - id: 1, - name: '中二少女团', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png' - }, - { - id: 1, - name: '骗你学计算机', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png' - } - ]) -} - -const radar = () => { - return builder([{ - item: '引用', - '个人': 70, - '团队': 30, - '部门': 40 - }, - { - item: '口碑', - '个人': 60, - '团队': 70, - '部门': 40 - }, - { - item: '产量', - '个人': 50, - '团队': 60, - '部门': 40 - }, - { - item: '贡献', - '个人': 40, - '团队': 50, - '部门': 40 - }, - { - item: '热度', - '个人': 60, - '团队': 70, - '部门': 40 - }, - { - item: '引用', - '个人': 70, - '团队': 50, - '部门': 40 - } - ]) -} - -Mock.mock(/\/service/, 'get', serverList) -Mock.mock(/\/list\/search\/projects/, 'get', projects) -Mock.mock(/\/workplace\/activity/, 'get', activity) -Mock.mock(/\/workplace\/teams/, 'get', teams) -Mock.mock(/\/workplace\/radar/, 'get', radar) diff --git a/view/catch-admin/src/mock/services/other.js b/view/catch-admin/src/mock/services/other.js deleted file mode 100644 index 83a5792..0000000 --- a/view/catch-admin/src/mock/services/other.js +++ /dev/null @@ -1,974 +0,0 @@ -import Mock from 'mockjs2' -import { builder } from '../util' - -const orgTree = () => { - return builder([{ - 'key': 'key-01', - 'title': '研发中心', - 'icon': 'mail', - 'children': [{ - 'key': 'key-01-01', - 'title': '后端组', - 'icon': null, - 'group': true, - children: [{ - 'key': 'key-01-01-01', - 'title': 'JAVA', - 'icon': null - }, - { - 'key': 'key-01-01-02', - 'title': 'PHP', - 'icon': null - }, - { - 'key': 'key-01-01-03', - 'title': 'Golang', - 'icon': null - } - ] - }, { - 'key': 'key-01-02', - 'title': '前端组', - 'icon': null, - 'group': true, - children: [{ - 'key': 'key-01-02-01', - 'title': 'React', - 'icon': null - }, - { - 'key': 'key-01-02-02', - 'title': 'Vue', - 'icon': null - }, - { - 'key': 'key-01-02-03', - 'title': 'Angular', - 'icon': null - } - ] - }] - }, { - 'key': 'key-02', - 'title': '财务部', - 'icon': 'dollar', - 'children': [{ - 'key': 'key-02-01', - 'title': '会计核算', - 'icon': null - }, { - 'key': 'key-02-02', - 'title': '成本控制', - 'icon': null - }, { - 'key': 'key-02-03', - 'title': '内部控制', - 'icon': null, - 'children': [{ - 'key': 'key-02-03-01', - 'title': '财务制度建设', - 'icon': null - }, - { - 'key': 'key-02-03-02', - 'title': '会计核算', - 'icon': null - } - ] - }] - }]) -} - -const role = () => { - return builder({ - 'data': [{ - 'id': 'admin', - 'name': '管理员', - 'describe': '拥有所有权限', - 'status': 1, - 'creatorId': 'system', - 'createTime': 1497160610259, - 'deleted': 0, - 'permissions': [{ - 'roleId': 'admin', - 'permissionId': 'comment', - 'permissionName': '评论管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'member', - 'permissionName': '会员管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'menu', - 'permissionName': '菜单管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'order', - 'permissionName': '订单管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'permission', - 'permissionName': '权限管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'role', - 'permissionName': '角色管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'test', - 'permissionName': '测试权限', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'user', - 'permissionName': '用户管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }, - { - 'action': 'export', - 'describe': '导出', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - } - ] - }, - { - 'id': 'svip', - 'name': 'SVIP', - 'describe': '超级会员', - 'status': 1, - 'creatorId': 'system', - 'createTime': 1532417744846, - 'deleted': 0, - 'permissions': [{ - 'roleId': 'admin', - 'permissionId': 'comment', - 'permissionName': '评论管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'member', - 'permissionName': '会员管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'menu', - 'permissionName': '菜单管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'order', - 'permissionName': '订单管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'permission', - 'permissionName': '权限管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'role', - 'permissionName': '角色管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, - { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'test', - 'permissionName': '测试权限', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'admin', - 'permissionId': 'user', - 'permissionName': '用户管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, - { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, - { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - } - ] - }, - { - 'id': 'user', - 'name': '普通会员', - 'describe': '普通用户,只能查询', - 'status': 1, - 'creatorId': 'system', - 'createTime': 1497160610259, - 'deleted': 0, - 'permissions': [{ - 'roleId': 'user', - 'permissionId': 'comment', - 'permissionName': '评论管理', - 'actions': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"}]', - 'actionEntitySet': [{ - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - - { - 'roleId': 'user', - 'permissionId': 'marketing', - 'permissionName': '营销管理', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'user', - 'permissionId': 'member', - 'permissionName': '会员管理', - 'actions': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"}]', - 'actionEntitySet': [{ - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'user', - 'permissionId': 'menu', - 'permissionName': '菜单管理', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - - { - 'roleId': 'user', - 'permissionId': 'order', - 'permissionName': '订单管理', - 'actions': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"}]', - 'actionEntitySet': [{ - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, - { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - } - ], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'user', - 'permissionId': 'permission', - 'permissionName': '权限管理', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'user', - 'permissionId': 'role', - 'permissionName': '角色管理', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - - { - 'roleId': 'user', - 'permissionId': 'test', - 'permissionName': '测试权限', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - }, - { - 'roleId': 'user', - 'permissionId': 'user', - 'permissionName': '用户管理', - 'actions': '[]', - 'actionEntitySet': [], - 'actionList': null, - 'dataAccess': null - } - ] - } - ], - 'pageSize': 10, - 'pageNo': 0, - 'totalPage': 1, - 'totalCount': 5 - }) -} - -const permissionNoPager = () => { - return builder([{ - 'id': 'marketing', - 'name': '营销管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': null, - 'parents': null, - 'type': null, - 'deleted': 0, - 'actions': [ - 'add', - 'query', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'member', - 'name': '会员管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'query', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'menu', - 'name': '菜单管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'import', - 'get', - 'update' - ] - }, - { - 'id': 'order', - 'name': '订单管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'query', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'permission', - 'name': '权限管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'role', - 'name': '角色管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'test', - 'name': '测试权限', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get' - ] - }, - { - 'id': 'user', - 'name': '用户管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"export","defaultCheck":false,"describe":"导出"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get' - ] - } - ]) -} - -const permissions = () => { - return builder({ - 'data': [{ - 'id': 'marketing', - 'name': '营销管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': null, - 'parents': null, - 'type': null, - 'deleted': 0, - 'actions': [ - 'add', - 'query', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'member', - 'name': '会员管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'query', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'menu', - 'name': '菜单管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'import', - 'get', - 'update' - ] - }, - { - 'id': 'order', - 'name': '订单管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'query', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'permission', - 'name': '权限管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'role', - 'name': '角色管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get', - 'update', - 'delete' - ] - }, - { - 'id': 'test', - 'name': '测试权限', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get' - ] - }, - { - 'id': 'user', - 'name': '用户管理', - 'describe': null, - 'status': 1, - 'actionData': '[{"action":"add","describe":"新增","defaultCheck":false},{"action":"get","describe":"查询","defaultCheck":false}]', - 'sptDaTypes': null, - 'optionalFields': '[]', - 'parents': null, - 'type': 'default', - 'deleted': 0, - 'actions': [ - 'add', - 'get' - ] - } - ], - 'pageSize': 10, - 'pageNo': 0, - 'totalPage': 1, - 'totalCount': 5 - }) -} - -Mock.mock(/\/org\/tree/, 'get', orgTree) -Mock.mock(/\/role/, 'get', role) -Mock.mock(/\/permission\/no-pager/, 'get', permissionNoPager) -Mock.mock(/\/permission/, 'get', permissions) diff --git a/view/catch-admin/src/mock/services/tagCloud.js b/view/catch-admin/src/mock/services/tagCloud.js deleted file mode 100644 index 63a2e06..0000000 --- a/view/catch-admin/src/mock/services/tagCloud.js +++ /dev/null @@ -1,9 +0,0 @@ -import Mock from 'mockjs2' -import { builder } from '../util' - -// -const tagCloudData = () => { - return builder([{ 'value': 9, 'name': 'AntV' }, { 'value': 8, 'name': 'F2' }, { 'value': 8, 'name': 'G2' }, { 'value': 8, 'name': 'G6' }, { 'value': 8, 'name': 'DataSet' }, { 'value': 8, 'name': '墨者学院' }, { 'value': 6, 'name': 'Analysis' }, { 'value': 6, 'name': 'Data Mining' }, { 'value': 6, 'name': 'Data Vis' }, { 'value': 6, 'name': 'Design' }, { 'value': 6, 'name': 'Grammar' }, { 'value': 6, 'name': 'Graphics' }, { 'value': 6, 'name': 'Graph' }, { 'value': 6, 'name': 'Hierarchy' }, { 'value': 6, 'name': 'Labeling' }, { 'value': 6, 'name': 'Layout' }, { 'value': 6, 'name': 'Quantitative' }, { 'value': 6, 'name': 'Relation' }, { 'value': 6, 'name': 'Statistics' }, { 'value': 6, 'name': '可视化' }, { 'value': 6, 'name': '数据' }, { 'value': 6, 'name': '数据可视化' }, { 'value': 4, 'name': 'Arc Diagram' }, { 'value': 4, 'name': 'Bar Chart' }, { 'value': 4, 'name': 'Canvas' }, { 'value': 4, 'name': 'Chart' }, { 'value': 4, 'name': 'DAG' }, { 'value': 4, 'name': 'DG' }, { 'value': 4, 'name': 'Facet' }, { 'value': 4, 'name': 'Geo' }, { 'value': 4, 'name': 'Line' }, { 'value': 4, 'name': 'MindMap' }, { 'value': 4, 'name': 'Pie' }, { 'value': 4, 'name': 'Pizza Chart' }, { 'value': 4, 'name': 'Punch Card' }, { 'value': 4, 'name': 'SVG' }, { 'value': 4, 'name': 'Sunburst' }, { 'value': 4, 'name': 'Tree' }, { 'value': 4, 'name': 'UML' }, { 'value': 3, 'name': 'Chart' }, { 'value': 3, 'name': 'View' }, { 'value': 3, 'name': 'Geom' }, { 'value': 3, 'name': 'Shape' }, { 'value': 3, 'name': 'Scale' }, { 'value': 3, 'name': 'Animate' }, { 'value': 3, 'name': 'Global' }, { 'value': 3, 'name': 'Slider' }, { 'value': 3, 'name': 'Connector' }, { 'value': 3, 'name': 'Transform' }, { 'value': 3, 'name': 'Util' }, { 'value': 3, 'name': 'DomUtil' }, { 'value': 3, 'name': 'MatrixUtil' }, { 'value': 3, 'name': 'PathUtil' }, { 'value': 3, 'name': 'G' }, { 'value': 3, 'name': '2D' }, { 'value': 3, 'name': '3D' }, { 'value': 3, 'name': 'Line' }, { 'value': 3, 'name': 'Area' }, { 'value': 3, 'name': 'Interval' }, { 'value': 3, 'name': 'Schema' }, { 'value': 3, 'name': 'Edge' }, { 'value': 3, 'name': 'Polygon' }, { 'value': 3, 'name': 'Heatmap' }, { 'value': 3, 'name': 'Render' }, { 'value': 3, 'name': 'Tooltip' }, { 'value': 3, 'name': 'Axis' }, { 'value': 3, 'name': 'Guide' }, { 'value': 3, 'name': 'Coord' }, { 'value': 3, 'name': 'Legend' }, { 'value': 3, 'name': 'Path' }, { 'value': 3, 'name': 'Helix' }, { 'value': 3, 'name': 'Theta' }, { 'value': 3, 'name': 'Rect' }, { 'value': 3, 'name': 'Polar' }, { 'value': 3, 'name': 'Dsv' }, { 'value': 3, 'name': 'Csv' }, { 'value': 3, 'name': 'Tsv' }, { 'value': 3, 'name': 'GeoJSON' }, { 'value': 3, 'name': 'TopoJSON' }, { 'value': 3, 'name': 'Filter' }, { 'value': 3, 'name': 'Map' }, { 'value': 3, 'name': 'Pick' }, { 'value': 3, 'name': 'Rename' }, { 'value': 3, 'name': 'Filter' }, { 'value': 3, 'name': 'Map' }, { 'value': 3, 'name': 'Pick' }, { 'value': 3, 'name': 'Rename' }, { 'value': 3, 'name': 'Reverse' }, { 'value': 3, 'name': 'sort' }, { 'value': 3, 'name': 'Subset' }, { 'value': 3, 'name': 'Partition' }, { 'value': 3, 'name': 'Imputation' }, { 'value': 3, 'name': 'Fold' }, { 'value': 3, 'name': 'Aggregate' }, { 'value': 3, 'name': 'Proportion' }, { 'value': 3, 'name': 'Histogram' }, { 'value': 3, 'name': 'Quantile' }, { 'value': 3, 'name': 'Treemap' }, { 'value': 3, 'name': 'Hexagon' }, { 'value': 3, 'name': 'Binning' }, { 'value': 3, 'name': 'kernel' }, { 'value': 3, 'name': 'Regression' }, { 'value': 3, 'name': 'Density' }, { 'value': 3, 'name': 'Sankey' }, { 'value': 3, 'name': 'Voronoi' }, { 'value': 3, 'name': 'Projection' }, { 'value': 3, 'name': 'Centroid' }, { 'value': 3, 'name': 'H5' }, { 'value': 3, 'name': 'Mobile' }, { 'value': 3, 'name': 'K线图' }, { 'value': 3, 'name': '关系图' }, { 'value': 3, 'name': '烛形图' }, { 'value': 3, 'name': '股票图' }, { 'value': 3, 'name': '直方图' }, { 'value': 3, 'name': '金字塔图' }, { 'value': 3, 'name': '分面' }, { 'value': 3, 'name': '南丁格尔玫瑰图' }, { 'value': 3, 'name': '饼图' }, { 'value': 3, 'name': '线图' }, { 'value': 3, 'name': '点图' }, { 'value': 3, 'name': '散点图' }, { 'value': 3, 'name': '子弹图' }, { 'value': 3, 'name': '柱状图' }, { 'value': 3, 'name': '仪表盘' }, { 'value': 3, 'name': '气泡图' }, { 'value': 3, 'name': '漏斗图' }, { 'value': 3, 'name': '热力图' }, { 'value': 3, 'name': '玉玦图' }, { 'value': 3, 'name': '直方图' }, { 'value': 3, 'name': '矩形树图' }, { 'value': 3, 'name': '箱形图' }, { 'value': 3, 'name': '色块图' }, { 'value': 3, 'name': '螺旋图' }, { 'value': 3, 'name': '词云' }, { 'value': 3, 'name': '词云图' }, { 'value': 3, 'name': '雷达图' }, { 'value': 3, 'name': '面积图' }, { 'value': 3, 'name': '马赛克图' }, { 'value': 3, 'name': '盒须图' }, { 'value': 3, 'name': '坐标轴' }, { 'value': 3, 'name': '' }, { 'value': 3, 'name': 'Jacques Bertin' }, { 'value': 3, 'name': 'Leland Wilkinson' }, { 'value': 3, 'name': 'William Playfair' }, { 'value': 3, 'name': '关联' }, { 'value': 3, 'name': '分布' }, { 'value': 3, 'name': '区间' }, { 'value': 3, 'name': '占比' }, { 'value': 3, 'name': '地图' }, { 'value': 3, 'name': '时间' }, { 'value': 3, 'name': '比较' }, { 'value': 3, 'name': '流程' }, { 'value': 3, 'name': '趋势' }, { 'value': 2, 'name': '亦叶' }, { 'value': 2, 'name': '再飞' }, { 'value': 2, 'name': '完白' }, { 'value': 2, 'name': '巴思' }, { 'value': 2, 'name': '张初尘' }, { 'value': 2, 'name': '御术' }, { 'value': 2, 'name': '有田' }, { 'value': 2, 'name': '沉鱼' }, { 'value': 2, 'name': '玉伯' }, { 'value': 2, 'name': '画康' }, { 'value': 2, 'name': '祯逸' }, { 'value': 2, 'name': '绝云' }, { 'value': 2, 'name': '罗宪' }, { 'value': 2, 'name': '萧庆' }, { 'value': 2, 'name': '董珊珊' }, { 'value': 2, 'name': '陆沉' }, { 'value': 2, 'name': '顾倾' }, { 'value': 2, 'name': 'Domo' }, { 'value': 2, 'name': 'GPL' }, { 'value': 2, 'name': 'PAI' }, { 'value': 2, 'name': 'SPSS' }, { 'value': 2, 'name': 'SYSTAT' }, { 'value': 2, 'name': 'Tableau' }, { 'value': 2, 'name': 'D3' }, { 'value': 2, 'name': 'Vega' }, { 'value': 2, 'name': '统计图表' }]) -} - -Mock.mock(/\/data\/antv\/tag-cloud/, 'get', tagCloudData) diff --git a/view/catch-admin/src/mock/services/user.js b/view/catch-admin/src/mock/services/user.js deleted file mode 100644 index 3c3ad1a..0000000 --- a/view/catch-admin/src/mock/services/user.js +++ /dev/null @@ -1,770 +0,0 @@ -import Mock from 'mockjs2' -import { builder } from '../util' - -const info = (options) => { - console.log('options', options) - const userInfo = { - 'id': '4291d7da9005377ec9aec4a71ea837f', - 'name': '天野远子', - 'username': 'admin', - 'password': '', - 'avatar': '/avatar2.jpg', - 'status': 1, - 'telephone': '', - 'lastLoginIp': '27.154.74.117', - 'lastLoginTime': 1534837621348, - 'creatorId': 'admin', - 'createTime': 1497160610259, - 'merchantCode': 'TLif2btpzg079h15bk', - 'deleted': 0, - 'roleId': 'admin', - 'role': {} - } - // role - const roleObj = { - 'id': 'admin', - 'name': '管理员', - 'describe': '拥有所有权限', - 'status': 1, - 'creatorId': 'system', - 'createTime': 1497160610259, - 'deleted': 0, - 'permissions': [{ - 'roleId': 'admin', - 'permissionId': 'dashboard', - 'permissionName': '仪表盘', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'exception', - 'permissionName': '异常页面权限', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'result', - 'permissionName': '结果权限', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'profile', - 'permissionName': '详细页权限', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'table', - 'permissionName': '表格权限', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'form', - 'permissionName': '表单权限', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'order', - 'permissionName': '订单管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'permission', - 'permissionName': '权限管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'role', - 'permissionName': '角色管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'table', - 'permissionName': '桌子管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'query', - 'describe': '查询', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }, { - 'roleId': 'admin', - 'permissionId': 'user', - 'permissionName': '用户管理', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }, { - 'action': 'export', - 'describe': '导出', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }] - } - - roleObj.permissions.push({ - 'roleId': 'admin', - 'permissionId': 'support', - 'permissionName': '超级模块', - 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]', - 'actionEntitySet': [{ - 'action': 'add', - 'describe': '新增', - 'defaultCheck': false - }, { - 'action': 'import', - 'describe': '导入', - 'defaultCheck': false - }, { - 'action': 'get', - 'describe': '详情', - 'defaultCheck': false - }, { - 'action': 'update', - 'describe': '修改', - 'defaultCheck': false - }, { - 'action': 'delete', - 'describe': '删除', - 'defaultCheck': false - }, { - 'action': 'export', - 'describe': '导出', - 'defaultCheck': false - }], - 'actionList': null, - 'dataAccess': null - }) - - userInfo.role = roleObj - return builder(userInfo) -} - -const userNav = (options) => { - const nav = [ - // dashboard - { - 'name': 'dashboard', - 'parentId': 0, - 'id': 1, - 'meta': { - 'icon': 'dashboard', - 'title': '仪表盘', - 'show': true - }, - 'component': 'RouteView', - 'redirect': '/dashboard/workplace' - }, - { - 'name': 'workplace', - 'parentId': 1, - 'id': 7, - 'meta': { - 'title': '工作台', - 'show': true - }, - 'component': 'Workplace' - }, - { - 'name': 'monitor', - 'path': 'https://www.baidu.com/', - 'parentId': 1, - 'id': 3, - 'meta': { - 'title': '监控页(外部)', - 'target': '_blank', - 'show': true - } - }, - { - 'name': 'Analysis', - 'parentId': 1, - 'id': 2, - 'meta': { - 'title': '分析页', - 'show': true - }, - 'component': 'Analysis', - 'path': '/dashboard/analysis' - }, - { - 'name': 'tests', - 'parentId': 1, - 'id': 8, - 'meta': { - 'title': '测试功能', - 'show': true - }, - 'component': 'TestWork' - }, - - // form - { - 'name': 'form', - 'parentId': 0, - 'id': 10, - 'meta': { - 'icon': 'form', - 'title': '表单页' - }, - 'redirect': '/form/base-form', - 'component': 'PageView' - }, - { - 'name': 'basic-form', - 'parentId': 10, - 'id': 6, - 'meta': { - 'title': '基础表单' - }, - 'component': 'BasicForm' - }, - { - 'name': 'step-form', - 'parentId': 10, - 'id': 5, - 'meta': { - 'title': '分步表单' - }, - 'component': 'StepForm' - }, - { - 'name': 'advanced-form', - 'parentId': 10, - 'id': 4, - 'meta': { - 'title': '高级表单' - }, - 'component': 'AdvanceForm' - }, - - // list - { - 'name': 'list', - 'parentId': 0, - 'id': 10010, - 'meta': { - 'icon': 'table', - 'title': '列表页', - 'show': true - }, - 'redirect': '/list/table-list', - 'component': 'PageView' - }, - { - 'name': 'table-list', - 'parentId': 10010, - 'id': 10011, - 'path': '/list/table-list/:pageNo([1-9]\\d*)?', - 'meta': { - 'title': '查询表格', - 'show': true - }, - 'component': 'TableList' - }, - { - 'name': 'basic-list', - 'parentId': 10010, - 'id': 10012, - 'meta': { - 'title': '标准列表', - 'show': true - }, - 'component': 'StandardList' - }, - { - 'name': 'card', - 'parentId': 10010, - 'id': 10013, - 'meta': { - 'title': '卡片列表', - 'show': true - }, - 'component': 'CardList' - }, - { - 'name': 'search', - 'parentId': 10010, - 'id': 10014, - 'meta': { - 'title': '搜索列表', - 'show': true - }, - 'redirect': '/list/search/article', - 'component': 'SearchLayout' - }, - { - 'name': 'article', - 'parentId': 10014, - 'id': 10015, - 'meta': { - 'title': '搜索列表(文章)', - 'show': true - }, - 'component': 'SearchArticles' - }, - { - 'name': 'project', - 'parentId': 10014, - 'id': 10016, - 'meta': { - 'title': '搜索列表(项目)', - 'show': true - }, - 'component': 'SearchProjects' - }, - { - 'name': 'application', - 'parentId': 10014, - 'id': 10017, - 'meta': { - 'title': '搜索列表(应用)', - 'show': true - }, - 'component': 'SearchApplications' - }, - - // profile - { - 'name': 'profile', - 'parentId': 0, - 'id': 10018, - 'meta': { - 'title': '详情页', - 'icon': 'profile', - 'show': true - }, - 'redirect': '/profile/basic', - 'component': 'RouteView' - }, - { - 'name': 'basic', - 'parentId': 10018, - 'id': 10019, - 'meta': { - 'title': '基础详情页', - 'show': true - }, - 'component': 'ProfileBasic' - }, - { - 'name': 'advanced', - 'parentId': 10018, - 'id': 10020, - 'meta': { - 'title': '高级详情页', - 'show': true - }, - 'component': 'ProfileAdvanced' - }, - - // result - { - 'name': 'result', - 'parentId': 0, - 'id': 10021, - 'meta': { - 'title': '结果页', - 'icon': 'check-circle-o', - 'show': true - }, - 'redirect': '/result/success', - 'component': 'PageView' - }, - { - 'name': 'success', - 'parentId': 10021, - 'id': 10022, - 'meta': { - 'title': '成功', - 'hiddenHeaderContent': true, - 'show': true - }, - 'component': 'ResultSuccess' - }, - { - 'name': 'fail', - 'parentId': 10021, - 'id': 10023, - 'meta': { - 'title': '失败', - 'hiddenHeaderContent': true, - 'show': true - }, - 'component': 'ResultFail' - }, - - // Exception - { - 'name': 'exception', - 'parentId': 0, - 'id': 10024, - 'meta': { - 'title': '异常页', - 'icon': 'warning', - 'show': true - }, - 'redirect': '/exception/403', - 'component': 'RouteView' - }, - { - 'name': '403', - 'parentId': 10024, - 'id': 10025, - 'meta': { - 'title': '403', - 'show': true - }, - 'component': 'Exception403' - }, - { - 'name': '404', - 'parentId': 10024, - 'id': 10026, - 'meta': { - 'title': '404', - 'show': true - }, - 'component': 'Exception404' - }, - { - 'name': '500', - 'parentId': 10024, - 'id': 10027, - 'meta': { - 'title': '500', - 'show': true - }, - 'component': 'Exception500' - }, - - // account - { - 'name': 'account', - 'parentId': 0, - 'id': 10028, - 'meta': { - 'title': '个人页', - 'icon': 'user', - 'show': true - }, - 'redirect': '/account/center', - 'component': 'RouteView' - }, - { - 'name': 'center', - 'parentId': 10028, - 'id': 10029, - 'meta': { - 'title': '个人中心', - 'show': true - }, - 'component': 'AccountCenter' - }, - // 特殊三级菜单 - { - 'name': 'settings', - 'parentId': 10028, - 'id': 10030, - 'meta': { - 'title': '个人设置', - 'hideHeader': true, - 'hideChildren': true, - 'show': true - }, - 'redirect': '/account/settings/base', - 'component': 'AccountSettings' - }, - { - 'name': 'BaseSettings', - 'path': '/account/settings/base', - 'parentId': 10030, - 'id': 10031, - 'meta': { - 'title': '基本设置', - 'show': false - }, - 'component': 'BaseSettings' - }, - { - 'name': 'SecuritySettings', - 'path': '/account/settings/security', - 'parentId': 10030, - 'id': 10032, - 'meta': { - 'title': '安全设置', - 'show': false - }, - 'component': 'SecuritySettings' - }, - { - 'name': 'CustomSettings', - 'path': '/account/settings/custom', - 'parentId': 10030, - 'id': 10033, - 'meta': { - 'title': '个性化设置', - 'show': false - }, - 'component': 'CustomSettings' - }, - { - 'name': 'BindingSettings', - 'path': '/account/settings/binding', - 'parentId': 10030, - 'id': 10034, - 'meta': { - 'title': '账户绑定', - 'show': false - }, - 'component': 'BindingSettings' - }, - { - 'name': 'NotificationSettings', - 'path': '/account/settings/notification', - 'parentId': 10030, - 'id': 10034, - 'meta': { - 'title': '新消息通知', - 'show': false - }, - 'component': 'NotificationSettings' - } - ] - const json = builder(nav) - console.log('json', json) - return json -} - -Mock.mock(/\/api\/user\/info/, 'get', info) -Mock.mock(/\/api\/user\/nav/, 'get', userNav) diff --git a/view/catch-admin/src/mock/util.js b/view/catch-admin/src/mock/util.js deleted file mode 100644 index a4be036..0000000 --- a/view/catch-admin/src/mock/util.js +++ /dev/null @@ -1,38 +0,0 @@ -const responseBody = { - message: '', - timestamp: 0, - result: null, - code: 0 -} - -export const builder = (data, message, code = 0, headers = {}) => { - responseBody.result = data - if (message !== undefined && message !== null) { - responseBody.message = message - } - if (code !== undefined && code !== 0) { - responseBody.code = code - responseBody._status = code - } - if (headers !== null && typeof headers === 'object' && Object.keys(headers).length > 0) { - responseBody._headers = headers - } - responseBody.timestamp = new Date().getTime() - return responseBody -} - -export const getQueryParameters = (options) => { - const url = options.url - const search = url.split('?')[1] - if (!search) { - return {} - } - return JSON.parse('{"' + decodeURIComponent(search) - .replace(/"/g, '\\"') - .replace(/&/g, '","') - .replace(/=/g, '":"') + '"}') -} - -export const getBody = (options) => { - return options.body && JSON.parse(options.body) -} diff --git a/view/catch-admin/tests/unit/.eslintrc.js b/view/catch-admin/tests/unit/.eslintrc.js deleted file mode 100644 index 958d51b..0000000 --- a/view/catch-admin/tests/unit/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - env: { - jest: true - } -}