提交 0a001d6c authored 作者: 黄志强's avatar 黄志强

修改

上级 66c36175
......@@ -14,6 +14,7 @@
"image-webpack-loader": "^6.0.0",
"lib-flexible": "^0.3.2",
"postcss-px2rem-exclude": "^0.0.6",
"sockjs-client": "^1.4.0",
"stompjs": "^2.3.3",
"vue": "^2.6.11",
"vue-quill-editor": "^3.0.6",
......
let baseUrl = "https://workbook.zjtys.com.cn:8289"; // 120.55.57.35 localhost
let baseUrl = "https://workbook.zjtys.com.cn"; // 120.55.57.35 localhost 8289
let env = process.env.VUE_APP_TITLE === 'alpha' ? 'alpha' : 'production';
switch (env) {
case 'production':
// baseUrl = "http://192.168.1.248:8090"; // 测试环境
baseUrl = "https://workbook.zjtys.com.cn:8289"; // 测试环境
baseUrl = "https://workbook.zjtys.com.cn"; // 测试环境
break;
case 'alpha':
baseUrl = "https://workbook.zjtys.com.cn:8289"; // 阿里云环境
// baseUrl = "https://120.55.57.35:8289"; // 阿里云环境
// baseUrl = "https://workbook.zjtys.com.cn"; // 阿里云环境
baseUrl = "https://workbook.zjtys.com.cn"; // 阿里云环境
break;
}
// https://workbook.zjtys.com.cn:8289
export default baseUrl;
......@@ -247,7 +247,7 @@ const requests = {
method: 'post'
})
},
postFirstWebsocket(id) { // 告诉该推消息了
postFirstWebSocket(id) { // 告诉该推消息了
return axios(ip + '/read/push?id=' + id, {
method: 'post'
})
......@@ -257,11 +257,16 @@ const requests = {
method: 'put'
})
},
putFindWorkload(id) { // 任务id查找成语工作量
putFindWorkload(id) { // 任务id查找剩余工作量
return axios(ip + '/job/work/select/workload/' + id, {
method: 'put'
})
},
getTaskFindById(id) {
return axios(ip + '/job/work/select/work/' + id, {
method: 'get'
})
},
// postUserLogin(data) { // 用户登录
// console.log(data);
// return axios('http://192.168.1.7:8082/userLogin', {
......
......@@ -129,7 +129,7 @@
.tip{
float: right;
font-size: 22px; /*no*/
padding-top: 25px; /*no*/
margin-top: 25px; /*no*/
color: #ec3321;
}
......
......@@ -10,7 +10,7 @@
<el-row>
<el-col :span="12">
<div style="text-align: center;">
<img height="354" src="../assets/images/imgs/big-lock.png"/>
<img class="passImg" src="../assets/images/imgs/big-lock.png"/>
</div>
</el-col>
<el-col :span="12">
......@@ -46,6 +46,34 @@
//import引入的组件需要注入到对象中才能使用
components: {},
data () {
let validateOld=(rule, value, callback)=>{
if (value !== this.userDetail.password) {
callback(new Error('密码错误,请重新输入!'));
} else{
callback();
}
};
let validateNew = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
}else if (value === this.passwordForm.old){
callback(new Error('新密码不能和旧密码相同!'));
} else {
if (this.passwordForm.confirm != '') {
this.$refs.passwordForm.validateField('confirm');
}
callback();
}
};
let validateConfirm = (rule, value, callback) => {
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.passwordForm.confirm) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
//这里存放数据
return {
dialogPasswordVisible: false,
......@@ -56,13 +84,16 @@
},
rules: {
new: [
{ required: true, message: '请输入新密码', trigger: 'blur' },
{ validator: validateNew, trigger: 'blur'},
// { required: true, message: '请输入新密码', trigger: 'blur' },
],
old: [
{ required: true, message: '请输入当前密码', trigger: 'blur' },
{ validator: validateOld, trigger: 'blur' }
// { required: true, message: '请输入当前密码', trigger: 'blur' },
],
confirm: [
{ required: true, message: '请输入确认密码', trigger: 'blur' },
{ validator: validateConfirm, trigger: 'blur' }
// { required: true, message: '请输入确认密码', trigger: 'blur' },
],
},
closeDialog(val) {
......@@ -106,7 +137,8 @@
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted () {
this.userDetail = JSON.parse(this.$Base64.decode(localStorage.getItem('login')));
console.log(this.userDetail)
},
beforeCreate () {
}, //生命周期 - 创建之前
......@@ -137,4 +169,8 @@
right: 0px;
cursor: pointer;
}
.passImg{
height: 354px;
}
</style>
......@@ -49,6 +49,12 @@ const routes = [
meta: ['user'],
component: () => import(/* webpackChunkName: "home" */ '../views/AddTask.vue')
},
{
path: '/departmentTask',
name: 'departmentTask',
meta: ['user'],
component: () => import(/* webpackChunkName: "home" */ '../views/DepartmentTask.vue')
},
{
path: '/unpublishedTask',
name: 'unpublishedTask',
......
......@@ -20,7 +20,7 @@ const webSocket = {
console.log(greeting);
dataZ = JSON.parse(greeting.body); // 将传过来的数据转为json格式
if (dataZ.length !== 0) {
st.commit('changeRealData', { // 将webscoket中更新的数据放入单独的池子
st.socks.commit('changeRealData', { // 将webscoket中更新的数据放入单独的池子
'realData': dataZ
});
}
......
......@@ -179,20 +179,28 @@
this.$axios.getUserById(val).then((res) => {
console.log(res)
if (res.request.status === 200) {
if (res.data.length > 0) {
this.leaderOptions = res.data;
this.memberOptions = res.data;
} else if (JSON.stringify(this.$store.getters.getSuperior.superior) !== '{}' && JSON.stringify(this.$store.getters.getSuperior.superior) !== undefined) {
this.leaderOptions = this.$store.getters.getSuperior.superior.crewList;
this.memberOptions = this.$store.getters.getSuperior.superior.crewList;
if (res.data.length === 0 && (JSON.stringify(this.$store.getters.getSuperior.superior) !== '{}' && JSON.stringify(this.$store.getters.getSuperior.superior) !== undefined)) {
let data = this.$store.getters.getSuperior.superior.crewList;
data.push(JSON.parse(JSON.stringify(this.userLoginData)));
console.log(data)
let data2 = Array.from(new Set(data));
this.leaderOptions = data2;
this.memberOptions = data2;
} else if (res.data.length > 0 && (JSON.stringify(this.$store.getters.getSuperior.superior) === '{}' || JSON.stringify(this.$store.getters.getSuperior.superior) === undefined)) {
let data = res.data;
data.push(JSON.parse(JSON.stringify(this.userLoginData)));
let data2 = Array.from(new Set(data));
this.leaderOptions = data2;
this.memberOptions = data2;
} else if (res.data.length > 0 && (JSON.stringify(this.$store.getters.getSuperior.superior) !== '{}' && JSON.stringify(this.$store.getters.getSuperior.superior) !== undefined)) {
let arr1 = res.data;
let arr2 = this.$store.getters.getSuperior.superior.crewList;
arr1.push(...arr2);
arr1.push(JSON.parse(JSON.stringify(this.userLoginData)));
let arr3 = Array.from(new Set(arr1));
this.leaderOptions = arr3;
this.memberOptions = arr3;
}
// console.log(JSON.stringify(this.$store.getters.getSuperior.superior))
// console.log(this.userLoginData.roles)
// if (this.userLoginData.roles.length !== 0) {
// let data = this.userLoginData.roles[0].authorities.findIndex(item => item.name === '分解权限');
// console.log(data)
// }
}
})
},
......@@ -220,7 +228,7 @@
console.log(res)
if (res.status === 200) {
if (parseInt(this.taskForm.workload) > parseInt(res.data)) {
this.$alert('当前总任务量为3,请重新评估任务量', '任务量提示', {
this.$alert(`当前总任务量为${res.data},请重新评估任务量`, '任务量提示', {
confirmButtonText: '确定'});
return false;
} else {
......
......@@ -168,7 +168,7 @@
{required: true, validator: checkPhone1, trigger: 'blur' }
],
phone2: [
{ validator: checkPhone2, trigger: 'blur' }
{required: true, validator: checkPhone2, trigger: 'blur' }
],
idCard: [
{ required: true, message: '请填写证件号码', trigger: 'blur' },
......
<!-- 部门任务 -->
<template>
<div class='departmentTask'>
<!--{{taskListData}}-->
<div>
<el-table
:data="taskListData"
@row-click="openDetails"
style="width: 100%">
<el-table-column
prop="title"
label="任务名称"
align="center">
</el-table-column>
<el-table-column
prop="publisher"
label="发布者"
align="center">
<template slot-scope="scope">
<span>{{scope.row.publisher.username}}</span>
</template>
</el-table-column>
<el-table-column
prop="executor"
align="center"
label="执行者">
<template slot-scope="scope">
<span>{{scope.row.executor.username}}</span>
</template>
</el-table-column>
<el-table-column
prop="stateTime"
label="任务开始时间"
align="center">
</el-table-column>
<el-table-column
prop="status"
align="center"
label="任务状态">
<template slot-scope="scope">
<span>{{$common.statusName(scope.row.status)}}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
name: "DepartmentTask",
//import引入的组件需要注入到对象中才能使用
components: {},
data () {
//这里存放数据
return {
taskListData: [],
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
openDetails(val) {
console.log(val)
localStorage.setItem('taskDetail', this.$Base64.encode(JSON.stringify(val)));
this.$router.push({name: 'taskDetails'});
},
getDeaprtmentTask(val) {
this.$axios.getTaskFindById(val).then((res) => {
console.log(res)
if (res.status === 200) {
this.taskListData = res.data;
}
})
}
},
//生命周期 - 创建完成(可以访问当前this实例)
created () {
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted () {
let data = JSON.parse(this.$Base64.decode(localStorage.getItem('login')));
console.log(data)
let that = this;
setTimeout(function () {
that.getDeaprtmentTask(data.id);
}, 200)
},
beforeCreate () {
}, //生命周期 - 创建之前
beforeMount () {
}, //生命周期 - 挂载之前
beforeUpdate () {
}, //生命周期 - 更新之前
updated () {
}, //生命周期 - 更新之后
beforeDestroy () {
}, //生命周期 - 销毁之前
destroyed () {
}, //生命周期 - 销毁完成
activated () {
}, //如果页面有keep-alive缓存功能,这个函数会触发
}
</script>
<style scoped>
</style>
......@@ -36,13 +36,29 @@
homeClick(val) {
this.$router.push({name: val})
},
firstSocket(val) {
this.$axios.postFirstWebSocket(val).then(() => {
// console.log(res)
})
}
},
//生命周期 - 创建完成(可以访问当前this实例)
created () {
// let st = { // 将整个数据池传给了st
// socks: this.$store
// };
// wsk.serverZAX(st);
// let that = this;
// window.addEventListener('beforeunload', e => { // 点击刷新触发
// that.socks.commit('changeRealData', {
// realData: {}
// });
// });
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted () {
let data = JSON.parse(this.$Base64.decode(localStorage.getItem('login')));
this.firstSocket(data.id);
},
beforeCreate () {
}, //生命周期 - 创建之前
......
......@@ -147,10 +147,10 @@
},
rules: {
workTime: [
{ type: 'string', required: true, message: '请选择上班时间', trigger: 'change' }
{type: 'string', required: true, message: '请选择上班时间', trigger: 'change' }
],
afterWorkTime: [
{ type: 'string', required: true, message: '请选择下班时间', trigger: 'change' }
{type: 'string', required: true, message: '请选择下班时间', trigger: 'change' }
],
score: [
{ required: true, message: '请输入日基础分', trigger: 'blur' }
......@@ -226,7 +226,9 @@
this.$axios.getAddConfig().then((res) => {
console.log(res)
if (res.request.status === 200) {
this.baseForm = res.data;
if (res.data !== null) {
this.baseForm = res.data;
}
}
})
},
......@@ -244,6 +246,7 @@
})
},
submitForm(formName) {
console.log(this.baseForm)
this.$refs[formName].validate((valid) => {
if (valid) {
this.$axios.postAddConfig(this.baseForm).then((res) => {
......
差异被折叠。
......@@ -8,7 +8,7 @@
<li class="viewTask" @click="taskClick('viewTask')">
<div class="nameManage">查看任务</div>
</li>
<li class="viewTask" @click="taskClick('departmentTask')">
<li class="viewTask" v-show="showDepartment" @click="taskClick('departmentTask')">
<div class="nameManage">部门任务</div>
</li>
</ul>
......@@ -26,7 +26,8 @@
data () {
//这里存放数据
return {
showAddTask: true
showAddTask: false,
showDepartment: false,
};
},
//监听属性 类似于data概念
......@@ -49,9 +50,15 @@
console.log(data)
if (data.roles.length === 0) {
this.showAddTask = false;
this.showDepartment = false;
} else {
if (data.roles.length > 0) {
this.showAddTask = true;
if (data.roles[0].authorities.findIndex(item => item.name === '分解任务') > -1) {
this.showAddTask = true;
}
if (data.roles[0].authorities.findIndex(item => item.name === '查看任务') > -1) {
this.showDepartment = true;
}
}
}
},
......
......@@ -6,13 +6,18 @@
<span slot="label">
<!--<i class="el-icon-date"></i>-->
我的待办任务
<el-badge :value="meCommissionUnread" :hidden="meCommissionUnread === 0" class="item"></el-badge>
<el-badge :is-dot="meCommissionUnread === 1" class="item"></el-badge>
</span>
<div class="cardDiv" style="height: 100%;overflow-y: auto;padding: 0px 30px;">
<el-card @click.native="taskDetails(item)" style="margin-bottom: 10px;" class="box-card cardShadow" v-for="(item,index) in dataList" :key="index">
<el-badge :is-dot="item.readState === 1" class="item">
<div class="taskContent">
<!--<span class=""></span>-->
<span class="">
<img class="itemImgStatus" v-show="item.workAttribution === 1" src="../assets/images/related.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 3" src="../assets/images/released.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 2" src="../assets/images/breakdown.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 4" src="../assets/images/receive.png"/>
</span>
<span :title="item.title" class="taskItem">任务名称:{{item.title}}</span>
<span :title="item.release" class="taskItem">发布者:{{item.release}}</span>
<span :title="$common.timeYMDHMSFilter(item.time)" class="taskItem">开始时间:{{$common.timeYMDHMSFilter(item.time)}}</span>
......@@ -29,12 +34,18 @@
<span slot="label">
<!--<i class="el-icon-date"></i>-->
我的相关任务
<el-badge :value="meRelatedUnread" :hidden="meRelatedUnread === 0" class="item"></el-badge>
<el-badge :is-dot="meRelatedUnread === 1" class="item"></el-badge>
</span>
<div class="cardDiv" style="height: 100%;overflow-y: auto;padding: 0px 30px;">
<el-card @click.native="taskDetails(item)" style="margin-bottom: 10px;" class="box-card cardShadow" v-for="(item,index) in dataList" :key="index">
<el-badge :is-dot="item.readState === 1" class="item">
<div class="taskContent">
<span class="">
<img class="itemImgStatus" v-show="item.workAttribution === 1" src="../assets/images/related.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 3" src="../assets/images/released.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 2" src="../assets/images/breakdown.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 4" src="../assets/images/receive.png"/>
</span>
<span :title="item.title" class="taskItem">任务名称:{{item.title}}</span>
<span :title="item.release" class="taskItem">发布者:{{item.release}}</span>
<span :title="$common.timeYMDHMSFilter(item.time)" class="taskItem">开始时间:{{$common.timeYMDHMSFilter(item.time)}}</span>
......@@ -51,12 +62,18 @@
<span slot="label">
<!--<i class="el-icon-date"></i>-->
我的分解任务
<el-badge :value="meResolveUnread" :hidden="meResolveUnread === 0" class="item"></el-badge>
<el-badge :is-dot="meResolveUnread === 1" class="item"></el-badge>
</span>
<div class="cardDiv" style="height: 100%;overflow-y: auto;padding: 0px 30px;">
<el-card @click.native="taskDetails(item)" style="margin-bottom: 10px;" class="box-card cardShadow" v-for="(item,index) in dataList" :key="index">
<el-badge :is-dot="item.readState === 1" class="item">
<div class="taskContent">
<span class="">
<img class="itemImgStatus" v-show="item.workAttribution === 1" src="../assets/images/related.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 3" src="../assets/images/released.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 2" src="../assets/images/breakdown.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 4" src="../assets/images/receive.png"/>
</span>
<span :title="item.title" class="taskItem">任务名称:{{item.title}}</span>
<span :title="item.release" class="taskItem">发布者:{{item.release}}</span>
<span :title="$common.timeYMDHMSFilter(item.time)" class="taskItem">开始时间:{{$common.timeYMDHMSFilter(item.time)}}</span>
......@@ -73,12 +90,18 @@
<span slot="label">
<!--<i class="el-icon-date"></i>-->
我的发布任务
<el-badge :value="meReleaseUnread" :hidden="meReleaseUnread === 0" class="item"></el-badge>
<el-badge :is-dot="meReleaseUnread === 1" class="item"></el-badge>
</span>
<div class="cardDiv" style="height: 100%;overflow-y: auto;padding: 0px 30px;">
<el-card @click.native="taskDetails(item)" style="margin-bottom: 10px;" class="box-card cardShadow" v-for="(item,index) in dataList" :key="index">
<el-badge :is-dot="item.readState === 1" class="item">
<div class="taskContent">
<span class="">
<img class="itemImgStatus" v-show="item.workAttribution === 1" src="../assets/images/related.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 3" src="../assets/images/released.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 2" src="../assets/images/breakdown.png"/>
<img class="itemImgStatus" v-show="item.workAttribution === 4" src="../assets/images/receive.png"/>
</span>
<span :title="item.title" class="taskItem">任务名称:{{item.title}}</span>
<span :title="item.release" class="taskItem">发布者:{{item.release}}</span>
<span :title="$common.timeYMDHMSFilter(item.time)" class="taskItem">开始时间:{{$common.timeYMDHMSFilter(item.time)}}</span>
......@@ -151,6 +174,11 @@
},
//方法集合
methods: {
firstSocket(val) {
this.$axios.postFirstWebSocket(val).then(() => {
// console.log(res)
})
},
handleClick(tab, event) {
console.log(this.activeName)
this.currentPage = 1;
......@@ -252,6 +280,7 @@
},
socketDate() {
let real = this.$store.getters.getRealData.realData;
console.log(real)
if (real !== undefined) {
this.meCommissionUnread = real.meCommissionUnread;
this.meRelatedUnread = real.meRelatedUnread;
......@@ -259,15 +288,20 @@
this.meReleaseUnread = real.meReleaseUnread;
}
},
firstSocket(val) {
this.$axios.postFirstWebsocket(val).then(() => {
// console.log(res)
})
}
},
//生命周期 - 创建完成(可以访问当前this实例)
created () {
let st = { // 将整个数据池传给了st
socks: this.$store
};
wsk.serverZAX(st);
let that = this;
window.addEventListener('beforeunload', e => { // 点击刷新触发
that.socks.commit('changeRealData', {
realData: {}
});
});
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted () {
......@@ -275,10 +309,10 @@
this.userDetail = data;
this.firstSocket(data.id);
let that = this;
let thisStore = this.$store;
// let thisStore = this.$store;
setTimeout(function () {
that.getDataListUpcoming();
wsk.serverZAX(thisStore);
// wsk.serverZAX(thisStore);
}, 200)
},
beforeCreate () {
......@@ -351,12 +385,20 @@
align-items: left;
height: 20px;
line-height: 20px;
position: relative;
}
.itemImgStatus{
position: absolute;
top: -0px;
left: -15px;
width: 20px;
}
.taskItem{
width: 16%;
font-size: 20px;
text-align: center;
/*text-align: center;*/
white-space:nowrap;/* 规定文本是否折行 */
overflow: hidden;/* 规定超出内容宽度的元素隐藏 */
text-overflow: ellipsis;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论