Commit 7bb0da56 authored by David Yang's avatar David Yang

update: ui

parent 97a10aed
...@@ -43,8 +43,9 @@ ...@@ -43,8 +43,9 @@
4. 筛选区统一包含关键词、年份和当前分类关键字段;谈话类额外支持是否党员、是否领导干部、是否投资序列筛选 4. 筛选区统一包含关键词、年份和当前分类关键字段;谈话类额外支持是否党员、是否领导干部、是否投资序列筛选
5. 用户点击 `查询` 后,前端调用 `POST /record/query` 5. 用户点击 `查询` 后,前端调用 `POST /record/query`
6. 列表按 `updated_at`、`created_at` 倒序展示 6. 列表按 `updated_at`、`created_at` 倒序展示
7. 表格仅展示核心字段和操作入口;专题会议类、廉洁主题活动、节前廉洁提醒保留附件状态、更新时间辅助列;培训类外层展示序号、培训类别、时间、授课主题、授课人、参加人数、培训对象、牵头部门,不展示附件状态和更新时间;谈话类外层展示序号、年份、姓名、所属一级部门、岗位名称、是否党员、是否领导干部、是否投资序列、本年度计划谈话时间、本年度实际谈话时间,不展示附件状态和更新时间;调研类外层展示序号、调研时间、调研单位、调研人员及职务、调研内容、调研收集的建议意见,不展示附件状态和更新时间 7. 表格仅展示核心字段和操作入口,6 类台账统一不展示“附件状态”和“更新时间”列;附件完整清单在编辑弹窗中维护,更新时间继续作为后台排序字段使用
8. 完整字段在编辑弹窗中维护 8. 表格采用固定列宽布局:日期、状态类字段使用紧凑宽度,主题和长文本字段使用较宽列并单行省略,完整内容通过悬停提示查看;列数较多时允许在表格区域横向滚动,避免内容覆盖操作入口
9. 完整字段在编辑弹窗中维护
### 4.2 手动新建台账 ### 4.2 手动新建台账
......
...@@ -42,7 +42,6 @@ import { ...@@ -42,7 +42,6 @@ import {
exportLedgerTemplateWorkbook, exportLedgerTemplateWorkbook,
exportLedgerWorkbook, exportLedgerWorkbook,
exportSelectedLedgerWorkbook, exportSelectedLedgerWorkbook,
formatDateTime,
importLedgerWorkbook, importLedgerWorkbook,
loadLedgerPage, loadLedgerPage,
previewLedgerWorkbook, previewLedgerWorkbook,
...@@ -110,6 +109,43 @@ function formatCellValue(field, value) { ...@@ -110,6 +109,43 @@ function formatCellValue(field, value) {
return value === null || value === undefined || value === '' ? '-' : String(value); return value === null || value === undefined || value === '' ? '-' : String(value);
} }
const TABLE_COLUMN_WIDTHS = {
sequence_no: 72,
year: 88,
training_category: 164,
training_date: 124,
lecture_topic: 260,
lecturer: 156,
participant_count: 104,
training_target: 156,
lead_department: 156,
person_name: 112,
primary_department: 156,
position_name: 156,
is_party_member: 104,
is_leader: 116,
is_investment_sequence: 128,
planned_talk_date: 148,
actual_talk_date: 148,
research_date: 124,
research_unit: 156,
research_staff_and_position: 196,
research_content: 280,
survey_suggestions: 280,
meeting_date: 124,
meeting_topic: 260,
main_content: 280,
activity_theme: 260,
activity_format: 156,
holiday_name: 112,
holiday_other: 180,
other_measures: 280,
};
const DEFAULT_TABLE_COLUMN_WIDTH = 156;
const TABLE_SELECTION_COLUMN_WIDTH = 52;
const TABLE_ACTION_COLUMN_WIDTH = 112;
function AttachmentField({ field, value = [], onChange, disabled }) { function AttachmentField({ field, value = [], onChange, disabled }) {
const inputRef = useRef(null); const inputRef = useRef(null);
const [uploading, setUploading] = useState(false); const [uploading, setUploading] = useState(false);
...@@ -758,7 +794,23 @@ export default function IntegrityPartyPage() { ...@@ -758,7 +794,23 @@ export default function IntegrityPartyPage() {
) : records.length === 0 ? ( ) : records.length === 0 ? (
<EmptyStatePage title="当前筛选条件下还没有台账记录" /> <EmptyStatePage title="当前筛选条件下还没有台账记录" />
) : ( ) : (
<Table dense striped className="[--gutter:--spacing(5)]"> <Table
dense
striped
className="[--gutter:--spacing(5)] [&_table]:table-fixed [&_table]:min-w-[1180px]"
>
<colgroup>
<col style={{ width: TABLE_SELECTION_COLUMN_WIDTH }} />
{activeConfig.tableColumns.map((fieldName) => (
<col
key={fieldName}
style={{
width: TABLE_COLUMN_WIDTHS[fieldName] || DEFAULT_TABLE_COLUMN_WIDTH,
}}
/>
))}
<col style={{ width: TABLE_ACTION_COLUMN_WIDTH }} />
</colgroup>
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableHeader className="w-12"> <TableHeader className="w-12">
...@@ -782,12 +834,6 @@ export default function IntegrityPartyPage() { ...@@ -782,12 +834,6 @@ export default function IntegrityPartyPage() {
{fieldMap[fieldName]?.label || fieldName} {fieldMap[fieldName]?.label || fieldName}
</TableHeader> </TableHeader>
))} ))}
{activeConfig.showAttachmentStatusColumn === false ? null : (
<TableHeader>附件状态</TableHeader>
)}
{activeConfig.showUpdatedAtColumn === false ? null : (
<TableHeader>更新时间</TableHeader>
)}
<TableHeader className="text-right">操作</TableHeader> <TableHeader className="text-right">操作</TableHeader>
</TableRow> </TableRow>
</TableHead> </TableHead>
...@@ -810,29 +856,15 @@ export default function IntegrityPartyPage() { ...@@ -810,29 +856,15 @@ export default function IntegrityPartyPage() {
/> />
</TableCell> </TableCell>
{activeConfig.tableColumns.map((fieldName) => ( {activeConfig.tableColumns.map((fieldName) => (
<TableCell key={fieldName} className="max-w-[260px]"> <TableCell key={fieldName} className="overflow-hidden">
<span title={formatCellValue(fieldMap[fieldName], record.metadata[fieldName])}>
{formatCellValue(fieldMap[fieldName], record.metadata[fieldName])}
</span>
</TableCell>
))}
{activeConfig.showAttachmentStatusColumn === false ? null : (
<TableCell>
<span <span
className={clsx( className="block truncate"
'inline-flex rounded-full px-2.5 py-1 text-xs font-medium', title={formatCellValue(fieldMap[fieldName], record.metadata[fieldName])}
record.attachmentCount > 0
? 'bg-emerald-50 text-emerald-700 ring-1 ring-emerald-200'
: 'bg-zinc-100 text-zinc-600 ring-1 ring-zinc-200',
)}
> >
{record.attachmentStatus} {formatCellValue(fieldMap[fieldName], record.metadata[fieldName])}
</span> </span>
</TableCell> </TableCell>
)} ))}
{activeConfig.showUpdatedAtColumn === false ? null : (
<TableCell>{formatDateTime(record.updatedAt)}</TableCell>
)}
<TableCell className="text-right"> <TableCell className="text-right">
<Button type="button" plain onClick={() => openEditDialog(record)}> <Button type="button" plain onClick={() => openEditDialog(record)}>
<PencilSquareIcon data-slot="icon" /> <PencilSquareIcon data-slot="icon" />
......
...@@ -71,8 +71,6 @@ export const INTEGRITY_LEDGER_CONFIGS = [ ...@@ -71,8 +71,6 @@ export const INTEGRITY_LEDGER_CONFIGS = [
'training_target', 'training_target',
'lead_department', 'lead_department',
], ],
showAttachmentStatusColumn: false,
showUpdatedAtColumn: false,
batchFields: ['training_category', 'training_date', 'lead_department'], batchFields: ['training_category', 'training_date', 'lead_department'],
fields: [ fields: [
field('序号', 'sequence_no', FIELD_TYPES.NUMBER), field('序号', 'sequence_no', FIELD_TYPES.NUMBER),
...@@ -125,8 +123,6 @@ export const INTEGRITY_LEDGER_CONFIGS = [ ...@@ -125,8 +123,6 @@ export const INTEGRITY_LEDGER_CONFIGS = [
'planned_talk_date', 'planned_talk_date',
'actual_talk_date', 'actual_talk_date',
], ],
showAttachmentStatusColumn: false,
showUpdatedAtColumn: false,
filterFields: [ filterFields: [
field('是否党员', 'is_party_member', FIELD_TYPES.BOOLEAN, { field('是否党员', 'is_party_member', FIELD_TYPES.BOOLEAN, {
emptyLabel: '全部', emptyLabel: '全部',
...@@ -188,8 +184,6 @@ export const INTEGRITY_LEDGER_CONFIGS = [ ...@@ -188,8 +184,6 @@ export const INTEGRITY_LEDGER_CONFIGS = [
'research_content', 'research_content',
'survey_suggestions', 'survey_suggestions',
], ],
showAttachmentStatusColumn: false,
showUpdatedAtColumn: false,
batchFields: ['research_date', 'research_unit', 'remarks'], batchFields: ['research_date', 'research_unit', 'remarks'],
fields: [ fields: [
field('序号', 'sequence_no', FIELD_TYPES.NUMBER), field('序号', 'sequence_no', FIELD_TYPES.NUMBER),
......
...@@ -88,7 +88,7 @@ type Record = { ...@@ -88,7 +88,7 @@ type Record = {
- 筛选区统一包含关键词、年份和当前分类关键字段 - 筛选区统一包含关键词、年份和当前分类关键字段
- 关键词检索应覆盖当前台账对象的核心文本字段 - 关键词检索应覆盖当前台账对象的核心文本字段
- 日期字段页面和 Excel 展示为 `YYYY-MM-DD`,保存为 ISO 8601 字符串 - 日期字段页面和 Excel 展示为 `YYYY-MM-DD`,保存为 ISO 8601 字符串
- 附件字段在列表中展示上传状态,完整文件列表在编辑弹窗维护 - 附件字段不在列表中展示状态,完整文件列表仅在编辑弹窗维护
--- ---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment