Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Mar 12, 2024
1 parent f5cf12a commit 5404682
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
38 changes: 29 additions & 9 deletions src/main/resources/web/assets/css/list-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ See LICENSE and COMMERCIAL in the project root for license information.
overflow: auto;
}

.record-merge-table table > thead > tr > th {
border-bottom-color: #aaa;
}

.record-merge-table table th {
min-width: 200px;
}
Expand All @@ -195,25 +199,41 @@ See LICENSE and COMMERCIAL in the project root for license information.
}

.record-merge-table table td.active {
border: 1px double #34a853;
background-color: #f5f8fd;
background-color: #dee2e6;
}

.record-merge-table table td.sysfield {
cursor: not-allowed;
}

.record-merge-table table td.active::after {
font-family: 'Material Design Icons', serif;
content: '\F012C';
position: absolute;
right: 7px;
top: 5px;
right: 6px;
top: 6px;
color: #34a853;
font-size: 1.12rem;
font-size: 1rem;
font-weight: bold;
}

.record-merge-table table tbody tr:first-child td.active::before {
height: 1px;
line-height: 1;
font-size: 0;
content: '';
position: absolute;
background-color: #34a853;
top: -1px;
left: 0;
width: 100%;
}

.record-merge-table table td.sysfield {
cursor: not-allowed;
}

.record-merge-table table tr.bt2 {
border-top: 2px solid #dee2e6;
border-top: 2px solid #aaa;
}

.record-merge-table table tr.bt2 label {
margin-top: 2px;
}
20 changes: 15 additions & 5 deletions src/main/resources/web/assets/js/general/rb-datalist.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,7 @@ CellRenders.addRender('TAG', function (v, s, k) {
class RecordMerger extends RbModalHandler {
constructor(props) {
super(props)
this.state.keepMain = props.ids[0]
}
render() {
Expand All @@ -1861,11 +1862,12 @@ class RecordMerger extends RbModalHandler {
idData.map((item, idx) => {
if (idx === 0) return null
return (
<th key={idx} data-id={item[0]}>
<strong>{item[1]}</strong>
<th key={idx} data-id={item[0]} onClick={() => this.setState({ keepMain: item[0] })}>
<a href={`${rb.baseUrl}/app/redirect?id=${item[0]}&type=newtab`} target="_blank" title={$L('打开')}>
<b className="fs-12">{item[1]}</b>
<i className="icon zmdi zmdi zmdi-open-in-new ml-1" />
</a>
{this.state.keepMain === item[0] && <span className="badge badge-success badge-pill ml-1">{$L('主')}</span>}
</th>
)
})}
Expand Down Expand Up @@ -1991,23 +1993,31 @@ class RecordMerger extends RbModalHandler {
merged[field] = id || null
}
})
console.log(merged)

const details = []
$(this._$mergeDetails)
.find('input[checked]')
.each(function () {
details.push($(this).val())
})
const url = `/app/${this.props.entity}/record-merge/merge?ids=${this.props.ids.join(',')}&deleteAfter=${del || false}&mergeDetails=${details.join(',')}`

let ids = this.props.ids
ids.remove(this.state.keepMain)
ids = [this.state.keepMain, ...ids]

const url = `/app/${this.props.entity}/record-merge/merge?ids=${ids.join(',')}&deleteAfter=${del || false}&mergeDetails=${details.join(',')}`
const $btn = $(this._$btn).find('.btn').button('loading')
$.post(url, JSON.stringify(merged), (res) => {
if (res.error_code === 0) {
this.hide()
RbHighbar.success($L('合并成功'))
this.props.listRef.reload()

setTimeout(() => {
CellRenders.clickView({ id: res.data, entity: this.props.entity })
window.RbViewModal.create({ id: res.data, entity: this.props.entity })
if (window.RbListPage) {
location.hash = `!/View/${this.props.entity}/${res.data}`
}
}, 500)
} else {
RbHighbar.error(res.error_msg)
Expand Down
9 changes: 2 additions & 7 deletions src/main/resources/web/assets/js/general/rb-forms.append.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,18 +736,13 @@ class RepeatedViewer extends RbModalHandler {
return <td key={`col-${idx}-${i}`}>{o || <span className="text-muted">{$L('无')}</span>}</td>
})}
<td className="actions">
<button type="button" className="btn btn-light btn-sm w-auto" onClick={() => this.openView(item[0])} title={$L('查看详情')}>
<a className="btn btn-light btn-sm w-auto" style={{ lineHeight: '28px' }} title={$L('打开')} href={`${rb.baseUrl}/app/redirect?id=${item[0]}&type=newtab`} target="_blank">
<i className="zmdi zmdi-open-in-new fs-16 down-2" />
</button>
</a>
</td>
</tr>
)
}
openView(id) {
if (window.RbViewModal) window.RbViewModal.create({ id: id, entity: this.props.entity })
else window.open(`${rb.baseUrl}/app/entity/view?id=${id}`)
}
}
// -- LiteForm
Expand Down

0 comments on commit 5404682

Please sign in to comment.