Commit b2a1997a by end

修改投票管理bug

parent 6cd02a57
File added
......@@ -70,7 +70,7 @@ class Item extends React.Component {
render() {
let { usable, data, defaultValue, reminds, index } = this.props;
//此判断没用到
if (reminds === [] || reminds === undefined) {
if (reminds.length === 0 || reminds === undefined) {
reminds === false;
}
console.log(data.timeType, "console.log(data.timeType);");
......@@ -269,7 +269,7 @@ class MessageRemind extends React.Component {
const { getFieldDecorator, getFieldValue } = this.props.form;
let labelAlignText = labelAlign ? labelAlign : "right";
let temparr = [];
if (reminds && reminds.length > 0) {
for (let i = 0; i < reminds.length; i++) {
......@@ -435,13 +435,13 @@ export default connect(
{
/*
使用实例
使用实例
参数*******说明
relationId : 回显的当前的id
relationId : 回显的当前的id
remind: 是否提醒
relationType:功能
wrappedComponentRef={(form) => this.messageRemind = form} 提交获取本组件的参数
<MessageRemind relationId={id} newsList={newsList} remind={details.remind} relationType={3} wrappedComponentRef={(form) => this.messageRemind = form}/>
<MessageRemind relationId={id} newsList={newsList} remind={details.remind} relationType={3} wrappedComponentRef={(form) => this.messageRemind = form}/>
*/
}
......@@ -770,6 +770,7 @@ class homePage extends Component {
componentDidMount() {
let _this = this;
this.props.getActionList();
this.props.queryExamNum();
this.getPhbRes();
this.getDllRes();
this.getLllRes();
......@@ -811,6 +812,7 @@ class homePage extends Component {
level2Menu,
tgrData,
tgrData1,
examList
} = this.props;
const loginChange = () => {
return dllData.num - dllData.preNum > 0 ? (
......@@ -1243,7 +1245,7 @@ class homePage extends Component {
<div>
<div className={styles.chartList}>
<p>年度测试总数及参加人数</p>
<div className={styles.chartBottom}>
<div className={styles.chartBottom} style={ {height: "360px"} }>
<ReactEcharts
style={{ height: "100%", width: "100%" }}
option={this.zlrChart1()}
......@@ -1253,9 +1255,9 @@ class homePage extends Component {
/>
</div>
</div>
<div className={styles.chartList}>
<div className={styles.chartList} >
<p>年度测试合格率</p>
<div className={styles.chartBottom}>
<div className={styles.chartBottom} style={ {height: "360px"} }>
<ReactEcharts
style={{ height: "100%", width: "100%" }}
option={this.zlrChart2()}
......@@ -1266,6 +1268,29 @@ class homePage extends Component {
</div>
</div>
</div>
<div>
<div className={styles.exambox}>
<div className={styles.zllNum1}>
<p>
{" "}
<span className={styles.red}></span>
<span>发起总数</span>
</p>
</div>
{examList &&
examList.length > 0 &&
examList.map((item, index) => (
<div className={styles.zllNum} key={index}>
<div>{item.deptName}</div>
{item?.eventTrackTypeNumVoList &&
item?.eventTrackTypeNumVoList.length > 0 &&
item?.eventTrackTypeNumVoList.map((element, index1) => (
<p key={index1}>{element.num}</p>
))}
</div>
))}
</div>
</div>
</div>
</div>
<div className={styles.row2}>
......
export const ACTION_LIST = "ACTION_LIST";
export const EXAM_LIST = "EXAM_LIST";
export const PHB_CHART = "PHB_CHART";
export const DLL_DATA = "DLL_DATA";
export const LLL_DATA = "LLL_DATA";
......
......@@ -14,6 +14,18 @@ export function getActionList() {
});
};
}
// 培训测试--按组织方统计“发起次数”列表
export function queryExamNum() {
const url = `${getUrl}/web-manage/manage/api/eventTrack/queryExamNum`;
return dispatch => {
return request({
url,
}).then(res => {
dispatch({ type: Types.EXAM_LIST, data: res.data });
});
};
}
export function getPhbChartList(data) {
const url = `${getUrl}/web-manage/manage/point/user/new/rank/list`;
return dispatch => {
......
......@@ -19,6 +19,10 @@ function homePage(state = initialState, action) {
return Object.assign({}, state, {
actionList: action.data,
});
case Types.EXAM_LIST:
return Object.assign({}, state, {
examList: action.data,
});
case Types.PHB_CHART:
return Object.assign({}, state, {
pbhChartList: action.data,
......
......@@ -424,42 +424,6 @@
.box1 .row1 {
display: flex;
justify-content: space-between;
height: 460px;
}
.box1 .row1 > div:nth-child(1) {
padding: 20px 15px;
width: 57.85%;
}
.box1 .row1 > div:nth-child(2) {
padding: 20px 15px;
width: 40.91%;
}
.box1 .row2 {
display: flex;
justify-content: space-between;
margin-top: 12px;
height: 460px;
}
.box1 .row2 > div:nth-child(1) {
padding: 20px 15px;
width: 25%;
}
.box1 .row2 > div:nth-child(2) {
width: 75%;
}
.box1 > div:nth-child(2) {
display: flex;
justify-content: space-between;
}
.box1 > div:nth-child(2) > .tgchart {
width: 45%;
}
.box1 > div:nth-child(2) > .lineData {
width: 53%;
}
.box1 .row1 {
display: flex;
justify-content: space-between;
height: 500px;
}
.box1 .row1 > div:nth-child(1) {
......@@ -740,6 +704,7 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(2) > .chartList {
width: 50%;
......@@ -758,11 +723,95 @@
margin-top: -10px;
margin-bottom: -30px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) {
display: flex;
align-items: center;
justify-content: space-between;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox {
margin-top: 12px;
display: flex;
align-items: center;
justify-content: space-between;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum1 {
width: 100px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum1 .red {
background: linear-gradient(270deg, #ba4048 0%, #e22020);
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum1 > div {
background: #f5f6f7;
height: 24px;
opacity: 0.7;
line-height: 24px;
color: #4a5154;
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 12px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum1 > p {
margin: 0;
height: 24px;
line-height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum1 > p > span:nth-child(1) {
height: 8px;
width: 8px;
border-radius: 50%;
display: block;
margin-right: 5px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum1 > p > p:nth-child(2) {
display: block;
font-size: 14px;
font-family: PingFang SC, PingFang SC-500;
font-weight: 500;
color: #4a5154;
text-align: center;
margin: 0;
height: 30px;
line-height: 30px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum {
width: 100px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum > div {
background: #f5f6f7;
height: 26px;
opacity: 0.7;
line-height: 26px;
color: #4a5154;
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 12px;
}
.box1 .row1 > div:nth-child(2) > div:nth-child(3) > .exambox > .zllNum > p {
margin: 0;
height: 24px;
line-height: 24px;
font-size: 14px;
font-family: PingFang SC, PingFang SC-500;
font-weight: 500;
color: #4a5154;
text-align: center;
}
.box1 .row2 {
display: flex;
justify-content: space-between;
margin-top: 12px;
height: 460px;
height: 500px;
}
.box1 .row2 > div:nth-child(1) {
padding: 20px 15px;
......
......@@ -443,50 +443,6 @@
line-height: 25px !important;
}
}
& .row1 {
display: flex;
justify-content: space-between;
height: 460px;
& > div:nth-child(1) {
padding: 20px 15px;
width: 57.85%; // 将固定700px改为百分比 (700/1210)
// ... existing code ...
}
& > div:nth-child(2) {
padding: 20px 15px;
width: 40.91%; // 将固定495px改为百分比 (495/1210)
// ... existing code ...
}
}
& .row2 {
display: flex;
justify-content: space-between;
margin-top: 12px;
height: 460px;
& > div:nth-child(1) {
padding: 20px 15px;
width: 25%; // 将固定240px改为百分比 (240/1210)
// ... existing code ...
}
& > div:nth-child(2) {
width: 75%; // 将固定955px改为百分比 (955/1210)
// ... existing code ...
}
}
& > div:nth-child(2) {
display: flex;
justify-content: space-between;
& > .tgchart {
width: 45%; // 将固定380px改为百分比 (380/845)
// ... existing code ...
}
& > .lineData {
width: 53%; // 将固定580px改为百分比 (580/845)
// ... existing code ...
}
}
width: 100%;
& .row1 {
display: flex;
......@@ -770,6 +726,7 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
& > .chartList {
width: 50%;
& > p {
......@@ -788,13 +745,98 @@
}
}
}
& > div:nth-child(3) {
display: flex;
align-items: center;
justify-content: space-between;
& > .exambox {
margin-top: 12px;
display: flex;
align-items: center;
justify-content: space-between;
& > .zllNum1 {
width: 100px;
& .red {
background: linear-gradient(270deg, #ba4048 0%, #e22020);
}
& > div {
background: #f5f6f7;
height: 24px;
opacity: 0.7;
line-height: 24px;
color: #4a5154;
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 12px;
}
& > p {
margin: 0;
height: 24px;
line-height: 24px;
display: flex;
align-items: center;
justify-content: center;
& > span:nth-child(1) {
height: 8px;
width: 8px;
border-radius: 50%;
display: block;
margin-right: 5px;
}
& > p:nth-child(2) {
display: block;
font-size: 14px;
font-family: PingFang SC, PingFang SC-500;
font-weight: 500;
color: #4a5154;
text-align: center;
margin: 0;
height: 30px;
line-height: 30px;
}
}
}
& > .zllNum {
width: 100px;
& > div {
background: #f5f6f7;
height: 26px;
opacity: 0.7;
line-height: 26px;
color: #4a5154;
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 12px;
}
& > p {
margin: 0;
height: 24px;
line-height: 24px;
font-size: 14px;
font-family: PingFang SC, PingFang SC-500;
font-weight: 500;
text-align: center;
color: #4a5154;
text-align: center;
}
}
}
}
}
}
& .row2 {
display: flex;
justify-content: space-between;
margin-top: 12px;
height: 460px;
height: 500px;
& > div:nth-child(1) {
padding: 20px 15px;
width: 18%;
......
import React, { Component } from "react";
import styles from "./index.less";
import {
Form,
Input,
Radio,
Row,
Col,
message,
} from "antd";
import { Form, Input, Radio, Row, Col, message } from "antd";
import UploadUtil from "../component/UploadUtil";
const { TextArea } = Input;
const FormItem = Form.Item;
......@@ -86,7 +79,7 @@ class TestModal extends Component {
this.setState({ keywords: tags.join() });
};
render() {
const { defaultValue } = this.props;
const { defaultValue, status } = this.props;
const { radioNum } = this.state;
const { getFieldDecorator, getFieldValue } = this.props.form;
const formItemLayout = {
......@@ -125,17 +118,29 @@ class TestModal extends Component {
message: "不能超过200个字符",
},
],
})(<TextArea rows={4} />)}
</FormItem>
<FormItem
{...formItemLayout}
style={{ marginLeft: 85, marginTop: -15 }}
>
{getFieldDecorator(
"contentAppendixUrl",
{}
)(<UploadUtil {...this.props.uploadProps} />)}
})(<TextArea rows={4} disabled={status === "look"} />)}
</FormItem>
{status === "look" && (
<div>
<img
src={defaultValue.contentAppendixUrl}
alt=""
style={{ width: "200px", height: "160px" }}
/>
</div>
)}
{status !== "look" && (
<FormItem
{...formItemLayout}
style={{ marginLeft: 85, marginTop: -15 }}
>
{getFieldDecorator(
"contentAppendixUrl",
{}
)(<UploadUtil {...this.props.uploadProps} />)}
</FormItem>
)}
<div className={styles.sur_test_option} id="dselect">
<RadioGroup style={{ width: "100%" }}>
{radioNum === 1 && (
......@@ -148,7 +153,7 @@ class TestModal extends Component {
</Row>
{keys1.map((item, k) => {
return (
<Row gutter={23}>
<Row gutter={23} key={item.no}>
<FormItem style={{ display: "none" }}>
{getFieldDecorator(`no[${item.no}]`, {
initialValue: item.no,
......@@ -169,7 +174,7 @@ class TestModal extends Component {
message: "不能超过200个字符",
},
],
})(<TextArea />)}
})(<TextArea disabled={status === "look"} />)}
</FormItem>
</Col>
</Row>
......
......@@ -239,12 +239,7 @@ class Details extends Component {
const param = {
type: values.type,
content: values.content,
//bug-9797-liyuan 附件回显
contentAppendixUrl: this.state.fileUrl
? this.state.fileUrl
: this.state.testItem.contentAppendixUrl
? this.state.testItem.contentAppendixUrl
: "",
contentAppendixUrl: this.state.fileUrl ? this.state.fileUrl : "",
needAnswer: values.needAnswer ? 1 : 0,
questionOptions: objs,
maxSelectItem: values.needAnswer2 ? values.maxSelectItem : "",
......@@ -308,6 +303,7 @@ class Details extends Component {
const { details, tlist, jumptests, surid } = this.props;
const uploadProps = {
uploadUtilName: "上传图片",
status: "look",
getUrl: (fileUrl, fileName) => {
this.setState({
fileUrl,
......@@ -445,6 +441,7 @@ class Details extends Component {
style={{ marginLeft: "170px" }}
relationId={this.id}
remind={details.remind}
usable={true}
relationType={3}
wrappedComponentRef={form => (this.messageRemind = form)}
/>
......@@ -453,6 +450,7 @@ class Details extends Component {
formItemLayout={formItemLayout}
style={{ marginLeft: "170px" }}
relationType={3}
usable={true}
wrappedComponentRef={form => (this.messageRemind = form)}
/>
)}
......@@ -565,6 +563,7 @@ class Details extends Component {
jumptests={jumptests}
ref={obj => (this.newTest = obj)}
uploadProps={uploadProps}
status={"look"}
/>
</Modal>
)}
......
......@@ -14,13 +14,15 @@ class UploadUtil extends Component {
uploadAction: {},
originalFileName: "",
fileList: [],
newFileList: [],
newFileList: "",
key: "",
processNum: 0, //进度条--liyuan
};
}
//修改一
componentDidMount() {}
componentDidMount() {
console.log(this.props.status, this.props.defaultUrl, "222222222222");
}
beforeUpload = (file, fileList) => {
// 文件大小判断 图片小于3M 文件小于200M
......@@ -59,7 +61,6 @@ class UploadUtil extends Component {
//上传
handleChange = info => {
let fileList = info.fileList;
// 限制只能上传一张图片:如果文件列表长度大于1,只保留最后一个文件
if (fileList.length > 1) {
fileList = [fileList[fileList.length - 1]];
}
......@@ -70,34 +71,18 @@ class UploadUtil extends Component {
if (info.file.status === "done") {
// 清空之前的文件列表,确保只保留一个文件
this.setState({ newFileList: [] });
this.setState({ newFileList: "" });
fileList.map(item => {
if (item.status === "done") {
// 检查 item.response.data 是否存在且不为 undefined
if (
item?.response?.data &&
this.state.newFileList.indexOf(item.response.data) === -1
) {
this.state.newFileList.push(item.response.data);
}
// 检查 item.url 是否存在且不为 undefined
if (item.url && this.state.newFileList.indexOf(item.url) === -1) {
this.state.newFileList.push(item.url);
}
this.state.newFileList = item.response.data;
}
});
message.success("上传成功");
} else if (info.file.status === "error") {
message.error("上传失败,请重新尝试");
}
if (this.props.getUrl) {
// 修改:返回字符串而不是数组,取第一个元素或空字符串
const urlString =
this.state.newFileList.length > 0 ? this.state.newFileList[0] : "";
this.props.getUrl(urlString);
}
this.props.getUrl(this.state.newFileList);
this.setState({ fileList });
};
......@@ -109,26 +94,7 @@ class UploadUtil extends Component {
};
fnRemove = e => {
if (this.props.defaultUrl) {
// 遍历 defaultUrl 数组,将每个对象的 url 合并到 newFileList 中,避免重复添加
this.props.defaultUrl.forEach(item => {
if (item.url && !this.state.newFileList.includes(item.url)) {
this.state.newFileList.push(item.url);
}
});
}
if (e.url) {
this.state.newFileList.splice(this.state.newFileList.indexOf(e.url), 1);
} else {
this.state.newFileList.splice(
this.state.newFileList.indexOf(e.response.data),
1
);
}
// 修改:返回字符串而不是数组
const urlString =
this.state.newFileList.length > 0 ? this.state.newFileList[0] : "";
this.props.getUrl(urlString);
this.props.getUrl("");
};
render() {
......@@ -136,9 +102,7 @@ class UploadUtil extends Component {
const { getFieldDecorator } = this.props.form;
return (
<Form>
<FormItem
extra={"请上传资源附件(附件格式:mp4、png、jpg、jpeg、gif)"}
>
<FormItem extra={"请上传资源附件(附件格式:png、jpg、jpeg、gif)"}>
{getFieldDecorator("upload", {
valuePropName: "fileList",
getValueFromEvent: this.normFile,
......@@ -160,15 +124,6 @@ class UploadUtil extends Component {
</Button>
</Upload>
)}
{this.state.processNum != 0 && this.state.processNum != 100 && (
<p>
<Progress
percent={this.state.processNum}
strokeWidth={5}
showInfo={false}
/>
</p>
)}
</FormItem>
</Form>
);
......
......@@ -163,13 +163,6 @@ class Survey extends Component {
message.error(data.subMsg);
console.log(key, "111111", searchValue, pageSize);
}
// console.log(key,"22222222",searchValue,pageSize)
// this.props.getlist({
// state:key,
// name:searchValue,
// pageNo:1,
// pageSize:pageSize
// })
});
}
......@@ -353,7 +346,7 @@ class Survey extends Component {
{action2}
</a>
</Popconfirm>
{key == 2 ? (
{key == 2 || key == 0 ? (
<div>
<Popconfirm
title="确定要删除吗?"
......@@ -381,13 +374,6 @@ class Survey extends Component {
>
投票明细导出
</div>
{/* <div
className={styles.survey_list_btn}
style={{ cursor: "pointer", color: "#1890FF" }}
onClick={() => this.detil(record.id, 2)}
>
投票分析导出
</div> */}
</div>
) : null}
</div>
......
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