mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-02-25 23:05:06 +08:00
页面规范
This commit is contained in:
parent
dd232e2182
commit
3fa6a7578a
15 changed files with 105 additions and 42 deletions
|
@ -180,6 +180,7 @@ public class FormManager extends LayoutManager {
|
|||
else if (!entityMeta.containsField(fieldName)) {
|
||||
LOG.warn("Unknow field '" + fieldName + "' in '" + entity + "'");
|
||||
iter.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
Field fieldMeta = entityMeta.getField(fieldName);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# DB settings
|
||||
|
||||
db.url=jdbc:mysql://127.0.0.1:4653/rebuild?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
db.url=jdbc:mysql://127.0.0.1:4653/rebuild10?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
db.user=rebuild
|
||||
db.passwd=rebuild
|
||||
|
||||
|
|
|
@ -69,12 +69,20 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-forms-ext.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/bizuser/dept-tree.js"></script>
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordList',
|
||||
entity: ['Department','${entityLabel}','${entityIcon}'],
|
||||
privileges: ${entityPrivileges},
|
||||
listConfig: ${DataListConfig},
|
||||
advFilter: false
|
||||
}
|
||||
</script>
|
||||
<script type="text/babel">
|
||||
RbForm.postAfter = function(){
|
||||
location.reload()
|
||||
}
|
||||
$(document).ready(function(){
|
||||
RbListPage.init($.parseJSON('${DataListConfig}'), ['Department','${entityLabel}','${entityIcon}'], $.parseJSON('${entityPrivileges}'))
|
||||
loadDeptTree()
|
||||
})
|
||||
clickDept = function(depts) {
|
||||
|
|
|
@ -45,9 +45,15 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-forms-ext.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-view.jsx" type="text/babel"></script>
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordView',
|
||||
entity: ['Department','${entityLabel}','${entityIcon}'],
|
||||
recordId: '${id}'
|
||||
}
|
||||
</script>
|
||||
<script type="text/babel">
|
||||
$(document).ready(function(){
|
||||
RbViewPage.init('${id}', ['Department','${entityLabel}','${entityIcon}'])
|
||||
if (rb.isAdminUser == false || rb.isAdminVerified == false) $('.view-action').remove()
|
||||
|
||||
$('.J_delete').off('click').click(function(){
|
||||
|
|
|
@ -39,9 +39,15 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-forms-ext.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-view.jsx" type="text/babel"></script>
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordView',
|
||||
entity: ['Role','${entityLabel}','${entityIcon}'],
|
||||
recordId: '${id}'
|
||||
}
|
||||
</script>
|
||||
<script type="text/babel">
|
||||
$(document).ready(function(){
|
||||
RbViewPage.init('${id}', ['Role','${entityLabel}','${entityIcon}'])
|
||||
if (rb.isAdminUser == false || rb.isAdminVerified == false) $('.view-action').remove()
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -74,6 +74,15 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-forms-ext.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/bizuser/dept-tree.js"></script>
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordList',
|
||||
entity: ['User','${entityLabel}','${entityIcon}'],
|
||||
privileges: ${entityPrivileges},
|
||||
listConfig: ${DataListConfig},
|
||||
advFilter: false
|
||||
}
|
||||
</script>
|
||||
<script type="text/babel">
|
||||
let formPostType = 1
|
||||
RbForm.postAfter = function(){
|
||||
|
@ -81,7 +90,6 @@ RbForm.postAfter = function(){
|
|||
else loadDeptTree()
|
||||
}
|
||||
$(document).ready(function(){
|
||||
RbListPage.init($.parseJSON('${DataListConfig}'), ['User','${entityLabel}','${entityIcon}'], $.parseJSON('${entityPrivileges}'))
|
||||
loadDeptTree()
|
||||
|
||||
$('.J_new').click(function(){ formPostType = 1 })
|
||||
|
|
|
@ -52,9 +52,15 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-forms-ext.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-view.jsx" type="text/babel"></script>
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordView',
|
||||
entity: ['User','${entityLabel}','${entityIcon}'],
|
||||
recordId: '${id}'
|
||||
}
|
||||
</script>
|
||||
<script type="text/babel">
|
||||
$(document).ready(function(){
|
||||
RbViewPage.init('${id}', ['User','${entityLabel}','${entityIcon}'])
|
||||
if (rb.isAdminUser == false || rb.isAdminVerified == false) $('.view-action').remove()
|
||||
|
||||
$('.J_delete').off('click').click(function(){
|
||||
|
@ -85,7 +91,7 @@ $(document).ready(function(){
|
|||
if (res.data.disabled == true) reason.push('已停用')
|
||||
$('.J_tips').removeClass('hide').find('.message p').text('当前用户处于未激活状态,因为其 ' + reason.join(' / '))
|
||||
})
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -75,7 +75,7 @@ a#entityIcon:hover{opacity:0.8}
|
|||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-sm-right">主显字段</label>
|
||||
<div class="col-lg-5 col-sm-10">
|
||||
<select class="form-control form-control-sm" id="nameField">
|
||||
<select class="form-control form-control-sm" id="nameField" data-o="${nameField}">
|
||||
</select>
|
||||
<p class="form-text mb-0">好的主显字段应能够清晰的表示记录本身,如客户中的客户名称或订单中的订单编号</p>
|
||||
</div>
|
||||
|
@ -122,7 +122,8 @@ $(document).ready(function(){
|
|||
label = $val('#entityLabel'),
|
||||
comments = $val('#comments'),
|
||||
nameField = $val('#nameField')
|
||||
let _data = { icon:icon, entityLabel:label, comments:comments, nameField:nameField }
|
||||
let _data = { entityLabel:label, comments:comments, nameField:nameField }
|
||||
if (!!icon) data.icon = icon
|
||||
_data = $cleanMap(_data)
|
||||
if (Object.keys(_data) == 0){ location.reload(); return }
|
||||
|
||||
|
@ -140,12 +141,12 @@ $(document).ready(function(){
|
|||
|
||||
$.get(rb.baseUrl + '/commons/metadata/fields?entity=${entityName}', function(d){
|
||||
let rs = d.data.map((item) => {
|
||||
let not = item.type == 'REFERENCE' || item.type == 'NTEXT'
|
||||
let unName = item.type == 'REFERENCE' || item.type == 'NTEXT'
|
||||
return {
|
||||
id: item.name,
|
||||
text: item.label,
|
||||
disabled: not,
|
||||
title: not ? '此字段(类型)不能作为主显字段' : ''
|
||||
disabled: unName,
|
||||
title: unName ? '此字段(类型)不能作为主显字段' : ''
|
||||
}
|
||||
})
|
||||
$('#nameField').select2({
|
||||
|
|
|
@ -74,9 +74,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<%@ include file="/_include/Foot.jsp"%>
|
||||
<script>
|
||||
var FormConfig = ${FormConfig} || []; // ES5:Unbabel
|
||||
</script>
|
||||
<script type="text/babel">
|
||||
$(document).ready(function(){
|
||||
const config = JSON.parse('${FormConfig}' || '[]');
|
||||
const config = FormConfig
|
||||
$.get('../list-field?entity=${entityName}', function(res){
|
||||
let validFields = {}, configFields = []
|
||||
$(config.elements).each(function(){ configFields.push(this.field) })
|
||||
|
|
|
@ -472,4 +472,12 @@ const QuickFilter = {
|
|||
// 复写增加额外过滤条件
|
||||
mergeFilter() {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Init
|
||||
$(document).ready(() => {
|
||||
let wpc = window.__PageConfig
|
||||
if (!wpc) return
|
||||
RbListPage.init(wpc.listConfig, wpc.entity, wpc.privileges)
|
||||
if (!(wpc.advFilter == false)) rb.AdvFilter.init('.adv-search', wpc.entity[0])
|
||||
})
|
|
@ -120,11 +120,9 @@ const RbViewPage = {
|
|||
$('.J_reload').click(function(){
|
||||
location.reload()
|
||||
})
|
||||
|
||||
this.renderRecordMeta()
|
||||
},
|
||||
|
||||
renderRecordMeta() {
|
||||
initRecordMeta() {
|
||||
$.get(`${rb.baseUrl}/app/entity/record-meta?id=${this.__id}`, function(res){
|
||||
if (res.error_code == 0) {
|
||||
let _data = res.data
|
||||
|
@ -257,4 +255,14 @@ const RbViewPage = {
|
|||
else setTimeout(function() { parent.location.reload() }, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Init
|
||||
$(document).ready(function(){
|
||||
let wpc = window.__PageConfig
|
||||
if (!wpc) return
|
||||
RbViewPage.init(wpc.recordId, wpc.entity, wpc.privileges)
|
||||
RbViewPage.initRecordMeta()
|
||||
if (!!wpc.viewTabs) RbViewPage.initVTabs(wpc.viewTabs)
|
||||
if (!!wpc.viewAdds) RbViewPage.initVAdds(wpc.viewAdds)
|
||||
})
|
|
@ -81,12 +81,14 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-advfilter.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/assign-share.jsx" type="text/babel"></script>
|
||||
<script type="text/babel">
|
||||
window.pageType = 'RecordList'
|
||||
$(document).ready(function(){
|
||||
RbListPage.init($.parseJSON('${DataListConfig}'), ['${entityName}','${entityLabel}','${entityIcon}'], $.parseJSON('${entityPrivileges}'))
|
||||
rb.AdvFilter.init('.adv-search', '${entityName}')
|
||||
})
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordList',
|
||||
entity: ['${entityName}','${entityLabel}','${entityIcon}'],
|
||||
privileges: ${entityPrivileges},
|
||||
listConfig: ${DataListConfig},
|
||||
advFilter: true
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -87,13 +87,15 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-view.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/assign-share.jsx" type="text/babel"></script>
|
||||
<script type="text/babel">
|
||||
window.pageType = 'RecordView'
|
||||
$(document).ready(function(){
|
||||
RbViewPage.init('${id}', ['${entityName}','${entityLabel}','${entityIcon}'], $.parseJSON('${entityPrivileges}'))
|
||||
RbViewPage.initVTabs($.parseJSON('${ViewTabs}'))
|
||||
RbViewPage.initVAdds($.parseJSON('${ViewAdds}'))
|
||||
})
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'RecordView',
|
||||
entity: ['${entityName}','${entityLabel}','${entityIcon}'],
|
||||
privileges: ${entityPrivileges},
|
||||
viewTabs: ${ViewTabs},
|
||||
viewAdds: ${ViewAdds},
|
||||
recordId: '${id}'
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -75,12 +75,14 @@
|
|||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-advfilter.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/assign-share.jsx" type="text/babel"></script>
|
||||
<script type="text/babel">
|
||||
window.pageType = 'SlaveList'
|
||||
$(document).ready(function(){
|
||||
RbListPage.init($.parseJSON('${DataListConfig}'), ['${entityName}','${entityLabel}','${entityIcon}'], $.parseJSON('${entityPrivileges}'))
|
||||
rb.AdvFilter.init('.adv-search', '${entityName}')
|
||||
})
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'SlaveList',
|
||||
entity: ['${entityName}','${entityLabel}','${entityIcon}'],
|
||||
privileges: ${entityPrivileges},
|
||||
listConfig: ${DataListConfig},
|
||||
advFilter: true
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -59,11 +59,13 @@
|
|||
<%@ include file="/_include/Foot.jsp"%>
|
||||
<script src="${baseUrl}/assets/js/rb-forms.jsx" type="text/babel"></script>
|
||||
<script src="${baseUrl}/assets/js/rb-view.jsx" type="text/babel"></script>
|
||||
<script type="text/babel">
|
||||
window.pageType = 'SlaveView'
|
||||
$(document).ready(function(){
|
||||
RbViewPage.init('${id}', ['${entityName}','${entityLabel}','${entityIcon}'], $.parseJSON('${entityPrivileges}'))
|
||||
})
|
||||
<script>
|
||||
window.__PageConfig = {
|
||||
type: 'SlaveView',
|
||||
entity: ['${entityName}','${entityLabel}','${entityIcon}'],
|
||||
privileges: ${entityPrivileges},
|
||||
recordId: '${id}'
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue