表达式up

This commit is contained in:
zhuangdashia 2025-07-07 01:19:34 +08:00
parent 56d52be0ec
commit 165dcf761b
5 changed files with 14 additions and 9 deletions

View File

@ -31,21 +31,21 @@ const props = defineProps({
type: Number,
// required: true,
validator: (val: number) => [1, 2, 3, 4].includes(val),
default:4
default:3
}
})
const show = ref(false)
const typeMap = {
1: 'SQEL',
// 1: 'SQEL',
2: 'Aviator',
3: 'QL',
3: '表达式',
4: '表达式'
}
const examples = {
1: `# SQEL条件表达式示例\nuser.age > 18 \nAND department == 'IT' \nOR (vipLevel >= 3 AND creditScore > 800)`,
3: `// 查询语言示例\nfrom Employee e\nwhere e.salary > 10000\nand e.joinDate > '2020-01-01'\nselect e.name, e.position`,
3: `#时间类型变量\n LocalDateTime.now().plusDays(15)\n .format(DateTimeFormatter\n .ofPattern('yyyy-MM-dd'))\n#系统属性\n System.getenv('JAVA_HOME')`,
2: `## Aviator脚本示例\nlet user = {\n name: '张三',\n vip: true,\n credit: 1500\n};\n\nif(user.vip&&user.credit>1000){\n "尊享VIP服务"\n} else {\n "标准服务"\n}`,
4: `// 状态判断\n"#status == 'SUCCESS'"\n"#taskStatus != 'FAILED'" `
}

View File

@ -159,8 +159,8 @@ export const logicalConditionOptions = transformRecordToNumberOption(logicalCond
/** 表达式类型 */
export const expressionRecord: Record<Api.Common.Expression, string> = {
1: 'SpEl',
2: 'Aviator',
// 1: 'SpEl',
// 2: 'Aviator',
3: 'QL'
};

View File

@ -88,8 +88,9 @@ declare namespace Api {
/** 判定逻辑 1:and 2:or */
type LogicalCondition = 1 | 2;
/** 表达式类型 1:SpEl 2:Aviator 3:QL */
type Expression = 1 | 2 | 3;
/** 表达式类型 1:SpEl 2:Aviator 3:QL 只用ql */
// type Expression = 1 | 2 | 3;
type Expression = 3;
/** 请求类型 1:application/json 2:application/x-www-form-urlencoded */
type ContentType = 1 | 2;

View File

@ -66,6 +66,10 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
title: $t('page.system_variable.variableValue'),
align: 'left',
minWidth: 50,
ellipsis: {
tooltip: true,
contentStyle: { maxWidth: '110px' }
},
},
{
key: 'variableType',

View File

@ -205,7 +205,7 @@ function getPermission(str: string): PermissionModel {
:label="$t(item.label)"
/>
</NSpace>
<example-expression :type=4 />
<example-expression :type=3 />
</NRadioGroup>
<!-- <NPopover trigger="hover"-->
<!-- >-->