场景中心增加 动态配置表结构、字段命令
This commit is contained in:
parent
eb5b81eebf
commit
66427493fc
|
@ -30,7 +30,7 @@ const whiteList = [
|
|||
router.beforeEach((to, from, next) => {
|
||||
let reloaded = sessionStorage.getItem('reloaded')
|
||||
//网站第一次进来逻辑 当from为空
|
||||
if (from.path === '/' && !reloaded && isFirst) {
|
||||
if (from.path === '/' && !reloaded && isFirst && !whiteList.includes(to.path)) {
|
||||
isFirst = false
|
||||
setMenuNode("/index");
|
||||
store.commit("SET_CURRENT_MENU_NODE", "/index");
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<div style=" margin-right: 10px;">
|
||||
<div
|
||||
:class="{
|
||||
'tree-node': true,
|
||||
expandable: isObject,
|
||||
leaf: !isObject,
|
||||
selected: isSelected,
|
||||
}"
|
||||
@click="isObject ? toggleExpand() : selectNode()"
|
||||
>
|
||||
<div v-if="isObject" class="tree-expand-icon" :class="{ expanded }">
|
||||
<i class="el-icon-caret-right"></i>
|
||||
</div>
|
||||
<div v-else class="tree-expand-icon">
|
||||
<i class="el-icon-caret-bottom" style="font-size: 6px; color: #94a3b8"></i>
|
||||
</div>
|
||||
<span>{{ nodeKey }}</span>
|
||||
<el-tag v-if="!isObject" size="small" style="margin-left: 8px">
|
||||
{{ nodeValue }}
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
<div v-if="isObject && expanded" style="margin-left: 20px">
|
||||
<tree-node
|
||||
v-for="(value, key) in nodeValue"
|
||||
:key="key"
|
||||
:node-key="key"
|
||||
:node-value="value"
|
||||
:path="path + '.' + key"
|
||||
:selected-node="selectedNode"
|
||||
@node-selected="handleNodeSelected"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TreeNode",
|
||||
props: {
|
||||
nodeKey: [String,Number],
|
||||
nodeValue: [Object, String, Number, Boolean, Array, null],
|
||||
path: String,
|
||||
selectedNode: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
expanded: this.path && !this.path.includes("."),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isObject() {
|
||||
return typeof this.nodeValue === "object" && this.nodeValue !== null;
|
||||
},
|
||||
isSelected() {
|
||||
return this.selectedNode === this.path;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleExpand() {
|
||||
if (this.isObject) {
|
||||
this.expanded = !this.expanded;
|
||||
}
|
||||
},
|
||||
selectNode() {
|
||||
if (!this.isObject) {
|
||||
this.$emit("node-selected", this.path);
|
||||
}
|
||||
},
|
||||
handleNodeSelected(path) {
|
||||
this.$emit("node-selected", path);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 原样式类名保持不变,这里你可以加你自己的样式,或者留空 */
|
||||
.tree-container {
|
||||
padding: 16px;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
margin: 2px 0;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
user-select: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tree-node:hover {
|
||||
background: #f0f9ff;
|
||||
color: #0ea5e9;
|
||||
}
|
||||
|
||||
.tree-node.selected {
|
||||
background: #dbeafe;
|
||||
color: #0284c7;
|
||||
border: 1px solid #93c5fd;
|
||||
}
|
||||
|
||||
.tree-node.expandable {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tree-node.leaf {
|
||||
margin-left: 20px;
|
||||
font-size: 14px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.tree-expand-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.tree-expand-icon.expanded {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
</style>
|
|
@ -7,14 +7,17 @@
|
|||
:appendBody="true"
|
||||
:loading="true"
|
||||
:footerShow="true"
|
||||
:submitShow="true"
|
||||
:submitShow="submitShow"
|
||||
:submitTitle="'保存'"
|
||||
title="新增应用账号授权"
|
||||
title="新增账号"
|
||||
>
|
||||
<template #addButton>
|
||||
<el-button type="primary" @click="VerifyAccount">验证账号</el-button>
|
||||
</template>
|
||||
<div class="rightDialogClass_main" style="background: #fff; padding: 10px">
|
||||
<base-form
|
||||
style="padding-top: 0 !important"
|
||||
spanWidth="130px"
|
||||
spanWidth="80px"
|
||||
ref="customForm"
|
||||
:formRow="accountFormRow"
|
||||
:isFunBtn="false"
|
||||
|
@ -23,6 +26,26 @@
|
|||
:span="24"
|
||||
>
|
||||
</base-form>
|
||||
<div class="custom-error-box" v-if="!submitShow && message">
|
||||
<el-alert
|
||||
title="验证失败"
|
||||
type="error"
|
||||
show-icon
|
||||
:closable="false"
|
||||
:description="message"
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="custom-error-box" v-if="submitShow && message">
|
||||
<el-alert
|
||||
title="验证成功"
|
||||
type="success"
|
||||
show-icon
|
||||
:closable="false"
|
||||
:description="message"
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
</div>
|
||||
</base-right-dialog>
|
||||
</template>
|
||||
|
@ -166,13 +189,21 @@ export default {
|
|||
],
|
||||
},
|
||||
appID: "",
|
||||
sceneID: "",
|
||||
stepID: "",
|
||||
accountType: "",
|
||||
submitShow: false, //是否显示查看按钮
|
||||
message: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
openDialog(appID) {
|
||||
openDialog(appID, sceneID, stepID) {
|
||||
this.submitShow = false;
|
||||
this.message = "";
|
||||
this.queryDictionaryList();
|
||||
this.appID = appID;
|
||||
this.sceneID = sceneID;
|
||||
this.stepID = stepID;
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.customForm?.resetFields("ruleForm");
|
||||
|
@ -194,12 +225,46 @@ export default {
|
|||
this.accountFormRow[3].elCol[0].options = res.attribute;
|
||||
}
|
||||
},
|
||||
VerifyAccount() {
|
||||
this.$refs.customForm.$refs["ruleForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
let params = {
|
||||
...this.$refs.customForm.ruleForm,
|
||||
};
|
||||
this.verifyDataBase(params);
|
||||
} else {
|
||||
this.$message({ message: "请选择必填项", type: "warning" });
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
async verifyDataBase(params) {
|
||||
this.openLoading("验证");
|
||||
let res = await authApi(
|
||||
"sysFlowStepAccountService",
|
||||
"",
|
||||
"verifyDataBase",
|
||||
"",
|
||||
params
|
||||
);
|
||||
if (res.status == "200") {
|
||||
this.message = res.attribute.msg || "";
|
||||
if (res.attribute.flag == true) {
|
||||
this.submitShow = true;
|
||||
} else {
|
||||
this.submitShow = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirmClick() {
|
||||
this.$refs.customForm.$refs["ruleForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
let params = {
|
||||
...this.$refs.customForm.ruleForm,
|
||||
appId: this.appID,
|
||||
status: 1,
|
||||
flowId: this.sceneID,
|
||||
stepId: this.stepID,
|
||||
};
|
||||
this.SaveAccountData(params);
|
||||
} else {
|
||||
|
@ -211,7 +276,7 @@ export default {
|
|||
|
||||
async SaveAccountData(params) {
|
||||
let res = await authApi(
|
||||
"sysApplicationAccountService",
|
||||
"sysFlowStepAccountService",
|
||||
"",
|
||||
"saveAccount",
|
||||
"",
|
||||
|
@ -238,4 +303,14 @@ export default {
|
|||
::v-deep .label {
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
::v-deep .custom-error-box .el-alert {
|
||||
padding: 15px 16px !important;
|
||||
}
|
||||
::v-deep .custom-error-box .el-alert__title {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
::v-deep .custom-error-box .el-alert__description {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
|
@ -8,26 +8,178 @@ var stepAdd = { icon: '', title: '触发条件', actionName: '平台触发配置
|
|||
var stepUse = { icon: '', title: '执行操作', actionName: '请选择执行操作', content: '请选择动作', }
|
||||
|
||||
var timeDivide = [
|
||||
{
|
||||
id: 1,
|
||||
title: "秒级",
|
||||
content: "用户可使用 cron 表达式自定义时间执行",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "分钟级",
|
||||
content: "用户可使用 cron 表达式自定义时间执行",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "小时级",
|
||||
content: "按设定的周期时间开始执行,如每月 x 执行一次",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "天级",
|
||||
content: "按设定的时间间隔开始执行,如间隔 x 小时执行一次",
|
||||
},
|
||||
]
|
||||
{
|
||||
id: 1,
|
||||
title: "秒级",
|
||||
content: "用户可使用 cron 表达式自定义时间执行",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "分钟级",
|
||||
content: "用户可使用 cron 表达式自定义时间执行",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "小时级",
|
||||
content: "按设定的周期时间开始执行,如每月 x 执行一次",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "天级",
|
||||
content: "按设定的时间间隔开始执行,如间隔 x 小时执行一次",
|
||||
},
|
||||
]
|
||||
var representationData = [
|
||||
{
|
||||
id: 1,
|
||||
label: "字符串函数",
|
||||
children: [
|
||||
{
|
||||
label: "concat",
|
||||
value: "将任意数量的字符串拼接到一起",
|
||||
},
|
||||
{
|
||||
label: "replaceFirst",
|
||||
value: "用给定的字符串替换字符串中的第一个",
|
||||
},
|
||||
{
|
||||
label: "replaceAll",
|
||||
value: "用给定的字符串替换字符串中所有匹配上的字符串",
|
||||
},
|
||||
{
|
||||
label: "format",
|
||||
value: "使用指定的格式字符串和参数返回一个格式化字符串",
|
||||
},
|
||||
{
|
||||
label: "startsWith",
|
||||
value: "判断字符串是否是以指定的字符串开始",
|
||||
},
|
||||
{
|
||||
label: "endsWith",
|
||||
value: "判断字符串是否是以指定的字符串结束",
|
||||
},
|
||||
{
|
||||
label: "equals",
|
||||
value: "判断两个字符串是否相等",
|
||||
},
|
||||
{
|
||||
label: "equalsIgnoreCase",
|
||||
value: "判断两个字符串是否相等(忽略大小写)",
|
||||
},
|
||||
{
|
||||
label: "contains",
|
||||
value: "判断字符串是否包含指定的字符串",
|
||||
},
|
||||
{
|
||||
label: "indexOf",
|
||||
value: "查询指定字符串在字符串中的第一次出现的位置",
|
||||
},
|
||||
{
|
||||
label: "substring",
|
||||
value: "截取指定位置字符串,end不指定时表示到字符串末尾,从0开始",
|
||||
},
|
||||
{
|
||||
label: "split",
|
||||
value: "按分割符分割字符串",
|
||||
},
|
||||
{
|
||||
label: "md5",
|
||||
value: "MD5加密",
|
||||
},
|
||||
{
|
||||
label: "upperCase",
|
||||
value: "英文字符串转大写",
|
||||
},
|
||||
{
|
||||
label: "lowerCase",
|
||||
value: "英文字符串转小写",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "JSON函数",
|
||||
children: [
|
||||
{
|
||||
label: "toString",
|
||||
value: "将JSON转化为字符串输出",
|
||||
},
|
||||
{
|
||||
label: "parseObject",
|
||||
value: "将字符串转化为JSON输出",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: "数学计算",
|
||||
children: [
|
||||
{
|
||||
label: "add",
|
||||
value: "计算两个数据的和",
|
||||
},
|
||||
{
|
||||
label: "addWithScale",
|
||||
value: "计算两个数据的和(指定精度)",
|
||||
},
|
||||
{
|
||||
label: "subtract",
|
||||
value: "计算两个数据的差",
|
||||
},
|
||||
{
|
||||
label: "subtractWithScale",
|
||||
value: "计算两个数据的差(指定精度)",
|
||||
},
|
||||
{
|
||||
label: "multiply",
|
||||
value: "计算两个数据的积",
|
||||
},
|
||||
{
|
||||
label: "multiplyWithScale",
|
||||
value: "计算两个数据的积(指定精度)",
|
||||
},
|
||||
{
|
||||
label: "divide",
|
||||
value: "计算两个数据的商",
|
||||
},
|
||||
{
|
||||
label: "divideWithScale",
|
||||
value: "计算两个数据的商(指定精度)",
|
||||
},
|
||||
{
|
||||
label: "modly",
|
||||
value: "取两个数据的余数",
|
||||
},
|
||||
{
|
||||
label: "abs",
|
||||
value: "计算数据绝对值",
|
||||
},
|
||||
{
|
||||
label: "greaterThan",
|
||||
value: "判断数据1是否大于数据2",
|
||||
},
|
||||
{
|
||||
label: "greaterThanOrEqual",
|
||||
value: "判断数据1是否大于等于数据2",
|
||||
},
|
||||
{
|
||||
label: "lessThan",
|
||||
value: "判断数据1是否小于数据2",
|
||||
},
|
||||
{
|
||||
label: "lessThanOrEqual",
|
||||
value: "判断数据1是否小于等于数据2",
|
||||
},
|
||||
{
|
||||
label: "equals",
|
||||
value: "判断数据1是否等于数据2",
|
||||
},
|
||||
{
|
||||
label: "notEqual",
|
||||
value: "判断数据1是否不等于数据2",
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
export { tabListDisposition, tabListAction, stepAdd, stepUse, timeDivide }
|
||||
export { tabListDisposition, tabListAction, stepAdd, stepUse, timeDivide,representationData }
|
||||
|
|
Loading…
Reference in New Issue