Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

隐藏首页右侧多余的滚动条;调整详情页布局方案,适应账单详情场景显示要求 #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 64 additions & 19 deletions myapp/frontend/src/pages/ADUGTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1010,27 +1010,72 @@ export default function TaskListManager(props?: IAppMenuItem) {
destroyOnClose
onCancel={() => { setVisableDetail(false) }}>
<Spin spinning={loadingDetail}>
<div className="pb32" style={{ minHeight: 300 }}>
{
dataDetail.map((item, index) => {
return <Row className="mb16" key={`dataDetail_${index}`}>
<Col span={6}><div className="ta-r"><strong>{item.label}:</strong></div></Col>
<Col span={18}><pre style={{ whiteSpace: 'break-spaces' }} dangerouslySetInnerHTML={{
__html: (() => {
let content = item.value
if (Object.prototype.toString.call(item.value) === '[object Object]' || Object.prototype.toString.call(item.value) === '[object Array]') {
try {
content = JSON.stringify(item.value)
} catch (error) { }
}
return content
})()
}}></pre></Col>
</Row>
})
}
<div className="pb8"
style={{
paddingBottom: '8px',
minHeight: '400px', // 最小高度
maxWidth: '80vw', // 最大宽度
margin: '0 auto', // 水平居中
overflowX: 'auto', // 横向滚动条
}}
>
{dataDetail.map((item, index) => (
<div
key={`dataDetail_${index}`}
style={{
display: 'flex',
gap: '1rem',
marginBottom: '1rem'
}}
>
{/* Label列 */}
<div
style={{
display: 'flex',
justifyContent: 'flex-end', // 第一列内容靠右对齐
paddingRight: '1rem',
minWidth:'80px'
}}
>
<strong>{item.label}:</strong>
</div>

{/* Value列 */}
<div
style={{
flex: '1',
display: 'flex',
justifyContent: 'flex-start', // 第二列内容靠左对齐
}}
>
<pre
style={{
whiteSpace: 'pre-wrap',
wordBreak: 'break-word',
overflowX: 'auto',
margin: 0,
}}
dangerouslySetInnerHTML={{
__html: (() => {
let content = item.value;
if (
Object.prototype.toString.call(item.value) === '[object Object]' ||
Object.prototype.toString.call(item.value) === '[object Array]'
) {
try {
content = JSON.stringify(item.value, null, 2); // 格式化输出
} catch (error) {}
}
return content;
})(),
}}
></pre>
</div>
</div>
))}
</div>
</Spin>

</Modal>

<TitleHeader title={<>
Expand Down
2 changes: 1 addition & 1 deletion myapp/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block content %}
<div class="di-home" style="position: absolute;width: 100%;height: 100%;left: 0;top: 0px;padding-top:15px;background-color: #fff;">
<div class="di-home" style="position: absolute;width: 100%;height: 100%;left: 0;top: 0px;padding-top:15px;background-color: #fff;overflow: hidden;">
<iframe src="/static/appbuilder/vison/index.html#/home" style="width:100%;height:100%;border: none;"></iframe>
</div>
<script>
Expand Down