From 81f5165150c084af52f316f89061c4bdab72a648 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 27 Mar 2022 09:07:18 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/components/TableCard.js | 2 + spug_web/src/pages/deploy/request/Table.js | 76 ++++++++++++------- .../pages/deploy/request/index.module.less | 12 +++ 3 files changed, 62 insertions(+), 28 deletions(-) diff --git a/spug_web/src/components/TableCard.js b/spug_web/src/components/TableCard.js index 46e974a..2a449e0 100644 --- a/spug_web/src/components/TableCard.js +++ b/spug_web/src/components/TableCard.js @@ -176,6 +176,8 @@ function TableCard(props) { onFieldsChange={handleFieldsChange} onReload={props.onReload}/> fields.includes(index))} diff --git a/spug_web/src/pages/deploy/request/Table.js b/spug_web/src/pages/deploy/request/Table.js index 6963827..007d36e 100644 --- a/spug_web/src/pages/deploy/request/Table.js +++ b/spug_web/src/pages/deploy/request/Table.js @@ -9,11 +9,13 @@ import { BranchesOutlined, BuildOutlined, TagOutlined, PlusOutlined, TagsOutline import { Radio, Modal, Popover, Tag, Popconfirm, Tooltip, message } from 'antd'; import { http, hasPermission } from 'libs'; import { Action, AuthButton, TableCard } from 'components'; +import S from './index.module.less'; import store from './store'; function ComTable() { const columns = [{ title: '申请标题', + className: S.min180, render: info => (
{info.type === '2' && R} @@ -24,12 +26,15 @@ function ComTable() { ) }, { title: '应用', + className: S.min120, dataIndex: 'app_name', }, { title: '发布环境', + className: S.min120, dataIndex: 'env_name', }, { title: '版本', + className: S.min155, render: info => { if (info['app_extend'] === '1') { const [ext1] = info.extra || info.rep_extra; @@ -47,8 +52,47 @@ function ComTable() { ) } } + }, { + title: '申请人', + className: S.min120, + dataIndex: 'created_by_user', + hide: true + }, { + title: '申请时间', + className: S.min120, + dataIndex: 'created_at', + sorter: (a, b) => a['created_at'].localeCompare(b['created_at']), + render: v => {v ? v.substring(0, 10) : null}, + hide: true + }, { + title: '审核人', + className: S.min120, + dataIndex: 'approve_by_user', + hide: true + }, { + title: '审核时间', + className: S.min120, + dataIndex: 'approve_at', + render: v => {v ? v.substring(0, 10) : null}, + }, { + title: '发布人', + className: S.min120, + dataIndex: 'do_by_user', + hide: true + }, { + title: '发布时间', + className: S.min120, + dataIndex: 'do_at', + render: v => {v ? v.substring(0, 10) : null}, + hide: true + }, { + title: '备注', + className: S.min120, + dataIndex: 'desc', }, { title: '状态', + fixed: 'right', + className: S.min120, render: info => { if (info.status === '-1' && info.reason) { return @@ -68,36 +112,10 @@ function ComTable() { return {info['status_alias']} } } - }, { - title: '申请人', - dataIndex: 'created_by_user', - hide: true - }, { - title: '申请时间', - dataIndex: 'created_at', - sorter: (a, b) => a['created_at'].localeCompare(b['created_at']), - hide: true - }, { - title: '审核人', - dataIndex: 'approve_by_user', - hide: true - }, { - title: '审核时间', - dataIndex: 'approve_at' - }, { - title: '发布人', - dataIndex: 'do_by_user', - hide: true - }, { - title: '发布时间', - dataIndex: 'do_at', - hide: true - }, { - title: '备注', - dataIndex: 'desc', }, { title: '操作', - className: hasPermission('deploy.request.do|deploy.request.edit|deploy.request.approve|deploy.request.del') ? null : 'none', + fixed: 'right', + className: hasPermission('deploy.request.do|deploy.request.edit|deploy.request.approve|deploy.request.del') ? S.min180 : 'none', render: info => { switch (info.status) { case '-3': @@ -169,6 +187,8 @@ function ComTable() { rowKey="id" title="申请列表" columns={columns} + scroll={{x: 1500}} + tableLayout="auto" loading={store.isFetching} dataSource={store.dataSource} onReload={store.fetchRecords} diff --git a/spug_web/src/pages/deploy/request/index.module.less b/spug_web/src/pages/deploy/request/index.module.less index d493a24..af4f8c8 100644 --- a/spug_web/src/pages/deploy/request/index.module.less +++ b/spug_web/src/pages/deploy/request/index.module.less @@ -100,4 +100,16 @@ .upload :global(.ant-upload-list-item) { margin: 0; +} + +.min120 { + min-width: 120px; +} + +.min155 { + min-width: 155px; +} + +.min180 { + min-width: 180px; } \ No newline at end of file