
/**
* Sptsel Default规则
*/
import Api from "~/service/Api";
import Utils from "~/utils/index"
export default {

    "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,
    "chkinc": defaultCheckbox,
    "chkdzt": defaultCheckbox,
    "chkpen": defaultCheckbox,
    "chkcor": defaultCheckbox,
    "chkaut": defaultCheckbox,
    "chkdel": defaultCheckbox,
    "chktco": updateTable,
    // "chkcan": updateTable,
}
function defaultSptstm() {

}
function defaultDlaxq() {
}
function defaultUsfmodLabtxt() {
}
function defaultUsfmodFlt() {
}
function defaultUsfmodShwflt() {
}
function defaultDlmft() {
}
function defaultButimg() {
}
async function defaultDflg() {
    const that = this;
    that.executeDefault("dflg").then(res => {
        that.model.dflg = res.data.dflg;
    })
}
async function defaultYptinf() {
    const that = this;
    that.executeDefault("yptinf").then(res => {
        //TODO 处理数据逻辑
    })
}
function defaultUsfmodUsrExtkey() {
}
function defaultCheckbox(rule, value, callback) {
    const that = this;
    if (that.model[rule.field] === "") {
        return
    }
    if(that.model[rule.field] === false){
        that.model[rule.field] = "";
    }
    that.executeDefault("sptstm").then(res => {
        //TODO 处理数据逻辑
        that.$refs.Menu.stmData.data = res.data.sptstm.rows;
    })
   
}
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);
    }
}
