Commit 6e0be362 by zhongqm

update:迁移最新模块完成

parent 73bca1d7
......@@ -12,7 +12,7 @@ var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')
spinner.start()
console.log('环境>>',process.env.PACK_ENV);
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
......
......@@ -4,8 +4,8 @@
<meta charset='utf-8'>
<meta name='viewport' content='initial-scale=1.0, maximum-scale=1.0, user-scalable=0'>
<title>简历</title>
<script src='miniapp://common/js/qing/qing.js'></script>
<!-- <script src="https://staging.jffctest.com/public/js/qing/latest/qing.js"></script>-->
<!-- <script src='miniapp://common/js/qing/qing.js'></script>-->
<script src='https://staging.jffctest.com/public/js/qing/latest/qing.js'></script>
</head>
<body>
<div class='header'>
......
This diff could not be displayed because it is too large.
......@@ -22,55 +22,55 @@
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"babel-plugin-istanbul": "^4.1.1",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chai": "^3.5.0",
"chalk": "^1.1.3",
"compression-webpack-plugin": "^0.4.0",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^4.0.0",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"eslint": "^3.19.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^3.0.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"mocha": "^3.2.0",
"chai": "^3.5.0",
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"inject-loader": "^3.0.0",
"babel-plugin-istanbul": "^4.1.1",
"cross-spawn": "^5.0.1",
"json-loader": "^0.5.4",
"less": "^2.7.2",
"less-loader": "^4.0.4",
"loader-utils": "^1.1.0",
"mocha": "^3.2.0",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
"style-loader": "^0.17.0",
"svg-url-loader": "^2.2.0",
"touch": "^1.0.0",
"url-loader": "^0.5.8",
"yaml-loader": "^0.4.0",
"css-loader": "^0.28.0",
"file-loader": "^0.11.1",
"json-loader": "^0.5.4",
"less-loader": "^4.0.4",
"loader-utils": "^1.1.0",
"webpack": "^2.3.3",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0",
"zip-webpack-plugin": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"compression-webpack-plugin": "^0.4.0",
"copy-webpack-plugin": "^4.0.1",
"extract-text-webpack-plugin": "^2.0.0",
"friendly-errors-webpack-plugin": "^1.1.3",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"connect-history-api-fallback": "^1.3.0",
"http-proxy-middleware": "^0.17.3",
"svg-url-loader": "^2.2.0"
"yaml-loader": "^0.4.0",
"zip-webpack-plugin": "^1.1.0"
},
"engines": {
"node": ">= 6.0.0",
......
import common from './common';
const isProduct = process.env.PACK_ENV === 'prod'
const isProduct = process.env.PACK_ENV === 'product'
const config = {
product: true,
ssoToken: 'token',
......
......@@ -62,7 +62,7 @@ const config = {
loginuserid: '46000011',
appKey: 'd504275e',
uid: 'hqhuang@cndrealty.com',
token,
token:'yzj_6082c32a80f913acd16a0e8e9364914d',
baseUrl: 'https://mxytest.cndrealty.com:4433/',
};
......
......@@ -7,6 +7,8 @@ import IScroll from 'iscroll/build/iscroll-probe';
import createWatermark from './lib/wmSVG';
import { setWaterMark } from './lib/wmCanvas';
console.log('开始>>', qing);
const PhotoSwipe = require('./lib/photoswipe.min').PhotoSwipe;
const PhotoSwipeUI_Default = require('./lib/photoswipe-ui-default.min')
.PhotoSwipeUI_Default;
......@@ -22,6 +24,7 @@ window.topHeight = 115;
let _uid = '';
let userid = '';
let loginuserid = '';//登入用户工号
let token = '';
let appKey = '';
let photoUrl = '';
......@@ -52,14 +55,14 @@ const tipsModal = document.querySelector('.tips__modal');
const tipsmMdalClose = document.querySelector('.tips__close');
app.ready(() => {
// new Vconsole(); // 注册Vconsole
initUser().then(() => {
$mas.token = token;
mount();
}).catch((e) => {
console.log('-开发环境>>');
if (!configuration.product) {
_uid = configuration.uid;
loginuserid = configuration.loginuserid;
userid = configuration.userid;
token = configuration.token;
appKey = configuration.appKey;
......@@ -70,7 +73,7 @@ app.ready(() => {
$mas.token = token;
mount();
//todo 开发环境调试添加水印
setWaterMark(`黄华强hqhuang@cndrealty.com`,'')
setWaterMark(`黄华强hqhuang@cndrealty.com`, '');
// createWatermark({ content: '黄华强hqhuang@cndrealty.com' });
});
// 取消延迟响应
......@@ -154,6 +157,7 @@ function initUser() {
uid: viewee.uid,
extra: '{"orgType": 1}'
};
loginuserid = user.employeenumber;
userid = isFromPersonDetail ? extra.employeenumber : user.employeenumber;
_uid = isFromPersonDetail ? extra.uid : user.uid;
photoUrl = isFromPersonDetail ? extra.avatar : user.avatar;
......@@ -220,6 +224,7 @@ function initUser() {
console.log('e:', e.toString());
if (!configuration.product) {
_uid = configuration.uid;
loginuserid = configuration.loginuserid;
userid = configuration.userid;
token = configuration.token;
appKey = configuration.appKey;
......@@ -279,6 +284,7 @@ function mount() {
tipsModal.style.display = 'none';
};
$mas.restful(url, {
loginuserid,
userid,
appKey
})
......@@ -292,7 +298,7 @@ function mount() {
.catch(e => {
});
// 获取头像
renderPhoto()
renderPhoto();
/*
$mas.getData(configuration.baseUrl + configuration.methods.photo, {
uid: _uid,
......@@ -474,9 +480,9 @@ function render(data) {
default:
showToast(`#jobGradeType = ${jobGradeType}; 不明人员`);
}
addFileEvent()//干部测评附件
addAssFileEvent()//绩效附件
eleHideChil()
addFileEvent();//干部测评附件
addAssFileEvent();//绩效附件
eleHideChil();
eleHide();
// eleHideShrink()
}
......@@ -485,7 +491,7 @@ function renderer(renderTemp, data) {
let type = renderTemp.type;
// 干部测评没有数据不展示
if (type === RENDER_TYPE.G && (!data || !data.length)) {
return
return;
}
container.appendChild(headerRenderer(renderTemp));
switch (type) {
......@@ -549,7 +555,7 @@ function propertyRenderer(renderTemp, data) {
let type = renderTemp.type;
// 干部测评没有数据不展示
if (type === RENDER_TYPE.G && (!data || !data.length)) {
return
return;
}
container.appendChild(propertyHeaderRenderer(renderTemp));
......@@ -2045,7 +2051,6 @@ function listenerChange(target, clickNode, i) {
}
function isImage(ext) {
return [
'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].indexOf(ext.toLowerCase()) !== -1;
......@@ -2055,30 +2060,30 @@ function isImage(ext) {
function renderFileIcon(fileName) {
//获取最后一个.的位置
const index = fileName.lastIndexOf(".");
console.log('. index>>', index)
const index = fileName.lastIndexOf('.');
console.log('. index>>', index);
//获取后缀
const ext = fileName.substr(index + 1);
console.log('附件后缀>>', ext);
if (ext.includes('pdf')) {
return `<img class="file-icon" src="${require('@/assets/images/pdf.png')}" alt=""/>`
return `<img class='file-icon' src='${require('@/assets/images/pdf.png')}' alt=''/>`;
} else if (ext.includes('xls')) {
return `<img class="file-icon" src="${require('@/assets/images/excel.png')}" alt=""/>`
return `<img class='file-icon' src='${require('@/assets/images/excel.png')}' alt=''/>`;
} else if (ext.includes('doc')) {
return `<img class="file-icon" src="${require('@/assets/images/word.png')}" alt=""/>`
return `<img class='file-icon' src='${require('@/assets/images/word.png')}' alt=''/>`;
} else if (isImage(ext)) {
return `<img class="file-icon" src="${require('@/assets/images/img.png')}" alt=""/>`
return `<img class='file-icon' src='${require('@/assets/images/img.png')}' alt=''/>`;
} else {
return `<img class="file-icon" src="${require('@/assets/images/attachment.png')}" alt=""/>`
return `<img class='file-icon' src='${require('@/assets/images/attachment.png')}' alt=''/>`;
}
}
//渲染文件名称
function renderFileName(attachmentName) {
const index = attachmentName.lastIndexOf(".");
console.log('attachmentFile.substring(0,index)>>', index, attachmentName, attachmentName.substring(0, index))
return index !== -1 ? attachmentName.substring(0, index) : attachmentName
const index = attachmentName.lastIndexOf('.');
console.log('attachmentFile.substring(0,index)>>', index, attachmentName, attachmentName.substring(0, index));
return index !== -1 ? attachmentName.substring(0, index) : attachmentName;
}
......@@ -2087,42 +2092,42 @@ function renderFileName(attachmentName) {
function listGRenderer(list, data) {
let temp = ``;
if (data && data.length) {
let cadreFile = []
let cadreFile = [];
data.forEach((item, index) => {
let note = list.note;
let chil = list.chilkey
let children = item[list.children]
let chil = list.chilkey;
let children = item[list.children];
if (chil instanceof Array && children) {
let childrenHtml = ``
let childrenHtml = ``;
let sortChildren = children.sort((a, b) => {
return a[list.chilkey[0]].localeCompare(b[list.chilkey[0]])
})
console.log('gbkh-sortChildren>>', sortChildren)
return a[list.chilkey[0]].localeCompare(b[list.chilkey[0]]);
});
console.log('gbkh-sortChildren>>', sortChildren);
sortChildren.forEach((items) => {
childrenHtml += itemRenderer(
`<span class="file_link"> ${renderFileIcon(items[list.chilkey[1]])} ${renderFileName(items[list.chilkey[0]])}</span>`,
`<span class='file_link'> ${renderFileIcon(items[list.chilkey[1]])} ${renderFileName(items[list.chilkey[0]])}</span>`,
// `<a class="a_link" > ${renderFileIcon(items[list.chilkey[1]])} ${renderFileName(items[list.chilkey[0]])}</a>`,
'',
'children_content'
);
cadreFile.push(items[list.chilkey[1]])
})
cadreFile.push(items[list.chilkey[1]]);
});
temp += itemRenderer(
`${item[list.title]}年`,
`<span class="item__content-note t-black ">${item[note] || ''}</span>`,
`<span class='item__content-note t-black '>${item[note] || ''}</span>`,
`${childrenHtml ? 'has-children text-left' : 'text-left'}`
);
if (childrenHtml) {
temp += `<div class="children_box">${childrenHtml}</div>`
temp += `<div class='children_box'>${childrenHtml}</div>`;
}
} else {
temp += itemRenderer(
`${item[list.title]}年`,
`<span class="item__content-note t-black">${item[note]}</span>`
`<span class='item__content-note t-black'>${item[note]}</span>`
);
}
});
cadreFileList = cadreFile
cadreFileList = cadreFile;
} else {
temp = noDataRenderer();
......@@ -2132,20 +2137,20 @@ function listGRenderer(list, data) {
}
function addFileEvent() {
console.log('xxx')
console.log('xxx');
let file_note = document.getElementsByClassName('file_link');
// console.log('assFileList>>', assFileList)
for (let i = 0; i < file_note.length; i++) {
registerEvent(file_note[i], cadreFileList[i])
registerEvent(file_note[i], cadreFileList[i]);
}
}
function addAssFileEvent() {
console.log('--------------------------')
console.log('--------------------------');
let file_note = document.getElementsByClassName('ass_file_link');
console.log('assFileList>>', assFileList)
console.log('assFileList>>', assFileList);
for (let i = 0; i < file_note.length; i++) {
registerEvent(file_note[i], assFileList[i])
registerEvent(file_note[i], assFileList[i]);
}
}
......@@ -2155,30 +2160,30 @@ function registerEvent(clickNode, data) {
clickNode.addEventListener('click', () => {
// console.log('registerEvent--data>>', data)
const fileName = data.split('?')[1] || ''
const index = fileName.lastIndexOf(".");
console.log('. index>>', index)
const fileName = data.split('?')[1] || '';
const index = fileName.lastIndexOf('.');
console.log('. index>>', index);
//获取后缀
const fileType = fileName.substr(index + 1);
console.log('fileType>>', fileType)
console.log('orgType>>', orgType)
let apiCode = 'hr.resume.attachmentInfoV'
console.log('fileType>>', fileType);
console.log('orgType>>', orgType);
let apiCode = 'hr.resume.attachmentInfoV';
switch (orgType) {
case 1:
// 房开
apiCode = 'hr.resume.attachmentInfoV'
apiCode = 'hr.resume.attachmentInfoV';
break;
case 6:
// 物业
apiCode = 'wyhr.resume.attachmentInfoV'
apiCode = 'wyhr.resume.attachmentInfoV';
break;
case 7:
// 合诚
apiCode = 'hchr.resume.attachmentInfoV'
apiCode = 'hchr.resume.attachmentInfoV';
break;
}
const url = `${configuration.baseUrl}mas-api/proxy?alias=${apiCode}&${fileName}&tocken=${$mas.token}`
console.log('url>>', url)
const url = `${configuration.baseUrl}mas-api/proxy?alias=${apiCode}&${fileName}&tocken=${$mas.token}`;
console.log('url>>', url);
// if (fileType === 'pdf') {
// app.showPdf([{url}])
// } else {
......@@ -2187,16 +2192,16 @@ function registerEvent(clickNode, data) {
if (fileType === 'pdf') {
app.showPdf([{url}])
app.showPdf([{ url }]);
} else if (fileType.includes('xls') || fileType.includes('doc')) {
console.log('run>>>> xls,doc')
console.log('run>>>> xls,doc');
// app.openUrl(`https://view.officeapps.live.com/op/view.aspx?src=${url}`)
window.location.href = url
window.location.href = url;
} else if (fileType === 'txt') {
app.showTxt([{url}])
app.showTxt([{ url }]);
} else {
console.log('run>>> else-----')
app.openUrl(url)
console.log('run>>> else-----');
app.openUrl(url);
}
});
......@@ -2210,7 +2215,7 @@ function listDRenderer(list, data) {
// console.log('月度渲染>>', { list, data })
let temp = ``;
if (data && data.length) {
assFileList = []
assFileList = [];
data.forEach((item, index) => {
let sub = '';
let note = list.note;
......@@ -2244,39 +2249,39 @@ function listDRenderer(list, data) {
temp += itemRenderer(
`${item[list.title]}年`,
`<span class="item__content-note t-black">${item[note]} </span>`,
`<span class='item__content-note t-black'>${item[note]} </span>`,
`${(item.months && item.months.length) || (item.attachmentArray && item.attachmentArray.length) ? 'has-children text-left' : 'text-left'}`
);
if ((item.months && item.months.length) || (item.attachmentArray && item.attachmentArray.length)) {
temp += '<div class="children_box">'
temp += '<div class="children_box">';
if (item.attachmentArray && item.attachmentArray.length) {
let sortChildren = item.attachmentArray.sort((a, b) => {
return a.attachmentName.localeCompare(b.attachmentName)
})
console.log('jx-sortChildren>>>', sortChildren)
return a.attachmentName.localeCompare(b.attachmentName);
});
console.log('jx-sortChildren>>>', sortChildren);
sortChildren.forEach((items) => {
temp += itemRenderer(
`<span class="ass_file_link" data-url="${items.attachmentFile}">${renderFileIcon(items.attachmentFile)}${renderFileName(items.attachmentName)}</span>`,
`<span class='ass_file_link' data-url='${items.attachmentFile}'>${renderFileIcon(items.attachmentFile)}${renderFileName(items.attachmentName)}</span>`,
'',
'children_content'
);
assFileList.push(items.attachmentFile)
})
assFileList.push(items.attachmentFile);
});
}
if (item.months && item.months.length) {
item.months.forEach((itemM, indexM) => {
temp += itemRenderer(
`<span class="child_row_title_dot">·</span><span>${itemM.month}</span>`,
`<span class="item__content-note">${itemM.assgrade}</span>`,
`<span class='child_row_title_dot'>·</span><span>${itemM.month}</span>`,
`<span class='item__content-note'>${itemM.assgrade}</span>`,
'text-left'
);
})
});
}
temp += '</div>'
temp += '</div>';
}
});
} else {
......@@ -2665,11 +2670,11 @@ function filter(item, data) {
break;
}
}
let templist = []
let sumList = []
let templist = [];
let sumList = [];
for (let i = 0; i < data.length; i++) {
const index = templist.indexOf(data[i].assyear)
let _assyear = data[i].asstype
const index = templist.indexOf(data[i].assyear);
let _assyear = data[i].asstype;
// if(data[i].asstype==="半年度"){
// if(data[i].assendtime.substring(5,10)==="06-30"){
// _assyear='上半年度'
......@@ -2713,8 +2718,8 @@ function filter(item, data) {
obj[item.assyear] = [];
}
if (item.asstype === '月度') {
item.month = Number(item.assendtime.substring(5, 7)) + '月'
item.monthNum = Number(item.assendtime.substring(5, 7))
item.month = Number(item.assendtime.substring(5, 7)) + '月';
item.monthNum = Number(item.assendtime.substring(5, 7));
obj[item.assyear].push(item);
}
......@@ -2723,29 +2728,29 @@ function filter(item, data) {
// console.log('年分组>>', obj)
assessData = data.filter(i => i.asstype === '年度')
let objKeys = Object.keys(obj)
let dataYears = assessData.map(item => item.assyear)
let noYearData = {}
assessData = data.filter(i => i.asstype === '年度');
let objKeys = Object.keys(obj);
let dataYears = assessData.map(item => item.assyear);
let noYearData = {};
if (objKeys.length !== assessData.length) {
noYearData = {assyear: objKeys.find(item => !dataYears.includes(item)), assgrade: ''}
noYearData = { assyear: objKeys.find(item => !dataYears.includes(item)), assgrade: '' };
}
if (noYearData.assyear) {
assessData.unshift(noYearData)
assessData.unshift(noYearData);
}
assessData.forEach(item => {
item.months = obj[item.assyear]
})
item.months = obj[item.assyear];
});
//月份升序
assessData.forEach(item => {
if (item.months && item.months.length) {
item.months.sort((a, b) => {
return a.monthNum - b.monthNum
})
return a.monthNum - b.monthNum;
});
}
})
});
}
......@@ -2762,28 +2767,29 @@ function filter(item, data) {
function eleHide() {
let wrap_content = document.getElementsByClassName('wrap_content');
console.log('wrap_content>>', wrap_content)
console.log('wrap_content>>', wrap_content);
for (let i = 0; i < wrap_content.length; i++) {
console.log('')
console.log('');
if (wrap_content[i].childNodes.length > 3) {
let clickNode = wrap_content[i].nextElementSibling;
wrapContent(wrap_content[i], clickNode);
}
}
}
function eleHideChil() {
console.log('eleHideChil>>>')
console.log('eleHideChil>>>');
let wrap_box = document.getElementsByClassName('children_box');
let hasChildrenEle = document.getElementsByClassName('has-children');
for (let i = 0; i < wrap_box.length; i++) {
let clickNode = hasChildrenEle[i];
wrapContentChil(wrap_box[i], clickNode);
}
console.log('eleHideChil>>>')
console.log('eleHideChil>>>');
}
function wrapContentChil(target, clickNode, num = 0) {
let offsetHeight = target.offsetHeight
let offsetHeight = target.offsetHeight;
let item = target.childNodes;
let allHeight = target.offsetHeight + 'px';
let showEleHeight = 0;
......@@ -2799,13 +2805,13 @@ function wrapContentChil(target, clickNode, num = 0) {
if (target.style.height == showEleHeight || target.style.height == (showEleHeight + 'px')) {
target.classList.add('expand');
target.style.height = allHeight;
clickNode.classList.add('expand')
target.parentNode.style.height = (target.parentNode.offsetHeight + offsetHeight) + 'px'
clickNode.classList.add('expand');
target.parentNode.style.height = (target.parentNode.offsetHeight + offsetHeight) + 'px';
} else {
target.style.height = showEleHeight;
target.classList.remove('expand');
clickNode.classList.remove('expand')
target.parentNode.style.height = (target.parentNode.offsetHeight - offsetHeight) + 'px'
clickNode.classList.remove('expand');
target.parentNode.style.height = (target.parentNode.offsetHeight - offsetHeight) + 'px';
}
});
attachAtivated(clickNode);
......
This diff could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment