$(function () {
    vm.getMkCenterMenuList();
});

let vm = new Vue({
	el: '#rrapp',
	data: {
        showList: true,
        title: null,
		mkCenterMenu: {},
		ruleValidate: {},
        mkCenterMenuList: []
	},
	methods: {
        getMkCenterMenuList: function() {
            $.get("../mkcentermenu/queryAll", function (r) {
                vm.mkCenterMenuList = r.list;
            });
        },
		getInfo: function(id){
			$.get("../mkcentermenu/info/"+id, function (r) {
                vm.mkCenterMenu = r.mkCenterMenu;
            });
		},
		reload: function (event) {
			vm.showList = true;
            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
			$("#jqGrid").jqGrid('setGridParam', {
                postData: {'name': vm.q.name},
                page: page
            }).trigger("reloadGrid");
            vm.handleReset('formValidate');
		},
        handleSubmit: function (name) {
            handleSubmitValidate(this, name, function () {
                vm.saveOrUpdate()
            });
        },
        handleReset: function (name) {
            handleResetForm(this, name);
        }
	}
});