Parcourir la source

组件流程开发

bwm il y a 1 an
Parent
révision
c71e5a6b01

+ 2
- 0
.npmrc Voir le fichier

@@ -2,3 +2,5 @@
2 2
 shamefully-hoist=true
3 3
 auto-install-peers=true
4 4
 strict-peer-dependencies=false
5
+@qomo:registry=https://packages.aliyun.com/669a1b3bbedb1acc325c96c0/npm/npm-registry/
6
+@qomo-platform:registry=https://packages.aliyun.com/669a1b3bbedb1acc325c96c0/npm/npm-registry/

+ 2
- 1
package.json Voir le fichier

@@ -16,7 +16,7 @@
16 16
   },
17 17
   "dependencies": {
18 18
     "@element-plus/icons-vue": "2.3.1",
19
-    "@qomo-platform/core": "^1.0.100",
19
+    "@qomo-platform/core": "^1.0.151",
20 20
     "@vueup/vue-quill": "1.2.0",
21 21
     "@vueuse/core": "10.6.1",
22 22
     "axios": "1.6.7",
@@ -33,6 +33,7 @@
33 33
     "pinia-plugin-persistedstate": "^3.2.1",
34 34
     "postcss-pxtorem": "^6.1.0",
35 35
     "prettier": "^3.2.5",
36
+    "uuid": "^10.0.0",
36 37
     "vite-plugin-qiankun": "^1.0.15",
37 38
     "vue": "3.3.9",
38 39
     "vue-router": "4.2.5"

+ 49
- 1
src/api/index.js Voir le fichier

@@ -1,3 +1,51 @@
1
+import request from "@/service/request";
1 2
 export function getDictCode(params) {
2
-  return request.get(`/sys/dictItem/type`,params);
3
+  return request.get(`/sys/dictItem/type`, params);
4
+}
5
+
6
+//保存流程图
7
+export function saveFlowModel(data) {
8
+  return request.post("/api/flowDefinition/saveModel", {}, data, {
9
+    message: {
10
+      success: `保存成功`,
11
+      error: true
12
+    }
13
+  });
14
+}
15
+//执行流程
16
+export function flowInstanceExecute(id) {
17
+  return request.post(`/api/dataIntegration/flowInstance/execute/${id}`, {}, {}, {
18
+    message: {
19
+      success: `流程开始运行`,
20
+      error: true
21
+    }
22
+  });
23
+}
24
+//查询数据源
25
+export function dataSourceList(params) {
26
+  return request.get("/api/group/treeList", params, {
27
+    error: true
28
+  });
29
+}
30
+//查询组件
31
+export function getComponentTree(params) {
32
+  return request.get("/api/componentGroup/getComponentTree", params, {
33
+    error: true
34
+  });
35
+}
36
+//查询数据库列表
37
+export function databaseListSchemas(params) {
38
+  return request.get('/api/database/listSchemas', params, {
39
+    error: true
40
+  });
41
+}
42
+
43
+//查询表
44
+export function listTablesBySchemaPage(params) {
45
+  return request.get('/api/database/listTablesBySchemaPage', params);
46
+}
47
+
48
+// 获取表字段
49
+export function listColumns(params) {
50
+  return request.get('/api/database/listColumns', params);
3 51
 }

+ 32
- 0
src/api/modelManagement.js Voir le fichier

@@ -0,0 +1,32 @@
1
+import request from "@/service/request";
2
+/*获取模型列表*/
3
+export function modelList(params) {
4
+    return request.get(`/cost-model/pageList`, params);
5
+}
6
+// /*新增小时费率*/
7
+// export function addHourRate(data) {
8
+//     return request.post("/hourRate/add", {}, data, {
9
+//         message: {
10
+//             success: "新增成功",
11
+//             error: true
12
+//         }
13
+//     });
14
+// }
15
+// /*编辑小时费率*/
16
+// export function editHourRate(data) {
17
+//     return request.post("/hourRate/edit", {}, data, {
18
+//         message: {
19
+//             success: "编辑成功",
20
+//             error: true
21
+//         }
22
+//     });
23
+// }
24
+/*删除*/
25
+export function deleteModel(data) {
26
+    return request.post("/cost-model/delete",{}, data,{
27
+        message: {
28
+            success: "删除成功",
29
+            error: true
30
+        }
31
+    });
32
+}

BIN
src/assets/imgs/database.png Voir le fichier


BIN
src/assets/imgs/dateIcon.png Voir le fichier


BIN
src/assets/imgs/icon_folder.png Voir le fichier


BIN
src/assets/imgs/icon_report.png Voir le fichier


BIN
src/assets/imgs/numberIcon.png Voir le fichier


BIN
src/assets/imgs/stringIcon.png Voir le fichier


+ 245
- 0
src/components/SqlStatement/index.vue Voir le fichier

@@ -0,0 +1,245 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import { useRequest } from "vue-request";
12
+import {
13
+  dataSourceList,
14
+  databaseListSchemas,
15
+  listTablesBySchemaPage,
16
+  listColumns
17
+} from "@/api";
18
+import icon_report from "@/assets/imgs/icon_report.png";
19
+import icon_folder from "@/assets/imgs/icon_folder.png";
20
+import dateIcon from "@/assets/imgs/dateIcon.png";
21
+import numberIcon from "@/assets/imgs/numberIcon.png";
22
+import stringIcon from "@/assets/imgs/stringIcon.png";
23
+import databaseIcon from "@/assets/imgs/database.png";
24
+import { ElMessage } from "element-plus";
25
+import { da } from "element-plus/es/locale";
26
+
27
+export default defineComponent({
28
+  name: "SqlStatement",
29
+  props: {
30
+    model: {
31
+      type: Object
32
+    },
33
+  },
34
+  setup(props, { attrs, expose, slots = {} }) {
35
+    const typeNumber = [
36
+        "int",
37
+        "smallint",
38
+        "bigint",
39
+        "float",
40
+        "double",
41
+        "decimal",
42
+        "bit"
43
+      ],
44
+      typeDate = ["date", "datetime", "time", "timestamp"],
45
+      typeString = ["char", "varchar", "varchar2", "text"];
46
+    const { data, error } = useRequest(async () => await dataSourceList());
47
+
48
+    const {
49
+      run,
50
+      data: _schemaData_,
51
+      loading
52
+    } = useRequest(databaseListSchemas, {
53
+      manual: true
54
+    });
55
+
56
+    const {
57
+      run: listTablesBySchemaPageRun,
58
+      data: tablesData,
59
+      loading: listTablesLoading
60
+    } = useRequest(listTablesBySchemaPage, {
61
+      manual: true
62
+    });
63
+
64
+    const {
65
+      run: listColumnsRun,
66
+      data: listColumnsData,
67
+      loading: listColumnsLoading
68
+    } = useRequest(listColumns, {
69
+      manual: true
70
+    });
71
+
72
+    const schemaData = computed(() =>
73
+      (_schemaData_.value || []).map(item => ({
74
+        label: item.name,
75
+        value: item.name
76
+      }))
77
+    );
78
+
79
+    const handleNodeClick = async node => {
80
+      if (node.nodeType) {
81
+        props.model.dataSource = node.name;
82
+        props.model.url = node.url;
83
+        props.model.username = node.userName;
84
+        props.model.password = node.password;
85
+        props.model.currentNode = node;
86
+        run({ id: node.id });
87
+      } else ElMessage.warning("选中的不是数据源,请重新选择");
88
+    };
89
+
90
+    watch(
91
+      () => props.model.schema,
92
+      val => {
93
+        if (val)
94
+          listTablesBySchemaPageRun({
95
+            id: props.model.currentNode.id,
96
+            schemaName: props.model.schema,
97
+            tableName: "",
98
+            typeList: "table,view",
99
+            pageNo: 1,
100
+            pageSize: 1000
101
+          });
102
+      }
103
+    );
104
+
105
+    const filterNodeMethod = (value, data) => data.name.includes(value);
106
+
107
+    const loadNode = async (node, resolve) => {
108
+      const { data } = node;
109
+      if (node?.level !== 0) {
110
+        await listColumnsRun({
111
+          id: props.model.currentNode.id,
112
+          tableName: data.name,
113
+          schemaName: props.model.schema
114
+        });
115
+        resolve(listColumnsData.value);
116
+      }
117
+    };
118
+
119
+    const filterSearch = async value => {
120
+      listTablesBySchemaPageRun({
121
+        id: props.model.currentNode.id,
122
+        schemaName: props.model.schema,
123
+        tableName: value,
124
+        typeList: "table,view",
125
+        pageNo: 1,
126
+        pageSize: 1000
127
+      });
128
+    };
129
+
130
+    const handleTableClick = node => {
131
+      props.model.sqlString = `select * from ${node.name}`;
132
+      // this.$refs.codemirrorTic.$refs.mycode.__vue__.focus();
133
+    };
134
+
135
+    return () => (
136
+      <>
137
+        <base-form-item label="数据源:" prop="dataSource" span={8}>
138
+          <el-tree-select
139
+            v-model={props.model.dataSource}
140
+            data={data.value}
141
+            value-key="name"
142
+            filter-node-method={filterNodeMethod}
143
+            filterable
144
+            render-after-expand={false}
145
+            style="width: 240px"
146
+            v-slots={{
147
+              default: ({ data }) => (
148
+                <div
149
+                  class="flex items-center gap-[5px]"
150
+                  onClick={() => handleNodeClick(data)}
151
+                >
152
+                  {data.children && !data.parentId && (
153
+                    <img class="w-[15px] h-[15px]" src={icon_report} alt="" />
154
+                  )}
155
+                  {data.children && data.parentId && (
156
+                    <img class="w-[15px] h-[15px]" src={icon_folder} alt="" />
157
+                  )}
158
+                  <span class={"text-[12px] text-[#26314a] font-[400]"}>
159
+                    {data.name}
160
+                  </span>
161
+                </div>
162
+              )
163
+            }}
164
+          />
165
+        </base-form-item>
166
+        <base-form-item label="schema:" prop="schema" span={8}>
167
+          <base-select
168
+            disabled={loading.value}
169
+            placeholder={loading.value ? "加载中" : "请选择"}
170
+            v-model={props.model.schema}
171
+            options={schemaData.value}
172
+          ></base-select>
173
+        </base-form-item>
174
+        <div
175
+          class={
176
+            "max-h-[400px] overflow-auto border-solid border-[1px] border-[#ccc] p-[10px]"
177
+          }
178
+        >
179
+          <base-tree
180
+            data={tablesData.value?.records}
181
+            filterables={{
182
+              size: "small"
183
+            }}
184
+            props={{
185
+              label: "name"
186
+            }}
187
+            load={loadNode}
188
+            filterSearch={filterSearch}
189
+            lazy
190
+            v-slots={{
191
+              default: ({ node, data }) => {
192
+                return (
193
+                  <div
194
+                    onClick={() => handleTableClick(data)}
195
+                    class={"flex items-center gap-[4px] text-[12px]"}
196
+                  >
197
+                    {node.level === 1 && (
198
+                      <img
199
+                        class="w-[15px] h-[15px]"
200
+                        src={databaseIcon}
201
+                        alt=""
202
+                      />
203
+                    )}
204
+                    {!data.columns &&
205
+                      typeNumber.includes(
206
+                        (data?.type || "").toLocaleLowerCase()
207
+                      ) && (
208
+                        <img
209
+                          class="w-[15px] h-[15px]"
210
+                          src={numberIcon}
211
+                          alt=""
212
+                        />
213
+                      )}
214
+                    {!data.columns &&
215
+                      typeDate.includes(
216
+                        (data?.type || "").toLocaleLowerCase()
217
+                      ) && (
218
+                        <img class="w-[15px] h-[15px]" src={dateIcon} alt="" />
219
+                      )}
220
+                    {!data.columns &&
221
+                      typeString.includes(
222
+                        (data?.type || "").toLocaleLowerCase()
223
+                      ) && (
224
+                        <img
225
+                          class="w-[15px] h-[15px]"
226
+                          src={stringIcon}
227
+                          alt=""
228
+                        />
229
+                      )}
230
+                    <span class="text-[12px]">
231
+                      {data.name}
232
+                      {data.comment && <span>({data.comment})</span>}
233
+                    </span>
234
+                  </div>
235
+                );
236
+              }
237
+            }}
238
+          />
239
+        </div>
240
+      </>
241
+    );
242
+  }
243
+});
244
+</script>
245
+<style scoped lang="scss"></style>

+ 273
- 0
src/components/SqlStatementType/index.vue Voir le fichier

@@ -0,0 +1,273 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import { useRequest } from "vue-request";
12
+import {
13
+  dataSourceList,
14
+  databaseListSchemas,
15
+  listTablesBySchemaPage,
16
+  listColumns
17
+} from "@/api";
18
+import icon_report from "@/assets/imgs/icon_report.png";
19
+import icon_folder from "@/assets/imgs/icon_folder.png";
20
+import dateIcon from "@/assets/imgs/dateIcon.png";
21
+import numberIcon from "@/assets/imgs/numberIcon.png";
22
+import stringIcon from "@/assets/imgs/stringIcon.png";
23
+import databaseIcon from "@/assets/imgs/database.png";
24
+import { ElMessage } from "element-plus";
25
+import { da } from "element-plus/es/locale";
26
+
27
+export default defineComponent({
28
+  name: "SqlStatement",
29
+  props: {
30
+    model: {
31
+      type: Object
32
+    }
33
+  },
34
+  setup(props, { attrs, expose, slots = {} }) {
35
+    const typeNumber = [
36
+        "int",
37
+        "smallint",
38
+        "bigint",
39
+        "float",
40
+        "double",
41
+        "decimal",
42
+        "bit"
43
+      ],
44
+      typeDate = ["date", "datetime", "time", "timestamp"],
45
+      typeString = ["char", "varchar", "varchar2", "text"];
46
+    const { data, error } = useRequest(async () => await dataSourceList());
47
+
48
+    const {
49
+      run,
50
+      data: _schemaData_,
51
+      loading
52
+    } = useRequest(databaseListSchemas, {
53
+      manual: true
54
+    });
55
+
56
+    const {
57
+      run: listTablesBySchemaPageRun,
58
+      data: tablesData,
59
+      loading: listTablesLoading
60
+    } = useRequest(listTablesBySchemaPage, {
61
+      manual: true
62
+    });
63
+
64
+    const {
65
+      run: listColumnsRun,
66
+      data: listColumnsData,
67
+      loading: listColumnsLoading
68
+    } = useRequest(listColumns, {
69
+      manual: true
70
+    });
71
+
72
+    const schemaData = computed(() =>
73
+      (_schemaData_.value || []).map(item => ({
74
+        label: item.name,
75
+        value: item.name
76
+      }))
77
+    );
78
+
79
+    const handleNodeClick = async node => {
80
+      if (node.nodeType) {
81
+        props.model.dataSource = node.name;
82
+        props.model.url = node.url;
83
+        props.model.username = node.userName;
84
+        props.model.password = node.password;
85
+        props.model.currentNode = node;
86
+        run({ id: node.id });
87
+      } else ElMessage.warning("选中的不是数据源,请重新选择");
88
+    };
89
+
90
+    watch(
91
+      () => props.model.schema,
92
+      val => {
93
+        if (val)
94
+          listTablesBySchemaPageRun({
95
+            id: props.model.currentNode.id,
96
+            schemaName: props.model.schema,
97
+            tableName: "",
98
+            typeList: "table,view",
99
+            pageNo: 1,
100
+            pageSize: 1000
101
+          });
102
+      }
103
+    );
104
+
105
+    const filterNodeMethod = (value, data) => data.name.includes(value);
106
+
107
+    const loadNode = async (node, resolve) => {
108
+      const { data } = node;
109
+      if (node?.level !== 0) {
110
+        await listColumnsRun({
111
+          id: props.model.currentNode.id,
112
+          tableName: data.name,
113
+          schemaName: props.model.schema
114
+        });
115
+        resolve(listColumnsData.value);
116
+      }
117
+    };
118
+
119
+    const filterSearch = async value => {
120
+      listTablesBySchemaPageRun({
121
+        id: props.model.currentNode.id,
122
+        schemaName: props.model.schema,
123
+        tableName: value,
124
+        typeList: "table,view",
125
+        pageNo: 1,
126
+        pageSize: 1000
127
+      });
128
+    };
129
+
130
+    const handleTableClick = node => {
131
+      props.model.sqlString = `select * from ${node.name}`;
132
+      // this.$refs.codemirrorTic.$refs.mycode.__vue__.focus();
133
+    };
134
+    const feeTypeList = [
135
+      {
136
+        label: "机器折旧费",
137
+        value: "EquipmentFee"
138
+      },
139
+      {
140
+        label: "辅料费",
141
+        value: "SupplyMaterialFee"
142
+      },
143
+      {
144
+        label: "水电费",
145
+        value: "DriverFee"
146
+      },
147
+      {
148
+        label: "其他费用",
149
+        value: "OtherFee"
150
+      },
151
+      {
152
+        label: "物流费",
153
+        value: "LogisticsFee"
154
+      }
155
+    ];
156
+    return () => (
157
+      <>
158
+        <base-form-item label="费用类型:" prop="feeType" span={8}>
159
+          <base-select
160
+            placeholder={loading.value ? "加载中" : "请选择"}
161
+            v-model={props.model.feeType}
162
+            options={feeTypeList}
163
+          ></base-select>
164
+        </base-form-item>
165
+        <base-form-item label="数据源:" prop="dataSource" span={8}>
166
+          <el-tree-select
167
+            v-model={props.model.dataSource}
168
+            data={data.value}
169
+            value-key="name"
170
+            filter-node-method={filterNodeMethod}
171
+            filterable
172
+            render-after-expand={false}
173
+            style="width: 240px"
174
+            v-slots={{
175
+              default: ({ data }) => (
176
+                <div
177
+                  class="flex items-center gap-[5px]"
178
+                  onClick={() => handleNodeClick(data)}
179
+                >
180
+                  {data.children && !data.parentId && (
181
+                    <img class="w-[15px] h-[15px]" src={icon_report} alt="" />
182
+                  )}
183
+                  {data.children && data.parentId && (
184
+                    <img class="w-[15px] h-[15px]" src={icon_folder} alt="" />
185
+                  )}
186
+                  <span class={"text-[12px] text-[#26314a] font-[400]"}>
187
+                    {data.name}
188
+                  </span>
189
+                </div>
190
+              )
191
+            }}
192
+          />
193
+        </base-form-item>
194
+        <base-form-item label="schema:" prop="schema" span={8}>
195
+          <base-select
196
+            disabled={loading.value}
197
+            placeholder={loading.value ? "加载中" : "请选择"}
198
+            v-model={props.model.schema}
199
+            options={schemaData.value}
200
+          ></base-select>
201
+        </base-form-item>
202
+        <div
203
+          class={
204
+            "max-h-[400px] overflow-auto border-solid border-[1px] border-[#ccc] p-[10px]"
205
+          }
206
+        >
207
+          <base-tree
208
+            data={tablesData.value?.records}
209
+            filterables={{
210
+              size: "small"
211
+            }}
212
+            props={{
213
+              label: "name"
214
+            }}
215
+            load={loadNode}
216
+            filterSearch={filterSearch}
217
+            lazy
218
+            v-slots={{
219
+              default: ({ node, data }) => {
220
+                return (
221
+                  <div
222
+                    onClick={() => handleTableClick(data)}
223
+                    class={"flex items-center gap-[4px] text-[12px]"}
224
+                  >
225
+                    {node.level === 1 && (
226
+                      <img
227
+                        class="w-[15px] h-[15px]"
228
+                        src={databaseIcon}
229
+                        alt=""
230
+                      />
231
+                    )}
232
+                    {!data.columns &&
233
+                      typeNumber.includes(
234
+                        (data?.type || "").toLocaleLowerCase()
235
+                      ) && (
236
+                        <img
237
+                          class="w-[15px] h-[15px]"
238
+                          src={numberIcon}
239
+                          alt=""
240
+                        />
241
+                      )}
242
+                    {!data.columns &&
243
+                      typeDate.includes(
244
+                        (data?.type || "").toLocaleLowerCase()
245
+                      ) && (
246
+                        <img class="w-[15px] h-[15px]" src={dateIcon} alt="" />
247
+                      )}
248
+                    {!data.columns &&
249
+                      typeString.includes(
250
+                        (data?.type || "").toLocaleLowerCase()
251
+                      ) && (
252
+                        <img
253
+                          class="w-[15px] h-[15px]"
254
+                          src={stringIcon}
255
+                          alt=""
256
+                        />
257
+                      )}
258
+                    <span class="text-[12px]">
259
+                      {data.name}
260
+                      {data.comment && <span>({data.comment})</span>}
261
+                    </span>
262
+                  </div>
263
+                );
264
+              }
265
+            }}
266
+          />
267
+        </div>
268
+      </>
269
+    );
270
+  }
271
+});
272
+</script>
273
+<style scoped lang="scss"></style>

+ 102
- 0
src/flowableComponents/code_1tp3f06n2osg0/index.vue Voir le fichier

@@ -0,0 +1,102 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import SqlStatement from "@/components/SqlStatement";
12
+
13
+export default defineComponent({
14
+  name: "dbOutput",
15
+  props: {
16
+    nodeDetail: {
17
+      type: Object
18
+    }
19
+  },
20
+  setup(props, { attrs, expose, slots = {} }) {
21
+    const nodeDetail = computed(() => props?.nodeDetail);
22
+    const baseFormRef = ref({});
23
+    const baseMonacoEditorRef = ref();
24
+    const { findNodesPrev, findNodesNext, getNodeData } = attrs;
25
+    const submit = () => {
26
+      let params = baseFormRef.value.formData;
27
+      return {
28
+        params
29
+      };
30
+    };
31
+
32
+    const open = () => {
33
+      init(nodeDetail.value);
34
+      baseMonacoEditorRef.value?.restLayout();
35
+    };
36
+
37
+    // onMounted(()=>{
38
+    //   init(nodeDetail.value)
39
+    // })
40
+
41
+    // watch(nodeDetail,(v)=>{
42
+    //   init(v)
43
+    // },{
44
+    //   deep:true
45
+    // })
46
+    watch(
47
+      () => baseFormRef.value.formData,
48
+      val => {},
49
+      {
50
+        deep: true
51
+      }
52
+    );
53
+
54
+    const init = v => {
55
+      const data = findNodesNext(props?.nodeDetail.id);
56
+      baseFormRef.value.setFormData(
57
+        JSON.parse(v?.taskParams || "{}")?.params || {}
58
+      );
59
+    };
60
+
61
+    const handleOK = value => {};
62
+
63
+    expose({
64
+      submit,
65
+      open
66
+    });
67
+
68
+    return () => (
69
+      <base-form
70
+        ref={baseFormRef}
71
+        v-slots={{
72
+          default: ({ model }) => (
73
+            <div class={"flex gap-[10px] w-full"}>
74
+              <div class={"w-[300px] overflow-auto flex flex-col"}>
75
+                <SqlStatement
76
+                  baseFormRef={baseFormRef}
77
+                  model={model}
78
+                ></SqlStatement>
79
+              </div>
80
+              <div class={"flex flex-1 flex-col"}>
81
+                <base-form-item label="SQL语句:" prop="test" span={8}>
82
+                  <div class={"w-full h-[200px]"}>
83
+                    <BaseMonacoEditor
84
+                      ref={baseMonacoEditorRef}
85
+                      v-model={model.sqlString}
86
+                      language="sql"
87
+                      customReminders={{
88
+                        test: ["liaoqiuyu"]
89
+                      }}
90
+                    ></BaseMonacoEditor>
91
+                  </div>
92
+                </base-form-item>
93
+              </div>
94
+            </div>
95
+          )
96
+        }}
97
+      />
98
+    );
99
+  }
100
+});
101
+</script>
102
+<style scoped lang="scss"></style>

+ 102
- 0
src/flowableComponents/code_1tvqz9qc8o3k0/index.vue Voir le fichier

@@ -0,0 +1,102 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import SqlStatementType from "@/components/SqlStatementType";
12
+
13
+export default defineComponent({
14
+  name: "dbOutput",
15
+  props: {
16
+    nodeDetail: {
17
+      type: Object
18
+    }
19
+  },
20
+  setup(props, { attrs, expose, slots = {} }) {
21
+    const nodeDetail = computed(() => props?.nodeDetail);
22
+    const baseFormRef = ref({});
23
+    const baseMonacoEditorRef = ref();
24
+    const { findNodesPrev, findNodesNext, getNodeData } = attrs;
25
+    const submit = () => {
26
+      let params = baseFormRef.value.formData;
27
+      return {
28
+        params
29
+      };
30
+    };
31
+
32
+    const open = () => {
33
+      init(nodeDetail.value);
34
+      baseMonacoEditorRef.value?.restLayout();
35
+    };
36
+
37
+    // onMounted(()=>{
38
+    //   init(nodeDetail.value)
39
+    // })
40
+
41
+    // watch(nodeDetail,(v)=>{
42
+    //   init(v)
43
+    // },{
44
+    //   deep:true
45
+    // })
46
+    watch(
47
+      () => baseFormRef.value.formData,
48
+      val => {},
49
+      {
50
+        deep: true
51
+      }
52
+    );
53
+
54
+    const init = v => {
55
+      const data = findNodesNext(props?.nodeDetail.id);
56
+      baseFormRef.value.setFormData(
57
+        JSON.parse(v?.taskParams || "{}")?.params || {}
58
+      );
59
+    };
60
+
61
+    const handleOK = value => {};
62
+
63
+    expose({
64
+      submit,
65
+      open
66
+    });
67
+
68
+    return () => (
69
+      <base-form
70
+        ref={baseFormRef}
71
+        v-slots={{
72
+          default: ({ model }) => (
73
+            <div class={"flex gap-[10px] w-full"}>
74
+              <div class={"w-[300px] overflow-auto flex flex-col"}>
75
+                <SqlStatementType
76
+                  baseFormRef={baseFormRef}
77
+                  model={model}
78
+                ></SqlStatementType>
79
+              </div>
80
+              <div class={"flex flex-1 flex-col"}>
81
+                <base-form-item label="SQL语句:" prop="test" span={8}>
82
+                  <div class={"w-full h-[200px]"}>
83
+                    <BaseMonacoEditor
84
+                      ref={baseMonacoEditorRef}
85
+                      v-model={model.sqlString}
86
+                      language="sql"
87
+                      customReminders={{
88
+                        test: ["liaoqiuyu"]
89
+                      }}
90
+                    ></BaseMonacoEditor>
91
+                  </div>
92
+                </base-form-item>
93
+              </div>
94
+            </div>
95
+          )
96
+        }}
97
+      />
98
+    );
99
+  }
100
+});
101
+</script>
102
+<style scoped lang="scss"></style>

+ 102
- 0
src/flowableComponents/code_4sx7fvcei1w0/index.vue Voir le fichier

@@ -0,0 +1,102 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import SqlStatement from "@/components/SqlStatement";
12
+
13
+export default defineComponent({
14
+  name: "dbOutput",
15
+  props: {
16
+    nodeDetail: {
17
+      type: Object
18
+    }
19
+  },
20
+  setup(props, { attrs, expose, slots = {} }) {
21
+    const nodeDetail = computed(() => props?.nodeDetail);
22
+    const baseFormRef = ref({});
23
+    const baseMonacoEditorRef = ref();
24
+    const { findNodesPrev, findNodesNext, getNodeData } = attrs;
25
+    const submit = () => {
26
+      let params = baseFormRef.value.formData;
27
+      return {
28
+        params
29
+      };
30
+    };
31
+
32
+    const open = () => {
33
+      init(nodeDetail.value);
34
+      baseMonacoEditorRef.value?.restLayout();
35
+    };
36
+
37
+    // onMounted(()=>{
38
+    //   init(nodeDetail.value)
39
+    // })
40
+
41
+    // watch(nodeDetail,(v)=>{
42
+    //   init(v)
43
+    // },{
44
+    //   deep:true
45
+    // })
46
+    watch(
47
+      () => baseFormRef.value.formData,
48
+      val => {},
49
+      {
50
+        deep: true
51
+      }
52
+    );
53
+
54
+    const init = v => {
55
+      const data = findNodesNext(props?.nodeDetail.id);
56
+      baseFormRef.value.setFormData(
57
+        JSON.parse(v?.taskParams || "{}")?.params || {}
58
+      );
59
+    };
60
+
61
+    const handleOK = value => {};
62
+
63
+    expose({
64
+      submit,
65
+      open
66
+    });
67
+
68
+    return () => (
69
+      <base-form
70
+        ref={baseFormRef}
71
+        v-slots={{
72
+          default: ({ model }) => (
73
+            <div class={"flex gap-[10px] w-full"}>
74
+              <div class={"w-[300px] overflow-auto flex flex-col"}>
75
+                <SqlStatement
76
+                  baseFormRef={baseFormRef}
77
+                  model={model}
78
+                ></SqlStatement>
79
+              </div>
80
+              <div class={"flex flex-1 flex-col"}>
81
+                <base-form-item label="SQL语句:" prop="test" span={8}>
82
+                  <div class={"w-full h-[200px]"}>
83
+                    <BaseMonacoEditor
84
+                      ref={baseMonacoEditorRef}
85
+                      v-model={model.sqlString}
86
+                      language="sql"
87
+                      customReminders={{
88
+                        test: ["liaoqiuyu"]
89
+                      }}
90
+                    ></BaseMonacoEditor>
91
+                  </div>
92
+                </base-form-item>
93
+              </div>
94
+            </div>
95
+          )
96
+        }}
97
+      />
98
+    );
99
+  }
100
+});
101
+</script>
102
+<style scoped lang="scss"></style>

+ 102
- 0
src/flowableComponents/code_mmnbnhf6uhc0/index.vue Voir le fichier

@@ -0,0 +1,102 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import SqlStatement from "@/components/SqlStatement";
12
+
13
+export default defineComponent({
14
+  name: "dbOutput",
15
+  props: {
16
+    nodeDetail: {
17
+      type: Object
18
+    }
19
+  },
20
+  setup(props, { attrs, expose, slots = {} }) {
21
+    const nodeDetail = computed(() => props?.nodeDetail);
22
+    const baseFormRef = ref({});
23
+    const baseMonacoEditorRef = ref();
24
+    const { findNodesPrev, findNodesNext, getNodeData } = attrs;
25
+    const submit = () => {
26
+      let params = baseFormRef.value.formData;
27
+      return {
28
+        params
29
+      };
30
+    };
31
+
32
+    const open = () => {
33
+      init(nodeDetail.value);
34
+      baseMonacoEditorRef.value?.restLayout();
35
+    };
36
+
37
+    // onMounted(()=>{
38
+    //   init(nodeDetail.value)
39
+    // })
40
+
41
+    // watch(nodeDetail,(v)=>{
42
+    //   init(v)
43
+    // },{
44
+    //   deep:true
45
+    // })
46
+    watch(
47
+      () => baseFormRef.value.formData,
48
+      val => {},
49
+      {
50
+        deep: true
51
+      }
52
+    );
53
+
54
+    const init = v => {
55
+      const data = findNodesNext(props?.nodeDetail.id);
56
+      baseFormRef.value.setFormData(
57
+        JSON.parse(v?.taskParams || "{}")?.params || {}
58
+      );
59
+    };
60
+
61
+    const handleOK = value => {};
62
+
63
+    expose({
64
+      submit,
65
+      open
66
+    });
67
+
68
+    return () => (
69
+      <base-form
70
+        ref={baseFormRef}
71
+        v-slots={{
72
+          default: ({ model }) => (
73
+            <div class={"flex gap-[10px] w-full"}>
74
+              <div class={"w-[300px] overflow-auto flex flex-col"}>
75
+                <SqlStatement
76
+                  baseFormRef={baseFormRef}
77
+                  model={model}
78
+                ></SqlStatement>
79
+              </div>
80
+              <div class={"flex flex-1 flex-col"}>
81
+                <base-form-item label="SQL语句:" prop="test" span={8}>
82
+                  <div class={"w-full h-[200px]"}>
83
+                    <BaseMonacoEditor
84
+                      ref={baseMonacoEditorRef}
85
+                      v-model={model.sqlString}
86
+                      language="sql"
87
+                      customReminders={{
88
+                        test: ["liaoqiuyu"]
89
+                      }}
90
+                    ></BaseMonacoEditor>
91
+                  </div>
92
+                </base-form-item>
93
+              </div>
94
+            </div>
95
+          )
96
+        }}
97
+      />
98
+    );
99
+  }
100
+});
101
+</script>
102
+<style scoped lang="scss"></style>

+ 102
- 0
src/flowableComponents/code_oq3y1fnvwhs0/index.vue Voir le fichier

@@ -0,0 +1,102 @@
1
+<script lang="tsx">
2
+import {
3
+  computed,
4
+  defineComponent,
5
+  ref,
6
+  onMounted,
7
+  watchEffect,
8
+  watch
9
+} from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import SqlStatement from "@/components/SqlStatement";
12
+
13
+export default defineComponent({
14
+  name: "dbOutput",
15
+  props: {
16
+    nodeDetail: {
17
+      type: Object
18
+    }
19
+  },
20
+  setup(props, { attrs, expose, slots = {} }) {
21
+    const nodeDetail = computed(() => props?.nodeDetail);
22
+    const baseFormRef = ref({});
23
+    const baseMonacoEditorRef = ref();
24
+    const { findNodesPrev, findNodesNext, getNodeData } = attrs;
25
+    const submit = () => {
26
+      let params = baseFormRef.value.formData;
27
+      return {
28
+        params
29
+      };
30
+    };
31
+
32
+    const open = () => {
33
+      init(nodeDetail.value);
34
+      baseMonacoEditorRef.value?.restLayout();
35
+    };
36
+
37
+    // onMounted(()=>{
38
+    //   init(nodeDetail.value)
39
+    // })
40
+
41
+    // watch(nodeDetail,(v)=>{
42
+    //   init(v)
43
+    // },{
44
+    //   deep:true
45
+    // })
46
+    watch(
47
+      () => baseFormRef.value.formData,
48
+      val => {},
49
+      {
50
+        deep: true
51
+      }
52
+    );
53
+
54
+    const init = v => {
55
+      const data = findNodesNext(props?.nodeDetail.id);
56
+      baseFormRef.value.setFormData(
57
+        JSON.parse(v?.taskParams || "{}")?.params || {}
58
+      );
59
+    };
60
+
61
+    const handleOK = value => {};
62
+
63
+    expose({
64
+      submit,
65
+      open
66
+    });
67
+
68
+    return () => (
69
+      <base-form
70
+        ref={baseFormRef}
71
+        v-slots={{
72
+          default: ({ model }) => (
73
+            <div class={"flex gap-[10px] w-full"}>
74
+              <div class={"w-[300px] overflow-auto flex flex-col"}>
75
+                <SqlStatement
76
+                  baseFormRef={baseFormRef}
77
+                  model={model}
78
+                ></SqlStatement>
79
+              </div>
80
+              <div class={"flex flex-1 flex-col"}>
81
+                <base-form-item label="SQL语句:" prop="test" span={8}>
82
+                  <div class={"w-full h-[200px]"}>
83
+                    <BaseMonacoEditor
84
+                      ref={baseMonacoEditorRef}
85
+                      v-model={model.sqlString}
86
+                      language="sql"
87
+                      customReminders={{
88
+                        test: ["liaoqiuyu"]
89
+                      }}
90
+                    ></BaseMonacoEditor>
91
+                  </div>
92
+                </base-form-item>
93
+              </div>
94
+            </div>
95
+          )
96
+        }}
97
+      />
98
+    );
99
+  }
100
+});
101
+</script>
102
+<style scoped lang="scss"></style>

+ 77
- 22
src/flowableComponents/dbOutput/index.vue Voir le fichier

@@ -7,39 +7,94 @@ import {
7 7
   watchEffect,
8 8
   watch
9 9
 } from "vue";
10
+import { useExposeDialogArgs } from "@qomo-platform/core";
11
+import SqlStatement from "@/components/SqlStatement";
10 12
 
11 13
 export default defineComponent({
12 14
   name: "dbOutput",
13
-  props:{
14
-    nodeDetail:{
15
-      type:Object
15
+  props: {
16
+    nodeDetail: {
17
+      type: Object
16 18
     }
17 19
   },
18 20
   setup(props, { attrs, expose, slots = {} }) {
19
-    const formInline = reactive({});
21
+    const nodeDetail = computed(() => props?.nodeDetail);
22
+    const baseFormRef = ref({});
23
+    const baseMonacoEditorRef = ref();
24
+    const { findNodesPrev, findNodesNext, getNodeData } = attrs;
25
+    const submit = () => {
26
+      let params = baseFormRef.value.formData;
27
+      return {
28
+        params
29
+      };
30
+    };
20 31
 
21
-    const submit = ()=>{
22
-      let param = formInline;
23
-     
32
+    const open = () => {
33
+      init(nodeDetail.value);
34
+      baseMonacoEditorRef.value?.restLayout();
35
+    };
24 36
 
25
-      return param
26
-    }
37
+    // onMounted(()=>{
38
+    //   init(nodeDetail.value)
39
+    // })
40
+
41
+    // watch(nodeDetail,(v)=>{
42
+    //   init(v)
43
+    // },{
44
+    //   deep:true
45
+    // })
46
+    watch(
47
+      () => baseFormRef.value.formData,
48
+      val => {},
49
+      {
50
+        deep: true
51
+      }
52
+    );
53
+
54
+    const init = v => {
55
+      const data = findNodesNext(props?.nodeDetail.id);
56
+      baseFormRef.value.setFormData(
57
+        JSON.parse(v?.taskParams || "{}")?.params || {}
58
+      );
59
+    };
60
+
61
+    const handleOK = value => {};
27 62
 
28 63
     expose({
29
-      submit
30
-    })
64
+      submit,
65
+      open
66
+    });
67
+
31 68
     return () => (
32
-      <el-form label-width="auto" v-model={formInline}>
33
-        <el-form-item label="Name">
34
-          <el-input v-model={formInline.name} />
35
-        </el-form-item>
36
-        <el-form-item label="Activity zone">
37
-          <el-input v-model={formInline.region} />
38
-        </el-form-item>
39
-        <el-form-item label="Activity form">
40
-          <el-input v-model={formInline.type} />
41
-        </el-form-item>
42
-      </el-form>
69
+      <base-form
70
+        ref={baseFormRef}
71
+        v-slots={{
72
+          default: ({ model }) => (
73
+            <div class={"flex gap-[10px] w-full"}>
74
+              <div class={"w-[300px] overflow-auto flex flex-col"}>
75
+                <SqlStatement
76
+                  baseFormRef={baseFormRef}
77
+                  model={model}
78
+                ></SqlStatement>
79
+              </div>
80
+              <div class={"flex flex-1 flex-col"}>
81
+                <base-form-item label="SQL语句:" prop="test" span={8}>
82
+                  <div class={"w-full h-[200px]"}>
83
+                    <BaseMonacoEditor
84
+                      ref={baseMonacoEditorRef}
85
+                      v-model={model.code}
86
+                      language="sql"
87
+                      customReminders={{
88
+                        test: ["liaoqiuyu"]
89
+                      }}
90
+                    ></BaseMonacoEditor>
91
+                  </div>
92
+                </base-form-item>
93
+              </div>
94
+            </div>
95
+          )
96
+        }}
97
+      />
43 98
     );
44 99
   }
45 100
 });

+ 40
- 0
src/platform.ts Voir le fichier

@@ -20,6 +20,46 @@ export const qomoPlatformOptions = {
20 20
           label: "首批",
21 21
           value: "C"
22 22
         }
23
+      ],
24
+      modelStatus: [
25
+        {
26
+          label: "草稿",
27
+          value: "1"
28
+        },
29
+        {
30
+          label: "已发布",
31
+          value: "2"
32
+        },
33
+        {
34
+          label: "运行中",
35
+          value: "3"
36
+        },
37
+        {
38
+          label: "已完成",
39
+          value: "4"
40
+        }
41
+      ],
42
+      feeTypeList:[
43
+        {
44
+          label: "机器折旧费",
45
+          value: "EquipmentFee"
46
+        },
47
+        {
48
+          label: "辅料费",
49
+          value: "SupplyMaterialFee"
50
+        },
51
+        {
52
+          label: "水电费",
53
+          value: "DriverFee"
54
+        },
55
+        {
56
+          label: "其他费用",
57
+          value: "OtherFee"
58
+        },
59
+        {
60
+          label: "物流费",
61
+          value: "LogisticsFee"
62
+        }
23 63
       ]
