From 949a04de73198d8a13dfc1732f8eefaa7231434c Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 7 Aug 2024 15:52:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=BB=84=E4=BB=B6=E5=B0=81?= =?UTF-8?q?=E8=A3=85=EF=BC=8C=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E5=BE=80=E6=9D=A5=E5=8D=95=E4=BD=8D=E7=AE=A1=E7=90=86=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E9=A1=B5=E9=9D=A2=E6=90=AD=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/sidebar.scss | 1 + src/components/DialogModel/index.vue | 55 +++++ src/components/TableModel/index.vue | 139 ++++++----- src/components/ToolbarModel/index.vue | 227 ++++++++++++++++++ src/layout/components/AppMain.vue | 79 +++--- src/main.js | 3 + src/mixins/common.js | 12 + src/permission.js | 81 ++++--- src/router/index.js | 12 + .../components/form-contact-units.vue | 121 ++++++++++ src/views/BasicManage/ContactUnits/config.js | 18 ++ src/views/BasicManage/ContactUnits/index.vue | 49 +++- .../ProjectManage/components/form-project.vue | 185 ++++++++++++++ src/views/BasicManage/ProjectManage/config.js | 27 ++- src/views/BasicManage/ProjectManage/index.vue | 45 +++- 15 files changed, 904 insertions(+), 150 deletions(-) create mode 100644 src/components/DialogModel/index.vue create mode 100644 src/components/ToolbarModel/index.vue create mode 100644 src/mixins/common.js create mode 100644 src/views/BasicManage/ContactUnits/components/form-contact-units.vue create mode 100644 src/views/BasicManage/ContactUnits/config.js create mode 100644 src/views/BasicManage/ProjectManage/components/form-project.vue diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index abe5b63..e85851a 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -5,6 +5,7 @@ transition: margin-left .28s; margin-left: $base-sidebar-width; position: relative; + overflow: hidden; } .sidebarHide { diff --git a/src/components/DialogModel/index.vue b/src/components/DialogModel/index.vue new file mode 100644 index 0000000..76c3dcc --- /dev/null +++ b/src/components/DialogModel/index.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/TableModel/index.vue b/src/components/TableModel/index.vue index 9111634..d072e38 100644 --- a/src/components/TableModel/index.vue +++ b/src/components/TableModel/index.vue @@ -76,70 +76,72 @@ - - - +
+ +
+
- - - - - - - - + + + + + + + + + + - + diff --git a/src/components/ToolbarModel/index.vue b/src/components/ToolbarModel/index.vue new file mode 100644 index 0000000..626b89f --- /dev/null +++ b/src/components/ToolbarModel/index.vue @@ -0,0 +1,227 @@ + + + diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index a25c562..2a92571 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -1,75 +1,76 @@ diff --git a/src/main.js b/src/main.js index ea2b899..86212e0 100644 --- a/src/main.js +++ b/src/main.js @@ -40,6 +40,8 @@ import DictData from '@/components/DictData' // 表格组件 import TableModel from '@/components/TableModel' +// 弹框组件 +import DialogModel from '@/components/DialogModel' // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -61,6 +63,7 @@ Vue.component('FileUpload', FileUpload) Vue.component('ImageUpload', ImageUpload) Vue.component('ImagePreview', ImagePreview) Vue.component('TableModel', TableModel) +Vue.component('DialogModel', DialogModel) Vue.use(directive) Vue.use(plugins) diff --git a/src/mixins/common.js b/src/mixins/common.js new file mode 100644 index 0000000..dd37b4a --- /dev/null +++ b/src/mixins/common.js @@ -0,0 +1,12 @@ +export const commonMixin = { + methods: { + /** 关闭外侧弹框 */ + closeDialogOuter() { + this.dialogConfig.outerVisible = false + }, + /** 关闭内侧弹框 */ + closeDialogInner() { + this.dialogConfig.innerVisible = false + }, + } +} \ No newline at end of file diff --git a/src/permission.js b/src/permission.js index 5297df9..1d597ec 100644 --- a/src/permission.js +++ b/src/permission.js @@ -12,46 +12,47 @@ const whiteList = ['/login', '/register'] router.beforeEach((to, from, next) => { NProgress.start() - if (getToken()) { - console.log(getToken()) - to.meta.title && store.dispatch('settings/setTitle', to.meta.title) - /* has token*/ - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() - } else if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - if (store.getters.roles.length === 0) { - isRelogin.show = true - // 判断当前用户是否已拉取完user_info信息 - store.dispatch('GetInfo').then(() => { - isRelogin.show = false - store.dispatch('GenerateRoutes').then(accessRoutes => { - // 根据roles权限生成可访问的路由表 - router.addRoutes(accessRoutes) // 动态添加可访问路由表 - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 - }) - }).catch(err => { - store.dispatch('LogOut').then(() => { - Message.error(err) - next({ path: '/' }) - }) - }) - } else { - next() - } - } - } else { - // 没有token - if (whiteList.indexOf(to.path) !== -1) { - // 在免登录白名单,直接进入 - next() - } else { - next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 - NProgress.done() - } - } + next() + // if (getToken()) { + // console.log(getToken()) + // to.meta.title && store.dispatch('settings/setTitle', to.meta.title) + // /* has token*/ + // if (to.path === '/login') { + // next({ path: '/' }) + // NProgress.done() + // } else if (whiteList.indexOf(to.path) !== -1) { + // next() + // } else { + // if (store.getters.roles.length === 0) { + // isRelogin.show = true + // // 判断当前用户是否已拉取完user_info信息 + // store.dispatch('GetInfo').then(() => { + // isRelogin.show = false + // store.dispatch('GenerateRoutes').then(accessRoutes => { + // // 根据roles权限生成可访问的路由表 + // router.addRoutes(accessRoutes) // 动态添加可访问路由表 + // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + // }) + // }).catch(err => { + // store.dispatch('LogOut').then(() => { + // Message.error(err) + // next({ path: '/' }) + // }) + // }) + // } else { + // next() + // } + // } + // } else { + // // 没有token + // if (whiteList.indexOf(to.path) !== -1) { + // // 在免登录白名单,直接进入 + // next() + // } else { + // next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 + // NProgress.done() + // } + // } }) router.afterEach(() => { diff --git a/src/router/index.js b/src/router/index.js index 493b19f..b35dc4f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -71,6 +71,18 @@ export const constantRoutes = [ component: () => import('@/views/index'), name: 'Index', meta: { title: '首页', icon: 'dashboard', affix: true } + }, + { + path: 'ProjectManage', + component: () => import('@/views/BasicManage/ProjectManage'), + name: 'ProjectManage', + meta: { title: '工程管理', icon: 'dashboard', affix: true } + }, + { + path: 'ContactUnits', + component: () => import('@/views/BasicManage/ContactUnits'), + name: 'ContactUnits', + meta: { title: '往来单位', icon: 'dashboard', affix: true } } ] }, diff --git a/src/views/BasicManage/ContactUnits/components/form-contact-units.vue b/src/views/BasicManage/ContactUnits/components/form-contact-units.vue new file mode 100644 index 0000000..62ac463 --- /dev/null +++ b/src/views/BasicManage/ContactUnits/components/form-contact-units.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/views/BasicManage/ContactUnits/config.js b/src/views/BasicManage/ContactUnits/config.js new file mode 100644 index 0000000..6e65931 --- /dev/null +++ b/src/views/BasicManage/ContactUnits/config.js @@ -0,0 +1,18 @@ + +export const formLabel = [ + { f_label: '分公司名称', f_model: 'keyWords', f_type: 'ipt' }, +] +export const columnsList = [ + { t_props: 'scrapNum', t_label: '单位名称', }, + { t_props: '', t_label: '单位类型' }, + { t_props: 'repairNum', t_label: '所属分公司' }, + { t_props: 'unitName', t_label: '联系人', }, + { t_props: 'projectName', t_label: '联系电话', }, + { t_props: 'itemType', t_label: '状态', }, + +] +export const dialogConfig = { + outerWidth: '40%', + outerTitle: '', + outerVisible: false, +} \ No newline at end of file diff --git a/src/views/BasicManage/ContactUnits/index.vue b/src/views/BasicManage/ContactUnits/index.vue index f43a00c..615ecda 100644 --- a/src/views/BasicManage/ContactUnits/index.vue +++ b/src/views/BasicManage/ContactUnits/index.vue @@ -1,10 +1,51 @@ - - diff --git a/src/views/BasicManage/ProjectManage/components/form-project.vue b/src/views/BasicManage/ProjectManage/components/form-project.vue new file mode 100644 index 0000000..9b8f885 --- /dev/null +++ b/src/views/BasicManage/ProjectManage/components/form-project.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/src/views/BasicManage/ProjectManage/config.js b/src/views/BasicManage/ProjectManage/config.js index 5963bfc..98d35ea 100644 --- a/src/views/BasicManage/ProjectManage/config.js +++ b/src/views/BasicManage/ProjectManage/config.js @@ -3,11 +3,22 @@ export const formLabel = [ { f_label: '分公司名称', f_model: 'keywords', f_type: 'ipt' }, ] export const columnsList = [ - // { t_width: '55px', t_props: '', t_label: '序号' }, - { t_width: '', t_props: 'scrapNum', t_label: '单位名称', }, - { t_width: '', t_props: '', t_label: '单位类型' }, - { t_width: '', t_props: 'repairNum', t_label: '所属分公司' }, - { t_width: '', t_props: 'unitName', t_label: '联系人', }, - { t_width: '', t_props: 'projectName', t_label: '联系电话', }, - { t_width: '', t_props: 'itemType', t_label: '状态', }, -] \ No newline at end of file + { t_props: 'scrapNum', t_label: '工程项目名称', }, + { t_props: '', t_label: '实施单位' }, + { t_props: 'repairNum', t_label: '工程类型' }, + { t_props: 'unitName', t_label: 'i8工程编码', }, + { t_props: 'projectName', t_label: '是否匹配i8工程', }, + { t_props: 'itemType', t_label: '合同主体', }, + { t_props: 'itemType', t_label: '项目经理', }, + { t_props: 'itemType', t_label: '联系电话', }, + { t_props: 'itemType', t_label: '工程状态', }, +] + +export const dialogConfig = { + outerWidth: '70%', + outerTitle: '', + outerVisible: false, + innerWidth: '50%', + innerTitle: '', + innerVisible: false, +} diff --git a/src/views/BasicManage/ProjectManage/index.vue b/src/views/BasicManage/ProjectManage/index.vue index 7d7ce82..513593b 100644 --- a/src/views/BasicManage/ProjectManage/index.vue +++ b/src/views/BasicManage/ProjectManage/index.vue @@ -1,18 +1,57 @@