Browse Source

fix: formItem formItemProps 调研关联性

main
xuziqiang 6 months ago
parent
commit
620fbd509a
  1. 10
      hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue
  2. 4
      hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue
  3. 0
      hx-ai-intelligent/src/view/equipmentManage/group/groupEdit.vue
  4. 4
      lib/component/form/form/form-item.vue
  5. 6
      lib/component/form/form/use-form-model.ts

10
hx-ai-intelligent/src/view/equipmentManage/group/editFormula.vue

@ -45,10 +45,12 @@
field: 'formula', field: 'formula',
component: 'NsTextarea', component: 'NsTextarea',
defaultValue: '(A+B)*2', defaultValue: '(A+B)*2',
style: { width: '450px' }, formItemProps: {
wrapperCol: { span: 24 },
},
componentProps: { componentProps: {
placeholder: '请输入', placeholder: '请输入',
autosize: { autoSize: {
minRows: 6, minRows: 6,
maxRows: 6, maxRows: 6,
}, },
@ -70,11 +72,13 @@
label: '', label: '',
field: 'NsBasicTable', field: 'NsBasicTable',
component: 'NsBasicTable', component: 'NsBasicTable',
formItemProps: {
wrapperCol: { span: 24 },
},
componentProps: { componentProps: {
disabled: true, disabled: true,
placeholder: '请输入', placeholder: '请输入',
dataSource: mockDataSource.value, dataSource: mockDataSource.value,
style: { width: '450px' },
pagination: false, pagination: false,
rowKey: (record) => record.groupName, rowKey: (record) => record.groupName,
columns: [ columns: [

4
hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue

@ -87,11 +87,13 @@
label: '', label: '',
field: 'NsBasicTable', field: 'NsBasicTable',
component: 'NsBasicTable', component: 'NsBasicTable',
formItemProps: {
wrapperCol: { span: 24 },
},
componentProps: { componentProps: {
disabled: true, disabled: true,
placeholder: '请输入', placeholder: '请输入',
dataSource: mockDataSource.value, dataSource: mockDataSource.value,
style: { width: '450px' },
rowSelection: { type: 'radio' }, rowSelection: { type: 'radio' },
pagination: false, pagination: false,
rowKey: (record) => record.groupName, rowKey: (record) => record.groupName,

0
hx-ai-intelligent/src/view/equipmentManage/group/groupEdit.vue

4
lib/component/form/form/form-item.vue

@ -293,9 +293,13 @@
}, },
onValidateChange: (text: Object | undefined) => { onValidateChange: (text: Object | undefined) => {
if (isUndefined(text)) text = {}; if (isUndefined(text)) text = {};
console.error(text, 'onValidateChange');
validateRef.value = text; validateRef.value = text;
}, },
}; };
console.log(on, 'checkON');
return { return {
...propsData, ...propsData,
...on, ...on,

6
lib/component/form/form/use-form-model.ts

@ -1,5 +1,3 @@
import type { UnwrapRef, Ref } from 'vue'; import type { UnwrapRef, Ref } from 'vue';
import { unref, nextTick, toRaw } from 'vue'; import { unref, nextTick, toRaw } from 'vue';
import { get, isArray, isNil, isUndefined, isPlainObject, forEach, isFunction } from 'lodash-es'; import { get, isArray, isNil, isUndefined, isPlainObject, forEach, isFunction } from 'lodash-es';
@ -173,7 +171,9 @@ export function useFormModel({ schemas, formModel, formElRef, emit }: useFormMod
//select allowClear时值被设为undefined //select allowClear时值被设为undefined
unref(formModel)[key] = value; unref(formModel)[key] = value;
} }
validateFields([key]).catch(() => {}); validateFields([key]).catch((err) => {
console.error(`${key}:`, err);
});
// console.log('formModel', key, value, formModel.value); // console.log('formModel', key, value, formModel.value);
// if (fieldRules(key)) { // if (fieldRules(key)) {
// console.log('getNamePath', getNamePath.value); // console.log('getNamePath', getNamePath.value);

Loading…
Cancel
Save