Commit 6e0be362 by zhongqm

update:迁移最新模块完成

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