firmList.jsx 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import "react-quill/dist/quill.bubble.css";
  4. import moment from "moment";
  5. import "../authentication/techDemand.less";
  6. import {
  7. Form,
  8. Icon,
  9. Button,
  10. Input,
  11. Select,
  12. Table,
  13. message,
  14. DatePicker,
  15. Modal,
  16. Upload,
  17. Popconfirm,
  18. Cascader,
  19. InputNumber,
  20. Radio,
  21. TimePicker,
  22. Tabs,
  23. Tag, Checkbox
  24. } from "antd";
  25. import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
  26. import {
  27. getGameState,
  28. splitUrl,
  29. getprovince,
  30. getStatuslist,
  31. getLvl,
  32. beforeUploadFile,
  33. getPicPath
  34. } from "@/tools.js";
  35. import Editors from "@/richTextEditors";
  36. import SpinContainer from "../../SpinContainer";
  37. import {companyList, getCompanyName, getCompanyValueArray} from "../../common/configure"; //富文本编辑器
  38. // 上传文件
  39. const PicturesWall = React.createClass({
  40. getInitialState() {
  41. return {
  42. previewVisible: false,
  43. previewImage: "",
  44. fileList: this.props.pictureUrl,
  45. locations: [],
  46. indeterminate: false,
  47. };
  48. },
  49. getDefaultProps() {
  50. return {
  51. changeClick: this.modifyChange
  52. };
  53. },
  54. handleCancel() {
  55. this.setState({ previewVisible: false });
  56. },
  57. handlePreview(file) {
  58. this.setState({
  59. previewImage: file.url || file.thumbUrl,
  60. previewVisible: true
  61. });
  62. },
  63. handleChange(info) {
  64. let fileList = info.fileList;
  65. this.setState({ fileList });
  66. this.props.fileList(fileList);
  67. },
  68. componentWillReceiveProps(nextProps) {
  69. },
  70. render() {
  71. const { previewVisible, previewImage, fileList } = this.state;
  72. // 点击上传
  73. const uploadButton = (
  74. <div>
  75. <Icon type="plus" />
  76. <div className="ant-upload-text">点击上传</div>
  77. </div>
  78. );
  79. return (
  80. //上传组件
  81. <div style={{ display: "inline-block" }}>
  82. <Upload
  83. beforeUpload={beforeUploadFile}
  84. // action={globalConfig.context + "/api/admin/militaryEnterprises/uploadPicture"}
  85. action={globalConfig.context + "/api/admin/news/uploadFile"}
  86. data={{ sign: "enterprises_pucture" }}
  87. listType="picture-card"
  88. fileList={fileList}
  89. onPreview={this.handlePreview}
  90. onChange={this.handleChange}
  91. >
  92. {fileList && fileList.length >= 1 ? null : uploadButton}
  93. </Upload>
  94. <Modal
  95. maskClosable={false}
  96. visible={previewVisible}
  97. footer={null}
  98. onCancel={e => {
  99. this.setState({ previewVisible: false });
  100. }}
  101. >
  102. <img alt="" style={{ width: "100%" }} src={previewImage} />
  103. </Modal>
  104. </div>
  105. );
  106. }
  107. });
  108. //主体
  109. const FirmList = Form.create()(
  110. React.createClass({
  111. // 初始化数据
  112. loadData(pageNo) {
  113. this.state.data = [];
  114. this.setState({
  115. loading: true,
  116. page: pageNo
  117. });
  118. //发送请求
  119. $.ajax({
  120. method: "get",
  121. dataType: "json",
  122. crossDomain: false,
  123. url: globalConfig.context + "/api/admin/news/listNews",
  124. data: {
  125. pageNo: pageNo || this.state.pagination.current || 1,
  126. pageSize: this.state.pagination.pageSize,
  127. title: this.state.titleSearch,
  128. location: this.state.locationSearch,
  129. },
  130. success: function(data) {
  131. let theArr = [];
  132. if (!data.data || !data.data.list) {
  133. if (data.error && data.error.length) {
  134. message.warning(data.error[0].message);
  135. }
  136. } else {
  137. for (let i = 0; i < data.data.list.length; i++) {
  138. let thisdata = data.data.list[i];
  139. thisdata.key = i + 1
  140. theArr.push(thisdata);
  141. }
  142. this.state.pagination.current = data.data.pageNo;
  143. this.state.pagination.total = data.data.totalCount;
  144. }
  145. this.setState({
  146. dataSource: theArr,
  147. pagination: this.state.pagination
  148. });
  149. }.bind(this)
  150. }).always(
  151. function() {
  152. this.setState({
  153. loading: false
  154. });
  155. }.bind(this)
  156. );
  157. },
  158. //声明状态
  159. getInitialState() {
  160. return {
  161. loading: false,
  162. flag: true,
  163. editorState: null,
  164. activeKey: "1",
  165. timesArr: [],
  166. ProvinceCity: [],
  167. ProvinceCityC: [],
  168. totalData: {
  169. mark: false
  170. },
  171. imgWidth: "width: 200px",
  172. logoUrl: [],
  173. pagination: {
  174. defaultCurrent: 1,
  175. defaultPageSize: 10,
  176. showQuickJumper: true,
  177. pageSize: 10,
  178. onChange: function(page) {
  179. this.loadData(page);
  180. this.setState({
  181. selectedRowKeys: []
  182. });
  183. }.bind(this),
  184. showTotal: function(total) {
  185. return "共" + total + "条数据";
  186. }
  187. },
  188. //数据类型
  189. columns: [
  190. {
  191. title: "序号",
  192. dataIndex: "key",
  193. key: "key"
  194. },
  195. {
  196. title: "新闻分类",
  197. dataIndex: "type",
  198. key: "type",
  199. render: text => {
  200. if (text == 0) {
  201. return "公司新闻";
  202. } else if (text == 1) {
  203. return "行业新闻";
  204. }
  205. }
  206. },
  207. {
  208. title: "新闻标题",
  209. dataIndex: "title",
  210. key: "title",
  211. render: text => {
  212. return text.length >= 8 ? text.substring(0, 8) + "..." : text;
  213. }
  214. },
  215. {
  216. title: "排序",
  217. dataIndex: "sort",
  218. key: "sort"
  219. },
  220. {
  221. title: "是否首页",
  222. dataIndex: "status",
  223. key: "status",
  224. render: s => {
  225. return s ? (
  226. <Tag color="#87d068">是</Tag>
  227. ) : (
  228. <Tag color="#f50">否</Tag>
  229. );
  230. }
  231. },
  232. {
  233. title: "新闻缩率图",
  234. dataIndex: "pictureUrl",
  235. key: "pictureUrl",
  236. render: url => {
  237. let path = getPicPath(globalConfig.avatarUploadHost, url);
  238. return (
  239. <div style={{ textAlign: "center" }}>
  240. <img src={path} style={{ width: "100px", height: 50 }} />
  241. <Button
  242. className="buttonimg"
  243. style={{ marginLeft: 10 }}
  244. onClick={e => {
  245. e.stopPropagation();
  246. this.maximg(path);
  247. }}
  248. >
  249. 查看大图
  250. </Button>
  251. </div>
  252. );
  253. }
  254. },
  255. {
  256. title: "公司",
  257. dataIndex: "locations",
  258. key: "locations",
  259. render: r => {
  260. return(
  261. r && r.map((v)=>(
  262. <Tag>{getCompanyName(v)}</Tag>
  263. ))
  264. )
  265. }
  266. },
  267. {
  268. title: "发布状态",
  269. dataIndex: "releaseStatus",
  270. key: "releaseStatus",
  271. render: text => {
  272. return text ? "是" : "否";
  273. }
  274. },
  275. // {
  276. // title: "置顶",
  277. // dataIndex: "topNumber",
  278. // key: "topNumber",
  279. // render: text => {
  280. // return text ? "否" : "是";
  281. // }
  282. // },
  283. {
  284. title: "操作",
  285. dataIndex: "operate",
  286. key: "operate",
  287. render: (text, record, index) => {
  288. return (
  289. <div>
  290. <Button
  291. type="primary"
  292. style={{ marginLeft: "10px" }}
  293. onClick={() => {
  294. this.setState({
  295. flag: true
  296. });
  297. this.edit(record);
  298. }}
  299. >
  300. 编辑
  301. </Button>
  302. <Popconfirm
  303. title="您确定删除该新闻吗?"
  304. onConfirm={() => this.confirm(record.id)}
  305. onCancel={this.cancel}
  306. okText="是"
  307. cancelText="否"
  308. >
  309. <Button
  310. type="danger"
  311. style={{ marginLeft: "10px" }}
  312. onClick={e => {
  313. e.stopPropagation();
  314. }}
  315. >
  316. 删除
  317. </Button>
  318. </Popconfirm>
  319. <Button
  320. type="primary"
  321. style={{ marginLeft: "10px" }}
  322. onClick={e => {
  323. e.stopPropagation();
  324. if (record.status) {
  325. this.toTop(record, 0);
  326. } else {
  327. this.toTop(record, 1);
  328. }
  329. }}
  330. >
  331. {record.status ? "从首页撤下" : "推荐至首页"}
  332. </Button>
  333. </div>
  334. );
  335. }
  336. },
  337. {
  338. title: "发布时间",
  339. dataIndex: "releaseTimeConvert",
  340. key: "releaseTimeConvert"
  341. }
  342. ],
  343. //数据列表
  344. dataSource: []
  345. };
  346. },
  347. // 新增新闻按钮
  348. add() {
  349. this.setState({
  350. editvisible: true,
  351. flag: false
  352. });
  353. },
  354. // 推荐置顶
  355. toTop(record, num) {
  356. $.ajax({
  357. method: "post",
  358. dataType: "json",
  359. crossDomain: false,
  360. url: globalConfig.context + "/api/admin/news/updateNews",
  361. data: {
  362. id: record.id,
  363. status: num
  364. },
  365. success: function(data) {
  366. let theArr = [];
  367. if (data.error && data.error.length) {
  368. message.warning(data.error[0].message);
  369. } else {
  370. this.loadData();
  371. }
  372. }.bind(this)
  373. }).always(
  374. function() {
  375. this.setState({
  376. loading: false
  377. });
  378. }.bind(this)
  379. );
  380. },
  381. //编辑按钮操作
  382. tableRowClick(record) {
  383. this.setState({
  384. editvisible: true,
  385. flag: true,
  386. },()=>{
  387. this.edit(record);
  388. });
  389. },
  390. edit(record, index) {
  391. this.setState({
  392. editvisible: true,
  393. loading: true
  394. });
  395. $.ajax({
  396. method: "get",
  397. dataType: "json",
  398. crossDomain: false,
  399. url: globalConfig.context + "/api/admin/news/selectNews",
  400. data: {
  401. id: record.id
  402. },
  403. success: function(data) {
  404. let theArr = [];
  405. if (data.error && data.error.length) {
  406. message.warning(data.error[0].message);
  407. } else {
  408. let thisdata = data.data;
  409. this.setState({
  410. id: thisdata.id,
  411. title: thisdata.title,
  412. publisher: thisdata.publisher,
  413. type: thisdata.type,
  414. pictureUrl: thisdata.pictureUrl
  415. ? splitUrl(
  416. thisdata.pictureUrl,
  417. ",",
  418. globalConfig.avatarUploadHost
  419. )
  420. : [],
  421. sort: thisdata.sort,
  422. indeterminate: thisdata.locations ? thisdata.locations.length === companyList.length : false,
  423. locations: thisdata.locations,
  424. editorcontext: thisdata.content,
  425. releaseStatus: thisdata.releaseStatus,
  426. time: thisdata.releaseTimeConvert
  427. ? thisdata.releaseTimeConvert
  428. : thisdata.createTimeConvert
  429. });
  430. window.setTimeout(() => {
  431. console.log(this.state);
  432. }, 100);
  433. }
  434. }.bind(this)
  435. }).always(
  436. function() {
  437. this.setState({
  438. loading: false
  439. });
  440. }.bind(this)
  441. );
  442. },
  443. getOrgCodeUrl(e) {
  444. this.setState({ pictureUrl: e });
  445. },
  446. // 新增新闻
  447. addNew(flag) {
  448. if(!this.state.locations || this.state.locations.length === 0 ){
  449. message.warning('请选择公司');
  450. return ;
  451. }
  452. if(!this.state.pictureUrl || this.state.pictureUrl.length === 0){
  453. message.warning('请选择新闻大图');
  454. return ;
  455. }
  456. if (this.state.flag) {
  457. $.ajax({
  458. method: "post",
  459. dataType: "json",
  460. crossDomain: false,
  461. url: globalConfig.context + "/api/admin/news/updateNews",
  462. data: {
  463. id: this.state.id,
  464. title: this.state.title,
  465. publisher: this.state.publisher,
  466. type: this.state.type,
  467. pictureUrl: this.state.pictureUrl
  468. ? this.state.pictureUrl[0].response.data
  469. : undefined,
  470. sort: this.state.sort,
  471. locations: this.state.locations.join(','),
  472. content: this.state.editorcontext,
  473. status: this.state.status,
  474. releaseTimes: this.state.time,
  475. releaseStatus: flag
  476. },
  477. success: function(data) {
  478. let theArr = [];
  479. if (data.error && data.error.length) {
  480. message.warning(data.error[0].message);
  481. } else {
  482. message.success('操作成功');
  483. this.loadData();
  484. this.handleCancelEdit();
  485. }
  486. }.bind(this)
  487. }).always(
  488. function() {
  489. this.setState({
  490. loading: false
  491. });
  492. }.bind(this)
  493. );
  494. } else {
  495. $.ajax({
  496. method: "post",
  497. dataType: "json",
  498. crossDomain: false,
  499. url: globalConfig.context + "/api/admin/news/addNews",
  500. data: {
  501. title: this.state.title,
  502. publisher: this.state.publisher,
  503. type: this.state.type,
  504. pictureUrl: this.state.pictureUrl[0].response.data,
  505. sort: this.state.sort,
  506. locations: this.state.locations.join(','),
  507. content: this.state.editorcontext,
  508. releaseStatus: flag,
  509. status: 0,
  510. releaseTimes: this.state.time
  511. },
  512. success: function(data) {
  513. if (data.error && data.error.length) {
  514. message.warning(data.error[0].message);
  515. } else {
  516. message.success('操作成功');
  517. this.loadData();
  518. this.handleCancelEdit();
  519. }
  520. }.bind(this)
  521. }).always(
  522. function() {
  523. this.setState({
  524. loading: false
  525. });
  526. }.bind(this)
  527. );
  528. }
  529. },
  530. //表单内容改变时候触发
  531. change(key, e, f) {
  532. if (f === undefined) {
  533. this.state.totalData[key] = e;
  534. this.setState({
  535. totalData: this.state.totalData
  536. });
  537. } else if (typeof f === "function") {
  538. this.state.totalData[key] = e;
  539. this.setState(
  540. {
  541. totalData: this.state.totalData
  542. },
  543. f
  544. );
  545. }
  546. },
  547. // 关闭模态框
  548. handleCancelEdit() {
  549. this.setState({
  550. editvisible: false
  551. });
  552. this.addReset();
  553. },
  554. //点击大图
  555. maximg(url) {
  556. this.setState({
  557. imgeditvisible: true,
  558. maximg: url
  559. });
  560. },
  561. componentWillMount() {
  562. this.loadData();
  563. },
  564. //确认要删除吗
  565. confirm(id) {
  566. $.ajax({
  567. method: "post",
  568. dataType: "json",
  569. crossDomain: false,
  570. url: globalConfig.context + "/api/admin/news/deleteNews",
  571. data: {
  572. id
  573. },
  574. success: function(data) {
  575. let theArr = [];
  576. if (data.error && data.error.length) {
  577. message.warning(data.error[0].message);
  578. } else {
  579. this.loadData();
  580. }
  581. }.bind(this)
  582. }).always(
  583. function() {
  584. this.setState({
  585. loading: false
  586. });
  587. }.bind(this)
  588. );
  589. },
  590. imghandleCancel() {
  591. this.setState({
  592. imgeditvisible: false
  593. });
  594. },
  595. //取消删除
  596. cancel() {
  597. console.log("我取消删除了");
  598. },
  599. async submitContent() {
  600. // 在编辑器获得焦点时按下ctrl+s会执行此方法
  601. // 编辑器内容提交到服务端之前,可直接调用editorState.toHTML()来获取HTML格式的内容
  602. const htmlContent = this.state.editorState.toHTML();
  603. const result = await saveEditorContent(htmlContent);
  604. },
  605. //新增框的清零
  606. addReset() {
  607. this.setState({
  608. pictureUrl: [],
  609. title: undefined,
  610. publisher: undefined,
  611. type: undefined,
  612. sort: undefined,
  613. locations: [],
  614. editorcontext: "",
  615. time: undefined,
  616. indeterminate: false,
  617. });
  618. },
  619. //搜索部分的清零
  620. reset() {
  621. this.setState({
  622. locationSearch: '',
  623. titleSearch: undefined,
  624. },()=>{
  625. this.loadData();
  626. })
  627. },
  628. render() {
  629. const FormItem = Form.Item;
  630. const rowSelection = {
  631. selectedRowKeys: this.state.selectedRowKeys,
  632. onChange: (selectedRowKeys, selectedRows) => {
  633. this.setState({
  634. selectedRows: selectedRows.slice(-1),
  635. selectedRowKeys: selectedRowKeys.slice(-1)
  636. });
  637. }
  638. };
  639. let data = this.state.totalData;
  640. const { TextArea } = Input; //文本域
  641. const { TabPane } = Tabs; //标签页
  642. const { MonthPicker, RangePicker, WeekPicker } = DatePicker; //日期输入框
  643. const { editorState } = this.state;
  644. return (
  645. <div className="user-content">
  646. <div className="content-title">
  647. <span>新闻列表</span>
  648. <div className="user-search">
  649. <Input
  650. placeholder="请输入新闻标题"
  651. style={{
  652. width: "150px",
  653. marginRight: "10px",
  654. marginBottom: "10px"
  655. }}
  656. value={this.state.titleSearch}
  657. onChange={e => {
  658. this.setState({ titleSearch: e.target.value });
  659. }}
  660. />
  661. <Select
  662. placeholder="请选择公司"
  663. style={{ width: 150 }}
  664. value={this.state.locationSearch}
  665. onChange={e => {
  666. this.setState({
  667. locationSearch: e
  668. });
  669. }}
  670. >
  671. {
  672. companyList.map((v)=>(
  673. <Select.Option key={v.value} value={v.value}>{v.title}</Select.Option>
  674. ))
  675. }
  676. </Select>
  677. <Button
  678. type="primary"
  679. onClick={e => {
  680. this.loadData();
  681. }}
  682. style={{ marginRight: "10px" }}
  683. >
  684. 搜索
  685. </Button>
  686. <Button onClick={this.reset} style={{ marginRight: "10px" }}>
  687. 重置
  688. </Button>
  689. <Button
  690. type="primary"
  691. onClick={this.add}
  692. style={{ marginLeft: "100px" }}
  693. >
  694. 新增新闻
  695. </Button>
  696. </div>
  697. {/* 新闻表单 */}
  698. <div className="patent-table">
  699. <SpinContainer spinning={this.state.loading}>
  700. <Table
  701. columns={this.state.columns}
  702. dataSource={this.state.dataSource}
  703. pagination={this.state.pagination}
  704. onRowClick={this.tableRowClick}
  705. bordered
  706. size="small"
  707. ellipsis="true"
  708. />
  709. </SpinContainer>
  710. </div>
  711. </div>
  712. {/* 模块框 */}
  713. <div className="patent-desc">
  714. <Modal
  715. className="customeDetails"
  716. title={this.state.flag ? "新闻详情" : "新增新闻"}
  717. width="1000px"
  718. onCancel={this.handleCancelEdit}
  719. visible={this.state.editvisible}
  720. footer=""
  721. >
  722. <SpinContainer spinning={this.state.loading}>
  723. <div className="clearfix">
  724. <FormItem
  725. className="half-item"
  726. labelCol={{ span: 8 }}
  727. wrapperCol={{ span: 12 }}
  728. label="新闻标题"
  729. >
  730. <Input
  731. placeholder="请输入新闻标题"
  732. value={this.state.title}
  733. onChange={e => {
  734. this.setState({
  735. title: e.target.value
  736. });
  737. }}
  738. style={{ width: "240px" }}
  739. />
  740. </FormItem>
  741. <FormItem
  742. className="half-item"
  743. labelCol={{ span: 8 }}
  744. wrapperCol={{ span: 12 }}
  745. label="新闻类别"
  746. >
  747. <Select
  748. style={{ width: 120 }}
  749. placeholder="请选择新闻类型"
  750. value={
  751. this.state.type == 1
  752. ? "行业新闻"
  753. : this.state.type == 0
  754. ? "公司新闻"
  755. : []
  756. }
  757. onChange={e => {
  758. this.setState({
  759. type: e
  760. });
  761. }}
  762. >
  763. <Option value="0">公司新闻</Option>
  764. <Option value="1">行业新闻</Option>
  765. </Select>
  766. </FormItem>
  767. <FormItem
  768. className="half-item"
  769. labelCol={{ span: 8 }}
  770. wrapperCol={{ span: 12 }}
  771. label="新闻发布人"
  772. >
  773. <Input
  774. placeholder="请输入新闻发布人"
  775. value={this.state.publisher}
  776. onChange={e => {
  777. this.setState({
  778. publisher: e.target.value
  779. });
  780. }}
  781. style={{ width: "240px" }}
  782. />
  783. </FormItem>
  784. <FormItem
  785. className="half-item"
  786. labelCol={{ span: 8 }}
  787. wrapperCol={{ span: 12 }}
  788. label="发布时间"
  789. >
  790. <DatePicker
  791. placeholder="请输入发布时间"
  792. format="YYYY-MM-DD HH:mm:ss"
  793. showTime
  794. value={this.state.time ? moment(this.state.time) : null}
  795. onChange={(e, f) => {
  796. this.setState({ time: f });
  797. console.log(e, f);
  798. }}
  799. style={{ width: "240px" }}
  800. />
  801. </FormItem>
  802. <FormItem
  803. className="half-item"
  804. labelCol={{ span: 8 }}
  805. wrapperCol={{ span: 12 }}
  806. label="排序"
  807. >
  808. <Input
  809. placeholder="请输入排序"
  810. value={this.state.sort}
  811. onChange={e => {
  812. this.setState({
  813. sort: e.target.value
  814. });
  815. }}
  816. style={{ width: "240px" }}
  817. />
  818. </FormItem>
  819. <FormItem
  820. className="half-item"
  821. labelCol={{ span: 8 }}
  822. wrapperCol={{ span: 12 }}
  823. label="公司"
  824. >
  825. <Checkbox.Group value={this.state.locations} onChange={e => {
  826. this.setState({
  827. locations: e.indexOf(undefined) === -1 ? e : getCompanyValueArray(),
  828. indeterminate: e.indexOf(undefined) !== -1
  829. });
  830. }}>
  831. <Checkbox indeterminate={this.state.indeterminate}>全选</Checkbox>
  832. {
  833. companyList.map((v)=>(
  834. <Checkbox key={v.value} value={v.value}>{v.title}</Checkbox>
  835. ))
  836. }
  837. </Checkbox.Group>
  838. </FormItem>
  839. </div>
  840. <div className="clearfix">
  841. <FormItem
  842. labelCol={{ span: 4 }}
  843. wrapperCol={{ span: 18 }}
  844. onCancel={this.handleCancel}
  845. label="新闻大图"
  846. >
  847. <PicturesWall
  848. fileList={this.getOrgCodeUrl}
  849. pictureUrl={this.state.pictureUrl}
  850. />
  851. <p>图片建议:要清晰。</p>
  852. </FormItem>
  853. </div>
  854. <div className="clearfix">
  855. <FormItem
  856. labelCol={{ span: 4 }}
  857. wrapperCol={{ span: 18 }}
  858. label="企业简介"
  859. >
  860. <Editors
  861. textContent={this.state.editorcontext}
  862. uploadUrl={"/api/admin/news/uploadFile"}
  863. globalConfig={globalConfig.uploadPath}
  864. placeholder="业务项目客户基本条件"
  865. handleRichText={value => {
  866. this.setState({ editorcontext: value });
  867. }}
  868. />
  869. </FormItem>
  870. </div>
  871. <div className="clearfix">
  872. <Button
  873. type="primary"
  874. size="large"
  875. onClick={e => {
  876. this.addNew(0);
  877. }}
  878. style={{
  879. float: "right",
  880. marginRight: "80px",
  881. marginTop: "20px"
  882. }}
  883. >
  884. 保存
  885. </Button>
  886. <Button
  887. type="primary"
  888. size="large"
  889. onClick={e => {
  890. this.addNew(1);
  891. }}
  892. style={{
  893. float: "right",
  894. marginRight: "20px",
  895. marginTop: "20px"
  896. }}
  897. >
  898. 保存并发布
  899. </Button>
  900. </div>
  901. </SpinContainer>
  902. </Modal>
  903. <Modal
  904. visible={this.state.imgeditvisible}
  905. onCancel={this.imghandleCancel}
  906. onOk={this.imgOk}
  907. >
  908. <img style={{ width: "100%" }} src={this.state.maximg} />
  909. </Modal>
  910. </div>
  911. </div>
  912. );
  913. }
  914. })
  915. );
  916. export default FirmList;