Browse Source

结合crowd代码

master
陈裕财 3 years ago
parent
commit
944e094ef3
  1. 3
      package.json
  2. 53
      src/api/login.js
  3. 76
      src/api/mdp/arc/archive.js
  4. 66
      src/api/mdp/arc/category.js
  5. 9
      src/api/mdp/arc/image.js
  6. 47
      src/api/mdp/arc/tag.js
  7. 118
      src/api/mdp/sys/user.js
  8. 153
      src/api/xm/core/xmTask.js
  9. 165
      src/permission.js
  10. 2
      src/router/index.js
  11. 7
      src/store/modules/user.js
  12. 7
      src/views/layout/components/AppMain.vue
  13. 436
      src/views/xm/core/xmProject/index.vue
  14. 876
      src/views/xm/core/xmProject/top-nav.vue
  15. BIN
      static/images/ability-level1.png
  16. BIN
      static/images/ability-level2.png
  17. BIN
      static/images/ability-level3.png
  18. BIN
      static/images/ability-level4.png
  19. BIN
      static/images/ability-level5.png
  20. BIN
      static/images/ability-level6.png
  21. BIN
      static/images/ability-level7.png
  22. BIN
      static/images/ability-level8.png
  23. BIN
      static/images/account-cancel1.png
  24. BIN
      static/images/account-cancel2.png
  25. BIN
      static/images/agile-development.png
  26. BIN
      static/images/alipay.png
  27. BIN
      static/images/arrow.png
  28. BIN
      static/images/authentication1.png
  29. BIN
      static/images/authentication2.png
  30. BIN
      static/images/authentication3.png
  31. BIN
      static/images/authentication4.png
  32. BIN
      static/images/bank1.png
  33. BIN
      static/images/bank2.png
  34. BIN
      static/images/bank3.png
  35. BIN
      static/images/bank4.png
  36. BIN
      static/images/bg.png
  37. BIN
      static/images/bid.png
  38. BIN
      static/images/bind-email.png
  39. BIN
      static/images/bind-phone.png
  40. BIN
      static/images/card-authen.png
  41. BIN
      static/images/card-logo.png
  42. BIN
      static/images/check-green.png
  43. BIN
      static/images/checked.png
  44. BIN
      static/images/checking.png
  45. BIN
      static/images/code1.png
  46. BIN
      static/images/code2.png
  47. BIN
      static/images/collaborative-application.png
  48. BIN
      static/images/collect-star.png
  49. BIN
      static/images/collect.png
  50. BIN
      static/images/collected-star.png
  51. BIN
      static/images/com-calculate.png
  52. BIN
      static/images/community-bg.png
  53. BIN
      static/images/community-forum-bg.png
  54. BIN
      static/images/contact-to.png
  55. BIN
      static/images/cooperation-bg.png
  56. BIN
      static/images/cooperation-edit.png
  57. BIN
      static/images/cooperation-form-bg.png
  58. BIN
      static/images/cooperation-process1.png
  59. BIN
      static/images/cooperation-process2.png
  60. BIN
      static/images/cooperation-process3.png
  61. BIN
      static/images/cooperation-process4.png
  62. BIN
      static/images/cooperation-process5.png
  63. BIN
      static/images/cooperation-process6.png
  64. BIN
      static/images/cooperation.png
  65. BIN
      static/images/cp1.png
  66. BIN
      static/images/cp2.png
  67. BIN
      static/images/cp3.png
  68. BIN
      static/images/cp4.png
  69. BIN
      static/images/cp5.png
  70. BIN
      static/images/cp6.png
  71. BIN
      static/images/cp7.png
  72. BIN
      static/images/credit-amount.png
  73. BIN
      static/images/credit-level1.png
  74. BIN
      static/images/credit-level2.png
  75. BIN
      static/images/credit-level3.png
  76. BIN
      static/images/credit-level4.png
  77. BIN
      static/images/credit-level5.png
  78. BIN
      static/images/credit-level6.png
  79. BIN
      static/images/credit-level7.png
  80. BIN
      static/images/customer-service.png
  81. BIN
      static/images/dashed.png
  82. BIN
      static/images/developer.png
  83. BIN
      static/images/dots.png
  84. BIN
      static/images/e-bg.png
  85. BIN
      static/images/effectiveness-analysis.png
  86. BIN
      static/images/email-authen1.png
  87. BIN
      static/images/email-authen2.png
  88. BIN
      static/images/employer.png
  89. BIN
      static/images/enterprise-authen.png
  90. BIN
      static/images/equity.png
  91. BIN
      static/images/file-logo.png
  92. BIN
      static/images/file-s-logo.png
  93. BIN
      static/images/forum.png
  94. BIN
      static/images/good.png
  95. BIN
      static/images/gou.png
  96. BIN
      static/images/grey-bg-ava.png
  97. BIN
      static/images/grey-bg.png
  98. BIN
      static/images/help-bg.png
  99. BIN
      static/images/help2.png
  100. BIN
      static/images/help3.png

3
package.json

@ -59,7 +59,8 @@
"vuedraggable": "2.15.0", "vuedraggable": "2.15.0",
"vuex": "3.0.1", "vuex": "3.0.1",
"wl-gantt": "^1.0.6", "wl-gantt": "^1.0.6",
"xlsx": "^0.14.5"
"xlsx": "^0.14.5",
"element-china-area-data": "^5.0.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.8", "@babel/core": "^7.15.8",

53
src/api/login.js

