ソースを参照

update: 修改bread数据展示 + 组件切换

liuyang 2 年 前
コミット
ac88257f0d
共有37 個のファイルを変更した801 個の追加168 個の削除を含む
  1. 13 11
      package-lock.json
  2. 1 1
      package.json
  3. 26 3
      src/App.vue
  4. 5 0
      src/components/index.ts
  5. 206 0
      src/components/table/IpuTable.vue
  6. 285 0
      src/components/table/TableColumn.vue
  7. 5 0
      src/main.ts
  8. 4 1
      src/store/getters.ts
  9. 1 0
      src/store/mutation_types.ts
  10. 5 0
      src/store/mutations.ts
  11. 2 1
      src/store/state.ts
  12. 96 8
      src/views/_components/_flow/Index.vue
  13. 12 12
      src/views/_components/_flow/nodes.js
  14. 2 2
      src/views/_components/node/BranchNode.vue
  15. 2 9
      src/views/_components/panel/PanelEnd.vue
  16. 2 2
      src/views/_components/panel/PanelExpression.vue
  17. 4 4
      src/views/_components/panel/PanelForeach.vue
  18. 4 4
      src/views/_components/panel/PanelFunction.vue
  19. 10 10
      src/views/_components/panel/PanelGlobal.vue
  20. 3 3
      src/views/_components/panel/PanelHttp.vue
  21. 8 24
      src/views/_components/panel/PanelSql.vue
  22. 4 6
      src/views/_components/panel/PanelStart.vue
  23. 2 2
      src/views/_components/panel/PanelSubFlow.vue
  24. 6 6
      src/views/_components/panel/common/AddFormItem.vue
  25. 2 2
      src/views/_components/panel/common/AttrInfo.vue
  26. 4 4
      src/views/_components/panel/common/CommonPanel.vue
  27. 10 10
      src/views/_components/panel/common/ParamItem.vue
  28. 4 1
      src/views/_components/panel/global/CustomDetail.vue
  29. 3 3
      src/views/_components/panel/global/CustomDetailList.vue
  30. 5 5
      src/views/_components/panel/global/ImportModel.vue
  31. 7 7
      src/views/_components/panel/global/ModelDetail.vue
  32. 16 16
      src/views/_components/panel/global/ValidateRules.vue
  33. 2 2
      src/views/_components/panel/sql-components/InputOutputTab.vue
  34. 23 4
      src/views/flow/Flow.vue
  35. 6 0
      src/views/flow/SystemDetail.vue
  36. 1 5
      src/views/flow/_components/ApiDetailPage.vue
  37. 10 0
      src/views/sub-flow/SubFlow.vue

+ 13 - 11
package-lock.json

@ -480,9 +480,9 @@
480 480
      "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg=="
481 481
    },
482 482
    "@floating-ui/core": {
483
      "version": "1.2.4",
484
      "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.2.4.tgz",
485
      "integrity": "sha512-SQOeVbMwb1di+mVWWJLpsUTToKfqVNioXys011beCAhyOIFtS+GQoW4EQSneuxzmQKddExDwQ+X0hLl4lJJaSQ=="
483
      "version": "1.2.5",
484
      "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.2.5.tgz",
485
      "integrity": "sha512-qrcbyfnRVziRlB6IYwjCopYhO7Vud750JlJyuljruIXcPxr22y8zdckcJGsuOdnQ639uVD1tTXddrcH3t3QYIQ=="
486 486
    },
487 487
    "@floating-ui/dom": {
488 488
      "version": "1.2.5",
@ -591,11 +591,6 @@
591 591
        "fastq": "^1.6.0"
592 592
      }
593 593
    },
594
    "@popperjs/core": {
595
      "version": "npm:@sxzz/popperjs-es@2.11.7",
596
      "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
597
      "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
598
    },
599 594
    "@rollup/pluginutils": {
600 595
      "version": "4.2.1",
601 596
      "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
@ -1521,9 +1516,9 @@
1521 1516
      "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="
1522 1517
    },
1523 1518
    "common-module-ui": {
1524
      "version": "0.0.13",
1525
      "resolved": "https://registry.npmjs.org/common-module-ui/-/common-module-ui-0.0.13.tgz",
1526
      "integrity": "sha512-LjK7Vol/8BiCcf6h3iRyiH7NEwdNkITjTs5yFndfCthwJ3ZEnp+ynak6U5QVra9OcR5McqeK2ihaYQVQc7M0Hw==",
1519
      "version": "0.0.14",
1520
      "resolved": "https://registry.npmjs.org/common-module-ui/-/common-module-ui-0.0.14.tgz",
1521
      "integrity": "sha512-haF7AX0Qsc6FLpJ8LsY79h6VkcFMwEzI9alMHLm+O6/ReTtBxadhaHUwaL6LJGuc0KxzDsbo6hvqglpnMSAqfA==",
1527 1522
      "requires": {
1528 1523
        "@element-plus/icons-vue": "^2.0.10",
1529 1524
        "@typescript-eslint/parser": "^5.42.1",
@ -1872,6 +1867,13 @@
1872 1867
        "lodash-unified": "^1.0.2",
1873 1868
        "memoize-one": "^6.0.0",
1874 1869
        "normalize-wheel-es": "^1.2.0"
1870
      },
1871
      "dependencies": {
1872
        "@popperjs/core": {
1873
          "version": "npm:@sxzz/popperjs-es@2.11.7",
1874
          "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
1875
          "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
1876
        }
1875 1877
      }
1876 1878
    },
