场景中心变更

This commit is contained in:
caorui 2025-07-31 10:22:16 +08:00
parent 64cca71663
commit df74cbd87c
6 changed files with 2189 additions and 100 deletions

View File

@ -12,16 +12,16 @@
title="新增账号"
>
<template #addButton>
<el-button type="primary" @click="VerifyAccount">验证账号</el-button>
<el-button type="primary" v-if="!submitShow" @click="VerifyAccount">验证账号</el-button>
</template>
<div class="rightDialogClass_main" style="background: #fff; padding: 10px">
<base-form
style="padding-top: 0 !important"
spanWidth="80px"
ref="customForm"
:formRow="accountFormRow"
:formRow="currentForm"
:isFunBtn="false"
:rules="accountRules"
:rules="currentRules"
alignAt="block"
:span="24"
>
@ -62,6 +62,8 @@ export default {
data() {
return {
dialogVisible: false,
currentForm: [],
currentRules: {},
accountFormRow: [
{
elCol: [
@ -188,26 +190,161 @@ export default {
},
],
},
accountOtherFormRow: [
{
elCol: [
{
label: "账号名称",
prop: "name",
tag: "elInput",
span: 24,
},
],
},
{
elCol: [
{
label: "ip地址",
prop: "ipAddress",
tag: "elInput",
span: 24,
},
],
},
{
elCol: [
{
label: "端口",
prop: "port",
tag: "elInput",
span: 24,
},
],
},
{
elCol: [
{
label: "应用Key",
prop: "appKey",
tag: "elInput",
span: 24,
},
],
},
{
elCol: [
{
label: "应用密钥",
prop: "appSecret",
tag: "elInput",
span: 24,
},
],
},
{
elCol: [
{
label: "企业ID",
prop: "corpid",
tag: "elInput",
span: 24,
},
],
},
{
elCol: [
{
label: "应用ID",
prop: "agentid",
tag: "elInput",
span: 24,
},
],
},
],
accountOtherRules: {
name: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
ipAddress: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
port: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
appKey: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
appSecret: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
corpid: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
agentid: [
{
required: true,
message: "请输入",
trigger: "change, blur",
},
],
},
appID: "",
sceneID: "",
stepID: "",
accountType: "",
submitShow: false, //
message: "",
appType: "",
};
},
methods: {
openDialog(appID, sceneID, stepID) {
this.submitShow = false;
openDialog(appID, sceneID, stepID, appType) {
this.appType = appType;
this.message = "";
this.queryDictionaryList();
this.appID = appID;
this.sceneID = sceneID;
this.stepID = stepID;
this.submitShow = false;
if (appType == "9") {
this.currentForm = this.accountFormRow;
this.currentRules = this.accountRules;
this.queryDictionaryList();
} else {
this.submitShow = true;
this.currentForm = this.accountOtherFormRow;
this.currentRules = this.accountOtherRules;
}
this.$nextTick(() => {
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.customForm?.resetFields("ruleForm");
});
});
},
async queryDictionaryList() {
let params = {
@ -230,6 +367,7 @@ export default {
if (valid) {
let params = {
...this.$refs.customForm.ruleForm,
appType: this.appType,
};
this.verifyDataBase(params);
} else {
@ -257,6 +395,7 @@ export default {
}
},
handleConfirmClick() {
this.openLoading("保存")
this.$refs.customForm.$refs["ruleForm"].validate((valid) => {
if (valid) {
let params = {
@ -265,6 +404,7 @@ export default {
status: 1,
flowId: this.sceneID,
stepId: this.stepID,
appType: this.appType,
};
this.SaveAccountData(params);
} else {

View File

@ -25,7 +25,7 @@
style="background: #fff"
>
<!-- 步骤画布 -->
<div class="drawCanvas" v-show="!representation">
<div class="drawCanvas drawParent" v-show="!representation">
<div
class="drawItem"
v-for="(ele, index) in drawShowList"
@ -120,6 +120,41 @@
<div @click="addDrwaItem" class="drawItem drawItemBtn">
添加新步骤
</div>
<!-- 测试结果展示区 -->
<div class="TestResultDisplayArea" v-if="TestResultDisplayArea">
<div class="testResultBoxTitle">
测试结果输出
<div class="closeTextBox" @click="closeTestResultArea">
<i class="el-icon-close"></i> 关闭
</div>
</div>
<div
class="testSuccessTip"
v-if="jsonTestResultData && jsonTestResultData.flag"
>
<el-alert
title="测试成功"
type="success"
show-icon
:closable="false"
>
</el-alert>
</div>
<div class="testFailTip" v-else>
<el-alert
title="测试失败"
type="error"
:description="jsonTestResultData.msg"
show-icon
:closable="false"
>
</el-alert>
</div>
<div class="jsonTestResultBox" v-if="jsonTestResultData.attribute">
<json-view :data="jsonTestResultData.attribute" />
</div>
</div>
</div>
<!-- 动态内容及其表达式 -->
<div
@ -521,6 +556,7 @@
label-width="80px"
label-position="top"
style="margin-bottom: 10px"
v-if="currentRowData.options.appType == '9'"
>
<el-form-item label="选择表">
<el-select
@ -528,6 +564,7 @@
placeholder="请选择表"
@change="outsideSelectChange"
style="width: 100%"
filterable
>
<el-option
v-for="(el, index) in outsideOptions"
@ -538,9 +575,33 @@
</el-select>
</el-form-item>
</el-form>
<div class="Columnsbtn">
<div class="Columnsbtn" v-if="outsideColumns.length > 0">
<el-button @click="saveTestTableEvent">暂存</el-button>
<el-button @click="hitTesting">点击测试</el-button>
<el-button @click="saveTestTableEvent('hit')"
>点击测试</el-button
>
</div>
<div
v-if="
currentRowData.options &&
currentRowData.options.appType == '9' &&
currentRowData.options.apiName.includes('查询')
"
>
<el-form
ref="pegeForm"
:model="pageFormData"
label-width="80px"
label-position="top"
style="margin-bottom: 10px"
>
<el-form-item label="页码">
<el-input v-model="pageFormData.rowNum"></el-input>
</el-form-item>
<el-form-item label="每页条数">
<el-input v-model="pageFormData.pageLimit"></el-input>
</el-form-item>
</el-form>
</div>
<div class="fixedChildTable">
<!-- 表字段 -->
@ -670,6 +731,7 @@ import addAccount from "./addAccount.vue";
import baseForm from "@/components/base/baseNewForm";
import treeNode from "./TreeNode";
import IconsDialog from "../../tool/build/IconsDialog.vue";
import jsonView from "vue-json-views";
export default {
components: {
editSence,
@ -679,6 +741,7 @@ export default {
baseForm,
treeNode,
IconsDialog,
jsonView,
},
data() {
return {
@ -750,48 +813,23 @@ export default {
representation: false,
selectedNode: "",
representationActiveName: "first",
treeData: {
user: {
id: 1001,
profile: {
name: "李四",
email: "lisi@example.com",
settings: {
theme: "dark",
notifications: {
email: true,
sms: false,
push: true,
},
},
},
permissions: ["read", "write", "admin"],
metadata: {
created_at: "2023-01-15T10:30:00Z",
updated_at: "2024-03-20T15:45:30Z",
version: 2.1,
},
},
config: {
database: {
host: "localhost",
port: 5432,
ssl: false,
},
features: {
experimental: ["ai_assist", "real_time_sync"],
stable: ["user_management", "data_export"],
},
},
},
treeData: {},
currenrActiveNodeRef: "",
lastSelectedTokenIndex: -1,
representationData: representationData,
savedRange: null, // range
TestResultDisplayArea: false, //
jsonTestResultData: {},
pageFormData: {
rowNum: "1",
pageLimit: "100",
},
parameterType: "body", //
};
},
methods: {
async saveTestTableEvent() {
async saveTestTableEvent(type) {
if (!this.outsideFormData.tableName) {
this.$vmNews("请先选择表");
return;
@ -808,7 +846,17 @@ export default {
stepAccountId: data.step_acc_id,
actionName: data.apiName || data.plugName,
tableName: this.outsideFormData.tableName,
appType: this.currentRowData.options.appType,
};
if (
this.currentRowData.options &&
this.currentRowData.options.appType == "9" &&
this.currentRowData.options.apiName.includes("查询")
) {
params.rowNum = this.pageFormData.rowNum;
params.pageLimit = this.pageFormData.pageLimit;
}
let res = await authApi(
"sysFlowStepConfigService",
"",
@ -817,7 +865,11 @@ export default {
params
);
if (res.status == "200") {
this.$vmNews("暂存成功!","success")
if (type == "hit") {
this.hitTesting();
} else {
this.$vmNews("暂存成功!", "success");
}
}
},
extractEditorItems(rootElement) {
@ -850,8 +902,33 @@ export default {
return result;
},
hitTesting(){
async hitTesting() {
if (!this.outsideFormData.tableName) {
this.$vmNews("请先选择表");
return;
}
this.openLoading("测试");
this.representation = false;
let data = this.currentRowData.options;
let params = {
stepID: data.stepID,
tableName: this.outsideFormData.tableName,
};
let res = await authApi(
"sysFlowStepConfigService",
"",
"testSql",
"",
params
);
if (res.status == "200") {
this.TestResultDisplayArea = true;
this.jsonTestResultData = res || {};
}
},
closeTestResultArea() {
this.TestResultDisplayArea = false;
this.jsonTestResultData = {};
},
/**
* 打开弹窗
@ -871,6 +948,10 @@ export default {
this.triggerMode = triggerMode;
//
this.examineOperateDialog = true;
this.representation = false;
this.TestResultDisplayArea = false;
this.jsonTestResultData = {};
this.parameterType = "body";
//
this.sceneLoading = true;
// 5
@ -1088,6 +1169,7 @@ export default {
this.apiIDActiv = "";
this.userActivId = "";
this.CurrentAppRow = {};
if (index === 0) {
this.activeTabName = "选择操作";
} else {
@ -1097,9 +1179,30 @@ export default {
//
await this.getAppList();
//
await this.queryNodeList();
//
await this.GetSceneStepData();
}
},
/**
* 获取场景映射动态关系
*/
async queryNodeList() {
let params = {
flowId: this.sceneID,
stepId: this.currentRowData.options.stepID,
};
let res = await authApi(
"sysFlowStepConfigService",
"",
"queryNodeList",
"",
params
);
if (res.status == "200") {
this.treeData = res.attribute || {};
}
},
/**
* 获取场景步骤数据
*/
@ -1139,6 +1242,8 @@ export default {
this.pluginList = [];
//
this.userList = [];
//
this.outsideColumns = [];
if (this.currentRowData.options.appId) {
// ID
this.appActivIndex = this.currentRowData.options.appId;
@ -1166,6 +1271,10 @@ export default {
if (this.currentRowData.options.apiId) {
// API ID
this.apiIdActiv = this.currentRowData.options.apiId;
//
if (this.currentRowData.options.appType != "9") {
this.queryApiConfig();
}
} else {
// API ID
this.apiIdActiv = "";
@ -1185,8 +1294,10 @@ export default {
//
this.CurrentAppRow.step_acc_name =
this.currentRowData.options.step_acc_name;
if (this.currentRowData.options.appType == "9") {
//
this.queryTables(this.userActivId);
}
} else {
// ID
this.userActivId = "";
@ -1324,15 +1435,11 @@ export default {
* @param {any} value 标签页值
*/
handleOtherTabClick(value) {
console.log(
this.activeOtherTabName,
this.userActivId,
this.outsideFormData.tableName
);
if (
this.activeOtherTabName == "配置应用" &&
this.userActivId &&
this.outsideFormData.tableName
this.outsideFormData.tableName &&
this.currentRowData.options.appType == "9"
) {
this.queryColumns(this.outsideFormData.tableName);
}
@ -1432,6 +1539,8 @@ export default {
this.pluginList = [];
this.userActivId = "";
this.userList = [];
this.jsonTestResultData = {};
this.TestResultDisplayArea = false;
//
this.matchAppData(row);
//
@ -1533,7 +1642,7 @@ export default {
this.activeApiPliginTabName = e;
},
// API
hangleApiClickEvent(item) {
async hangleApiClickEvent(item) {
this.pluginActiv = "";
this.currentRowData.options.plugId = "";
this.currentRowData.options.plugName = "";
@ -1548,7 +1657,11 @@ export default {
//
this.currentRowData.options.actionType = this.activeApiPliginTabName;
//
if (this.userActivId) {
this.activeOtherTabName = "配置应用";
} else {
this.activeOtherTabName = "选择账号";
}
let params = {
flowId: this.sceneID,
id: this.currentRowData.options.stepID,
@ -1559,7 +1672,37 @@ export default {
apiName: item.apiName,
};
//
this.SaveSceneStepData(params);
await this.SaveSceneStepData(params);
//
if (this.currentRowData.options.appType != "9") {
this.queryApiConfig();
}
},
//
async queryApiConfig() {
if (!this.currentRowData.options.apiId) {
return;
}
this.outsideColumns = [];
let params = {
stepId: this.currentRowData.options.stepID, //id
apiId: this.currentRowData.options.apiId,
type: this.parameterType,
};
let res = await authApi(
"sysFlowStepApiConfigService",
"",
"queryApiConfig",
"",
params
);
this.drawMask = false;
if (res.status == "200") {
this.outsideColumns = res.attribute || [];
this.$nextTick(() => {
// this.getStepConfig();
});
}
},
//
hanglePluginClickEvent(item) {
@ -1602,7 +1745,8 @@ export default {
this.$refs.addAccount.openDialog(
this.appActivIndex,
this.sceneID,
this.currentRowData.options.stepID
this.currentRowData.options.stepID,
this.currentRowData.options.appType
);
},
/**
@ -1636,17 +1780,19 @@ export default {
id: this.currentRowData.options.stepID,
step_acc_name: item.name,
step_acc_id: item.id,
tableName: "",
tableName: "-1",
};
//
await this.SaveSceneStepData(params);
//
this.activeOtherTabName = "配置应用";
if (this.currentRowData.options.appType == "9") {
//
await this.queryTables(item.id);
this.$nextTick(() => {
this.resetForm("outsideForm");
});
}
},
/**
* 重置表单
@ -1740,6 +1886,14 @@ export default {
this.matchEditorItems(root, item.fieldName, item.html_label);
});
}
if (
this.currentRowData.options &&
this.currentRowData.options.appType == "9" &&
this.currentRowData.options.apiName.includes("查询")
) {
this.pageFormData.rowNum = res.attribute.rowNum || "1";
this.pageFormData.pageLimit = res.attribute.pageLimit || "100";
}
}
},
matchEditorItems(rootElement, rootName, rootHtml) {
@ -1838,7 +1992,7 @@ export default {
editSceneName() {
//
let row = {
flowId: this.sceneID,
id: this.sceneID,
};
// DOM
this.$nextTick(() => {
@ -1905,6 +2059,12 @@ export default {
//
this.userList = [];
this.representation = false;
this.TestResultDisplayArea = false;
//
this.pageFormData = {
rowNum: "1",
pageLimit: "100",
};
},
representationChange() {
if (!this.currenrActiveNodeRef) return;
@ -1965,20 +2125,8 @@ export default {
handleEditorClick(e, columnName, rowIndex) {
const editor = this.$refs["contentEditor" + columnName + rowIndex][0];
this.currenrActiveNodeRef = "contentEditor" + columnName + rowIndex;
// // token
// if (
// !e.target.classList.contains("content-token") &&
// !e.target.closest(".content-token")
// ) {
// this.clearTokenSelection(columnName, rowIndex);
// }
// //
// if (e.target === editor || editor.contains(e.target)) {
editor.focus();
this.saveRange();
// }
},
//
handlePaste(e, columnName, rowIndex) {
@ -2042,6 +2190,7 @@ export default {
let nodeRef = "contentEditor" + columnName + rowIndex;
this.currenrActiveNodeRef = nodeRef;
this.representation = true;
this.TestResultDisplayArea = false;
this.representationActiveName = "first";
// span
@ -2957,6 +3106,7 @@ export default {
::v-deep .el-collapse-item__header {
padding-left: 10px !important;
}
// ------------------------
.editor-container {
flex: 1;
@ -3113,6 +3263,47 @@ export default {
height: calc(100vh - 360px);
overflow: auto;
}
.drawParent {
position: relative;
}
.TestResultDisplayArea {
width: 400px;
height: calc(100% - 10px);
position: absolute;
right: 10px;
top: 5px;
background-color: #fff;
box-sizing: border-box;
box-shadow: 0 0 8px #0000001a;
border-radius: 4px;
z-index: 100;
overflow: hidden;
}
.testResultBoxTitle {
display: flex;
padding: 15px 10px;
background: #333333;
font-size: 14px;
font-weight: bold;
color: #fff;
justify-content: space-between;
border-radius: 4px 4px 0 0;
.closeTextBox {
cursor: pointer;
}
}
.jsonTestResultBox {
height: calc(100% - 90px);
overflow: auto;
}
::v-deep .el-alert {
padding: 10px !important;
}
</style>

View File

@ -170,8 +170,8 @@ export default {
params
);
if (res.status == "200") {
this.$refs.senceForm.choiceAssignment(res.data[0]);
this.triggerModeId = res.data[0].triggerMode;
this.$refs.senceForm.choiceAssignment(res.attribute[0]);
this.triggerModeId = res.attribute[0].triggerMode;
}
},
choseType(row) {

View File

@ -44,23 +44,17 @@
</div>
</div>
</base-dialog>
<!-- <addDialogChunk
ref="addDialogChunk"
@examineHandleClose="examineHandleClose"
></addDialogChunk> -->
</div>
</template>
<script>
import baseDialog from "@/components/base/BaseNewDialog/index.vue";
// import addDialogChunk from "./addDialogChunk";
import { authApi } from "@/api/apis/auth";
import baseForm from "@/components/base/baseNewForm";
export default {
components: {
baseDialog,
baseForm,
// addDialogChunk,
},
data() {
return {
@ -75,6 +69,7 @@ export default {
options: [],
optionValue: "id",
optionLabel: "name",
disabled:true
},
],
},
@ -169,8 +164,8 @@ export default {
params
);
if (res.status == "200") {
this.$refs.senceForm.choiceAssignment(res.data[0]);
this.triggerModeId = res.data[0].triggerMode;
this.$refs.senceForm.choiceAssignment(res.attribute[0]);
this.triggerModeId = res.attribute[0].triggerMode;
}
},
handleConfirmClick() {

File diff suppressed because it is too large Load Diff

View File

@ -358,6 +358,10 @@
ref="addDialogChunk"
@examineHandleClose="resetTable"
></addDialogChunk>
<viewDialogChunk
ref="viewDialogChunk"
@examineHandleClose="resetTable"
></viewDialogChunk>
</div>
</template>
@ -372,6 +376,7 @@ import addSence from "@/views/LinkUp/compoment/addSence.vue";
import projectClassificationRightDialog from "@/views/projectClassification/rightDialog.vue";
import authorizationDialog from "@/views/projectClassification/authorizationDialog.vue";
import addDialogChunk from "./compoment/addDialogChunk.vue";
import viewDialogChunk from "./compoment/viewDialogChunk.vue";
export default {
components: {
baseLayout,
@ -381,6 +386,7 @@ export default {
projectClassificationRightDialog,
authorizationDialog,
addDialogChunk,
viewDialogChunk
},
data() {
return {
@ -524,17 +530,9 @@ export default {
//
getFuncBtn(btnEven) {
if (btnEven.menuName == "新增") {
// this.$refs.addDialogChunk.openDialog(
// "-4252471217359269890",
// "3-33003",
// "add",
// 3
// );
this.$refs.addSence.openDialog("", "add", this.projectClassificationID);
}
},
//hyt 2024/08/14
onFixedBtn(flag) {
this.$refs.layoutNew.pageClear();
this.pageModel.page = 1;