sonUploadLink.vue 15 KB

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