commonApi.js 1.57 KB
Newer Older
fukai committed
1 2
import Api from "~/service/Api"
import Utils from "../utils"
zhengxiaokui committed
3

fukai committed
4
export default {
zhengxiaokui committed
5
    data() {
fukai committed
6 7
        return {}
    },
zhengxiaokui committed
8
    mounted() {
fukai committed
9
        //this.restoreDisplay()
fukai committed
10
    },
zhengxiaokui committed
11 12 13
    methods: {
        init(params) {
            return Api.post(this.declareParams.trnName + "/init", { params })
fukai committed
14
        },
zhengxiaokui committed
15
        save(params) {
zhengxiaokui committed
16
            return Api.post(this.declareParams.trnName + "/saveData", this.wrapper(params))
fukai committed
17
        },
18
        executeCheck(rulePath,params){
19
            return Api.post(this.declareParams.trnName+"/executeCheck/"+rulePath, this.wrapper(params))
fukai committed
20
        },
zhengxiaokui committed
21 22
        executeDefault(rulePath, params) {
            return Api.post(this.declareParams.trnName + "/executeDefault/" + rulePath, this.wrapper(params))
fukai committed
23
        },
zhengxiaokui committed
24 25
        executeRule(rulePath, params) {
            return Api.post(this.declareParams.trnName + "/executeRule/" + rulePath, this.wrapper(params))
fukai committed
26
        },
zhengxiaokui committed
27 28
        async checkAll(params) {
            const res = await Api.post(this.declareParams.trnName + "/checkAll", this.wrapper(params))
潘际乾 committed
29
            return res
fukai committed
30
        },
zhengxiaokui committed
31 32
        pedding(params) {
            return Api.post(this.declareParams.trnName + "/pending", this.wrapper(params))
fukai committed
33
        },
zhengxiaokui committed
34
        async restoreDisplay() {
fukai committed
35
            let inr = this.$route.query.trn
zhengxiaokui committed
36
            if (!inr)
fukai committed
37
                return
zhengxiaokui committed
38 39
            let data = await Api.post("display/" + inr)
            Utils.copyValueFromVO(this.model, JSON.parse(data.data))
40
        },
zhengxiaokui committed
41 42
        executeNotify(params) {
            return Api.post(this.declareParams.trnName + "/executeNotify", this.wrapper(params))
43
        },
fukai committed
44
    }
zhengxiaokui committed
45
}