firmList.jsx 29 KB

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