24 64
     },
25 65
     async provider(dictType) {

+ 25
- 12
src/router/index.js Voir le fichier

@@ -69,18 +69,18 @@ export const constantRoutes = [
69 69
       },
70 70
     ]
71 71
   },
72
-  // {
73
-  //   path: '',
74
-  //   component: Layout,
75
-  //   children: [
76
-  //     {
77
-  //       path: "/hour",
78
-  //       component: () => import("@/views/hour/index"),
79
-  //       name: "Hour",
80
-  //       meta: { title: "小时费率", icon: "money", affix: true }
81
-  //     }
82
-  //   ]
83
-  // },
72
+  {
73
+    path: '',
74
+    component: Layout,
75
+    children: [
76
+      {
77
+        path: "/hour",
78
+        component: () => import("@/views/hour/index"),
79
+        name: "Hour",
80
+        meta: { title: "小时费率", icon: "money", affix: true }
81
+      }
82
+    ]
83
+  },
84 84
   // {
85 85
   //   path: '',
86 86
   //   component: Layout,
@@ -153,6 +153,19 @@ export const constantRoutes = [
153 153
       }
154 154
     ]
155 155
   },
156
+  {
157
+    path: '',
158
+    component: Layout,
159
+    children: [
160
+      {
161
+        path: "modelManagement/index",
162
+        component: () => import("@/views/modelManagement/index"),
163
+        name: "Modelmanagement",
164
+        meta: { title: "成本计算模型管理", icon: "tree", affix: true }
165
+      }
166
+    ]
167
+  },
168
+  // Bom,工序,采购价格
156 169
 ];
