From 3498f7498e47499e0d44d46ac27f609c2c28c7f2 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Thu, 4 Nov 2021 16:42:35 +0800 Subject: [PATCH] fdsf --- src/assets/scss/main-shuju.scss | 589 ++++++++++++++++++ src/js/store/index.js | 51 +- src/router/index.js | 121 +++- src/store/index.js | 7 +- src/views/components/editResi.vue | 7 +- src/views/components/resiSearch.vue | 1 + src/views/main-navbar.vue | 11 +- src/views/main-shuju/main-content.vue | 95 +++ .../main-navbar-update-password-work.vue | 148 +++++ src/views/main-shuju/main-navbar.vue | 246 ++++++++ src/views/main-shuju/main.vue | 157 +++++ src/views/main-sidebar.vue | 16 - src/views/main.vue | 1 - src/views/modules/base/resi.vue | 64 +- src/views/pages/indexWork.vue | 4 +- 15 files changed, 1411 insertions(+), 107 deletions(-) create mode 100644 src/assets/scss/main-shuju.scss create mode 100644 src/views/main-shuju/main-content.vue create mode 100644 src/views/main-shuju/main-navbar-update-password-work.vue create mode 100644 src/views/main-shuju/main-navbar.vue create mode 100644 src/views/main-shuju/main.vue diff --git a/src/assets/scss/main-shuju.scss b/src/assets/scss/main-shuju.scss new file mode 100644 index 00000000..da5ddef9 --- /dev/null +++ b/src/assets/scss/main-shuju.scss @@ -0,0 +1,589 @@ +@import "~@/element-ui/theme-variables.scss"; +@import "./variables.scss"; + +// $navbar--height: 60px; + +/* Reset element-ui +------------------------------ */ +.g-bd { + .el-card + .el-card { + margin-top: 15px; + } + .el-input__prefix .el-input__icon { + display: inline-block; + vertical-align: middle; + } + .el-date-editor .el-range-separator { + width: 8%; + } + .el-table th { + color: $--color-text-primary; + background-color: $--background-color-base; + } + .el-pagination { + margin-top: 15px; + text-align: right; + } + .el-table__expand-icon { + display: inline-block; + width: 14px; + vertical-align: middle; + margin-right: 5px; + } +} + +/* Common +------------------------------ */ +// 图标 +.icon-svg { + width: 1em; + height: 1em; + fill: currentColor; + vertical-align: middle; + overflow: hidden; +} +// 卡片 +.aui-card--fill .el-card__header { + height: $content--card-header-height; + line-height: $content--card-header-height - 36px; +} +.aui-card__title { + font-size: 16px; +} +// 表单 +.aui-form__label-icon { + display: inline-block; + margin: 0 3px; + vertical-align: middle; + font-size: 18px; + color: $--color-text-secondary; +} +// 按钮 +.aui-button--dashed { + border-style: dashed; + &:focus, + &:hover { + background-color: transparent; + } + &-add { + > span > *[class*="el-icon-"], + > span > *[class*="icon"] { + vertical-align: middle; + font-size: 18px; + margin-right: 5px; + } + } +} + +/* Layout +------------------------------ */ +.g-bd { + position: relative; + padding-top: $navbar--height; + + /* Sidebar fold +------------------------------ */ + &.z-sidebar--fold { + .navbar { + &__header, + &__brand { + width: $sidebar--width-fold; + } + &__brand { + &-lg { + display: none; + } + &-mini { + display: inline-block; + } + } + &__icon-menu--switch { + transform: rotateZ(180deg); + } + } + .aui-sidebar { + &__inner { + width: $sidebar--width-fold + 20px; + } + &, + &__menu { + width: $sidebar--width-fold; + } + &__menu > li > .el-submenu__title { + text-align: center; + } + &__menu-icon { + margin-right: 0; + font-size: 18px; + } + } + .g-cnt { + &__wrapper { + margin-left: $sidebar--width-fold; + } + &--tabs > .el-tabs > .el-tabs__header { + left: $sidebar--width-fold; + } + } + } + + &.z-sidebar--noside { + .aui-sidebar { + display: none !important; + } + .g-cnt { + &__wrapper { + margin-left: 0 !important; + } + &--tabs > .el-tabs > .el-tabs__header { + left: 0 !important; + } + } + } +} + +/* Navbar +------------------------------ */ +.m-navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; + display: flex; + align-items: stretch; + height: $navbar--height; + // background-color: $--color-primary; + // box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05); + background: linear-gradient(180deg, #00023f, #176dec); + box-shadow: 0px 3px 16px 0px rgba(187, 187, 227, 0.35); + + .navbar--colorful { + .navbar__body { + background-color: transparent; + } + .navbar__menu { + > .el-menu-item, + > .el-submenu > .el-submenu__title { + color: #fff; + &:focus, + &:hover { + color: #fff; + background-color: mix(#000, $--color-primary, 15%); + } + } + > .el-menu-item.is-active, + > .el-submenu.is-active > .el-submenu__title { + color: #fff; + &:focus, + &:hover { + color: #fff; + } + } + .el-menu-item i, + .el-submenu__title i, + .el-menu-item svg, + .el-submenu__title svg, + .el-menu-item .el-dropdown { + color: #fff !important; + } + .el-button { + color: #fff; + background-color: transparent; + } + } + .navbar__search { + &-txt { + .el-input__inner { + color: #fff; + border-color: #fff; + &::-webkit-input-placeholder { + color: #fff; + } + } + } + } + } + .navbar__header { + position: relative; + width: $sidebar--width; + height: $navbar--height; + transition: width 0.3s; + } + .navbar__brand { + display: flex; + justify-content: center; + align-items: center; + padding: 5px; + margin: 0; + width: 100%; + height: 100%; + font-size: 24px; + text-transform: uppercase; + white-space: nowrap; + overflow: hidden; + transition: width 0.3s; + font-family: FZZCHJW; + font-weight: normal; + color: #ffffff; + background: linear-gradient(0deg, #03c7ff 24.609375%, #ffffff 81.0791015625%); + -webkit-background-clip: text; + -webkit-text-fill-color: rgba(#fff, 0.7); + + &-lg, + &-mini { + max-width: 100%; + color: #fff; + cursor: pointer; + &:focus, + &:hover { + color: #fff; + text-decoration: none; + } + } + &-mini { + display: none; + } + } + .navbar__body { + position: relative; + display: flex; + flex: 1; + // background-color: #fff; + background-color: transparent; + // overflow: hidden; + } + .navbar__menu { + background-color: transparent; + border-bottom: 0 !important; + a:focus, + a:hover { + text-decoration: none; + } + &.z-div { + .el-menu-item { + position: relative; + + &.is-active { + &::before { + position: absolute; + content: ""; + display: block; + bottom: -6px; + left: 0; + right: 0; + margin: 0 auto; + width: 50px; + height: 4px; + border: 0; + border-radius: 0 0 2px 2px; + background: #1effff; + } + } + + &:last-child { + &::after { + display: none; + } + } + + &::after { + position: absolute; + content: ""; + right: 0; + top: 0; + bottom: 0; + margin: auto 0; + width: 1px; + height: 18px; + background-color: rgba(#ffffff, 0.6); + } + } + } + .el-menu-item, + .el-submenu > .el-submenu__title { + height: $navbar--height; + padding: 0 15px; + line-height: $navbar--height; + border-color: transparent !important; + color: #fff; + } + .el-menu-item.is-active, + .el-submenu.is-active > .el-submenu__title { + color: #fff; + font-weight: bold; + &:focus, + &:hover { + } + } + .el-menu-item { + &:focus, + &:hover { + background-color: transparent !important; + + .navbar__icon-menu { + color: #fff; + } + .el-dropdown { + color: #fff; + .el-icon-arrow-down { + transform: rotateZ(180deg); + } + } + } + * { + vertical-align: initial; + } + .navbar__icon-menu { + vertical-align: middle; + font-size: 16px; + } + .el-dropdown { + color: #fff; + .el-icon-arrow-down { + width: auto; + font-size: 12px; + margin: 0 0 0 5px; + transition: transform 0.3s; + } + } + } + .el-badge { + display: inline; + z-index: 2; + &__content { + line-height: 16px; + } + } + } + .navbar__search { + > *[class*="el-icon-"], + > *[class*="icon"] { + display: inline-block; + vertical-align: middle; + } + &-txt { + width: 0; + transition: width 0.3s, margin-left 0.3s; + &.is-show { + width: 210px; + margin-left: 8px; + } + .el-input__inner { + height: $navbar--height - 20px; + padding: 0; + line-height: $navbar--height - 20px; + border-color: $--color-text-primary; + border-top: 0; + border-right: 0; + border-left: 0; + border-radius: 0; + background: transparent; + } + } + } + .navbar__avatar { + .el-dropdown-link { + > img { + width: 36px; + height: auto; + margin-right: 5px; + border-radius: 100%; + vertical-align: middle; + } + } + } +} + +/* Content +------------------------------ */ +.g-cnt { + position: relative; + padding: $content--padding; + min-height: calc(100vh - #{$navbar--height}); + background-color: #000; + + &__wrapper { + position: relative; + margin-left: $sidebar--width; + min-height: calc(100vh - #{$navbar--height}); + background-color: $content--background-color; + transition: margin-left 0.3s; + } + > .aui-card--fill > .el-card__body { + min-height: calc(#{$content--fill-height} - 2px); + } + > .aui-card--fill > .el-card__header + .el-card__body { + min-height: calc(#{$content--fill-height} - #{$content--card-header-height} - 2px); + } + &--tabs { + padding: $content--tabs-header-height 0 0; + } + &--tabs-tools { + position: fixed; + top: $navbar--height; + right: 0; + z-index: 931; + min-width: $content--tabs-header-height; + height: $content--tabs-header-height; + padding: 0 12px; + text-align: center; + font-size: 16px; + line-height: $content--tabs-header-height; + background-color: $--background-color-base; + cursor: pointer; + } + &--tabs-icon-nav { + display: inline-block; + vertical-align: middle; + font-size: 16px; + } + > .el-tabs { + > .el-tabs__header { + position: fixed; + top: $navbar--height; + left: $sidebar--width; + right: 0; + z-index: 930; + padding: 0 55px 0 15px; + margin: 0; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); + background-color: #fff; + transition: left 0.3s; + > .el-tabs__nav-wrap { + margin-bottom: 0; + &:after { + display: none; + } + > .el-tabs__nav-next, + > .el-tabs__nav-prev { + line-height: $content--tabs-header-height; + } + > .el-tabs__nav-scroll > .el-tabs__nav { + & > .el-tabs__active-bar { + display: none; + } + & > .el-tabs__item { + height: $content--tabs-header-height; + padding: 0 15px; + line-height: $content--tabs-header-height; + border: 0; + color: $--color-text-regular; + &:focus, + &:hover, + &.is-active { + color: $--color-text-primary; + background-color: $--background-color-base; + &:after { + display: block; + } + > .el-icon-close { + color: $--color-text-primary; + } + } + &:after { + display: none; + position: absolute; + bottom: 0; + left: 0; + content: ""; + width: 100%; + height: 2px; + background-color: $--color-primary; + } + + .el-tabs__item { + margin-left: 1px; + } + > .el-icon-close { + width: 14px; + margin-left: 15px; + color: $--color-text-secondary; + } + > i.icon { + display: inline-block; + vertical-align: middle; + font-size: 18px; + } + } + } + } + } + > .el-tabs__content { + padding: $content--padding; + .el-loading-mask { + z-index: 830; + } + > .el-tab-pane { + min-height: calc(#{$content--fill-height-tabs}); + > .aui-card--fill > .el-card__body { + min-height: calc(#{$content--fill-height-tabs} - 2px); + } + > .aui-card--fill > .el-card__header + .el-card__body { + min-height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px); + } + &.is-iframe { + height: calc(#{$content--fill-height-tabs} + #{$content--padding * 2}); + margin: -$content--padding; + min-height: auto; + > .aui-card--fill { + background-color: transparent; + } + > .aui-card--fill > .el-card__header { + background-color: #fff; + } + > .aui-card--fill > .el-card__body { + height: calc(#{$content--fill-height-tabs} - 2px); + margin: $content--padding; + min-height: auto; + border: $--border-base; + border-color: $--border-color-lighter; + border-radius: $--border-radius-base; + background-color: #fff; + } + > .aui-card--fill > .el-card__header + .el-card__body { + height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px); + } + } + } + } + } + // quill富文本编辑器 + .ql-toolbar { + line-height: 20px; + &.ql-snow { + border-color: $--border-color-base; + } + .ql-formats { + margin: 0 5px; + } + } + .ql-container { + height: 150px; + &.ql-snow { + border-color: $--border-color-base; + } + } +} + +.el-loading-mask { + z-index: 5001 !important; +} + +/* Page +------------------------------ */ +*[class*="aui-page__"] { + padding-top: 0; + .aui-content { + min-height: auto; + &__wrapper { + min-height: 100vh; + margin-left: 0; + } + > .aui-card--fill > .el-card__body { + min-height: calc(100vh - #{$content--padding * 2} - 2px); + } + > .aui-card--fill > .el-card__header + .el-card__body { + min-height: calc(100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px); + } + } +} diff --git a/src/js/store/index.js b/src/js/store/index.js index b9969fc6..8eaa5b65 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -1,49 +1,54 @@ -import Vue from 'vue' -import Vuex from 'vuex' -import cloneDeep from 'lodash/cloneDeep' -import user from './modules/user' -import app from './modules/app' -import tagsView from './modules/tagsView' +import Vue from "vue"; +import Vuex from "vuex"; +import cloneDeep from "lodash/cloneDeep"; +import user from "./modules/user"; +import app from "./modules/app"; +import tagsView from "./modules/tagsView"; -Vue.use(Vuex) +Vue.use(Vuex); export default new Vuex.Store({ namespaced: true, state: { // 导航条, 布局风格, defalut(白色) / colorful(鲜艳) - navbarLayoutType: 'colorful', + navbarLayoutType: "colorful", // 侧边栏, 布局皮肤, default(白色) / dark(黑色) - sidebarLayoutSkin: 'dark', + sidebarLayoutSkin: "dark", // 侧边栏, 折叠状态 sidebarFold: false, // 侧边栏, 菜单 sidebarMenuList: [], - sidebarMenuActiveName: '', - LevelOneMenuActiveName: '', + sidebarMenuActiveName: "", + LevelOneMenuActiveName: "", sidebarActiveSubMenuList: [], // 内容, 是否需要刷新 contentIsNeedRefresh: false, // 内容, 标签页(默认添加首页) contentTabs: [ { - ...window.SITE_CONFIG['contentTabDefault'], - 'name': 'home', - 'title': 'home' - } + ...window.SITE_CONFIG["contentTabDefault"], + name: "home", + title: "home", + }, ], - contentTabsActiveName: 'home' + contentTabsActiveName: "home", + + mainShuju: { + menuList: [], + activeName: "", + }, }, modules: { user, app, - tagsView + tagsView, }, mutations: { // 重置vuex本地储存状态 - resetStore (state) { + resetStore(state) { Object.keys(state).forEach((key) => { - state[key] = cloneDeep(window.SITE_CONFIG['storeState'][key]) - }) - } - } -}) + state[key] = cloneDeep(window.SITE_CONFIG["storeState"][key]); + }); + }, + }, +}); diff --git a/src/router/index.js b/src/router/index.js index a504f736..77937f91 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -67,16 +67,30 @@ export const moduleRoutes = { component: () => import('@/views/modules/home'), name: 'home', meta: { - title: '首页', + title: '主页', isTab: true } - }, - { - path: '/work-setpwd', - component: () => import('@/views/modules/workPc/setpwd'), - name: 'work-setpwd', + } + ] +} + +// 模块路由(基于主入口布局页面) 可视化数据 +export const moduleShujuRoutes = { + path: '/', + component: () => import('@/views/main-shuju/main'), + name: 'main-shuju', + redirect: { + name: 'home2' + }, + meta: { + title: '主入口布局' + }, + children: [{ + path: '/home2', + component: () => import('@/views/modules/home'), + name: 'home2', meta: { - title: '修改密码', + title: '主页2', isTab: true } } @@ -123,7 +137,7 @@ const router = new Router({ scrollBehavior: () => ({ y: 0 }), - routes: pageRoutes.concat(moduleRoutes) + routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes) }) router.beforeEach((to, from, next) => { @@ -136,22 +150,6 @@ router.beforeEach((to, from, next) => { return next() } - // 获取字典列表, 添加并全局变量保存 - // http - // .get('/sys/dict/type/all') - // .then(({ data: res }) => { - // if (res.code !== 0) { - // return - // } - // window.SITE_CONFIG['dictList'] = res.data - // }) - // .catch(() => {}) - // 获取菜单列表, 添加并全局变量保存 - - const userType = localStorage.getItem('userType') - - - if (userType === 'work') { const customerId = localStorage.getItem('customerId') console.log('customerId:', customerId) // if(customerId==='1e68188b8f7e9ab15658c164bd5b3676'){ @@ -212,7 +210,7 @@ router.beforeEach((to, from, next) => { if (res.code !== 0) { // Vue.prototype.$message.error(res.msg) return next({ - name: 'loginWork' + name: 'login' }) } window.SITE_CONFIG['menuList'] = res.data @@ -225,7 +223,7 @@ router.beforeEach((to, from, next) => { }) .catch(() => { next({ - name: 'loginWork' + name: 'login' }) }) // } @@ -234,7 +232,6 @@ router.beforeEach((to, from, next) => { // 1e68188b8f7e9ab15658c164bd5b3676 - } else { http .get('/oper/access/menu/nav') .then(({ @@ -246,8 +243,21 @@ router.beforeEach((to, from, next) => { name: 'login' }) } - window.SITE_CONFIG['menuList'] = res.data - fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList']) + window.SITE_CONFIG['menuShujuList'] = [ + { + icon: "icon-setting", + id: "2", + name: "基础信息", + url: "shequ/index" + }, + { + icon: "icon-setting", + id: "3", + name: "人员预警", + url: "base/resi" + } + ] + fnAddDynamicMenuRoutes2(window.SITE_CONFIG['menuShujuList']) // next({ ...to, replace: true }) next({ ...to, @@ -259,7 +269,6 @@ router.beforeEach((to, from, next) => { name: 'login' }) }) - } }) /** @@ -337,4 +346,56 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true } +function fnAddDynamicMenuRoutes2(menuList = [], routes = []) { + var temp = [] + for (var i = 0; i < menuList.length; i++) { + if (menuList[i].children && menuList[i].children.length >= 1) { + temp = temp.concat(menuList[i].children) + continue + } + // 组装路由 + var route = { + path: '', + component: null, + name: '', + meta: { + ...window.SITE_CONFIG['contentTabDefault'], + menuId: menuList[i].id, + title: menuList[i].name + } + } + // eslint-disable-next-line + let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => + eval(s2) + ) // URL支持{{ window.xxx }}占位符变量 + if (isURL(URL)) { + route['path'] = route['name'] = `i-${menuList[i].id}` + route['meta']['iframeURL'] = URL + } else { + URL = URL.replace(/^\//, '').replace(/_/g, '-') + route['path'] = route['name'] = URL.replace(/\//g, '-') + route['component'] = () => import(`@/views/modules/${URL}`) + } + routes.push(route) + } + if (temp.length >= 1) { + return fnAddDynamicMenuRoutes2(temp, routes) + } + // 添加路由 + router.addRoutes([{ + ...moduleShujuRoutes, + name: 'main-dynamic-menu-shuju', + children: routes + }, + { + path: '*', + redirect: { + name: '404' + } + } + ]) + window.SITE_CONFIG['dynamicMenuRoutesShuju'] = routes + window.SITE_CONFIG['dynamicMenuRoutesShujuHasAdded'] = true +} + export default router \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 1e96dbc0..f7f2ca77 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -27,7 +27,12 @@ export default new Vuex.Store({ 'title': 'home' } ], - contentTabsActiveName: 'home' + contentTabsActiveName: 'home', + + mainShuju: { + menuList: [], + activeName: "", + }, }, modules: { user diff --git a/src/views/components/editResi.vue b/src/views/components/editResi.vue index 67c6ef73..0170b276 100644 --- a/src/views/components/editResi.vue +++ b/src/views/components/editResi.vue @@ -472,7 +472,6 @@ export default { this.addList = [...this.mutiList] // console.log('addList----111', this.addList) } - // } this.addList.push(this.addCount++) if (this.fixed) { this.getGridList() this.getValiheList() @@ -483,11 +482,6 @@ export default { }, methods: { initForm () { - // console.log('formInfo', this.formInfo) - // if (Object.keys(this.formInfo).length > 0) { - // this.form = { ...this.formInfo } - // return - // } this.formList.forEach(async item => { if (item.optionSourceType === 'remote') { await this.getOptionsLists(item.optionSourceValue).then(res => { @@ -575,6 +569,7 @@ export default { // console.log('handlerMuscForm----000', this.$refs['baseForms' + item.row || item][0].handleForm()) arr.push([ ...this.$refs['baseForms' + item.row][0].handleForm() ]) }) + if (arr.length === 0) return arr let arr2 = arr.reduce(function (a, b) { return a.concat(b) }) let hash = {} let i = 0 diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 2a0bf6aa..f4c5b830 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -516,6 +516,7 @@ export default { margin-bottom: 20px; } .resi-search { + padding-right: 140px; .el-col { text-align: right; } diff --git a/src/views/main-navbar.vue b/src/views/main-navbar.vue index 18a3d95d..bce1e51a 100644 --- a/src/views/main-navbar.vue +++ b/src/views/main-navbar.vue @@ -40,13 +40,18 @@ + + 首页 + + {{ $t('updatePassword.title') }} @@ -158,6 +162,9 @@ export default { } }, methods: { + toIndexPage(){ + this.$router.replace('/indexWork') + }, // 通过menuId与动态(菜单)路由进行匹配跳转至指定路由 gotoRouteHandle(menuId, idx) { var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter( diff --git a/src/views/main-shuju/main-content.vue b/src/views/main-shuju/main-content.vue new file mode 100644 index 00000000..6d470b37 --- /dev/null +++ b/src/views/main-shuju/main-content.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/views/main-shuju/main-navbar-update-password-work.vue b/src/views/main-shuju/main-navbar-update-password-work.vue new file mode 100644 index 00000000..c29715ba --- /dev/null +++ b/src/views/main-shuju/main-navbar-update-password-work.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/views/main-shuju/main-navbar.vue b/src/views/main-shuju/main-navbar.vue new file mode 100644 index 00000000..df9555f2 --- /dev/null +++ b/src/views/main-shuju/main-navbar.vue @@ -0,0 +1,246 @@ + + + + + + + diff --git a/src/views/main-shuju/main.vue b/src/views/main-shuju/main.vue new file mode 100644 index 00000000..731629bd --- /dev/null +++ b/src/views/main-shuju/main.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/src/views/main-sidebar.vue b/src/views/main-sidebar.vue index fdd5bd82..6f76c2b5 100644 --- a/src/views/main-sidebar.vue +++ b/src/views/main-sidebar.vue @@ -4,27 +4,11 @@ >
- - - - @@ -25,7 +26,7 @@ :prop="item.columnName" :label="item.label" align="center" - width="180"> + :width="item.itemType === 'radio' ? 80 : 180"> @@ -85,7 +86,7 @@
取消 - 提交 + 提交
@@ -111,7 +112,7 @@
取消 - 提交 + 提交
@@ -130,6 +131,8 @@ export default { }, data () { return { + tableLoading: false, + btnLoading: false, disabled: false, pageLoading: false, dialogEditVisible: false, @@ -266,8 +269,8 @@ export default { }, async handleEdit (row) { this.disabled = false - await this.getFormList() - this.getrowInfo(row.icResiUserId) + await this.getFormList('edit') + await this.getrowInfo(row.icResiUserId) }, async handleAdd () { await this.getFormList() @@ -400,8 +403,9 @@ export default { }) this.dialogVisible = false }, - submitAdd (arr) { - this.$http + async submitAdd (arr) { + this.btnLoading = true + await this.$http .post('/epmetuser/icresiuser/add', arr) .then(({ data: res }) => { if (res.code !== 0) { @@ -420,12 +424,15 @@ export default { .catch(() => { return this.$message.error('网络错误') }) + this.btnLoading = false }, - submitEdit (arr) { - this.$http + async submitEdit (arr) { + this.btnLoading = true + await this.$http .post('/epmetuser/icresiuser/edit', arr) .then(({ data: res }) => { if (res.code !== 0) { + return this.$message.error(res.msg) } else { this.$message.success('提交成功') @@ -441,6 +448,7 @@ export default { .catch(() => { return this.$message.error('网络错误') }) + this.btnLoading = false }, getTableHeader () { this.$http @@ -456,14 +464,15 @@ export default { return this.$message.error('网络错误') }) }, - getTableData () { + async getTableData () { + this.tableLoading = true let params = { formCode: 'resi_base_info', pageNo: this.currentPage, pageSize: this.pageSize, conditions: this.conditions } - this.$http + await this.$http .post('/epmetuser/icresiuser/listresi', params) .then(({ data: res }) => { if (res.code !== 0) { @@ -476,6 +485,7 @@ export default { .catch(() => { return this.$message.error('网络错误') }) + this.tableLoading = false }, getrowInfo (id) { let params = { @@ -588,7 +598,7 @@ export default { return this.$message.error('网络错误') }) }, - async getFormList () { + async getFormList (type) { await this.$http .post('/oper/customize/icform/getcustomerform', { formCode: 'resi_base_info', dynamic: true }) .then(({ data: res }) => { @@ -598,23 +608,25 @@ export default { console.log('获取详情成功getFormList') let { itemList, groupList } = res.data this.activeName = 'group' + res.data.groupList[0].groupId - itemList.forEach(async item => { - if (item.optionSourceType === 'remote') { - await this.getOptionsList(item.optionSourceValue).then(res => { - item.options = res - }) - } - }) - groupList.forEach(item => { - item.itemList.forEach(async n => { - n.tableName = item.tableName - if (n.optionSourceType === 'remote') { - await this.getOptionsList(n.optionSourceValue).then(res => { - n.options = res + if (type !== 'edit') { + itemList.forEach(async item => { + if (item.optionSourceType === 'remote') { + await this.getOptionsList(item.optionSourceValue).then(res => { + item.options = res }) } }) - }) + groupList.forEach(item => { + item.itemList.forEach(async n => { + n.tableName = item.tableName + if (n.optionSourceType === 'remote') { + await this.getOptionsList(n.optionSourceValue).then(res => { + n.options = res + }) + } + }) + }) + } this.formList = itemList this.tabsList = groupList } diff --git a/src/views/pages/indexWork.vue b/src/views/pages/indexWork.vue index 760ff1ac..6048c4c2 100644 --- a/src/views/pages/indexWork.vue +++ b/src/views/pages/indexWork.vue @@ -51,9 +51,9 @@ export default { methods: { handleClickItem(k) { if (k == 1) { - this.$router.replace({ name: 'home' }) + this.$router.replace({ name: 'main' }) } else if (k == 2) { - this.$router.replace({ name: 'home' }) + this.$router.replace({ name: 'main-shuju' }) } },