forked from Gitlink/forgeplus-react
工单列表
This commit is contained in:
parent
637ce0fc9a
commit
a83b6a1013
|
@ -5,14 +5,21 @@ import axios from 'axios';
|
|||
import Nav from './Nav';
|
||||
import UploadComponent from '../Upload/Index';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import{ Modal,Col,Form,Input,Tooltip,Select } from 'antd'
|
||||
import NoneData from '../../modules/courses/coursesPublic/NoneData';
|
||||
import{ Modal ,Form , Input , Select } from 'antd';
|
||||
import QuillForEditor from '../quillForEditor';
|
||||
import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html'
|
||||
import Attachments from '../Upload/attachment'
|
||||
|
||||
const TextArea = Input.TextArea;
|
||||
const Option = Select.Option;
|
||||
|
||||
|
||||
const options = [
|
||||
['bold', 'italic', 'underline'],
|
||||
[{header: [1,2,3,false]}],
|
||||
['blockquote', 'code-block'],
|
||||
['link', 'image'],
|
||||
['formula']
|
||||
];
|
||||
class CopyDetail extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
|
@ -36,7 +43,7 @@ class CopyDetail extends Component{
|
|||
done_ratio:0,
|
||||
textcount:"",
|
||||
fileList:undefined,
|
||||
get_attachments: undefined
|
||||
get_attachments: undefined,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,6 +124,12 @@ class CopyDetail extends Component{
|
|||
})
|
||||
}
|
||||
|
||||
onContentChange=(value)=>{
|
||||
this.setState({
|
||||
textcount:value
|
||||
})
|
||||
}
|
||||
|
||||
changmodelname=(e)=>{
|
||||
this.setState({
|
||||
subject:e.target.value
|
||||
|
@ -155,12 +168,19 @@ class CopyDetail extends Component{
|
|||
if(values.assigned_to_id===0){
|
||||
values.assigned_to_id = ""
|
||||
}
|
||||
const { textcount } = this.state;
|
||||
let _html = '';
|
||||
try {
|
||||
_html = new QuillDeltaToHtmlConverter(textcount.ops, {}).convert();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
axios.put(url,{
|
||||
project_id:projectsId,
|
||||
subject:subject,
|
||||
id: orderId,
|
||||
description:this.state.textcount,
|
||||
description:_html,
|
||||
attachment_ids:fileList,
|
||||
...values
|
||||
}).then(result=>{
|
||||
|
@ -204,14 +224,29 @@ class CopyDetail extends Component{
|
|||
<Input placeholder="标题" onChange={this.changmodelname}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<div className="quillContent" style={{marginBottom:"20px"}}>
|
||||
<QuillForEditor
|
||||
value = {textcount}
|
||||
imgAttrs={{ width: '60px', height: '30px' }}
|
||||
wrapStyle={{
|
||||
height: '220px',
|
||||
opacity:1,
|
||||
}}
|
||||
// autoFocus={true}
|
||||
style={{ height: '170px' }}
|
||||
placeholder="请输入工单的描述..."
|
||||
options={options}
|
||||
onContentChange={this.onContentChange}
|
||||
/>
|
||||
</div>
|
||||
{/* <Form.Item>
|
||||
{getFieldDecorator('description', {
|
||||
rules: [],
|
||||
initialValue: textcount
|
||||
})(
|
||||
<TextArea placeholder="请输入工单的描述..." style={{height: "300px"}} onChange={this.changmodelcount}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form.Item> */}
|
||||
<UploadComponent load={this.UploadFunc}
|
||||
showNotification={this.props.showNotification} isComplete={true} ></UploadComponent>
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ class OrderItem extends Component{
|
|||
<li>{item.assign_user_name || "--"}</li>
|
||||
<li>{item.priority || "--"}</li>
|
||||
<li>{item.done_ratio || "--"}</li>
|
||||
<li>{ item.journals_count ? <span><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</span> : "" }</li>
|
||||
<li>{ item.journals_count ? <Link to={`/projects/${projectsId}/orders/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link> : "" }</li>
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue