Default.js 2.01 KB
Newer Older
liuxin committed
1 2 3 4

/**
* Sptsel Default规则
*/
5
import Api from "~/service/Api";
liuxin committed
6
import Utils from "~/utils/index"
liuxin committed
7 8
export default {

liuxin committed
9 10 11 12 13 14 15 16 17 18
    "sptstm": defaultSptstm,
    "dlaxq": defaultDlaxq,
    "usfmod.labtxt": defaultUsfmodLabtxt,
    "usfmod.flt": defaultUsfmodFlt,
    "usfmod.shwflt": defaultUsfmodShwflt,
    "dlmft": defaultDlmft,
    "butimg": defaultButimg,
    "dflg": defaultDflg,
    "yptinf": defaultYptinf,
    "usfmod.usr.extkey": defaultUsfmodUsrExtkey,
liuxin committed
19
    "chkinc": defaultCheckbox,
20
    "chkdzt": defaultCheckbox,
liuxin committed
21 22 23 24
    "chkpen": defaultCheckbox,
    "chkcor": defaultCheckbox,
    "chkaut": defaultCheckbox,
    "chkdel": defaultCheckbox,
1377875331@qq.com committed
25 26
    "chktco": updateTable,
    // "chkcan": updateTable,
liuxin committed
27 28 29
}
function defaultSptstm() {

liuxin committed
30
}
liuxin committed
31
function defaultDlaxq() {
liuxin committed
32
}
liuxin committed
33
function defaultUsfmodLabtxt() {
liuxin committed
34
}
liuxin committed
35
function defaultUsfmodFlt() {
liuxin committed
36
}
liuxin committed
37
function defaultUsfmodShwflt() {
liuxin committed
38
}
liuxin committed
39
function defaultDlmft() {
liuxin committed
40
}
liuxin committed
41
function defaultButimg() {
liuxin committed
42
}
liuxin committed
43
async function defaultDflg() {
liuxin committed
44 45 46 47
    const that = this;
    that.executeDefault("dflg").then(res => {
        that.model.dflg = res.data.dflg;
    })
liuxin committed
48
}
liuxin committed
49
async function defaultYptinf() {
liuxin committed
50 51
    const that = this;
    that.executeDefault("yptinf").then(res => {
liuxin committed
52
        //TODO 处理数据逻辑
liuxin committed
53
    })
liuxin committed
54
}
liuxin committed
55
function defaultUsfmodUsrExtkey() {
liuxin committed
56
}
57
function defaultCheckbox(rule, value, callback) {
liuxin committed
58
    const that = this;
59 60 61 62 63 64
    if (that.model[rule.field] === "") {
        return
    }
    if(that.model[rule.field] === false){
        that.model[rule.field] = "";
    }
liuxin committed
65
    that.executeDefault("sptstm").then(res => {
liuxin committed
66
        //TODO 处理数据逻辑
liuxin committed
67 68
        that.$refs.Menu.stmData.data = res.data.sptstm.rows;
    })
69
   
liuxin committed
70
}
1377875331@qq.com committed
71 72 73 74 75 76 77 78 79
function updateTable(rule, value, callback){
    const that = this;
    if (that.model[rule.field] === true && that.$refs.Menu.stmData.columns[3] === "7 6 \"Creation\" 101 20 DateTime 1") {
        that.$refs.Menu.stmData.columns.splice(3, 0, "18 5 \"MT\" 100");
    }
    if (that.model[rule.field] === false && that.$refs.Menu.stmData.columns[3] === "18 5 \"MT\" 100") {
        that.$refs.Menu.stmData.columns.splice(3, 1);
    }
}