From 63befd33c6b4439a7a2d419bed5b38ee1e958773 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Tue, 27 Nov 2018 22:33:37 +0800 Subject: [PATCH 1/4] add html demo Former-commit-id: c96e7e73b5577d17be818020b7746c08b6258a3b [formerly c96e7e73b5577d17be818020b7746c08b6258a3b [formerly c96e7e73b5577d17be818020b7746c08b6258a3b [formerly c96e7e73b5577d17be818020b7746c08b6258a3b [formerly b8366a6d8947acf1a7236d2fcbe70fdde5eea560 [formerly e7d024c7319241b098239cecf544f3f506f2b522]]]]] Former-commit-id: 56e1427ccdd3d3b96508b36e900b26949636206b Former-commit-id: 41a84ffb578b100e70a0351c4de9b18255defb07 Former-commit-id: 031c4afbae818b08a3dae04ee9bc2cf7ee68a331 [formerly 8d68981562d608faf36fde7a1fea18d6b2b7570a] Former-commit-id: 5f2d083f639d0b5b33ad0ab389ada692d14ca0a4 Former-commit-id: 4d165efbcac91e0bbcf794271b0562f436277ad8 Former-commit-id: 9e8bf683f1d5cedb7d6969e8006bfd35ab019e8d Former-commit-id: 7ab7d18d389176b555ea53d20798647ea7d4f65f Former-commit-id: 337861057a4ab74d8142525448bcbcf58f7617aa --- public/html/demo.html | 100 ++++++++++++++++++++++++++++ src/menu/modules/demo-frame.js | 3 +- src/pages/demo/frame/html/index.vue | 13 ++++ src/router/modules/frame.js | 1 + 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 public/html/demo.html create mode 100644 src/pages/demo/frame/html/index.vue diff --git a/public/html/demo.html b/public/html/demo.html new file mode 100644 index 00000000..e4823f04 --- /dev/null +++ b/public/html/demo.html @@ -0,0 +1,100 @@ + + + + + + + + demo + + +
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/menu/modules/demo-frame.js b/src/menu/modules/demo-frame.js index c00234bb..8b479bcb 100644 --- a/src/menu/modules/demo-frame.js +++ b/src/menu/modules/demo-frame.js @@ -3,6 +3,7 @@ export default { title: '内嵌网页', icon: 'globe', children: (pre => [ - { path: `${pre}d2-doc`, title: 'D2Admin 中文文档', iconSvg: 'd2-admin' } + { path: `${pre}d2-doc`, title: 'D2Admin 中文文档', iconSvg: 'd2-admin' }, + { path: `${pre}html`, title: '静态 HTML', icon: 'code' } ])('/demo/frame/') } diff --git a/src/pages/demo/frame/html/index.vue b/src/pages/demo/frame/html/index.vue new file mode 100644 index 00000000..b916bfa4 --- /dev/null +++ b/src/pages/demo/frame/html/index.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/router/modules/frame.js b/src/router/modules/frame.js index cb6d3537..4e360ba7 100644 --- a/src/router/modules/frame.js +++ b/src/router/modules/frame.js @@ -9,6 +9,7 @@ export default { redirect: { name: 'demo-frame-index' }, component: layoutHeaderAside, children: (pre => [ + { path: 'html', name: `${pre}html`, component: () => import('@/pages/demo/frame/html'), meta: { ...meta, title: '静态 HTML' } }, { path: 'd2-doc', name: `${pre}d2-doc`, component: () => import('@/pages/demo/frame/d2-doc'), meta: { ...meta, title: 'D2Admin 中文文档' } } ])('demo-frame-') } From 947475bdc195d2b7c9f5d599bf71d74165e59d3c Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Wed, 28 Nov 2018 16:49:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A4=8D=E7=8E=B0=E4=BA=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E7=AD=89=E5=BE=85=E7=BB=93=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly ecb763d008a589ee3b83854517804b1468ca7a09 [formerly b18b87cc41e0c54a93a2f5021fe6022a6fa2c5fb]]]]] Former-commit-id: 51a327f9f3d7a018f099f72ad564d6604aa5e9d7 Former-commit-id: 81c578d9cef74d8513c8a3c65107cfdfd3c6dfb7 Former-commit-id: caad4b29ff03d5878996ce52ff20252336128d97 [formerly 42d8aa2c0c3332d2c07057d6f4cdf21388c08fb9] Former-commit-id: a81ea126d2fa05ae5555f872669792a08f9f2ff0 Former-commit-id: d27d0e66ed023c621d2cd2711664f498a21bb8ad Former-commit-id: 61e0719ea25d0c67c1c38ded8cf41be50c17d7b5 Former-commit-id: 17291fab193dcf38a91f44137fa271d8f2d4ee56 Former-commit-id: 5218d72d35fb2d088198c37187d662eca768bd7b --- package-lock.json.REMOVED.git-id | 2 +- package.json | 1 + src/api/demo/business/issues/142/index.js | 11 +++ src/menu/modules/demo-business.js | 7 ++ .../api/demo/business/issues/142/index.js | 26 ++++++ src/pages/demo/business/issues/142/edit.vue | 80 +++++++++++++++++++ src/pages/demo/business/issues/142/index.vue | 60 ++++++++++++++ .../demo/playground/store/page/index.vue | 10 +-- src/router/modules/business.js | 39 ++++++++- 9 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 src/api/demo/business/issues/142/index.js create mode 100644 src/mock/api/demo/business/issues/142/index.js create mode 100644 src/pages/demo/business/issues/142/edit.vue create mode 100644 src/pages/demo/business/issues/142/index.vue 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-') } From c40ffd28ebd6931c8d40abb826583cc683637af9 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Wed, 28 Nov 2018 19:43:04 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=97=A0=E7=BC=93=E5=AD=98=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 6883d69fa575d23f2b84d87c98837513ce80796d [formerly d5db79752e5291211213ee25de648bef17890514] [formerly 6883d69fa575d23f2b84d87c98837513ce80796d [formerly d5db79752e5291211213ee25de648bef17890514] [formerly 6883d69fa575d23f2b84d87c98837513ce80796d [formerly d5db79752e5291211213ee25de648bef17890514] [formerly d5db79752e5291211213ee25de648bef17890514 [formerly 4e406142b9bb6080e9e1762c0a4bef23a1e50cd6 [formerly 1bf019d5133f11592485fa0f7cb1de7efec5b445]]]]] Former-commit-id: d51db872aaf542f2b43a961e33072c072776506c Former-commit-id: c5894cf9c1ee7748390cb62af232866c51c3c134 Former-commit-id: 65920a88a0ad59b76a722014c50fa26c2e72335d [formerly 69b2ad233bdca2af18a802eb70d8fc8f4f9b8c18] Former-commit-id: a1bf30ad771fa9ebfd93f0d0176db83b8cbc761a Former-commit-id: 01b20064c86040c27526f032537f393e4d45616e Former-commit-id: 0c7c844d38c24679b82ed3b9c5eee402a835dd8e Former-commit-id: 5221a9aa5913d25224c3a9060881124e90cc3876 Former-commit-id: 3712bbcc1f0c6bb7cb660871b9e14797146e596c --- src/pages/demo/business/issues/142/edit.vue | 67 +++++++++++++------- src/pages/demo/business/issues/142/index.vue | 4 +- src/router/modules/business.js | 2 +- 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/src/pages/demo/business/issues/142/edit.vue b/src/pages/demo/business/issues/142/edit.vue index 79fe15c0..ca9ccdb4 100644 --- a/src/pages/demo/business/issues/142/edit.vue +++ b/src/pages/demo/business/issues/142/edit.vue @@ -3,7 +3,11 @@ type="card" class="demo-business-issues-142-edit"> - + @@ -12,14 +16,12 @@ 修改 - 取消 + + diff --git a/src/pages/demo/business/issues/142/edit.vue b/src/pages/demo/business/issues/142/edit.vue index ca9ccdb4..48b96f63 100644 --- a/src/pages/demo/business/issues/142/edit.vue +++ b/src/pages/demo/business/issues/142/edit.vue @@ -1,13 +1,12 @@ diff --git a/src/pages/demo/business/issues/142/index.vue b/src/pages/demo/business/issues/142/index.vue index ceb280e6..c52280ac 100644 --- a/src/pages/demo/business/issues/142/index.vue +++ b/src/pages/demo/business/issues/142/index.vue @@ -2,7 +2,8 @@