Skip to content

Commit ffb68c7

Browse files
committed
微调修正
1 parent f6f9bd5 commit ffb68c7

File tree

10 files changed

+104
-63
lines changed

10 files changed

+104
-63
lines changed

api/animesSearch.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ module.exports = async function (req, res, next) {
5252
case '3':
5353
sortData = { "score": 1 }
5454
break;
55-
case '4':
56-
sortData = { "progress": -1 }
57-
break;
58-
case '5':
59-
sortData = { "progress": 1 }
60-
break;
6155
}
6256

6357
// 查询数据

api/gamesCreateOrEdit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ module.exports = async function (req, res, next) {
122122
/*-----------------以上为共通----------------*/
123123
platform: platform,
124124
gameCompany: gameCompany,
125-
progress: progress,
125+
progress: isLongGame ? 0 : progress,
126126
isLongGame: isLongGame,
127127
}
128128
let saveData = null;

api/tagSearch.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const _ = require('lodash');
88
module.exports = async function (req, res, next) {
99
// 数据读取
1010
const name = req.body.name ? String(req.body.name) : '';
11+
const isAll = req.body.isAll ? true : false;
1112
const page = Number(req.body.page || 1);
1213
if (!_.isInteger(page) || page < 1) {
1314
res.send({
@@ -24,7 +25,13 @@ module.exports = async function (req, res, next) {
2425
const reg = new RegExp(name, 'i');
2526
params["name"] = { $regex: reg };
2627
}
27-
const tagsData = await tagsUtils.findInPage(params, 20, page);
28+
const tagsData = {};
29+
if (isAll) {
30+
const tagsData_ = await tagsUtils.findMany(params);
31+
tagsData["data"] = tagsData_;
32+
} else {
33+
tagsData = await tagsUtils.findInPage(params, 20, page);
34+
}
2835
res.send({
2936
code: 1,
3037
tags: tagsData,

client/src/assets/css/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,10 @@ body::-webkit-scrollbar-thumb:hover {
378378
}
379379
.acgnlist_option_button{
380380
margin: 3px 0;
381+
}
382+
.acgnlist_tag_max80{
383+
max-width: 80px;
384+
white-space: nowrap;
385+
overflow: hidden;
386+
text-overflow: ellipsis;
381387
}

client/src/components/adminPageCompent.js

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Button, Table, Switch, Modal, Form, Tag, Slider, Input, Image, message, Pagination, Select, InputNumber, Radio, Checkbox } from 'antd';
2+
import { Button, Table, Switch, Modal, Form, Tag, Slider, Input, Image, message, Pagination, Select, InputNumber, Radio, Checkbox, Tooltip } from 'antd';
33
import { FilterFilled, ExclamationCircleOutlined } from '@ant-design/icons';
44
import ReactMarkdown from 'react-markdown/with-html';
55
import BaseFormItem from './baseFormItem'
@@ -13,16 +13,6 @@ const _ = require('lodash');
1313
const { Option } = Select;
1414
const { confirm } = Modal;
1515

16-
const sortOption = (
17-
<>
18-
<Option value="0">创建时间从新到旧</Option>
19-
<Option value="1">创建时间从旧到新</Option>
20-
<Option value="2">评分从高到低</Option>
21-
<Option value="3">评分从低到高</Option>
22-
<Option value="4">进度从高到低</Option>
23-
<Option value="5">进度从低到高</Option>
24-
</>
25-
);
2616
class adminPageCompent extends Component {
2717
constructor(props) {
2818
super(props);
@@ -87,9 +77,9 @@ class adminPageCompent extends Component {
8777
<>
8878
{original.map(original => {
8979
return (
90-
<Tag key={original}>
80+
<Tooltip title={original}><Tag key={original} className="acgnlist_tag_max80">
9181
{original}
92-
</Tag>
82+
</Tag></Tooltip>
9383
);
9484
})}
9585
</>
@@ -102,9 +92,9 @@ class adminPageCompent extends Component {
10292
<>
10393
{author.map(author => {
10494
return (
105-
<Tag key={author}>
95+
<Tooltip title={author}><Tag key={author} className="acgnlist_tag_max80">
10696
{author}
107-
</Tag>
97+
</Tag></Tooltip>
10898
);
10999
})}
110100
</>
@@ -134,9 +124,9 @@ class adminPageCompent extends Component {
134124
<>
135125
{original.map(original => {
136126
return (
137-
<Tag key={original}>
127+
<Tooltip title={original}><Tag key={original} className="acgnlist_tag_max80">
138128
{original}
139-
</Tag>
129+
</Tag></Tooltip>
140130
);
141131
})}
142132
</>
@@ -149,9 +139,9 @@ class adminPageCompent extends Component {
149139
<>
150140
{directed.map(directed => {
151141
return (
152-
<Tag key={directed}>
142+
<Tooltip title={directed}><Tag key={directed} className="acgnlist_tag_max80">
153143
{directed}
154-
</Tag>
144+
</Tag></Tooltip>
155145
);
156146
})}
157147
</>
@@ -253,18 +243,21 @@ class adminPageCompent extends Component {
253243
},
254244
{
255245
title: '录入时间',
246+
width: 214,
256247
dataIndex: 'creatDate',
257-
render: creatDate => <div>{moment(creatDate).format('YYYY-MM-DD h:mm:ss')}</div>
248+
render: creatDate => <div>{moment(creatDate).format('YYYY年MM月DD日 HH:mm:ss')}</div>
258249
},
259250
{
260251
title: '开始时间',
252+
width: 214,
261253
dataIndex: 'startDate',
262-
render: startDate => <div>{startDate && moment(startDate).format('YYYY-MM-DD h:mm:ss')}</div>
254+
render: startDate => <div>{startDate && moment(startDate).format('YYYY年MM月DD日 HH:mm:ss')}</div>
263255
},
264256
{
265257
title: '结束时间',
258+
width: 214,
266259
dataIndex: 'endDate',
267-
render: endDate => <div>{endDate && moment(endDate).format('YYYY-MM-DD h:mm:ss')}</div>
260+
render: endDate => <div>{endDate && moment(endDate).format('YYYY年MM月DD日 HH:mm:ss')}</div>
268261
},
269262
{
270263
title: '显示',
@@ -596,7 +589,9 @@ class adminPageCompent extends Component {
596589
});
597590
}
598591
filterChange = (params) => {
599-
this.setState(params, () => {
592+
const stateData = { ...params };
593+
stateData["page"] = 1;
594+
this.setState(stateData, () => {
600595
this.searchDataList();
601596
});
602597
}
@@ -612,6 +607,31 @@ class adminPageCompent extends Component {
612607
});
613608
}
614609
render () {
610+
const sortOption = () => {
611+
switch (this.props.type) {
612+
case "novel":
613+
case "comic":
614+
case "game":
615+
return <>
616+
<Option value="0">创建时间从新到旧</Option>
617+
<Option value="1">创建时间从旧到新</Option>
618+
<Option value="2">评分从高到低</Option>
619+
<Option value="3">评分从低到高</Option>
620+
<Option value="4">进度从高到低</Option>
621+
<Option value="5">进度从低到高</Option>
622+
</>
623+
case "anime":
624+
return <>
625+
<Option value="0">创建时间从新到旧</Option>
626+
<Option value="1">创建时间从旧到新</Option>
627+
<Option value="2">评分从高到低</Option>
628+
<Option value="3">评分从低到高</Option>
629+
</>
630+
default:
631+
break;
632+
}
633+
634+
};
615635
const otherForm = () => {
616636
let form = <></>;
617637
switch (this.props.type) {
@@ -694,17 +714,17 @@ class adminPageCompent extends Component {
694714
</div>
695715
<div style={{ "display": this.state.filterOpen ? 'block' : 'none' }} className="mt10">
696716

697-
<Filter sortOption={sortOption} showShowSelect={true} showStatusSelect={true} showMode={this.state.showMode} keyword={this.state.keyword} sort={this.state.sort} status={this.state.status} onSearch={(params) => this.filterChange(params)} onClear={(params) => this.filterChange(params)} />
717+
<Filter sortOption={sortOption()} showShowSelect={true} showStatusSelect={true} showMode={this.state.showMode} keyword={this.state.keyword} sort={this.state.sort} status={this.state.status} onSearch={(params) => this.filterChange(params)} onClear={(params) => this.filterChange(params)} />
698718
</div>
699719
<div className="mt10">
700720
<Table rowKey="_id"
701721
bordered
702722
columns={this.state.columns}
703-
dataSource={this.state.data} scroll={{ x: 2000 }} sticky
723+
dataSource={this.state.data} scroll={{ x: 2500 }} sticky
704724
pagination={false}
705725
/>
706726
<div className="tr mt10">
707-
<Pagination current={this.state.page}
727+
<Pagination current={this.state.page} showSizeChanger={false}
708728
total={this.state.total}
709729
onChange={this.pageChange}
710730
pageSize={20} />

client/src/components/baseDetailItem.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class baseDetailItem extends Component {
123123
<div className="acgnlist_detail_label">添加时间:</div>
124124
</Col>
125125
<Col lg={20} md={20} sm={20} xs={24}>
126-
<div>{moment(this.props.detailData.creatDate).format("YYYY年MM月DD日 HH时MM分SS秒")}</div>
126+
<div>{moment(this.props.detailData.creatDate).format("YYYY年MM月DD日 HH时mm分ss秒")}</div>
127127
</Col>
128128
</Row>
129129
<Divider />
@@ -133,7 +133,7 @@ class baseDetailItem extends Component {
133133
<div className="acgnlist_detail_label">开始时间:</div>
134134
</Col>
135135
<Col lg={20} md={20} sm={20} xs={24}>
136-
<div>{moment(this.props.detailData.startDate).format("YYYY年MM月DD日 HH时MM分SS秒")}</div>
136+
<div>{moment(this.props.detailData.startDate).format("YYYY年MM月DD日 HH时mm分ss秒")}</div>
137137
</Col>
138138
</Row>
139139
<Divider />
@@ -144,7 +144,7 @@ class baseDetailItem extends Component {
144144
<div className="acgnlist_detail_label">结束时间:</div>
145145
</Col>
146146
<Col lg={20} md={20} sm={20} xs={24}>
147-
<div>{moment(this.props.detailData.endDate).format("YYYY年MM月DD日 HH时MM分SS秒")}</div>
147+
<div>{moment(this.props.detailData.endDate).format("YYYY年MM月DD日 HH时mm分ss秒")}</div>
148148
</Col>
149149
</Row>
150150
<Divider />

0 commit comments

Comments
 (0)