1877 1879
    "emoji-regex": {

+ 1 - 1
package.json

@ -24,7 +24,7 @@
24 24
    "axios": "^1.1.3",
25 25
    "code-mirror-themes": "^1.0.0",
26 26
    "codemirror": "^5.65.2",
27
    "common-module-ui": "0.0.13",
27
    "common-module-ui": "0.0.14",
28 28
    "eslint": "^8.27.0",
29 29
    "eslint-config-airbnb-base": "^15.0.0",
30 30
    "eslint-config-prettier": "^8.5.0",

+ 26 - 3
src/App.vue

@ -13,7 +13,7 @@
13 13
    :commonds="commonds"
14 14
    :is-collapse="isCollapse"
15 15
    :aside-width="asideWidth"
16
    :breads="route.meta.breadcrumb"
16
    :breads="breadData"
17 17
    @handle-change-collapse="handleChangeCollapse"
18 18
  >
19 19
    <!-- <template #breadLeft>
@ -25,10 +25,19 @@
25 25
  </common-layer>
26 26
</template>
27 27
<script setup lang="ts">
28
import { ref } from 'vue';
28
import { ref, computed, watch } from 'vue';
29
import { useStore } from 'vuex';
29 30
import { useRoute } from 'vue-router';
30 31
import logoImg from './assets/images/logo.svg';
31 32
33
const store = useStore();
34
const route = useRoute();
35
36
const routeMetaBread = computed(() => route.meta.breadcrumb);
37
const breadData = computed(() => store.getters.breadData);
38
39
console.log(store);
40
32 41
const menuList = ref<any>([
33 42
  {
34 43
    label: '流程编排',
@ -57,7 +66,6 @@ const headerInfo = ref<any>({
57 66
  title: '快键 服务逻辑编排',
58 67
  logo: logoImg
59 68
});
60
const route = useRoute();
61 69
62 70
const userInfo = ref<any>({
63 71
  userAccount: 'deployer'
@ -77,6 +85,21 @@ function handleChangeCollapse(collapse: any) {
77 85
    asideWidth.value = '260px';
78 86
  }
79 87
}
88
89
const exposePath = <any>['/flow-module', '/flow-detail'];
90
91
watch(
92
  route,
93
  () => {
94
    console.log(route.path);
95
    console.log(exposePath.includes(route.path));
96
97
    if (!exposePath.includes(route.path)) {
98
      store.commit('setBreadData', routeMetaBread.value);
99
    }
100
  },
101
  { deep: true }
102
);
80 103
</script>
81 104
82 105
<style>

+ 5 - 0
src/components/index.ts

@ -0,0 +1,5 @@
1
import IpuTable from './table/IpuTable.vue';
2
3
export function setupGlobalComponents(app: any) {
4
  app.component('IpuTable', IpuTable);
5
}

+ 206 - 0
src/components/table/IpuTable.vue

@ -0,0 +1,206 @@
1
<template>
2
  <el-table
3
    ref="ipuTable"
4
    class="g-table"
5
    :data="tableData"
6
    :header-cell-style="headerCellStyle"
7
    :cell-style="cellStyle"
8
    v-bind="tableAttrs"
9
    @current-change="handleCurrentRowChange"
10
    @selection-change="handleSelectionChange"
11
  >
12
    <template #empty>
13
      <el-empty description="暂无数据"></el-empty>
14
    </template>
15
    <el-table-column
16
      v-if="isCheck"
17
      type="selection"
18
      width="55"
19
    ></el-table-column>
20
    <template v-for="header in tableHeader" :key="header?.name">
21
      <!-- 自自定义按钮 -->
22
      <el-table-column
23
        v-if="header?.type === 'selection'"
24
        type="selection"
25
        width="55"
26
      ></el-table-column>
27
      <el-table-column
28
        v-else-if="header?.type"
29
        :prop="header?.name"
30
        :label="header?.label"
31
        :width="header?.width"
32
        :min-width="header?.minWidth"
33
        :sortable="header?.sortable || false"
34
        :fixed="header?.fixed || false"
35
        :align="header?.position || 'left'"
36
      >
37
        <template #default="scope">
38
          <!-- <component :is="header.component" :value="scope.row"></component> -->
39
          <!-- 自定义按钮  -->
40
          <table-column
41
            :header="header"
42
            :row="scope.row"
43
            :is-disable="isDisable"
44
            @change-event="changeEvent"
45
            @blur-event="blurEvent"
46
            @svgEvent="svgEvent"
47
          ></table-column>
48
          <!-- 按钮 -->
49
          <slot :name="header.name" :row="scope.row"></slot>
50
        </template>
51
      </el-table-column>
52
      <!-- 普通样式 -->
53
      <el-table-column
54
        v-else
55
        :prop="header?.name"
56
        show-overflow-tooltip
57
        :label="header?.label"
58
        :width="header?.width"
59
        :min-width="header?.minWidth"
60
        :sortable="header?.sortable || false"
61
        :align="header?.position || 'left'"
62
        :fixed="header?.fixed || false"
63
      >
64
        <template #default="scope">
65
          {{
66
            scope.row[header?.name] || scope.row[header?.name] === 0
67
              ? scope.row[header?.name]
68
              : '-'
69
          }}
70
        </template>
71
      </el-table-column>
72
    </template>
73
  </el-table>
74
</template>
75
76
<script setup>
77
import { ref } from 'vue';
78
import TableColumn from './TableColumn.vue';
79
80
defineProps({
81
  tableHeader: {
82
    type: Array,
83
    default: () => []
84
  },
85
  tableData: {
86
    type: Array,
87
    default: () => []
88
  },
89
  tableAttrs: {
90
    type: Object,
91
    default: () => {}
92
  },
93
  isCheck: {
94
    type: Boolean,
95
    default: () => false
96
  },
97
  isDisable: {
98
    type: Boolean,
99
    default: true
100
  }
101
});
102
const emits = defineEmits([
103
  'changeEvent',
104
  'blurEvent',
105
  'handleCurrentRowChange',
106
  'svgEvent',
107
  'handleSelectionChange'
108
]);
109
const cellStyle = ref({
110
  padding: '0 2px',
111
  height: '60px',
112
  'line-height': '60px',
113
  'font-size': '14px'
114
});
115
const headerCellStyle = ref({
116
  padding: '0 2px',
117
  height: '39px',
118
  'font-weight': '600',
119
  'font-size': '14px',
120
  'line-height': '39px',
121
  color: '#000',
122
  'background-color': '#fafafa'
123
});
124
const changeEvent = (form) => {
125
  emits('changeEvent', form);
126
};
127
128
// 触发blur事件
129
const blurEvent = (form) => {
130
  emits('blurEvent', form);
131
};
132
const ipuTable = ref(null);
133
// 选中当前行
134
function handleCurrentRowChange(row) {
135
  // console.log(row)
136
  emits('handleCurrentRowChange', row);
137
}
138
139
function handleSelectionChange(row) {
140
  emits('handleSelectionChange', row);
141
}
142
143
function svgEvent(row) {
144
  emits('svgEvent', row);
145
}
146
147
function setCurrent(rows) {
148
  if (rows) {
149
    rows.forEach((row) => {
150
      ipuTable.value?.toggleRowSelection(row);
151
    });
152
  }
153
}
154
155
function setSingleCurrent(row) {
156
  if (row) {
157
    setTimeout(() => {
158
      ipuTable.value?.setCurrentRow(row);
159
    }, 10);
160
  }
161
}
162
// 反选
163
164
defineExpose({
165
  ipuTable,
166
  setCurrent,
167
  setSingleCurrent
168
});
169
</script>
170
171
<style scoped lang="scss">
172
:deep(.el-table__inner-wrapper) {
173
  font-size: 14px;
174
  .el-table__header-wrapper {
175
    font-size: 14px;
176
    thead tr {
177
      font-size: 14px;
178
    }
179
  }
180
}
181
.el-table {
182
  width: 100%;
183
}
184
// 消除table横向滚动条
185
// :deep(.is-horizontal){
186
//   .el-scrollbar__thumb{
187
//     display: none;
188
//   }
189
// }
190
:deep(.el-tooltip) {
191
  display: flex;
192
}
193
:deep(.current-row) {
194
  position: relative;
195
  background: rgba(25, 130, 255, 0.04);
196
  &:after {
197
    content: '';
198
    position: absolute;
199
    left: 0;
200
    width: 4px;
201
    height: 100%;
202
    background: #2d98ff;
203
    z-index: 1000;
204
  }
205
}
206
</style>

+ 285 - 0
src/components/table/TableColumn.vue

@ -0,0 +1,285 @@
1
<!-- eslint-disable vue/no-mutating-props -->
2
<template>
3
  <!-- input -->
4
  <el-input
5
    v-if="header?.type === 'input'"
6
    v-model="row[header.name]"
7
    v-bind="header?.attrs"
8
    @blur="blurEvent(header)"
9
    @change="changeEvent(header)"
10
  ></el-input>
11
12
  <!-- select -->
13
  <common-select
14
    v-if="header?.type === 'select'"
15
    v-model="row[header.name]"
16
    v-bind="header?.attrs"
17
    @change="changeEvent(header)"
18
  ></common-select>
19
20
  <div
21
    :class="[
22
      header?.attrs?.isShow ? 'color-picker-wrapper' : 'color-picker-noWrapper'
23
    ]"
24
  >
25
    <!-- 取色器 color-picker -->
26
    <el-color-picker
27
      v-if="header?.type === 'color-picker'"
28
      v-bind="header?.attrs"
29
      v-model="row[header.name]"
30
      :predefine="predefineColors"
31
      @change="changeEvent(header)"
32
    ></el-color-picker>
33
    <span v-if="header?.attrs?.isShow" class="color-des">
34
      {{ row[header.name].slice(1) }}
35
    </span>
36
  </div>
37
38
  <!--时间选择器-->
39
  <el-date-picker
40
    v-if="header?.type === 'date-picker'"
41
    v-bind="header?.attrs"
42
    v-model="row[header.name]"
43
    @change="changeEvent(header)"
44
  ></el-date-picker>
45
46
  <!-- 数字 -->
47
  <el-input-num
48
    v-if="header?.type === 'input-num'"
49
    v-bind="header?.attrs"
50
    v-model="row[header.name]"
51
    controls-position="right"
52
    @change="changeEvent(header)"
53
    @blur="blurEvent(header)"
54
  ></el-input-num>
55
56
  <!-- radio -->
57
  <el-radio
58
    v-if="header?.type === 'radio'"
59
    v-bind="header?.attrs"
60
    v-model="row[header.name]"
61
    @change="changeEvent(header)"
62
  ></el-radio>
63
  <!-- switch -->
64
  <el-switch
65
    v-if="header?.type === 'switch'"
66
    v-bind="header?.attrs"
67
    v-model="row[header.name]"
68
    :radios="row[header.name]"
69
    @change="changeEvent(header)"
70
  ></el-switch>
71
72
  <!-- checkox -->
73
  <el-checkbox
74
    v-if="header?.type === 'checkbox'"
75
    v-bind="header?.attrs"
76
    v-model="row[header.name]"
77
    @change="changeEvent(header)"
78
  ></el-checkbox>
79
80
  <!-- 接收传入的行间样式修改颜色 -->
81
  <span
82
    v-if="header?.type === 'color'"
83
    :class="row[header?.name]"
84
    v-bind="header?.attrs"
85
  ></span>
86
87
  <!-- linkPage回调由父组件传入,父组件可以自定义回调的执行 -->
88
  <span v-if="header?.type === 'link'" class="link" @click="linkEvent(row)">
89
    {{ row[header?.name] }}
90
  </span>
91
92
  <!-- 在线状态 在线与离线 -->
93
  <el-tag
94
    v-if="header?.type === 'onlineStatus'"
95
    v-model="row[header?.name]"
96
    :type="
97
      row[header?.name] === '在线' || row[header?.name] === '启用'
98
        ? 'success'
99
        : 'danger'
100
    "
101
    effect="light"
102
    round
103
  >
104
    <common-icon
105
      :name="
106
        row[header?.name] === '在线' || row[header?.name] === '启用'
107
          ? 'success'
108
          : 'danger'
109
      "
110
      :size="header?.attrs?.size"
111
      class="point"
112
    ></common-icon>
113
    <span class="svg-content">
114
      {{ row[header?.name] }}
115
    </span>
116
  </el-tag>
117
118
  <!-- 已发布与未发布 -->
119
  <el-tag
120
    v-if="header?.type === 'publishStatus'"
121
    v-model="row[header?.name]"
122
    :type="row[header?.name] === '已发布' ? 'success' : 'info'"
123
    effect="light"
124
    round
125
  >
126
    <common-icon
127
      :name="row[header?.name] === '已发布' ? 'success' : 'info'"
128
      :size="header?.attrs?.size"
129
      class="point"
130
    ></common-icon>
131
    <span class="svg-content">
132
      {{ row[header?.name] }}
133
    </span>
134
  </el-tag>
135
136
  <!-- 文字展示 -->
137
  <div v-if="header?.type === 'link-text'" class="link-text">
138
    <span class="link-left">{{ row[header.name] }}</span>
139
    <span v-if="!header?.svg" class="link-right" @click="checkDevice(row)">
140
      {{ header?.description }}
141
    </span>
142
    <common-icon
143
      v-if="header?.svg && row['valueTypeDisplay'] === '数字'"
144
      class="link-right my-svg"
145
      :name="header?.svg"
146
      :class="isDisable ? 'disabled' : ''"
147
      @click="svgEvent(row)"
148
    ></common-icon>
149
  </div>
150
</template>
151
152
<script setup>
153
import { ref } from 'vue';
154
155
const predefineColors = ref(['#D9D9D9', '#5AC285', '#ED9248', '#E53E3E']);
156
defineProps({
157
  header: {
158
    type: Object,
159
    default: () => {}
160
  },
161
  row: {
162
    type: Object,
163
    default: () => {}
164
  },
165
  isDisable: {
166
    type: Boolean,
167
    default: true
168
  }
169
});
170
const emits = defineEmits([
171
  'changeEvent',
172
  'blurEvent',
173
  'linkEvent',
174
  'svgEvent',
175
  'checkDevice'
176
]);
177
178
const changeEvent = (form) => {
179
  emits('changeEvent', form);
180
};
181
182
// 触发blur事件
183
const blurEvent = (form) => {
184
  emits('blurEvent', form);
185
};
186
187
// 触发link事件
188
const linkEvent = (row) => {
189
  emits('linkEvent', row);
190
};
191
192
// 触发svg事件
193
const svgEvent = (row) => {
194
  emits('svgEvent', row);
195
};
196
197
// 查看设备
198
function checkDevice(row) {
199
  emits('checkDevice', row);
200
}
201
</script>
202
203
<style scoped lang="scss">
204
.red {
205
  width: 44px;
206
  height: 10px;
207
  display: inline-block;
208
  background: #f34871;
209
}
210
.blue {
211
  width: 44px;
212
  height: 10px;
213
  display: inline-block;
214
  background: #2d98ff;
215
}
216
.point {
217
  margin: 0 4px 2.5px 0;
218
}
219
.link-text {
220
  width: 85px;
221
  display: flex;
222
  justify-content: space-between;
223
  .link-left,
224
  .link-right {
225
    font-size: 14px;
226
  }
227
  .link-right {
228
    cursor: pointer;
229
    color: #2d98ff;
230
  }
231
}
232
.color-picker-wrapper {
233
  width: 101px;
234
  border: 1px solid rgba(0, 0, 0, 0.15);
235
  border-radius: 6px;
236
  display: flex;
237
  justify-content: space-between;
238
  align-items: center;
239
  box-sizing: border-box;
240
  padding-right: 5px;
241
}
242
.color-picker-noWrapper {
243
  display: inline-block;
244
}
245
.color-picker-wrapper {
246
  :deep(.el-color-picker__trigger) {
247
    padding: 1px;
248
    border: none;
249
    .el-color-picker__color {
250
      border: none;
251
    }
252
    .el-color-picker__color-inner {
253
      border-radius: 5px;
254
      .el-icon {
255
        font-size: 0;
256
      }
257
    }
258
  }
259
  .color-des {
260
    font-size: 14px;
261
  }
262
}
263
.ipu-svg {
264
  width: 6px;
265
  height: 6px;
266
  margin-top: 5px;
267
}
268
.svg-content {
269
  margin-left: 4px;
270
}
271
.link {
272
  color: #2d98ff;
273
  cursor: pointer;
274
}
275
.my-svg {
276
  width: 20px;
277
  height: 20px;
278
  position: relative;
279
  bottom: 4px;
280
}
281
.disabled {
282
  color: #cccccc !important;
283
  cursor: not-allowed !important;
284
}
285
</style>

+ 5 - 0
src/main.ts

@ -10,6 +10,8 @@ import CommonUI from 'common-module-ui';
10 10
import 'common-module-ui/lib/style.css';
11 11
import { setEventBus } from './utils/eventBus.js';
12 12
13
import { setupGlobalComponents } from './components/index';
14
13 15
// import CommonUI from './common-ui/common-module-ui.js';
14 16
// import './common-ui/style.css';
15 17
import App from './App.vue';
@ -36,7 +38,10 @@ function render(props: any = {}) {
36 38
  setEventBus(app);
37 39
  app.use(router);
38 40
  app.use(CommonUI);
41
  console.log(CommonUI);
42
39 43
  app.use(store);
44
  setupGlobalComponents(app);
40 45
  // 注册项目全局组件
41 46
  setupProductComponents(app);
42 47

+ 4 - 1
src/store/getters.ts

@ -12,6 +12,8 @@ export const token = (s: any) => s.token;
12 12
export const userInfo = (s: any) => s.userInfo;
13 13
export const showInfo = (s: any) => s.showInfo;
14 14
15
export const breadData = (s: any) => s.breadData;
16
15 17
export const mainProduct = (s: any) => s.mainProduct;
16 18
17 19
export default {
@ -20,5 +22,6 @@ export default {
20 22
  systemIcon,
21 23
  token,
22 24
  userInfo,
23
  showInfo
25
  showInfo,
26
  breadData
24 27
};

+ 1 - 0
src/store/mutation_types.ts

@ -12,3 +12,4 @@ export const CHANGE_TOKEN = 'changeToken';
12 12
export const CHANGE_USER_INFO = 'changeUserInfo';
13 13
export const CHANGE_SHOW_INFO = 'changeShowInfo';
14 14
export const SET_MAIN_PRODUCT = 'setMainProduct';
15
export const SET_BREAD_DATA = 'setBreadData';

+ 5 - 0
src/store/mutations.ts

@ -28,5 +28,10 @@ export default {
28 28
  },
29 29
  [types.CHANGE_SHOW_INFO](state: any, data: any) {
30 30
    state.showInfo = data;
31
  },
32
  [types.SET_BREAD_DATA](state: any, data: any) {
33
    console.log(state);
34
35
    state.breadData = data;
31 36
  }
32 37
};

+ 2 - 1
src/store/state.ts

@ -13,5 +13,6 @@ export default {
13 13
  showInfo: false,
14 14
  mainProduct: JSON.parse(localStorage.getItem('mainProduct') || '{}'),
15 15
16
  userInfo: {}
16
  userInfo: {},
17
  breadData: []
17 18
};

+ 96 - 8
src/views/_components/_flow/Index.vue

@ -29,7 +29,7 @@
29 29
<script setup>
30 30
import { ref, getCurrentInstance, onMounted, nextTick, watchEffect } from 'vue';
31 31
/** x6相关start */
32
import { Graph, Dom, Point } from '@antv/x6';
32
import { Graph, Dom, Point, Shape } from '@antv/x6';
33 33
import { Snapline } from '@antv/x6-plugin-snapline';
34 34
import { Clipboard } from '@antv/x6-plugin-clipboard';
35 35
import { Keyboard } from '@antv/x6-plugin-keyboard';
@ -103,7 +103,79 @@ function initGraph() {
103 103
      allowLoop: false, // 是否允许循环创建节点
104 104
      allowPort: true, // 是否允许边链接到链接桩,
105 105
      allowNode: false,
106
      highlight: true
106
      highlight: true,
107
      // snap: true, // 自动吸附(50px)
108
      createEdge() {
109
        return new Shape.Edge({
110
          attrs: {
111
            line: {
112
              stroke: '#B1B1B1',
113
              strokeWidth: 1,
114
              targetMarker: {
115
                name: 'block',
116
                width: 5,
117
                height: 9
118
              }
119
            }
120
          },
121
          router: 'custom',
122
          zIndex: 0,
123
          connector: {
124
            name: '',
125
            args: {
126
              radius: 90
127
            }
128
          }
129
        });
130
      },
131
      //  判断节点是否可被连接
132
      validateConnection({ sourcePort, targetPort, sourceCell, targetCell }) {
133
        const data = targetCell.getData();
134
        // @: xx类型节点不被连接 start节点不能被连接
135
        if (data.name === 'start') {
136
          return false;
137
        }
138
        const tartgetPorts = targetCell.getPorts();
139
        const sourcePorts = sourceCell.getPorts();
140
        /**
141
         * 1. 如果源点的group为input时,不允许连接
142
         * 2. 如果target的group为output时,不允许连接
143
         */
144
        if (
145
          sourcePorts.filter((el) => el.id === sourcePort)?.[0].group ===
146
          'input'
147
        ) {
148
          // proxy.$utils.ipuMessage('不能从输入节点进行连线!', 'error')
149
          return false;
150
        }
151
        if (
152
          tartgetPorts.filter((el) => el.id === targetPort)?.[0].group ===
153
          'output'
154
        ) {
155
          // proxy.$utils.ipuMessage('不能连接输出节点!', 'error')
156
          return false;
157
        }
158
        return true;
159
      },
160
      // 限制链接桩只能链接一条边(需在ports中设置connectionCount)
161
      validateMagnet({ magnet, cell }) {
162
        let count = 0;
163
        const connectionCount = magnet.getAttribute('connection-count');
164
        const max = connectionCount ? parseInt(connectionCount, 10) : 1;
165
        if (max === 0) {
166
          proxy.$utils.ipuMessage('请配置路由分发节点!', 'error');
167
        }
168
        const outgoingEdges = graph.value.getOutgoingEdges(cell);
169
        if (outgoingEdges) {
170
          outgoingEdges.forEach((edge) => {
171
            const edgeView = graph.value.findViewByCell(edge);
172
            if (edgeView.sourceMagnet === magnet) {
173
              count += 1;
174
            }
175
          });
176
        }
177
        return count < max;
178
      }
107 179
    },
108 180
    // 节点拖拽到另外一个节点中
109 181
    embedding: {
@ -179,13 +251,25 @@ const TeleportContainer = getTeleport();
179 251
180 252
const customNodes = [
181 253
  {
182
    name: 'custom-node',
254
    name: 'flow-start-node',
183 255
    component: CustomeNode,
184 256
    w: 100,
185 257
    h: 100
186 258
  },
187 259
  {
188
    name: 'branch-node',
260
    name: 'flow-end-node',
261
    component: CustomeNode,
262
    w: 100,
263
    h: 100
264
  },
265
  {
266
    name: 'flow-input-node',
267
    component: CustomeNode,
268
    w: 100,
269
    h: 100
270
  },
271
  {
272
    name: 'flow-route-node',
189 273
    component: BranchNode,
190 274
    w: 200,
191 275
    h: 100
@ -208,7 +292,7 @@ registerNode();
208 292
const dragStartNode = (target, e) => {
209 293
  if (target.name === 'start') {
210 294
    const node = new CreateNodeClass(
211
      'custom-node',
295
      'flow-start-node',
212 296
      graph.value,
213 297
      target
214 298
    ).createStartNode();
@ -219,7 +303,7 @@ const dragStartNode = (target, e) => {
219 303
const dragEndNode = (target, e) => {
220 304
  if (target.name === 'end') {
221 305
    const node = new CreateNodeClass(
222
      'custom-node',
306
      'flow-end-node',
223 307
      graph.value,
224 308
      target
225 309
    ).createEndNode();
@ -234,7 +318,7 @@ const dragInputNode = (target, e) => {
234 318
    target.type === 'route'
235 319
  ) {
236 320
    const node = new CreateNodeClass(
237
      'custom-node',
321
      'flow-input-node',
238 322
      graph.value,
239 323
      target
240 324
    ).createNormalNode();
@ -246,7 +330,7 @@ const dragInputNode = (target, e) => {
246 330
const dragBranchNode = (target, e) => {
247 331
  if (target.id === 'branch') {
248 332
    const node = new CreateNodeClass(
249
      'branch-node',
333
      'flow-route-node',
250 334
      graph.value,
251 335
      target
252 336
    ).createBranchNode();
@ -427,6 +511,9 @@ function initEvent(graph) {
427 511
  });
428 512
}
429 513
514
function centerContent() {
515
  graph.value.centerContent();
516
}
430 517
// 异步渲染数据
431 518
const graphData = ref(JSON.parse(props.flowData?.jsonData || '{}'));
432 519
// 初始化形状
@ -434,6 +521,7 @@ function initGraphShape() {
434 521
  if (graph.value) {
435 522
    graph.value.fromJSON([]);
436 523
    graph.value.fromJSON(graphData.value);
524
    centerContent();
437 525
  }
438 526
}
439 527

+ 12 - 12
src/views/_components/_flow/nodes.js

@ -9,7 +9,7 @@ export default {
9 9
          id: 'start',
10 10
          label: '开始',
11 11
          type: 'global',
12
          icon: 'tool-start',
12
          icon: 'flow-start',
13 13
          isStartNode: true,
14 14
          attrsData: {}
15 15
        },
@ -18,7 +18,7 @@ export default {
18 18
          id: 'end',
19 19
          label: '结束',
20 20
          type: 'global',
21
          icon: 'tool-end',
21
          icon: 'flow-end',
22 22
          isStartNode: false,
23 23
          attrsData: {}
24 24
        }
@ -33,7 +33,7 @@ export default {
33 33
          id: 'sql',
34 34
          label: 'SQL',
35 35
          type: 'logic',
36
          icon: 'tool-sql',
36
          icon: 'flow-sql',
37 37
          isStartNode: false,
38 38
          attrsData: {}
39 39
        },
@ -42,7 +42,7 @@ export default {
42 42
          id: 'expression',
43 43
          label: '表达式',
44 44
          type: 'logic',
45
          icon: 'tool-expression',
45
          icon: 'flow-expression',
46 46
          isStartNode: false,
47 47
          attrsData: {}
48 48
        },
@ -51,7 +51,7 @@ export default {
51 51
          id: 'branch',
52 52
          label: '分支',
53 53
          type: 'branch',
54
          icon: 'tool-if',
54
          icon: 'flow-if',
55 55
          isStartNode: false,
56 56
          attrsData: {}
57 57
        },
@ -60,7 +60,7 @@ export default {
60 60
          id: 'subprocess',
61 61
          label: '子流程',
62 62
          type: 'logic',
63
          icon: 'tool-subprocess',
63
          icon: 'flow-subprocess',
64 64
          isStartNode: false,
65 65
          attrsData: {}
66 66
        }
@ -69,7 +69,7 @@ export default {
69 69
        //   id: 'logic',
70 70
        //   label: '逻辑',
71 71
        //   type: 'logic',
72
        //   icon: 'tool-logic',
72
        //   icon: 'flow-logic',
73 73
        //   isStartNode: false,
74 74
        //   attrsData: {}
75 75
        // }
@ -84,7 +84,7 @@ export default {
84 84
          id: 'foreach',
85 85
          label: '循环',
86 86
          type: 'data-processing',
87
          icon: 'tool-foreach',
87
          icon: 'flow-foreach',
88 88
          isStartNode: false,
89 89
          attrsData: {}
90 90
        },
@ -93,7 +93,7 @@ export default {
93 93
          id: 'action',
94 94
          label: '业务行为',
95 95
          type: 'data-processing',
96
          icon: 'tool-action',
96
          icon: 'flow-action',
97 97
          isStartNode: false,
98 98
          attrsData: {}
99 99
        },
@ -102,7 +102,7 @@ export default {
102 102
          id: 'function',
103 103
          label: '函数',
104 104
          type: 'data-processing',
105
          icon: 'tool-function',
105
          icon: 'flow-function',
106 106
          isStartNode: false,
107 107
          attrsData: {}
108 108
        },
@ -111,7 +111,7 @@ export default {
111 111
          id: 'polymerization',
112 112
          label: '数据聚合',
113 113
          type: 'data-processing',
114
          icon: 'tool-polymerization',
114
          icon: 'flow-polymerization',
115 115
          isStartNode: false,
116 116
          attrsData: {}
117 117
        },
@ -120,7 +120,7 @@ export default {
120 120
          id: 'http',
121 121
          label: 'HTTP接口',
122 122
          type: 'data-processing',
123
          icon: 'tool-http',
123
          icon: 'flow-http',
124 124
          isStartNode: false,
125 125
          attrsData: {}
126 126
        }

+ 2 - 2
src/views/_components/node/BranchNode.vue

@ -3,11 +3,11 @@
3 3
    <!-- <h5 class="node-title">分支节点</h5> -->
4 4
    <ul class="branch-list">
5 5
      <li v-for="(item, index) in caseList" :key="index" class="branch-item">
6
        <ipu-svg name="flow-if" class="icon" size="16"></ipu-svg>
6
        <common-icon name="flow-if" class="icon" size="16"></common-icon>
7 7
        <span>case: {{ item.name }}</span>
8 8
      </li>
9 9
      <li class="branch-item">
10
        <ipu-svg name="flow-if" class="icon" size="16"></ipu-svg>
10
        <common-icon name="flow-if" class="icon" size="16"></common-icon>
11 11
        <span>default</span>
12 12
      </li>
13 13
    </ul>

+ 2 - 9
src/views/_components/panel/PanelEnd.vue

@ -1,16 +1,9 @@
1 1
<template>
2 2
  <div class="panel-end">
3 3
    <el-tabs v-model="activeName" @tab-click="handleClick">
4
      <!-- <el-tab-pane label="基础" name="action">
5
        <el-form :model="formData" label-position="top">
6
          <el-form-item label="ID">
7
            <ipu-input v-model="formData.id"></ipu-input>
8
          </el-form-item>
9
        </el-form>
10
      </el-tab-pane> -->
11 4
      <el-tab-pane label="功能" name="function">
12 5
        <el-button type="success" @click.stop="setting">设置</el-button>
13
        <ipu-table
6
        <common-table
14 7
          :table-header="tableHeader"
15 8
          :table-data="panelData.function.tableData"
16 9
        >
@ -19,7 +12,7 @@
19 12
              <Delete></Delete>
20 13
            </el-icon>
21 14
          </template>
22
        </ipu-table>
15
        </common-table>
23 16
      </el-tab-pane>
24 17
    </el-tabs>
25 18
  </div>

+ 2 - 2
src/views/_components/panel/PanelExpression.vue

@ -16,10 +16,10 @@
16 16
          <div class="form-title">
17 17
            <h5>名称</h5>
18 18
          </div>
19
          <ipu-input
19
          <el-input
20 20
            v-bind="attributes"
21 21
            v-model="panelData.function.name"
22
          ></ipu-input>
22
          ></el-input>
23 23
        </div>
24 24
        <div class="form-item">
25 25
          <div class="form-title">

+ 4 - 4
src/views/_components/panel/PanelForeach.vue

@ -13,20 +13,20 @@
13 13
          <div class="form-title">
14 14
            <h5>迭代器</h5>
15 15
          </div>
16
          <ipu-select
16
          <common-select
17 17
            v-model="panelData.function.iterator"
18 18
            :props-map="propsMap"
19 19
            :options="iteratorDataList"
20
          ></ipu-select>
20
          ></common-select>
21 21
        </div>
22 22
        <div class="form-item">
23 23
          <div class="form-title">
24 24
            <h5>数据类型</h5>
25 25
          </div>
26
          <ipu-select
26
          <common-select
27 27
            v-model="panelData.function.resultType"
28 28
            :options="resultTypes"
29
          ></ipu-select>
29
          ></common-select>
30 30
        </div>
31 31
        <div class="form-item">
32 32
          <div class="form-title">

+ 4 - 4
src/views/_components/panel/PanelFunction.vue

@ -12,22 +12,22 @@
12 12
        <div class="content">
13 13
          <div class="form-item">
14 14
            <span class="form-item-title">DOMAIN</span>
15
            <ipu-select
15
            <common-select
16 16
              v-model="panelData.function.domain"
17 17
              :options="domainList"
18 18
              :props-map="domainMap"
19 19
              @change="changeDomain(panelData.function.domain)"
20
            ></ipu-select>
20
            ></common-select>
21 21
          </div>
22 22
          <div class="form-item">
23 23
            <span class="form-item-title">NAME</span>
24
            <ipu-select
24
            <common-select
25 25
              v-model="panelData.function.name"
26 26
              class="select"
27 27
              :props-map="domainMap"
28 28
              :options="nameList"
29 29
              @change="changeName(panelData.function.name)"
30
            ></ipu-select>
30
            ></common-select>
31 31
          </div>
32 32
          <h4 class="form-title">函数参数</h4>
33 33
          <param-item :item-list="panelData.function?.params"></param-item>

+ 10 - 10
src/views/_components/panel/PanelGlobal.vue

@ -8,27 +8,27 @@
8 8
          label-position="top"
9 9
        >
10 10
          <el-form-item label="服务名称" prop="name">
11
            <ipu-input
11
            <el-input
12 12
              v-model="basicFormData.name"
13 13
              placeholder="请输入场景名"
14
            ></ipu-input>
14
            ></el-input>
15 15
          </el-form-item>
16 16
          <el-form-item label="服务路径" prop="name">
17
            <ipu-input
17
            <el-input
18 18
              v-model="basicFormData.path"
19 19
              placeholder="请输入路径"
20
            ></ipu-input>
20
            ></el-input>
21 21
          </el-form-item>
22 22
          <el-form-item label="服务方法" prop="method">
23
            <ipu-select
23
            <el-select
24 24
              v-model="basicFormData.method"
25 25
              class="form-item"
26 26
              :options="methodsOptions"
27 27
              placeholder="请选择服务方法"
28
            ></ipu-select>
28
            ></el-select>
29 29
          </el-form-item>
30 30
          <el-form-item label="服务描述">
31
            <ipu-input
31
            <el-input
32 32
              v-model="basicFormData.desc"
33 33
              type="textarea"
34 34
              clearable
@ -36,7 +36,7 @@
36 36
              maxlength="200"
37 37
              show-word-limit
38 38
              placeholder="请输入服务描述"
39
            ></ipu-input>
39
            ></el-input>
40 40
          </el-form-item>
41 41
        </el-form>
42 42
      </el-tab-pane>
@ -75,7 +75,7 @@
75 75
76 76
    <!-- 自定义属性声明 -->
77 77
    <!-- 模型声明 -->
78
    <ipu-table
78
    <el-table
79 79
      v-if="activeName === 'models' || activeName === 'customAttrs'"
80 80
      class="global-table"
81 81
      :table-header="table[activeName]?.header"
@ -100,7 +100,7 @@
100 100
          </template>
101 101
        </el-popconfirm>
102 102
      </template>
103
    </ipu-table>
103
    </el-table>
104 104
  </div>
105 105
  <dialog-panel
106 106
    v-if="isShowPanel"

+ 3 - 3
src/views/_components/panel/PanelHttp.vue

@ -13,10 +13,10 @@
13 13
          <div class="panel-content">
14 14
            <!-- 请求参数 -->
15 15
            <h4 class="form-title">接口参数</h4>
16
            <ipu-form
17
              :model="panelData?.function?.formValues"
16
            <common-form
18 17
              :forms="panelData?.function?.forms"
19
            ></ipu-form>
18
              :form-values="panelData?.function?.formValues"
19
            ></common-form>
20 20
21 21
            <!-- 请求头 -->
22 22
            <h4 class="form-title">请求头</h4>

+ 8 - 24
src/views/_components/panel/PanelSql.vue

@ -9,14 +9,14 @@
9 9
          label-position="top"
10 10
        >
11 11
          <el-form-item label="服务名称" prop="name">
12
            <ipu-input
12
            <el-input
13 13
              v-model="panelData.basicData.name"
14 14
              placeholder="请输入场景名"
15 15
              @change="changeName"
16
            ></ipu-input>
16
            ></el-input>
17 17
          </el-form-item>
18 18
          <el-form-item label="服务描述">
19
            <ipu-input
19
            <el-input
20 20
              v-model="panelData.basicData.desc"
21 21
              type="textarea"
22 22
              clearable
@ -24,26 +24,10 @@
24 24
              maxlength="200"
25 25
              show-word-limit
26 26
              placeholder="请输入服务描述"
27
            ></ipu-input>
27
            ></el-input>
28 28
          </el-form-item>
29 29
        </el-form>
30
31 30
        <!-- 高级设置 -->
32
        <!-- <div class="collapse" @click="showMoreSettings = !showMoreSettings">
33
          <span>高级设置</span>
34
          <el-icon v-if="showMoreSettings" class="icon"><ArrowUp ></ArrowUp></el-icon>
35
          <el-icon v-else class="icon"><ArrowDown ></ArrowDown></el-icon>
36
          <span class="line"></span>
37
        </div>
38
39
        <el-form v-show="showMoreSettings" :model="seniorData" label-position="top">
40
          <el-form-item label="节点ID" >
41
            <ipu-input v-model="seniorData.nodeId" placeholder="请输入节点ID" ></ipu-input>
42
          </el-form-item>
43
          <el-form-item label="下一节点">
44
            <ipu-input v-model="seniorData.nextNode" disabled ></ipu-input>
45
          </el-form-item>
46
        </el-form> -->
47 31
      </el-tab-pane>
48 32
      <el-tab-pane label="输入输出" name="input-output">
49 33
        <input-output-tab
@ -56,12 +40,12 @@
56 40
          <div class="form-title">
57 41
            <h5>数据源</h5>
58 42
          </div>
59
          <ipu-select
43
          <common-select
60 44
            v-model="panelData.function.datasource"
61 45
            class="int-select"
62 46
            :props-map="propsMap"
63 47
            :options="datasources"
64
          ></ipu-select>
48
          ></common-select>
65 49
        </div>
66 50
        <div class="form-item">
67 51
          <div class="form-title">
@ -70,11 +54,11 @@
70 54
              脚本编辑器
71 55
            </el-button>
72 56
          </div>
73
          <ipu-input
57
          <el-input
74 58
            v-model="panelData.function.sql"
75 59
            v-bind="attributes"
76 60
            disabled
77
          ></ipu-input>
61
          ></el-input>
78 62
          <!-- <div class="editor">
79 63
            <my-code
80 64
              :editorValue="panelData.function.sql"

+ 4 - 6
src/views/_components/panel/PanelStart.vue

@ -3,7 +3,7 @@
3 3
    <el-tabs v-model="activeName">
4 4
      <el-tab-pane label="功能" name="action">
5 5
        <el-button type="success" @click="importData">引入</el-button>
6
        <ipu-table
6
        <common-table
7 7
          class="table"
8 8
          :table-header="tableHeader"
9 9
          :table-data="panelData.function.tableData"
@ -20,7 +20,7 @@
20 20
              </template>
21 21
            </el-popconfirm>
22 22
          </template>
23
        </ipu-table>
23
        </common-table>
24 24
      </el-tab-pane>
25 25
    </el-tabs>
26 26
  </div>
@ -38,13 +38,13 @@
38 38
    </el-radio-group>
39 39
40 40
    <!-- 数据展示 -->
41
    <ipu-table
41
    <common-table
42 42
      class="table"
43 43
      :table-header="table[selectTab].header"
44 44
      :table-data="table[selectTab].data"
45 45
      :is-check="true"
46 46
      @selection-change="handleSelectChange"
47
    ></ipu-table>
47
    ></common-table>
48 48
  </dialog-panel>
49 49
</template>
50 50
@ -102,8 +102,6 @@ const tableHeader = ref([
102 102
  }
103 103
]);
104 104
105
// const tableData = ref(props.targetNode.cell.getData()?.attrsData ? props.targetNode.cell.getData()?.attrsData : [])
106
107 105
watch(
108 106
  panelData,
109 107
  () => {

+ 2 - 2
src/views/_components/panel/PanelSubFlow.vue

@ -14,12 +14,12 @@
14 14
          <div class="form-title">
15 15
            <h5>子流程</h5>
16 16
          </div>
17
          <ipu-select
17
          <common-select
18 18
            v-model="panelData.function.datasource"
19 19
            class="int-select"
20 20
            :props-map="propsMap"
21 21
            :options="subflowList"
22
          ></ipu-select>
22
          ></common-select>
23 23
        </div>
24 24
        <div class="form-item">
25 25
          <div class="form-title">

+ 6 - 6
src/views/_components/panel/common/AddFormItem.vue

@ -6,24 +6,24 @@
6 6
        <span>VALUE</span>
7 7
      </li>
8 8
      <li v-for="(item, index) in datas" :key="index" class="form-item">
9
        <ipu-input
9
        <el-input
10 10
          v-model="item.key"
11 11
          class="int"
12 12
          placeholder="请输入key"
13
        ></ipu-input>
14
        <ipu-input
13
        ></el-input>
14
        <el-input
15 15
          v-if="!options.length"
16 16
          v-model="item.value"
17 17
          class="int int2"
18 18
          placeholder="请输入value"
19
        ></ipu-input>
20
        <ipu-select
19
        ></el-input>
20
        <el-select
21 21
          v-if="options && options.length"
22 22
          v-model="item.value"
23 23
          class="int int2"
24 24
          placeholder="请选择"
25 25
          :options="options"
26
        ></ipu-select>
26
        ></el-select>
27 27
        <el-icon
28 28
          v-if="index < datas.length - 1"
29 29
          class="icon"

+ 2 - 2
src/views/_components/panel/common/AttrInfo.vue

@ -7,12 +7,12 @@
7 7
    </el-radio-group>
8 8
9 9
    <!-- 数据 -->
10
    <ipu-table
10
    <common-table
11 11
      :table-header="table[active]?.header"
12 12
      :table-data="table[active]?.data"
13 13
      :is-check="true"
14 14
      @selection-change="handleSelectionChange"
15
    ></ipu-table>
15
    ></common-table>
16 16
  </div>
17 17
</template>
18 18

+ 4 - 4
src/views/_components/panel/common/CommonPanel.vue

@ -10,14 +10,14 @@
10 10
          label-position="top"
11 11
        >
12 12
          <el-form-item label="服务名称" prop="name">
13
            <ipu-input
13
            <el-input
14 14
              v-model="panelData.basicData.name"
15 15
              placeholder="请输入场景名"
16 16
              @change="changeName"
17
            ></ipu-input>
17
            ></el-input>
18 18
          </el-form-item>
19 19
          <el-form-item label="服务描述">
20
            <ipu-input
20
            <el-input
21 21
              v-model="panelData.basicData.desc"
22 22
              type="textarea"
23 23
              clearable
@ -25,7 +25,7 @@
25 25
              maxlength="200"
26 26
              show-word-limit
27 27
              placeholder="请输入服务描述"
28
            ></ipu-input>
28
            ></el-input>
29 29
          </el-form-item>
30 30
        </el-form>
31 31
      </el-tab-pane>

+ 10 - 10
src/views/_components/panel/common/ParamItem.vue

@ -19,7 +19,7 @@
19 19
        <span>{{ item.desc || '-' }}</span>
20 20
      </el-col>
21 21
      <el-col :span="6">
22
        <ipu-select
22
        <common-select
23 23
          v-model="item.varType"
24 24
          :options="
25 25
            item.type.toLowerCase() === 'string' ||
@ -28,40 +28,40 @@
28 28
              ? contantTypes
29 29
              : varTypes
30 30
          "
31
        ></ipu-select>
31
        ></common-select>
32 32
      </el-col>
33 33
      <el-col :span="6">
34 34
        <!-- string -->
35
        <ipu-input
35
        <el-input
36 36
          v-if="
37 37
            item.varType === 'constant' && item.type.toLowerCase() === 'string'
38 38
          "
39 39
          v-model="item.value"
40
        ></ipu-input>
40
        ></el-input>
41 41
        <!--- number -->
42
        <ipu-input-num
42
        <el-input-num
43 43
          v-else-if="
44 44
            item.varType === 'constant' && item.type.toLowerCase() === 'int'
45 45
          "
46 46
          v-model="item.value"
47 47
          controls-position="right"
48 48
          class="int"
49
        ></ipu-input-num>
49
        ></el-input-num>
50 50
        <!-- bollean -->
51
        <ipu-select
51
        <common-select
52 52
          v-else-if="
53 53
            item.varType === 'constant' && item.type.toLowerCase() === 'Boolean'
54 54
          "
55 55
          v-model="item.value"
56 56
          :options="bolleanList"
57
        ></ipu-select>
57
        ></common-select>
58 58
        <!-- 变量 -->
59
        <ipu-select
59
        <common-select
60 60
          v-else-if="item.varType === 'var'"
61 61
          v-model="item.value"
62 62
          :options="globalDataBus"
63 63
          :props-map="varPropsMap"
64
        ></ipu-select>
64
        ></common-select>
65 65
        <span v-else>-</span>
66 66
      </el-col>
67 67
    </el-row>

+ 4 - 1
src/views/_components/panel/global/CustomDetail.vue

@ -8,7 +8,10 @@
8 8
        <el-input v-model="formData.name"></el-input>
9 9
      </el-form-item>
10 10
      <el-form-item label="属性类型">
11
        <ipu-select v-model="formData.type" :options="typeList"></ipu-select>
11
        <common-select
12
          v-model="formData.type"
13
          :options="typeList"
14
        ></common-select>
12 15
      </el-form-item>
13 16
      <template
14 17
        v-if="formData.type === 'array' || formData.type === 'object'"

+ 3 - 3
src/views/_components/panel/global/CustomDetailList.vue

@ -1,7 +1,7 @@
1 1
<template>
2 2
  <div class="custom-detail-list">
3 3
    <div class="model-table">
4
      <ipu-table :table-header="table?.header" :table-data="table?.data">
4
      <common-table :table-header="table?.header" :table-data="table?.data">
5 5
        <template #custom="scope">
6 6
          <ipu-popconfirm
7 7
            :btn-icon="'Delete'"
@ -9,10 +9,10 @@
9 9
            @confirm="confirmEvent(scope.row)"
10 10
          ></ipu-popconfirm>
11 11
        </template>
12
      </ipu-table>
12
      </common-table>
13 13
    </div>
14 14
    <div class="model-footer">
15
      <ipu-pagination :page="table[active]?.page"></ipu-pagination>
15
      <common-pagination :page="table[active]?.page"></common-pagination>
16 16
    </div>
17 17
  </div>
18 18
</template>

+ 5 - 5
src/views/_components/panel/global/ImportModel.vue

@ -3,10 +3,10 @@
3 3
    <div class="import-header">
4 4
      <el-form :model="formData" :inline="true">
5 5
        <el-form-item label="模型名称">
6
          <ipu-input v-model="formData.name"></ipu-input>
6
          <el-input v-model="formData.name"></el-input>
7 7
        </el-form-item>
8 8
        <el-form-item label="模型ID">
9
          <ipu-input v-model="formData.id"></ipu-input>
9
          <el-input v-model="formData.id"></el-input>
10 10
        </el-form-item>
11 11
        <el-form-item>
12 12
          <el-button type="success" @click.stop="search">查询</el-button>
@ -15,7 +15,7 @@
15 15
      <el-button type="success" @click.stop="bacthAdd">批量添加</el-button>
16 16
    </div>
17 17
    <div class="import-content">
18
      <ipu-table
18
      <common-table
19 19
        :table-header="table.header"
20 20
        :table-data="table.data"
21 21
        :is-check="true"
@ -26,10 +26,10 @@
26 26
            <el-icon><View></View></el-icon>
27 27
          </el-button>
28 28
        </template>
29
      </ipu-table>
29
      </common-table>
30 30
    </div>
31 31
    <div class="import-footer">
32
      <ipu-pagination :page="table.page"></ipu-pagination>
32
      <common-pagination :page="table.page"></common-pagination>
33 33
    </div>
34 34
  </div>
35 35
  <dialog-panel v-if="showModelDetail" :dialog-data="dialogData">

+ 7 - 7
src/views/_components/panel/global/ModelDetail.vue

@ -8,19 +8,19 @@
8 8
    <!-- 基本信息 -->
9 9
    <el-form v-show="active === 'basic'" :model="formData" label-position="top">
10 10
      <el-form-item label="模型ID">
11
        <ipu-input v-model="formData.id" disabled></ipu-input>
11
        <common-input v-model="formData.id" disabled></common-input>
12 12
      </el-form-item>
13 13
      <el-form-item label="模型名称">
14
        <ipu-input v-model="formData.name" disabled></ipu-input>
14
        <el-input v-model="formData.name" disabled></el-input>
15 15
      </el-form-item>
16 16
      <el-form-item label="描述">
17
        <ipu-input
17
        <el-input
18 18
          v-model="formData.desc"
19 19
          type="textarea"
20 20
          rows="10"
21 21
          maxlength="1000"
22 22
          disabled
23
        ></ipu-input>
23
        ></el-input>
24 24
      </el-form-item>
25 25
    </el-form>
26 26
@ -30,7 +30,7 @@
30 30
      class="model-content"
31 31
    >
32 32
      <div class="model-table">
33
        <ipu-table
33
        <common-table
34 34
          :table-header="table[active]?.header"
35 35
          :table-data="table[active]?.data"
36 36
        >
@ -39,10 +39,10 @@
39 39
              <el-icon><View></View></el-icon>
40 40
            </el-button>
41 41
          </template>
42
        </ipu-table>
42
        </common-table>
43 43
      </div>
44 44
      <div class="model-footer">
45
        <ipu-pagination :page="table[active]?.page"></ipu-pagination>
45
        <common-pagination :page="table[active]?.page"></common-pagination>
46 46
      </div>
47 47
    </div>
48 48

+ 16 - 16
src/views/_components/panel/global/ValidateRules.vue

@ -4,50 +4,50 @@
4 4
    <div class="rules">
5 5
      <el-form :inline="true" label-position="top">
6 6
        <el-form-item class="item" label="最小">
7
          <ipu-input
7
          <el-input
8 8
            v-model="validateRules.min"
9 9
            class="form-item"
10 10
            placeholder="最小值"
11
          ></ipu-input>
11
          ></el-input>
12 12
        </el-form-item>
13 13
        <el-form-item class="item" label="最大">
14
          <ipu-input
14
          <el-input
15 15
            v-model="validateRules.max"
16 16
            class="form-item"
17 17
            placeholder="最大值"
18
          ></ipu-input>
18
          ></el-input>
19 19
        </el-form-item>
20 20
21 21
        <el-form-item class="item" label="小于">
22
          <ipu-input
22
          <el-input
23 23
            v-model="validateRules.more"
24 24
            class="form-item"
25 25
            placeholder="小于最大值校验"
26
          ></ipu-input>
26
          ></el-input>
27 27
        </el-form-item>
28 28
29 29
        <el-form-item class="item" label="大于">
30
          <ipu-input
30
          <el-input
31 31
            v-model="validateRules.less"
32 32
            class="form-item"
33 33
            placeholder="大于最大值校验"
34
          ></ipu-input>
34
          ></el-input>
35 35
        </el-form-item>
36 36
37 37
        <el-form-item class="item" label="等于">
38
          <ipu-input
38
          <el-input
39 39
            v-model="validateRules.equal"
40 40
            class="form-item"
41 41
            placeholder="等于值校验"
42
          ></ipu-input>
42
          ></el-input>
43 43
        </el-form-item>
44 44
45 45
        <el-form-item class="item" label="不等于">
46
          <ipu-input
46
          <el-input
47 47
            v-model="validateRules.unequal"
48 48
            class="form-item"
49 49
            placeholder="不等于值校验"
50
          ></ipu-input>
50
          ></el-input>
51 51
        </el-form-item>
52 52
53 53
        <el-form-item
@ -67,11 +67,11 @@
67 67
          class="item"
68 68
          label="小数刻度"
69 69
        >
70
          <ipu-input
70
          <el-input
71 71
            v-model="validateRules.scale"
72 72
            class="form-item"
73 73
            placeholder="小数刻度校验"
74
          ></ipu-input>
74
          ></el-input>
75 75
        </el-form-item>
76 76
77 77
        <el-form-item
@ -79,11 +79,11 @@
79 79
          class="item"
80 80
          label="小数精度"
81 81
        >
82
          <ipu-input
82
          <el-input
83 83
            v-model="validateRules.precision"
84 84
            class="form-item"
85 85
            placeholder="小数精度校验"
86
          ></ipu-input>
86
          ></el-input>
87 87
        </el-form-item>
88 88
      </el-form>
89 89
    </div>

+ 2 - 2
src/views/_components/panel/sql-components/InputOutputTab.vue

@ -10,7 +10,7 @@
10 10
    </div>
11 11
12 12
    <!-- input -->
13
    <ipu-table
13
    <common-table
14 14
      :table-header="table[active]?.header"
15 15
      :table-data="table[active]?.data"
16 16
    >
@ -22,7 +22,7 @@
22 22
          <Delete></Delete>
23 23
        </el-icon>
24 24
      </template>
25
    </ipu-table>
25
    </common-table>
26 26
    <!-- output -->
27 27
  </div>
28 28

+ 23 - 4
src/views/flow/Flow.vue

@ -17,24 +17,43 @@ import { ref, getCurrentInstance, onMounted } from 'vue';
17 17
18 18
/** x6相关end */
19 19
import { useRoute } from 'vue-router';
20
import { useStore } from 'vuex';
20 21
import SubFlow from '../_components/_flow/Index.vue';
21 22
import nodes from '../_components/_flow/nodes.js';
22 23
23 24
import * as api from '../../api/flow';
24 25
import NodeDataFormate from '../_components/_flow/nodeDataFormate.js';
25 26
27
const store = useStore();
26 28
const nodeList = ref(nodes.nodes);
27 29
28 30
const { proxy } = getCurrentInstance();
29 31
const route = useRoute();
30 32
const subFlowDetail = ref(null);
31
const subFlowId = ref(route.query.id);
33
const flowId = ref(route.query.id);
34
const sysTemId = ref(route.query.sysId);
32 35
33 36
// 获取流程数据
34 37
async function getLogicDetailById() {
35
  await api.getLogicDetailById(subFlowId.value).then((res) => {
38
  await api.getLogicDetailById(flowId.value).then((res) => {
36 39
    if (res.resultCode === '0') {
37 40
      subFlowDetail.value = res.result;
41
      const panelGlobal = {};
42
      panelGlobal[flowId.value] = JSON.parse(res.result?.databusData) || {};
43
      localStorage.setItem('panelGlobal', JSON.stringify(panelGlobal));
44
      store.commit('setBreadData', [
45
        { name: '系统管理', to: { name: 'SystemList' } },
46
        {
47
          name: subFlowDetail.value.systemName,
48
          to: {
49
            name: 'SystemDetail',
50
            query: {
51
              id: sysTemId.value
52
            }
53
          }
54
        },
55
        { name: subFlowDetail.value.name }
56
      ]);
38 57
    } else {
39 58
      proxy.$message.error(res.resultMsg);
40 59
    }
@ -50,12 +69,12 @@ async function updateFlowData(graph, type) {
50 69
  const databusData = JSON.parse(localStorage.getItem('panelGlobal')) || {};
51 70
  const params = {
52 71
    jsonData: JSON.stringify(graph),
53
    databusData: JSON.stringify(databusData[subFlowId.value]),
72
    databusData: JSON.stringify(databusData[flowId.value]),
54 73
    stateValue: type,
55 74
    nodesData: getNodesData(graph)
56 75
  };
57 76
  await api
58
    .updateFlowDataById(params, subFlowId.value)
77
    .updateFlowDataById(params, flowId.value)
59 78
    .then((res) => {
60 79
      if (res.resultCode === '0') {
61 80
        proxy.$message.success('流程保存成功!');

+ 6 - 0
src/views/flow/SystemDetail.vue

@ -83,6 +83,7 @@
83 83
<script setup>
84 84
import { ref, onMounted, getCurrentInstance, computed, watch } from 'vue';
85 85
import { useRoute, useRouter } from 'vue-router';
86
import { useStore } from 'vuex';
86 87
import { formConfig } from './_config';
87 88
import ApiDetailPage from './_components/ApiDetailPage.vue';
88 89
import * as api from '../../api/flow';
@ -96,6 +97,7 @@ const drawerType = ref('module');
96 97
const operateType = ref('create');
97 98
const apiDetail = ref(null);
98 99
const versionState = ref('');
100
const store = useStore();
99 101
100 102
const systemId = computed(() => route.query.id);
101 103
const curVersionId = ref('');
@ -144,6 +146,10 @@ async function getSystemDetail() {
144 146
      systemInfo.value = res.result;
145 147
      curVersionId.value = systemInfo.value.version.id;
146 148
      versionState.value = systemInfo.value.version.state;
149
      store.commit('setBreadData', [
150
        { name: '系统管理', to: { name: 'SystemList' } },
151
        { name: systemInfo.value.name }
152
      ]);
147 153
    } else {
148 154
      systemInfo.value = null;
149 155
    }

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

@ -128,11 +128,7 @@
128 128
      </div>
129 129
      <div class="card">
130 130
        <h4 class="sub-title">请求参数</h4>
131
        <!-- <ipu-input
132
          v-model="testRequest.params"
133
          class="result"
134
          v-bind="attributes"
135
        ></ipu-input> -->
131
136 132
        <div>
137 133
          <JsonEditorVue
138 134
            v-model="testRequest.params"

+ 10 - 0
src/views/sub-flow/SubFlow.vue

@ -17,12 +17,15 @@ import { ref, getCurrentInstance, onMounted } from 'vue';
17 17
18 18
/** x6相关end */
19 19
import { useRoute } from 'vue-router';
20
import { useStore } from 'vuex';
20 21
import SubFlow from '../_components/_flow/Index.vue';
21 22
import nodes from '../_components/_flow/nodes.js';
22 23
23 24
import * as api from '../../api/subflow';
24 25
import NodeDataFormate from '../_components/_flow/nodeDataFormate.js';
25 26
27
const store = useStore();
28
26 29
const nodeList = ref(nodes.nodes);
27 30
nodeList.value.map((item) => {
28 31
  if (item.nodes?.length) {
@ -41,6 +44,13 @@ async function getSubFlowDetailById() {
41 44
  await api.getSubFlowDetailById(subFlowId.value).then((res) => {
42 45
    if (res.resultCode === '0') {
43 46
      subFlowDetail.value = res.result;
47
      const panelGlobal = {};
48
      panelGlobal[subFlowId.value] = JSON.parse(res.result?.databusData) || {};
49
      localStorage.setItem('panelGlobal', JSON.stringify(panelGlobal));
50
      store.commit('setBreadData', [
51
        { name: '系统管理', to: { name: 'SystemList' } },
52
        { name: subFlowDetail.value.name }
53
      ]);
44 54
    } else {
45 55
      proxy.$message.error(res.resultMsg);
46 56
    }