diff --git a/src/api/user.js b/src/api/user.js index 436705b3..fa1c2de0 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -18,7 +18,8 @@ export function getInfo(token) { export function logout() { return request({ - url: '/vue-element-admin/user/logout', - method: 'post' - }) + url: '/commonAction.do', + method: 'post', + data: 'funid=login&pagetype=login&eventcode=logout&user_id=administrator&dataType=json' + }).then(response => response.data) } diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 11682e70..3408b684 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -33,12 +33,12 @@ export default { methods: { getBreadcrumb() { // only show routes with meta.title - let matched = this.$route.matched.filter(item => item.meta && item.meta.title) - const first = matched[0] + const matched = this.$route.matched.filter(item => item.meta && item.meta.title) + // const first = matched[0] - if (!this.isDashboard(first)) { - matched = [{ path: '/', meta: { title: '安全生产' }}].concat(matched) - } + // if (!this.isDashboard(first)) { + // matched = [{ path: '/', meta: { title: '安全生产' }}].concat(matched) + // } this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) }, diff --git a/src/components/Buttons/index.vue b/src/components/Buttons/index.vue index 70e57ed7..c7439aba 100644 --- a/src/components/Buttons/index.vue +++ b/src/components/Buttons/index.vue @@ -17,8 +17,8 @@ export default { }, data() { return { - data: [] - + data: [], + loading: false } }, created() { @@ -26,9 +26,11 @@ export default { }, methods: { getButtons() { + this.loading = true api.getButtons(this.funid).then(data => { if (data.success) { this.data = data.data.buttons + this.loading = false } else { this.$message.error(data.message) } diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue index f9e4e997..3e7e4e42 100644 --- a/src/components/RightPanel/index.vue +++ b/src/components/RightPanel/index.vue @@ -125,10 +125,10 @@ export default { } .handle-button { - width: 48px; - height: 48px; + width: 38px; + height: 38px; position: absolute; - left: -48px; + left: -38px; text-align: center; font-size: 24px; border-radius: 6px 0 0 6px !important; @@ -136,10 +136,10 @@ export default { pointer-events: auto; cursor: pointer; color: #fff; - line-height: 48px; + line-height: 38px; i { font-size: 24px; - line-height: 48px; + line-height: 38px; } } diff --git a/src/components/selDept/index.vue b/src/components/selDept/index.vue index e3551a90..739d7c11 100644 --- a/src/components/selDept/index.vue +++ b/src/components/selDept/index.vue @@ -58,6 +58,12 @@ import api from './api' export default { name: 'SelDept', + props: { + selective: { + type: String, + default: null + } + }, data() { return { loading: false, @@ -116,7 +122,8 @@ export default { }, treeList: [], whereSql: false, - whereValue: '' + whereValue: '', + Dpets: '' } }, created() { @@ -318,8 +325,12 @@ export default { this.pager.pageNo = page this.getList() }, - handleSelectionChange(val) { - this.$emit('updateDepts', val) + handleSelectionChange(row) { + if (this.selective) { + this.$emit('updateDepts', row) + } else { + this.Dpets = row + } }, closeDialog() { this.dialogFormVisible = false diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index abac0401..ca0d3fc1 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -24,20 +24,8 @@ - - Profile - - - Dashboard - - - Github - - - Docs - - - Log Out + + 退出登录 @@ -53,6 +41,7 @@ import ErrorLog from '@/components/ErrorLog' import Screenfull from '@/components/Screenfull' // import SizeSelect from '@/components/SizeSelect' import Search from '@/components/HeaderSearch' +import { logout } from '@/api/user' export default { components: { @@ -75,8 +64,15 @@ export default { this.$store.dispatch('app/toggleSideBar') }, async logout() { - await this.$store.dispatch('user/logout') - this.$router.push(`/login?redirect=${this.$route.fullPath}`) + logout().then(data => { + if (data.success) { + this.$store.dispatch('user/logout') + this.$router.push(`/login?redirect=${this.$route.fullPath}`) + this.$message.success('已退出登录!') + } else { + this.$message.error(data.message) + } + }) } } } diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 32ef0189..a69d4703 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -1,25 +1,25 @@ @@ -101,12 +122,15 @@ import publicApi from '@/api/public' import buttons from '@/components/formBtn' import InspDet from '../insp_det' import SelUser from '@/components/selUser' +import InspName from '../inspName' +import { parseDay } from '@/utils' export default { name: 'EditForm', components: { buttons, SelUser, - InspDet + InspDet, + InspName }, // props: { // id: { type: String, default: () => '' } @@ -114,11 +138,60 @@ export default { data() { return { loading: false, - form: {}, + parseDay, + form: { + safe_insp__insp_code: '', + safe_insp__insp_name: '', + safe_insp__insp_state: '', + safe_insp__insp_date: '', + safe_insp__insp_man: '', + safe_insp__insp_times: '', + safe_insp__insp_memo: '', + safe_insp__insp_ed: '', + safe_insp__insp_ing: '', + safe_insp__insp_non: '', + safe_insp__safe_insp_id: '' + }, + rules: { + safe_insp__insp_name: [ + { required: true, message: '请选择巡检名称', trigger: 'blur' } + ], + safe_insp__insp_man: [ + { required: true, message: '请选择巡检人员', trigger: 'blur' } + ], + safe_insp__insp_date: [ + { required: true, message: '请选择巡检日期', trigger: 'blur' } + ], + safe_insp__insp_times: [ + { required: true, message: '请选择巡检频率', trigger: 'blur' } + ] + }, id: this.$route.params.id, disabled: false, options: [], - selUserVisible: false + insptimes: [], + selUserVisible: false, + inspNameVisible: false + } + }, + watch: { + 'form.safe_insp__insp_name': { + handler(val, oldVal) { + this.$refs['safe_insp__insp_name'].clearValidate() + }, + deep: true + }, + 'form.safe_insp__insp_man': { + handler(val, oldVal) { + this.$refs['safe_insp__insp_man'].clearValidate() + }, + deep: true + }, + 'form.safe_insp__insp_times': { + handler(val, oldVal) { + this.$refs['safe_insp__insp_times'].clearValidate() + }, + deep: true } }, created() { @@ -132,6 +205,7 @@ export default { api.getFormDate(this.id).then(data => { if (data.success) { this.form = data.data.root[0] + this.form.safe_insp__insp_date = parseDay(data.data.root[0].safe_insp__insp_date) setTimeout(() => { this.loading = false }, 200) @@ -149,6 +223,15 @@ export default { } }) }, + async getInsptimes() { + await publicApi.getTypeSel('insptimes').then(data => { + if (data.success) { + this.insptimes = data.data.root + } else { + this.$message.error(data.message) + } + }) + }, onSubmit() {}, updateUser(data) { this.form.safe_insp__insp_man = data.sys_user__user_name @@ -168,6 +251,11 @@ export default { } }) }, + updateInspName(data) { + this.form.safe_insp__insp_name = data.insp_name__insp_name + this.form.safe_insp__insp_name_id = data.insp_name__insp_name_id + this.inspNameVisible = false + }, back() { // this.$router.back(-1) } diff --git a/src/views/safe_insp/index.vue b/src/views/safe_insp/index.vue index 4865f4c2..457c4d9d 100644 --- a/src/views/safe_insp/index.vue +++ b/src/views/safe_insp/index.vue @@ -3,20 +3,26 @@