diff --git a/src/components/Designer/src/components/componentProperty/PropertyOption.vue b/src/components/Designer/src/components/componentProperty/PropertyOption.vue
index 1b536e7..475b0cb 100644
--- a/src/components/Designer/src/components/componentProperty/PropertyOption.vue
+++ b/src/components/Designer/src/components/componentProperty/PropertyOption.vue
@@ -422,6 +422,13 @@
+
+
+
+ {{ fItem.label }}
+
+
+
@@ -1560,6 +1567,18 @@
});
}
+ function findTableFields(obj) {
+ if (!props.widgetForm?.list) {
+ return [];
+ }
+ const bTable = obj.bindTable;
+ const pTable = props.widgetForm.list.find((item) => item.type === 'form' && item.bindTable === bTable);
+ if (!pTable) {
+ return [];
+ }
+ return pTable.children;
+ }
+
return {
data,
hasKey,
@@ -1617,7 +1636,8 @@
handleIsSave,
buttonTableOptions,
t,
- imageUrl
+ imageUrl,
+ findTableFields
};
}
});
diff --git a/src/components/Designer/src/types/index.ts b/src/components/Designer/src/types/index.ts
index 08f0f61..732236b 100644
--- a/src/components/Designer/src/types/index.ts
+++ b/src/components/Designer/src/types/index.ts
@@ -1164,6 +1164,7 @@ export const infoComponents = [
labelFixWidth: 120,
parentNode: '',
responsive: false,
+ sepTextField: '',
span: '',
width: '100%',
defaultValue: undefined,
@@ -1184,6 +1185,7 @@ export const infoComponents = [
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
+ sepTextField: '',
span: '',
width: '100%',
defaultValue: '',
diff --git a/src/components/Form/src/components/SelectDepartmentV2.vue b/src/components/Form/src/components/SelectDepartmentV2.vue
index d0828b2..e032349 100644
--- a/src/components/Form/src/components/SelectDepartmentV2.vue
+++ b/src/components/Form/src/components/SelectDepartmentV2.vue
@@ -1,205 +1,226 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
diff --git a/src/components/Form/src/components/SubFormV2.vue b/src/components/Form/src/components/SubFormV2.vue
index 478a73a..65f9472 100644
--- a/src/components/Form/src/components/SubFormV2.vue
+++ b/src/components/Form/src/components/SubFormV2.vue
@@ -9,7 +9,7 @@
{{ t('新增') }}
-
+
@@ -66,6 +66,8 @@
:bordered="showComponentBorder"
:index="index"
:mainKey="mainKey"
+ :key="column.dataIndex + record['_key_']"
+ :row="record"
v-bind="getComponentsProps(column.componentProps, column.dataIndex, record, index)"
@blur="onFieldBlur(column, record, index)"
@change="onFieldChange(column, record, index)"
@@ -225,6 +227,15 @@
});
}
+ function addDataKey(rows) {
+ rows.forEach((row) => {
+ if (!row['_key_']) {
+ row['_key_'] = Math.random();
+ }
+ });
+ return rows;
+ }
+
onMounted(() => {
data.value = cloneDeep(props.value);
@@ -261,23 +272,7 @@
watch(
() => props.value,
(v) => {
- // console.log('watch props.value', props.value);
data.value = v;
- // const rangeComponents = props.columns.filter((column) =>
- // column.componentType?.includes('Range'),
- // );
- // if (rangeComponents.length && formModel) {
- // rangeComponents.forEach((item) => {
- // data.value.forEach((x) => {
- // if (x[(item.dataIndex as string)?.split(',')[0]]) {
- // x[item.dataIndex as string] = [
- // x[(item.dataIndex as string)?.split(',')[0]],
- // x[(item.dataIndex as string)?.split(',')[1]],
- // ];
- // }
- // });
- // });
- // }
//要保证在预加载之后在emit 不然预加载数据不会绑定到表单数据中
emit('change', unref(data));
diff --git a/src/utils/event/design.ts b/src/utils/event/design.ts
index 9933cad..94f1835 100644
--- a/src/utils/event/design.ts
+++ b/src/utils/event/design.ts
@@ -27,8 +27,11 @@ export function changeToPinyin(label: string, isUpper?: boolean) {
/* 如果没有下划线,不需要处理
如果有下划线,用下划线切割,第一个下划线左边的全部小写,后面的首字母大写,首字母后面的全部小写 */
-export function camelCaseString(string: string) {
+export function camelCaseString(string: string, skipNoUnderline = false) {
if (!string) return;
+ if (skipNoUnderline && string.indexOf('_') < 0) {
+ return string;
+ }
const stringLower = string.toLowerCase();
const len = stringLower.length;
let str = '';