| | |
| | | if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
| | | time = parseInt(time)
|
| | | } else if (typeof time === 'string') {
|
| | | time = time.replace(new RegExp(/-/gm), '/');
|
| | | time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm),'');
|
| | | }
|
| | | if ((typeof time === 'number') && (time.toString().length === 10)) {
|
| | | time = time * 1000
|
| | |
| | | export function selectDictLabel(datas, value) {
|
| | | var actions = [];
|
| | | Object.keys(datas).some((key) => {
|
| | | if (datas[key].dictValue == ('' + value)) {
|
| | | actions.push(datas[key].dictLabel);
|
| | | if (datas[key].value == ('' + value)) {
|
| | | actions.push(datas[key].label);
|
| | | return true;
|
| | | }
|
| | | })
|
| | |
| | | return str;
|
| | | }
|
| | |
|
| | | // 数据合并
|
| | | export function mergeRecursive(source, target) {
|
| | | for (var p in target) {
|
| | | try {
|
| | | if (target[p].constructor == Object) {
|
| | | source[p] = mergeRecursive(source[p], target[p]);
|
| | | } else {
|
| | | source[p] = target[p];
|
| | | }
|
| | | } catch(e) {
|
| | | source[p] = target[p];
|
| | | }
|
| | | }
|
| | | return source;
|
| | | };
|
| | |
|
| | | /**
|
| | | * 构造树型结构数据
|
| | | * @param {*} data 数据源
|