mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化代码
This commit is contained in:
parent
67858c82c4
commit
486f6fdf84
@ -70,7 +70,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
vc.component.addOaWorkflowInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
//不提交数据将数据 回调给侦听处理
|
||||
if (vc.notNull($props.callBackListener)) {
|
||||
vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addOaWorkflowInfo);
|
||||
@ -79,7 +78,7 @@
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'oaWorkflow.saveOaWorkflow',
|
||||
'/oaWorkflow/saveOaWorkflow',
|
||||
JSON.stringify(vc.component.addOaWorkflowInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
|
||||
@ -19,9 +19,8 @@
|
||||
},
|
||||
methods: {
|
||||
deleteOaWorkflow: function () {
|
||||
vc.component.deleteOaWorkflowInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'oaWorkflow.deleteOaWorkflow',
|
||||
'/oaWorkflow/deleteOaWorkflow',
|
||||
JSON.stringify(vc.component.deleteOaWorkflowInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
|
||||
@ -1,110 +1,110 @@
|
||||
(function(vc,vm){
|
||||
(function (vc, vm) {
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
editOaWorkflowInfo:{
|
||||
flowId:'',
|
||||
flowName:'',
|
||||
flowType:'',
|
||||
describle:'',
|
||||
data: {
|
||||
editOaWorkflowInfo: {
|
||||
flowId: '',
|
||||
flowName: '',
|
||||
flowType: '',
|
||||
describle: '',
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('editOaWorkflow','openEditOaWorkflowModal',function(_params){
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editOaWorkflow', 'openEditOaWorkflowModal', function (_params) {
|
||||
vc.component.refreshEditOaWorkflowInfo();
|
||||
$('#editOaWorkflowModel').modal('show');
|
||||
vc.copyObject(_params, vc.component.editOaWorkflowInfo );
|
||||
vc.copyObject(_params, vc.component.editOaWorkflowInfo);
|
||||
vc.component.editOaWorkflowInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
editOaWorkflowValidate:function(){
|
||||
return vc.validate.validate({
|
||||
editOaWorkflowInfo:vc.component.editOaWorkflowInfo
|
||||
},{
|
||||
'editOaWorkflowInfo.flowName':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"流程名称不能为空"
|
||||
methods: {
|
||||
editOaWorkflowValidate: function () {
|
||||
return vc.validate.validate({
|
||||
editOaWorkflowInfo: vc.component.editOaWorkflowInfo
|
||||
}, {
|
||||
'editOaWorkflowInfo.flowName': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "流程名称不能为空"
|
||||
},
|
||||
{
|
||||
limit:"maxLength",
|
||||
param:"64",
|
||||
errInfo:"流程名称超过64位"
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "流程名称超过64位"
|
||||
},
|
||||
],
|
||||
'editOaWorkflowInfo.flowType':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"流程类型不能为空"
|
||||
'editOaWorkflowInfo.flowType': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "流程类型不能为空"
|
||||
},
|
||||
{
|
||||
limit:"maxLength",
|
||||
param:"12",
|
||||
errInfo:"流程类型不能为空"
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "12",
|
||||
errInfo: "流程类型不能为空"
|
||||
},
|
||||
],
|
||||
'editOaWorkflowInfo.describle':[
|
||||
{
|
||||
limit:"maxLength",
|
||||
param:"200",
|
||||
errInfo:"备注内容不能超过200"
|
||||
'editOaWorkflowInfo.describle': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "备注内容不能超过200"
|
||||
},
|
||||
],
|
||||
'editOaWorkflowInfo.flowId':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"工作流ID不能为空"
|
||||
'editOaWorkflowInfo.flowId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "工作流ID不能为空"
|
||||
}]
|
||||
|
||||
});
|
||||
},
|
||||
editOaWorkflow:function(){
|
||||
if(!vc.component.editOaWorkflowValidate()){
|
||||
});
|
||||
},
|
||||
editOaWorkflow: function () {
|
||||
if (!vc.component.editOaWorkflowValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'oaWorkflow.updateOaWorkflow',
|
||||
'/oaWorkflow/updateOaWorkflow',
|
||||
JSON.stringify(vc.component.editOaWorkflowInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#editOaWorkflowModel').modal('hide');
|
||||
vc.emit('oaWorkflowManage','listOaWorkflow',{});
|
||||
return ;
|
||||
vc.emit('oaWorkflowManage', 'listOaWorkflow', {});
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function(errInfo,error){
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
});
|
||||
});
|
||||
},
|
||||
refreshEditOaWorkflowInfo:function(){
|
||||
vc.component.editOaWorkflowInfo= {
|
||||
flowId:'',
|
||||
flowName:'',
|
||||
flowType:'',
|
||||
describle:'',
|
||||
refreshEditOaWorkflowInfo: function () {
|
||||
vc.component.editOaWorkflowInfo = {
|
||||
flowId: '',
|
||||
flowName: '',
|
||||
flowType: '',
|
||||
describle: '',
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
})(window.vc, window.vc.component);
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('oaWorkflow.listOaWorkflows',
|
||||
vc.http.apiGet('/oaWorkflow/queryOaWorkflow',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _oaWorkflowManageInfo = JSON.parse(json);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user