| | |
| | | params: data |
| | | }) |
| | | } |
| | | // 角色新增、编辑保存 |
| | | export function RoleAddUpdateSava(data) { |
| | | return request({ |
| | | url: 'BasicSetting/RoleAddUpdateSava', |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | | } |
| | | // 角色删除 |
| | | export function RoleDeleteSava(data) { |
| | | return request({ |
| | | url: 'BasicSetting/RoleDeleteSava', |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 角色权限角色编码、操作端编码查询菜单及按钮 |
| | | export function RolePermissionSearchRoleMenu(data) { |
| | |
| | | // params: { token } |
| | | // }) |
| | | // } |
| | | |
| | | export function logout(data) { |
| | | return request({ |
| | | url: '/Login/LoginOut', |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | export function UserTorgData(data) { |
| | | return request({ |
| | | url: '/Login/UserTorgData', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | export function UpdateUserPassword(data) { |
| | | return request({ |
| | | url: '/Login/UpdateUserPassword', |
| | |
| | | </el-badge> |
| | | </el-tooltip> |
| | | |
| | | <div style=" font-size: 18px;font-family: 'Microsoft YaHei';color:#AAAAAA;padding:0 8px;cursor: pointer"> |
| | | {{ stu_torgname }} |
| | | <div style=" font-size: 18px;font-family: 'Microsoft YaHei';color:#AAAAAA;cursor: pointer"> |
| | | <!-- {{ stu_torgname }}--> |
| | | |
| | | <el-dropdown class="avatar-container" trigger="hover"> |
| | | <div class="avatar-wrapper"> |
| | | <div style="display: flex;align-items: center;margin-top: -5px"> |
| | | |
| | | <!-- <i class="el-icon-user" style="font-weight: bolder;font-size: 18px;margin-right: 5px;color:#A7A7A7" />--> |
| | | <div style=" font-size: 18px;font-family: 'Microsoft YaHei';color:#AAAAAA">{{ stu_torgname }}</div> |
| | | </div> |
| | | |
| | | </div> |
| | | <el-dropdown-menu |
| | | v-if="stu_torgname.toString().length>0" |
| | | slot="dropdown" |
| | | class="user-dropdown" |
| | | style="text-align: center" |
| | | > |
| | | <el-dropdown-item |
| | | v-for="(item,index) in $stu_torg" |
| | | :key="item.torg_code" |
| | | :divided="index!==0" |
| | | @click.native="changeTrog(item)" |
| | | > |
| | | <span style="display:block;">{{ item.torg_name }}</span> |
| | | </el-dropdown-item> |
| | | |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | |
| | | </div> |
| | | <!-- <el-tooltip content="Global Size" effect="dark" placement="bottom">--> |
| | | <!-- <size-select id="size-select" class="right-menu-item hover-effect" />--> |
| | |
| | | import MenuItemEx from './Sidebar/MenuItemEx' |
| | | import Breadcrumb from '@/components/Breadcrumb' |
| | | import Hamburger from '@/components/Hamburger' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { getCookie, setCookie } from '@/utils/auth' |
| | | import { UpdateUserPassword } from '@/api/user' |
| | | import Search from '@/components/HeaderSearch' |
| | | import Screenfull from '@/components/Screenfull' |
| | |
| | | ], |
| | | created() { |
| | | // this.$signalr.start() |
| | | this.usercode = getCookie('navTabId') |
| | | this.username = getCookie('username') |
| | | this.stu_torgname = getCookie('stu_torgname') |
| | | |
| | | this.usercode = localStorage.getItem('usercode') |
| | | this.username = localStorage.getItem('username') |
| | | Vue.prototype.$stu_torg = JSON.parse(localStorage.getItem('torg')) |
| | | |
| | | if (Vue.prototype.$stu_torg.length > 0) { |
| | | this.stu_torgname = Vue.prototype.$stu_torg[0].torg_name |
| | | setCookie('torg_code', Vue.prototype.$stu_torg.find(i => i.torg_name === this.stu_torgname).torg_code) |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.getHubConnectionBuilder() |
| | | |
| | | Vue.prototype.$ButtonData = JSON.parse(sessionStorage.getItem('ButtonData')) |
| | | Vue.prototype.$ButtonData = JSON.parse(localStorage.getItem('ButtonData')) |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | changeTrog(val) { |
| | | if (val.torg_name !== this.stu_torgname) { |
| | | this.stu_torgname = val.torg_name |
| | | setCookie('torg_code', val.torg_code) |
| | | } |
| | | }, |
| | | // 建立hub连接 |
| | | async getHubConnectionBuilder() { |
| | | const url = 'http://121.196.36.24:8019/chatHub' |
| | |
| | | |
| | | // jwt解密获取用户编码 |
| | | const jwt = decode(localStorage.getItem('token')) |
| | | setCookie('usercode', jwt.usercode) |
| | | setCookie('stu_torgname', jwt.stu_torgname) |
| | | setCookie('username', jwt.username) |
| | | localStorage.setItem('usercode', jwt.usercode) |
| | | |
| | | // 拉取菜单信息表 |
| | | const menu = await store.dispatch('user/getMenu') |
| | |
| | | import { login, logout, getInfo, LoginMenu, LoginMenuCloud } from '@/api/user' |
| | | import { login, logout, getInfo, LoginMenu, LoginMenuCloud, UserTorgData } from '@/api/user' |
| | | import { getToken, setToken, removeToken, setCookie, removeCookie, getCookie } from '@/utils/auth' |
| | | import { resetRouter } from '@/router' |
| | | import { ButtonData } from '@/api/basicSettings' |
| | | |
| | | const getDefaultState = () => { |
| | | return { |
| | |
| | | |
| | | localStorage.setItem('token', res.data) |
| | | |
| | | // login({ UserName: '001', PassWord: 123, HOrgName: 1 }).then(response => { |
| | | // const { data: res } = response |
| | | // if (res.code === '200') { |
| | | // setCookie('username', res.data.username) |
| | | // setCookie('admin', res.data.usercode) |
| | | // setCookie('navTabId', res.data.usercode) |
| | | // setCookie('usertype', res.data.usertype) |
| | | // setCookie('userid', res.data.userid) |
| | | // setCookie('rediskey', res.data.rediskey) |
| | | // setCookie('guid', res.data.guid) |
| | | // setCookie('stu_torgcode', res.data.stu_torgcode) |
| | | // setCookie('stu_torgname', res.data.stu_torgname) |
| | | // setCookie('description', res.data.description) |
| | | // } |
| | | // console.log(res.code === '302', 8989) |
| | | // if (res.code === '302') { |
| | | setCookie('code', res.code) |
| | | // } |
| | | // commit('SET_TOKEN', data.token) |
| | | // setToken(res) |
| | | // commit('SET_TOKEN', res) |
| | | // setToken(res) |
| | | resolve() |
| | | }).catch(error => { |
| | | reject(error) |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // get user menu |
| | | getMenu({ commit, state }) { |
| | | return new Promise((resolve, reject) => { |
| | | console.log('进来了11111') |
| | | LoginMenu({ usertype: 'PC', usercode: getCookie('usercode') }).then(res => { |
| | | console.log('菜单接口进来了11111') |
| | | LoginMenu({ usertype: 'PC', usercode: localStorage.getItem('usercode') }).then(res => { |
| | | if (res.code === '200') { |
| | | UserTorgData({ usercode: localStorage.getItem('usercode') }).then(res1 => { |
| | | localStorage.setItem('username', res1.data.user) |
| | | localStorage.setItem('torg', JSON.stringify(res1.data.torg)) |
| | | }) |
| | | ButtonData().then(res2 => { |
| | | localStorage.setItem('ButtonData', JSON.stringify(res2.data)) |
| | | }) |
| | | |
| | | commit('SET_NAME', res.message) |
| | | commit('SET_MENU', res.data) |
| | | resolve(res.data) |
| | |
| | | // type: 'error', |
| | | // duration: 5 * 1000 |
| | | // }) |
| | | removeCookie('usercode') |
| | | localStorage.removeItem('usercode') |
| | | localStorage.removeItem('torg') |
| | | localStorage.removeItem('token') |
| | | sessionStorage.removeItem('tabViews') |
| | | // setTimeout(() => { |
| | |
| | | <input |
| | | v-if="data.isEdit" |
| | | :ref="data.code" |
| | | v-model="node.label" |
| | | v-model="data.name" |
| | | type="text" |
| | | @click.stop |
| | | @blur="roleSave(data)" |
| | |
| | | <script> |
| | | import waves from '@/directive/waves' |
| | | import { |
| | | DataPermissions, |
| | | DataPermissions, RoleAddUpdateSava, RoleDeleteSava, |
| | | RolePermissionSava, |
| | | RolePermissionSearchRole, |
| | | RolePermissionSearchRoleMenu, |
| | |
| | | it.buttoncodelist.includes(j.buttoncode) |
| | | ) |
| | | |
| | | // let temp = this.allButtonData.filter(j => j.menucode === it.menucode).length > 0 ? this.allButtonData.filter(j => j.menucode === it.menucode)[0].buttoncode : [] |
| | | // temp = temp.length > 0 ? temp.split(',') : [] |
| | | |
| | | // it.buttonChecked = [] // 数据回显 |
| | | // it.buttoncodelist.forEach(j => { |
| | | // if (temp.includes(j.buttoncode)) { |
| | | // it.buttonChecked.push(j.buttonname) |
| | | // } |
| | | // }) |
| | | |
| | | it.buttoncodelist = it.buttoncodelist.map(j => j.buttonname) |
| | | } |
| | | |
| | |
| | | it.datacodelist.includes(j.datacode) |
| | | ).map(j => j.dataname) |
| | | } |
| | | // const datacode = this.allButtonData.filter(j => j.menucode === it.menucode).length > 0 ? this.allButtonData.filter(j => j.menucode === it.menucode)[0].datacode : '' |
| | | // it.dataChecked = datacode ? this.dataKeyValue.find(j => j.datacode === datacode).dataname : '' // 数据回显 |
| | | }) |
| | | |
| | | item.expanded = true |
| | |
| | | }, |
| | | // 角色名称新增 |
| | | rolePlusClick() { |
| | | this.treeLeft[0].roles.push({ code: 1234, name: '', isEdit: true }) |
| | | this.treeLeft[0].roles.push({ code: '', name: '', isEdit: true }) |
| | | }, |
| | | // 角色名称修改 |
| | | roleEditClick(self, node, data) { |
| | |
| | | // 角色名称删除 |
| | | roleDeleteClick(self, node, data) { |
| | | // console.log(self, node, data) |
| | | // this.treeLeft[0].roles.forEach((item, index) => { |
| | | // if (item.code === data.code) { |
| | | // this.treeLeft[0].roles.splice(index, 1) // 暂时先写成前端删除,后期调用接口删除 |
| | | // } |
| | | // }) |
| | | const D = { |
| | | rolecode: data.code, |
| | | rolename: data.name, |
| | | type: this.activeName |
| | | } |
| | | RoleDeleteSava(D).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('角色删除成功!') |
| | | } |
| | | this.getRolePermissionSearchRole() |
| | | }) |
| | | }, |
| | | // 角色名称保存 采用防抖形式 |
| | | roleSave: throttle(function(data) { |
| | | data.isEdit = false |
| | | console.log('执行了!') |
| | | roleSave: throttle(function(val) { |
| | | val.isEdit = false |
| | | const data = { |
| | | rolecode: val.code, |
| | | rolename: val.name, |
| | | type: val.code === '' ? 'Add' : 'Update' |
| | | } |
| | | console.log(data, '执行了!') |
| | | RoleAddUpdateSava(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(val.code === '' ? '角色新增成功!' : '角色修改成功!') |
| | | } |
| | | }) |
| | | this.getRolePermissionSearchRole() |
| | | }, 1000, true), |
| | | |
| | | // 页面勾选好保存事件 |
| | |
| | | } |
| | | }) |
| | | |
| | | // console.log(arr, 'arr') |
| | | const rolecode = this.$refs.treeLeftRef.getCurrentKey() |
| | | const res = await RolePermissionSava(JSON.stringify(arr), rolecode, this.activeName) |
| | | if (res.code === '200') { |
| | | const rolename = this.treeLeft[0].roles.find(i => i.code === rolecode).name |
| | | this.$notify.success(rolename + '的角色权限提交成功!') |
| | | await this.getRolePermissionSearchRoleMenuButton(rolecode) |
| | | // await this.getRolePermissionSearchRoleMenu(rolecode) |
| | | } |
| | | // this.$forceUpdate() |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | |
| | | <script> |
| | | import { validUsername } from '@/utils/validate' |
| | | import { getCookie, removeCookie, setCookie } from '@/utils/auth' |
| | | import { ForcedOffline } from '@/api/user' |
| | | import { ForcedOffline, UserTorgData } from '@/api/user' |
| | | import { ButtonData } from '@/api/basicSettings' |
| | | import Vue from 'vue' |
| | | |
| | |
| | | if (valid) { |
| | | this.loading = true |
| | | this.$store.dispatch('user/login', this.loginForm).then(() => { |
| | | // console.log(getCookie('code') === '302', 9999) |
| | | if (getCookie('code') === '302') { |
| | | this.dialogVisible = true |
| | | } else { |
| | | this.$router.push({ path: this.redirect || '/' }) |
| | | ButtonData().then(res => { |
| | | sessionStorage.setItem('ButtonData', JSON.stringify(res.data)) |
| | | }) |
| | | // ButtonData().then(res => { |
| | | // localStorage.setItem('ButtonData', JSON.stringify(res.data)) |
| | | // }) |
| | | // UserTorgData({ usercode: getCookie('usercode') }).then(res => { |
| | | // setCookie('username', res.data.user) |
| | | // // sessionStorage.setItem('username', res.data.user) |
| | | // sessionStorage.setItem('torg', JSON.stringify(res.data.torg)) |
| | | // }) |
| | | } |
| | | this.loading = false |
| | | }).catch(() => { |
| | |
| | | -webkit-text-fill-color: #000 !important; |
| | | } |
| | | } |
| | | |
| | | ::v-deep .el-dialog__title{ |
| | | color: red; |
| | | } |
| | |
| | | display: flex; |
| | | justify-content: end; |
| | | } |
| | | |
| | | ::v-deep .dialogVisible .el-button--primary { |
| | | background-color: #42b983 !important; |
| | | height: 30px; |
| | |
| | | border: none; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | ::v-deep .dialogVisible .el-button--default { |
| | | height: 30px; |
| | | display: flex; |
| | |
| | | prop="filingdate" |
| | | label="编码格式" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div>{{ dateType.find(i => i.code === row.filingdate).name }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | /> |
| | | <el-table-column |
| | | prop="incbit" |
| | | label="自增位数" |
| | |
| | | }, |
| | | encodingPre: '', // 编码预览 |
| | | dateType: [ |
| | | { name: '年月日', code: 'YMD' }, |
| | | { name: '年月', code: 'YM' }, |
| | | { name: '年', code: 'Y' } |
| | | { name: '年月日', code: '年月日' }, |
| | | { name: '年月', code: '年月' }, |
| | | { name: '年', code: '年' } |
| | | ], |
| | | menuOptionsAll: [], |
| | | menuOptions: [], |
| | |
| | | handler(newValue, oldValue) { |
| | | const date = new Date() |
| | | let newDate = '' |
| | | if (newValue.filingdate === 'YMD') { |
| | | if (newValue.filingdate === '年月日') { |
| | | newDate = date.getFullYear().toString().substring(2, 4) + '' + (date.getMonth() + 1 + '').padStart(2, '0') + '' + (date.getDate() + '').padStart(2, '0') |
| | | } else if (newValue.filingdate === 'YM') { |
| | | } else if (newValue.filingdate === '年月') { |
| | | newDate = date.getFullYear().toString().substring(2, 4) + '' + (date.getMonth() + 1 + '').padStart(2, '0') |
| | | } else if (newValue.filingdate === 'Y') { |
| | | } else if (newValue.filingdate === '年') { |
| | | newDate = date.getFullYear().toString().substring(2, 4) + '' |
| | | } |
| | | this.encodingPre = newValue.prefix + '' + newDate + '' + (1 + '').padStart(newValue.incbit, '0') |