Adjust the table column's width, fix the operate column and add sorter to some column. (#86)
diff --git a/src/routes/Plugin/Common/index.js b/src/routes/Plugin/Common/index.js
index c4b404d..8fb72ea 100644
--- a/src/routes/Plugin/Common/index.js
+++ b/src/routes/Plugin/Common/index.js
@@ -475,7 +475,8 @@
align: "center",
title: getIntlContent("SOUL.SYSTEM.UPDATETIME"),
dataIndex: "dateCreated",
- key: "dateCreated"
+ key: "dateCreated",
+ sorter: (a,b) => a.dateCreated > b.dateCreated ? 1 : -1,
},
{
align: "center",
diff --git a/src/routes/System/AppAuth/index.js b/src/routes/System/AppAuth/index.js
index 574595c..dd2902d 100644
--- a/src/routes/System/AppAuth/index.js
+++ b/src/routes/System/AppAuth/index.js
@@ -348,7 +348,7 @@
dataIndex: "appKey",
key: "appKey",
ellipsis:true,
- width: 180,
+ width: 320,
},
{
align: "center",
@@ -356,7 +356,7 @@
dataIndex: "appSecret",
key: "appSecret",
ellipsis:true,
- width: 180,
+ width: 320,
},
{
align: "center",
@@ -364,6 +364,7 @@
dataIndex: "userId",
key: "userId",
ellipsis:true,
+ width: 80,
},
{
align: "center",
@@ -371,6 +372,7 @@
dataIndex: "phone",
key: "phone",
ellipsis:true,
+ width: 120,
},
{
align: "center",
@@ -378,6 +380,7 @@
dataIndex: "open",
key: "open",
ellipsis:true,
+ width: 80,
render: text => {
if (text) {
return <div className="open">{getIntlContent("SOUL.COMMON.OPEN")}</div>;
@@ -392,6 +395,7 @@
dataIndex: "enabled",
key: "enabled",
ellipsis:true,
+ width: 80,
render: text => {
if (text) {
return <div className="open">{getIntlContent("SOUL.COMMON.OPEN")}</div>;
@@ -407,6 +411,7 @@
render: dateUpdated => dayjs(dateUpdated).format('YYYY-MM-DD HH:mm:ss' ),
key: "dateUpdated",
ellipsis:true,
+ sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
{
align: "center",
@@ -414,6 +419,8 @@
dataIndex: "operate",
key: "operate",
ellipsis:true,
+ width: 80,
+ fixed: "right",
render: (text, record) => {
return (
// 弹窗中的编辑事件
@@ -436,6 +443,8 @@
dataIndex: "operates",
key: "operates",
ellipsis:true,
+ width: 140,
+ fixed: "right",
render: (text, record) => {
if(record.open){
return (
@@ -544,6 +553,7 @@
rowKey={record => record.id}
loading={loading}
columns={columns}
+ scroll={{ x: 1450 }}
dataSource={authList}
rowSelection={rowSelection}
pagination={{
diff --git a/src/routes/System/Dict/index.js b/src/routes/System/Dict/index.js
index 449f425..8b986e1 100644
--- a/src/routes/System/Dict/index.js
+++ b/src/routes/System/Dict/index.js
@@ -304,7 +304,8 @@
dataIndex: "type",
key: "type",
ellipsis:true,
- width: 150,
+ width: 180,
+ sorter: (a,b) => a.type > b.type ? 1 : -1,
},
{
align: "center",
@@ -312,7 +313,7 @@
dataIndex: "dictCode",
key: "dictCode",
ellipsis:true,
- width: 180,
+ width: 350,
},
{
align: "center",
@@ -320,7 +321,7 @@
dataIndex: "dictName",
key: "dictName",
ellipsis:true,
- width: 180,
+ width: 200,
},
{
align: "center",
@@ -328,7 +329,7 @@
dataIndex: "dictValue",
key: "dictValue",
ellipsis:true,
- width: 70,
+ width: 140,
},
{
align: "center",
@@ -336,7 +337,6 @@
dataIndex: "desc",
key: "desc",
ellipsis:true,
- width: 180,
},
{
align: "center",
@@ -344,6 +344,7 @@
dataIndex: "sort",
key: "sort",
ellipsis:true,
+ width: 80,
},
{
align: "center",
@@ -351,6 +352,7 @@
dataIndex: "enabled",
ellipsis:true,
key: "enabled",
+ width: 80,
render: text => {
if (text) {
return <div className="open">{getIntlContent("SOUL.COMMON.OPEN")}</div>;
@@ -365,6 +367,8 @@
ellipsis:true,
dataIndex: "operate",
key: "operate",
+ width: 80,
+ fixed: "right",
render: (text, record) => {
return (
<AuthButton perms="system:dict:edit">
@@ -477,6 +481,7 @@
rowKey={record => record.id}
loading={loading}
columns={columns}
+ scroll={{ x: 1350 }}
dataSource={soulDictList}
rowSelection={rowSelection}
pagination={{
diff --git a/src/routes/System/Metadata/index.js b/src/routes/System/Metadata/index.js
index e75610d..b06809b 100644
--- a/src/routes/System/Metadata/index.js
+++ b/src/routes/System/Metadata/index.js
@@ -269,6 +269,7 @@
dataIndex: "appName",
key: "appName",
ellipsis:true,
+ sorter: (a,b) => a.appName > b.appName ? 1 : -1,
},
{
align: "center",
@@ -292,6 +293,7 @@
dataIndex: "methodName",
key: "methodName",
ellipsis:true,
+ sorter: (a,b) => a.methodName > b.methodName ? 1 : -1,
},
{
align: "center",
@@ -300,6 +302,7 @@
key: "parameterTypes",
ellipsis:true,
width: 120,
+ sorter: (a,b) => a.parameterTypes > b.parameterTypes ? 1 : -1,
},
{
align: "center",
@@ -307,6 +310,7 @@
dataIndex: "rpcType",
key: "rpcType",
ellipsis:true,
+ sorter: (a,b) => a.rpcType > b.rpcType ? 1 : -1,
},
{
align: "center",
@@ -345,7 +349,8 @@
ellipsis:true,
dataIndex: "operate",
key: "operate",
- width: 60,
+ width: 80,
+ fixed: "right",
render: (text, record) => {
return (
<AuthButton perms="system:meta:edit">
@@ -455,6 +460,7 @@
rowKey={record => record.id}
loading={loading}
columns={columns}
+ scroll={{ x: 1350 }}
dataSource={userList}
rowSelection={rowSelection}
pagination={{
diff --git a/src/routes/System/Plugin/index.js b/src/routes/System/Plugin/index.js
index 753666a..c608b3b 100644
--- a/src/routes/System/Plugin/index.js
+++ b/src/routes/System/Plugin/index.js
@@ -299,7 +299,7 @@
dataIndex: "name",
key: "name",
ellipsis:true,
- width: 180,
+ width: 120,
},
{
align: "center",
@@ -307,6 +307,8 @@
dataIndex: "role",
ellipsis:true,
key: "role",
+ width: 120,
+ sorter: (a,b) => a.role > b.role ? 1 : -1,
render: (text) => {
const map = {
0: getIntlContent("SOUL.SYSTEM.SYSTEM"),
@@ -321,7 +323,6 @@
dataIndex: "config",
key: "config",
ellipsis:true,
- width: 180,
},
{
align: "center",
@@ -329,6 +330,8 @@
dataIndex: "dateCreated",
key: "dateCreated",
ellipsis:true,
+ width: 180,
+ sorter: (a,b) => a.dateCreated > b.dateCreated ? 1 : -1,
},
{
align: "center",
@@ -336,6 +339,8 @@
dataIndex: "dateUpdated",
key: "dateUpdated",
ellipsis:true,
+ width: 180,
+ sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
{
align: "center",
@@ -343,6 +348,8 @@
dataIndex: "enabled",
key: "enabled",
ellipsis:true,
+ width: 80,
+ sorter: (a,b) => (a.enabled || "-1") > (b.enabled || "-1") ? 1 : -1,
render: text => {
if (text) {
return <div className="open">{getIntlContent("SOUL.COMMON.OPEN")}</div>;
@@ -357,6 +364,8 @@
dataIndex: "time",
key: "time",
ellipsis:true,
+ width: 80,
+ fixed: "right",
render: (text, record) => {
return (
<AuthButton perms="system:plugin:edit">
@@ -465,6 +474,7 @@
bordered
loading={loading}
columns={columns}
+ scroll={{ x: 1350 }}
dataSource={pluginList}
rowSelection={rowSelection}
pagination={{
diff --git a/src/routes/System/PluginHandle/index.js b/src/routes/System/PluginHandle/index.js
index 20f4d75..ef53db7 100644
--- a/src/routes/System/PluginHandle/index.js
+++ b/src/routes/System/PluginHandle/index.js
@@ -291,6 +291,8 @@
dataIndex: "pluginId",
key: "pluginId",
ellipsis: true,
+ sorter: (a,b)=> a.pluginId - b.pluginId,
+ width: 120,
render: text => {
const {pluginHandle} = this.props;
const {pluginHandleList, pluginDropDownList} = pluginHandle;
@@ -326,7 +328,7 @@
dataIndex: "field",
key: "field",
ellipsis: true,
- width: 180,
+ width: 200,
},
{
align: "center",
@@ -334,7 +336,8 @@
dataIndex: "label",
key: "label",
ellipsis: true,
- width: 180,
+ width: 200,
+ sorter: (a,b) => a.label > b.label ? 1 : -1,
},
{
align: "center",
@@ -342,6 +345,7 @@
dataIndex: "dataType",
key: "dataType",
ellipsis: true,
+ width: 100,
render: text => {
if (text === 1) {
return <div>{getIntlContent("SOUL.PLUGIN.DIGITAL")}</div>;
@@ -359,6 +363,8 @@
dataIndex: "type",
key: "type",
ellipsis:true,
+ width: 120,
+ sorter: (a,b)=> a.type - b.type,
render: text => {
if (text === 1) {
return <div>{getIntlContent("SOUL.SELECTOR.NAME")}</div>;
@@ -375,6 +381,8 @@
dataIndex: "sort",
key: "sort",
ellipsis:true,
+ width: 80,
+ sorter: (a,b)=> a.sort - b.sort,
},
{
align: "center",
@@ -382,6 +390,8 @@
dataIndex: "required",
key: "required",
ellipsis:true,
+ width: 120,
+ sorter: (a,b) => (a.required || "-1") > (b.required || "-1") ? 1 : -1,
render: text => {
if (text === "1") {
return <div>{getIntlContent("SOUL.COMMON.YES")}</div>;
@@ -396,6 +406,7 @@
dataIndex: "defaultValue",
key: "defaultValue",
ellipsis: true,
+ width: 120,
},
{
align: "center",
@@ -403,6 +414,8 @@
dataIndex: "dateCreated",
key: "dateCreated",
ellipsis: true,
+ width: 180,
+ sorter: (a,b) => a.dateCreated > b.dateCreated ? 1 : -1,
},
{
align: "center",
@@ -410,14 +423,16 @@
dataIndex: "dateUpdated",
key: "dateUpdated",
ellipsis: true,
+ sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
-
{
align: "center",
title: getIntlContent("SOUL.COMMON.OPERAT"),
dataIndex: "time",
key: "time",
ellipsis: true,
+ fixed: 'right',
+ width: 100,
render: (text, record) => {
return (
<AuthButton perms="system:pluginHandler:edit">
@@ -518,6 +533,7 @@
bordered
loading={loading}
columns={tableColumns}
+ scroll={{ x: 1550 }}
dataSource={pluginHandleList}
rowSelection={rowSelection}
pagination={{
diff --git a/src/routes/System/Resource/index.js b/src/routes/System/Resource/index.js
index 3168308..f96bc9f 100644
--- a/src/routes/System/Resource/index.js
+++ b/src/routes/System/Resource/index.js
@@ -307,6 +307,7 @@
dataIndex: "title",
key: "title",
ellipsis:true,
+ width: 100,
render: text => {
return getIntlContent(text) || text;
}
@@ -316,6 +317,7 @@
title: getIntlContent("SOUL.SYSTEM.ICON"),
dataIndex: "icon",
key: "icon",
+ width: 60,
render: text => {
return <Icon type={text} /> || text;
}
@@ -325,7 +327,8 @@
title: getIntlContent("SOUL.SYSTEM.RESOURCE.PERMS"),
dataIndex: "perms",
key: "perms",
- ellipsis:true
+ ellipsis:true,
+ width: 140,
},
{
align: "center",
@@ -333,6 +336,8 @@
dataIndex: "dateCreated",
key: "dateCreated",
ellipsis:true,
+ width: 140,
+ sorter: (a,b) => a.dateCreated > b.dateCreated ? 1 : -1,
},
{
align: "center",
@@ -340,6 +345,8 @@
dataIndex: "dateUpdated",
key: "dateUpdated",
ellipsis:true,
+ width: 140,
+ sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
{
align: "center",
@@ -347,6 +354,7 @@
dataIndex: "operate",
key: "operate",
ellipsis:true,
+ width: 60,
render: (text, record) => {
return (
<AuthButton perms="system:resource:editButton">
diff --git a/src/routes/System/Role/index.js b/src/routes/System/Role/index.js
index 3826809..f6d005f 100644
--- a/src/routes/System/Role/index.js
+++ b/src/routes/System/Role/index.js
@@ -192,6 +192,7 @@
dataIndex: "dateCreated",
key: "dateCreated",
ellipsis:true,
+ sorter: (a,b) => a.dateCreated > b.dateCreated ? 1 : -1,
},
{
align: "center",
@@ -199,6 +200,7 @@
dataIndex: "dateUpdated",
key: "dateUpdated",
ellipsis:true,
+ sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
{
align: "center",
diff --git a/src/routes/System/User/index.js b/src/routes/System/User/index.js
index a644402..436700a 100644
--- a/src/routes/System/User/index.js
+++ b/src/routes/System/User/index.js
@@ -220,6 +220,7 @@
dataIndex: "dateCreated",
key: "dateCreated",
ellipsis:true,
+ sorter: (a,b) => a.dateCreated > b.dateCreated ? 1 : -1,
},
{
align: "center",
@@ -227,6 +228,7 @@
dataIndex: "dateUpdated",
key: "dateUpdated",
ellipsis:true,
+ sorter: (a,b) => a.dateUpdated > b.dateUpdated ? 1 : -1,
},
{
align: "center",