From 71cd86a7f2ced3be61b28c665543f0db69d2594e Mon Sep 17 00:00:00 2001 From: renguanyu111 <80379958+renguanyu111@users.noreply.github.com> Date: Tue, 26 Apr 2022 14:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A9=E6=95=88=E5=90=8E=E5=8F=B020220426?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/--layout/components/AppMain.vue | 48 +++ src/--layout/components/Navbar.vue | 152 +++++++ src/--layout/components/Sidebar/FixiOSBug.js | 26 ++ src/--layout/components/Sidebar/Item.vue | 41 ++ src/--layout/components/Sidebar/Link.vue | 49 +++ src/--layout/components/Sidebar/Logo.vue | 82 ++++ .../components/Sidebar/SidebarItem copy.vue | 95 +++++ .../components/Sidebar/SidebarItem.vue | 95 +++++ src/--layout/components/Sidebar/index.vue | 95 +++++ .../components/Sidebar/subMenu copy.vue | 42 ++ src/--layout/components/Sidebar/subMenu.vue | 43 ++ src/--layout/components/index.js | 3 + src/--layout/index.vue | 103 +++++ src/--layout/mixin/ResizeHandler copy.js | 45 +++ src/--layout/mixin/ResizeHandler.js | 45 +++ src/App.vue | 19 +- src/api/user.js | 88 ++++ src/layout/components/Navbar.vue | 1 + src/router/index.js | 21 +- .../departmentalAssessment.vue | 50 ++- .../qualitativeIndicators.vue | 205 +++++++++- src/views/basicInfo/project.vue | 3 +- src/views/basicInfo/target.vue | 20 +- src/views/ce/index.vue | 49 +++ src/views/frontPage/index.vue | 7 + src/views/login/wxLogin.vue | 378 ++++++++++++++++++ src/views/menuSettings/index.vue | 378 ++++++++++++++++++ 27 files changed, 2138 insertions(+), 45 deletions(-) create mode 100644 src/--layout/components/AppMain.vue create mode 100644 src/--layout/components/Navbar.vue create mode 100644 src/--layout/components/Sidebar/FixiOSBug.js create mode 100644 src/--layout/components/Sidebar/Item.vue create mode 100644 src/--layout/components/Sidebar/Link.vue create mode 100644 src/--layout/components/Sidebar/Logo.vue create mode 100644 src/--layout/components/Sidebar/SidebarItem copy.vue create mode 100644 src/--layout/components/Sidebar/SidebarItem.vue create mode 100644 src/--layout/components/Sidebar/index.vue create mode 100644 src/--layout/components/Sidebar/subMenu copy.vue create mode 100644 src/--layout/components/Sidebar/subMenu.vue create mode 100644 src/--layout/components/index.js create mode 100644 src/--layout/index.vue create mode 100644 src/--layout/mixin/ResizeHandler copy.js create mode 100644 src/--layout/mixin/ResizeHandler.js create mode 100644 src/views/ce/index.vue create mode 100644 src/views/login/wxLogin.vue create mode 100644 src/views/menuSettings/index.vue diff --git a/src/--layout/components/AppMain.vue b/src/--layout/components/AppMain.vue new file mode 100644 index 0000000..63783eb --- /dev/null +++ b/src/--layout/components/AppMain.vue @@ -0,0 +1,48 @@ + + + + + + + diff --git a/src/--layout/components/Navbar.vue b/src/--layout/components/Navbar.vue new file mode 100644 index 0000000..a5081eb --- /dev/null +++ b/src/--layout/components/Navbar.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/--layout/components/Sidebar/FixiOSBug.js b/src/--layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..bc14856 --- /dev/null +++ b/src/--layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,26 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + // https://github.com/PanJiaChen/vue-element-admin/issues/1135 + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/src/--layout/components/Sidebar/Item.vue b/src/--layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..aa1f5da --- /dev/null +++ b/src/--layout/components/Sidebar/Item.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/--layout/components/Sidebar/Link.vue b/src/--layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..09075ed --- /dev/null +++ b/src/--layout/components/Sidebar/Link.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/--layout/components/Sidebar/Logo.vue b/src/--layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..040fab6 --- /dev/null +++ b/src/--layout/components/Sidebar/Logo.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/--layout/components/Sidebar/SidebarItem copy.vue b/src/--layout/components/Sidebar/SidebarItem copy.vue new file mode 100644 index 0000000..a418c3d --- /dev/null +++ b/src/--layout/components/Sidebar/SidebarItem copy.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/--layout/components/Sidebar/SidebarItem.vue b/src/--layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..9c308f2 --- /dev/null +++ b/src/--layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/--layout/components/Sidebar/index.vue b/src/--layout/components/Sidebar/index.vue new file mode 100644 index 0000000..b1fef16 --- /dev/null +++ b/src/--layout/components/Sidebar/index.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/--layout/components/Sidebar/subMenu copy.vue b/src/--layout/components/Sidebar/subMenu copy.vue new file mode 100644 index 0000000..7163210 --- /dev/null +++ b/src/--layout/components/Sidebar/subMenu copy.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/src/--layout/components/Sidebar/subMenu.vue b/src/--layout/components/Sidebar/subMenu.vue new file mode 100644 index 0000000..122d210 --- /dev/null +++ b/src/--layout/components/Sidebar/subMenu.vue @@ -0,0 +1,43 @@ + + + + + \ No newline at end of file diff --git a/src/--layout/components/index.js b/src/--layout/components/index.js new file mode 100644 index 0000000..97ee3cd --- /dev/null +++ b/src/--layout/components/index.js @@ -0,0 +1,3 @@ +export { default as Navbar } from './Navbar' +export { default as Sidebar } from './Sidebar' +export { default as AppMain } from './AppMain' diff --git a/src/--layout/index.vue b/src/--layout/index.vue new file mode 100644 index 0000000..df648d5 --- /dev/null +++ b/src/--layout/index.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/--layout/mixin/ResizeHandler copy.js b/src/--layout/mixin/ResizeHandler copy.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/--layout/mixin/ResizeHandler copy.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/--layout/mixin/ResizeHandler.js b/src/--layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/--layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/App.vue b/src/App.vue index ec9032c..c94831c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,23 @@ diff --git a/src/api/user.js b/src/api/user.js index 149beb6..5f8c5d4 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -71,3 +71,91 @@ export function logout() { method: 'post' }) } +// @Summary 系统菜单列表 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const systemmenulist = (data) => { + return request({ + url: '/systemmenu/systemmenulist', + method: 'post', + data: data + }) +} +// @Summary 添加菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const addmenu = (data) => { + return request({ + url: '/systemmenu/addmenu', + method: 'post', + data: data + }) +} +// @Summary 修改菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const eitemenu = (data) => { + return request({ + url: '/systemmenu/eitemenu', + method: 'post', + data: data + }) +} +// @Summary 删除菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const delmenu = (data) => { + return request({ + url: '/systemmenu/delmenu', + method: 'post', + data: data + }) +} +// @Summary 添加菜单功能 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const addmenuoperation = (data) => { + return request({ + url: '/systemmenu/addmenuoperation', + method: 'post', + data: data + }) +} +// @Summary 删除菜单功能 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const delmenuperation = (data) => { + return request({ + url: '/systemmenu/delmenuperation', + method: 'post', + data: data + }) +} +// @Summary 查询个人信息 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const scancode = (data) => { + return request({ + url: '/noverify/scancode', + method: 'post', + data: data + }) +} +// @Summary 超级登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const scancodelogin = (data) => { + return request({ + url: '/base/scancodelogin', + method: 'post', + data: data + }) +} diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index a5081eb..de9f067 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -60,6 +60,7 @@ export default { this.$router.push('/login') } this.userInfo=JSON.parse(sessionStorage.getItem('userinfo')); + }, methods: { toggleSideBar() { diff --git a/src/router/index.js b/src/router/index.js index 9ff4075..04b3dbf 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,6 @@ Vue.use(Router) /* Layout */ import Layout from '@/layout' - /** * Note: sub-menu only appear when route children.length >= 1 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html @@ -31,9 +30,14 @@ import Layout from '@/layout' * all roles can be accessed */ export const constantRoutes = [ + { + path: '/ceshi', + component: () => import('@/views/ce/index'), + // hidden: true + }, { path: '/login', - component: () => import('@/views/login/index'), + component: () => import('@/views/login/wxLogin'), hidden: true }, { @@ -67,6 +71,19 @@ export const constantRoutes = [ meta: { title: '首页'} }] }, + // /setsystem/systemmenulist + { + path: '/setsystem', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'systemmenulist', + component: () => import('@/views/menuSettings/index'), + }, + ], + }, // { // path: '/', // component: Layout, diff --git a/src/views/assessmentProgram/departmentalAssessment.vue b/src/views/assessmentProgram/departmentalAssessment.vue index ac0e528..d6da030 100644 --- a/src/views/assessmentProgram/departmentalAssessment.vue +++ b/src/views/assessmentProgram/departmentalAssessment.vue @@ -14,15 +14,16 @@ - - - - - + + + - + + @@ -345,14 +347,15 @@ - + + @@ -609,6 +612,13 @@ export default { }, data() { return { + props1: { + checkStrictly: true, + value: "id", + label: "name", + children: "children", + emitPath:false, + }, contentShow:false, editTargerFrom:{}, detailsShow:false, @@ -767,7 +777,7 @@ export default { }, // 新条件查询变量 searchVersion: { - group: "3", + group: '', deaprtid:'', year: "", //年 }, @@ -1189,7 +1199,6 @@ export default { type: 1, //1:定性考核;2:定量考核 targetid: this.form.target.toString(), //指标 targetsunid: val.toString() //子栏目 - } const res = await gettasktargetcontary(from) this.rulesList=JSON.parse(JSON.stringify(res.data)) @@ -1263,7 +1272,7 @@ export default { async initialDepartment(){ const departmentFrom={ - id:3 + id:2 } const res = await departmentlist(departmentFrom) this.departmentList=res.data @@ -1282,8 +1291,11 @@ export default { }, // 获取公司 async getGrouplist(){ - const res = await getgroupdepartmap() - this.companyList=res.data.list + const idFrom = { + id:1 + } + const res = await getgroupdepartmap(idFrom) + this.companyList=res.data }, // 添加获取选中组件值 @@ -1489,7 +1501,7 @@ export default { } this.versionData = res.data this.searchVersion={ - group: "3", + group: '', deaprtid:'', year: "", //年 } diff --git a/src/views/assessmentProgram/qualitativeIndicators.vue b/src/views/assessmentProgram/qualitativeIndicators.vue index d244b49..2005e10 100644 --- a/src/views/assessmentProgram/qualitativeIndicators.vue +++ b/src/views/assessmentProgram/qualitativeIndicators.vue @@ -162,7 +162,7 @@ - + @@ -191,7 +191,7 @@ - + - + + + + + + + + + + + + + v-model="scope.row.detailedtargetcontent"> @@ -498,7 +534,7 @@ - +