新增临时角色页面
This commit is contained in:
@@ -17,6 +17,14 @@ export function getRole(roleId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询角色详细
|
||||
export function currentRole() {
|
||||
return request({
|
||||
url: '/system/role/currentRole',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增角色
|
||||
export function addRole(data) {
|
||||
return request({
|
||||
|
||||
@@ -182,7 +182,6 @@ export default {
|
||||
"updateCrontabValue", name, value, from;
|
||||
this.crontabValueObj[name] = value;
|
||||
if (from && from !== name) {
|
||||
console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
|
||||
this.changeRadio(name, value);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -46,7 +46,6 @@ export default {
|
||||
this.loading = true;
|
||||
listOaOutWarehouse(this.queryParams).then(res => {
|
||||
this.outWareHouseList = res.rows
|
||||
console.log(res.rows)
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
@@ -47,7 +47,6 @@ export default {
|
||||
//路由跳转
|
||||
goTarget(href) {
|
||||
this.$router.push({ path: href});
|
||||
console.log(999,href)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
|
||||
@@ -77,7 +77,6 @@ export default {
|
||||
methods: {
|
||||
// 打开聊天窗口
|
||||
openChat() {
|
||||
console.log("窗口打开")
|
||||
this.drawerVisible = true;
|
||||
},
|
||||
|
||||
@@ -91,7 +90,6 @@ export default {
|
||||
selectContact(contact) {
|
||||
this.selectedContact = contact;
|
||||
this.chatHistory = []; // 清空当前聊天记录
|
||||
console.log(contact);
|
||||
this.loadMessage(contact.id);
|
||||
},
|
||||
|
||||
@@ -121,7 +119,6 @@ export default {
|
||||
this.msgListLoading = true;
|
||||
getContact(concatId).then(response => {
|
||||
if (response.code === 200) {
|
||||
console.log(response.data)
|
||||
this.currentContact = response.data;
|
||||
this.contactUser = response.data.user;
|
||||
this.chatHistory = response.data.messages;
|
||||
|
||||
@@ -193,7 +193,7 @@ export default {
|
||||
this.currentContact = response.data;
|
||||
this.contactUser = response.data.user;
|
||||
this.msgList = response.data.messages;
|
||||
console.log(this.msgList);
|
||||
|
||||
}
|
||||
this.msgListLoading = false;
|
||||
this.fleshScroll();
|
||||
@@ -243,12 +243,9 @@ export default {
|
||||
this.msgList.push(message);
|
||||
this.fleshLastMsg();
|
||||
this.fleshScroll();
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
fleshLastMsg() {
|
||||
console.log(this.contactList)
|
||||
const index = this.contactList.findIndex(e => e.id === this.currentContact.id);
|
||||
this.contactList[index].endMsg = this.msgList[this.msgList.length - 1].content;
|
||||
},
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
import {Message} from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import {getToken} from '@/utils/auth'
|
||||
import {isRelogin} from '@/utils/request'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
NProgress.configure({showSpinner: false})
|
||||
|
||||
const whiteList = ['/login', '/register']
|
||||
|
||||
@@ -16,25 +16,25 @@ router.beforeEach((to, from, next) => {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
next({path: '/'})
|
||||
NProgress.done()
|
||||
} else {
|
||||
if (store.getters.roles.length === 0) {
|
||||
isRelogin.show = true
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
store.dispatch('GetInfo').then(res => {
|
||||
isRelogin.show = false
|
||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
next({...to, replace: true}) // hack方法 确保addRoutes已完成
|
||||
})
|
||||
}).catch(err => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
Message.error(err)
|
||||
next({ path: '/' })
|
||||
})
|
||||
store.dispatch('LogOut').then(() => {
|
||||
Message.error(err)
|
||||
next({path: '/'})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
|
||||
@@ -27,9 +27,7 @@ export default {
|
||||
})
|
||||
},
|
||||
resource(resource) {
|
||||
console.log(resource)
|
||||
var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource);
|
||||
console.log(url)
|
||||
axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
@@ -63,7 +61,6 @@ export default {
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
Message.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
|
||||
@@ -172,7 +172,6 @@ export default {
|
||||
type: ${activatedElement.businessObject.$type}
|
||||
----------
|
||||
`);
|
||||
console.log("businessObject: ", activatedElement.businessObject);
|
||||
window.bpmnInstances.bpmnElement = activatedElement;
|
||||
this.bpmnElement = activatedElement;
|
||||
this.elementId = activatedElement.id;
|
||||
|
||||
@@ -71,7 +71,7 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '工作台', icon: 'dashboard', affix: true }
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -54,7 +54,6 @@ const user = {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(res => {
|
||||
const user = res.data.user
|
||||
console.log(user)
|
||||
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : user.avatar;
|
||||
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
commit('SET_ROLES', res.data.roles)
|
||||
|
||||
@@ -91,7 +91,7 @@ const webSocketOnError = (e) => {
|
||||
//服务器返回的数据
|
||||
const webSocketOnMessage = (e)=> {
|
||||
//判断是否登录
|
||||
console.log(JSON.parse(e?.data))
|
||||
// console.log(JSON.parse(e?.data))
|
||||
if (getToken()) {
|
||||
//window自定义事件
|
||||
window.dispatchEvent(
|
||||
|
||||
@@ -1,23 +1,61 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<el-container style="height: 100vh;">
|
||||
<el-main>
|
||||
<el-row :gutter="20">
|
||||
<!-- 右侧展示区域 -->
|
||||
<el-col :span="18" class="content-area">
|
||||
<announcements />
|
||||
<financial-charts />
|
||||
</el-col>
|
||||
<div v-if="currentRole.roleKey==='temp'">
|
||||
<div class="onboarding-homepage">
|
||||
<!-- 提示信息 -->
|
||||
<el-alert
|
||||
title="欢迎加入,请尽快补充您的必要信息!"
|
||||
type="info"
|
||||
show-icon>
|
||||
</el-alert>
|
||||
|
||||
<!-- 数据补充表单 -->
|
||||
<el-form :model="employeeData" class="employee-form" label-width="80px">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="employeeData.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="employeeData.email"></el-input>
|
||||
</el-form-item>
|
||||
<!-- 根据实际需求添加更多字段 -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 流程图 -->
|
||||
<div class="flow-chart">
|
||||
<el-steps :active="activeStep" finish-status="success">
|
||||
<el-step title="填写信息"></el-step>
|
||||
<el-step title="审批中"></el-step>
|
||||
<el-step title="完成"></el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-container style="height: 100vh;">
|
||||
<el-main>
|
||||
<el-row :gutter="20">
|
||||
<!-- 右侧展示区域 -->
|
||||
<el-col :span="18" class="content-area">
|
||||
<announcements />
|
||||
<financial-charts />
|
||||
</el-col>
|
||||
|
||||
<!-- 左侧功能区域 -->
|
||||
<el-col :span="6" class="sidebar">
|
||||
<quick-access />
|
||||
<inventory />
|
||||
<project-management />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
|
||||
|
||||
<!-- 左侧功能区域 -->
|
||||
<el-col :span="6" class="sidebar">
|
||||
<quick-access />
|
||||
<inventory />
|
||||
<project-management />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -30,6 +68,7 @@ import Inventory from "../components/Inventory/index.vue";
|
||||
import Announcements from "../components/Announcements/index.vue";
|
||||
import ProjectManagement from "../components/ProjectManagement/index.vue";
|
||||
import FinancialCharts from "../components/FinancialCharts/index.vue";
|
||||
import {currentRole} from "@/api/system/role";
|
||||
|
||||
export default {
|
||||
name: "Index",
|
||||
@@ -42,6 +81,14 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 新员工填写的信息
|
||||
employeeData: {
|
||||
name: "",
|
||||
email: "",
|
||||
// 其他必要字段
|
||||
},
|
||||
// 当前步骤,从 0 开始计数
|
||||
activeStep: 0,
|
||||
version: "0.8.3",
|
||||
commandstats: null,
|
||||
usedmemory: null,
|
||||
@@ -53,13 +100,29 @@ export default {
|
||||
noticeTitle: '',
|
||||
noticeContent: '',
|
||||
drawer: false,
|
||||
currentRole:{}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCurrentUserRole();
|
||||
this.getList();
|
||||
this.getListNotice();
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
// 这里可以加入表单验证与提交逻辑
|
||||
// 模拟提交后进入下一流程(例如审批中)
|
||||
this.activeStep = 1;
|
||||
this.$message({
|
||||
message: "表单提交成功,进入审批流程!",
|
||||
type: "success"
|
||||
});
|
||||
},
|
||||
getCurrentUserRole(){
|
||||
currentRole().then(res => {
|
||||
this.currentRole = res.data;
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
getCache().then((response) => {
|
||||
this.cache = response.data;
|
||||
@@ -88,7 +151,18 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.onboarding-homepage {
|
||||
max-width: 800px;
|
||||
margin: 20px auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.employee-form {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.flow-chart {
|
||||
margin-top: 30px;
|
||||
}
|
||||
/* 栅格列样式 */
|
||||
.content-area {
|
||||
background: #fff;
|
||||
|
||||
@@ -575,7 +575,6 @@ export default {
|
||||
this.loading = true;
|
||||
listOaAttendance(this.queryParams).then(res => {
|
||||
this.userList = res.rows;
|
||||
console.log(this.userList);
|
||||
this.dateLength = res.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
@@ -251,7 +251,7 @@ export default {
|
||||
})
|
||||
},
|
||||
co(){
|
||||
console.log(this.files)
|
||||
|
||||
},
|
||||
|
||||
// 添加新的一行
|
||||
|
||||
@@ -403,7 +403,6 @@ export default {
|
||||
getOaClaim(this.$route.params.claimId).then(res => {
|
||||
this.form = res.data;
|
||||
this.detailList = res.data.detailList
|
||||
console.log(this.detailList)
|
||||
this.initData();
|
||||
this.loading=false
|
||||
})
|
||||
|
||||
@@ -237,7 +237,6 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOaClaim(this.queryParams).then(response => {
|
||||
console.log(response.rows)
|
||||
this.oaClaimList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
||||
@@ -89,7 +89,6 @@ export default {
|
||||
//排序
|
||||
this.stepsList = res.data.data.taskList.sort((a, b) => parseInt(a.dictValue) - parseInt(b.dictValue));
|
||||
this.active = res.data.data.active;
|
||||
console.log(this.stepsList)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ export default {
|
||||
|
||||
//核算弹出层
|
||||
handleCheck(row) {
|
||||
console.log(3333, row)
|
||||
|
||||
this.openCheck = true;
|
||||
this.titleCheck = "项目核算";
|
||||
this.projectName = row.projectName;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-loading="loading">
|
||||
<el-tabs v-model="activeName" style="margin-left: 10px;">
|
||||
<el-tab-pane label="休假日历" name="first">
|
||||
<el-tab-pane label="休假日历" name="first" >
|
||||
<el-calendar>
|
||||
<template slot="dateCell" slot-scope="{date, data}">
|
||||
<div :class="{'is-selected': data.isSelected, 'blue-background': isHoliday(data.day)}" style="height: 100%"
|
||||
@@ -99,6 +99,7 @@
|
||||
|
||||
<script>
|
||||
import {listOaHoliday, updateOaHoliday,queryListHoliday} from "@/api/oa/oaHoliday";
|
||||
import {currentRole} from "@/api/system/role";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -135,6 +136,7 @@ export default {
|
||||
holidayTime: undefined,
|
||||
name: undefined,
|
||||
},
|
||||
currentRole:{},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
@@ -161,6 +163,11 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCurrentUserRole() {
|
||||
currentRole().then(res => {
|
||||
this.currentRole = res.data;
|
||||
})
|
||||
},
|
||||
fetchHolidayData() {
|
||||
this.loading = true;
|
||||
listOaHoliday({}).then(response => {
|
||||
@@ -172,7 +179,6 @@ export default {
|
||||
}));
|
||||
this.loading = false;
|
||||
}).catch(error => {
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
@@ -185,11 +191,11 @@ export default {
|
||||
return holiday ? holiday.name : '';
|
||||
},
|
||||
handleCellClick(data) {
|
||||
|
||||
const holiday = this.holidays.find(holiday => holiday.date === data.day);
|
||||
this.currentHoliday = {...holiday.fullData, type: holiday.type};
|
||||
this.dialogVisible = true;
|
||||
|
||||
if (this.currentRole.roleKey==='doctor'){
|
||||
const holiday = this.holidays.find(holiday => holiday.date === data.day);
|
||||
this.currentHoliday = {...holiday.fullData, type: holiday.type};
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
},
|
||||
updateHoliday() {
|
||||
updateOaHoliday(this.currentHoliday).then(response => {
|
||||
@@ -198,7 +204,6 @@ export default {
|
||||
this.$message.success("假期类型更新成功");
|
||||
|
||||
}).catch(error => {
|
||||
console.error("Error updating holiday data:", error);
|
||||
this.$message.error("更新失败");
|
||||
});
|
||||
},
|
||||
@@ -314,6 +319,7 @@ export default {
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getCurrentUserRole();
|
||||
this.fetchHolidayData();
|
||||
this.getList();
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ export default {
|
||||
this.loading = true;
|
||||
listOnboarding(this.queryParams).then(response => {
|
||||
this.onboardingList = response.rows;
|
||||
console.log(this.onboardingList)
|
||||
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
@@ -822,7 +822,7 @@ export default {
|
||||
}
|
||||
listProject(this.queryParams).then(response => {
|
||||
this.projectList = response.rows;
|
||||
console.log(this.projectList)
|
||||
|
||||
//项目周期
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
||||
@@ -1390,7 +1390,7 @@ export default {
|
||||
getTaskByDictType(pid).then(res => {
|
||||
//排序
|
||||
this.stepsList = res.data.data.taskList.sort((a, b) => parseInt(b.dictValue) - parseInt(a.dictValue));
|
||||
console.log(this.stepsList)
|
||||
|
||||
this.active = res.data.data.active;
|
||||
})
|
||||
},
|
||||
@@ -1576,7 +1576,7 @@ export default {
|
||||
getProject(projectId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
console.log(this.form)
|
||||
|
||||
this.bail = response.data.bail == null ? this.bail : JSON.parse(response.data.bail);
|
||||
let period = [];
|
||||
period.push(response.data.beginTime);
|
||||
|
||||
@@ -153,7 +153,6 @@ export default {
|
||||
}else {
|
||||
this.finishedList =response.rows;
|
||||
}
|
||||
console.log(this.finishedList)
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
@@ -165,7 +165,6 @@ export default {
|
||||
},
|
||||
// 跳转到处理页面
|
||||
handleProcess(row) {
|
||||
console.log(row)
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
|
||||
Reference in New Issue
Block a user