Commit 50833df6 authored by 秦文海's avatar 秦文海

fix: 修复引入问题

parent 59946673
Pipeline #37614 passed with stages
in 5 minutes 26 seconds
......@@ -679,51 +679,3 @@ export default () => {
</div>
);
};
//分类可见与不可见属性的数组
export const getVisibleAttribues = function (attribuesArr, fields) {
var attrs = [];
fields.forEach(function (item, i, arr) {
attribuesArr.forEach(function (attr, index) {
if (i == 0) {
attrs[index] = {
show: {},
hide: {},
fields: [],
};
}
// 属性值
var attrValue = attr[item.name];
if (_.isUndefined(attrValue) || _.isNull(attrValue)) {
attrValue = '';
}
// 界面展示值-处理后的
var handleValue = attrValue;
if (handleValue == '') {
handleValue = '--';
}
if (item.visible) {
attrs[index]['show'][item.alias] = [attrValue, handleValue, item.name, item];
attrs[index]['fields'].push(item.alias);
} else {
attrs[index]['hide'][item.alias] = attrValue;
}
});
});
attrsFieldHandle(attrs);
return attrs;
};
//字段类型读取
function attrsFieldHandle(attrs) {
attrs.forEach((item) => {
var showFieldObj = item['show'];
for (var k in showFieldObj) {
var testField = showFieldObj[k][0];
if (typeof testField == 'number') {
if (Number.isInteger(testField)) showFieldObj[k][1] = testField;
else showFieldObj[k][1] = Number(testField.toFixed(3));
}
}
});
}
......@@ -88,5 +88,51 @@ const TipTool = (props) => {
</div>
);
};
//分类可见与不可见属性的数组
export const getVisibleAttribues = function (attribuesArr, fields) {
var attrs = [];
fields.forEach(function (item, i, arr) {
attribuesArr.forEach(function (attr, index) {
if (i == 0) {
attrs[index] = {
show: {},
hide: {},
fields: [],
};
}
// 属性值
var attrValue = attr[item.name];
if (_.isUndefined(attrValue) || _.isNull(attrValue)) {
attrValue = '';
}
// 界面展示值-处理后的
var handleValue = attrValue;
if (handleValue == '') {
handleValue = '--';
}
if (item.visible) {
attrs[index]['show'][item.alias] = [attrValue, handleValue, item.name, item];
attrs[index]['fields'].push(item.alias);
} else {
attrs[index]['hide'][item.alias] = attrValue;
}
});
});
attrsFieldHandle(attrs);
return attrs;
};
//字段类型读取
function attrsFieldHandle(attrs) {
attrs.forEach((item) => {
var showFieldObj = item['show'];
for (var k in showFieldObj) {
var testField = showFieldObj[k][0];
if (typeof testField == 'number') {
if (Number.isInteger(testField)) showFieldObj[k][1] = testField;
else showFieldObj[k][1] = Number(testField.toFixed(3));
}
}
});
}
export default TipTool;
import './index.less';
import { getVisibleAttribues } from '../demos';
import { getVisibleAttribues } from '../index';
import classNames from 'classnames';
import { ConfigProvider } from 'antd';
import React, { useContext } from 'react';
......
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 to comment