From c7fff2ae8d6a5360abf60afbf058aac91653becb Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sun, 22 Aug 2021 19:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/formjs/editor.html | 11 +++++++++-- public/formjs/editor.js | 21 +++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/public/formjs/editor.html b/public/formjs/editor.html index 31f893fc1..71a2f3198 100644 --- a/public/formjs/editor.html +++ b/public/formjs/editor.html @@ -36,16 +36,23 @@ body{ background: #fff; } + + .no_display { + display: none; + } + +
+
- - + diff --git a/public/formjs/editor.js b/public/formjs/editor.js index cbfbc003f..87053eae7 100644 --- a/public/formjs/editor.js +++ b/public/formjs/editor.js @@ -18,26 +18,22 @@ container: document.querySelector('#form') }); - let _doSaveDiagram = function (_xml, svg) { - //发送get请求 - let _modelId = vc.getParam('modelId'); + _doSaveDiagram = function (_xml, svg) { let _param = { - 'xml': _xml, - 'svg': svg + 'formJson': JSON.stringify(formEditor.saveSchema()), + 'flowId': vc.getParam('flowId') }; - vc.http.apiPost('/activiti/model/' + _modelId + '/save', + vc.http.apiPost('/oaWorkflow/saveOaWorkflowForm', JSON.stringify(_param), { emulateJSON: true }, function (json, res) { let listRoomData = JSON.parse(json); - console.log(json) + vc.toast(listRoomData.msg); if (listRoomData.code == 0) { - vc.toast('保存成功'); window.close(); } - }, function (errInfo, error) { console.log('请求失败处理'); } @@ -45,13 +41,14 @@ } initFormJs = function (_context) { try { - formEditor.importSchema(_context); + console.log(_context) + formEditor.importSchema(_context); } catch (err) { console.log('importing form failed', err); } }; - window._getSchema = function(){ + window._getSchema = function () { const schema = formEditor.saveSchema(); console.log('exported schema', JSON.stringify(schema)); } @@ -71,7 +68,7 @@ let _flowXml = JSON.parse(json); if (_flowXml.data.length > 0) { //初始化 - initFormJs(_flowXml.data[0].bpmnXml); + initFormJs(JSON.parse(_flowXml.data[0].formJson)); return; } //初始化