mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 10:36:31 +08:00
1、固定vue-draggable-plus版本为0.3.1,发现0.3.5有bug。
This commit is contained in:
13711
OrangeFormsOpen-VUE3/package-lock.json
generated
13711
OrangeFormsOpen-VUE3/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@
|
|||||||
"pinia-plugin-persist": "^1.0.0",
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"vant": "^4.7.3",
|
"vant": "^4.7.3",
|
||||||
"vue": "^3.3.8",
|
"vue": "^3.3.8",
|
||||||
"vue-draggable-plus": "^0.3.1",
|
"vue-draggable-plus": "0.3.1",
|
||||||
"vue-json-viewer": "^3.0.4",
|
"vue-json-viewer": "^3.0.4",
|
||||||
"vue-router": "^4.2.5",
|
"vue-router": "^4.2.5",
|
||||||
"vxe-table": "^4.5.13",
|
"vxe-table": "^4.5.13",
|
||||||
|
|||||||
@@ -795,8 +795,6 @@ defineExpose({ resetWidget });
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!dialogParams.value.isEdit) {
|
if (!dialogParams.value.isEdit) {
|
||||||
initPage();
|
|
||||||
initFormWidgetList();
|
|
||||||
initFormData();
|
initFormData();
|
||||||
initWidgetLinkage();
|
initWidgetLinkage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -562,12 +562,13 @@ const formExpose = useFormExpose(formData);
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!dialogParams.value.isEdit) {
|
if (!dialogParams.value.isEdit) {
|
||||||
initPage();
|
|
||||||
initFormWidgetList();
|
|
||||||
initWidgetRule();
|
initWidgetRule();
|
||||||
initFormData()
|
initFormData()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
initWidgetLinkage();
|
initWidgetLinkage();
|
||||||
|
setTimeout(() => {
|
||||||
|
formRef.value.clearValidate();
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((e: Error) => {
|
.catch((e: Error) => {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="online-query-form" :style="{ height: height ? height : '100%' }" v-show="isReady">
|
<div
|
||||||
|
class="online-query-form"
|
||||||
|
:style="{ height: height ? height : '100%', width: '100%' }"
|
||||||
|
v-show="isReady"
|
||||||
|
>
|
||||||
<OnlineFilterBox
|
<OnlineFilterBox
|
||||||
class="query-filter-box"
|
class="query-filter-box"
|
||||||
:isEdit="dialogParams.isEdit"
|
:isEdit="dialogParams.isEdit"
|
||||||
@@ -29,7 +33,7 @@
|
|||||||
>
|
>
|
||||||
<OnlineCustomTable
|
<OnlineCustomTable
|
||||||
ref="dataTable"
|
ref="dataTable"
|
||||||
style="padding-top: 0 !important"
|
style="padding: 0 !important"
|
||||||
:dataList="queryTableWidget.dataList"
|
:dataList="queryTableWidget.dataList"
|
||||||
:isEdit="dialogParams.isEdit"
|
:isEdit="dialogParams.isEdit"
|
||||||
:widget="queryTable"
|
:widget="queryTable"
|
||||||
@@ -511,8 +515,6 @@ const initFormData = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!dialogParams.value.isEdit) {
|
if (!dialogParams.value.isEdit) {
|
||||||
initPage();
|
|
||||||
initFormWidgetList();
|
|
||||||
initFormData();
|
initFormData();
|
||||||
}
|
}
|
||||||
isReady.value = true;
|
isReady.value = true;
|
||||||
|
|||||||
@@ -607,8 +607,6 @@ const initFormData = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!dialogParams.value.isEdit) {
|
if (!dialogParams.value.isEdit) {
|
||||||
initPage();
|
|
||||||
initFormWidgetList();
|
|
||||||
initFormData();
|
initFormData();
|
||||||
initWidgetLinkage();
|
initWidgetLinkage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,13 +231,14 @@ const initFormData = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!props.isEdit) {
|
if (!props.isEdit) {
|
||||||
initPage();
|
|
||||||
initFormWidgetList();
|
|
||||||
initWidgetRule();
|
initWidgetRule();
|
||||||
|
|
||||||
initFormData()
|
initFormData()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
initWidgetLinkage();
|
initWidgetLinkage();
|
||||||
|
setTimeout(() => {
|
||||||
|
componentRef.value.clearValidate();
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((e: Error) => {
|
.catch((e: Error) => {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
@@ -260,8 +261,8 @@ const getFormDataImpl = (variableList: ANY_OBJECT[] | null = null) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 获取流程变量
|
// 获取流程变量
|
||||||
if (variableList) {
|
if (variableList && variableList.value) {
|
||||||
variableList.forEach(variable => {
|
variableList.value.forEach(variable => {
|
||||||
if (!variable.builtin) {
|
if (!variable.builtin) {
|
||||||
let column = form.value.columnMap.get(variable.bindColumnId);
|
let column = form.value.columnMap.get(variable.bindColumnId);
|
||||||
let relation = form.value.relationMap.get(variable.bindRelationId);
|
let relation = form.value.relationMap.get(variable.bindRelationId);
|
||||||
|
|||||||
@@ -428,8 +428,6 @@ const onSearch = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isReady.value = false;
|
isReady.value = false;
|
||||||
if (!props.isEdit) {
|
if (!props.isEdit) {
|
||||||
initPage();
|
|
||||||
initFormWidgetList();
|
|
||||||
if (props.entryId) {
|
if (props.entryId) {
|
||||||
FlowEntryController.viewDict({
|
FlowEntryController.viewDict({
|
||||||
entryId: props.entryId,
|
entryId: props.entryId,
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
|
|
||||||
const form = computed(() => {
|
const form = computed(() => {
|
||||||
buildFormConfig(dialogParams.value.formConfig);
|
buildFormConfig(dialogParams.value.formConfig);
|
||||||
|
initPage();
|
||||||
|
initFormWidgetList();
|
||||||
return dialogParams.value.formConfig;
|
return dialogParams.value.formConfig;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -66,7 +68,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
const { checkPermCodeExist } = usePermissions();
|
const { checkPermCodeExist } = usePermissions();
|
||||||
|
|
||||||
const masterTable = computed(() => {
|
const masterTable = computed(() => {
|
||||||
return form.value.tableMap.get(form.value.masterTableId);
|
return dialogParams.value.formConfig.tableMap.get(dialogParams.value.formConfig.masterTableId);
|
||||||
});
|
});
|
||||||
const isRelation = computed(() => {
|
const isRelation = computed(() => {
|
||||||
return masterTable.value?.relation != null;
|
return masterTable.value?.relation != null;
|
||||||
@@ -206,12 +208,12 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
// 一对一关联选择组件
|
// 一对一关联选择组件
|
||||||
if (
|
if (
|
||||||
widget.widgetType === SysCustomWidgetType.DataSelect &&
|
widget.widgetType === SysCustomWidgetType.DataSelect &&
|
||||||
(form.value.formType === SysOnlineFormType.FORM ||
|
(dialogParams.value.formConfig.formType === SysOnlineFormType.FORM ||
|
||||||
form.value.formType === SysOnlineFormType.FLOW)
|
dialogParams.value.formConfig.formType === SysOnlineFormType.FLOW)
|
||||||
) {
|
) {
|
||||||
const selectRow = (detail || {}).selectRow;
|
const selectRow = (detail || {}).selectRow;
|
||||||
const relationId = (widget.props.relativeTable || {}).relationId;
|
const relationId = (widget.props.relativeTable || {}).relationId;
|
||||||
const relation = form.value.relationMap.get(relationId);
|
const relation = dialogParams.value.formConfig.relationMap.get(relationId);
|
||||||
if (relation != null) {
|
if (relation != null) {
|
||||||
formData[relation.variableName] = selectRow || {};
|
formData[relation.variableName] = selectRow || {};
|
||||||
}
|
}
|
||||||
@@ -235,7 +237,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
};
|
};
|
||||||
const getWidgetValueByColumn = (column: ANY_OBJECT) => {
|
const getWidgetValueByColumn = (column: ANY_OBJECT) => {
|
||||||
if (column == null) return undefined;
|
if (column == null) return undefined;
|
||||||
const table = column ? form.value.tableMap.get(column.tableId) : undefined;
|
const table = column ? dialogParams.value.formConfig.tableMap.get(column.tableId) : undefined;
|
||||||
if (table == null || table.datasource == null) return undefined;
|
if (table == null || table.datasource == null) return undefined;
|
||||||
return table.relation == null
|
return table.relation == null
|
||||||
? formData[table.datasource.variableName][column.columnName]
|
? formData[table.datasource.variableName][column.columnName]
|
||||||
@@ -244,7 +246,9 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
const getParamValue = (valueType: number, valueData: string) => {
|
const getParamValue = (valueType: number, valueData: string) => {
|
||||||
switch (valueType) {
|
switch (valueType) {
|
||||||
case SysOnlineParamValueType.TABLE_COLUMN: {
|
case SysOnlineParamValueType.TABLE_COLUMN: {
|
||||||
const column = form.value.columnMap ? form.value.columnMap.get(valueData) : null;
|
const column = dialogParams.value.formConfig.columnMap
|
||||||
|
? dialogParams.value.formConfig.columnMap.get(valueData)
|
||||||
|
: null;
|
||||||
return column ? getWidgetValueByColumn(column) : undefined;
|
return column ? getWidgetValueByColumn(column) : undefined;
|
||||||
}
|
}
|
||||||
case SysOnlineParamValueType.STATIC_DICT:
|
case SysOnlineParamValueType.STATIC_DICT:
|
||||||
@@ -289,7 +293,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const checkOperationPermCode = (operation: ANY_OBJECT | null) => {
|
const checkOperationPermCode = (operation: ANY_OBJECT | null) => {
|
||||||
if (form.value.formType !== SysOnlineFormType.QUERY || props.isEdit) return true;
|
if (dialogParams.value.formConfig.formType !== SysOnlineFormType.QUERY || props.isEdit) return true;
|
||||||
return checkPermCodeExist(getOperationPermCode(operation));
|
return checkPermCodeExist(getOperationPermCode(operation));
|
||||||
};
|
};
|
||||||
const checkOperationDisabled = (
|
const checkOperationDisabled = (
|
||||||
@@ -453,7 +457,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
};
|
};
|
||||||
|
|
||||||
const initPage = () => {
|
const initPage = () => {
|
||||||
form.value.tableMap.forEach((table: ANY_OBJECT) => {
|
dialogParams.value.formConfig.tableMap.forEach((table: ANY_OBJECT) => {
|
||||||
if (table.relation == null) {
|
if (table.relation == null) {
|
||||||
// 主表
|
// 主表
|
||||||
const tempObj = Array.isArray(table.columnList)
|
const tempObj = Array.isArray(table.columnList)
|
||||||
@@ -494,8 +498,8 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 初始化自定义字段
|
// 初始化自定义字段
|
||||||
if (Array.isArray(form.value.customFieldList)) {
|
if (Array.isArray(dialogParams.value.formConfig.customFieldList)) {
|
||||||
form.value.customFieldList.forEach(field => {
|
dialogParams.value.formConfig.customFieldList.forEach(field => {
|
||||||
formData.customField[field.fieldName] = undefined;
|
formData.customField[field.fieldName] = undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -523,12 +527,13 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
};
|
};
|
||||||
const initWidget = (widget: ANY_OBJECT) => {
|
const initWidget = (widget: ANY_OBJECT) => {
|
||||||
if (widget != null) {
|
if (widget != null) {
|
||||||
if (widget.bindData.tableId) widget.table = form.value.tableMap.get(widget.bindData.tableId);
|
if (widget.bindData.tableId)
|
||||||
|
widget.table = dialogParams.value.formConfig.tableMap.get(widget.bindData.tableId);
|
||||||
if (widget.bindData.columnId)
|
if (widget.bindData.columnId)
|
||||||
widget.column = form.value.columnMap.get(widget.bindData.columnId);
|
widget.column = dialogParams.value.formConfig.columnMap.get(widget.bindData.columnId);
|
||||||
if (widget.bindData.dataType === SysCustomWidgetBindDataType.Custom) {
|
if (widget.bindData.dataType === SysCustomWidgetBindDataType.Custom) {
|
||||||
if (widget.props.dictId != null) {
|
if (widget.props.dictId != null) {
|
||||||
widget.dictInfo = form.value.dictMap.get(widget.props.dictId);
|
widget.dictInfo = dialogParams.value.formConfig.dictMap.get(widget.props.dictId);
|
||||||
} else {
|
} else {
|
||||||
// TODO 这里与原代码不一致,原代码走不到这一步
|
// TODO 这里与原代码不一致,原代码走不到这一步
|
||||||
widget.dictInfo = (widget.column || {}).dictInfo;
|
widget.dictInfo = (widget.column || {}).dictInfo;
|
||||||
@@ -585,7 +590,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (widget.props.dictInfo && widget.props.dictInfo.dictId) {
|
if (widget.props.dictInfo && widget.props.dictInfo.dictId) {
|
||||||
widget.props.dictInfo.dict = form.value.dictMap.get(widget.props.dictInfo.dictId);
|
widget.props.dictInfo.dict = dialogParams.value.formConfig.dictMap.get(widget.props.dictInfo.dictId);
|
||||||
}
|
}
|
||||||
if (widget.column && widget.column.dictInfo != null) {
|
if (widget.column && widget.column.dictInfo != null) {
|
||||||
dropdownWidgetList.push(widget);
|
dropdownWidgetList.push(widget);
|
||||||
@@ -604,9 +609,11 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
}
|
}
|
||||||
if (Array.isArray(widget.props.tableColumnList)) {
|
if (Array.isArray(widget.props.tableColumnList)) {
|
||||||
widget.props.tableColumnList.forEach((tableColumn: ANY_OBJECT) => {
|
widget.props.tableColumnList.forEach((tableColumn: ANY_OBJECT) => {
|
||||||
tableColumn.table = form.value.tableMap.get(tableColumn.tableId);
|
tableColumn.table = dialogParams.value.formConfig.tableMap.get(tableColumn.tableId);
|
||||||
tableColumn.column = form.value.columnMap.get(tableColumn.columnId);
|
tableColumn.column = dialogParams.value.formConfig.columnMap.get(tableColumn.columnId);
|
||||||
tableColumn.relation = form.value.relationMap.get(tableColumn.relationId);
|
tableColumn.relation = dialogParams.value.formConfig.relationMap.get(
|
||||||
|
tableColumn.relationId,
|
||||||
|
);
|
||||||
if (tableColumn.table == null || tableColumn.column == null) {
|
if (tableColumn.table == null || tableColumn.column == null) {
|
||||||
errorMessage.value.push({
|
errorMessage.value.push({
|
||||||
widget: widget,
|
widget: widget,
|
||||||
@@ -634,10 +641,10 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
if (Array.isArray(widget.props.dictInfo.paramList)) {
|
if (Array.isArray(widget.props.dictInfo.paramList)) {
|
||||||
widget.props.dictInfo.paramList.forEach((dictParam: ANY_OBJECT) => {
|
widget.props.dictInfo.paramList.forEach((dictParam: ANY_OBJECT) => {
|
||||||
if (dictParam.dictValueType === SysOnlineParamValueType.TABLE_COLUMN) {
|
if (dictParam.dictValueType === SysOnlineParamValueType.TABLE_COLUMN) {
|
||||||
let linkageItem = form.value.linkageMap.get(dictParam.dictValue);
|
let linkageItem = dialogParams.value.formConfig.linkageMap.get(dictParam.dictValue);
|
||||||
if (linkageItem == null) {
|
if (linkageItem == null) {
|
||||||
linkageItem = [];
|
linkageItem = [];
|
||||||
form.value.linkageMap.set(dictParam.dictValue, linkageItem);
|
dialogParams.value.formConfig.linkageMap.set(dictParam.dictValue, linkageItem);
|
||||||
}
|
}
|
||||||
linkageItem.push(widget);
|
linkageItem.push(widget);
|
||||||
}
|
}
|
||||||
@@ -648,14 +655,14 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
};
|
};
|
||||||
|
|
||||||
const initFormWidgetList = () => {
|
const initFormWidgetList = () => {
|
||||||
if (Array.isArray(form.value.widgetList)) {
|
if (Array.isArray(dialogParams.value.formConfig.widgetList)) {
|
||||||
form.value.widgetList.forEach(widget => {
|
dialogParams.value.formConfig.widgetList.forEach(widget => {
|
||||||
initWidget(widget);
|
initWidget(widget);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
errorMessage.value = [];
|
errorMessage.value = [];
|
||||||
if (form.value.tableWidget) initWidget(form.value.tableWidget);
|
if (dialogParams.value.formConfig.tableWidget) initWidget(dialogParams.value.formConfig.tableWidget);
|
||||||
if (form.value.leftWidget) initWidget(form.value.leftWidget);
|
if (dialogParams.value.formConfig.leftWidget) initWidget(dialogParams.value.formConfig.leftWidget);
|
||||||
if (errorMessage.value.length > 0) {
|
if (errorMessage.value.length > 0) {
|
||||||
console.error(errorMessage);
|
console.error(errorMessage);
|
||||||
}
|
}
|
||||||
@@ -771,7 +778,7 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
if (!rules.value) {
|
if (!rules.value) {
|
||||||
rules.value = {};
|
rules.value = {};
|
||||||
}
|
}
|
||||||
form.value.widgetList.forEach((widget: ANY_OBJECT) => {
|
dialogParams.value.formConfig.widgetList.forEach((widget: ANY_OBJECT) => {
|
||||||
buildWidgetRule(widget, rules.value);
|
buildWidgetRule(widget, rules.value);
|
||||||
});
|
});
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -781,9 +788,9 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
|
|
||||||
// TODO initWidgetLinkage
|
// TODO initWidgetLinkage
|
||||||
const initWidgetLinkage = () => {
|
const initWidgetLinkage = () => {
|
||||||
// form.value.linkageMap.forEach((widgetList: ANY_OBJECT[], key: string) => {
|
// dialogParams.value.formConfig.linkageMap.forEach((widgetList: ANY_OBJECT[], key: string) => {
|
||||||
// const column = form.value.columnMap.get(key);
|
// const column = dialogParams.value.formConfig.columnMap.get(key);
|
||||||
// const table = column ? form.value.tableMap.get(column.tableId) : undefined;
|
// const table = column ? dialogParams.value.formConfig.tableMap.get(column.tableId) : undefined;
|
||||||
// const watchKey =
|
// const watchKey =
|
||||||
// 'formData.' +
|
// 'formData.' +
|
||||||
// (table.relation == null ? table.datasource.variableName : table.relation.variableName) +
|
// (table.relation == null ? table.datasource.variableName : table.relation.variableName) +
|
||||||
|
|||||||
@@ -384,6 +384,9 @@ const handlerStart = (
|
|||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.warn(e);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
|||||||
Reference in New Issue
Block a user