META-INF.resources.asset.ajaxjs-ui.js.widgets.admin.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ajaxjs-web Show documentation
Show all versions of ajaxjs-web Show documentation
AJAXJS Web aims to full-stack, not only the server-side framework, but also integrates the front-end library. It's written in HTML5 + Java, a successor to the JVM platform, efficient, secure, stable, cross-platform and many other advantages, but it abandoned the traditional enterprise architecture brought about by the large and bloated, emphasizing the lightweight, and fast, very suitable for the Internet fast application.
// 后台头部导航
Vue.component('ajaxjs-admin-header', {
props : {
isCreate : Boolean, // true=新建/fasle=编辑
uiName : String, // 实体名称
infoId : { // 实体 id
type: Number,
required: false
}
},
template :
'\
\
\
新窗口打开\
\
\
'
})
// 后台增加、编辑、复位、删除按钮
Vue.component('ajaxjs-admin-info-btns', {
props : {
isCreate : Boolean // true=新建/fasle=编辑
},
template :
'\
\
\
\
',
methods : {
del : function () {
if (confirm('确定删除?'))
ajaxjs.xhr.dele('.', function(json) {
if (json && json.isOk) {
alert(json.msg);
location.assign('../list/');
}
});
}
}
});
// 搜索、分类下拉
Vue.component('aj-admin-filter-panel', {
props : {
label : {
type : String,
required : false
},
catelogId :{ //
type: Number,
required: false
},
selectedCatelogId :{ // 已选中的分类 id
type: Number,
required: false
},
noCatelog :{
type : Boolean, // 是否不需要 分类下拉
default : false
}
},
template:
'\
\
{{label||\'分类\'}}: \
'
});
aj.admin = {
del : function(id, title) {
if (confirm('请确定删除记录:\n' + title + ' ?')) {
ajaxjs.xhr.dele('../' + id + '/', function(json) {
if (json.isOk) {
alert('删除成功!');
location.reload();
}
});
}
},
setStatus : function(id, status) {
ajaxjs.xhr.post('../setStatus/' + id + '/', function(json) {
if (json.isOk) {
}
}, {
status : status
});
}
};