From 82c54f1d3c343717df433e7bbabf0dcd659d34a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=80=97=E6=AF=94?= <754124441@qq.com> Date: Thu, 8 Nov 2018 15:04:54 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e69de29..e10758b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ +抽取后的效果图: +![输入图片说明](https://images.gitee.com/uploads/images/2018/1108/150414_25ca3029_1636840.png "屏幕截图.png") +![输入图片说明](https://images.gitee.com/uploads/images/2018/1108/150436_f05a982d_1636840.png "屏幕截图.png") \ No newline at end of file -- Gitee From 4fda5799221ce99055816b72e56a8dc22d57c147 Mon Sep 17 00:00:00 2001 From: dinghao <754124441@qq.com> Date: Thu, 8 Nov 2018 15:12:17 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E6=97=B6=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Main.vue | 26 +++++++++++++++++++++++++- src/views/login.vue | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/views/Main.vue b/src/views/Main.vue index 75e4e73..c97f29e 100644 --- a/src/views/Main.vue +++ b/src/views/Main.vue @@ -3,6 +3,11 @@ diff --git a/src/components/tables/handle-btns.js b/src/components/tables/handle-btns.js new file mode 100644 index 0000000..ddae233 --- /dev/null +++ b/src/components/tables/handle-btns.js @@ -0,0 +1,33 @@ +const btns = { + delete: (h, params, vm) => { + return h('Poptip', { + props: { + confirm: true, + title: '你确定要删除吗?' + }, + on: { + 'on-ok': () => { + vm.$emit('on-delete', params) + vm.$emit('input', params.tableData.filter((item, index) => index !== params.row.initRowIndex)) + } + } + }, [ + h('Button', { + props: { + type: 'text', + ghost: true + } + }, [ + h('Icon', { + props: { + type: 'md-trash', + size: 18, + color: '#000000' + } + }) + ]) + ]) + } +} + +export default btns diff --git a/src/components/tables/index.js b/src/components/tables/index.js new file mode 100644 index 0000000..4dabfab --- /dev/null +++ b/src/components/tables/index.js @@ -0,0 +1,2 @@ +import Tables from './tables.vue' +export default Tables diff --git a/src/components/tables/index.less b/src/components/tables/index.less new file mode 100644 index 0000000..29b8a21 --- /dev/null +++ b/src/components/tables/index.less @@ -0,0 +1,20 @@ +.search-con { + padding: 10px 0; + .search { + &-col { + display: inline-block; + width: 200px; + } + &-input { + display: inline-block; + width: 200px; + margin-left: 2px; + } + &-btn { + margin-left: 2px; + } + &-add { + margin-left: 2px; + } + } +} diff --git a/src/components/tables/tables.vue b/src/components/tables/tables.vue new file mode 100644 index 0000000..7ba21c1 --- /dev/null +++ b/src/components/tables/tables.vue @@ -0,0 +1,294 @@ + + + + diff --git a/src/libs/table2excel.js b/src/libs/table2excel.js index 2e0017a..a3aa06d 100644 --- a/src/libs/table2excel.js +++ b/src/libs/table2excel.js @@ -1,5 +1,6 @@ var idTmr; -function getExplorer () { + +function getExplorer() { var explorer = window.navigator.userAgent; if (explorer.indexOf('MSIE') >= 0) { // ie @@ -16,9 +17,11 @@ function getExplorer () { } else if (explorer.indexOf('Safari') >= 0) { // Safari return 'Safari'; - }; + } + ; }; -function tranform (table, aId, name) { + +function tranform(table, aId, name) { let tableHead = table.$children[0].$el; let tableBody = table.$children[1].$el; let tableInnerHTML = ''; @@ -74,16 +77,22 @@ function tranform (table, aId, name) { tableToExcel(tableInnerHTML, aId, name); } } -function Cleanup () { + +function Cleanup() { window.clearInterval(idTmr); // CollectGarbage(); } + let tableToExcel = (function () { let uri = 'data:application/vnd.ms-excel;base64,'; let template = '{table}
'; - let base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); }; + let base64 = function (s) { + return window.btoa(unescape(encodeURIComponent(s))); + }; let format = function (s, c) { - return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }); + return s.replace(/{(\w+)}/g, function (m, p) { + return c[p]; + }); }; return function (table, aId, name) { let ctx = {worksheet: name || 'Worksheet', table: table}; diff --git a/src/main.js b/src/main.js index 72c1cca..760727d 100644 --- a/src/main.js +++ b/src/main.js @@ -7,7 +7,7 @@ import App from './app.vue'; import '@/locale'; import 'iview/dist/styles/iview.css'; import VueI18n from 'vue-i18n'; -import util from '@/libs/util'; +// import util from '@/libs/util'; Vue.use(VueI18n); Vue.use(iView); diff --git a/src/router/router.js b/src/router/router.js index c2dd595..824e07d 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -58,7 +58,16 @@ export const otherRouter = { // 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里 export const appRouter = [ - + { + path: '/user', + icon: 'key', + name: 'user', + title: '用户管理', + component: Main, + children: [ + { path: 'index', title: '用户管理', name: 'user_index', component: resolve => { require(['@/views/user/user.vue'], resolve); } }, + ] + }, ]; // 所有上面定义的路由都要写在下面的routers里 diff --git a/src/store/modules/app.js b/src/store/modules/app.js index b76c315..59ac30e 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -8,8 +8,8 @@ const app = { cachePage: [], lang: '', isFullScreen: false, - openedSubmenuArr: [], // 要展开的菜单数组 - menuTheme: 'dark', // 主题 + openedSubmenuArr: [], /* 要展开的菜单数组 */ + menuTheme: 'dark', /* 主题 */ themeColor: '', pageOpenedList: [{ title: '首页', @@ -23,7 +23,7 @@ const app = { path: '', name: 'home_index' } - ], // 面包屑数组 + ], /* 面包屑数组 */ menuList: [], routers: [ otherRouter, @@ -31,7 +31,7 @@ const app = { ], tagsList: [...otherRouter.children], messageCount: 0, - dontCache: ['text-editor', 'artical-publish'] // 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js) + dontCache: ['text-editor', 'artical-publish'] /* 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js) */ }, mutations: { setTagsList (state, list) { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 4d0fb69..c3f314a 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -8,7 +8,7 @@ const user = { token: getToken(), access: '', lockScreenPassword: '', - username: '', + username: '' }, diff --git a/src/views/user/user.vue b/src/views/user/user.vue new file mode 100644 index 0000000..94d02ee --- /dev/null +++ b/src/views/user/user.vue @@ -0,0 +1,125 @@ + + + + + -- Gitee