
import API  from '@/utils/api.js'
const api = new API("ValuesController");

const state ={
    daiBan:[],//待办对象数据
    gengxin:{},//更新对象数据
    xiaoxi:[],//消息对象数据
}

const mutations ={
    getDB(state,data){
        state.daiBan = data;
    },
    getGX(state,data){
        state.gengxin = data;
    },
    getXX(state,data){
        state.xiaoxi = data;
    },
   
}

const actions ={
    getDaiBan({commit},data){
        commit('getDB',data);
    },
    getGengXin({commit},data){
        commit('getGX',data);
    },
    getXiaoXi({commit},data){
        commit('getXX',data)
    },
    GetUserVM({commit},data){
        return api.Post('GetUserVM',data).then(r=>{
            return r.data;
        })
    },
    GetWorkFlowCaseVM({commit},caseCode){
        return api.Get('GetWorkFlowCaseVM',caseCode).then(r=>{
            return r.data;
        })
    },
    GetWorkFlowFile({commit},actcode){
        return api.Get('GetWorkFlowFile',actcode).then(r=>{
            return r.data;
        })
    },
    GetDongLong({commit},url){
        return api.Get('GetDongLong',url).then(r=>{
            return r.data;
        })
    },
    GetWorkFlowProcedure({commit},data){
        return api.Post('GetWorkFlowProcedure',data).then(r=>{
            return r.data;
        })
    },
    GetSystemURLList({commit}){
        return api.All('GetSystemURLList').then(r=>{
            return r.data;
        })
    },
    GetSystemURL({commit},data){
        return api.Post('GetSystemURL',data).then(r=>{
            return r.data;
        })
    },
    UpdateSystemURL({commit},data){
        return api.Post('UpdateSystemURL',data).then(r=>{
            return r.data;
        })
    },
}
const getters = {
    daiBans:state=>state.daiBan,
    gengXins:state =>state.gengxin,
    xiaoXis:state =>state.xiaoxi,
    Web:state=>state.webservice,
}

export default {
    state,mutations,actions,getters
}
