Просмотр исходного кода

fixed: 修改流程json编辑器不生效的bug

liuyang лет назад: 2
Родитель
Сommit
607ee0104c

+ 1 - 0
.gitignore

@ -14,6 +14,7 @@ stats.html
14 14
aiot
15 15
dist-ssr
16 16
*.local
17
*.zip
17 18
18 19
# Editor directories and files
19 20
.vscode/*

+ 171 - 0
package-lock.json

@ -82,6 +82,13 @@
82 82
      "integrity": "sha512-JlQpbN2bBRZEs5J8xbpKf3+SU3NUj604Pg2Lm1/RslXk3m5ix9utQ6IYQUs/FGglPvPEF2zmdY9/aL3zUrbNUw==",
83 83
      "requires": {
84 84
        "vue-demi": "^0.13.11"
85
      },
86
      "dependencies": {
87
        "vue-demi": {
88
          "version": "0.13.11",
89
          "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.11.tgz",
90
          "integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A=="
91
        }
85 92
      }
86 93
    },
87 94
    "@babel/code-frame": {
@ -591,6 +598,170 @@
591 598
        "fastq": "^1.6.0"
592 599
      }
593 600
    },
601
    "@originjs/vite-plugin-commonjs": {
602
      "version": "1.0.3",
603
      "resolved": "https://registry.npmjs.org/@originjs/vite-plugin-commonjs/-/vite-plugin-commonjs-1.0.3.tgz",
604
      "integrity": "sha512-KuEXeGPptM2lyxdIEJ4R11+5ztipHoE7hy8ClZt3PYaOVQ/pyngd2alaSrPnwyFeOW1UagRBaQ752aA1dTMdOQ==",
605
      "requires": {
606
        "esbuild": "^0.14.14"
607
      },
608
      "dependencies": {
609
        "@esbuild/linux-loong64": {
610
          "version": "0.14.54",
611
          "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz",
612
          "integrity": "sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==",
613
          "optional": true
614
        },
615
        "esbuild": {
616
          "version": "0.14.54",
617
          "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz",
618
          "integrity": "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==",
619
          "requires": {
620
            "@esbuild/linux-loong64": "0.14.54",
621
            "esbuild-android-64": "0.14.54",
622
            "esbuild-android-arm64": "0.14.54",
623
            "esbuild-darwin-64": "0.14.54",
624
            "esbuild-darwin-arm64": "0.14.54",
625
            "esbuild-freebsd-64": "0.14.54",
626
            "esbuild-freebsd-arm64": "0.14.54",
627
            "esbuild-linux-32": "0.14.54",
628
            "esbuild-linux-64": "0.14.54",
629
            "esbuild-linux-arm": "0.14.54",
630
            "esbuild-linux-arm64": "0.14.54",
631
            "esbuild-linux-mips64le": "0.14.54",
632
            "esbuild-linux-ppc64le": "0.14.54",
633
            "esbuild-linux-riscv64": "0.14.54",
634
            "esbuild-linux-s390x": "0.14.54",
635
            "esbuild-netbsd-64": "0.14.54",
636
            "esbuild-openbsd-64": "0.14.54",
637
            "esbuild-sunos-64": "0.14.54",
638
            "esbuild-windows-32": "0.14.54",
639
            "esbuild-windows-64": "0.14.54",
640
            "esbuild-windows-arm64": "0.14.54"
641
          }
642
        },
643
        "esbuild-android-64": {
644
          "version": "0.14.54",
645
          "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz",
646
          "integrity": "sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==",
647
          "optional": true
648
        },
649
        "esbuild-android-arm64": {
650
          "version": "0.14.54",
651
          "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz",
652
          "integrity": "sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==",
653
          "optional": true
654
        },
655
        "esbuild-darwin-64": {
656
          "version": "0.14.54",
657
          "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz",
658
          "integrity": "sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==",
659
          "optional": true
660
        },
661
        "esbuild-darwin-arm64": {
662
          "version": "0.14.54",
663
          "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz",
664
          "integrity": "sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==",
665
          "optional": true
666
        },
667
        "esbuild-freebsd-64": {
668
          "version": "0.14.54",
669
          "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz",
670
          "integrity": "sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==",
671
          "optional": true
672
        },
673
        "esbuild-freebsd-arm64": {
674
          "version": "0.14.54",
675
          "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz",
676
          "integrity": "sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==",
677
          "optional": true
678
        },
679
        "esbuild-linux-32": {
680
          "version": "0.14.54",
681
          "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz",
682
          "integrity": "sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==",
683
          "optional": true
684
        },
685
        "esbuild-linux-64": {
686
          "version": "0.14.54",
687
          "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz",
688
          "integrity": "sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==",
689
          "optional": true
690
        },
691
        "esbuild-linux-arm": {
692
          "version": "0.14.54",
693
          "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz",
694
          "integrity": "sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==",
695
          "optional": true
696
        },
697
        "esbuild-linux-arm64": {
698
          "version": "0.14.54",
699
          "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz",
700
          "integrity": "sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==",
701
          "optional": true
702
        },
703
        "esbuild-linux-mips64le": {
704
          "version": "0.14.54",
705
          "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz",
706
          "integrity": "sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==",
707
          "optional": true
708
        },
709
        "esbuild-linux-ppc64le": {
710
          "version": "0.14.54",
711
          "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz",
712
          "integrity": "sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==",
713
          "optional": true
714
        },
715
        "esbuild-linux-riscv64": {
716
          "version": "0.14.54",
717
          "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz",
718
          "integrity": "sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==",
719
          "optional": true
720
        },
721
        "esbuild-linux-s390x": {
722
          "version": "0.14.54",
723
          "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz",
724
          "integrity": "sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==",
725
          "optional": true
726
        },
727
        "esbuild-netbsd-64": {
728
          "version": "0.14.54",
729
          "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz",
730
          "integrity": "sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==",
731
          "optional": true
732
        },
733
        "esbuild-openbsd-64": {
734
          "version": "0.14.54",
735
          "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz",
736
          "integrity": "sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==",
737
          "optional": true
738
        },
739
        "esbuild-sunos-64": {
740
          "version": "0.14.54",
741
          "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz",
742
          "integrity": "sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==",
743
          "optional": true
744
        },
745
        "esbuild-windows-32": {
746
          "version": "0.14.54",
747
          "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz",
748
          "integrity": "sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==",
749
          "optional": true
750
        },
751
        "esbuild-windows-64": {
752
          "version": "0.14.54",
753
          "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz",
754
          "integrity": "sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==",
755
          "optional": true
756
        },
757
        "esbuild-windows-arm64": {
758
          "version": "0.14.54",
759
          "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz",
760
          "integrity": "sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==",
761
          "optional": true
762
        }
763
      }
764
    },
594 765
    "@rollup/pluginutils": {
595 766
      "version": "4.2.1",
596 767
      "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",

+ 1 - 0
package.json

@ -18,6 +18,7 @@
18 18
    "@antv/x6-plugin-selection": "^2.1.5",
19 19
    "@antv/x6-plugin-snapline": "^2.1.6",
20 20
    "@antv/x6-vue-shape": "^2.0.10",
21
    "@originjs/vite-plugin-commonjs": "^1.0.3",
21 22
    "@typescript-eslint/parser": "^5.42.1",
22 23
    "@vitejs/plugin-vue-jsx": "^3.0.0",
23 24
    "@vueuse/core": "^9.5.0",

BIN
qb-logic-flow-front.zip


+ 1 - 0
src/App.vue

@ -112,5 +112,6 @@ body {
112 112
  background-color: #f9f9f9;
113 113
  font-size: 12px;
114 114
  font-family: 'PingFang SC';
115
  user-select: none;
115 116
}
116 117
</style>

+ 9 - 3
src/api/flow.ts

@ -193,11 +193,17 @@ export function getFunctionList() {
193 193
}
194 194
195 195
// 测试接口
196
export function testLogic(data: any, id: any) {
196
export function logicModeUpdate(data: any, id: any) {
197 197
  return AIotRequest.patch({
198
    url: `{flow.logicMgmt}/${id}`,
198
    url: `${flow.logicMgmt}/${id}`,
199 199
    data
200 200
  });
201 201
}
202 202
203
//
203
// 接口测试
204
export function testLogic(data: any, id: any) {
205
  return AIotRequest.post({
206
    url: `${flow.testLogic}/${id}`,
207
    data
208
  });
209
}

+ 4 - 3
src/main.ts

@ -5,12 +5,14 @@
5 5
 * @LastEditTime: 2023-02-23 16:43:29
6 6
 * @Description: 主配置
7 7
 */
