Commit 647356273f3ccf59f9c37163cc9de24afba7c02b
Merge branch 'ww' into 'main'
fix: configuration center init draw.io default xml See merge request huang/yun-teng-iot-front!441
Showing
4 changed files
with
16 additions
and
2 deletions
@@ -22,5 +22,6 @@ export interface ConfigurationCenterParams { | @@ -22,5 +22,6 @@ export interface ConfigurationCenterParams { | ||
22 | createTime: string; | 22 | createTime: string; |
23 | creator: string; | 23 | creator: string; |
24 | remark: string; | 24 | remark: string; |
25 | + defaultContent?: string; | ||
25 | } | 26 | } |
26 | export type ConfigurationCenterInfo = ConfigurationCenterParams; | 27 | export type ConfigurationCenterInfo = ConfigurationCenterParams; |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <script lang="ts"> | 13 | <script lang="ts"> |
14 | import { defineComponent, ref, computed, unref } from 'vue'; | 14 | import { defineComponent, ref, computed, unref } from 'vue'; |
15 | import { BasicForm, useForm } from '/@/components/Form'; | 15 | import { BasicForm, useForm } from '/@/components/Form'; |
16 | - import { formSchema } from './center.data'; | 16 | + import { formSchema, PC_DEFAULT_CONTENT, PHONE_DEFAULT_CONTENT, Platform } from './center.data'; |
17 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 17 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
18 | import { useMessage } from '/@/hooks/web/useMessage'; | 18 | import { useMessage } from '/@/hooks/web/useMessage'; |
19 | import { saveOrUpdateConfigurationCenter } from '/@/api/configuration/center/configurationCenter'; | 19 | import { saveOrUpdateConfigurationCenter } from '/@/api/configuration/center/configurationCenter'; |
@@ -54,6 +54,13 @@ | @@ -54,6 +54,13 @@ | ||
54 | 54 | ||
55 | const getTitle = computed(() => (!unref(isUpdate) ? '新增组态中心' : '编辑组态中心')); | 55 | const getTitle = computed(() => (!unref(isUpdate) ? '新增组态中心' : '编辑组态中心')); |
56 | 56 | ||
57 | + const getDefaultContent = (platform: Platform) => { | ||
58 | + if (platform === Platform.PC) { | ||
59 | + return PC_DEFAULT_CONTENT; | ||
60 | + } | ||
61 | + return PHONE_DEFAULT_CONTENT; | ||
62 | + }; | ||
63 | + | ||
57 | async function handleSubmit() { | 64 | async function handleSubmit() { |
58 | try { | 65 | try { |
59 | const { createMessage } = useMessage(); | 66 | const { createMessage } = useMessage(); |
@@ -65,6 +72,7 @@ | @@ -65,6 +72,7 @@ | ||
65 | setDrawerProps({ confirmLoading: true }); | 72 | setDrawerProps({ confirmLoading: true }); |
66 | let saveMessage = '添加成功'; | 73 | let saveMessage = '添加成功'; |
67 | let updateMessage = '修改成功'; | 74 | let updateMessage = '修改成功'; |
75 | + values.defaultContent = getDefaultContent(values.platform); | ||
68 | await saveOrUpdateConfigurationCenter(values, unref(isUpdate)); | 76 | await saveOrUpdateConfigurationCenter(values, unref(isUpdate)); |
69 | closeDrawer(); | 77 | closeDrawer(); |
70 | emit('success'); | 78 | emit('success'); |
@@ -9,6 +9,11 @@ export enum Platform { | @@ -9,6 +9,11 @@ export enum Platform { | ||
9 | PC = 'pc', | 9 | PC = 'pc', |
10 | } | 10 | } |
11 | 11 | ||
12 | +export const PC_DEFAULT_CONTENT = | ||
13 | + '<mxfile><diagram>dZHBDsIgDIafhvuEzOh5Tr142sEzGXWQsHVhmKFP7xbAidMT5fv/UtoSVrTuZHgvLyhAE5oJR9iBUMrybT4dM3l4stnTzJPGKBHYAir1hACj7a4EDInRImqr+hTW2HVQ24RxY3BMbTfUadWeN7ACVc31ml6VsPK7jVk4g2pkLJ3tgtLy6A5gkFzg+IFYSVhhEK2PWleAnscXB+Pzjn/U988MdPZHwhQsb0+XZEesfAE=</diagram></mxfile>'; | ||
14 | + | ||
15 | +export const PHONE_DEFAULT_CONTENT = | ||
16 | + '<mxfile><diagram>dZHBEoIgEEC/hru6lXU2q0snD50Z2YQZdB2k0fr6dMCMsU4sb9+ysDDI6uFseCuvJFCzJBIDgyNLkjjdw7hM5OnIYRc5UBklvLSAQr3Qw1l7KIFdIFoibVUbwpKaBksbMG4M9aF2Jx12bXmFK1CUXK/pTQkrHd3E24VfUFXSd04hdYmaz65/SCe5oP4LQc4gM0TWRfWQoZ5mN4/F1Z3+ZD/3MtjYHwVjsJw9boIPgvwN</diagram></mxfile>'; | ||
12 | // 表格列数据 | 17 | // 表格列数据 |
13 | export const columns: BasicColumn[] = [ | 18 | export const columns: BasicColumn[] = [ |
14 | { | 19 | { |
@@ -153,7 +153,7 @@ | @@ -153,7 +153,7 @@ | ||
153 | enableBasicAutocompletion: true, | 153 | enableBasicAutocompletion: true, |
154 | enableLiveAutocompletion: true, | 154 | enableLiveAutocompletion: true, |
155 | }); | 155 | }); |
156 | - // aceEditor.value.setValue(); | 156 | + aceEditor.value.setValue(''); |
157 | beautify(aceEditor.value.session); | 157 | beautify(aceEditor.value.session); |
158 | // scriptForm.convertJs = aceEditor.value.getValue(); | 158 | // scriptForm.convertJs = aceEditor.value.getValue(); |
159 | }; | 159 | }; |