157 170
 
158 171
 //本地调试默认路由

+ 3
- 3
src/utils/auth.js Voir le fichier

@@ -3,13 +3,13 @@ import Cookies from "js-cookie";
3 3
 const TokenKey = "Admin-Token";
4 4
 
5 5
 export function getToken() {
6
-  return Cookies.get(TokenKey);
6
+  return window.localStorage.getItem(TokenKey);
7 7
 }
8 8
 
9 9
 export function setToken(token) {
10
-  return Cookies.set(TokenKey, token);
10
+  return window.localStorage.setItem(TokenKey, token);
11 11
 }
12 12
 
13 13
 export function removeToken() {
14
-  return Cookies.remove(TokenKey);
14
+  return window.localStorage.removeItem(TokenKey);
15 15
 }

+ 140
- 0
src/views/modelManagement/index.vue Voir le fichier

@@ -0,0 +1,140 @@
1
+<script lang="tsx">
2
+//表格
3
+import { defineComponent, ref } from "vue";
4
+import { ElMessage } from "element-plus";
5
+import { transformPageResponse } from "@/utils/qomo";
6
+import { modelList,deleteModel } from "@/api/modelManagement";
7
+import { useRouter } from 'vue-router';
8
+import { ro } from "element-plus/es/locale";
9
+export default defineComponent({
10
+  setup() {
11
+    const router = useRouter();
12
+    const tableRef = ref();
13
+    const forecastDialogRef = ref();
14
+    const selectionRows = ref([]);
15
+    // const uploadUrl = ref("/c7525cost/importExcel");
16
+    //列
17
+    const columns = ref([
18
+      { prop: "drawingNo", label: "图号" },
19
+      { label: "物料号", prop: "materialNo" },
20
+      { label: "物料类型", prop: "materialType" },
21
+      { prop: "modelName", label: "模型名称", hideInSearchForm: true },
22
+      { prop: "modelVersion", label: "模型版本", hideInSearchForm: true },
23
+      {
24
+        valueType: "date",
25
+        prop: "createTime",
26
+        label: "创建时间",
27
+        hideInSearchForm: true
28
+      },
29
+      {
30
+        prop: "status",
31
+        label: "状态",
32
+        valueType: "dict-select",
33
+        extraProps: { dictType: "modelStatus" }
34
+      },
35
+      {
36
+        type: "operation",
37
+        label: "操作",
38
+        minWidth: 120,
39
+        render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
40
+          <base-table-operation
41
+            btnList={[
42
+              {
43
+                key: "edit",
44
+                label: "编辑",
45
+                onclick: () => doAddOrEdit(row)
46
+              },
47
+              {
48
+                key: "delete",
49
+                label: "删除",
50
+                onclick: () => doDeleteRows(row)
51
+              },
52
+              {
53
+                key: "release",
54
+                label: "发布",
55
+                onclick: () => releaseRows(row)
56
+              }
57
+            ]}
58
+          />
59
+        )
60
+      }
61
+    ]);
62
+
63
+    const render = () => {
64
+      return (
65
+        <div>
66
+          <BaseTable
67
+            columns={columns.value}
68
+            ref={tableRef}
69
+            selectionRows={selectionRows.value}
70
+            toolbar={{
71
+              layout: "search-dnamic,reload,column-setting,fullscreen"
72
+            }}
73
+            request={async ({
74
+              pageSize = 10,
75
+              current = 1,
76
+              ...otherSearchParams
77
+            }) => {
78
+              let tableData = {};
79
+              tableData = transformPageResponse(
80
+                await modelList({
81
+                  pageNo: current,
82
+                  pageSize,
83
+                  ...otherSearchParams
84
+                })
85
+              );
86
+              tableData.data.forEach(item => {
87
+                if (item.status == "1") {
88
+                  item.status = "草稿";
89
+                } else if (item.status == "2") {
90
+                  item.status = "已发布";
91
+                } else if (item.status == "3") {
92
+                  item.status = "运行中";
93
+                } else if (item.status == "4") {
94
+                  item.status = "已完成";
95
+                }
96
+              });
97
+              return tableData;
98
+            }}
99
+            curdConfig={{
100
+              /**
101
+               * 接受自动表单的数据
102
+               * @param data
103
+               */
104
+              async onAddOrEdit(data) {
105
+                if (data.id) {
106
+                  await editHourRate(data);
107
+                } else {
108
+                  await addHourRate(data);
109
+                }
110
+              },
111
+              /*删除*/
112
+              async onDeleteRows(data) {
113
+                await deleteModel({ id: data.id });
114
+              },
115
+              unitColSpan: 12
116
+            }}
117
+            v-slots={{
118
+              toolbar: () => (
119
+                <el-space>
120
+                  <el-button type="primary" onClick={addModel}>
121
+                    新增模型
122
+                  </el-button>
123
+                </el-space>
124
+              )
125
+            }}
126
+          />
127
+        </div>
128
+      );
129
+    };
130
+    const releaseRows = () => {
131
+      console.log("发布");
132
+    };
133
+    const addModel = () => {
134
+      router.push({ path: "/test/index" });
135
+    }
136
+    return render;
137
+  }
138
+});
139
+</script>
140
+<style lang="scss" scoped></style>

