diff --git a/.env b/.env index 2f44eed..a14f3b0 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ VUE_APP_TBAS_TITLES_KEY=admin.tabs.titles VUE_APP_LAYOUT_KEY=admin.layout VUE_APP_THEME_MODE_KEY=admin.theme.mode VUE_APP_THEME_COLOR_KEY=admin.theme.color -VUE_APP_API_BASE_URL=http://zxx4.f3322.net:16680 +VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000 VUE_APP_USER_MODEL=AdminUser VUE_APP_BEID=1 VUE_APP_PTYID=0 \ No newline at end of file diff --git a/.env.development b/.env.development index 67a0ad0..e9bba22 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ -VUE_APP_API_BASE_URL=http://zxx4.f3322.net:16680 \ No newline at end of file +VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000 \ No newline at end of file diff --git a/package.json b/package.json index 232ff27..56dc2f7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,9 @@ "vue-i18n": "^8.18.2", "vue-router": "^3.3.4", "vuedraggable": "^2.23.2", - "vuex": "^3.4.0" + "vuex": "^3.4.0", + "vxe-table": "^3.6.6", + "xe-utils": "^3.5.7" }, "devDependencies": { "@ant-design/colors": "^4.0.1", diff --git a/src/application/index.js b/src/application/index.js new file mode 100644 index 0000000..15432f0 --- /dev/null +++ b/src/application/index.js @@ -0,0 +1,12 @@ +// 跟业务系统相关的 + +import mk from './mk' + +export default { + install(Vue) { + + + Vue.prototype.$mk = mk; + + } +} \ No newline at end of file diff --git a/src/application/mk/components/dialog/dialog.vue b/src/application/mk/components/dialog/dialog.vue new file mode 100644 index 0000000..810134d --- /dev/null +++ b/src/application/mk/components/dialog/dialog.vue @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/src/application/mk/components/dialog/index.js b/src/application/mk/components/dialog/index.js new file mode 100644 index 0000000..5af5d8a --- /dev/null +++ b/src/application/mk/components/dialog/index.js @@ -0,0 +1,17 @@ +import Vue from 'vue' +import promptComponent from './dialog.vue' + + + +export default { + + open: function (args) { + const promptConstructor = Vue.extend(promptComponent); + let instance = new promptConstructor().$mount(''); + document.body.appendChild(instance.$el); + + + instance.open(args); + } + +}; \ No newline at end of file diff --git a/src/application/mk/config/index.js b/src/application/mk/config/index.js new file mode 100644 index 0000000..2db977d --- /dev/null +++ b/src/application/mk/config/index.js @@ -0,0 +1,50 @@ + + + +export default { + + defaults: { + + gridOptions: { + rowConfig: { + keyField: "id", + isCurrent: true, + isHover: true + }, + columnConfig: { + resizable: true + }, + sortConfig: { + trigger: 'cell', + remote: true + }, + pagerConfig: { + pageSize: 50, + pageSizes: [50, 100, 200, 500, 1000] + }, + __toolbarConfig: { + buttons: [ + ], + refresh: true, + import: false, + export: false, + print: false, + zoom: false, + custom: true + }, + checkboxConfig: { + reserve: true, + highlight: true, + range: true + } + }, + + + formOptions: { + + } + + } + + +}; \ No newline at end of file diff --git a/src/application/mk/index.js b/src/application/mk/index.js new file mode 100644 index 0000000..f26dbf6 --- /dev/null +++ b/src/application/mk/index.js @@ -0,0 +1,18 @@ +import modal from './libs/function/modal' +import apis from './libs/function/apis' +import config from './config' +import dialog from './components/dialog' + + +var mk = { + + ...modal, + + ...apis, + + config: config, + + dialog: dialog +}; + +export default mk; \ No newline at end of file diff --git a/src/application/mk/libs/function/apis.js b/src/application/mk/libs/function/apis.js new file mode 100644 index 0000000..c60bbeb --- /dev/null +++ b/src/application/mk/libs/function/apis.js @@ -0,0 +1,87 @@ +import { request } from '@/utils/request' +import modal from './modal' +export default { + + post : function({url, data,loading , config}){ + + return new Promise((resolve, reject)=>{ + + if(loading){ + modal.loading(loading); + } + request(url, 'post', data, config).then(response=>{ + if(!response){ + reject && reject(response); + return; + } + var result = response.data; + if(!result){ + reject && reject(response); + return; + } + if(loading){ + modal.hideLoading(); + } + if(result.code != 200){ + if(reject){ + reject(response); + }else{ + modal.error(result.msg); + } + return; + } + resolve(result.data); + }).catch((error)=>{ + if(loading){ + modal.hideLoading(); + } + modal.error(error.toString()); + }); + }); + + }, + + getPagedData: function({url, method = 'post', data, config}){ + + return new Promise((resolve, reject)=>{ + + if(data.start_time && typeof(data.start_time) == "string"){ + data.start_time = parseInt(new Date(data.start_time).getTime()/1000); + } + if(data.end_time && typeof(data.end_time) == "string"){ + data.end_time =parseInt(new Date(data.end_time).getTime()/1000); + } + console.log(data) + request(url, method, data, config).then(response=>{ + if(!response){ + reject && reject(response); + return; + } + var result = response.data; + if(!result){ + reject && reject(response); + return; + } + + if(result.code != 200){ + if(reject){ + reject(response); + }else{ + modal.error(result.msg); + } + return; + } + resolve(result.data); + }).catch((error)=>{ + resolve({ + total:0, + list :[] + }); + modal.error(error.toString()); + }); + }); + + } + + +} \ No newline at end of file diff --git a/src/application/mk/libs/function/modal.js b/src/application/mk/libs/function/modal.js new file mode 100644 index 0000000..f924604 --- /dev/null +++ b/src/application/mk/libs/function/modal.js @@ -0,0 +1,63 @@ +import VXETable from 'vxe-table' + +/** + * 函数 - 弹窗 + */ +const msgs = { + title: "提示", + confirmText: "确定", + cancelText: "取消", + placeholderText: "请输入" +}; +export default { + /** + this.$mk.alert({ content: '基本提示框', title: '标题1' }); + */ + alert: function (options = {}) { + options = Object.assign({ title: msgs.title }, options); + + return VXETable.modal.alert(options); + }, + + /** + this.$mk.msg(“消息提示”); + */ + msg: function (content) { + return VXETable.modal.message({ content: content }); + }, + + info: function (content) { + return VXETable.modal.message({ content: content, status: 'info' }); + }, + + warning: function (content) { + return VXETable.modal.message({ content: content, status: 'warning' }); + }, + + question: function (content) { + return VXETable.modal.message({ content: content, status: 'question' }); + }, + + success: function (content) { + return VXETable.modal.message({ content: content, status: 'success' }); + }, + + error: function (content) { + return VXETable.modal.message({ content: content, status: 'error' }); + }, + + loading: function (content) { + return VXETable.modal.message({ content: content, status: 'loading', duration: -1, id: 'loading' }); + }, + + hideLoading: function () { + VXETable.modal.close("loading"); + }, + + /* + this.$mk.confirm('您确定要删除吗?').then(type => { + this.$mk.msg("点击了确定") + }); + */ + confirm: VXETable.modal.confirm +} diff --git a/src/application/mk/style/main.css b/src/application/mk/style/main.css new file mode 100644 index 0000000..cdca317 --- /dev/null +++ b/src/application/mk/style/main.css @@ -0,0 +1,18 @@ +.ant-btn { + margin-right: 8px; + margin-bottom: 12px; +} + + +.vxe-checkbox--input{ + display: none; +} +.vxe-toolbar .vxe-custom--footer button { + background-color: transparent; + width: 50%; + height: 2.5em; + border: 0; + color: #606266; + text-align: center; + cursor: pointer; +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 7343c63..d2d8218 100644 --- a/src/main.js +++ b/src/main.js @@ -10,11 +10,15 @@ import 'animate.css/source/animate.css' // 引入animate.css 动画库 import Plugins from '@/plugins' // 引入插件 import {initI18n} from '@/utils/i18n' // 引入国际化方法 import bootstrap from '@/bootstrap' // 引入启动引导方法 -import 'moment/locale/zh-cn' // 引入moment 本地化 +import 'moment/locale/zh-cn' // 引入moment 本地化 +import VXETable from 'vxe-table' +import 'vxe-table/lib/style.css' + const router = initRouter(store.state.setting.asyncRoutes) // 初始化路由 加载动态路由 const i18n = initI18n('CN', 'US') // 初始化国际化 加载中英文 语言包 +Vue.use(VXETable) Vue.use(Antd) // 注册ant-design-vue 组件库 Vue.config.productionTip = false // 关闭生产模式下给出的提示 Vue.use(Viser) // 注册viser-vue 组件库 @@ -22,6 +26,11 @@ Vue.use(Plugins) // 注册插件 bootstrap({router, store, i18n, message: Vue.prototype.$message}) // 启动引导方法 + +import application from './application'; +import './application/mk/style/main.css'; +Vue.use(application); + new Vue({ router, // 注入路由 store, // 注入vuex store diff --git a/src/pages/Middle/Admin/AdminUser/UserDetail.vue b/src/pages/Middle/Admin/AdminUser/UserDetail.vue index e69de29..bcbe29d 100644 --- a/src/pages/Middle/Admin/AdminUser/UserDetail.vue +++ b/src/pages/Middle/Admin/AdminUser/UserDetail.vue @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/src/pages/Middle/Admin/AdminUser/UserEdit.vue b/src/pages/Middle/Admin/AdminUser/UserEdit.vue new file mode 100644 index 0000000..2cce903 --- /dev/null +++ b/src/pages/Middle/Admin/AdminUser/UserEdit.vue @@ -0,0 +1,185 @@ + + + + diff --git a/src/pages/Middle/Admin/AdminUser/UserList.vue b/src/pages/Middle/Admin/AdminUser/UserList.vue index d774fd5..f6799ad 100644 --- a/src/pages/Middle/Admin/AdminUser/UserList.vue +++ b/src/pages/Middle/Admin/AdminUser/UserList.vue @@ -1,103 +1,282 @@