Commit ad838d3a by chengming

增加上下移动投票

parent bdba67bb
...@@ -960,13 +960,13 @@ class homePage extends Component { ...@@ -960,13 +960,13 @@ class homePage extends Component {
<img src={img4} alt="" /> <img src={img4} alt="" />
行为分析 行为分析
</p> </p>
<Button {/* <Button
type="primary" type="primary"
onClick={this.handleDownload} onClick={this.handleDownload}
className={styles.downloadBtn} className={styles.downloadBtn}
> >
下载Excel 下载Excel
</Button> </Button> */}
</div> </div>
<div className={styles.box}> <div className={styles.box}>
{/* 顶部四个栏目 */} {/* 顶部四个栏目 */}
......
...@@ -33,6 +33,7 @@ import { ...@@ -33,6 +33,7 @@ import {
getSeeEdit, getSeeEdit,
postUpdata, postUpdata,
nullSeeEdit, nullSeeEdit,
readExport
} from "./redux/action"; } from "./redux/action";
import moment from "moment"; import moment from "moment";
import Styles from "./index.less"; import Styles from "./index.less";
...@@ -551,6 +552,10 @@ class Information extends React.Component { ...@@ -551,6 +552,10 @@ class Information extends React.Component {
} }
); );
}; };
readExportDown = (id) => {
const { readExport } = this.props;
readExport({ informationId: id });
};
//关闭评论管理 //关闭评论管理
hideComment = () => { hideComment = () => {
this.setState({ this.setState({
...@@ -1075,6 +1080,12 @@ class Information extends React.Component { ...@@ -1075,6 +1080,12 @@ class Information extends React.Component {
> >
评论管理 评论管理
</a> </a>
<a
className={Styles.marr10}
onClick={() => this.readExportDown(record.id, record.name)}
>
阅读明细导出
</a>
{record.state == "2" ? ( {record.state == "2" ? (
<div style={{ display: "inline" }}> <div style={{ display: "inline" }}>
<a <a
...@@ -1322,6 +1333,7 @@ function mapDispatchToProps(dispatch) { ...@@ -1322,6 +1333,7 @@ function mapDispatchToProps(dispatch) {
getSeeEdit: (obj, callback) => dispatch(getSeeEdit(obj, callback)), getSeeEdit: (obj, callback) => dispatch(getSeeEdit(obj, callback)),
postUpdata: (obj, callback) => dispatch(postUpdata(obj, callback)), postUpdata: (obj, callback) => dispatch(postUpdata(obj, callback)),
nullSeeEdit: (obj, callback) => dispatch(nullSeeEdit(obj, callback)), nullSeeEdit: (obj, callback) => dispatch(nullSeeEdit(obj, callback)),
readExport: (obj, callback) => dispatch(readExport(obj, callback)),
}; };
} }
......
...@@ -16,6 +16,7 @@ const { ...@@ -16,6 +16,7 @@ const {
getSeeEditApi, getSeeEditApi,
postUpdataApi, postUpdataApi,
getMenuApi, getMenuApi,
readExportApi
} = apis; } = apis;
//资讯管理 //资讯管理
...@@ -239,3 +240,15 @@ export function getMenu(data, callback) { ...@@ -239,3 +240,15 @@ export function getMenu(data, callback) {
}); });
}; };
} }
export function readExport(param) {
return dispatch => {
return request({
url: readExportApi,
data: param,
}).then(res => {
// message.success(res.data);
message.loading("数据导出中..", 5).then(() => window.open(res.data));
});
};
}
\ No newline at end of file
...@@ -13,6 +13,7 @@ export default { ...@@ -13,6 +13,7 @@ export default {
getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`, getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`,
postUpdataApi: `POST ${services.webManage}/site/classify/info/update`, postUpdataApi: `POST ${services.webManage}/site/classify/info/update`,
getMenuApi: `GET ${services.base}/system/dictionary/child/listByCode`, getMenuApi: `GET ${services.base}/system/dictionary/child/listByCode`,
readExportApi: `GET ${services.webManage}/site/classify/info/readExport`,
comment: { comment: {
getCommentsList: `GET ${services.webManage}/tpComment/list`, getCommentsList: `GET ${services.webManage}/tpComment/list`,
getRepCommentList: `GET ${services.webManage}/tpCommentReply/list`, getRepCommentList: `GET ${services.webManage}/tpCommentReply/list`,
......
...@@ -24,6 +24,7 @@ import { ...@@ -24,6 +24,7 @@ import {
insertTestFetch, insertTestFetch,
updateFetch, updateFetch,
getDelete, getDelete,
moveTestFetch,
} from "../redux/actions"; } from "../redux/actions";
// import Remind from '../../../../common/remind' // import Remind from '../../../../common/remind'
import TestModal from "../Create/TestModal"; import TestModal from "../Create/TestModal";
...@@ -164,11 +165,11 @@ class Details extends Component { ...@@ -164,11 +165,11 @@ class Details extends Component {
console.log("跳转", this.props); console.log("跳转", this.props);
this.props.history.push( this.props.history.push(
"/" + "/" +
companyCode + companyCode +
"/" + "/" +
siteCode + siteCode +
"/index/tool/survey/survey-management?tab=" + "/index/tool/survey/survey-management?tab=" +
(this.state.isupdata == 1 ? "2" : "1") (this.state.isupdata == 1 ? "2" : "1")
); );
} }
}); });
...@@ -195,6 +196,18 @@ class Details extends Component { ...@@ -195,6 +196,18 @@ class Details extends Component {
canEdit: false, canEdit: false,
}); });
} }
//上移下移 1下移 2上移
handleMove(record, type) {
let newNo = type == 2 ? record.no - 1 : record.no + 1;
const { surid } = this.props;
this.props.move(
{ questionId: record.id, no: newNo },
surid,
this.state.pageNo,
this.state.pageSize
);
}
handleOk() { handleOk() {
const { surid } = this.props; const { surid } = this.props;
const { editstate, editid } = this.state; const { editstate, editid } = this.state;
...@@ -222,7 +235,11 @@ class Details extends Component { ...@@ -222,7 +235,11 @@ class Details extends Component {
type: values.type, type: values.type,
content: values.content, content: values.content,
logoSrc: values.logoSrc, logoSrc: values.logoSrc,
contentAppendixUrl: this.state.fileUrl ? this.state.fileUrl : this.state.testItem.contentAppendixUrl ? this.state.testItem.contentAppendixUrl : "", contentAppendixUrl: this.state.fileUrl
? this.state.fileUrl
: this.state.testItem.contentAppendixUrl
? this.state.testItem.contentAppendixUrl
: "",
needAnswer: values.needAnswer ? 1 : 0, needAnswer: values.needAnswer ? 1 : 0,
questionOptions: objs, questionOptions: objs,
maxSelectItem: values.needAnswer2 ? values.maxSelectItem : "", maxSelectItem: values.needAnswer2 ? values.maxSelectItem : "",
...@@ -296,13 +313,13 @@ class Details extends Component { ...@@ -296,13 +313,13 @@ class Details extends Component {
}, },
defaultUrl: this.state.testItem.contentAppendixUrl defaultUrl: this.state.testItem.contentAppendixUrl
? [ ? [
{ {
uid: 1, uid: 1,
status: "done", status: "done",
url: this.state.testItem.contentAppendixUrl, url: this.state.testItem.contentAppendixUrl,
name: this.state.testItem.contentAppendixUrl.split("prefix=")[1], name: this.state.testItem.contentAppendixUrl.split("prefix=")[1],
}, },
] ]
: [], : [],
}; };
const formItemLayout = { const formItemLayout = {
...@@ -313,9 +330,9 @@ class Details extends Component { ...@@ -313,9 +330,9 @@ class Details extends Component {
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
dataIndex: "no", key: "index",
key: "no",
width: 150, width: 150,
render: (text, record, index) => index + 1,
}, },
{ {
title: "问题内容", title: "问题内容",
...@@ -337,16 +354,33 @@ class Details extends Component { ...@@ -337,16 +354,33 @@ class Details extends Component {
</div> </div>
), ),
}, },
// 在 d:\工作\虹桥智慧党建\sass-admin\src\pages\TrainingTools\Survey\Details\index.jsx 中修改操作栏配置
{ {
title: "操作", title: "操作",
dataIndex: "operation", dataIndex: "operation",
key: "operation", key: "operation",
width: 100, width: 200, // 增加宽度以容纳更多按钮
render: (text, record) => ( render: (text, record, index) => (
<div style={{ display: "inline" }}> <div style={{ display: "inline" }}>
{this.state.isupdata == 1 && ( {this.state.isupdata == 1 && (
<div> <div>
<a onClick={() => this.handleTestView(record)}>编辑</a> <a onClick={() => this.handleTestView(record)}>编辑</a>
{/* 添加上移按钮 */}
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 2)}
disabled={index === 0}
>
上移
</a>
{/* 添加下移按钮 */}
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 1)}
disabled={index === this.props.tlist.list.length - 1}
>
下移
</a>
<Popconfirm <Popconfirm
title="是否删除?" title="是否删除?"
onConfirm={() => this.onDelete(record.id)} onConfirm={() => this.onDelete(record.id)}
...@@ -428,25 +462,25 @@ class Details extends Component { ...@@ -428,25 +462,25 @@ class Details extends Component {
<Input defaultValue={details.point} disabled /> <Input defaultValue={details.point} disabled />
</FormItem> </FormItem>
{// 修改 {// 修改
details.remind ? ( details.remind ? (
<MessageRemind <MessageRemind
formItemLayout={formItemLayout} formItemLayout={formItemLayout}
style={{ marginLeft: "170px" }} style={{ marginLeft: "170px" }}
relationId={this.id} relationId={this.id}
remind={details.remind} remind={details.remind}
usable={true} usable={true}
relationType={3} relationType={3}
wrappedComponentRef={form => (this.messageRemind = form)} wrappedComponentRef={form => (this.messageRemind = form)}
/> />
) : ( ) : (
<MessageRemind <MessageRemind
formItemLayout={formItemLayout} formItemLayout={formItemLayout}
style={{ marginLeft: "170px" }} style={{ marginLeft: "170px" }}
relationType={3} relationType={3}
usable={true} usable={true}
wrappedComponentRef={form => (this.messageRemind = form)} wrappedComponentRef={form => (this.messageRemind = form)}
/> />
)} )}
<div <div
style={{ style={{
width: "96%", width: "96%",
...@@ -522,7 +556,7 @@ class Details extends Component { ...@@ -522,7 +556,7 @@ class Details extends Component {
<LinkUser <LinkUser
type={this.type == "2" ? "look" : ""} type={this.type == "2" ? "look" : ""}
invisible={false} invisible={false}
getData={() => { }} getData={() => {}}
initData={details.authorizes} initData={details.authorizes}
types={"research"} types={"research"}
groupTypes={"research"} groupTypes={"research"}
...@@ -588,6 +622,7 @@ function mapDispatchToProps(dispatch) { ...@@ -588,6 +622,7 @@ function mapDispatchToProps(dispatch) {
edit: (obj, id, no, size) => dispatch(editTestFetch(obj, id, no, size)), edit: (obj, id, no, size) => dispatch(editTestFetch(obj, id, no, size)),
insert: (obj, no, size) => dispatch(insertTestFetch(obj, no, size)), insert: (obj, no, size) => dispatch(insertTestFetch(obj, no, size)),
getDelete: (obj, callback) => dispatch(getDelete(obj, callback)), getDelete: (obj, callback) => dispatch(getDelete(obj, callback)),
move: (obj, callback) => dispatch(moveTestFetch(obj, callback)),
}; };
} }
......
...@@ -495,3 +495,25 @@ export function exana(param) { ...@@ -495,3 +495,25 @@ export function exana(param) {
// }) // })
}; };
} }
//移动问题
export function moveTestFetch(params, surid, no, size) {
console.log(surid);
let param = { ...params, researchId: surid };
let url = api.moveTestFetch;
return dispatch => {
return request({
url: url,
data: param,
}).then(res => {
if (res.code === "1000") {
dispatch({ type: Types.EDIT_TEST, data: res.data });
dispatch(
getTestListFetch({ researchId: surid, pageNo: no, pageSize: size })
);
message.success("操作成功");
} else {
message.success("操作失败");
}
});
};
}
\ No newline at end of file
...@@ -40,4 +40,6 @@ export default { ...@@ -40,4 +40,6 @@ export default {
jump_ques: `POST ${services.webManage}/researchQuestion/jump/question/update`, jump_ques: `POST ${services.webManage}/researchQuestion/jump/question/update`,
chooses: `GET ${services.webManage}/researchQuestion/option/get`, chooses: `GET ${services.webManage}/researchQuestion/option/get`,
moveTestFetch: `POST ${services.webManage}/researchQuestion/batch/updateNo`,
}; };
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