Browse Source

合并dev 部分冲突

master
kim131 4 years ago
parent
commit
adbac4a581
3 changed files with 54 additions and 83 deletions
  1. +0
    -23
      src/services/user.js
  2. +15
    -11
      src/store/index.js
  3. +39
    -49
      src/views/components_web/newProj/newProj.vue

+ 0
- 23
src/services/user.js View File

@@ -6,7 +6,6 @@ import dayjs from 'dayjs';
export async function fetchAddressBook(companyId) { export async function fetchAddressBook(companyId) {


const res = await fetchApi('company/queryCompanyById', { id: companyId }); const res = await fetchApi('company/queryCompanyById', { id: companyId });
console.log('firstData',res);
const { company: unfixedCompany = {} } = res.Data || {}; const { company: unfixedCompany = {} } = res.Data || {};
const company = firstCharToLowerCase(unfixedCompany); const company = firstCharToLowerCase(unfixedCompany);
const firnode = node('company', company.id, company.companyName, company); const firnode = node('company', company.id, company.companyName, company);
@@ -20,16 +19,6 @@ export async function fetchAddressBook(companyId) {
* @param {string} parentNodeId 若为空,则表示查询根节点 * @param {string} parentNodeId 若为空,则表示查询根节点
*/ */
async function fetchNodes(parentNodeId) { async function fetchNodes(parentNodeId) {
// if (!parentNodeId) { // 查询省级
// const resData = await fetchApi('company/queryProviceTree');
// const dataList = resData.Data || [];
// return dataList.map(({ ProviceID, ProviceName, num }) => node('other', ProviceID, ProviceName, { num }));
// }
// if (!topNodeId) { // 查询省下的一级行业列表
// const resData = await fetchApi('company/queryCompanyByProviceIdAndIndustryId', { proviceId: parentNodeId });
// const dataList = resData.Data || [];
// return dataList.map(({ industry_id, name }) => node('other', industry_id, name, undefined, parentNodeId));
// }
const resData = await fetchApi('dept/queryDeptsByDeptId', { superId: parentNodeId }); const resData = await fetchApi('dept/queryDeptsByDeptId', { superId: parentNodeId });
const nodes = (resData.Data || []).map(d => { const nodes = (resData.Data || []).map(d => {
const data = firstCharToLowerCase(d); const data = firstCharToLowerCase(d);
@@ -47,18 +36,6 @@ async function fetchNodes(parentNodeId) {
} }
}) })
} }
// const companyList = data.companys || [];
// const indsList = data.industrys || [];
// let nodes = [];
//
// companyList.forEach(({ company_id, company_name }) => {
// nodes.push(node('company', company_id, company_name, undefined, topNodeId, true));
// });

// indsList.forEach(({ industry_id, name }) => {
// nodes.push(node('other', industry_id, name, undefined, topNodeId));
// });

return nodes; return nodes;
} }




+ 15
- 11
src/store/index.js View File

@@ -1,6 +1,7 @@


import { fetchApi } from '@/utils/request'; import { fetchApi } from '@/utils/request';
import { platform, PLATFORM_TYPE, AccessCode } from '@/utils/access'; import { platform, PLATFORM_TYPE, AccessCode } from '@/utils/access';
import { firstCharToLowerCase } from '@/utils/tool';


