优化代码

This commit is contained in:
java110 2020-06-21 09:31:34 +08:00
parent 79cc158b3d
commit 90fa9e4f85
3 changed files with 42 additions and 4 deletions

View File

@ -12,7 +12,7 @@
_initMethod: function () {
vc.component.clearCacheData();
vc.component._loadSysInfo();
},
_initEvent: function () {
vc.component.$on('errorInfoEvent', function (_errorInfo) {
@ -78,13 +78,18 @@
}
vc.http.post(
'login',
'doLogin',
'doLogin?version=2.0',
JSON.stringify(vc.component.loginInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _data = JSON.parse(json);
if (_data.hasOwnProperty('code') && _data.code != '0') {
vc.toast(_data.msg);
return;
}
if (res.status == 200) {
vc.emit('initData', 'loadCommunityInfo', {
url: '/'

View File

@ -83,6 +83,9 @@
<button class="btn-white btn btn-xs"
v-on:click="_openEditWorkflowModel(workflow)">设置流程
</button>
<button class="btn-white btn btn-xs"
v-on:click="_openWorkflowImage(workflow)">流程图
</button>
</div>
</td>
</tr>
@ -102,4 +105,6 @@
</div>
</div>
<vc:create path="common/viewImage"></vc:create>
</div>

View File

@ -65,8 +65,8 @@
},
_openEditWorkflowModel: function (_workflow) {
vc.jumpToPage('/admin.html#/pages/property/workflowSettingManage?'+vc.objToGetParam(_workflow));
vc.jumpToPage('/admin.html#/pages/property/workflowSettingManage?' + vc.objToGetParam(_workflow));
},
_queryWorkflowMethod: function () {
vc.component._listWorkflows(DEFAULT_PAGE, DEFAULT_ROWS);
@ -78,6 +78,34 @@
} else {
vc.component.workflowManageInfo.moreCondition = true;
}
},
_openWorkflowImage: function (_workflow) {
var param = {
params: {
communityId: vc.getCurrentCommunity().communityId,
flowId: _workflow.flowId
}
};
//发送get请求
vc.http.apiGet('workflow.listWorkflowImage',
param,
function (json, res) {
var _workflowManageInfo = JSON.parse(json);
if(_workflowManageInfo.code != '0'){
vc.toast(_workflowManageInfo.msg);
return ;
}
vc.emit('viewImage', 'showImage', {
url: 'data:image/png;base64,'+_workflowManageInfo.data
});
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
}