|
@@ -84,6 +84,7 @@ const D = (fieldID: number, valIndex?: number, newValue?: any) => {
|
|
|
if (!F(fieldID)) P(fieldID);
|
|
if (!F(fieldID)) P(fieldID);
|
|
|
if (DData[fieldID]) {
|
|
if (DData[fieldID]) {
|
|
|
if (DData[fieldID].length >= valIndex) {
|
|
if (DData[fieldID].length >= valIndex) {
|
|
|
|
|
+ if (!DData[fieldID][valIndex]) return null;
|
|
|
return DData[fieldID][valIndex];
|
|
return DData[fieldID][valIndex];
|
|
|
} else {
|
|
} else {
|
|
|
console.log(`指标id:${fieldID},${valIndex}>${DData[fieldID].length},请检查`)
|
|
console.log(`指标id:${fieldID},${valIndex}>${DData[fieldID].length},请检查`)
|
|
@@ -253,11 +254,11 @@ const insertFieldValue = (fieldID: number, valIdx: number, newValue: number) =>
|
|
|
|
|
|
|
|
//复制精度
|
|
//复制精度
|
|
|
const copyPrecision = (targetFieldID: number, orgFieldID: number) => {
|
|
const copyPrecision = (targetFieldID: number, orgFieldID: number) => {
|
|
|
- copyProperty(targetFieldID, orgFieldID,'Precision');
|
|
|
|
|
|
|
+ copyProperty(targetFieldID, orgFieldID, 'Precision');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const copyFixedPrecisionNum = (targetFieldID: number, orgFieldID: number) => {
|
|
const copyFixedPrecisionNum = (targetFieldID: number, orgFieldID: number) => {
|
|
|
- copyProperty(targetFieldID, orgFieldID,'fixedPrecisionNum');
|
|
|
|
|
|
|
+ copyProperty(targetFieldID, orgFieldID, 'fixedPrecisionNum');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//复制属性
|
|
//复制属性
|
|
@@ -265,12 +266,12 @@ const copyProperty = (targetFieldID: number, orgFieldID: number, property: strin
|
|
|
const targetField = <IGroupField>F(targetFieldID);
|
|
const targetField = <IGroupField>F(targetFieldID);
|
|
|
const orgField = <IGroupField>F(orgFieldID);
|
|
const orgField = <IGroupField>F(orgFieldID);
|
|
|
if (targetField && orgField) {
|
|
if (targetField && orgField) {
|
|
|
- if(orgField[property]){
|
|
|
|
|
- if(!targetField[property]){
|
|
|
|
|
- targetField[property]={};
|
|
|
|
|
|
|
+ if (orgField[property]) {
|
|
|
|
|
+ if (!targetField[property]) {
|
|
|
|
|
+ targetField[property] = {};
|
|
|
}
|
|
}
|
|
|
Object.assign(targetField[property], orgField[property]);
|
|
Object.assign(targetField[property], orgField[property]);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
console.log(`指标${orgFieldID}不存在${property}属性`);
|
|
console.log(`指标${orgFieldID}不存在${property}属性`);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -282,6 +283,12 @@ const setDate = (fieldID: number, format: string) => {
|
|
|
const date = new ReportDate();
|
|
const date = new ReportDate();
|
|
|
setData(fieldID, date.Format(format));
|
|
setData(fieldID, date.Format(format));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const DLength = () => {
|
|
|
|
|
+ if (orgData && orgData.detail_data) return orgData.detail_data[0].length
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
setupData,
|
|
setupData,
|
|
|
P,
|
|
P,
|
|
@@ -300,7 +307,8 @@ export default {
|
|
|
copyPrecision,
|
|
copyPrecision,
|
|
|
copyFixedPrecisionNum,
|
|
copyFixedPrecisionNum,
|
|
|
copyProperty,
|
|
copyProperty,
|
|
|
- setDate
|
|
|
|
|
|
|
+ setDate,
|
|
|
|
|
+ DLength
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|