Commit 56f6c34a0155a3d39cedecefe80572ae1af09e4b

Authored by fengtao
1 parent 699f3ff2

pref:优化转换函数弹窗加载

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