Commit c34dccef by chenshu

fix:修改样式

parent 02af41ef
......@@ -18,7 +18,7 @@ import ScanFileModal from "../../resource-disk/modal/ScanFileModal";
import WatchData from "./WatchData";
import KnowledgeAPI from "@/data-source/knowledge/request-api";
import ENUM from "../ENUM.js";
import * as studentData from '../../lottie/student/data.json';
import * as nodata from '../../lottie/nodata/data.json';
import "./KnowledgeBaseList.less";
const DEFAULT_SIZE_UNIT = 1000 * 1000; // 将B转换成M
......@@ -566,7 +566,7 @@ class KnowledgeBaseList extends React.Component {
const defaultOptions = {
loop: true,
autoplay: true,
animationData: studentData,
animationData: nodata,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
......
......@@ -11,7 +11,7 @@
justify-content: space-between;
.tip{
font-size:14px;
color:#FF9D14;
color:#2966FF;
margin-right:8px;
}
.text{
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -44,7 +44,7 @@
white-space: nowrap;
}
.ant-tree-node-content-wrapper.ant-tree-node-selected {
color: #666666;
color: #2966FF;
}
}
.ant-tree-treenode-selected:hover::before,
......
import React, { useState, useRef, useEffect, useContext } from 'react'
import { Input, Select, DatePicker, Tooltip, Button, Table, Dropdown, Menu, Modal } from 'antd';
import Lottie from 'react-lottie';
import TeacherSelect from '@/modules/common/TeacherSelect';
import { Route, withRouter } from 'react-router-dom';
import Service from "@/common/js/service";
import moment from 'moment';
import { PageControl } from "@/components";
import { PageControl, XMTable } from "@/components";
import AddExam from './AddExam';
import User from "@/common/js/user";
import { XMContext } from "@/store/context";
import ExamShareModal from './ExamShareModal'
import DataAnalysic from './DataAnalysic'
import PreviewModal from './PreviewModal'
import * as nodata from '../../lottie/nodata/data.json';
import './index.less'
const { RangePicker } = DatePicker;
const { Search } = Input;
......@@ -307,6 +309,14 @@ function ExaminationManager(props: any) {
setQuery(_query)
}
const defaultOptions = {
loop: true,
autoplay: true,
animationData: nodata,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}
return <div className="page examination-manager">
<div className="content-header">考试</div>
<div className="box content-body">
......@@ -401,7 +411,7 @@ function ExaminationManager(props: any) {
<div className="content">
<Table
<XMTable
bordered
size="small"
columns={columns}
......@@ -410,8 +420,20 @@ function ExaminationManager(props: any) {
onChange={onChange}
pagination={false}
style={{ margin: '0px 0 16px' }}
renderEmpty={{
image: <div style={{ marginTop: 24 }}>
<Lottie
options={defaultOptions}
height={150}
width={150}
isStopped={false}
isPaused={false}
/>
</div>,
description: <span style={{ display: 'block', paddingBottom: 24 }}>暂无数据</span>
}}
>
</Table>
</XMTable>
{total > 0 &&
<PageControl
size="small"
......
......@@ -20,7 +20,9 @@ import {
Modal,
Spin,
} from "antd";
import Lottie from 'react-lottie';
import { PlusOutlined } from "@ant-design/icons";
import { XMTable } from "@/components";
import ShowTips from "@/components/ShowTips";
import Breadcrumbs from "@/components/Breadcrumbs";
import "./OperatePaper.less";
......@@ -30,6 +32,7 @@ import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import Bus from "@/core/bus";
import { Route, withRouter } from "react-router-dom";
import * as paperEmpty from '../../lottie/paperEmpty/data.json';
import AddExam from "@/modules/teach-tool/examination-manager/AddExam";
const questionTypeEnum = {
......@@ -148,19 +151,6 @@ class OperatePaper extends Component {
);
};
// 自定义表格空状态
customizeRenderEmpty = () => {
return (
<Empty
image="https://image.xiaomaiketang.com/xm/emptyTable.png"
imageStyle={{
height: 100,
}}
description={"请在左上角添加题目"}
></Empty>
);
};
setFormData = (list, sorter) => {
const { formData } = this.state;
const _selectQuestionList = [...list];
......@@ -718,6 +708,14 @@ class OperatePaper extends Component {
totalScore,
} = formData;
const { match } = this.props;
const defaultOptions = {
loop: true,
autoplay: true,
animationData: paperEmpty,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}
return (
<div>
<div className="page operate-paper-page">
......@@ -819,16 +817,26 @@ class OperatePaper extends Component {
</div>
)}
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table
className="table-style"
scroll={{ y: 350 }}
columns={this.parseColumns()}
dataSource={selectQuestionList}
pagination={false}
onChange={this.sortByQuestionType}
/>
</ConfigProvider>
<XMTable
className="table-style"
scroll={{ y: 350 }}
columns={this.parseColumns()}
dataSource={selectQuestionList}
pagination={false}
onChange={this.sortByQuestionType}
renderEmpty={{
image: <div style={{ marginTop: 24 }}>
<Lottie
options={defaultOptions}
height={150}
width={150}
isStopped={false}
isPaused={false}
/>
</div>,
description: <span style={{ display: 'block', paddingBottom: 24 }}>请在左上角添加题目</span>
}}
/>
</Form>
</div>
<div className="footer">
......
.operate-paper-page {
.box {
margin-bottom: 66px !important;
margin-bottom: 52px !important;
.ant-form-item {
margin-bottom: 24px !important;
}
.table-style {
border: 1px solid #f0f0f0 !important;
}
......@@ -12,7 +15,6 @@
margin-left: 12px;
}
.choose-btn {
margin-top: 8px;
margin-bottom: 12px;
}
.paper-info-tip {
......@@ -58,6 +60,25 @@
margin-left: 10px;
}
}
.ant-table tbody tr {
&:nth-child(even) {
background: #fff;
}
&:nth-child(odd) {
background: #fafafa;
}
&:last-child {
td {
border-bottom: none!important;
}
}
}
.ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]) {
&::before {
width: 0!important;
}
}
}
.aid-tool-list {
......
......@@ -8,7 +8,6 @@
*/
import React, { Component } from "react";
import {
Table,
Dropdown,
Row,
Input,
......@@ -20,7 +19,8 @@ import {
ConfigProvider,
Empty,
} from "antd";
import { PageControl } from "@/components";
import Lottie from 'react-lottie';
import { PageControl, XMTable } from "@/components";
import "./PaperList.less";
import { Route, withRouter } from "react-router-dom";
import OperatePaper from "@/modules/teach-tool/paper-manage/OperatePaper";
......@@ -31,6 +31,7 @@ import Service from "@/common/js/service";
import _ from "underscore";
import PaperPreviewModal from "../modal/PreviewPaperModal";
import MoveModal from '../../modal/MoveModal';
import * as nodata from '../../../lottie/nodata/data.json';
import Bus from "@/core/bus";
const { Search } = Input;
......@@ -249,19 +250,6 @@ class PaperList extends Component {
}
};
// 自定义表格空状态
customizeRenderEmpty = () => {
return (
<Empty
image="https://image.xiaomaiketang.com/xm/emptyTable.png"
imageStyle={{
height: 100,
}}
description={"还没有试卷"}
></Empty>
);
};
// 表头设置
parseColumns = () => {
const columns = [
......@@ -305,7 +293,7 @@ class PaperList extends Component {
},
},
{
title: "试卷数量",
title: "题目数量",
key: "questionCnt",
dataIndex: "questionCnt",
width: this.props.type !== "modal-select" ? "12%" : "20%",
......@@ -559,6 +547,14 @@ class PaperList extends Component {
User.getUserRole()
);
const { match } = this.props;
const defaultOptions = {
loop: true,
autoplay: true,
animationData: nodata,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}
return (
<div className={"paper-list " + this.props.type}>
<div className="paper-list-filter">
......@@ -629,32 +625,54 @@ class PaperList extends Component {
)}
<div className="paper-list-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
{this.props.type !== "modal-select" ? (
<Table
rowKey={(record) => record.paperId}
rowSelection={paperRowSelection}
dataSource={dataSource}
columns={this.parseColumns()}
pagination={false}
bordered
loading={loading}
/>
) : (
<Table
rowKey={(record) => record.paperId}
dataSource={dataSource}
size={this.props.type == "modal-select" ? "small" : "middle"}
rowKey={(item) => {
return item.paperId;
}}
rowSelection={rowSelection}
columns={this.parseColumns()}
pagination={false}
bordered
/>
)}
</ConfigProvider>
{this.props.type !== "modal-select" ? (
<XMTable
rowKey={(record) => record.paperId}
rowSelection={paperRowSelection}
dataSource={dataSource}
columns={this.parseColumns()}
pagination={false}
bordered
loading={loading}
renderEmpty={{
image: <div style={{ marginTop: 24 }}>
<Lottie
options={defaultOptions}
height={150}
width={150}
isStopped={false}
isPaused={false}
/>
</div>,
description: <span style={{ display: 'block', paddingBottom: 24 }}>还没有试卷</span>
}}
/>
) : (
<XMTable
rowKey={(record) => record.paperId}
dataSource={dataSource}
size={this.props.type == "modal-select" ? "small" : "middle"}
rowKey={(item) => {
return item.paperId;
}}
rowSelection={rowSelection}
columns={this.parseColumns()}
pagination={false}
bordered
renderEmpty={{
image: <div style={{ marginTop: 24 }}>
<Lottie
options={defaultOptions}
height={150}
width={150}
isStopped={false}
isPaused={false}
/>
</div>,
description: <span style={{ display: 'block', paddingBottom: 24 }}>暂无数据</span>
}}
/>
)}
{total > 0 && (
<div className="box-footer">
......
......@@ -13,7 +13,7 @@
justify-content: space-between;
.tip{
font-size:14px;
color:#FF9D14;
color:#2966FF;
margin-right:8px;
}
.text{
......@@ -74,7 +74,7 @@
}
.paper-list-content {
position: relative;
margin-top: 16px;
margin-top: 12px;
.empty-list-tip {
color: #ffb714;
cursor: pointer;
......
......@@ -23,10 +23,11 @@ import {
Dropdown,
DatePicker,
} from "antd";
import Lottie from 'react-lottie';
import _ from "underscore";
import { Route, withRouter } from "react-router-dom";
import { DownOutlined } from '@ant-design/icons';
import { PageControl } from "@/components";
import { PageControl, XMTable } from "@/components";
import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import PreviewQuestionModal from "../modal/PreviewQuestionModal";
......@@ -36,6 +37,7 @@ import Bus from "@/core/bus";
import moment from 'moment';
import Service from "@/common/js/service";
import MoveModal from '../../modal/MoveModal';
import * as nodata from '../../../lottie/nodata/data.json';
import "./QuestionList.less";
const { RangePicker } = DatePicker;
......@@ -193,39 +195,6 @@ class QuestionList extends Component {
});
};
// 自定义表格空状态
customizeRenderEmpty = () => {
const { categoryId } = this.state.query;
return (
<Empty
image="https://image.xiaomaiketang.com/xm/emptyTable.png"
imageStyle={{
height: 100,
}}
description={
<span>
<span>还没有题目</span>
{["CloudManager", "StoreManager"].includes(User.getUserRole()) &&
categoryId && (
<span>
,快去
<span
className="empty-list-tip"
onClick={() => {
this.handleCreateQuestion();
}}
>
新建一个
</span>
吧!
</span>
)}
</span>
}
></Empty>
);
};
// 排序
handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter;
......@@ -625,6 +594,14 @@ class QuestionList extends Component {
preserveSelectedRowKeys: true,
onChange: this.onSelectChange,
};
const defaultOptions = {
loop: true,
autoplay: true,
animationData: nodata,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}
return (
<div className="question-list">
<div className="question-list-filter">
......@@ -711,7 +688,7 @@ class QuestionList extends Component {
</div>
{["CloudManager", "StoreManager"].includes(User.getUserRole()) &&
(
<Space size={16}>
<Space size={8}>
{_.isEmpty(selectedRowKeys) ?
(!!categoryId && [
<Button key="1" type="primary" onClick={this.handleCreateQuestion}>
......@@ -732,14 +709,14 @@ class QuestionList extends Component {
</div>
}
{!!categoryId ? (
<Dropdown className="ml8" overlay={this.setMoreOperationOption()}>
<Dropdown overlay={this.setMoreOperationOption()}>
<Button id="more_operate">
更多操作
<DownOutlined />
</Button>
</Dropdown>
) : (
<Space size={16}>
<Space size={8}>
<Button onClick={() => this.batchMove()}>批量移动</Button>
<Button onClick={() => this.batchDelete()}>批量删除</Button>
</Space>
......@@ -747,17 +724,43 @@ class QuestionList extends Component {
</Space>
)}
<div className="question-list-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table
rowKey={(record) => record.id}
dataSource={dataSource}
columns={this.parseColumns()}
pagination={false}
bordered
onChange={this.handleChangeTable}
rowSelection={rowSelection}
/>
</ConfigProvider>
<XMTable
rowKey={(record) => record.id}
dataSource={dataSource}
columns={this.parseColumns()}
pagination={false}
bordered
onChange={this.handleChangeTable}
rowSelection={rowSelection}
renderEmpty={{
image: <div style={{ marginTop: 24 }}>
<Lottie
options={defaultOptions}
height={150}
width={150}
isStopped={false}
isPaused={false}
/>
</div>,
description: <span style={{ display: 'block', paddingBottom: 24 }}><span>还没有题目</span>
{["CloudManager", "StoreManager"].includes(User.getUserRole()) &&
categoryId && (
<span>
,快去
<span
className="empty-list-tip"
onClick={() => {
this.handleCreateQuestion();
}}
>
新建一个
</span>
吧!
</span>
)}
</span>
}}
/>
{total > 0 && (
<div className="box-footer">
<PageControl
......
......@@ -51,7 +51,7 @@
justify-content: space-between;
.tip {
font-size: 14px;
color: #FF9D14;
color: #2966FF;
margin-right: 8px;
}
.text {
......@@ -70,7 +70,7 @@
}
.question-list-content {
position: relative;
margin-top: 16px;
margin-top: 12px;
.empty-list-tip {
color: #ffb714;
cursor: pointer;
......
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