4
4
This commit is contained in:
36
src/App.tsx
36
src/App.tsx
@ -305,7 +305,6 @@ export default function App() {
|
|||||||
setCurrentDeliveryRecordId(null);
|
setCurrentDeliveryRecordId(null);
|
||||||
setLabelAdjustmentFlow(false);
|
setLabelAdjustmentFlow(false);
|
||||||
|
|
||||||
setGroupOrderConfig([]);
|
|
||||||
setGroupConfigVisible(false);
|
setGroupConfigVisible(false);
|
||||||
setGroupOrderDraft([]);
|
setGroupOrderDraft([]);
|
||||||
setDraggingGroupIndex(null);
|
setDraggingGroupIndex(null);
|
||||||
@ -401,6 +400,8 @@ export default function App() {
|
|||||||
// 新表ID(批量生成表)
|
// 新表ID(批量生成表)
|
||||||
const BATCH_TABLE_ID = 'tblXO7iSxBYxrqtY';
|
const BATCH_TABLE_ID = 'tblXO7iSxBYxrqtY';
|
||||||
const BATCH_ROW_NUMBER_FIELD_ID = 'fldiqlTVsU';
|
const BATCH_ROW_NUMBER_FIELD_ID = 'fldiqlTVsU';
|
||||||
|
const BATCH_LABEL11_FIELD_ID = 'fld4BZHtBV';
|
||||||
|
const BATCH_LABEL12_FIELD_ID = 'fldnRlMeaD';
|
||||||
|
|
||||||
const activateTableForPaging = async (table: any) => {
|
const activateTableForPaging = async (table: any) => {
|
||||||
try {
|
try {
|
||||||
@ -2764,7 +2765,7 @@ export default function App() {
|
|||||||
console.log('currentStartTime:', currentStartTime);
|
console.log('currentStartTime:', currentStartTime);
|
||||||
|
|
||||||
{
|
{
|
||||||
const requiredLabelKeys = Array.from({ length: 10 }, (_, i) => `标签${i + 1}`);
|
const requiredLabelKeys = Array.from({ length: 11 }, (_, i) => `标签${i + 1}`);
|
||||||
const label7Val = (currentSelectedLabels as any)['标签7'];
|
const label7Val = (currentSelectedLabels as any)['标签7'];
|
||||||
const label7Values = Array.isArray(label7Val)
|
const label7Values = Array.isArray(label7Val)
|
||||||
? label7Val.map((s: any) => String(s ?? '').trim()).filter(Boolean)
|
? label7Val.map((s: any) => String(s ?? '').trim()).filter(Boolean)
|
||||||
@ -2904,7 +2905,7 @@ export default function App() {
|
|||||||
if (!fieldMeta || typeof (fieldMeta as any).name !== 'string' || typeof (fieldMeta as any).id !== 'string') {
|
if (!fieldMeta || typeof (fieldMeta as any).name !== 'string' || typeof (fieldMeta as any).id !== 'string') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const match = (fieldMeta as any).name.match(/^标签([1-9]|10|12)$/);
|
const match = (fieldMeta as any).name.match(/^标签(\d+)$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
const labelKey = `标签${match[1]}`;
|
const labelKey = `标签${match[1]}`;
|
||||||
timelineLabelFields[labelKey] = (fieldMeta as any).id;
|
timelineLabelFields[labelKey] = (fieldMeta as any).id;
|
||||||
@ -5510,9 +5511,13 @@ export default function App() {
|
|||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
const labels: { [key: string]: string | string[] } = {};
|
const labels: { [key: string]: string | string[] } = {};
|
||||||
for (let i2 = 1; i2 <= 10; i2++) {
|
for (let i2 = 1; i2 <= 12; i2++) {
|
||||||
const key = `标签${i2}`;
|
const key = `标签${i2}`;
|
||||||
const raw = f[nameToId.get(key) || ''];
|
const fieldId =
|
||||||
|
i2 === 11 ? (nameToId.get(key) || BATCH_LABEL11_FIELD_ID) :
|
||||||
|
i2 === 12 ? (nameToId.get(key) || BATCH_LABEL12_FIELD_ID) :
|
||||||
|
(nameToId.get(key) || '');
|
||||||
|
const raw = f[fieldId];
|
||||||
const list = normalizeToStringList(raw);
|
const list = normalizeToStringList(raw);
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
if (i2 === 7 || i2 === 8 || i2 === 10) labels[key] = list;
|
if (i2 === 7 || i2 === 8 || i2 === 10) labels[key] = list;
|
||||||
@ -5520,7 +5525,7 @@ export default function App() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const requiredLabelKeys = Array.from({ length: 10 }, (_, k) => `标签${k + 1}`);
|
const requiredLabelKeys = Array.from({ length: 12 }, (_, k) => `标签${k + 1}`);
|
||||||
const missing = requiredLabelKeys.filter(k => {
|
const missing = requiredLabelKeys.filter(k => {
|
||||||
const val = (labels as any)[k];
|
const val = (labels as any)[k];
|
||||||
if (Array.isArray(val)) return val.length === 0;
|
if (Array.isArray(val)) return val.length === 0;
|
||||||
@ -7868,11 +7873,20 @@ export default function App() {
|
|||||||
disabled={
|
disabled={
|
||||||
timelineLoading
|
timelineLoading
|
||||||
|| (timelineDirection === 'backward' && (!expectedDate || !startTime))
|
|| (timelineDirection === 'backward' && (!expectedDate || !startTime))
|
||||||
|| Array.from({ length: 10 }, (_, i) => `标签${i + 1}`).some(key => {
|
|| (() => {
|
||||||
const val = (selectedLabels as any)[key];
|
const required = Array.from({ length: 11 }, (_, i) => `标签${i + 1}`);
|
||||||
if (Array.isArray(val)) return val.length === 0;
|
const label7Val = (selectedLabels as any)['标签7'];
|
||||||
return !(typeof val === 'string' && val.trim().length > 0);
|
const label7Values = Array.isArray(label7Val)
|
||||||
})
|
? label7Val.map((s: any) => String(s ?? '').trim()).filter(Boolean)
|
||||||
|
: (typeof label7Val === 'string' ? [label7Val.trim()].filter(Boolean) : []);
|
||||||
|
const shouldRequireLabel12 = label7Values.length > 0 && !(label7Values.length === 1 && label7Values[0] === '无(二次工艺)');
|
||||||
|
if (shouldRequireLabel12) required.push('标签12');
|
||||||
|
return required.some(key => {
|
||||||
|
const val = (selectedLabels as any)[key];
|
||||||
|
if (Array.isArray(val)) return val.length === 0;
|
||||||
|
return !(typeof val === 'string' && val.trim().length > 0);
|
||||||
|
});
|
||||||
|
})()
|
||||||
}
|
}
|
||||||
style={{ minWidth: '160px' }}
|
style={{ minWidth: '160px' }}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user