表达式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, type: Number,
// required: true, // required: true,
validator: (val: number) => [1, 2, 3, 4].includes(val), validator: (val: number) => [1, 2, 3, 4].includes(val),
default:4 default:3
} }
}) })
const show = ref(false) const show = ref(false)
const typeMap = { const typeMap = {
1: 'SQEL', // 1: 'SQEL',
2: 'Aviator', 2: 'Aviator',
3: 'QL', 3: '表达式',
4: '表达式' 4: '表达式'
} }
const examples = { const examples = {
1: `# SQEL条件表达式示例\nuser.age > 18 \nAND department == 'IT' \nOR (vipLevel >= 3 AND creditScore > 800)`, 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}`, 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'" ` 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> = { export const expressionRecord: Record<Api.Common.Expression, string> = {
1: 'SpEl', // 1: 'SpEl',
2: 'Aviator', // 2: 'Aviator',
3: 'QL' 3: 'QL'
}; };

View File

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

View File

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

View File

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