框架配置
TopJUI框架提供了部分用户可自定义的参数属性,自定义配置文件路径为:static/public/js/topjui.config.js, 使用前建议先了解配置文件中的参数,或许可以帮助你减少开发中的工作量,各配置属性说明详见配置文件。
javascript
<script>
var myConfig = {
config: {
pkName: 'uuid',
singleQuotesParam: true,
aloneUse: false,
datagrid: {
size: 'rows',
page: 'page',
rows: 'rows',
total: 'total'
},
postJson: true,
code: {
success: 200,
failure: 300
}
},
language: {
message: {
title: {
operationTips: '操作提示',
confirmTips: '确认提示'
},
msg: {
success: '操作成功',
failed: '操作失败',
error: '未知错误',
checkSelfGrid: '请先勾选中要操作的数据前的复选框',
selectSelfGrid: '请先选中要操作的数据',
selectParentGrid: '请先选中主表中要操作的一条数据',
permissionDenied: '对不起,你没有操作权限',
confirmDelete: '你确定要删除所选的数据吗?',
confirmMsg: '确定要执行该操作吗?'
}
}
}
}
</script>状态码说明
- 状态码:200,从窗口右下角弹出消息提示框,2秒后自动隐藏;
- 状态码:300,从窗口中间弹出消息提示窗,需要手动关闭;
成功响应示例
json
{
"code": 200,
"title": "操作提示",
"message": "恭喜你,操作成功!"
}失败响应示例
json
{
"code": 300,
"title": "操作提示",
"message": "对不起,操作失败!"
}