const initialState = () => ({ const initialState = () => ({
isLogin: false, isLogin: false,
@@ -10,6 +11,8 @@ const initialState = () => ({
platformList: [], platformList: [],
currentPlatform: {}, currentPlatform: {},
currentCompanyId: undefined, currentCompanyId: undefined,
avator: undefined,
userInfo: {},
}); });


const getBootstrapState = () => { const getBootstrapState = () => {
@@ -49,15 +52,17 @@ export default {
} }


this.state.isLogin = true; this.state.isLogin = true;
const { CompanyId, CnName, Id: accountId, Permission, BackgroundPermission,HeadImgUrl } = loginRes.Data || {};
console.log(loginRes);
const userData = firstCharToLowerCase(loginRes.Data || {});
// 如果以后用到这里面的数据,拍平放到同层级,不再放到userExt字段下
delete userData.userExt;
const { companyId, cnName, id: accountId, permission, backgroundPermission } = userData;
const platformList = []; const platformList = [];
const loginData = { const loginData = {
accountId, accountId,
accountName: UserName, accountName: UserName,
userName: CnName,
userName: cnName,
platformList, platformList,
HeadImgUrl
userInfo: userData,
}; };


/** /**
@@ -67,18 +72,18 @@ export default {
* 3. 企业 * 3. 企业
*/ */


const isSuperAdmin = BackgroundPermission === 3;
const isCompanyAdmin = BackgroundPermission === 2;
const isSuperAdmin = backgroundPermission === 3;
const isCompanyAdmin = backgroundPermission === 2;


// //
if (isSuperAdmin) { // todo 服务商查询企业列表并生成platformList if (isSuperAdmin) { // todo 服务商查询企业列表并生成platformList
// todo 暂时将模板控制台加入到超管账号中 // todo 暂时将模板控制台加入到超管账号中
platformList.push( platformList.push(
platform(PLATFORM_TYPE.MANAGE_CENTER, CompanyId, 'LOCKING 总后台', undefined, []),
platform(PLATFORM_TYPE.MANAGE_CENTER, companyId, 'LOCKING 总后台', undefined, []),
// platform(PLATFORM_TYPE.TEMPLATE_CONSOLE, CompanyId, undefined, false, '模版控制台'), // platform(PLATFORM_TYPE.TEMPLATE_CONSOLE, CompanyId, undefined, false, '模版控制台'),
); );
} else { // 企业生成自己的企业平台权限 } else { // 企业生成自己的企业平台权限
const companyInfoRes = await fetchApi('company/queryFrontDeskCompanyById', { id: CompanyId });
const companyInfoRes = await fetchApi('company/queryFrontDeskCompanyById', { id: companyId });
if (companyInfoRes.Code !== 0) { if (companyInfoRes.Code !== 0) {
return companyInfoRes; return companyInfoRes;
} }
@@ -86,8 +91,8 @@ export default {
const { company: { LogoUrl, CompanyName } } = Data; const { company: { LogoUrl, CompanyName } } = Data;
const accessList = []; const accessList = [];
if (isCompanyAdmin) { accessList.push(AccessCode.CompanyConsole); } if (isCompanyAdmin) { accessList.push(AccessCode.CompanyConsole); }
if (Permission === 1) { accessList.push(AccessCode.ProjectManager); }
platformList.push(platform(PLATFORM_TYPE.COMPANY, CompanyId, CompanyName, LogoUrl, accessList));
if (permission === 1) { accessList.push(AccessCode.ProjectManager); }
platformList.push(platform(PLATFORM_TYPE.COMPANY, companyId, CompanyName, LogoUrl, accessList));
} }


// 存储 // 存储
@@ -100,7 +105,6 @@ export default {
Code: loginRes.Code, Code: loginRes.Code,
Data: loginData, Data: loginData,
} }

}, },
logout() { logout() {
this.state = initialState(); this.state = initialState();


+ 39
- 49
src/views/components_web/newProj/newProj.vue View File

@@ -161,10 +161,10 @@
<div class="fl firstPeople"> <div class="fl firstPeople">
<!-- 默认添加 --> <!-- 默认添加 -->
<div > <div >
<div class="avtarface" :title="currUser.userName">
<img src="" v-lazy="headSrc+currUser.HeadImgUrl"/>
<div class="avtarface" :title="currUser.cnName">
<img :src="currUser.headImgUrl | resolveAvator"/>
</div> </div>
<span class="Text_tiny tinyText_wirte">{{currUser.userName}}</span>
<span class="Text_tiny tinyText_wirte">{{currUser.cnName}}</span>
</div> </div>
</div> </div>
<!-- 竖线 --> <!-- 竖线 -->
@@ -179,7 +179,7 @@
<li v-for="(user,index) in newProjData.projectData.listProjManager" :key="index"> <li v-for="(user,index) in newProjData.projectData.listProjManager" :key="index">
<div v-if="index < 14 || showAll "> <div v-if="index < 14 || showAll ">
<div class="avtarface" :title="user.userName"> <div class="avtarface" :title="user.userName">
<img src="" v-lazy="headSrc+user.headImgUrl" />
<img :src="user.headImgUrl | resolveAvator" />
</div> </div>
<span class="Text_tiny tinyText_wirte">{{user.cnName}}</span> <span class="Text_tiny tinyText_wirte">{{user.cnName}}</span>
</div> </div>
@@ -222,7 +222,7 @@
<li v-for="(user,index) in folder.manageUser" :key="index"> <li v-for="(user,index) in folder.manageUser" :key="index">
<div> <div>
<div class="avtarface" title="编辑"> <div class="avtarface" title="编辑">
<img src="" v-lazy="headSrc+user.headImgUrl" />
<img :src="user.headImgUrl | resolveAvator" />
<div class="eiditIconimgBox" @click="addUserPal(folderIndex)"> <div class="eiditIconimgBox" @click="addUserPal(folderIndex)">
<i class="icon font_family icon-icon_bianji1 eiditIconimg"></i> <i class="icon font_family icon-icon_bianji1 eiditIconimg"></i>
</div> </div>
@@ -242,7 +242,7 @@
<li v-for="(user,index) in listUserComputed(folder.listUser)" :key="index"> <li v-for="(user,index) in listUserComputed(folder.listUser)" :key="index">
<div v-if="index < 14 || showAll "> <div v-if="index < 14 || showAll ">
<div class="avtarface" :title="user.cnName"> <div class="avtarface" :title="user.cnName">
<img src="" v-lazy="headSrc+user.headImgUrl" />
<img :src="user.headImgUrl | resolveAvator" />
</div> </div>
<span class="Text_tiny tinyText_wirte">{{user.cnName}}</span> <span class="Text_tiny tinyText_wirte">{{user.cnName}}</span>
</div> </div>
@@ -283,7 +283,7 @@
<div class="touxiang_hezuorenBox fl"> <div class="touxiang_hezuorenBox fl">
<div class="yonghutouxiangBox" v-for="(user,checkIndex) in folder.listUser" :key="checkIndex"> <div class="yonghutouxiangBox" v-for="(user,checkIndex) in folder.listUser" :key="checkIndex">
<div class="touxiang_hezuorenBox-item"> <div class="touxiang_hezuorenBox-item">
<img v-lazy="headSrc+user.headImgUrl" class="imgHead">
<img :src="user.headImgUrl | resolveAvator" class="imgHead">
<i class="icon_delete el-icon-delete" title="删除" @click="deleteNewProjUser(index,checkIndex)"></i> <i class="icon_delete el-icon-delete" title="删除" @click="deleteNewProjUser(index,checkIndex)"></i>
</div> </div>
<span>{{user.cnName}}</span> <span>{{user.cnName}}</span>
@@ -334,7 +334,7 @@
<el-checkbox class="checkBoxCol" v-model="user.selected" @change="handleCheckedOnlyOne(group_index,user,$event)" <el-checkbox class="checkBoxCol" v-model="user.selected" @change="handleCheckedOnlyOne(group_index,user,$event)"
:disabled="disabled"> :disabled="disabled">
<div class="checkboxlabelitem"> <div class="checkboxlabelitem">
<img v-lazy="headSrc+user.headImgUrl" alt="" class="user_info_faceImg">
<img :src="user.headImgUrl | resolveAvator" alt="" class="user_info_faceImg">
<span class="user_info_name">{{user.cnName}}</span> <span class="user_info_name">{{user.cnName}}</span>
<el-popover placement="bottom-start" width="180" trigger="hover"> <el-popover placement="bottom-start" width="180" trigger="hover">
<ul class="popover_ul popover_ul"> <ul class="popover_ul popover_ul">
@@ -376,7 +376,7 @@
<div class="user_info_item mainpeople_H" v-for="(user,index) in (selectedUser)" <div class="user_info_item mainpeople_H" v-for="(user,index) in (selectedUser)"
:key="index"> :key="index">
<i class="icon font_family icon-icon_huangguan-jihuo middlehuangguan fl" title="负责人"></i> <i class="icon font_family icon-icon_huangguan-jihuo middlehuangguan fl" title="负责人"></i>
<img v-lazy="headSrc+user.headImgUrl" alt="" class="user_info_faceImg">
<img :src="user.headImgUrl | resolveAvator" alt="" class="user_info_faceImg">
<span class="user_info_name">{{user.cnName}}</span> <span class="user_info_name">{{user.cnName}}</span>
<el-popover placement="bottom-start" width="180" trigger="hover"> <el-popover placement="bottom-start" width="180" trigger="hover">
<ul class="popover_ul popover_ul"> <ul class="popover_ul popover_ul">
@@ -405,7 +405,7 @@
</div> </div>
<div class="renyuanbox" v-for="(user,index) in listUserComputed(selectedUser)" :key="index"> <div class="renyuanbox" v-for="(user,index) in listUserComputed(selectedUser)" :key="index">
<div class="user_info_item" v-if="user.deptID ==dept.deptID"> <div class="user_info_item" v-if="user.deptID ==dept.deptID">
<img v-lazy="headSrc+user.headImgUrl" alt="" class="user_info_faceImg">
<img :src="user.headImgUrl | resolveAvator" alt="" class="user_info_faceImg">
<span class="user_info_name">{{user.cnName}}</span> <span class="user_info_name">{{user.cnName}}</span>
<el-popover placement="bottom-start" width="180" trigger="hover"> <el-popover placement="bottom-start" width="180" trigger="hover">
<ul class="popover_ul popover_ul"> <ul class="popover_ul popover_ul">
@@ -468,7 +468,7 @@
<el-checkbox class="checkBoxCol" v-model="user.disabled" @change="handleCheckedOne(group_index,user,$event)" <el-checkbox class="checkBoxCol" v-model="user.disabled" @change="handleCheckedOne(group_index,user,$event)"
:disabled="disabled"> :disabled="disabled">
<div class="checkboxlabelitem"> <div class="checkboxlabelitem">
<img v-lazy="headSrc+user.headImgUrl" alt="" class="user_info_faceImg">
<img :src="user.headImgUrl | resolveAvator" alt="" class="user_info_faceImg">
<span class="user_info_name">{{user.userName}}</span> <span class="user_info_name">{{user.userName}}</span>
<el-popover placement="bottom-start" width="180" trigger="hover"> <el-popover placement="bottom-start" width="180" trigger="hover">
<ul class="popover_ul popover_ul"> <ul class="popover_ul popover_ul">
@@ -509,7 +509,7 @@
<div class="user_info_item mainpeople_H" v-for="(user,index) in (selectedUser)" <div class="user_info_item mainpeople_H" v-for="(user,index) in (selectedUser)"
:key="index"> :key="index">
<i class="icon font_family icon-icon_huangguan-jihuo middlehuangguan fl" title="负责人"></i> <i class="icon font_family icon-icon_huangguan-jihuo middlehuangguan fl" title="负责人"></i>
<img v-lazy="headSrc+user.headImgUrl" alt="" class="user_info_faceImg">
<img :src="user.headImgUrl | resolveAvator" alt="" class="user_info_faceImg">
<span class="user_info_name">{{user.cnName}}</span> <span class="user_info_name">{{user.cnName}}</span>
<el-popover placement="bottom-start" width="180" trigger="hover"> <el-popover placement="bottom-start" width="180" trigger="hover">
<ul class="popover_ul popover_ul"> <ul class="popover_ul popover_ul">
@@ -537,7 +537,7 @@
<div class="renyuanbox" v-for="(user,index) in selectedUser" :key="index"> <div class="renyuanbox" v-for="(user,index) in selectedUser" :key="index">
<div class="user_info_item" v-if="user.deptId == dept.id"> <div class="user_info_item" v-if="user.deptId == dept.id">
<!-- <i class="huangguan" @click="setManageUser(user)" title="设置负责人"></i> --> <!-- <i class="huangguan" @click="setManageUser(user)" title="设置负责人"></i> -->
<img v-lazy="headSrc+user.headImgUrl" alt="" class="user_info_faceImg">
<img :src="user.headImgUrl | resolveAvator" alt="" class="user_info_faceImg">
<span class="user_info_name">{{user.userName}}</span> <span class="user_info_name">{{user.userName}}</span>
<el-popover placement="bottom-start" width="180" trigger="hover"> <el-popover placement="bottom-start" width="180" trigger="hover">
<ul class="popover_ul popover_ul"> <ul class="popover_ul popover_ul">
@@ -599,6 +599,7 @@
}, },
data() { data() {
const currentUser = this.$store.state.userInfo;
return { return {
imgSrc: process.env.API_HOST + 'archives/cover?path=', imgSrc: process.env.API_HOST + 'archives/cover?path=',
headSrc: process.env.API_HOST + 'archives/head?path=', headSrc: process.env.API_HOST + 'archives/head?path=',
@@ -675,7 +676,7 @@
ischeckAll: false, //是否是全部选中 ischeckAll: false, //是否是全部选中
newProjFolderIndex: 1, newProjFolderIndex: 1,
// projectCreaterName: sessionStorage.cnName, // projectCreaterName: sessionStorage.cnName,
projectCreaterName: JSON.parse(sessionStorage.user).userName,
projectCreaterName: currentUser.cnName,
createDate: new Date().toLocaleDateString(), createDate: new Date().toLocaleDateString(),
listNewFolder: [], listNewFolder: [],
listMyPermFolders: [], //获取项目文件夹 listMyPermFolders: [], //获取项目文件夹
@@ -693,7 +694,7 @@
nowFolderIndex: '', //当前分配工作文件夹index nowFolderIndex: '', //当前分配工作文件夹index
tempIndex: 0, tempIndex: 0,
currSelectData: [], currSelectData: [],
currUser:JSON.parse(sessionStorage.user),
currUser:currentUser,
isShowManager:true, isShowManager:true,
/* */ /* */
@@ -1269,7 +1270,6 @@
*/ */
checkDeptUserName: function(checked, item) { checkDeptUserName: function(checked, item) {
item['selected'] = checked; item['selected'] = checked;
debugger;
if (checked) { if (checked) {
item.folderPerm = 1; // 默认角色为:查看和编辑 item.folderPerm = 1; // 默认角色为:查看和编辑
var valueUser = JSON.parse(JSON.stringify(item)); var valueUser = JSON.parse(JSON.stringify(item));
@@ -1301,39 +1301,29 @@
/** /**
* 获取模板列表子节点数据 * 获取模板列表子节点数据
*/ */
getSelectTemplateList: function(templateID) {
var thisApp = this;
this.$axios({
method: 'get',
url: encodeURI(process.env.API_HOST + "templates/nodes/" + templateID + "/" + templateID),
})
.then(response => {
thisApp.SelectTemplateNodeList = response.data;
thisApp.newProjData.listFolder = [];
for (var i = 0; i < thisApp.SelectTemplateNodeList.length; i++) {
var folder = {
"folderID": "",
"projID": "",
"superID": "",
"levelID": "",
"firstFolderID": "",
"tempNodeID": thisApp.SelectTemplateNodeList[i].nodeID,
"folderName": thisApp.SelectTemplateNodeList[i].nodeName,
"fileCount": 0,
"childCount": 0,
"modifyUserID": "",
"deleted": 0,
"default": true,
"listUser": [],
"manageUser": []
};
thisApp.newProjData.listFolder.push(folder);
}
})
.catch(error => {
console.log(error);
});
async getSelectTemplateList(templateID) {
const { Data } = await templateService.queryTemplateNodeByTemplateId(templateID);
const headNodes = (Data.children || []);
this.newProjData.listFolder = [];
headNodes.forEach(node => {
const folder = {
folderID: "",
projID: "",
superID: "",
levelID: "",
firstFolderID: "",
tempNodeID: node.id,
folderName: node.topic,
fileCount: 0,
childCount: 0,
modifyUserID: "",
deleted: 0,
default: true,
listUser: [],
manageUser: []
};
this.newProjData.listFolder.push(folder);
});
}, },
/** /**
* 设置系统封面 * 设置系统封面


Loading…
Cancel
Save