;
var operationPage = new Vue({
    el: "#operationPage",
    data: {
        loginLoading: false,
        userId: 0,
        addForm: {
            mobile: '',
            linkName: '',
            userID: '',
            clubID: '',
            configFlag: 2
        },
        rule: {
            name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
            phone: '^\\d{6,12}$'
        }
    },
    computed: {

    },
    methods: {
        addConfirmFn:function(data){//添加运营人员
            var _self = this;
            var pass = verifyForm();
            if (_self.loginLoading) { return false; }
            if (!pass) {return false;}
            _self.loginLoading = true;
            UserApi.AddOperationUse(_self.addForm,function (response) {
                if(response.code == 0 ){ //删除成功
                    CAIMEI.dialog('添加成功',true,function () {
                        window.location.href='/user/operation/list.html';
                        _self.loginLoading = false;
                    });
                }else{
                    CAIMEI.Alert(response.msg,'确定',false);
                    _self.loginLoading = false;
                }
            })
        },
        blurHandle: function(event) { // 失去焦点校验
            var el = event.currentTarget;
            verifyHandle(el);
        }
    },
    mounted: function () {
        if(globalUserData){
            this.addForm.userID = globalUserData.userId;
            this.addForm.clubID = globalUserData.clubId;
        }
        $('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
        $('.navLayout').find('.navList').eq(1).addClass("on").find('.con').show().find('a').eq(1).addClass("on");

    }
});