@ -1,4 +1,7 @@
import axios from '@/utils/request'
import axios from 'axios'//免登录访问
import axiosAuth from '@/utils/request'//待token访问
import { getToken, setToken, removeToken,getCacheUserInfo,setCacheUserInfo,removeCacheUserInfo} from '@/utils/auth' import { getToken, setToken, removeToken,getCacheUserInfo,setCacheUserInfo,removeCacheUserInfo} from '@/utils/auth'
@ -6,6 +9,27 @@ import config from '@/common/config'
let base=config.getOauth2LoginBasePath(); let base=config.getOauth2LoginBasePath();
var curlDomain=window.location.protocol+"//"+window.location.host; // 返回https://mp.csdn.net
var baseApiUrl="";
if(process.env.BASE_API ){
if(process.env.BASE_API.indexOf("http")<0 && process.env.BASE_API.indexOf("wwww.")<0){
baseApiUrl=curlDomain+"/"+process.env.BASE_API+"/"+process.env.VERSION;
}else{
baseApiUrl=process.env.BASE_API+"/"+process.env.VERSION;
}
}else{
baseApiUrl=curlDomain+"/api/"+process.env.VERSION
}
var indexOfHttp=baseApiUrl.indexOf("://");
if(indexOfHttp>0){
baseApiUrl=baseApiUrl.substr(0,indexOfHttp+3)+baseApiUrl.substr(indexOfHttp+3,baseApiUrl.length).replace("//","/");
}else{
baseApiUrl=baseApiUrl.replace("//","/")
}
//let base=''; //let base='';
export function doLoginByUserloginid(userloginid, password,grantType,authType,deptid,userid) { export function doLoginByUserloginid(userloginid, password,grantType,authType,deptid,userid) {
removeToken(); removeToken();
@ -17,7 +41,7 @@ export function doLoginByUserloginid(userloginid, password,grantType,authType,de
userid:userid, userid:userid,
} }
return axios({ return axios({
url: base+'/login/token?grantType='+grantType,
url: baseApiUrl+'/'+base+'/login/token?grantType='+grantType,
method: 'post', method: 'post',
data data
}) })
@ -30,7 +54,7 @@ export function switchUser(userloginid, password,grantType,authType,deptid,useri
deptid:deptid, deptid:deptid,
userid:userid, userid:userid,
} }
return axios({
return axiosAuth({
url: base+'/login/token?grantType='+grantType, url: base+'/login/token?grantType='+grantType,
method: 'post', method: 'post',
data data
@ -42,7 +66,7 @@ export function checkUserid(userid ) {
userid: userid userid: userid
} }
return axios({ return axios({
url: base+'/user/check/userid',
url: baseApiUrl+'/'+base+'/user/check/userid',
method: 'post', method: 'post',
data data
}) })
@ -53,7 +77,7 @@ export function checkDisplayUserid(displayUserid ) {
displayUserid: displayUserid displayUserid: displayUserid
} }
return axios({ return axios({
url: base+'/user/check/displayUserid',
url: baseApiUrl+'/'+base+'/user/check/displayUserid',
method: 'post', method: 'post',
data data
}) })
@ -65,14 +89,14 @@ export function checkPhoneno(phoneno ) {
phoneno: phoneno phoneno: phoneno
} }
return axios({ return axios({
url: base+'/user/check/phoneno',
url: baseApiUrl+'/'+base+'/user/check/phoneno',
method: 'post', method: 'post',
data data
}) })
} }
export function queryByUserloginid( params ) { export function queryByUserloginid( params ) {
return axios({ return axios({
url: base+'/user/queryByUserloginid',
url: baseApiUrl+'/'+base+'/user/queryByUserloginid',
method: 'get', method: 'get',
params:params params:params
}) })
@ -82,7 +106,6 @@ export function doRegister( userInfo ) {
removeToken(); removeToken();
const data = { const data = {
username:userInfo.username, username:userInfo.username,
userid:userInfo.displayUserid,
displayUserid:userInfo.displayUserid, displayUserid:userInfo.displayUserid,
password:userInfo.password, password:userInfo.password,
phoneno:userInfo.phoneno, phoneno:userInfo.phoneno,
@ -91,7 +114,7 @@ export function doRegister( userInfo ) {
branchId:userInfo.branchId branchId:userInfo.branchId
} }
return axios({ return axios({
url: base+'/user/register',
url: baseApiUrl+'/'+base+'/user/register',
method: 'post', method: 'post',
data data
}) })
@ -106,7 +129,7 @@ export function resetPasswordByPhoneno( userInfo ) {
userid:userInfo.userid userid:userInfo.userid
} }
return axios({ return axios({
url: base+'/user/password/reset?type=sms',
url: baseApiUrl+'/'+base+'/user/password/reset?type=sms',
method: 'post', method: 'post',
data data
}) })
@ -128,7 +151,7 @@ export function getUserInfo(params) {
} }
} }
const data=params; const data=params;
return axios({
return axiosAuth({
url: base+'/user/info', url: base+'/user/info',
method: 'post', method: 'post',
data data
@ -142,7 +165,7 @@ export function getUserInfo(params) {
export function sendEmail(params) { export function sendEmail(params) {
const data=params; const data=params;
return axios({ return axios({
url: base+'/user/sendEmail',
url: baseApiUrl+'/'+base+'/user/sendEmail',
method: 'post', method: 'post',
data data
}) })
@ -153,7 +176,7 @@ export function sendEmail(params) {
export function validEmailCode(params) { export function validEmailCode(params) {
return axios({ return axios({
url: base+'/user/validEmailCode',
url: baseApiUrl+'/'+base+'/user/validEmailCode',
method: 'get', method: 'get',
params:params params:params
}) })
@ -167,7 +190,7 @@ export function validEmailCode(params) {
*/ */
export function getTpaState( ) { export function getTpaState( ) {
return axios({ return axios({
url: '/tpa/login/wechat/wxpub/state',
url: baseApiUrl+'/tpa/login/wechat/wxpub/state',
method: 'post', method: 'post',
data:{} data:{}
}) })
@ -177,7 +200,7 @@ export function getTpaState( ) {
* @returns * @returns
*/ */
export function queryMyUsers( ) { export function queryMyUsers( ) {
return axios({
return axiosAuth({
url: base+'/user/queryMyUsers', url: base+'/user/queryMyUsers',
method: 'get' method: 'get'
}) })

76
src/api/mdp/arc/archive.js

@ -1,7 +1,6 @@
import axios from '@/utils/request' import axios from '@/utils/request'
import config from '@/common/config' import config from '@/common/config'
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表
let base = config.getArcBasePath(); let base = config.getArcBasePath();
@ -12,52 +11,75 @@ let base=config.getArcBasePath();
**/ **/
//普通查询 条件之间and关系 //普通查询 条件之间and关系
export const listArchive = params => { return axios.get(`${base}/mdp/arc/archive/list`, { params: params }); };
export const listArchive = params => {
return axios.get(`${base}/mdp/arc/archive/list`, {
params: params
});
};
export const getNew = params => {
return axios.get(`${base}/archive/listNews`, {
params: params
});
};
//常见问题
export const getNorQuestions = params => {
return axios.get(`${base}/mdp/arc/aq/aqFaq/list`, {
params: params
});
};
export const getOneArchive = params => { return axios.get(`${base}/mdp/arc/archive/one`, { params: params }); };
export const getOneArchive = params => {
return axios.get(`${base}/mdp/arc/archive/one`, {
params: params
});
};
//模糊查询档案信息表 条件之间or关系 //模糊查询档案信息表 条件之间or关系
//export const listArchiveKey = params => { return axios.get(`${base}/mdp/arc/archive/listKey`, { params: params }); }; //export const listArchiveKey = params => { return axios.get(`${base}/mdp/arc/archive/listKey`, { params: params }); };
//删除一条档案信息表 params={id:'主键 主键'} //删除一条档案信息表 params={id:'主键 主键'}
export const delArchive = params => { return axios.post(`${base}/mdp/arc/archive/del`,params); };
export const delArchive = params => {
return axios.post(`${base}/mdp/arc/archive/del`, params);
};
//批量删除档案信息表 params=[{id:'主键 主键'}] //批量删除档案信息表 params=[{id:'主键 主键'}]
export const batchDelArchive = params => { return axios.post(`${base}/mdp/arc/archive/batchDel`, params); };
export const batchDelArchive = params => {
return axios.post(`${base}/mdp/arc/archive/batchDel`, params);
};
//修改一条档案信息表记录 //修改一条档案信息表记录
export const editArchive = params => { return axios.post(`${base}/mdp/arc/archive/edit`, params); };
export const editArchive = params => {
return axios.post(`${base}/mdp/arc/archive/editSomeFields`, params);
};
//新增一条档案信息表 //新增一条档案信息表
export const addArchive = params => { return axios.post(`${base}/mdp/arc/archive/add`, params); };
export const addArchive = params => {
return axios.post(`${base}/mdp/arc/archive/add`, params);
};
//打开评论 //打开评论
export const openComment = params => { return axios.post(`${base}/mdp/arc/archive/comment/open`, params); };
export const openComment = params => {
return axios.post(`${base}/mdp/arc/archive/comment/open`, params);
};
//关闭评论 //关闭评论
export const closeComment = params => { return axios.post(`${base}/mdp/arc/archive/comment/close`, params); };
export const closeComment = params => {
return axios.post(`${base}/mdp/arc/archive/comment/close`, params);
};
//发布 //发布
export const publish = params => { return axios.post(`${base}/mdp/arc/archive/publish`, params); };
export const publish = params => {
return axios.post(`${base}/mdp/arc/archive/publish`, params);
};
//取消发布 //取消发布
export const unPublish = params => { return axios.post(`${base}/mdp/arc/archive/unpublish`, params); };
export const unPublish = params => {
return axios.post(`${base}/mdp/arc/archive/unpublish`, params);
};
//新增一个 //新增一个
export const addWorkflowArchive = params => { return axios.post(`${base}/mdp/arc/archive/add/workflow`, params); };
//批量修改某些字段
export const editSomeFieldsArchive = params => { return axios.post(`${base}/mdp/arc/archive/editSomeFields`, params); };
/**-------------------------前端mng|add|edit界面公共函数---------------请写在下面----------------------------------------------- */
//初始化页面上的字典
export const initDicts = (that) => {
var itemCodes=['categoryType','archiveStatus'];//在此添加要加载的字典 如['sex','grade','lvl']
if(itemCodes.length>0){
initSimpleDicts('all',itemCodes).then(res=>{
Object.assign(that.dicts,res.data.data)
});
}
export const addWorkflowArchive = params => {
return axios.post(`${base}/mdp/arc/archive/add/workflow`, params);
}; };

66
src/api/mdp/arc/category.js

@ -26,3 +26,69 @@ export const editCategory = params => { return axios.post(`${base}/mdp/arc/categ
//新增一个 //新增一个
export const addCategory = params => { return axios.post(`${base}/mdp/arc/category/add`, params); }; export const addCategory = params => { return axios.post(`${base}/mdp/arc/category/add`, params); };
//将列表数据转化为树状结构数据
export const translateDataToTree = (data2) => {
var data=JSON.parse(JSON.stringify(data2));
let parents = data.filter(value =>{
//如果我的上级为空,则我是最上级
if(value.pid == 'undefined' || value.pid == null || value.pid == ''||value.pid=='0'||value.pid=='C0'){
return true;
//如果我的上级不在列表中,我作为最上级
}else if(data.some(i=>value.pid==i.id)){
return false;
}else {
return true
}
})
let children = data.filter(value =>{
if(data.some(i=>value.pid==i.id)){
return true;
}else{
return false;
}
})
let translator = (parents, children) => {
parents.forEach((parent) => {
children.forEach((current, index) => {
if (current.pid === parent.id) {
let temp = JSON.parse(JSON.stringify(children))
temp.splice(index, 1)
translator([current], temp)
typeof parent.children !== 'undefined' ? parent.children.push(current) : parent.children = [current]
}
}
)
}
)
}
translator(parents, children)
return parents
};
export const initCates = (callback) => {
var ckey='forum-category-list'
var categorysStr=localStorage.getItem(ckey);
if(!categorysStr||categorysStr=='null' || categorysStr=='undefined'){
listTreeCategory({categoryType:'5'}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
localStorage.setItem(ckey,JSON.stringify(res.data.data))
callback(res.data.data)
}else{
this.$message.error(tips.isOk)
}
})
}else{
callback(JSON.parse(categorysStr))
}
};

9
src/api/mdp/arc/image.js

@ -32,12 +32,3 @@ export const addImage = params => { return axios.post(`${base}/mdp/arc/image/add
export const listTags = params => { return axios.get(`${base}/mdp/arc/image/listTags`, params); }; export const listTags = params => { return axios.get(`${base}/mdp/arc/image/listTags`, params); };
export const uploadBase64 = params => { return axios.post(`${base}/mdp/arc/image/upload/base64`, params); }; export const uploadBase64 = params => { return axios.post(`${base}/mdp/arc/image/upload/base64`, params); };
export const upload = params=>{
return axios.post(`${base}/mdp/arc/image/upload`, params, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
}

47
src/api/mdp/arc/tag.js

@ -34,3 +34,50 @@ export const getAllTag = params => { return axios.get(`${base}/mdp/arc/tag/getAl
//新增一条arc_tag //新增一条arc_tag
export const deleteTagCategory= params => { return axios.post(`${base}/mdp/arc/tag/deleteTagCategory`, params); }; export const deleteTagCategory= params => { return axios.post(`${base}/mdp/arc/tag/deleteTagCategory`, params); };
//将tags转换成树状结构
export const translateTagsToTree = data => {
var tags=JSON.parse(JSON.stringify(data))
if(!tags||tags.length<=0){
return []
}
var cates={};
tags.forEach(k=>{
if(k.categoryId && k.categoryName){
cates[k.categoryId]={id:k.categoryId,name:k.categoryName,children:[],disabled:true}
}
})
tags.forEach(k=>{
k.name=k.tagName
k.id=k.tagId
k.disabled=false
var cate=cates[k.categoryId]
if(cate){
cate.children.push(k)
}
})
var datas=[]
for(let key in cates){
datas.push(cates[key])
}
return datas;
};
export const initTags = callback => {
var tagkey='forum-tags-list'
var tagStr=localStorage.getItem(tagkey);
if(!tagStr||tagStr=='null' || tagStr=='undefined'){
getAllTag().then(res=>{
var tips = res.data.tips;
if(tips.isOk){
localStorage.setItem(tagkey,JSON.stringify(res.data.data))
callback(res.data.data)
}else{
this.$message.error(tips.isOk)
}
})
}else{
callback(JSON.parse(tagStr))
}
};

118
src/api/mdp/sys/user.js

@ -1,6 +1,7 @@
import axios from '@/utils/request' import axios from '@/utils/request'
import config from '@/common/config' import config from '@/common/config'
import { CodeToText, TextToCode } from 'element-china-area-data';
let base=config.getSysBasePath(); let base=config.getSysBasePath();
@ -12,6 +13,12 @@ let base=config.getSysBasePath();
//普通查询 条件之间and关系 //普通查询 条件之间and关系
export const listUser = params => { return axios.get(`${base}/mdp/sys/user/list`, { params: params }); }; export const listUser = params => { return axios.get(`${base}/mdp/sys/user/list`, { params: params }); };
//免登录查询用户数据
export const listCrowdUser = params => { return axios.get(`${base}/mdp/sys/user/crowd/list`, { params: params }); };
//查询用户详情
export const detailNoauthUser = params => { return axios.get(`${base}/mdp/sys/user/noauth/detail`, { params: params }); };
export const listUserNames = params => { return axios.get(`${base}/mdp/sys/user/listUserNames`, { params: params }); }; export const listUserNames = params => { return axios.get(`${base}/mdp/sys/user/listUserNames`, { params: params }); };
export const selectlistKey= params => { return axios.get(`${base}/mdp/sys/user/selectlistKey`, { params: params }); }; export const selectlistKey= params => { return axios.get(`${base}/mdp/sys/user/selectlistKey`, { params: params }); };
@ -29,6 +36,10 @@ export const batchDelUser = params => { return axios.post(`${base}/mdp/sys/user/
//修改一条用户表记录 //修改一条用户表记录
export const editUser = params => { return axios.post(`${base}/mdp/sys/user/edit`, params); }; export const editUser = params => { return axios.post(`${base}/mdp/sys/user/edit`, params); };
//修改某个字段
export const editSomeFieldsUser = params => { return axios.post(`${base}/mdp/sys/user/editSomeFields`, params); };
//重置管理人员帮别人重置密码 //重置管理人员帮别人重置密码
export const resetPasswordByAdmin = params => { return axios.post(`${base}/sys/user/resetPassword`, params); }; export const resetPasswordByAdmin = params => { return axios.post(`${base}/sys/user/resetPassword`, params); };
@ -53,4 +64,111 @@ export const setUsersUnBranchAdm = params => { return axios.post(`${base}/sys/us
//更新当前登录着的头像 //更新当前登录着的头像
export const editHeadimgurl = params => { return axios.post(`${base}/sys/user/editHeadimgurl`, params); }; export const editHeadimgurl = params => { return axios.post(`${base}/sys/user/editHeadimgurl`, params); };
export const formatGradeLogo = item => {
if (item.gradeId == '2') {
item.gradeName = '学士';
item.gradeLogo = require('../../../../static/images/ability-level2.png');
} else if (item.gradeId == '3') {
item.gradeName = '进士';
item.gradeLogo = require('../../../../static/images/ability-level3.png');
} else if (item.gradeId == '4') {
item.gradeName = '大师';
item.gradeLogo = require('../../../../static/images/ability-level4.png');
} else if (item.gradeId == '5') {
item.gradeName = '宗师';
item.gradeLogo = require('../../../../static/images/ability-level5.png');
} else if (item.gradeId == '6') {
item.gradeName = '天师';
item.gradeLogo = require('../../../../static/images/ability-level6.png');
} else if (item.gradeId == '7') {
item.gradeName = '神师';
item.gradeLogo = require('../../../../static/images/ability-level7.png');
}else {
item.gradeName = '学徒';
item.gradeLogo = require('../../../../static/images/ability-level1.png');
}
return item
}
export const formatInterestsLogo = item => {
if (item.ilvlId == '2') {
item.ilvlName = '青铜会员';
item.ilvlLogo = require('../../../../static/images/mem-level1.png');
} else if (item.ilvlId == '3') {
item.ilvlName = '白银会员';
item.ilvlLogo = require('../../../../static/images/mem-level2.png');
} else if (item.ilvlId == '4') {
item.ilvlName = '黄金会员';
item.ilvlLogo = require('../../../../static/images/mem-level3.png');
} else if (item.ilvlId == '5') {
item.ilvlName = '紫金会员';
item.ilvlLogo = require('../../../../static/images/mem-level4.png');
} else if (item.ilvlId == '6') {
item.ilvlName = '皇冠会员';
item.ilvlLogo = require('../../../../static/images/mem-level5.png');
} else {
item.ilvlId = '1';
item.ilvlName = '普通会员';
item.ilvlLogo = require('../../../../static/images/mem-level6.png');
}
return item
}
export const formatGuardLogo = item => {
if (item.guardId == '3') {
item.guardName = '金牌三保用户';
item.guardLogo = require('../../../../static/images/is-gua.png');
} else if (item.guardId == '2') {
item.guardName = '银牌三保用户';
item.guardLogo = require('../../../../static/images/is-gua.png');
} else if (item.guardId == '1') {
item.guardName = '铜牌三保用户';
item.guardLogo = require('../../../../static/images/is-gua.png');
} else {
item.guardName = '非三保用户';
item.guardLogo = require('../../../../static/images/not-gua.png');
}
return item
}
export const formatCreditLogo = item => {
if (item.creditId == 'D') {
item.creditName = 'D级信用';
item.creditLogo = require('../../../../static/images/credit-level7.png');
} else if (item.creditId == 'C') {
item.creditName = 'C级信用';
item.creditLogo = require('../../../../static/images/credit-level6.png');
} else if (item.creditId == 'B') {
item.creditName = 'B级信用';
item.creditLogo = require('../../../../static/images/credit-level5.png');
} else if (item.creditId == 'A') {
item.creditName = 'A级信用';
item.creditLogo = require('../../../../static/images/credit-level4.png');
} else if (item.creditId == 'S') {
item.creditName = 'S级信用';
item.creditLogo = require('../../../../static/images/credit-level3.png');
} else if (item.creditId == 'SS') {
item.creditName = 'SS级信用';
item.creditLogo = require('../../../../static/images/credit-level2.png');
} else if (item.creditId == 'SSS') {
item.creditName = 'SSS级信用';
item.creditLogo = require('../../../../static/images/credit-level1.png');
} else {
item.creditId = 'D';
item.creditName = 'D级信用';
item.creditLogo = require('../../../../static/images/credit-level7.png');
}
return item;
}
export const formatUser = item => {
item.province = item.province ? CodeToText[item.province] : '';
item.city = item.city ? CodeToText[item.city] : '';
formatGuardLogo(item);
formatGradeLogo(item);
formatInterestsLogo(item);
formatCreditLogo(item);
return item
}

153
src/api/xm/core/xmTask.js

@ -86,7 +86,11 @@ export const initDicts = (that) => {
that.dicts['marketState']=[{id:'0',name:'关闭'},{id:'1',name:'待付款'},{id:'2',name:'已开通'},{id:'3',name:'已过期'}] that.dicts['marketState']=[{id:'0',name:'关闭'},{id:'1',name:'待付款'},{id:'2',name:'已开通'},{id:'3',name:'已过期'}]
if(itemCodes.length>0){ if(itemCodes.length>0){
initSimpleDicts('all',itemCodes).then(res=>{ initSimpleDicts('all',itemCodes).then(res=>{
if(that.dicts){
Object.assign(that.dicts,res.data.data) Object.assign(that.dicts,res.data.data)
}else{
that.dicts=res.data.data
}
}); });
} }
}; };
@ -99,6 +103,155 @@ export const initDicts = (that) => {
return res; return res;
}; };
export const logBrowseTimes=(taskId)=>{
/**
* 登记浏览量
*/
var taskReadNumsStr=localStorage.getItem('task-read-nums')
var date=new Date();
var taskReadNums={ltime:date.getTime(),data:[]}
if(taskReadNumsStr){
taskReadNums=JSON.parse(taskReadNumsStr)
}
taskReadNums.data.push({ taskId: taskId,nums:1 })
localStorage.setItem('task-read-nums',JSON.stringify(taskReadNums));
var ntime=date.getTime();
if((ntime-taskReadNums.ltime)>=10*60*1000){
localStorage.removeItem('task-read-nums');
upBrowseTimes(taskReadNums.data);
}
//upBrowseTimes(taskReadNums.data);
}
export const formatTask = taskMsg => {
taskMsg.gradeId=taskMsg.capaLvls;
taskMsg.creditId=taskMsg.creditId;
taskMsg.guardId=taskMsg.supRequires;
taskMsg.ilvlId=taskMsg.interestLvls;
formatCreditLogo(taskMsg)
formatGradeLogo(taskMsg)
formatGuardLogo(taskMsg)
formatInterestsLogo(taskMsg)
taskMsg.skills = taskMsg.taskSkillNames ? taskMsg.taskSkillNames.split(',') : [];
};
export const formatAtRemark = at => {
if(!at){
return "请输入预算金额"
}
if(at<10000){
return ""
}
if(at<10000){
return "约 " +(at) +" 元"
}else if(at<1000000){
return "约 " +(at/10000).toFixed(2)+" 万元"
}else if(at<1000000){
return "约 " +(at/10000).toFixed(2)+" 万元"
}else if(at<1000000){
return "约 " +(at/10000).toFixed(2)+" 万元"
}else if(at>=1000000){
return "约 " +(at/1000000).toFixed(2)+" 百万元"
}
};
export const formatWorkloadRemark = workload => {
if(!workload){
return "请输入估工时"
}
if(workload<8){
return ""
}
if(workload<1760){
return "约 " +(workload/8).toFixed(1)+" 人天 (1人天=8人时)"
}else if(workload<1760*12){
return "约 " +(workload/(1760)).toFixed(1)+" 人月 (1人月=22人天)"
}else if(workload>=1760*12){
return "约 " +(workload/1760*12).toFixed(2)+" 人年 (1人年=12人月)"
}
};
//更新任务的某些字段
export const editSomeFieldsTask = params => {
return axios.post(`${base}/xm/core/xmTask/editSomeFields`, params);
};
export const getTaskState= task => {
let obj = {
type: '',
state: '',
desc: '',
};
if (task.bidStep == '0') {
obj = {
type: 'info',
state: '草稿',
desc: '仅自己可见可编辑',
};
return obj;
} else if (task.bidStep == '1') {
obj = {
type: 'info',
state: '发布需求',
desc: '服务商可以搜素,但不可以投标。',
};
return obj;
} else if (task.bidStep == '2') {
obj = {
type: 'warning',
state: '投标进行中',
desc: '投标截止时间:'+((task.bidEtime ? task.bidEtime.slice(0,10) : '')||'未设置'),
};
return obj;
} else if (task.bidStep == '3') {
obj = {
type: 'warning',
state: '待选标',
desc: '投标截止时间:'+((task.bidEtime ? task.bidEtime.slice(0,10) : '')||'未设置'),
};
return obj;
} else if (task.bidStep == '4') {
obj = {
type: 'warning',
state: '托管赏金',
desc: '甲方将任务赏金拓管到平台',
};
return obj;
} else if (task.bidStep == '5') {
obj = {
type: 'danger',
state: '工作中',
desc: '服务商工作中',
};
return obj;
} else if (task.bidStep == '6') {
obj = {
type: 'success',
state: '确认验收',
desc: '甲方确认验收完毕,付款完毕',
};
return obj;
} else if (task.bidStep == '7') {
obj = {
type: 'success',
state: '确认验收',
desc: '甲方确认验收完毕,付款完毕',
};
return obj;
} else {
obj = {
type: 'danger',
state: '未知',
desc: '无法获取任务状态',
};
return obj;
}
};

165
src/permission.js

@ -7,24 +7,62 @@ import { getToken,setToken } from '@/utils/auth' // getToken from cookie
NProgress.configure({ showSpinner: false })// NProgress Configuration NProgress.configure({ showSpinner: false })// NProgress Configuration
function getQueryVariable(variable,url){
var query =url;
if(url==null || url==undefined || url==''){
query=window.location.href;
}
//alert(query);
var query2=query.split("?");
if(query2.length>1){
query=query2[1];
}else{
query=""
return null;
}
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return null;
}
var accessToken=getQueryVariable('accessToken');
// permissiom judge function // permissiom judge function
function hasPermission(roles, permissionRoles) { function hasPermission(roles, permissionRoles) {
if(!roles || roles.length==0){
return true;
}
if (!permissionRoles) return true if (!permissionRoles) return true
if (roles.some(role => role.roleid==='superAdmin')) return true // admin permission passed directly if (roles.some(role => role.roleid==='superAdmin')) return true // admin permission passed directly
return roles.some(role => permissionRoles.indexOf(role) >= 0)
return roles.some(role => permissionRoles.indexOf(role.roleid) >= 0)
} }
const whiteList = ['/login', '/authredirect','/changeEmailStepOne','/changeEmailStepTwo']// no redirect whitelist
//免登录白名单
const whiteList = [
]
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar NProgress.start() // start progress bar
var outUrl="";
debugger;
if(to.path==='/' || to.path.indexOf('/404')>=0 || to.path.indexOf('/401')>=0 || to.path.indexOf('/login')>=0 ||to.path.indexOf('/logout')>=0){
next()
NProgress.done()
return;
}
if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next() next()
NProgress.done() //如果当前页面为登录页,则在每个afterEach钩子后都不会触发,因此请手动处理它
NProgress.done()
return; return;
} }
if(to.meta.openTab==true && to.meta.outUrl){
var outUrl="";
if(to.meta && to.meta.openTab==true && to.meta.outUrl){
outUrl=to.meta.outUrl; outUrl=to.meta.outUrl;
if(to.query){ if(to.query){
var querys=''; var querys='';
@ -63,24 +101,30 @@ router.beforeEach((to, from, next) => {
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
return; return;
} }
if(to!=null && to.fullPath!=null){
var accessToken=getQueryVariable("accessToken",to.fullPath);
if(accessToken!=null){
setToken(accessToken);
}
if (!to.meta || !to.meta.roles) {
next()//
NProgress.done()
return;
} }
if (getToken()) { // determine if there has token if (getToken()) { // determine if there has token
/* has token*/ /* has token*/
if (to.path === '/login') {
if (to.path.indexOf('/login')>=0) {
next()// next()//
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
return;
} else { } else {
if(store.getters.isLoadOk==false ){ if(store.getters.isLoadOk==false ){
store.dispatch('GetUserInfo').then(res=>{ store.dispatch('GetUserInfo').then(res=>{
if(!res.data.tips.isOk){ if(!res.data.tips.isOk){
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
Message.error('请重新登陆') Message.error('请重新登陆')
if(accessToken && accessToken.length>0){
//window.open('/#/login',null,null,true)
next({ path: '/login',replace:true })
}else{
next({ path: '/login' }) next({ path: '/login' })
}
return
}) })
}else{ }else{
store.dispatch('GenerateRoutes', {roles:store.getters.roles ,menus:store.getters.myMenus} ).then(() => { // 根据roles权限生成可访问的路由表 store.dispatch('GenerateRoutes', {roles:store.getters.roles ,menus:store.getters.myMenus} ).then(() => { // 根据roles权限生成可访问的路由表
@ -89,7 +133,13 @@ router.beforeEach((to, from, next) => {
}).catch(() => { }).catch(() => {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
Message.error('路由处理出错,请重新登陆') Message.error('路由处理出错,请重新登陆')
if(accessToken && accessToken.length>0){
//window.open('/#/login',null,null,true)
next({ path: '/login',replace:true })
}else{
next({ path: '/login' }) next({ path: '/login' })
}
return
}) })
}) })
} }
@ -99,18 +149,28 @@ router.beforeEach((to, from, next) => {
store.dispatch('GenerateRoutes', {roles:store.getters.roles ,menus:store.getters.myMenus} ).then(() => { // 根据roles权限生成可访问的路由表 store.dispatch('GenerateRoutes', {roles:store.getters.roles ,menus:store.getters.myMenus} ).then(() => { // 根据roles权限生成可访问的路由表
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表 router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
return
}).catch(() => { }).catch(() => {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
Message.error('路由处理出错,请重新登陆') Message.error('路由处理出错,请重新登陆')
if(accessToken && accessToken.length>0){
//window.open('/#/login',null,null,true)
next({ path: '/login',replace:true })
}else{
next({ path: '/login' }) next({ path: '/login' })
}
return
}) })
}) })
} else { } else {
// 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓ // 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓
if (hasPermission(store.getters.roles, to.meta.roles)) {
if (!to.meta || !to.meta.roles || !store.getters.roles || hasPermission(store.getters.roles, to.meta.roles)) {
next()// next()//
return
} else { } else {
next({ path: '/401', replace: true, query: { noGoBack: true }}) next({ path: '/401', replace: true, query: { noGoBack: true }})
return
} }
// 可删 ↑ // 可删 ↑
} }
@ -119,55 +179,76 @@ router.beforeEach((to, from, next) => {
/* has no token*/ /* has no token*/
if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next() next()
return
} else { } else {
next('/login') // 否则全部重定向到登录页
next({path:'/login'}) // 否则全部重定向到登录页
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
return
} }
} }
}) })
function getQueryVariable(variable,url){
var query =url;
if(url==null || url==undefined || url==''){
query=window.location.href;
}
//alert(query);
var query2=query.split("?");
if(query2.length>1){
query=query2[1];
}else{
query=""
return null;
}
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return null;
/**
* 防止禁用弹框 _self模式
* @param {} url
*/
function newWin(url) {
var id='toOpenWindow'
var a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('target', '_self');
a.setAttribute('id', id);
// 防止反复添加
if(!document.getElementById(id)) document.body.appendChild(a);
a.click();
} }
function setIndexPath() { function setIndexPath() {
var indexPath=null var indexPath=null
var url=window.location.href; var url=window.location.href;
if(url.indexOf("/login")<0){
var indexOf=url.indexOf("/#")
var indexName="index-path-"+process.env.CONTEXT;
if(url.indexOf("/login")<=0){
var indexOf=url.indexOf("#/")
if(indexOf > 0){ if(indexOf > 0){
indexPath=url.substring(indexOf+2)
sessionStorage.setItem("index-path",indexPath);
indexPath=url.substring(indexOf+1)
sessionStorage.setItem(indexName,indexPath);
}else{ }else{
sessionStorage.setItem("index-path",null);
sessionStorage.removeItem(indexName);
} }
} }
} }
setIndexPath(); setIndexPath();
var accessToken=getQueryVariable('accessToken');
if(accessToken!=null){
if(accessToken && accessToken.length>10){
//alert(access_token); //alert(access_token);
setToken(accessToken); setToken(accessToken);
store.dispatch('GetUserInfo').then(res=>{
if(!res.data.tips.isOk){
store.dispatch('FedLogOut').then(() => {
Message.error('请重新登陆')
newWin('/#/login')
return
})
}else{
store.dispatch('GenerateRoutes', {roles:store.getters.roles ,menus:store.getters.myMenus} ).then(() => { // 根据roles权限生成可访问的路由表
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
var indexName="index-path-"+process.env.CONTEXT;
var indexPath=sessionStorage.getItem(indexName);
if(indexPath && indexPath.length>0){
newWin('/#'+indexPath)
}else{
newWin('/')
}
}).catch(() => {
store.dispatch('FedLogOut').then(() => {
Message.error('路由处理出错,请重新登陆')
newWin('/#/login')
return
})
})
}
});
} }
router.afterEach(() => { router.afterEach(() => {
NProgress.done() // finish progress bar NProgress.done() // finish progress bar

2
src/router/index.js

@ -52,7 +52,7 @@ export const constantRouterMap = [
path: 'dashboard', path: 'dashboard',
component: _import('xm/XmOverview'), component: _import('xm/XmOverview'),
name: '首页', name: '首页',
meta: { title: '首页', icon: 'home-page', noCache: true }
meta: { title: '首页', icon: 'home-page', noCache: true ,roles:["user"]}
}, },
// { // {
// path: 'updateUserInfo', // path: 'updateUserInfo',

7
src/store/modules/user.js

@ -1,6 +1,10 @@
import { doLoginByUserloginid, logout, getUserInfo } from '@/api/login' import { doLoginByUserloginid, logout, getUserInfo } from '@/api/login'
import { getToken, setToken, removeToken,getCacheUserInfo,setCacheUserInfo,removeCacheUserInfo} from '@/utils/auth' import { getToken, setToken, removeToken,getCacheUserInfo,setCacheUserInfo,removeCacheUserInfo} from '@/utils/auth'
import {
formatUser
} from '@/api/mdp/sys/user.js'
const user = { const user = {
state: { state: {
userInfo: { userInfo: {
@ -122,6 +126,7 @@ const user = {
} }
}); });
} }
formatUser(userInfo)
commit('SET_USER_INFO', userInfo) commit('SET_USER_INFO', userInfo)
commit('SET_ROLES', roles) commit('SET_ROLES', roles)
commit('SET_QXS', data.qxs) commit('SET_QXS', data.qxs)
@ -199,6 +204,8 @@ const user = {
d.branchName=branch.branchName d.branchName=branch.branchName
} }
}) })
formatUser(userInfo)
commit('SET_MYBRANCHS',branchs); commit('SET_MYBRANCHS',branchs);
commit('SET_MYDEPTS',depts); commit('SET_MYDEPTS',depts);
commit('SET_MYLOCATIONS',locations); commit('SET_MYLOCATIONS',locations);

7
src/views/layout/components/AppMain.vue

@ -1,10 +1,9 @@
<template> <template>
<section class="app-main" style="min-height: 100%;"> <section class="app-main" style="min-height: 100%;">
<transition name="fade" mode="out-in">
<keep-alive :include="cachedViews">
<router-view></router-view>
<router-view v-if="!$route.meta.keepAlive"></router-view>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive> </keep-alive>
</transition>
</section> </section>
</template> </template>

436
src/views/xm/core/xmProject/index.vue

@ -0,0 +1,436 @@
<template>
<section>
<top-nav/>
<keep-alive><router-view></router-view></keep-alive>
</section>
</template>
<script>
import util from "@/common/js/util"; //
//import Sticky from '@/components/Sticky' // header
//import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from "vuex";
import topNav from './top-nav.vue'
import { initDicts,getDefOptions,editXmProjectSomeFields } from "@/api/xm/core/xmProject";
export default {
computed: {
...mapGetters(["userInfo", "roles"]),
calcProjectStatusStep() {
if (this.dicts["projectStatus"] && this.selProject) {
var index = this.dicts["projectStatus"].findIndex((i) => {
if (i.id == this.selProject.status) {
return true;
} else {
return false;
}
});
return index + 1;
} else {
return 0;
}
},
},
watch: {},
data() {
return {
platformViewVisible: false,
tabPosition: "left",
infotype: "项目概览",
load: { list: false, edit: false },
groupUserVisible: false,
exportArr: ["任务", "计划", "需求监控"],
dicts: getDefOptions(),
maxTableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
};
}, //end data
methods: {
afterEditSubmit: function (project) {
this.selProject = Object.assign(this.selProject, project);
this.$emit("submit", project);
},
toArchive: function () {
this.$router.push({
path: "/mdp/arc/mate/archive/ArchiveMng",
});
},
toIm: function () {
this.groupUserVisible = true;
},
toHelpMe: function () {
this.$router.push({
path: "/mdp/im/messages/crmChat",
query: {
categoryId: "css",
sendContent: "咨询",
},
});
},
onUserSelected: function (users) {
if (this.groupUserVisible == true) {
var query = {};
if (users) {
if (users.length == 1) {
var user = users[0];
query.toUserid = user.userid;
query.toUsername = user.username;
query.msgType = "prichat";
} else if (users.length >= 2) {
query.users = JSON.stringify(
users.map((i) => {
return { userid: i.userid, username: i.username };
})
);
query.categoryId = "common";
query.msgType = "group";
}
}
this.$router.push({
path: "/mdp/im/messages/messageChat",
query: query,
});
}
},
setInfotype(infotype) {
if (infotype == "返回") {
this.goBack();
} else {
this.infotype = infotype;
localStorage.setItem("project-infotype", infotype);
}
},
handleExport() {
this.downloadLoading = true;
let list = [];
let header = [];
let keyList = [];
let pageNum = 1;
let infotypeKey = "";
if (this.infotype === "任务") {
header = [
"序号",
"任务名称",
"需求",
"预算(万)",
"工作量(人时)",
"执行人",
"进度",
"任务开始时间",
"任务结束时间",
"任务技能需求",
];
keyList = [
"sortLevel",
"name",
"menuName",
"budgetCost",
"budgetWorkload",
"exeUsernames",
"rate",
"startTime",
"endTime",
"taskSkillNames",
];
list = this.$refs.xmTaskMng.tasksTreeData;
pageNum = this.$refs.xmTaskMng.pageInfo.pageNum;
} else if (this.infotype === "计划") {
header = [
"序号",
"计划名称",
"开始时间",
"结束时间",
"进度(%)",
"状态",
"计划人数",
"实际人数",
"计划工期",
"实际工期",
"计划工作量(人时)",
"实际工作量(人时)",
"计划非人力成本(元)",
"实际非人力成本(元)",
"计划内购人力成本(元)",
"实际内购人力成本(元)",
"计划外购人力成本(元)",
"实际外购人力成本(元)",
"计划成本合计(元)",
"实际成本合计(元)",
"审批状态",
"备注",
];
keyList = [
"seqNo",
"name",
"beginDate",
"endDate",
"actRate",
"phaseStatus",
"budgetOuserCnt",
"actStaffNu",
"budgetHours",
"actHours",
"budgetWorkload",
"actWorkload",
"budgetNouserAt",
"actNouserAt",
"budgetIuserAt",
"actIuserAt",
"budgetOuserAt",
"actOuserAt",
"budgetCostAt",
"actCostAt",
"bizFlowState",
"remark",
];
list = this.$refs.xmPhaseMng.projectPhaseTreeData;
pageNum = this.$refs.xmPhaseMng.pageInfo.pageNum;
} else if (this.infotype === "需求监控") {
header = [
"序号",
"需求名称",
"计划状态",
"负责人",
"上线时间",
"计划开始时间",
"实际开始时间",
"计划结束时间",
"实际结束时间",
"计划工作量(人时)",
"实际工作量(人时)",
"计划成本(元)",
"实际成本(元)",
"总体完成比例%",
"需求完成比例%",
"设计完成比例%",
"开发完成比例%",
"sit完成比例%",
"uat完成比例%",
"上线状态",
];
keyList = [
"seqNo",
"menuName",
"planStatus",
"chargeUsername",
"onlineTime",
"planStartTime",
"actStartTime",
"planEndTime",
"actEndTime",
"planWorkload",
"actWorkload",
"planCostAmount",
"actCostAmount",
"finishRate",
"demandRate",
"designRate",
"devRate",
"sitRate",
"uatRate",
"onlineStatus",
];
list = this.$refs.xmMenuWithPlan.xmMenusTreeData;
pageNum = this.$refs.xmMenuWithPlan.pageInfo.pageNum;
}
const filename = `${this.selProject.name}_${this.infotype}_第${pageNum}`;
const data = this.formatJson(keyList, list);
import("@/vendor/Export2Excel").then((excel) => {
excel.export_json_to_excel({
header,
data,
filename,
// autoWidth: this.autoWidth,
bookType: "xlsx",
});
this.downloadLoading = false;
});
},
formatJson(filterVal, jsonData, dataList = []) {
if (this.infotype == "任务") {
jsonData.forEach((v) => {
const row = filterVal.map((j) => {
let key = "";
return v[j];
});
dataList.push(row);
if (v.children && v.children.length) {
dataList = this.formatJson(filterVal, v.children, dataList);
}
});
return dataList;
} else if (this.infotype == "计划") {
const bizFlowStateDict = {
0: "未发审",
1: "审核中",
2: "已通过",
3: "未通过",
4: "已取消",
};
jsonData.forEach((v) => {
const row = filterVal.map((j) => {
let key = "";
if (j == "phaseStatus") {
return this.$refs.xmPhaseMng.formateOption(
"xmPhaseStatus",
v.phaseStatus
);
} else if (j == "bizFlowState") {
return `${bizFlowStateDict[parseInt(v[j]) || 0]}`;
} else {
return v[j];
}
});
dataList.push(row);
if (v.children && v.children.length) {
dataList = this.formatJson(filterVal, v.children, dataList);
}
});
return dataList;
} else if (this.infotype == "需求监控") {
jsonData.forEach((v) => {
const row = filterVal.map((j) => {
let key = "";
if (j == "planStatus") {
key = "xmMenuPlanStatus";
} else if (j == "onlineStatus") {
return parseInt(v[j]) ? "已上线" : "未上线";
} else {
return v[j];
}
const dicts = this.$refs.xmMenuWithPlan.dicts;
if (
dicts[key] == undefined ||
dicts[key] == null ||
dicts[key].length == 0
) {
return v[j];
}
var rowData = dicts[key].filter((i) => i.id == v[j]);
if (rowData.length > 0) {
return rowData[0].name;
} else {
return v[j];
}
});
dataList.push(row);
if (v.children && v.children.length) {
dataList = this.formatJson(filterVal, v.children, dataList);
}
});
return dataList;
}
},
getDateString(dateStr) {
if (dateStr == null || dateStr == "" || dateStr == undefined) {
return "";
} else {
return dateStr.substr(0, 10);
}
},
editXmProjectSomeFields(row,fieldName,$event){
var that=this;
var func=(params)=>{
editXmProjectSomeFields(params).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$emit('edit-fields',params)
Object.assign(row,params)
this.selProjectBak=Object.assign({},row)
}else{
Object.assign(this.selProject,this.selProjectBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
})
}
var params={ids:[row.id]};
params[fieldName]=$event
if(fieldName=='description'){
this.$refs.selProject.validateField('description',err=>{
if(err){
this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'})
return;
}else{
func(params)
}
})
}else if(fieldName=='name'){
this.$refs.selProject.validateField('name',err=>{
if(err){
this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'})
return;
}else{
func(params)
}
})
}else{
func(params)
}
},
goBack() {
localStorage.setItem("project-infotype", "项目概览");
this.$router.back(-1);
},
goHome(){
localStorage.setItem("project-infotype", "项目概览");
this.$router.push({path:'/'})
},
onEditFields(row){
Object.assign(this.selProject,row)
this.$emit("edit-fields",row);
},
showCurrFlow(){
this.$refs['项目概览'].showPanelName='currFlow'
},
showHisFlow(){
this.$refs['项目概览'].showPanelName='hisFlow'
},
showDetail(){
this.$refs['项目概览'].showPanelName='detail'
},
showProjectGaiSuan(){
this.$refs['项目概览'].showPanelName='detail'
this.$nextTick(()=>{
this.$refs['项目概览'].$refs['detail'].$refs['projectEdit'].currTabPane='4'
})
},
showProjectShouYi(){
this.$refs['项目概览'].showPanelName='detail'
this.$nextTick(()=>{
this.$refs['项目概览'].$refs['detail'].$refs['projectEdit'].currTabPane='5'
})
},
showMenusPage(){
this.infotype='需求'
},
linkProduct(){
this.$refs['项目概览'].showPanelName='productProjectLink'
},
createProduct(){
this.infotype='产品'
this.$nextTick(()=>{
this.$refs['xmProductComplex'].addProductVisible=true
})
}
}, //end methods
components: {
topNav
//
},
mounted() {
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

876
src/views/xm/core/xmProject/top-nav.vue

@ -0,0 +1,876 @@
<template>
<section>
<el-row>
<el-menu
:default-active="infotype"
mode="horizontal"
@select="setInfotype"
class="menus"
background-color="rgb(48, 65, 86)"
text-color="rgb(191, 203, 217)"
active-text-color="#409eff"
>
<el-menu-item index="项目概览">
<span
slot="title"
style="font-size: 18px; color: #ffd04b"
class="hidden-sm-and-down"
:title="selProject.name"
>
<font v-if="selProject.name.length >= 15"
><strong
>&nbsp;<el-avatar class="top-icon" icon="el-icon-odometer" style="background-color:#E6A23C"></el-avatar>&nbsp;:&nbsp;{{ selProject.name.substring(0, 15) }}</strong
></font
>
<font type="danger" v-else
><strong>&nbsp;<el-avatar class="top-icon" icon="el-icon-odometer" style="background-color:#E6A23C"></el-avatar>&nbsp;:&nbsp;{{ selProject.name }}</strong></font
>
</span>
<span
slot="title"
style="color: #ffd04b"
class="hidden-md-and-up"
:title="selProject.name"
>
<font v-if="selProject.name.length >= 15"
>&nbsp;<el-avatar class="top-icon" icon="el-icon-odometer" style="background-color:#E6A23C"></el-avatar>&nbsp;:&nbsp;{{ selProject.name.substring(0, 15) }}</font
>
<font type="danger" v-else
>&nbsp;<el-avatar class="top-icon" icon="el-icon-odometer" style="background-color:#E6A23C"></el-avatar>&nbsp;:&nbsp;{{ selProject.name }}</font
>
</span>
</el-menu-item>
<el-menu-item index="产品">
<span slot="title"><i class="el-icon-s-opportunity"></i>产品</span>
</el-menu-item>
<el-menu-item label="需求" index="需求" class="hidden-md-and-down">
<span slot="title"><i class="el-icon-document"></i>需求</span>
</el-menu-item>
<el-menu-item index="迭代">
<span slot="title"><i class="el-icon-connection"></i>迭代</span>
</el-menu-item>
<el-menu-item index="计划">
<span slot="title"><i class="el-icon-time"></i>计划</span>
</el-menu-item>
<el-menu-item index="任务" class="hidden-md-and-down">
<span slot="title"><i class="el-icon-s-operation"></i>任务</span>
</el-menu-item>
<el-menu-item index="缺陷">
<span slot="title"><i class="el-icon-question"></i>缺陷</span>
</el-menu-item>
<el-menu-item index="团队">
<span slot="title"><i class="el-icon-user-solid"></i>团队</span>
</el-menu-item>
<el-submenu index="财务" class="hidden-sm-and-down">
<template slot="title"><i class="el-icon-coin"></i>财务</template>
<el-menu-item index="合同管理">
<span slot="title"><i class="el-icon-s-data"></i>合同管理</span>
</el-menu-item>
<el-menu-item index="预算">
<span slot="title"><i class="el-icon-coin"></i>预算</span>
</el-menu-item>
<el-menu-item index="费用">
<span slot="title"><i class="el-icon-coin"></i>费用</span>
</el-menu-item>
</el-submenu>
<el-menu-item index="效能">
<span slot="title"><i class="el-icon-s-data"></i>效能</span>
</el-menu-item>
<el-submenu index="知识" class="hidden-md-and-down">
<template slot="title">知识</template>
<el-menu-item index="文档">
<span slot="title"><i class="el-icon-document"></i>文档</span>
</el-menu-item>
<el-menu-item index="环境清单">
<span slot="title"><i class="el-icon-setting"></i>环境清单</span>
</el-menu-item>
<el-menu-item index="日志">
<span slot="title"><i class="el-icon-edit-outline"></i>日志</span>
</el-menu-item>
</el-submenu>
<el-submenu index="更多">
<template slot="title">更多 </template>
<el-menu-item index="每日工时">
<span slot="title"
><i class="el-icon-video-camera"></i>每日工时</span
>
</el-menu-item>
<el-menu-item index="每月工时">
<span slot="title"
><i class="el-icon-video-camera"></i>每月工时</span
>
</el-menu-item>
<el-menu-item index="预算">
<span slot="title"><i class="el-icon-coin"></i>预算</span>
</el-menu-item>
<el-menu-item index="费用">
<span slot="title"><i class="el-icon-coin"></i>费用</span>
</el-menu-item>
<el-menu-item index="考核">
<span slot="title"><i class="el-icon-view"></i>考核</span>
</el-menu-item>
<el-menu-item index="日志">
<span slot="title"><i class="el-icon-edit-outline"></i>日志</span>
</el-menu-item>
<el-menu-item index="合同管理">
<span slot="title"><i class="el-icon-s-data"></i>合同管理</span>
</el-menu-item>
<el-menu-item index="环境清单">
<span slot="title"><i class="el-icon-setting"></i>环境清单</span>
</el-menu-item>
<el-menu-item index="风险">
<span slot="title"><i class="el-icon-question"></i>风险</span>
</el-menu-item>
<el-menu-item index="论坛">
<span slot="title"><i class="el-icon-date"></i>论坛</span>
</el-menu-item>
<el-menu-item index="即聊">
<span slot="title"><i class="el-icon-date"></i>即聊</span>
</el-menu-item>
<el-menu-item index="客服">
<span slot="title"><i class="el-icon-date"></i>客服</span>
</el-menu-item>
<el-menu-item index="上一页" @click.native="goBack">
<span slot="title"
><i class="el-icon-back"></i>上一页</span
>
</el-menu-item>
<el-menu-item index="首页" @click.native="goHome">
<span slot="title"
><i class="el-icon-s-home"></i>首页</span
>
</el-menu-item>
</el-submenu>
</el-menu>
</el-row>
<el-row ref="pageBody">
<el-col :span="infotype=='项目概览'?4:0" class="padding border" :style="{maxHeight:maxTableHeight+'px',overflowY:'auto'}">
<h4 class="padding-bottom">常用功能快捷导航</h4>
<el-steps :active="calcProjectStatusStep" finish-status="success" direction="vertical">
<el-step
v-for="(i, index) in dicts['projectStatus']"
:title="i.name"
:key="index"
>
<el-row slot="description">
<el-row v-if="i.id=='0'"><!--初始-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="createProduct()">创建产品</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="linkProduct()">关联产品</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='环境清单'">环境清单</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','1')">进入售前</el-button>
</span>
<span v-if="selProject.status!=i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="linkProduct()">关联产品</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='环境清单'">环境清单</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='1'"><!--售前-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="showMenusPage">需求管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','2')">设为立项中</el-button>
</span>
<span v-if="selProject.status!=i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="showMenusPage">需求管理</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='2'"><!--立项中-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='合同管理'">签订合同</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='团队'">创建团队</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='计划'">创建计划</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='预算'">预算清单</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="showProjectGaiSuan()">项目估算</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="showProjectShouYi()">项目收益</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','3')">设为立项中</el-button>
</span>
<span v-if="selProject.status!=i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='合同管理'">合同管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='团队'">团队管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='计划'">计划管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='预算'">预算管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="showProjectGaiSuan()">项目估算</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="showProjectShouYi()">项目收益</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='3'"><!--实施中-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='迭代'">迭代管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='计划'">任务管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='缺陷'">缺陷管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='每日工时'">每日工时</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='每月工时'">每月工时</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='费用'">费用管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='效能'">效能分析</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','4')">暂停项目</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="projectChangeRequire()">变更申请</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','5')">设为结项中</el-button>
</span>
<span v-if="selProject.status!=i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='迭代'">迭代管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='计划'">任务管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='缺陷'">缺陷管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='每日工时'">每日工时</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='每月工时'">每月工时</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='费用'">费用管理</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="infotype='效能'">效能分析</el-button>
<el-button v-if="selProject.status<i.id" class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','5')">结项申请</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="showDetail()">变更申请</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='4'"><!--暂停中-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','3')">重新激活</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='5'"><!--结项中-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="showDetail()">结项申请</el-button>
<el-button class="step-btn" type="warning" size="mini" plain @click="showCurrFlow()">结项审批</el-button>
</span>
<span v-if="selProject.status!=i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="showHisFlow()">结项审批</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='6'"><!--已结项-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','7')">转入售后</el-button>
</span>
<span v-if="selProject.status!=i.id">
</span>
</el-row>
<el-row v-else-if="i.id=='7'"><!--售后-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','8')">设为已完成</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='8'"><!--已完成-->
<span v-if="selProject.status==i.id">
<el-button class="step-btn" type="warning" size="mini" plain @click="editXmProjectSomeFields(selProject,'status','9')">关闭项目</el-button>
</span>
</el-row>
<el-row v-else-if="i.id=='9'"><!--已关闭-->
</el-row>
</el-row>
</el-step>
</el-steps>
</el-col>
<el-col :span="infotype=='项目概览'?20:24">
<xm-project-overview-complex
v-if="infotype == '项目概览'"
:sel-project="selProject"
@submit="afterEditSubmit"
@edit-fields="onEditFields"
ref="项目概览"
></xm-project-overview-complex>
<xm-product-for-link-complex
v-if="infotype == '产品'"
ref="xmProductComplex"
:sel-project="selProject"
></xm-product-for-link-complex>
<xm-iteration-for-link-complex
v-if="infotype == '迭代'"
ref="xmIterationMng"
:sel-project="selProject"
></xm-iteration-for-link-complex>
<xm-menu-mng
v-if="infotype == '需求'"
:sel-project="selProject"
></xm-menu-mng>
<xm-task-mng
v-if="infotype == '任务'"
ref="xmTaskMng"
:sel-project="selProject"
ptype="0"
queryScope="task"
key="task"
></xm-task-mng>
<xm-question
v-if="infotype == '缺陷'"
:qtype="'1'"
:sel-project="selProject"
ref="xmQuestion"
></xm-question>
<xm-group-mng
v-if="infotype == '团队'"
:sel-project="selProject"
></xm-group-mng>
<xm-file-mng
v-if="infotype == '文档'"
:sel-project="selProject"
></xm-file-mng>
<xm-plan
v-if="infotype == '计划'"
ref="projectPlan"
ptype="0"
queryScope="planTask"
:sel-project="selProject"
key="projectPlan"
></xm-plan>
<!-- <xm-phase-mng v-if="infotype=='计划'" ref="xmPhaseMng" :sel-project="selProject" ></xm-phase-mng> -->
<xm-test-case-exec-mng
v-if="infotype == '测试计划'"
:visible="infotype == '测试计划'"
:sel-project="selProject"
ref="xmQuestion"
></xm-test-case-exec-mng>
<xm-budget
v-if="infotype == '预算'"
:sel-project="selProject"
></xm-budget>
<xm-cost v-if="infotype == '费用'" :sel-project="selProject"></xm-cost>
<xm-project-kpi
v-if="infotype == '考核'"
:sel-project="selProject"
></xm-project-kpi>
<xm-record
v-if="infotype == '日志'"
:visible="infotype == '日志'"
:sel-project="selProject"
></xm-record>
<xm-contract
v-if="infotype == '合同管理'"
:sel-project="selProject"
></xm-contract>
<xm-env-list
v-if="infotype == '环境清单'"
:sel-project="selProject"
></xm-env-list>
<xm-question
v-if="infotype == '风险'"
:qtype="'2'"
:sel-project="selProject"
ref="xmRisk"
></xm-question>
<el-drawer
title="选中团队成员"
:visible.sync="groupUserVisible"
size="50%"
append-to-body
:close-on-click-modal="false"
>
<xm-group-select
:sel-project="selProject"
:visible="groupUserVisible"
is-select-multi-user="1"
@user-confirm="onUserSelected"
></xm-group-select>
</el-drawer>
<xm-report
v-if="infotype == '效能'"
:xm-project="selProject"
></xm-report>
<xm-workload-set-day-list
v-if="infotype == '每日工时'"
:xm-project="selProject"
></xm-workload-set-day-list>
<xm-workload-set-month-list
v-if="infotype == '每月工时'"
:xm-project="selProject"
></xm-workload-set-month-list>
</el-col>
</el-row>
</section>
</template>
<script>
import util from "@/common/js/util"; //
//import Sticky from '@/components/Sticky' // header
//import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from "vuex";
import xmTaskMng from "../xmTask/XmTaskMng";
import xmGroupMng from "../xmGroup/XmGroupMng";
import xmGroupSelect from "../xmGroup/XmGroupSelect";
import xmQuestion from "../xmQuestion/XmQuestionMng";
import xmFileMng from "../xmFile/XmFileMng";
import xmDetail from "./XmProjectDetail";
import xmProjectKpi from "../xmProjectKpi/XmProjectKpiMng";
import xmRecord from "../xmRecord/XmRecordMng";
import xmCost from "./XmProjectCost";
import xmBudget from "./XmProjectBudgetCost";
import xmContract from "../xmContract/XmContractMng";
import xmEnvList from "../xmEnvList/XmEnvListMng";
import xmMenuMng from "../xmMenu/XmMenuBox";
import XmIterationForLinkComplex from "../xmIteration/XmIterationForLinkComplex.vue";
import XmProjectOverviewComplex from "./XmProjectOverviewComplex.vue";
import XmProductForLinkComplex from "../xmProduct/XmProductForLinkComplex.vue";
import XmWorkloadSetDayList from "../xmWorkload/WorkloadSetDayList.vue";
import XmWorkloadSetMonthList from "../xmWorkload/WorkloadSetMonthList.vue";
import XmReport from "@/views/xm/rpt/reportIndex";
import XmPlan from "../xmTask/XmPlan.vue";
import { initDicts,getDefOptions,editXmProjectSomeFields } from "@/api/xm/core/xmProject";
export default {
props: ["selProject", "visible"],
computed: {
...mapGetters(["userInfo", "roles"]),
calcProjectStatusStep() {
if (this.dicts["projectStatus"] && this.selProject) {
var index = this.dicts["projectStatus"].findIndex((i) => {
if (i.id == this.selProject.status) {
return true;
} else {
return false;
}
});
return index + 1;
} else {
return 0;
}
},
},
watch: {},
data() {
return {
platformViewVisible: false,
tabPosition: "left",
infotype: "项目概览",
load: { list: false, edit: false },
groupUserVisible: false,
exportArr: ["任务", "计划", "需求监控"],
dicts: getDefOptions(),
maxTableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
};
}, //end data
methods: {
afterEditSubmit: function (project) {
this.selProject = Object.assign(this.selProject, project);
this.$emit("submit", project);
},
toArchive: function () {
this.$router.push({
path: "/mdp/arc/mate/archive/ArchiveMng",
});
},
toIm: function () {
this.groupUserVisible = true;
},
toHelpMe: function () {
this.$router.push({
path: "/mdp/im/messages/crmChat",
query: {
categoryId: "css",
sendContent: "咨询",
},
});
},
onUserSelected: function (users) {
if (this.groupUserVisible == true) {
var query = {};
if (users) {
if (users.length == 1) {
var user = users[0];
query.toUserid = user.userid;
query.toUsername = user.username;
query.msgType = "prichat";
} else if (users.length >= 2) {
query.users = JSON.stringify(
users.map((i) => {
return { userid: i.userid, username: i.username };
})
);
query.categoryId = "common";
query.msgType = "group";
}
}
this.$router.push({
path: "/mdp/im/messages/messageChat",
query: query,
});
}
},
setInfotype(infotype) {
if (infotype == "返回") {
this.goBack();
} else {
this.infotype = infotype;
localStorage.setItem("project-infotype", infotype);
}
},
handleExport() {
this.downloadLoading = true;
let list = [];
let header = [];
let keyList = [];
let pageNum = 1;
let infotypeKey = "";
if (this.infotype === "任务") {
header = [
"序号",
"任务名称",
"需求",
"预算(万)",
"工作量(人时)",
"执行人",
"进度",
"任务开始时间",
"任务结束时间",
"任务技能需求",
];
keyList = [
"sortLevel",
"name",
"menuName",
"budgetCost",
"budgetWorkload",
"exeUsernames",
"rate",
"startTime",
"endTime",
"taskSkillNames",
];
list = this.$refs.xmTaskMng.tasksTreeData;
pageNum = this.$refs.xmTaskMng.pageInfo.pageNum;
} else if (this.infotype === "计划") {
header = [
"序号",
"计划名称",
"开始时间",
"结束时间",
"进度(%)",
"状态",
"计划人数",
"实际人数",
"计划工期",
"实际工期",
"计划工作量(人时)",
"实际工作量(人时)",
"计划非人力成本(元)",
"实际非人力成本(元)",
"计划内购人力成本(元)",
"实际内购人力成本(元)",
"计划外购人力成本(元)",
"实际外购人力成本(元)",
"计划成本合计(元)",
"实际成本合计(元)",
"审批状态",
"备注",
];
keyList = [
"seqNo",
"name",
"beginDate",
"endDate",
"actRate",
"phaseStatus",
"budgetOuserCnt",
"actStaffNu",
"budgetHours",
"actHours",
"budgetWorkload",
"actWorkload",
"budgetNouserAt",
"actNouserAt",
"budgetIuserAt",
"actIuserAt",
"budgetOuserAt",
"actOuserAt",
"budgetCostAt",
"actCostAt",
"bizFlowState",
"remark",
];
list = this.$refs.xmPhaseMng.projectPhaseTreeData;
pageNum = this.$refs.xmPhaseMng.pageInfo.pageNum;
} else if (this.infotype === "需求监控") {
header = [
"序号",
"需求名称",
"计划状态",
"负责人",
"上线时间",
"计划开始时间",
"实际开始时间",
"计划结束时间",
"实际结束时间",
"计划工作量(人时)",
"实际工作量(人时)",
"计划成本(元)",
"实际成本(元)",
"总体完成比例%",
"需求完成比例%",
"设计完成比例%",
"开发完成比例%",
"sit完成比例%",
"uat完成比例%",
"上线状态",
];
keyList = [
"seqNo",
"menuName",
"planStatus",
"chargeUsername",
"onlineTime",
"planStartTime",
"actStartTime",
"planEndTime",
"actEndTime",
"planWorkload",
"actWorkload",
"planCostAmount",
"actCostAmount",
"finishRate",
"demandRate",
"designRate",
"devRate",
"sitRate",
"uatRate",
"onlineStatus",
];
list = this.$refs.xmMenuWithPlan.xmMenusTreeData;
pageNum = this.$refs.xmMenuWithPlan.pageInfo.pageNum;
}
const filename = `${this.selProject.name}_${this.infotype}_第${pageNum}`;
const data = this.formatJson(keyList, list);
import("@/vendor/Export2Excel").then((excel) => {
excel.export_json_to_excel({
header,
data,
filename,
// autoWidth: this.autoWidth,
bookType: "xlsx",
});
this.downloadLoading = false;
});
},
formatJson(filterVal, jsonData, dataList = []) {
if (this.infotype == "任务") {
jsonData.forEach((v) => {
const row = filterVal.map((j) => {
let key = "";
return v[j];
});
dataList.push(row);
if (v.children && v.children.length) {
dataList = this.formatJson(filterVal, v.children, dataList);
}
});
return dataList;
} else if (this.infotype == "计划") {
const bizFlowStateDict = {
0: "未发审",
1: "审核中",
2: "已通过",
3: "未通过",
4: "已取消",
};
jsonData.forEach((v) => {
const row = filterVal.map((j) => {
let key = "";
if (j == "phaseStatus") {
return this.$refs.xmPhaseMng.formateOption(
"xmPhaseStatus",
v.phaseStatus
);
} else if (j == "bizFlowState") {
return `${bizFlowStateDict[parseInt(v[j]) || 0]}`;
} else {
return v[j];
}
});
dataList.push(row);
if (v.children && v.children.length) {
dataList = this.formatJson(filterVal, v.children, dataList);
}
});
return dataList;
} else if (this.infotype == "需求监控") {
jsonData.forEach((v) => {
const row = filterVal.map((j) => {
let key = "";
if (j == "planStatus") {
key = "xmMenuPlanStatus";
} else if (j == "onlineStatus") {
return parseInt(v[j]) ? "已上线" : "未上线";
} else {
return v[j];
}
const dicts = this.$refs.xmMenuWithPlan.dicts;
if (
dicts[key] == undefined ||
dicts[key] == null ||
dicts[key].length == 0
) {
return v[j];
}
var rowData = dicts[key].filter((i) => i.id == v[j]);
if (rowData.length > 0) {
return rowData[0].name;
} else {
return v[j];
}
});
dataList.push(row);
if (v.children && v.children.length) {
dataList = this.formatJson(filterVal, v.children, dataList);
}
});
return dataList;
}
},
getDateString(dateStr) {
if (dateStr == null || dateStr == "" || dateStr == undefined) {
return "";
} else {
return dateStr.substr(0, 10);
}
},
editXmProjectSomeFields(row,fieldName,$event){
var that=this;
var func=(params)=>{
editXmProjectSomeFields(params).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$emit('edit-fields',params)
Object.assign(row,params)
this.selProjectBak=Object.assign({},row)
}else{
Object.assign(this.selProject,this.selProjectBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
})
}
var params={ids:[row.id]};
params[fieldName]=$event
if(fieldName=='description'){
this.$refs.selProject.validateField('description',err=>{
if(err){
this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'})
return;
}else{
func(params)
}
})
}else if(fieldName=='name'){
this.$refs.selProject.validateField('name',err=>{
if(err){
this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'})
return;
}else{
func(params)
}
})
}else{
func(params)
}
},
goBack() {
localStorage.setItem("project-infotype", "项目概览");
this.$router.back(-1);
},
goHome(){
localStorage.setItem("project-infotype", "项目概览");
this.$router.push({path:'/'})
},
onEditFields(row){
Object.assign(this.selProject,row)
this.$emit("edit-fields",row);
},
showCurrFlow(){
this.$refs['项目概览'].showPanelName='currFlow'
},
showHisFlow(){
this.$refs['项目概览'].showPanelName='hisFlow'
},
showDetail(){
this.$refs['项目概览'].showPanelName='detail'
},
showProjectGaiSuan(){
this.$refs['项目概览'].showPanelName='detail'
this.$nextTick(()=>{
this.$refs['项目概览'].$refs['detail'].$refs['projectEdit'].currTabPane='4'
})
},
showProjectShouYi(){
this.$refs['项目概览'].showPanelName='detail'
this.$nextTick(()=>{
this.$refs['项目概览'].$refs['detail'].$refs['projectEdit'].currTabPane='5'
})
},
showMenusPage(){
this.infotype='需求'
},
linkProduct(){
this.$refs['项目概览'].showPanelName='productProjectLink'
},
createProduct(){
this.infotype='产品'
this.$nextTick(()=>{
this.$refs['xmProductComplex'].addProductVisible=true
})
}
}, //end methods
components: {
xmTaskMng,
xmGroupMng,
xmQuestion,
xmFileMng,
xmDetail,
xmProjectKpi,
xmRecord,
xmCost,
xmBudget,
xmContract,
xmEnvList,
xmMenuMng,
xmGroupSelect,
XmIterationForLinkComplex,
XmProjectOverviewComplex,
XmProductForLinkComplex,
XmReport,
XmPlan,
XmWorkloadSetDayList,
XmWorkloadSetMonthList,
//
},
mounted() {
this.$nextTick(() => {
this.maxTableHeight = this.source == 'GZT' ? this.maxTableHeight : util.calcTableMaxHeight(this.$refs.pageBody.$el);
var infotype = localStorage.getItem("project-infotype");
if (infotype) {
this.infotype = infotype;
}
});
initDicts(this)
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menus {
.el-menu-item {
padding-left: 0px !important;
}
}
/* 超过宽度则用...代替 */
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.step-btn{
margin-left:0px;margin-bottom: 5px;
}
</style>

BIN
static/images/ability-level1.png

After

Width: 800  |  Height: 800  |  Size: 31 KiB

BIN
static/images/ability-level2.png

After

Width: 800  |  Height: 800  |  Size: 24 KiB

BIN
static/images/ability-level3.png

After

Width: 800  |  Height: 800  |  Size: 25 KiB

BIN
static/images/ability-level4.png

After

Width: 800  |  Height: 800  |  Size: 30 KiB

BIN
static/images/ability-level5.png

After

Width: 800  |  Height: 800  |  Size: 31 KiB

BIN
static/images/ability-level6.png

After

Width: 800  |  Height: 800  |  Size: 32 KiB

BIN
static/images/ability-level7.png

After

Width: 800  |  Height: 800  |  Size: 29 KiB

BIN
static/images/ability-level8.png

After

Width: 800  |  Height: 800  |  Size: 32 KiB

BIN
static/images/account-cancel1.png

After

Width: 2264  |  Height: 336  |  Size: 48 KiB

BIN
static/images/account-cancel2.png

After

Width: 1842  |  Height: 896  |  Size: 188 KiB

BIN
static/images/agile-development.png

After

Width: 800  |  Height: 800  |  Size: 11 KiB

BIN
static/images/alipay.png

After

Width: 41  |  Height: 41  |  Size: 1.2 KiB

BIN
static/images/arrow.png

After

Width: 200  |  Height: 200  |  Size: 3.9 KiB

BIN
static/images/authentication1.png

After

Width: 473  |  Height: 344  |  Size: 3.2 KiB

BIN
static/images/authentication2.png

After

Width: 244  |  Height: 155  |  Size: 2.3 KiB

BIN
static/images/authentication3.png

After

Width: 244  |  Height: 155  |  Size: 1.8 KiB

BIN
static/images/authentication4.png

After

Width: 244  |  Height: 155  |  Size: 3.6 KiB

BIN
static/images/bank1.png

After

Width: 200  |  Height: 200  |  Size: 7.1 KiB

BIN
static/images/bank2.png

After

Width: 200  |  Height: 200  |  Size: 7.1 KiB

BIN
static/images/bank3.png

After

Width: 200  |  Height: 200  |  Size: 5.8 KiB

BIN
static/images/bank4.png

After

Width: 200  |  Height: 200  |  Size: 9.2 KiB

BIN
static/images/bg.png

After

Width: 1920  |  Height: 1080  |  Size: 219 KiB

BIN
static/images/bid.png

After

Width: 200  |  Height: 200  |  Size: 9.0 KiB

BIN
static/images/bind-email.png

After

Width: 271  |  Height: 206  |  Size: 11 KiB

BIN
static/images/bind-phone.png

After

Width: 264  |  Height: 224  |  Size: 7.2 KiB

BIN
static/images/card-authen.png

After

Width: 1670  |  Height: 962  |  Size: 136 KiB

BIN
static/images/card-logo.png

After

Width: 200  |  Height: 200  |  Size: 1.8 KiB

BIN
static/images/check-green.png

After

Width: 277  |  Height: 178  |  Size: 6.1 KiB

BIN
static/images/checked.png

After

Width: 200  |  Height: 200  |  Size: 5.8 KiB

BIN
static/images/checking.png

After

Width: 200  |  Height: 200  |  Size: 3.8 KiB

BIN
static/images/code1.png

After

Width: 132  |  Height: 123  |  Size: 16 KiB

BIN
static/images/code2.png

After

Width: 134  |  Height: 123  |  Size: 19 KiB

BIN
static/images/collaborative-application.png

After

Width: 800  |  Height: 800  |  Size: 9.7 KiB

BIN
static/images/collect-star.png

After

Width: 200  |  Height: 200  |  Size: 8.6 KiB

BIN
static/images/collect.png

After

Width: 200  |  Height: 200  |  Size: 5.1 KiB

BIN
static/images/collected-star.png

After

Width: 200  |  Height: 200  |  Size: 6.1 KiB

BIN
static/images/com-calculate.png

After

Width: 3200  |  Height: 2400  |  Size: 703 KiB

BIN
static/images/community-bg.png

After

Width: 1916  |  Height: 537  |  Size: 210 KiB

BIN
static/images/community-forum-bg.png

After

Width: 674  |  Height: 152  |  Size: 24 KiB

BIN
static/images/contact-to.png

After

Width: 200  |  Height: 200  |  Size: 3.4 KiB

BIN
static/images/cooperation-bg.png

After

Width: 1920  |  Height: 538  |  Size: 16 KiB

BIN
static/images/cooperation-edit.png

After

Width: 132  |  Height: 122  |  Size: 4.6 KiB

BIN
static/images/cooperation-form-bg.png

After

Width: 1015  |  Height: 208  |  Size: 16 KiB

BIN
static/images/cooperation-process1.png

After

Width: 144  |  Height: 148  |  Size: 10 KiB

BIN
static/images/cooperation-process2.png

After

Width: 144  |  Height: 148  |  Size: 11 KiB

BIN
static/images/cooperation-process3.png

After

Width: 144  |  Height: 148  |  Size: 11 KiB

BIN
static/images/cooperation-process4.png

After

Width: 144  |  Height: 148  |  Size: 11 KiB

BIN
static/images/cooperation-process5.png

After

Width: 144  |  Height: 148  |  Size: 11 KiB

BIN
static/images/cooperation-process6.png

After

Width: 144  |  Height: 148  |  Size: 12 KiB

BIN
static/images/cooperation.png

After

Width: 200  |  Height: 200  |  Size: 9.6 KiB

BIN
static/images/cp1.png

After

Width: 200  |  Height: 200  |  Size: 4.0 KiB

BIN
static/images/cp2.png

After

Width: 200  |  Height: 200  |  Size: 4.0 KiB

BIN
static/images/cp3.png

After

Width: 200  |  Height: 200  |  Size: 2.1 KiB

BIN
static/images/cp4.png

After

Width: 200  |  Height: 200  |  Size: 1.5 KiB

BIN
static/images/cp5.png

After

Width: 200  |  Height: 200  |  Size: 3.7 KiB

BIN
static/images/cp6.png

After

Width: 217  |  Height: 200  |  Size: 3.5 KiB

BIN
static/images/cp7.png

After

Width: 200  |  Height: 200  |  Size: 3.1 KiB

BIN
static/images/credit-amount.png

After

Width: 1824  |  Height: 430  |  Size: 60 KiB

BIN
static/images/credit-level1.png

After

Width: 200  |  Height: 200  |  Size: 18 KiB

BIN
static/images/credit-level2.png

After

Width: 200  |  Height: 200  |  Size: 15 KiB

BIN
static/images/credit-level3.png

After

Width: 200  |  Height: 200  |  Size: 14 KiB

BIN
static/images/credit-level4.png

After

Width: 200  |  Height: 200  |  Size: 14 KiB

BIN
static/images/credit-level5.png

After

Width: 200  |  Height: 200  |  Size: 12 KiB

BIN
static/images/credit-level6.png

After

Width: 200  |  Height: 200  |  Size: 16 KiB

BIN
static/images/credit-level7.png

After

Width: 200  |  Height: 200  |  Size: 12 KiB

BIN
static/images/customer-service.png

After

Width: 200  |  Height: 200  |  Size: 11 KiB

BIN
static/images/dashed.png

After

Width: 85  |  Height: 2  |  Size: 107 B

BIN
static/images/developer.png

After

Width: 44  |  Height: 50  |  Size: 2.5 KiB

BIN
static/images/dots.png

After

Width: 131  |  Height: 64  |  Size: 1.1 KiB

BIN
static/images/e-bg.png

After

Width: 450  |  Height: 160  |  Size: 24 KiB

BIN
static/images/effectiveness-analysis.png

After

Width: 800  |  Height: 800  |  Size: 6.3 KiB

BIN
static/images/email-authen1.png

After

Width: 2264  |  Height: 336  |  Size: 48 KiB

BIN
static/images/email-authen2.png

After

Width: 1802  |  Height: 924  |  Size: 128 KiB

BIN
static/images/employer.png

After

Width: 44  |  Height: 50  |  Size: 2.4 KiB

BIN
static/images/enterprise-authen.png

After

Width: 1668  |  Height: 558  |  Size: 95 KiB

BIN
static/images/equity.png

After

Width: 3199  |  Height: 1011  |  Size: 94 KiB

BIN
static/images/file-logo.png

After

Width: 200  |  Height: 200  |  Size: 1.8 KiB

BIN
static/images/file-s-logo.png

After

Width: 200  |  Height: 200  |  Size: 2.4 KiB

BIN
static/images/forum.png

After

Width: 500  |  Height: 400  |  Size: 7.4 KiB

BIN
static/images/good.png

After

Width: 200  |  Height: 200  |  Size: 7.3 KiB

BIN
static/images/gou.png

After

Width: 200  |  Height: 200  |  Size: 3.8 KiB

BIN
static/images/grey-bg-ava.png

After

Width: 200  |  Height: 200  |  Size: 4.7 KiB

BIN
static/images/grey-bg.png

After

Width: 1169  |  Height: 57  |  Size: 25 KiB

BIN
static/images/help-bg.png

After

Width: 1200  |  Height: 340  |  Size: 20 KiB

BIN
static/images/help2.png

After

Width: 146  |  Height: 145  |  Size: 5.3 KiB

BIN
static/images/help3.png

After

Width: 146  |  Height: 148  |  Size: 6.2 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save