Commit d7dc48cd by chengming

修改bug

parent 8d1d5e16
...@@ -101,10 +101,10 @@ class addEdit extends React.Component { ...@@ -101,10 +101,10 @@ class addEdit extends React.Component {
fileUrl: item.fileUrl fileUrl: item.fileUrl
? item.fileUrl ? item.fileUrl
: this.state.hostAndDir + : this.state.hostAndDir +
"/" + "/" +
item.uid + item.uid +
"." + "." +
item.name.substr(item.name.length - 3), item.name.substr(item.name.length - 3),
size: item.size + "", size: item.size + "",
suffix: "." + item.name.split(".")[1], suffix: "." + item.name.split(".")[1],
}; };
...@@ -129,10 +129,10 @@ class addEdit extends React.Component { ...@@ -129,10 +129,10 @@ class addEdit extends React.Component {
fileUrl: item.fileUrl fileUrl: item.fileUrl
? item.fileUrl ? item.fileUrl
: this.state.hostAndDir + : this.state.hostAndDir +
"/" + "/" +
item.uid + item.uid +
"." + "." +
item.name.substr(item.name.length - 3), item.name.substr(item.name.length - 3),
size: item.size + "", size: item.size + "",
suffix: "." + item.name.split(".")[1], suffix: "." + item.name.split(".")[1],
}; };
...@@ -146,7 +146,7 @@ class addEdit extends React.Component { ...@@ -146,7 +146,7 @@ class addEdit extends React.Component {
} }
return e && this.state.fileLists; return e && this.state.fileLists;
}; };
getImgUrl(imageUrl) { getImgUrl(imageUrl) {
let _this = this; let _this = this;
this.setState( this.setState(
{ {
...@@ -312,8 +312,9 @@ class addEdit extends React.Component { ...@@ -312,8 +312,9 @@ class addEdit extends React.Component {
{getFieldDecorator("content", { {getFieldDecorator("content", {
initialValue: seeEdit && seeEdit.content, initialValue: seeEdit && seeEdit.content,
})( })(
<Input <Input.TextArea
style={{ minHeight: "40px" }} rows={4}
style={{ width: "100%", minHeight: "40px", }}
disabled={type != "edit" ? true : false} disabled={type != "edit" ? true : false}
/> />
)} )}
......
...@@ -18,8 +18,6 @@ class Header extends React.Component { ...@@ -18,8 +18,6 @@ class Header extends React.Component {
render() { render() {
const { getFieldDecorator, resetFields } = this.props.form; const { getFieldDecorator, resetFields } = this.props.form;
const List = [ const List = [
{ value: 0, text: "删除" },
{ value: 1, text: "草稿" },
{ value: 2, text: "待审核" }, { value: 2, text: "待审核" },
{ value: 3, text: "待发布" }, { value: 3, text: "待发布" },
{ value: 4, text: "已发布" }, { value: 4, text: "已发布" },
......
...@@ -369,9 +369,9 @@ class EditBanner extends Component { ...@@ -369,9 +369,9 @@ class EditBanner extends Component {
required: false, required: false,
message: "请输入图片来源", message: "请输入图片来源",
}, },
{ max: 10, message: "图片来源最多10个字符!" }, { max: 30, message: "图片来源最多30个字符!" },
], ],
})(<Input maxLength={10} disabled={editType == "look"} />)} })(<Input maxLength={30} disabled={editType == "look"} />)}
</FormItem> </FormItem>
{moduleType.id === 4 && ( {moduleType.id === 4 && (
<FormItem label="链接地址:" {...formItemLayout}> <FormItem label="链接地址:" {...formItemLayout}>
......
...@@ -409,7 +409,7 @@ class addEdit extends React.Component { ...@@ -409,7 +409,7 @@ class addEdit extends React.Component {
], ],
})(<Input disabled={type == "look" ? !false : false} />)} })(<Input disabled={type == "look" ? !false : false} />)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="文章副标题"> {/* <FormItem {...formItemLayout} label="文章副标题">
{getFieldDecorator("titleSub", { {getFieldDecorator("titleSub", {
initialValue: seeEdit && seeEdit.titleSub, initialValue: seeEdit && seeEdit.titleSub,
rules: [ rules: [
...@@ -421,7 +421,7 @@ class addEdit extends React.Component { ...@@ -421,7 +421,7 @@ class addEdit extends React.Component {
}, },
], ],
})(<Input disabled={type == "look" ? !false : false} />)} })(<Input disabled={type == "look" ? !false : false} />)}
</FormItem> </FormItem> */}
{type != "look" && type != "edit" && ( {type != "look" && type != "edit" && (
<FormItem {...formItemLayout} label="所属栏位"> <FormItem {...formItemLayout} label="所属栏位">
{getFieldDecorator("type", { {getFieldDecorator("type", {
...@@ -543,7 +543,7 @@ class addEdit extends React.Component { ...@@ -543,7 +543,7 @@ class addEdit extends React.Component {
initialValue: seeEdit && seeEdit.author, initialValue: seeEdit && seeEdit.author,
})(<Input disabled={type == "look" ? !false : false} />)} })(<Input disabled={type == "look" ? !false : false} />)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="专题:"> {/* <FormItem {...formItemLayout} label="专题:">
{getFieldDecorator("topic", { {getFieldDecorator("topic", {
initialValue: seeEdit && seeEdit.topic, initialValue: seeEdit && seeEdit.topic,
})( })(
...@@ -561,7 +561,7 @@ class addEdit extends React.Component { ...@@ -561,7 +561,7 @@ class addEdit extends React.Component {
maxLength={30} maxLength={30}
/> />
)} )}
</FormItem> </FormItem> */}
<FormItem {...formItemLayout} label="创建时间"> <FormItem {...formItemLayout} label="创建时间">
{getFieldDecorator("releaseTime", { {getFieldDecorator("releaseTime", {
initialValue: initialValue:
...@@ -596,7 +596,7 @@ class addEdit extends React.Component { ...@@ -596,7 +596,7 @@ class addEdit extends React.Component {
<p>支持pdf,大小50mb以内</p> <p>支持pdf,大小50mb以内</p>
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="原文链接"> {/* <FormItem {...formItemLayout} label="原文链接">
{getFieldDecorator("linkUrl", { {getFieldDecorator("linkUrl", {
initialValue: seeEdit && seeEdit.linkUrl, initialValue: seeEdit && seeEdit.linkUrl,
rules: [ rules: [
...@@ -604,7 +604,7 @@ class addEdit extends React.Component { ...@@ -604,7 +604,7 @@ class addEdit extends React.Component {
{ max: 1000, message: "链接地址不能超过1000个字符!" }, { max: 1000, message: "链接地址不能超过1000个字符!" },
], ],
})(<Input disabled={type == "look" ? !false : false} />)} })(<Input disabled={type == "look" ? !false : false} />)}
</FormItem> </FormItem> */}
<FormItem {...formItemLayout} label="内容"> <FormItem {...formItemLayout} label="内容">
{type == "look" ? ( {type == "look" ? (
<Editor <Editor
......
...@@ -608,7 +608,7 @@ class Base extends Component { ...@@ -608,7 +608,7 @@ class Base extends Component {
title="" title=""
width={1160} width={1160}
visible={this.state.selectStudentVisible} visible={this.state.selectStudentVisible}
onCancel={this.closeSelectStudent}
onOk={this.saveHomeworkViewRange} onOk={this.saveHomeworkViewRange}
onCancel={this.onHideModal} onCancel={this.onHideModal}
> >
......
...@@ -3,10 +3,9 @@ import Base from "./Base"; ...@@ -3,10 +3,9 @@ import Base from "./Base";
import AddTest from "./AddTest"; import AddTest from "./AddTest";
import Jumpquestion from "./jumpquestios.js"; import Jumpquestion from "./jumpquestios.js";
import MessageRemind from "@/common/MessageRemind"; import MessageRemind from "@/common/MessageRemind";
import TagGroup from "@/common/tags";
import moment from "moment"; import moment from "moment";
import { message } from "antd"; import { message } from "antd";
import { Link, browserHistory, withRouter } from "react-router-dom"; import { Link, withRouter } from "react-router-dom";
import Breadcrumb from "@/common/Breadcrumb"; import Breadcrumb from "@/common/Breadcrumb";
import { import {
getTSdata, getTSdata,
...@@ -18,17 +17,13 @@ import { ...@@ -18,17 +17,13 @@ import {
upFetch, upFetch,
reFetch, reFetch,
postNewsList, postNewsList,
getNewsListMessageRemind,
} from "../redux/actions"; } from "../redux/actions";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Form, Steps, Button, Input, InputNumber, Radio } from "antd"; import { Form, Steps, Button, InputNumber } from "antd";
import QRCode from "qrcode.react";
const FormItem = Form.Item; const FormItem = Form.Item;
const Step = Steps.Step; const Step = Steps.Step;
import styles from "./index.less"; import styles from "./index.less";
import Task from "@/common/task/Task";
var companyCode = location.pathname.split("/")[1]; var companyCode = location.pathname.split("/")[1];
var siteCode = location.pathname.split("/")[2]; var siteCode = location.pathname.split("/")[2];
...@@ -285,9 +280,9 @@ class SurveyCreact extends Component { ...@@ -285,9 +280,9 @@ class SurveyCreact extends Component {
type: "number", type: "number",
})(<InputNumber min={0} />)} })(<InputNumber min={0} />)}
</FormItem> </FormItem>
<FormItem label="自定义关键词" {...formItemLayout}> {/* <FormItem label="自定义关键词" {...formItemLayout}>
{getFieldDecorator("keywords")(<TagGroup {...tagPropsNew} />)} {getFieldDecorator("keywords")(<TagGroup {...tagPropsNew} />)}
</FormItem> </FormItem> */}
</Form> </Form>
{/* <Remind ref={(obj) => this.remind = obj} {...remindProps} key={this.state.key} newsList={newsList}/> */} {/* <Remind ref={(obj) => this.remind = obj} {...remindProps} key={this.state.key} newsList={newsList}/> */}
...@@ -313,12 +308,6 @@ class SurveyCreact extends Component { ...@@ -313,12 +308,6 @@ class SurveyCreact extends Component {
wrappedComponentRef={form => (this.messageRemind = form)} wrappedComponentRef={form => (this.messageRemind = form)}
/> />
)} )}
<Task
taskValue={details.enableTask}
type={0}
getFieldDecorator={getFieldDecorator}
changeTask={this.changeTask}
/>
</div> </div>
</div> </div>
), ),
......
...@@ -266,9 +266,9 @@ class Details extends Component { ...@@ -266,9 +266,9 @@ class Details extends Component {
editstate: true, editstate: true,
editid: item.id, editid: item.id,
canEdit: true, canEdit: true,
defaultFileList:[] defaultFileList: []
}, ()=>{ }, () => {
this.handleData(item.attachmentUrl,true) this.handleData(item.attachmentUrl, true)
}); });
this.props.jump({ id: item.id }); this.props.jump({ id: item.id });
...@@ -280,9 +280,9 @@ class Details extends Component { ...@@ -280,9 +280,9 @@ class Details extends Component {
editstate: true, editstate: true,
editid: item.id, editid: item.id,
canEdit: false, canEdit: false,
defaultFileList:[] defaultFileList: []
}, ()=>{ }, () => {
this.handleData(item.attachmentUrl,true) this.handleData(item.attachmentUrl, true)
}); });
this.props.jump({ id: item.id }); this.props.jump({ id: item.id });
} }
...@@ -359,7 +359,7 @@ class Details extends Component { ...@@ -359,7 +359,7 @@ class Details extends Component {
} }
if (editstate) { if (editstate) {
console.log(this.state.fileUrl,this.state.testItem.attachmentUrl,'888888') console.log(this.state.fileUrl, this.state.testItem.attachmentUrl, '888888')
const param = { const param = {
type: values.type, type: values.type,
content: values.content, content: values.content,
...@@ -426,8 +426,8 @@ class Details extends Component { ...@@ -426,8 +426,8 @@ class Details extends Component {
}); });
this.props.jumpreset(); this.props.jumpreset();
} }
handleData(data,statu) { handleData(data, statu) {
if (this.state.testItem.attachmentUrl&&statu) { if (this.state.testItem.attachmentUrl && statu) {
data.forEach((item, index) => { data.forEach((item, index) => {
this.state.defaultFileList.push({ this.state.defaultFileList.push({
uid: index + 1, uid: index + 1,
...@@ -552,47 +552,51 @@ class Details extends Component { ...@@ -552,47 +552,51 @@ class Details extends Component {
render: (text, record) => ( render: (text, record) => (
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
{this.state.isupdata == 1 && ( {this.state.isupdata == 1 && (
<a onClick={() => this.handleTestView(record)}>编辑</a>
)} <div style={{ display: "flex" }}>
{this.state.isupdata == 2 && ( <a onClick={() => this.handleTestView(record)}>编辑</a>
<a onClick={() => this.handleTestView1(record)}>查看</a>
)}
<a
style={{ marginLeft: "10px" }}
onClick={() => this.dremove(record)}
>
删除
</a>
{record.no === 1 ? (
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 1)}
>
下移
</a>
) : tlist.list.length === record.no ? (
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 2)}
>
上移
</a>
) : (
<>
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 2)}
>
上移
</a>
<a <a
style={{ marginLeft: "10px" }} style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 1)} onClick={() => this.dremove(record)}
> >
下移 删除
</a> </a>
</> {record.no === 1 ? (
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 1)}
>
下移
</a>
) : tlist.list.length === record.no ? (
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 2)}
>
上移
</a>
) : (
<>
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 2)}
>
上移
</a>
<a
style={{ marginLeft: "10px" }}
onClick={() => this.handleMove(record, 1)}
>
下移
</a>
</>
)}
</div>
)} )}
{this.state.isupdata == 2 && (
<a onClick={() => this.handleTestView1(record)}>查看</a>
)}
</div> </div>
), ),
}, },
...@@ -687,12 +691,12 @@ class Details extends Component { ...@@ -687,12 +691,12 @@ class Details extends Component {
<FormItem {...formItemLayout} label="积分设置:"> <FormItem {...formItemLayout} label="积分设置:">
<Input defaultValue={details.point} disabled /> <Input defaultValue={details.point} disabled />
</FormItem> </FormItem>
<FormItem label="自定义关键词" {...formItemLayout}> {/* <FormItem label="自定义关键词" {...formItemLayout}>
<TagGroup <TagGroup
{...tagPropsNew} {...tagPropsNew}
disabled={this.state.isupdata == 1 ? "block" : "none"} disabled={this.state.isupdata == 1 ? "block" : "none"}
/> />
</FormItem> </FormItem> */}
{// 修改 {// 修改
details.remind ? ( details.remind ? (
<MessageRemind <MessageRemind
...@@ -711,13 +715,13 @@ class Details extends Component { ...@@ -711,13 +715,13 @@ class Details extends Component {
wrappedComponentRef={form => (this.messageRemind = form)} wrappedComponentRef={form => (this.messageRemind = form)}
/> />
)} )}
<Task {/* <Task
taskValue={details.enableTask} taskValue={details.enableTask}
type={0} type={0}
disabled={this.state.isupdata == 1 ? false : true} disabled={this.state.isupdata == 1 ? false : true}
getFieldDecorator={getFieldDecorator} getFieldDecorator={getFieldDecorator}
changeTask={this.changeTask} changeTask={this.changeTask}
/> /> */}
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<p <p
style={{ marginRight: "15px" }} style={{ marginRight: "15px" }}
...@@ -725,12 +729,12 @@ class Details extends Component { ...@@ -725,12 +729,12 @@ class Details extends Component {
> >
问题列表 问题列表
</p> </p>
<Button {this.state.isupdata == 1 && (<Button
type="primary" type="primary"
onClick={() => { onClick={() => {
this.setState({ this.setState({
visibleQuestion: true, visibleQuestion: true,
defaultFileList:[], defaultFileList: [],
testItem: {}, testItem: {},
editstate: false, editstate: false,
editid: "", editid: "",
...@@ -739,7 +743,7 @@ class Details extends Component { ...@@ -739,7 +743,7 @@ class Details extends Component {
}} }}
> >
添加问题 添加问题
</Button> </Button>)}
</div> </div>
<div> <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