Showing
2 changed files
with
5 additions
and
3 deletions
@@ -133,7 +133,7 @@ | @@ -133,7 +133,7 @@ | ||
133 | }); | 133 | }); |
134 | }); | 134 | }); |
135 | // 初始化编辑器 | 135 | // 初始化编辑器 |
136 | - const initEditor = (jsScript?: string) => { | 136 | + const initEditor = () => { |
137 | aceEditor.value = ace.edit(aceRef.value, { | 137 | aceEditor.value = ace.edit(aceRef.value, { |
138 | maxLines: 12, // 最大行数,超过会自动出现滚动条 | 138 | maxLines: 12, // 最大行数,超过会自动出现滚动条 |
139 | minLines: 12, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小 | 139 | minLines: 12, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小 |
@@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
147 | enableBasicAutocompletion: true, | 147 | enableBasicAutocompletion: true, |
148 | enableLiveAutocompletion: true, | 148 | enableLiveAutocompletion: true, |
149 | }); | 149 | }); |
150 | - aceEditor.value.setValue(jsScript); | 150 | + aceEditor.value.setValue(); |
151 | beautify(aceEditor.value.session); | 151 | beautify(aceEditor.value.session); |
152 | scriptForm.convertJs = aceEditor.value.getValue(); | 152 | scriptForm.convertJs = aceEditor.value.getValue(); |
153 | }; | 153 | }; |
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | isText.value = data.isText; | 46 | isText.value = data.isText; |
47 | isTitle.value = data.isTitle; | 47 | isTitle.value = data.isTitle; |
48 | editData.data = data.record; | 48 | editData.data = data.record; |
49 | - converScriptRef.value?.initEditor(data.record?.configuration?.jsScript); | 49 | + converScriptRef.value?.initEditor(); |
50 | setModalProps({ loading: false }); | 50 | setModalProps({ loading: false }); |
51 | if (!unref(isViewDetail)) { | 51 | if (!unref(isViewDetail)) { |
52 | const title = | 52 | const title = |
@@ -66,6 +66,8 @@ | @@ -66,6 +66,8 @@ | ||
66 | if (data.record) { | 66 | if (data.record) { |
67 | const res = await getScriptManageDetail(data.record); | 67 | const res = await getScriptManageDetail(data.record); |
68 | converScriptRef.value?.setFormData(res); | 68 | converScriptRef.value?.setFormData(res); |
69 | + } else { | ||
70 | + converScriptRef.value?.setDefaultRadio('HEX', 'true'); | ||
69 | } | 71 | } |
70 | } | 72 | } |
71 | setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText }); | 73 | setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText }); |