+ 42
- 1240
src/views/test/index.vue
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 18
- 4
vite.config.js Voir le fichier

@@ -22,7 +22,7 @@ function getLocalIpAddress() {
22 22
 // https://vitejs.dev/config/
23 23
 export default defineConfig(({ mode, command }) => {
24 24
   const env = loadEnv(mode, process.cwd());
25
-  const { VITE_APP_ENV ,VITE_APP_PATH} = env;
25
+  const { VITE_APP_ENV, VITE_APP_PATH } = env;
26 26
   return {
27 27
     // 部署生产环境和开发环境下的URL。
28 28
     // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
@@ -50,18 +50,32 @@ export default defineConfig(({ mode, command }) => {
50 50
       disableHostCheck: true,
51 51
       host: getLocalIpAddress(),
52 52
       open: true,
53
-      hmr:{overlay:false},
53
+      hmr: { overlay: false },
54 54
       proxy: {
55 55
         // https://cn.vitejs.dev/config/#server-proxy
56 56
         "/qomo": {
57 57
           // target: "http://172.16.0.241:8095", //wq
58
-          target: "http://172.16.0.214:8095",  //bgy
59
-          // target: "http://192.168.50.9:8095",
58
+          target: "http://172.16.0.162:8082",  //bgy
59
+          // target: "http://192.168.50.9:2999",//中智平台
60 60
           changeOrigin: true,
61 61
           pathRewrite: {
62 62
             "^/qomo": "/qomo"
63 63
           }
64 64
         },
65
+        "/qomo/flowSocket": {
66
+          // target: 'ws://192.168.0.66:60601/',这是后端接口地址
67
+          target: 'ws://172.16.0.162:8082',
68
+          // target: 'ws://192.168.50.99:2999',
69
+          changeOrigin: true,
70
+          ws: true
71
+        },
72
+        "/qomo/taskSocket": {
73
+          // target: 'ws://192.168.0.66:60601/',这是后端接口地址
74
+          target: 'ws://172.16.0.162:8082',
75
+          // target: 'ws://192.168.50.99:2999',
76
+          changeOrigin: true,
77
+          ws: true
78
+        },
65 79
       },
66 80
       headers: {
67 81
         "Access-Control-Allow-Origin": "*"