Parcourir la Source

fixed: 修改流程编排详情bug

liuyang 2 ans auparavant
Parent
commit
8337834a6b

+ 10 - 1
src/api/flow.ts

@ -229,7 +229,8 @@ export function getServiceDetail(data: any) {
229 229
export const otherApi = {
230 230
  getSqlList: '/ipu/sqlMgmt/sql',
231 231
  downloadTemplate: 'ipu/file/databusTemplate/download',
232
  getSystemConfig: 'ipu/config/value'
232
  getSystemConfig: 'ipu/config/value',
233
  getModelList: 'ipu/modelMgmt/model'
233 234
};
234 235
235 236
// 获取接口详情
@ -250,3 +251,11 @@ export function getSystemConfig() {
250 251
    url: otherApi.getSystemConfig
251 252
  });
252 253
}
254
255
// 查询模型列表
256
// http://127.0.0.1:8080/ipu/modelMgmt/model
257
export function getModelListApi() {
258
  return AIotRequest.get({
259
    url: otherApi.getModelList
260
  });
261
}

+ 2 - 1
src/views/_components/_flow/Index.vue

@ -584,7 +584,8 @@ export default {
584 584
    .flow-content {
585 585
      position: relative;
586 586
      height: calc(100vh - 172px);
587
      width: calc(100vw - 584px);
587
      // width: calc(100vw - 584px);
588
      width: 100%;
588 589
      overflow: hidden;
589 590
      .tool-control {
590 591
        position: absolute;

+ 18 - 24
src/views/_components/panel/PanelGlobal.vue

@ -62,7 +62,8 @@
62 62
      </el-tab-pane>
63 63
64 64
      <el-tab-pane label="模型声明" name="models">
65
        <el-button type="success" @click.stop="importModel">引入</el-button>
65
        <!-- <el-button type="success" @click.stop="importModel">引入</el-button> -->
66
        <common-select v-model="curModel" :options="modelInfo"></common-select>
66 67
      </el-tab-pane>
67 68
    </el-tabs>
68 69
@ -140,6 +141,7 @@ import ImportModel from './global/ImportModel.vue';
140 141
import CustomDetailList from './global/CustomDetailList.vue';
141 142
import CustomDetail from './global/CustomDetail.vue';
142 143
import CustomImport from './global/CustomImport.vue';
144
import { getModelListApi } from '../../../api/flow';
143 145
144 146
const activeName = ref('customAttrs');
145 147
const route = useRoute();
@ -421,29 +423,6 @@ const btns = [
421 423
422 424
// 自定义属性表格操作
423 425
function customAttrFn() {
424
  // if (attrInfo.value.type === 'add') {
425
  //   table.value.customAttrs.data.unshift(attrInfo.value.formData);
426
  //   attrInfo.value = {
427
  //     type: 'add',
428
  //     formData: JSON.parse(JSON.stringify(initFormData))
429
  //   };
430
  // } else if (attrInfo.value.type === 'edit') {
431
  //   table.value.customAttrs.data.map((item) => {
432
  //     if (item.id === attrInfo.value.formData.id) {
433
  //       item = attrInfo.value.formData;
434
  //     }
435
  //     return item;
436
  //   });
437
438
  // const newData = [...data, ...table.value.customAttrs.data];
439
  // newData.filter(
440
  //   (item, index) => newData.findIndex((t) => t.id === item.id) === index
441
  // );
442
  // table.value.customAttrs.data = newData;
443
  // table.value.customAttrs.data.map((item) => {
444
  //   item.actions = btns;
445
  //   return item;
446
  // });
447 426
  const data = customDetail.value.attrList;
448 427
  data.forEach((item) => {
449 428
    if (!table.value.customAttrs.data.some((el) => el.id === item.id)) {
@ -458,6 +437,21 @@ function handleClickImport() {
458 437
  isShowPanel.value = true;
459 438
  dialogType.value = 'fileImport';
460 439
}
440
441
/**
442
 * 模型声明 start
443
 */
444
// 获取模型列表
445
const modelList = ref([]);
446
function getModelList() {
447
  getModelListApi().then((res) => {
448
    modelList.value = res;
449
  });
450
}
451
getModelList();
452
/**
453
 * 模型声明 end
454
 */
461 455
</script>
462 456
463 457
<script>

+ 2 - 2
src/views/_components/right-panel/PanelBranch.vue

@ -28,8 +28,8 @@ const props = defineProps({
28 28
});
29 29
const tabList = ref<any>([
30 30
  { name: 'input', label: '输入' },
31
  { name: 'function', label: '功能' },
32
  { name: 'output', label: '输出' }
31
  { name: 'function', label: '功能' }
32
  // { name: 'output', label: '输出' }
33 33
]);
34 34
35 35
const nodePanelData = <any>props.targetNode.cell.getData()?.attrsData || null;

+ 1 - 1
src/views/_components/right-panel/PanelSql.vue

@ -142,8 +142,8 @@ function getList() {
142 142
143 143
// 功能模块
144 144
const tabList = ref<any>([
145
  { name: 'input', label: '输入' },
146 145
  { name: 'function', label: '功能' },
146
  { name: 'input', label: '输入' },
147 147
  { name: 'output', label: '输出' }
148 148
]);
149 149

+ 31 - 15
src/views/_components/right-panel/PanelSubFlow.vue

@ -18,14 +18,23 @@
18 18
            ></common-select>
19 19
          </div>
20 20
          <div class="form-item">
21
            <div class="form-title">
22
              <h5>入参映射</h5>
23
            </div>
24
          </div>
25
          <div class="form-item">
26
            <div class="form-title">
27
              <h5>出参映射</h5>
28
            </div>
21
            <!-- <el-button @click="paramsMapping">参数映射</el-button> -->
22
            <el-collapse v-model="activeNames">
23
              <el-collapse-item title="入参映射" name="input">
24
                <common-table
25
                  row-key="uuid"
26
                  :table-header="tableHeader"
27
                  :table-data="functionData.inputNodes || []"
28
                ></common-table>
29
              </el-collapse-item>
30
              <el-collapse-item title="出参映射" name="output">
31
                <common-table
32
                  row-key="uuid"
33
                  :table-header="tableHeader"
34
                  :table-data="functionData.outputNodes || []"
35
                ></common-table>
36
              </el-collapse-item>
37
            </el-collapse>
29 38
          </div>
30 39
        </div>
31 40
      </template>
@ -39,19 +48,24 @@ import PanelNodeLayout from './_components/PanelNodeLayout.vue';
39 48
import { getSubFlowList, getSubFlowDetailById } from '../../../api/subflow';
40 49
41 50
const { proxy } = getCurrentInstance();
42
51
const activeNames = ref<any>(['input', 'output']);
43 52
const subFlowDetail = ref<any>(null);
53
// const inputNodes = ref([]);
54
// const outputNodes = ref([]);
44 55
const props = defineProps({
45 56
  targetNode: {
46 57
    type: Object,
47 58
    default: () => {}
48 59
  }
49 60
});
50
const tabList = ref<any>([
51
  { name: 'input', label: '输入' },
52
  { name: 'function', label: '功能' },
53
  { name: 'output', label: '输出' }
61
const tableHeader: any = ref([
62
  { name: 'id', label: 'ID' },
63
  { name: 'name', label: '名称' },
64
  { name: 'type', label: '类型' },
65
  { name: 'alias', label: '别名', type: 'input' },
66
  { name: '', label: '' }
54 67
]);
68
const tabList = ref<any>([{ name: 'function', label: '功能' }]);
55 69
const subflowList = ref([]);
56 70
const propsMap = ref({
57 71
  label: 'name',
@ -62,8 +76,8 @@ const nodePanelData = <any>props.targetNode.cell.getData()?.attrsData || null;
62 76
const functionData = ref<any>(
63 77
  nodePanelData?.function || {
64 78
    subflowId: '',
65
    input: [],
66
    output: []
79
    inputNodes: [],
80
    outputNodes: []
67 81
  }
68 82
);
69 83
// 获取子流程列表
@ -99,6 +113,8 @@ function handleSelect(val: any) {
99 113
      console.log(res);
100 114
      if (res.resultCode === '0') {
101 115
        subFlowDetail.value = res.result;
116
        functionData.value.inputNodes = subFlowDetail.value.inputNodes;
117
        functionData.value.outputNodes = subFlowDetail.value.outputNodes;
102 118
      } else {
103 119
        proxy.$message.error(res.resultMsg);
104 120
      }

+ 8 - 6
src/views/_components/right-panel/_components/PanelDataAssembly.vue

@ -60,8 +60,8 @@
60 60
      </div>
61 61
62 62
      <div class="__down">
63
        <h5>后台jsonpath</h5>
64
        <div class="attr-content">
63
        <h5 v-if="isJsonPath">后台jsonpath</h5>
64
        <div v-if="isJsonPath" class="attr-content">
65 65
          <JsonEditor
66 66
            v-model="jsonpathData"
67 67
            class="editor"
@ -144,7 +144,7 @@ const route = useRoute();
144 144
const systemId = route.query.id;
145 145
const panelGlobal = JSON.parse(localStorage.getItem('panelGlobal'));
146 146
const dataBus = panelGlobal?.[`${systemId}`];
147
const customAttrs = ref<any>(dataBus?.customAttrs?.data || []);
147
const customAttrs: any = ref(dataBus?.customAttrs?.data || []);
148 148
149 149
const props = defineProps({
150 150
  dataSource: {
@ -157,7 +157,7 @@ const props = defineProps({
157 157
  }
158 158
});
159 159
// 源数据
160
const tagList = ref<any>([
160
const tagList: any = ref([
161 161
  { label: '对象', color: '#ff956f', type: 'object', tags: [] },
162 162
  { label: '数组', color: '#ffb95b', type: 'array', tags: [] },
163 163
  { label: '字符串', color: '#31cf9a', type: 'string', tags: [] },
@ -168,7 +168,7 @@ const tagList = ref<any>([
168 168
  { label: '日期', color: '#c084fc', type: 'date', tags: [] },
169 169
  { label: '时间', color: '#f471b7', type: 'datetime', tags: [] }
170 170
]);
171
const treeData = ref<any>([...props.dataSource] || []);
171
const treeData: any = ref([...props.dataSource] || []);
172 172
const jsonData = ref<any>({});
173 173
const jsonpathData = ref<any>({});
174 174
@ -505,7 +505,9 @@ defineExpose({
505 505
onMounted(() => {
506 506
  if (treeData.value?.length) {
507 507
    jsonData.value = tree2json(treeData.value, 'object');
508
    jsonpathData.value = tree2Jsonpath(treeData.value);
508
    if (props.isJsonPath) {
509
      jsonpathData.value = tree2Jsonpath(treeData.value);
510
    }
509 511
  } else {
510 512
    currentNode.value = {};
511 513
  }

+ 653 - 0
src/views/_components/right-panel/_components/PanelDataMapping.vue

@ -0,0 +1,653 @@
1
<!-- 
2
  数据转换组件
3
-->
4
<template>
5
  <div class="__data-conversion">
6
    <!--左树-->
7
    <div class="__left">
8
      <div class="__up">
9
        <h5 class="title">
10
          <span>属性树形结构</span>
11
        </h5>
12
        <div class="tree-content">
13
          <el-tree
14
            ref="myTree"
15
            :allow-drop="allowDrop"
16
            :data="treeData"
17
            :expand-on-click-node="false"
18
            highlight-current
19
            draggable
20
            :default-expanded-keys="currentNodes"
21
            :default-expand-all="defaultExpandAll"
22
            node-key="uuid"
23
            @node-click="getCurrentNode"
24
            @node-contextmenu="cancelCurrent"
25
          >
26
            <template #default="{ data }">
27
              <div class="tree-item">
28
                <span class="label">{{ data.name }}</span>
29
                <span class="type">
30
                  {{ data.code }}
31
                </span>
32
                <span class="type" :class="`${data.type}-color`">
33
                  {{ data.type }}
34
                </span>
35
                <!-- <el-input
36
                  v-model="data.alias"
37
                  class="tree-int"
38
                  size="small"
39
                  @click.stop
40
                ></el-input> -->
41
                <span class="type">{{ data.alias }}</span>
42
              </div>
43
            </template>
44
          </el-tree>
45
        </div>
46
      </div>
47
48
      <div class="__down">
49
        <!-- <h5>后台jsonpath</h5>
50
        <div class="attr-content">
51
          <JsonEditor
52
            v-model="jsonpathData"
53
            class="editor"
54
            current-mode="code"
55
            :mode-list="['code']"
56
            @blur="validate"
57
          ></JsonEditor>
58
        </div> -->
59
        <h5 class="title">属性内容</h5>
60
        <div class="attr-content">
61
          <JsonEditor
62
            v-model="jsonData"
63
            class="editor"
64
            current-mode="code"
65
            :mode-list="['code']"
66
            @blur="validate"
67
          ></JsonEditor>
68
        </div>
69
      </div>
70
    </div>
71
    <!--右列表-->
72
    <div class="__right">
73
      <h5 class="title">
74
        <span>数据总线</span>
75
        <el-button size="small" type="primary" @click.stop="quickCreate">
76
          快速创建
77
        </el-button>
78
      </h5>
79
      <ul class="tag-list">
80
        <li v-for="(item, index) in tagList" :key="index">
81
          <h5 class="tag-title">
82
            <span class="dian" :style="{ background: item.color }"></span>
83
            <span>{{ item.label }}</span>
84
          </h5>
85
          <div class="tag-content">
86
            <template v-for="(tag, tagIndex) in item.tags" :key="tagIndex">
87
              <span
88
                class="tag"
89
                :class="`${tag?.['type']}-color`"
90
                @click.stop="handleClickTag(tag)"
91
              >
92
                {{ tag.name }}
93
              </span>
94
            </template>
95
          </div>
96
        </li>
97
      </ul>
98
    </div>
99
  </div>
100
101
  <common-dialog
102
    v-if="showAttrDialog"
103
    title="新增自定义属性"
104
    @close-dialog="closeDialog"
105
    @confirm-dialog="confirmDialog"
106
  >
107
    <!-- 自定义属性 -->
108
    <CustomDetail ref="customDetail" :attr-info="attrInfo"></CustomDetail>
109
  </common-dialog>
110
</template>
111
112
<script setup lang="ts">
113
import {
114
  ref,
115
  watch,
116
  nextTick,
117
  defineProps,
118
  onMounted,
119
  getCurrentInstance
120
} from 'vue';
121
import JsonEditor from 'json-editor-vue3';
122
import { useRoute } from 'vue-router';
123
import CustomDetail from '../../panel/global/CustomDetail.vue';
124
125
const { proxy } = getCurrentInstance();
126
127
const route = useRoute();
128
const defaultExpandAll = ref<any>(true);
129
130
const systemId = route.query.id;
131
const panelGlobal = JSON.parse(localStorage.getItem('panelGlobal'));
132
const dataBus = panelGlobal?.[`${systemId}`];
133
const customAttrs = ref<any>(dataBus?.customAttrs?.data || []);
134
135
const props = defineProps({
136
  dataSource: {
137
    type: Array,
138
    default: () => []
139
  },
140
  isJsonPath: {
141
    type: Boolean,
142
    default: () => false
143
  }
144
});
145
// 源数据
146
const tagList = ref<any>([
147
  { label: '对象', color: '#ff956f', type: 'object', tags: [] },
148
  { label: '数组', color: '#ffb95b', type: 'array', tags: [] },
149
  { label: '字符串', color: '#31cf9a', type: 'string', tags: [] },
150
  { label: '整数', color: '#169bfa', type: 'int', tags: [] },
151
  { label: '布尔类型', color: '#ff956f', type: 'boolean', tags: [] },
152
  { label: '长整数', color: '#ff5f5f', type: 'long', tags: [] },
153
  { label: '小数', color: '#21c5db', type: 'decimal', tags: [] },
154
  { label: '日期', color: '#c084fc', type: 'date', tags: [] },
155
  { label: '时间', color: '#f471b7', type: 'datetime', tags: [] }
156
]);
157
const treeData = ref<any>([...props.dataSource] || []);
158
const jsonData = ref<any>({});
159
const jsonpathData = ref<any>({});
160
161
const currentNode = ref<any>({});
162
const myTree = ref<any>(null);
163
164
// 源数据处理
165
function formateSourceData(data: any) {
166
  tagList.value.map((item: any) => {
167
    data.forEach((tag: any) => {
168
      if (tag.type === item.type) {
169
        tag.alias = '';
170
        if (!item.tags.some((el: any) => el.id === tag.id)) {
171
          item.tags.push(tag);
172
        }
173
      }
174
    });
175
    return item;
176
  });
177
}
178
179
formateSourceData(customAttrs.value);
180
/**
181
 * el-tree拖拽start
182
 */
183
184
// 是否可被插入
185
const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
186
  console.log(draggingNode);
187
  if (type === 'inner') {
188
    if (dropNode.data.type === 'object' || dropNode.data.type === 'array') {
189
      return true;
190
    }
191
    return false;
192
  }
193
  // 被进入的节点如果是object或者array时,允许被传入,否则禁止拖进
194
195
  return true;
196
};
197
198
// 获取当前节点
199
function getCurrentNode(node: any) {
200
  if (currentNode.value === node) {
201
    myTree.value.setCurrentKey(null);
202
    currentNode.value = {};
203
  } else {
204
    currentNode.value = node;
205
  }
206
}
207
208
/**
209
 * el-tree拖拽end
210
 */
211
212
// 标签点击,添加至左边树
213
function handleClickTag(tag: any) {
214
  console.log(tag);
215
  if (currentNode.value) {
216
    proxy.$message.error('请先选中目标对象!');
217
  }
218
219
  nextTick(() => {
220
    myTree.value.setCurrentKey(currentNode.value.uuid);
221
  });
222
}
223
224
function cancelCurrent() {
225
  myTree.value.setCurrentKey(null);
226
  currentNode.value = {};
227
}
228
229
const defaultvalueMap = <any>{
230
  object: {},
231
  string: '',
232
  int: 0,
233
  boolean: false,
234
  array: [],
235
  'array-interator': [],
236
  'array-null': [],
237
  long: 0,
238
  date: '',
239
  datetime: '',
240
  decimal: 0.0
241
};
242
243
// 数据处理
244
function tree2json(
245
  data: any[],
246
  type: 'array-interator' | 'array-null' | 'object'
247
): any {
248
  const obj: any = {};
249
  data.map(({ children = [], type, alias, id }) => {
250
    const key = alias || id;
251
    obj[key] = children.length
252
      ? tree2json(children, type)
253
      : defaultvalueMap[type];
254
    return null;
255
  });
256
  return type.indexOf('array') > -1 ? [obj] : obj;
257
}
258
259
/**
260
 *
261
 * @param data 数据源
262
 * @param type 数据类型
263
 * 方法说明:
264
 * 1. 正常取值转换,通过对databus中的基础数据进行直接赋值的操作;
265
 * 2. 对象型数据转换,从模型中取数进行数据的赋值;
266
 * 3. 数组数据转换;1)需要迭代器的数据格式;2)不需要迭代器的数据格式;
267
 */
268
269
// tree to jsonpath
270
function arrayNullFunc(item: any) {
271
  const { children, id } = item;
272
  let values;
273
  if (children.length) {
274
    values = children.map((child: any) => {
275
      if (child.type === 'array-null' && child.children.length) {
276
        const childKey = child.alias || child.id;
277
        return {
278
          [childKey]: {
279
            _$$_isInterator: false,
280
            _$$_interator: '',
281
            values: arrayNullFunc(child)
282
          }
283
        };
284
      }
285
      if (
286
        (child.type === 'object' || child.type === 'array-interator') &&
287
        child.children.length
288
      ) {
289
        // eslint-disable-next-line no-use-before-define
290
        return tree2Jsonpath(child.children);
291
      }
292
      return `$.${child.id}`;
293
    });
294
  } else {
295
    values = `$.${id}`;
296
  }
297
  return values;
298
}
299
function tree2Jsonpath(data: any) {
300
  const result = {};
301
  const typeMap = {
302
    'array-null': (item: any) => {
303
      const { id, alias } = item;
304
      const key = alias || id;
305
306
      const values = arrayNullFunc(item);
307
      result[key] = {
308
        _$$_isInterator: false,
309
        _$$_interator: '',
310
        values
311
      };
312
    },
313
    'array-interator': (item: any) => {
314
      const { children, id, alias } = item;
315
      const key = alias || id;
316
      result[key] = {
317
        _$$_isInterator: true,
318
        _$$_interator: `$.${id}`,
319
        values: [tree2Jsonpath(children)]
320
      };
321
    },
322
    object: (item: any) => {
323
      const { children, id, alias } = item;
324
      const key = alias || id;
325
      result[key] = tree2Jsonpath(children);
326
    },
327
    default: (item: any) => {
328
      const { id, alias } = item;
329
      const key = alias || id;
330
      result[key] = `$.${id}`;
331
    }
332
  };
333
334
  data.forEach((item: any) => {
335
    const { type } = item;
336
    const fn = typeMap[type] || typeMap.default;
337
    fn(item);
338
  });
339
340
  return result;
341
}
342
343
function validate() {}
344
watch(
345
  treeData,
346
  () => {
347
    if (treeData.value?.length) {
348
      jsonData.value = tree2json(treeData.value, 'object');
349
      jsonpathData.value = tree2Jsonpath(treeData.value);
350
    } else {
351
      currentNode.value = {};
352
      jsonData.value = {};
353
      jsonpathData.value = {};
354
    }
355
  },
356
  { deep: true }
357
);
358
359
// 快速创建databus数据
360
const attrInfo = ref<any>([]);
361
const showAttrDialog = ref<any>(false);
362
const customDetail = ref<any>(null);
363
function quickCreate() {
364
  showAttrDialog.value = true;
365
}
366
// 关闭弹窗
367
function closeDialog() {
368
  showAttrDialog.value = false;
369
}
370
function confirmEvent() {}
371
const btns = [
372
  // { label: '编辑', name: 'edit', onClick: editFn },
373
  { label: '删除', name: 'delete', onClick: confirmEvent }
374
];
375
// 确认弹窗
376
function confirmDialog() {
377
  const data = customDetail.value.attrList;
378
  data.forEach((item: any) => {
379
    if (!customAttrs.value.some((el: any) => el.id === item.id)) {
380
      item.actions = btns;
381
      customAttrs.value.push(item);
382
    }
383
  });
384
385
  formateSourceData(customAttrs.value);
386
  dataBus.customAttrs.data = customAttrs.value;
387
  panelGlobal[`${systemId}`] = dataBus;
388
  localStorage.setItem('panelGlobal', JSON.stringify(panelGlobal));
389
  closeDialog();
390
}
391
const currentNodes = ref<any>([]);
392
393
watch(
394
  currentNode,
395
  () => {
396
    currentNodes.value = [currentNode.value.uuid];
397
  },
398
  { deep: true }
399
);
400
401
defineExpose({
402
  treeData,
403
  jsonData,
404
  jsonpathData
405
});
406
407
onMounted(() => {
408
  if (treeData.value?.length) {
409
    // jsonData.value = tree2json(treeData.value, 'object');
410
    // jsonpathData.value = tree2Jsonpath(treeData.value);
411
  } else {
412
    currentNode.value = {};
413
  }
414
});
415
</script>
416
417
<style scoped lang="scss">
418
.__data-conversion {
419
  display: flex;
420
  justify-content: space-between;
421
  height: calc(100% - 20px);
422
  padding: 0px;
423
  box-sizing: border-box;
424
  .__left {
425
    width: calc(60% - 7px);
426
    .__up {
427
      height: calc(50% - 20px);
428
      .title {
429
        display: flex;
430
        justify-content: space-between;
431
        margin-bottom: 5px;
432
      }
433
      .tree-content {
434
        background: #ffffff;
435
        border: 1px solid rgba(0, 0, 0, 0.15);
436
        border-radius: 4px;
437
        height: calc(100% - 20px);
438
439
        padding: 15px;
440
        box-sizing: border-box;
441
        overflow-y: auto;
442
      }
443
    }
444
    .__down {
445
      height: calc(50% - 0px);
446
      margin-top: 20px;
447
      .attr-content {
448
        border: 1px solid rgba(0, 0, 0, 0.15);
449
        background: #ffffff;
450
        border-radius: 4px;
451
        height: calc(100% - 20px);
452
        overflow: hidden;
453
        .editor {
454
          height: calc(100%);
455
          :deep(.jsoneditor-statusbar) {
456
            padding: 0 5px;
457
            box-sizing: content-box;
458
          }
459
        }
460
      }
461
    }
462
  }
463
  .__right {
464
    width: calc(40% - 8px);
465
    height: 100%;
466
    .title {
467
      display: flex;
468
      justify-content: space-between;
469
      align-items: center;
470
      margin-bottom: 5px;
471
    }
472
    .tag-list {
473
      background-color: #ffffff;
474
      border: 1px solid rgba(0, 0, 0, 0.15);
475
      border-radius: 4px;
476
      height: calc(100% - 20px);
477
      padding: 15px;
478
      box-sizing: border-box;
479
      overflow-y: auto;
480
      li {
481
        margin-bottom: 5px;
482
      }
483
      .tag-title {
484
        line-height: 32px;
485
        display: flex;
486
        align-items: center;
487
        .dian {
488
          width: 10px;
489
          height: 10px;
490
          margin-right: 10px;
491
        }
492
      }
493
      .tag-content {
494
        display: flex;
495
        flex-direction: row;
496
        justify-content: flex-start;
497
        flex-wrap: wrap;
498
499
        .tag {
500
          height: 32px;
501
          margin-right: 12px;
502
          line-height: 32px;
503
          padding: 0 12px;
504
          border-radius: 4px;
505
          position: relative;
506
          padding-left: 26px;
507
          margin-bottom: 10px;
508
          cursor: pointer;
509
          &:after {
510
            content: '';
511
            position: absolute;
512
            width: 6px;
513
            height: 6px;
514
            left: 12px;
515
            top: 13px;
516
            border-radius: 50%;
517
          }
518
        }
519
        .int-color {
520
          color: #169bfa;
521
          background: rgba(22, 155, 250, 0.1);
522
          &:after {
523
            background: #169bfa;
524
          }
525
        }
526
        .string-color {
527
          color: #31cf9a;
528
          background: rgba(49, 207, 154, 0.1);
529
          &:after {
530
            background: #31cf9a;
531
          }
532
        }
533
        .boolean-color {
534
          color: #31cf9a;
535
          background: rgba(49, 207, 154, 0.1);
536
          &:after {
537
            background: #31cf9a;
538
          }
539
        }
540
        .object-color {
541
          color: #ff956f;
542
          background: rgba(255, 149, 111, 0.1);
543
          &:after {
544
            background: #ff956f;
545
          }
546
        }
547
        .array-color {
548
          color: #ffb95b;
549
          background: rgba(255, 185, 91, 0.1);
550
          &:after {
551
            background: #ffb95b;
552
          }
553
        }
554
        .decimal-color {
555
          color: #21c5db;
556
          background: rgba(33, 197, 219, 0.1);
557
          &:after {
558
            background: #21c5db;
559
          }
560
        }
561
        .date-color {
562
          color: #c084fc;
563
          background: rgba(192, 132, 252, 0.1);
564
          &:after {
565
            background: #c084fc;
566
          }
567
        }
568
        .long-color {
569
          color: #ff5f5f;
570
          background: rgba(255, 95, 95, 0.1);
571
          &:after {
572
            background: #ff5f5f;
573
          }
574
        }
575
        .datetime-color {
576
          color: #f471b7;
577
          background: rgba(244, 113, 183, 0.1);
578
          &:after {
579
            background: #f471b7;
580
          }
581
        }
582
      }
583
    }
584
  }
585
}
586
587
.title {
588
  line-height: 32px;
589
  color: #606266;
590
  font-weight: 400;
591
}
592
593
:deep(.el-tree-node) {
594
  line-height: 30px;
595
  padding: 3px 0;
596
}
597
:deep(.is-current) {
598
  line-height: 30px;
599
  padding: 3px 0;
600
}
601
.tree-item {
602
  display: flex;
603
  justify-content: space-between;
604
  align-items: center;
605
  width: 100%;
606
  .int-color {
607
    color: #169bfa;
608
  }
609
  .string-color {
610
    color: #31cf9a;
611
  }
612
  .boolean-color {
613
    color: #31cf9a;
614
  }
615
  .object-color {
616
    color: #ff956f;
617
  }
618
  .array-color {
619
    color: #ffb95b;
620
  }
621
  .decimal-color {
622
    color: #21c5db;
623
  }
624
  .date-color {
625
    color: #c084fc;
626
  }
627
  .long-color {
628
    color: #ff5f5f;
629
  }
630
  .datetime-color {
631
    color: #f471b7;
632
  }
633
  .tree-int {
634
    width: 100px;
635
  }
636
  .label {
637
    width: 30%;
638
  }
639
  .type {
640
    width: 100px;
641
  }
642
}
643
</style>
644
645
<style>
646
.jsoneditor-menu {
647
  background-color: #bbb;
648
  border-color: rgba(0, 0, 0, 0.15);
649
}
650
.jsoneditor {
651
  border-color: rgba(0, 0, 0, 0.15);
652
}
653
</style>

+ 1 - 1
src/views/_components/right-panel/_components/PanelNodeFunction.vue

@ -4,7 +4,7 @@
4 4
      <slot name="function-basic"></slot>
5 5
    </div>
6 6
    <div class="senior">
7
      <h4>高级用法</h4>
7
      <!-- <h4>高级用法</h4> -->
8 8
      <slot name="function-senior"></slot>
9 9
    </div>
10 10
  </div>

+ 5 - 5
src/views/flow/_components/ApiDetailPage.vue

@ -203,7 +203,7 @@ function logicOperation(state, msg) {
203 203
204 204
      logicModeUpdate(params, props.apiDetail?.id)
205 205
        .then((res) => {
206
          if (res.data.resultCode === '0') {
206
          if (res.resultCode === '0') {
207 207
            proxy.$message.success(res.resultMsg);
208 208
          } else {
209 209
            proxy.$message.error(res.resultMsg, 'error');
@ -289,11 +289,11 @@ function testHooks() {
289 289
    const { params } = testRequest.value;
290 290
    testLogic(params, props.apiDetail.id)
291 291
      .then((res) => {
292
        if (res.data.resultCode === '0') {
292
        if (res.resultCode === '0') {
293 293
          proxy.$message.success('请求成功!');
294
          testResponse.value = res.data.result;
294
          testResponse.value = res.result;
295 295
        } else {
296
          proxy.$message.error(res.data.resultMsg);
296
          proxy.$message.error(res.resultMsg);
297 297
        }
298 298
      })
299 299
      .catch((err) => {
@ -308,7 +308,7 @@ function testHooks() {
308 308
  };
309 309
}
310 310
311
const { testRequest, test, updateTestData } = testHooks();
311
const { testRequest, testResponse, test, updateTestData } = testHooks();
312 312
function validate() {}
313 313
314 314
function handleClick() {}