Commit d7dc48cd by chengming

修改bug

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