Skip to content

Commit 25447a6

Browse files
fit2cloudwxxfit2-zhao
authored andcommitted
fix: formula edit diabled take up position
1 parent f78605a commit 25447a6

7 files changed

Lines changed: 19 additions & 5 deletions

File tree

frontend/packages/web/src/components/business/crm-form-create/components/advanced/serialNumber.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
formDetail: props.formDetail,
8282
fields: fieldList.value ?? [],
8383
formulaDataSource: formulaDataSource.value,
84+
needInitDetail: props.needInitDetail,
8485
evaluationNow: evaluationNow.value,
8586
decimalPlaces: 2,
8687
warn: (msg: string) => {

frontend/packages/web/src/components/business/crm-form-create/components/basic/singleText.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
formDetail: props.formDetail,
112112
fields: fieldList.value ?? [],
113113
formulaDataSource: formulaDataSource.value,
114+
needInitDetail: props.needInitDetail,
114115
evaluationNow: evaluationNow.value,
115116
decimalPlaces: 2,
116117
warn: (msg: string) => {

frontend/packages/web/src/components/business/crm-formula/formula-runtime/formula-executor/evaluator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ export function resolveFieldValue(rawVal: any, node: IRNode, ctx?: EvaluateConte
8686
const isEmptyString = typeof rawVal === 'string' && rawVal.trim() === '';
8787
const isEmptyValue = rawVal == null || rawVal === '' || isEmptyString;
8888

89-
if (node.type === 'field' && meta?.fieldType === FieldTypeEnum.SERIAL_NUMBER && !meta?.resourceFieldId) {
89+
if (
90+
node.type === 'field' &&
91+
meta?.fieldType === FieldTypeEnum.SERIAL_NUMBER &&
92+
!meta?.resourceFieldId &&
93+
!ctx?.needInitDetail
94+
) {
9095
return `\${${ctx?.getFieldMeta?.(node.fieldId)?.name || node.fieldId}}`;
9196
}
9297

frontend/packages/web/src/components/business/crm-formula/formula-runtime/formula-executor/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ export function executeFormFormula(ctx: FormulaExecutorContext): FormulaExecutor
143143
formDetail,
144144
fields = [],
145145
formulaDataSource,
146+
needInitDetail,
146147
evaluationNow,
147148
decimalPlaces = 2,
148149
expectedType,
149150
cloneIR = true,
150151
warn,
151152
} = ctx;
152-
153153
const { ir } = safeParseFormula(formula ?? '');
154154

155155
if (!ir) {
@@ -197,6 +197,7 @@ export function executeFormFormula(ctx: FormulaExecutorContext): FormulaExecutor
197197
return fieldTypeMap[fieldId];
198198
},
199199
resolveFieldRuntimeValue,
200+
needInitDetail,
200201
warn: (msg: string) => {
201202
warn?.(msg);
202203
},

frontend/packages/web/src/components/business/crm-formula/formula-runtime/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export interface EvaluateContext {
8888
getTableColumnValues(path: string): number[];
8989
getFieldMeta?(fieldId: string): FieldMeta | undefined;
9090
resolveFieldRuntimeValue?(fieldId: string, rawValue: any): any;
91-
91+
needInitDetail?: boolean;
9292
warn?(msg: string): void;
9393
}
9494

@@ -106,6 +106,7 @@ export interface FormulaExecutorContext {
106106
formDetail?: Record<string, any>;
107107
fields?: FormCreateField[];
108108
formulaDataSource: Record<string, any>;
109+
needInitDetail?: boolean;
109110
evaluationNow?: any;
110111
decimalPlaces?: number;
111112
expectedType?: ValueType;

frontend/packages/web/src/components/business/crm-formula/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@
9090
// 根据公式实时计算 todo 等待优化
9191
const updateValue = debounce(() => {
9292
const { formula } = props.fieldConfig;
93-
9493
const result = executeFormFormula({
9594
formula,
9695
path: props.path,
9796
formDetail: props.formDetail,
9897
fields: fieldList.value ?? [],
9998
formulaDataSource: formulaDataSource.value,
99+
needInitDetail: props.needInitDetail,
100100
evaluationNow: evaluationNow.value,
101101
decimalPlaces: 2,
102102
warn: (msg: string) => {

frontend/packages/web/src/views/clueManagement/clue/components/clueOverviewDrawer.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
:reason-key="ReasonTypeEnum.CLUE_POOL_RS"
8181
:source-id="sourceId"
8282
:name="sourceName"
83-
@refresh="emit('remove')"
83+
@refresh="handleMovedSuccess"
8484
/>
8585
<convertClueModal v-model:show="showConvertClueModal" :clue-id="sourceId" @success="emit('remove')" />
8686
</template>
@@ -310,6 +310,11 @@
310310
},
311311
];
312312
313+
function handleMovedSuccess() {
314+
show.value = false;
315+
emit('remove');
316+
}
317+
313318
function handleDescriptionInit(_collaborationType?: CollaborationType, _sourceName?: string) {
314319
sourceName.value = _sourceName || '';
315320
}

0 commit comments

Comments
 (0)