8
// eslint-disable-next-line import/no-extraneous-dependencies
9
// import 'jsoneditor';
8 10
import { createApp } from 'vue';
9 11
import CommonUI from 'common-module-ui';
10 12
import 'common-module-ui/lib/style.css';
11 13
import { setEventBus } from './utils/eventBus.js';
12 14
13
import { setupGlobalComponents } from './components/index';
15
// import { setupGlobalComponents } from './components/index';
14 16
15 17
// import CommonUI from './common-ui/common-module-ui.js';
16 18
// import './common-ui/style.css';
@ -38,10 +40,9 @@ function render(props: any = {}) {
38 40
  setEventBus(app);
39 41
  app.use(router);
40 42
  app.use(CommonUI);
41
  console.log(CommonUI);
42 43
43 44
  app.use(store);
44
  setupGlobalComponents(app);
45
  // setupGlobalComponents(app);
45 46
  // 注册项目全局组件
46 47
  setupProductComponents(app);
47 48

+ 1 - 2
src/views/_components/panel/PanelFunction.vue

@ -38,13 +38,12 @@
38 38
</template>
39 39
40 40
<script setup>
41
import { getCurrentInstance, ref, watch } from 'vue';
41
import { ref, watch } from 'vue';
42 42
import CommonPanel from './common/CommonPanel.vue';
43 43
import InputOutputTab from './sql-components/InputOutputTab.vue';
44 44
import ParamItem from './common/ParamItem.vue';
45 45
import { getFunctionList } from '../../../api/flow';
46 46
47
const { proxy } = getCurrentInstance();
48 47
const props = defineProps({
49 48
  targetNode: {
50 49
    type: Object,

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

@ -97,7 +97,7 @@
97 97
import { getCurrentInstance, reactive, ref, watch } from 'vue';
98 98
import MyCode from '../_codemirror/MyCode.vue';
99 99
import InputOutputTab from './sql-components/InputOutputTab.vue';
100
import { getSQLList } from '../../../api/flow';
100
import { getSqlList } from '../../../api/flow';
101 101
102 102
const { proxy } = getCurrentInstance();
103 103
const props = defineProps({
@ -275,7 +275,7 @@ const propsMap = ref({
275 275
});
276 276
// 获取数据库列表
277 277
function getList() {
278
  getSQLList()
278
  getSqlList()
279 279
    .then((res) => {
280 280
      if (res.data.resultCode === '0') {
281 281
        datasources.value = res.data.result.map((item) => {

+ 1 - 1
src/views/_components/panel/PanelStart.vue

@ -196,7 +196,7 @@ function setDialogInfo() {
196 196
          'min-width': '150'
197 197
        }
198 198
      ],
199
      data: dataBus?.[flowId.value]?.customAttrs.data || []
199
      data: dataBus?.[flowId.value]?.customAttrs?.data || []
200 200
    }
201 201
  });
202 202
  const handleSelectChange = (checkeds) => {

+ 12 - 11
src/views/flow/_components/ApiDetailPage.vue

@ -130,28 +130,26 @@
130 130
        <h4 class="sub-title">请求参数</h4>
131 131
132 132
        <div>
133
          <JsonEditorVue
133
          <JsonEditor
134 134
            v-model="testRequest.params"
135 135
            class="editor"
136
            current-mode="code"
137
            :mode-list="['code']"
136 138
            @blur="validate"
137
          ></JsonEditorVue>
139
          ></JsonEditor>
138 140
        </div>
139 141
      </div>
140 142
141 143
      <div class="card">
142 144
        <h4 class="sub-title">响应参数</h4>
143
        <!-- <ipu-input
144
          v-model="testResponse"
145
          class="result"
146
          v-bind="attributes"
147
          disabled
148
        ></ipu-input> -->
149 145
        <div>
150
          <!-- <JsonEditorVue
146
          <JsonEditor
151 147
            v-model="testResponse"
152 148
            class="editor"
149
            current-mode="code"
150
            :mode-list="['code']"
153 151
            @blur="validate"
154
          ></JsonEditorVue> -->
152
          ></JsonEditor>
155 153
        </div>
156 154
      </div>
157 155
    </div>
@ -159,7 +157,7 @@
159 157
</template>
160 158
161 159
<script setup>
162
// import JsonEditorVue from 'json-editor-vue3';
160
import JsonEditor from 'json-editor-vue3';
163 161
import { getCurrentInstance, onMounted, ref, watch } from 'vue';
164 162
import { logicModeUpdate, testLogic } from '../../../api/flow';
165 163
@ -405,4 +403,7 @@ onMounted(() => {});
405 403
  background: rgba(0, 0, 0, 0.4);
406 404
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
407 405
}
406
.full-screen-container {
407
  background-color: #000 !important;
408
}
408 409
</style>

+ 32 - 32
src/views/sub-flow/SubFlowList.vue

@ -23,7 +23,7 @@
23 23
  </common-drawer>
24 24
</template>
25 25
26
<script setup lang="ts">
26
<script setup>
27 27
import { ref, getCurrentInstance, computed } from 'vue';
28 28
import { useRouter } from 'vue-router';
29 29
import { searchConfig, formConfig } from './_config';
@ -32,29 +32,29 @@ import * as api from '../../api/subflow';
32 32
const { proxy } = getCurrentInstance();
33 33
const router = useRouter();
34 34
35
const modeMap = <any>{
35
const modeMap = {
36 36
  add: '新增子流程',
37 37
  edit: '编辑子流程',
38 38
  copy: '复制子流程'
39 39
};
40 40
const mode = ref('add');
41
const subFlowId = ref<any>('');
41
const subFlowId = ref('');
42 42
// dialog
43 43
const drawerTitle = computed(() => modeMap[mode.value]);
44
const showDrawer = ref<any>(false);
44
const showDrawer = ref(false);
45 45
46 46
// table
47
const tableHeader = ref<any>([
47
const tableHeader = ref([
48 48
  { name: 'name', label: '名称', 'min-width': 200 },
49 49
  { name: 'desc', label: '描述', 'min-width': 200 },
50 50
  { name: 'stateDesc', label: '状态', 'min-width': 200 },
51 51
  { name: 'referencesNum', label: '关联数', 'min-width': 200 },
52 52
  { name: 'custom', type: 'custom', label: '操作', fixed: 'right', width: 200 }
53 53
]);
54
const tableData = ref<any>([]);
54
const tableData = ref([]);
55 55
56
function parseBtns(item: any) {
57
  const btns = <any>[
56
function parseBtns(item) {
57
  const btns = [
58 58
    // eslint-disable-next-line no-use-before-define
59 59
    { label: '详情', name: 'view', onClick: view },
60 60
    // eslint-disable-next-line no-use-before-define
@ -83,7 +83,7 @@ function parseBtns(item: any) {
83 83
  return btns;
84 84
}
85 85
// 功能按钮
86
const functionButtons = ref<any>([
86
const functionButtons = ref([
87 87
  {
88 88
    label: '新增子流程',
89 89
    name: 'add',
@ -93,7 +93,7 @@ const functionButtons = ref<any>([
93 93
  }
94 94
]);
95 95
// 页脚
96
const page = ref<any>({
96
const page = ref({
97 97
  pageSize: 10,
98 98
  current: 1,
99 99
  total: 0
@ -101,7 +101,7 @@ const page = ref<any>({
101 101
102 102
// 获取子流程列表
103 103
function getSubFlowList() {
104
  const params = <any>{
104
  const params = {
105 105
    name: '',
106 106
    pageNumber: 1,
107 107
    pageSize: 10
@ -112,7 +112,7 @@ function getSubFlowList() {
112 112
      console.log(res);
113 113
      if (res.resultCode === '0') {
114 114
        tableData.value = res.result;
115
        tableData.value.map((item: any) => {
115
        tableData.value.map((item) => {
116 116
          item.actions = parseBtns(item);
117 117
          return item;
118 118
        });
@ -136,7 +136,7 @@ function create() {
136 136
}
137 137
138 138
// 初始化弹窗数据
139
function initDialogData(data: any) {
139
function initDialogData(data) {
140 140
  subFlowId.value = data.id;
141 141
  formConfig.value.subflow.formValues.name = data.name;
142 142
  formConfig.value.subflow.formValues.desc = data.desc;
@ -144,7 +144,7 @@ function initDialogData(data: any) {
144 144
}
145 145
146 146
// 详情
147
function view(item: any) {
147
function view(item) {
148 148
  router.push({
149 149
    name: 'SubFlow',
150 150
    query: {
@ -153,12 +153,12 @@ function view(item: any) {
153 153
  });
154 154
}
155 155
// 编辑子流程
156
function edit(data: any) {
156
function edit(data) {
157 157
  initDialogData(data);
158 158
  mode.value = 'edit';
159 159
}
160 160
// 删除子流程
161
function deleteFn(data: any) {
161
function deleteFn(data) {
162 162
  proxy
163 163
    .$confirm('确定要删除此子流程吗?', '警告', {
164 164
      confirmButtonText: '确定',
@ -181,9 +181,9 @@ function deleteFn(data: any) {
181 181
}
182 182
183 183
// 发布子流程
184
function publish(item: any) {
184
function publish(item) {
185 185
  // stateValue: 1:保存,2:提测;3:测试通过发布;
186
  const params = <any>{};
186
  const params = {};
187 187
  if (item.state === 'UNPUBLISHED') {
188 188
    params.stateValue = '2';
189 189
  } else if (item.state === 'PUBLISHED') {
@ -191,7 +191,7 @@ function publish(item: any) {
191 191
  }
192 192
  api
193 193
    .updateSubFlowById(params, item.id)
194
    .then((res: any) => {
194
    .then((res) => {
195 195
      if (res.resultCode === '0') {
196 196
        proxy.$message.success(res.resultMsg);
197 197
        getSubFlowList();
@ -199,14 +199,14 @@ function publish(item: any) {
199 199
        proxy.$message.error(res.resultMsg);
200 200
      }
201 201
    })
202
    .catch((err: any) => {
202
    .catch((err) => {
203 203
      proxy.$message.error(err);
204 204
    });
205 205
}
206 206
// 测试子流程节点
207 207
function test() {}
208 208
// 复制子流程
209
function copy(data: any) {
209
function copy(data) {
210 210
  initDialogData(data);
211 211
  mode.value = 'copy';
212 212
}
@ -214,10 +214,10 @@ function copy(data: any) {
214 214
// 发布子流程
215 215
216 216
// 创建子流程
217
function createSubFlow(params: any) {
217
function createSubFlow(params) {
218 218
  api
219 219
    .createSubFlow(params)
220
    .then((res: any) => {
220
    .then((res) => {
221 221
      if (res.resultCode === '0') {
222 222
        proxy.$message.success(res.resultMsg);
223 223
        getSubFlowList();
@ -227,16 +227,16 @@ function createSubFlow(params: any) {
227 227
        proxy.$message.error(res.resultMsg);
228 228
      }
229 229
    })
230
    .catch((err: any) => {
230
    .catch((err) => {
231 231
      proxy.$message.error(err);
232 232
    });
233 233
}
234 234
235 235
// 修改子流程
236
function updateSubFlowById(params: any) {
236
function updateSubFlowById(params) {
237 237
  api
238 238
    .updateSubFlowById(params, subFlowId.value)
239
    .then((res: any) => {
239
    .then((res) => {
240 240
      if (res.resultCode === '0') {
241 241
        proxy.$message.success('修改成功!');
242 242
        // eslint-disable-next-line no-use-before-define
@ -247,16 +247,16 @@ function updateSubFlowById(params: any) {
247 247
      // eslint-disable-next-line no-use-before-define
248 248
      closeDialog();
249 249
    })
250
    .catch((err: any) => {
250
    .catch((err) => {
251 251
      proxy.$message.error(err);
252 252
    });
253 253
}
254 254
255 255
// 复制子流程
256
function copySubFlowById(params: any) {
256
function copySubFlowById(params) {
257 257
  api
258 258
    .copySubFlowById(params, subFlowId.value)
259
    .then((res: any) => {
259
    .then((res) => {
260 260
      if (res.resultCode === '0') {
261 261
        proxy.$message.success('复制成功!');
262 262
        // eslint-disable-next-line no-use-before-define
@ -267,7 +267,7 @@ function copySubFlowById(params: any) {
267 267
      // eslint-disable-next-line no-use-before-define
268 268
      closeDialog();
269 269
    })
270
    .catch((err: any) => {
270
    .catch((err) => {
271 271
      proxy.$message.error(err);
272 272
    });
273 273
}
@ -290,14 +290,14 @@ function closeDialog() {
290 290
}
291 291
// 确认提交
292 292
function confirmDialog() {
293
  const params = <any>{
293
  const params = {
294 294
    name: formConfig.value.subflow.formValues.name,
295 295
    desc: formConfig.value.subflow.formValues.desc,
296 296
    databusData: '',
297 297
    jsonData: '',
298 298
    nodesData: {}
299 299
  };
300
  const param = <any>{
300
  const param = {
301 301
    name: formConfig.value.subflow.formValues.name,
302 302
    desc: formConfig.value.subflow.formValues.desc
303 303
  };

+ 2 - 0
vite.config.ts

@ -13,6 +13,7 @@ import qiankun from 'vite-plugin-qiankun';
13 13
// @ts-ignore
14 14
import viteCompression from 'vite-plugin-compression';
15 15
import { visualizer } from 'rollup-plugin-visualizer';
16
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';
16 17
17 18
// https://vitejs.dev/config/
18 19
// @ts-ignore
@ -23,6 +24,7 @@ export default defineConfig(({ mode }) => {
23 24
    base: mode === 'development' ? './' : './',
24 25
    plugins: [
25 26
      vue(),
27
      viteCommonjs(),
26 28
      visualizer({
27 29
        open: true, // 注意这里要设置为true,否则无效
28 30
        gzipSize: true,