diff --git a/dist/static/css/main.css b/dist/static/css/main.css index 20f9afe6..915d0507 100644 --- a/dist/static/css/main.css +++ b/dist/static/css/main.css @@ -3657,6 +3657,16 @@ button:focus { bottom: 4px; left: 10px; } +.listUpdateBtn.editCoverBtn{ + width: 40px; + height: 20px; + border-radius: 4px !important; + border: 0.5px solid rgba(227, 227, 227, 1); + line-height: 20px; + bottom: 10px; + font-size: 12px; + background-color: #fff; +} .listUpdateBtn .webuploader-pick{ width: 80px; height: 20px; diff --git a/package.json b/package.json index 9a01af9f..2a71a6fe 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "lodash": "^4.17.20", "sass": "^1.26.11", "sass-loader": "^10.0.2", + "socket.io-client": "^2.3.1", "vue": "^2.6.11", "vue-lazyload": "^1.3.3", "vue-router": "^3.4.5", diff --git a/src/services/system.js b/src/services/system.js index 358c4da7..3a2ad030 100644 --- a/src/services/system.js +++ b/src/services/system.js @@ -2,18 +2,26 @@ * 模拟客户端back server * 目前还不知道back的API及具体实现,暂时先抑制代码报错 */ +import io from 'socket.io-client'; export const isClient = process.env.IS_CLIENT; +let socket; const noop = () => {}; const safeCall = f => isClient ? f : noop; +const safeSocket = f => (...args) => socket && f(...args); const system = { isClient, test: safeCall(() => { console.log('客户端 electron API 检测:', global.electron); + system.initalSocket(); }), + initalSocket: () => { + socket = io('http://10.240.32.243:3000'); + socket.on('connect', () => { console.log('本地socket服务连接成功') }); + }, /** * 系统打开只当文件 */ @@ -21,6 +29,7 @@ const system = { const { shell } = global.electron; shell.openPath(filePath); }), + // todo } diff --git a/src/services/user.js b/src/services/user.js index 06a71ff5..1f3a5205 100644 --- a/src/services/user.js +++ b/src/services/user.js @@ -6,7 +6,6 @@ import dayjs from 'dayjs'; export async function fetchAddressBook(companyId) { const res = await fetchApi('company/queryCompanyById', { id: companyId }); - console.log('firstData',res); const { company: unfixedCompany = {} } = res.Data || {}; const company = firstCharToLowerCase(unfixedCompany); const firnode = node('company', company.id, company.companyName, company); @@ -20,16 +19,6 @@ export async function fetchAddressBook(companyId) { * @param {string} 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 nodes = (resData.Data || []).map(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; } diff --git a/src/store/index.js b/src/store/index.js index 7ab15e20..4bae50de 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,6 +1,7 @@ import { fetchApi } from '@/utils/request'; import { platform, PLATFORM_TYPE, AccessCode } from '@/utils/access'; +import { firstCharToLowerCase } from '@/utils/tool'; const initialState = () => ({ isLogin: false, @@ -10,6 +11,8 @@ const initialState = () => ({ platformList: [], currentPlatform: {}, currentCompanyId: undefined, + avator: undefined, + userInfo: {}, }); const getBootstrapState = () => { @@ -49,15 +52,17 @@ export default { } 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 loginData = { accountId, accountName: UserName, - userName: CnName, + userName: cnName, platformList, - HeadImgUrl + userInfo: userData, }; /** @@ -67,18 +72,18 @@ export default { * 3. 企业 */ - const isSuperAdmin = BackgroundPermission === 3; - const isCompanyAdmin = BackgroundPermission === 2; + const isSuperAdmin = backgroundPermission === 3; + const isCompanyAdmin = backgroundPermission === 2; // if (isSuperAdmin) { // todo 服务商查询企业列表并生成platformList // todo 暂时将模板控制台加入到超管账号中 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, '模版控制台'), ); } else { // 企业生成自己的企业平台权限 - const companyInfoRes = await fetchApi('company/queryFrontDeskCompanyById', { id: CompanyId }); + const companyInfoRes = await fetchApi('company/queryFrontDeskCompanyById', { id: companyId }); if (companyInfoRes.Code !== 0) { return companyInfoRes; } @@ -86,8 +91,8 @@ export default { const { company: { LogoUrl, CompanyName } } = Data; const accessList = []; 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, Data: loginData, } - }, logout() { this.state = initialState(); diff --git a/src/utils/request.js b/src/utils/request.js index b62bd874..3ab9f3ea 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -88,7 +88,7 @@ export default axios; function mapApiPathToFullPath(path) { const [service] = path.split('/'); - const fullpath = `api/${(service === 'template' || service ==='project') ? 'pms' : 'cms'}/${service === 'authentication' ? '' : 'v1/'}${path}`; + const fullpath = `api/${(service === 'template' || service === 'project') ? 'pms' : 'cms'}/${service === 'authentication' ? '' : 'v1/'}${path}`; let method = 'GET'; switch (path) { @@ -110,6 +110,7 @@ function mapApiPathToFullPath(path) { case 'template/createNestedRelevance': case 'template/deleteNestedRelevance': case 'project/EditProject': + case 'project/CreateProject': // case 'template/deleteTemplateNodeModelFile': method = 'POST'; break; diff --git a/src/views/components_web/newProj/newProj.vue b/src/views/components_web/newProj/newProj.vue index 86af934f..f9faefb5 100644 --- a/src/views/components_web/newProj/newProj.vue +++ b/src/views/components_web/newProj/newProj.vue @@ -31,11 +31,11 @@
下一步 - 下一步 - 创建项目 +
@@ -94,18 +94,21 @@ -
+ +
- - + +
+
+
-
- +
+
- {{currUser.userName}} + {{currUser.cnName}}
@@ -166,9 +169,9 @@
  • - +
    - {{user.userName}} + {{user.cnName}}
  • @@ -209,7 +212,7 @@
  • - +
    @@ -229,7 +232,7 @@
  • - +
    {{user.cnName}}
    @@ -270,7 +273,7 @@
    - +
    {{user.cnName}} @@ -314,12 +317,14 @@ --> {{dept.deptName}} -