sonUploadLink.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. <template>
  2. <div class="upload_Link">
  3. <div class="upHead">
  4. <div class="topLeftTitle">针对论坛及其他平台链接上传</div>
  5. <button class="addButton" @click="addInfo()">新增反馈</button>
  6. </div>
  7. <div class="tableBox">
  8. <table class="feedbackTable">
  9. <thead class="theadStyle">
  10. <tr class="tableHeadStyle1">
  11. <td>论坛传播情况汇总</td>
  12. </tr>
  13. <tr class="tableHeadStyle2 tableHeadStyle3">
  14. <td v-for="(item, index) in tableHeader" :key="index">
  15. {{ item }}
  16. </td>
  17. </tr>
  18. </thead>
  19. <tbody class="bodyStyle">
  20. <tr
  21. class="bodyContent tableHeadStyle2"
  22. v-for="(obj, index) in tableData"
  23. :key="index"
  24. :class="{ table_gray: index % 2 === 0 }"
  25. >
  26. <td v-if="flag">{{ index + 1 }}</td>
  27. <td>
  28. {{ (obj.publishDate || "").replace(RegExp("-", "g"), "/") }}
  29. </td>
  30. <!-- 发布日期 -->
  31. <td>{{ obj.informationName }}</td>
  32. <!-- 资料名称 -->
  33. <td>{{ obj.publishPlatformName }}</td>
  34. <!-- 发布渠道 -->
  35. <td>{{ obj.publishSourceName }}</td>
  36. <!-- 平台板块 发布版块-->
  37. <td>{{ obj.readCount }}</td>
  38. <!-- 阅读量 -->
  39. <td>{{ obj.goodCount }}</td>
  40. <!-- 点赞 -->
  41. <td>{{ obj.bbsCount }}</td>
  42. <!-- 评论 -->
  43. <td>{{ obj.lookingCount }}</td>
  44. <!-- 在看/转发 -->
  45. <!-- <td>{{ obj.carTypeName }}</td> -->
  46. <!-- 车系 -->
  47. <!-- <td>{{ obj.projectTypeName }}</td> -->
  48. <!-- 项目分类 -->
  49. <td>{{ obj.mediaTypeName }}</td>
  50. <!-- 稿件类别 内容分类1 -->
  51. <td>{{ obj.contentTypeName }}</td>
  52. <!-- 内容分类 内容分类2 -->
  53. <td>{{ obj.carPlatformName }}</td>
  54. <!-- 车型 -->
  55. <td :class="{ weiFanKui: !obj.id }">
  56. {{ obj.id ? "已反馈" : "未反馈" }}
  57. </td>
  58. <!-- 反馈状态 未定-->
  59. <td>{{ (obj.endDate || "").replace(RegExp("-", "g"), "/") }}</td>
  60. <!-- 反馈截止日期 -->
  61. <td>{{ obj.mediaTitle }}</td>
  62. <!-- 稿件标题 -->
  63. <td >
  64. <a :href="obj.mediaUrl" target="blank">{{ obj.mediaUrl }}</a>
  65. </td>
  66. <!-- 链接 -->
  67. <td
  68. class="operationStyle"
  69. style="cursor: pointer"
  70. v-if="+(obj.endDate || '').replace(RegExp('-', 'g'), '') - nowDate >= 0"
  71. >
  72. <span @click="toggleModal(index)">编辑</span>
  73. <!-- :class="showItemOperation" -->
  74. <span @click="toggleModal2(index)">删除</span>
  75. <!-- :class="showItemOperation" -->
  76. </td>
  77. </tr>
  78. </tbody>
  79. </table>
  80. </div>
  81. <!-- 弹窗: 编辑表格内容 -->
  82. <Modal
  83. v-if="showModal"
  84. v-on:closeme="closeme"
  85. :LinkData="modalData"
  86. @update="editTitle"
  87. :releaseMedia="releaseMedia"
  88. ></Modal>
  89. <!-- 弹窗: 新增内容 -->
  90. <AddModal
  91. v-if="showModalAdd"
  92. v-on:closeme="closemeAdd"
  93. @add_feedback="addFeedBack"
  94. :fileName="sfileName"
  95. :ziliaoId='ziliaoId'
  96. :userId="accountId"
  97. ></AddModal>
  98. <ResultModal
  99. v-show="isShowresultModal"
  100. :tipText="tipModalText"
  101. :flag="resultModalFlag"
  102. @close_result_modal="closeResultModal"
  103. @result_modal_submit="submit"
  104. ></ResultModal>
  105. <!-- 弹窗: 确定删除? -->
  106. <deleteModal
  107. v-if="showModal2"
  108. @dataDel="toDel"
  109. @hide_modal="closeme2"
  110. :LinkData="modalData"
  111. :showModalFlag="showModal2"
  112. ></deleteModal>
  113. <div class="pageBottom">
  114. <TablePage
  115. :currentPage="currentPage"
  116. :totalPage="totalPage"
  117. @change_page="changePage"
  118. @jump_page="jumpPage"
  119. ></TablePage>
  120. <p style="margin-left: 16px">共{{ totalPage }}页,共{{ sum }}条数据</p>
  121. </div>
  122. </div>
  123. </template>
  124. <script>
  125. import Modal from "../../../components/Modal";
  126. import AddModal from "../components/addFeedbackMoal";
  127. import TablePage from "../../../components/TablePage";
  128. import deleteModal from "../../data/components/UploadLinkModalDelete";
  129. import { env_url, php_url } from "../../../config/env";
  130. import axiosTest from "axios";
  131. import ResultModal from "../components/UploadResultModal";
  132. export default {
  133. props: {},
  134. components: {
  135. Modal,
  136. TablePage,
  137. deleteModal,
  138. AddModal,
  139. ResultModal
  140. },
  141. data() {
  142. return {
  143. sfileName: this.$route.query.informationName,
  144. publishCount: "",
  145. platform: [],
  146. platformVal: "",
  147. releaseMedia: [],
  148. selectedPlatform: "",
  149. selectedPlatformId: "",
  150. /* modal */
  151. feedbackTimeLimit: 0,
  152. showModal: false,
  153. showModalAdd: false,
  154. showModal2: false,
  155. showModal3: false,
  156. showModal4: false,
  157. // 表格配置
  158. sum: 0, // 一共有多少条数据
  159. pageSize: 20, // 每页展示的数据
  160. currentPage: 1,
  161. tableHeader: [
  162. "NO.",
  163. "发布日期",
  164. "资料名称",
  165. "发布渠道",
  166. "平台板块",
  167. "阅读量",
  168. "点赞",
  169. "评论",
  170. "在看/转发",
  171. "稿件类别",
  172. "内容分类",
  173. "涉及车型",
  174. "反馈状态",
  175. "反馈截止日期",
  176. "标题",
  177. "链接",
  178. "操作",
  179. ],
  180. tableData: [],
  181. flag: true,
  182. modalData: {}, //17:44
  183. file: "",
  184. dictList: [],
  185. onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
  186. accountId: "",
  187. informationName: this.$route.query.informationName || "",
  188. ziliaoId: this.$route.query.informationId || "",
  189. nowDate: "", //反馈截止时间
  190. php_url: php_url,
  191. isShowresultModal: false,
  192. resultModalFlag: true,
  193. tipModalText: "",
  194. addReportConfig: {}
  195. };
  196. },
  197. computed: {
  198. // 表格总页数
  199. totalPage() {
  200. return Math.ceil(this.sum / this.pageSize);
  201. },
  202. //是否隐藏编辑按钮 时间判断
  203. showItemOperation: function () {
  204. if (!this.endTime) {
  205. return { showItemOperationStyle: true };
  206. } else {
  207. return { showItemOperationStyle: false };
  208. }
  209. },
  210. },
  211. methods: {
  212. getNowDate: function () {
  213. let data = new Date();
  214. let year = data.getFullYear();
  215. let month = data.getMonth() + 1;
  216. let day = data.getDate();
  217. if (month < 10) {
  218. month = "0" + month;
  219. } else {
  220. month = month + "";
  221. }
  222. this.nowDate = +(year + month + day);
  223. },
  224. /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗; */
  225. toggleModal: function (i) {
  226. this.showModal = !this.showModal;
  227. this.modalData = this.tableData[i];
  228. },
  229. closeme: function () {
  230. this.showModal = !this.showModal;
  231. },
  232. //新增弹窗关闭
  233. closemeAdd: function () {
  234. this.showModalAdd = !this.showModalAdd;
  235. },
  236. //删除
  237. toggleModal2: function (i) {
  238. this.showModal2 = !this.showModal2;
  239. this.modalData = this.tableData[i];
  240. },
  241. closeme2: function () {
  242. this.showModal2 = !this.showModal2;
  243. },
  244. /* 编辑内容,,Modal传参 */
  245. editTitle: function (val) {
  246. this.$http({
  247. url: val.url,
  248. method: "post",
  249. data: val.data,
  250. })
  251. .then((res) => {
  252. if (res.data && res.data.code === 200) {
  253. //更新数据
  254. this.newGetDataList();
  255. } else {
  256. alert(res.data && res.data.message);
  257. }
  258. })
  259. .catch((err) => {
  260. console.log(err);
  261. });
  262. // axiosTest({})
  263. // console.log(val);
  264. },
  265. // 新增反馈接口
  266. add_report: function () {
  267. axiosTest({
  268. method: "post",
  269. url: this.php_url + "/lexus_php/api/add_report.php",
  270. data: this.addReportConfig.data,
  271. }).then((res) => {
  272. console.log(res);
  273. if(res.data && res.data.code === 0) {
  274. this.isShowresultModal = true;
  275. this.tipModalText = res.data.message;
  276. } else {
  277. this.getDataList();
  278. }
  279. }).catch((err) => {
  280. console.log(err);
  281. })
  282. },
  283. // 新增
  284. addFeedBack: function (val) {
  285. this.addReportConfig = val;
  286. this.addReportConfig.data.add_times = 1
  287. this.add_report();
  288. },
  289. // 关闭导入结果弹窗
  290. closeResultModal: function () {
  291. this.isShowresultModal = false;
  292. },
  293. // 导入结果返回结果是code是0
  294. submit: function () {
  295. this.addReportConfig.data.add_times = 2
  296. this.add_report();
  297. },
  298. toDel: function () {
  299. this.showModal2 = !this.showModal2;
  300. //更新数据
  301. //this.choosePlatform();
  302. this.newGetDataList();
  303. },
  304. /* 表格翻页 */
  305. changePage: function (page) {
  306. this.currentPage = page;
  307. this.getDataList();
  308. },
  309. // 点击上一页,下一页,首页,尾页
  310. jumpPage: function (item) {
  311. switch (item) {
  312. case 1:
  313. this.currentPage = 1;
  314. break;
  315. case 2:
  316. this.currentPage = this.currentPage - 1;
  317. break;
  318. case 3:
  319. this.currentPage = this.currentPage + 1;
  320. break;
  321. case 4:
  322. this.currentPage = this.totalPage;
  323. break;
  324. }
  325. this.getDataList();
  326. },
  327. //获取资料列表
  328. // getDataList: function () {
  329. // // let date = new Date();
  330. // // let m = date.getMonth() + 1;
  331. // // let y = date.getFullYear();
  332. // // let d = y + "/" + m;
  333. // this.$http({
  334. // url: "/firmsLinkUpload",
  335. // method: "post",
  336. // data: {
  337. // accountId: this.accountId,
  338. // informationId: this.$route.query.informationId,
  339. // page: this.currentPage,
  340. // rows: this.pageSize,
  341. // },
  342. // })
  343. // .then((res) => {
  344. // console.log(res);
  345. // if (res.data.code === 200) {
  346. // let data = res.data.data;
  347. // console.log(data, 2222);
  348. // this.sum = res.data.count;
  349. // for (let i = 0, j = 0; j < data.length; i++, j++) {
  350. // this.$set(this.tableData, i, data[j]);
  351. // }
  352. // }
  353. // })
  354. // .catch((err) => {
  355. // console.log(err);
  356. // });
  357. // },
  358. getDataList: function () {
  359. axiosTest({
  360. method: "post",
  361. url: this.php_url + "/lexus_php/api/myreport.php",
  362. data: {
  363. agentId: this.accountId,
  364. informationId: this.$route.query.informationId,
  365. Page: this.currentPage,
  366. Rows: this.pageSize,
  367. },
  368. })
  369. .then((res) => {
  370. if (res.data.code === 200) {
  371. this.tableData = [];
  372. let data = res.data.data;
  373. this.sum = res.data.count;
  374. for (let i = 0, j = 0; j < data.length; i++, j++) {
  375. this.$set(this.tableData, i, data[j]);
  376. }
  377. }
  378. })
  379. .catch((err) => {
  380. console.log(err);
  381. });
  382. },
  383. newGetDataList: function () {
  384. axiosTest({
  385. method: "post",
  386. url: this.php_url + "/lexus_php/api/myreport.php",
  387. data: {
  388. agentId: this.accountId,
  389. informationId: this.$route.query.informationId,
  390. Page: this.currentPage,
  391. Rows: this.pageSize,
  392. },
  393. })
  394. .then((res) => {
  395. if (res.data.code === 200) {
  396. this.tableData = [];
  397. let data = res.data.data;
  398. this.sum = res.data.count;
  399. for (let i = 0, j = 0; j < data.length; i++, j++) {
  400. this.$set(this.tableData, i, data[j]);
  401. }
  402. }
  403. })
  404. .catch((err) => {
  405. console.log(err);
  406. });
  407. },
  408. // newGetDataList: function () {
  409. // this.$http({
  410. // url: "/firmsLinkUpload",
  411. // method: "post",
  412. // data: {
  413. // agentId: this.accountId,
  414. // informationId: this.$route.query.informationId,
  415. // Page: this.currentPage,
  416. // Rows: this.pageSize,
  417. // },
  418. // })
  419. // .then((res) => {
  420. // console.log(res);
  421. // if (res.data.code === 200) {
  422. // this.tableData = [];
  423. // let data = res.data.data;
  424. // this.sum = res.data.count;
  425. // for (let i = 0, j = 0; j < data.length; i++, j++) {
  426. // this.$set(this.tableData, i, data[j]);
  427. // }
  428. // }
  429. // })
  430. // .catch((err) => {
  431. // console.log(err);
  432. // });
  433. // },
  434. //新增反馈
  435. addInfo: function () {
  436. this.showModalAdd = !this.showModalAdd;
  437. },
  438. },
  439. mounted() {
  440. let userId = localStorage.getItem("userId");
  441. if (userId) {
  442. this.accountId = userId;
  443. this.getDataList();
  444. } else {
  445. this.accountId = "";
  446. this.getDataList();
  447. }
  448. this.getNowDate();
  449. },
  450. created() {},
  451. beforeRouteEnter(to, from, next) {
  452. console.log(from)
  453. let meta = to.meta;
  454. meta[2].name = (to.query.informationName || '') + '详情'
  455. next()
  456. }
  457. };
  458. </script>
  459. <style scoped lang="less">
  460. .contentHead {
  461. height: 55px;
  462. display: flex;
  463. align-items: center;
  464. }
  465. .contentHead span {
  466. margin-right: 15px;
  467. }
  468. .tableBox {
  469. width: 1030px;
  470. overflow-y: hidden;
  471. }
  472. .tableBox {
  473. text-align: center;
  474. .table {
  475. table-layout: fixed;
  476. background-color: #fff;
  477. border-collapse: collapse;
  478. border: none;
  479. td {
  480. border: 1px solid #ccc;
  481. }
  482. span {
  483. &:hover {
  484. cursor: pointer;
  485. }
  486. }
  487. }
  488. }
  489. .table_gray td {
  490. background-color: #eeeeee;
  491. }
  492. .tableBox table {
  493. border-collapse: collapse;
  494. border: 0px;
  495. }
  496. .tableBox table td {
  497. border: 1px solid #ccc;
  498. border-right: 0px;
  499. border-bottom: 0px;
  500. text-overflow: ellipsis;
  501. overflow: hidden;
  502. white-space: nowrap;
  503. }
  504. // 表头样式
  505. .theadStyle tr td {
  506. color: white;
  507. }
  508. .tableHeadStyle1 {
  509. background: #848484;
  510. height: 30px;
  511. color: #fff;
  512. display: flex;
  513. align-items: center;
  514. }
  515. .tableHeadStyle1 td {
  516. width: 100%;
  517. padding: 7px 5px;
  518. }
  519. .tableHeadStyle2 {
  520. // background: #848484;
  521. height: 30px;
  522. color: #fff;
  523. display: flex;
  524. align-items: center;
  525. }
  526. .tableHeadStyle2 td {
  527. width: 100px;
  528. padding: 7px 5px;
  529. }
  530. .tableHeadStyle3 td {
  531. background: #848484;
  532. }
  533. .tableHeadStyle2 td:nth-child(1) {
  534. width: 60px;
  535. }
  536. .tableHeadStyle2 td:nth-child(10) {
  537. width: 100px;
  538. padding: 7px 5px;
  539. }
  540. .tableHeadStyle2 td:nth-child(11) {
  541. width: 100px;
  542. padding: 7px 5px;
  543. }
  544. .tableHeadStyle2 td:nth-child(12) {
  545. width: 100px;
  546. padding: 7px 5px;
  547. }
  548. .tableHeadStyle2 td:nth-child(2) {
  549. width: 100px;
  550. padding: 7px 5px;
  551. }
  552. .tableHeadStyle2 td:nth-child(3) {
  553. width: 100px;
  554. padding: 7px 5px;
  555. }
  556. .bodyStyle {
  557. display: block;
  558. background-color: #fff;
  559. }
  560. .bodyStyle tr > td:nth-last-child(2) {
  561. color: #0000ff;
  562. }
  563. .bodyContent td {
  564. //background-color: #fff;
  565. height: 20px;
  566. }
  567. .bodyContent td:nth-last-child(2) a {
  568. color: #0000ff;
  569. }
  570. .operationStyle {
  571. color: #0000ff;
  572. display: flex;
  573. justify-content: space-around;
  574. }
  575. .xiahuaxian {
  576. text-decoration: underline;
  577. }
  578. .operationStyle span {
  579. color: #0000ff;
  580. }
  581. .fileOperation {
  582. display: flex;
  583. justify-content: flex-start;
  584. margin: 10px;
  585. align-items: center;
  586. }
  587. .fileOperation button {
  588. border-radius: 4px;
  589. }
  590. .fileOperation span {
  591. margin-right: 16px;
  592. }
  593. .fileOperation {
  594. border-radius: 4px;
  595. label {
  596. margin-right: 16px;
  597. height: 30px;
  598. line-height: 30px;
  599. width: 56px;
  600. background-color: #0056a0;
  601. color: #fff;
  602. text-align: center;
  603. font-size: 14px;
  604. input {
  605. display: none;
  606. }
  607. }
  608. }
  609. .timeLimitStyle {
  610. padding: 10px;
  611. }
  612. .modal-backdrop {
  613. position: fixed;
  614. top: 0;
  615. right: 0;
  616. bottom: 0;
  617. left: 0;
  618. background-color: rgba(0, 0, 0, 0.3);
  619. display: flex;
  620. justify-content: center;
  621. align-items: center;
  622. }
  623. .modal {
  624. background-color: #ffffff;
  625. box-shadow: 2px 2px 20px 1px;
  626. overflow-x: auto;
  627. display: flex;
  628. flex-direction: column;
  629. width: 500px;
  630. border-radius: 0px;
  631. height: 230px;
  632. }
  633. .modal-footer {
  634. border-top: 1px solid #eee;
  635. position: relative;
  636. top: 124px;
  637. left: 232px;
  638. width: 208px;
  639. display: flex;
  640. justify-content: space-between;
  641. padding: 0px;
  642. }
  643. .modal-footer button {
  644. border-radius: 4px;
  645. margin-left: 0px;
  646. width: 80px;
  647. font-size: 14px;
  648. }
  649. .modal-footer button:nth-child(1) {
  650. background-color: #0056a0;
  651. }
  652. .modal-footer button:nth-child(2) {
  653. background-color: #eeeeee;
  654. }
  655. .modal-body {
  656. position: relative;
  657. top: 64px;
  658. margin-left: 50px;
  659. padding: 0px;
  660. }
  661. .btn-close,
  662. .btn-confirm {
  663. margin-left: 16px;
  664. width: 56px;
  665. height: 36px;
  666. border: none;
  667. cursor: pointer;
  668. }
  669. .btn-close {
  670. color: #313131;
  671. background-color: gray;
  672. }
  673. .btn-confirm {
  674. color: #fff;
  675. background-color: #2d8cf0;
  676. }
  677. .bodyRow {
  678. font-size: 16px;
  679. font-family: Arial;
  680. }
  681. .pageBottom {
  682. display: flex;
  683. justify-content: flex-end;
  684. align-items: center;
  685. }
  686. .topLeftTitle {
  687. height: 50px;
  688. display: flex;
  689. align-items: center;
  690. margin-bottom: 6px;
  691. }
  692. .addButton {
  693. color: white;
  694. width: 80px;
  695. border-radius: 4px;
  696. }
  697. .upHead {
  698. display: flex;
  699. justify-content: space-between;
  700. align-items: center;
  701. }
  702. .showItemOperationStyle {
  703. display: none;
  704. }
  705. </style>