diff --git a/package-lock.json.REMOVED.git-id b/package-lock.json.REMOVED.git-id index 2f1b1384..7347e8cb 100644 --- a/package-lock.json.REMOVED.git-id +++ b/package-lock.json.REMOVED.git-id @@ -1 +1 @@ -273bfaa679d4398e12f5270f76df4e1953da170b \ No newline at end of file +14be1e768a4e072ad8ea5ff5bfec5535088a3e4b \ No newline at end of file diff --git a/package.json b/package.json index 305788dc..a0ec1396 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "mockjs": "^1.0.1-beta3", "nprogress": "^0.2.0", "papaparse": "^4.3.6", + "qs": "^6.6.0", "quill": "^1.3.4", "screenfull": "^3.3.2", "simplemde": "^1.11.2", diff --git a/src/api/demo/business/issues/142/index.js b/src/api/demo/business/issues/142/index.js new file mode 100644 index 00000000..b5b4464c --- /dev/null +++ b/src/api/demo/business/issues/142/index.js @@ -0,0 +1,11 @@ +import request from '@/plugin/axios' + +export function get (id) { + return request({ + url: '/demo/business/issues/142', + method: 'get', + params: { + id + } + }) +} diff --git a/src/menu/modules/demo-business.js b/src/menu/modules/demo-business.js index 78724af8..71b01f37 100644 --- a/src/menu/modules/demo-business.js +++ b/src/menu/modules/demo-business.js @@ -10,6 +10,13 @@ export default { children: [ { path: `${pre}table/1`, title: '表格 1' } ] + }, + { + title: 'ISSUES', + icon: 'github', + children: [ + { path: `${pre}issues/142`, title: '#142' } + ] } ])('/demo/business/') } diff --git a/src/mock/api/demo/business/issues/142/index.js b/src/mock/api/demo/business/issues/142/index.js new file mode 100644 index 00000000..0c8933d8 --- /dev/null +++ b/src/mock/api/demo/business/issues/142/index.js @@ -0,0 +1,26 @@ +import Mock from 'mockjs' +import qs from 'qs' + +const db = [ + { id: '1', name: '王小虎1', address: '上海市普陀区金沙江路 1518 弄' }, + { id: '2', name: '王小虎2', address: '上海市普陀区金沙江路 1517 弄' }, + { id: '3', name: '王小虎3', address: '上海市普陀区金沙江路 1519 弄' }, + { id: '4', name: '王小虎4', address: '上海市普陀区金沙江路 1516 弄' } +] + +Mock.mock(RegExp('/api/demo/business/issues/142' + '.*'), 'get', ({ url, type, body }) => { + // 解析 + const options = { + params: qs.parse(url.split('?').length > 1 ? url.split('?')[1] : ''), + body: qs.parse(body), + url: qs.parse(url.split('?')[0]) + } + // 返回数据 + return Mock.mock( + { + code: 0, + msg: '获取数据成功', + data: db.find(e => e.id === options.params.id) + } + ) +}) diff --git a/src/pages/demo/business/issues/142/edit.vue b/src/pages/demo/business/issues/142/edit.vue new file mode 100644 index 00000000..79fe15c0 --- /dev/null +++ b/src/pages/demo/business/issues/142/edit.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/pages/demo/business/issues/142/index.vue b/src/pages/demo/business/issues/142/index.vue new file mode 100644 index 00000000..a1df4a94 --- /dev/null +++ b/src/pages/demo/business/issues/142/index.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/pages/demo/playground/store/page/index.vue b/src/pages/demo/playground/store/page/index.vue index 813dec42..c100055e 100644 --- a/src/pages/demo/playground/store/page/index.vue +++ b/src/pages/demo/playground/store/page/index.vue @@ -61,28 +61,28 @@ export default { // 关闭当前 handleCloseCurrent () { this.close({ - tagName: this.$route.name, + tagName: this.$route.fullPath, vm: this }) }, // 关闭左侧 handleCloseLeft () { this.closeLeft({ - tagName: this.$route.name, + tagName: this.$route.fullPath, vm: this }) }, // 关闭右侧 handleCloseRight () { this.closeRight({ - tagName: this.$route.name, + tagName: this.$route.fullPath, vm: this }) }, // 关闭其他 handleCloseOther () { this.closeOther({ - tagName: this.$route.name, + tagName: this.$route.fullPath, vm: this }) }, @@ -92,7 +92,7 @@ export default { }, // 清空当前页缓存并刷新此页面 handleCleanCacheAndRefreshCurrent () { - this.keepAliveRemove(this.$route.name) + this.keepAliveRemove(this.$route.fullPath) this.$nextTick(this.$router.replace('/refresh')) }, // 清空所有的缓存并刷新此页面 diff --git a/src/router/modules/business.js b/src/router/modules/business.js index 7b8ad0c5..3454c547 100644 --- a/src/router/modules/business.js +++ b/src/router/modules/business.js @@ -9,7 +9,42 @@ export default { redirect: { name: 'demo-business-index' }, component: layoutHeaderAside, children: (pre => [ - { path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/business/index'), meta: { ...meta, title: '示例首页' } }, - { path: 'table/1', name: `${pre}table-1`, component: () => import('@/pages/demo/business/table/1'), meta: { ...meta, title: '表格 1' } } + { + path: 'index', + name: `${pre}index`, + component: () => import('@/pages/demo/business/index'), + meta: { + ...meta, + title: '示例首页' + } + }, + { + path: 'table/1', + name: `${pre}table-1`, + component: () => import('@/pages/demo/business/table/1'), + meta: { + ...meta, + title: '表格 1' + } + }, + { + path: 'issues/142', + name: `${pre}issues-142`, + component: () => import('@/pages/demo/business/issues/142'), + meta: { + ...meta, + title: 'issue #142' + } + }, + { + path: 'issues/142/edit/:id', + name: `${pre}issues-142-edit`, + component: () => import('@/pages/demo/business/issues/142/edit'), + props: true, + meta: { + ...meta, + title: 'issue #142 Edit' + } + } ])('demo-business-') }