firmList.jsx 29 KB

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