新增 CLAUDE.md 文件以提供项目指导,添加 .claudeignore 文件以排除不必要的文件,更新 pom.xml 版本至 3.9.2,修复多个路径遍历和 SQL 注入漏洞,优化字典翻译切面逻辑,增强文件上传和下载的安全性,新增音频文件类型支持,改进动态数据源的安全校验。
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
{ source: '${fieldName}', target: '${dashedToCamel(targetFields[fieldName_index])}' },
|
||||
</#list>
|
||||
],
|
||||
props:{
|
||||
multi: ${col.extendParams.popupMulti?c},
|
||||
},
|
||||
<#if col.readonly=='Y'>
|
||||
disabled:true,
|
||||
</#if>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<#return "{type:'${po.fieldDbType}',value:'${po.fieldName}',text:'${po.filedComment}',dictCode:\"${po.dictTable},${po.dictText},${po.dictField}\"}">
|
||||
<#elseif po.dictField?? && po.classType!="sel_tree" && po.classType!="cat_tree" && po.classType!="link_down">
|
||||
<#return "{type:'${po.fieldDbType}',value:'${po.fieldName}',text:'${po.filedComment}',dictCode:'${po.dictField}'}">
|
||||
<#elseif po.fieldDbType=="Text">
|
||||
<#elseif po.fieldDbType=="Text" || po.fieldDbType=="LongText">
|
||||
<#return "{type:'string',value:'${po.fieldName}',text:'${po.filedComment}'}">
|
||||
<#elseif po.fieldDbType=="Blob">
|
||||
<#return "{type:'byte',value:'${po.fieldName}',text:'${po.filedComment}'}">
|
||||
|
||||
@@ -58,7 +58,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
export const saveOrUpdate = (params, isUpdate,showTip = true) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({url: url, params});
|
||||
return defHttp.post({url: url, params},{successMessageMode:showTip?'success':'none'});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled && showSubmitButton">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,9 +24,10 @@
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
showSubmitButton: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
const [registerForm, { setFieldsValue, setProps,validate, scrollToField, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
@@ -52,11 +53,21 @@
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
async function submitForm(showTip = true) {
|
||||
try {
|
||||
let values = await validate();
|
||||
console.log('表单数据', values)
|
||||
//提交表单
|
||||
await saveOrUpdate(values, true,showTip);
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled && showFlowSubmitButton">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,6 +24,7 @@
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
showSubmitButton: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
formBpm: { type: Boolean, default: true },
|
||||
showSubmitButton: { type: Boolean, default: true }
|
||||
});
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
@@ -126,7 +127,7 @@
|
||||
}
|
||||
// 是否显示提交按钮
|
||||
const showFlowSubmitButton = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formBpm === true && props.showSubmitButton === true){
|
||||
if(props.formData.disabled === false){
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import {ref, computed, unref,reactive, onMounted, defineProps } from 'vue';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
@@ -81,7 +80,8 @@
|
||||
|
||||
const props = defineProps({
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
formBpm: { type: Boolean, default: true },
|
||||
showSubmitButton: { type: Boolean, default: true },
|
||||
});
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
@@ -93,7 +93,7 @@
|
||||
});
|
||||
// 是否显示提交按钮
|
||||
const showFlowSubmitButton = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formBpm === true && props.showSubmitButton === true){
|
||||
if(props.formData.disabled === false){
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
import {ref, computed, unref,reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
|
||||
@@ -69,7 +69,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
export const saveOrUpdate = (params, isUpdate,showTip = true) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({url: url, params});
|
||||
return defHttp.post({url: url, params},{ successMessageMode :showTip?'success':'none'});
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
</#list>
|
||||
</a-tabs>
|
||||
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="handleSubmit" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled && showSubmitButton">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -66,6 +66,7 @@
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
showSubmitButton: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps }] = useForm({
|
||||
@@ -81,7 +82,7 @@
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
const showSuccessTip = ref(true);
|
||||
<#assign hasOne2Many = false>
|
||||
<#assign hasOne2One = false>
|
||||
const refKeys = ref([<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>]);
|
||||
@@ -148,10 +149,15 @@
|
||||
})
|
||||
}
|
||||
</#if>
|
||||
//流程表单提交
|
||||
function submitForm(showTip = true) {
|
||||
showSuccessTip.value = showTip?true:false;
|
||||
handleSubmit();
|
||||
}
|
||||
|
||||
//表单提交事件
|
||||
async function requestAddOrEdit(values) {
|
||||
await saveOrUpdate(values, true);
|
||||
await saveOrUpdate(values, true,showSuccessTip.value);
|
||||
}
|
||||
|
||||
const queryByIdUrl = '/${entityPackagePath}/${entityName?uncap_first}/queryById';
|
||||
@@ -181,6 +187,7 @@
|
||||
formDisabled,
|
||||
formRef,
|
||||
handleSubmit,
|
||||
submitForm,
|
||||
activeKey,
|
||||
handleChangeTabs,
|
||||
<#list subTables as sub>
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
import {ref, computed, unref,reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
</#if>
|
||||
</#list>
|
||||
<#if hasOne2manyTable == true>
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
||||
import {<#list subTableColumnsKey as columnsKey><#if columnsKey_index gt 0>, </#if>${columnsKey}</#list>} from '../${entityName}.data';
|
||||
</#if>
|
||||
<#include "/common/form/native/vue3NativeImport.ftl">
|
||||
@@ -124,9 +123,6 @@
|
||||
name: "${entityName}Form",
|
||||
components:{
|
||||
<#include "/common/form/native/vue3NativeComponents.ftl">
|
||||
<#if hasOne2manyTable == true>
|
||||
JVxeTable,
|
||||
</#if>
|
||||
JFormContainer,
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
@@ -140,7 +136,8 @@
|
||||
default: false
|
||||
},
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
formBpm: { type: Boolean, default: true },
|
||||
showSubmitButton: { type: Boolean, default: true },
|
||||
},
|
||||
emits:['success'],
|
||||
setup(props, {emit}) {
|
||||
@@ -229,7 +226,7 @@
|
||||
}
|
||||
// 是否显示提交按钮
|
||||
const showFlowSubmitButton = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formBpm === true && props.showSubmitButton === true){
|
||||
if(props.formData.disabled === false){
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import {ref, computed, unref,reactive, onMounted, defineProps } from 'vue';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
@@ -84,7 +83,8 @@
|
||||
|
||||
const props = defineProps({
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
formBpm: { type: Boolean, default: true },
|
||||
showSubmitButton: { type: Boolean, default: true },
|
||||
});
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
@@ -96,7 +96,7 @@
|
||||
});
|
||||
// 是否显示提交按钮
|
||||
const showFlowSubmitButton = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formBpm === true && props.showSubmitButton === true){
|
||||
if(props.formData.disabled === false){
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
import {ref, computed, unref,reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
|
||||
Reference in New Issue
Block a user