UploadLink.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. <template>
  2. <div class="upload_Link">
  3. <span><b>经销商</b></span>
  4. <span><b>针对论坛及其他平台链接上传</b></span>
  5. <div class="contentHead">
  6. <span>上传平台</span>
  7. <select name="" id="">
  8. <option value="">汽车之家</option>
  9. <option value="">请选择</option>
  10. </select>
  11. </div>
  12. <div class="tableBox">
  13. <table class="feedbackTable">
  14. <thead class="theadStyle">
  15. <tr class="tableHeadStyle1">
  16. <td>论坛传播情况汇总</td>
  17. </tr>
  18. <tr class="tableHeadStyle2">
  19. <td v-for="(item, index) in tableHeader" :key="index">
  20. {{ item }}
  21. </td>
  22. </tr>
  23. </thead>
  24. <tbody class="bodyStyle">
  25. <tr
  26. class="bodyContent tableHeadStyle2"
  27. v-for="(obj, index) in tableData"
  28. :key="index"
  29. :class="{ table_gray: !discolor && index % 2 === 0 }"
  30. >
  31. <td v-if="flag">{{ index + 1 }}</td>
  32. <td>
  33. {{ obj.releaseTime }}
  34. </td>
  35. <td>
  36. {{ obj.dataName }}
  37. </td>
  38. <td>
  39. {{ obj.carSeries }}
  40. </td>
  41. <td>
  42. {{ obj.carType }}
  43. </td>
  44. <td>
  45. {{ obj.releaseMedia }}
  46. </td>
  47. <td>
  48. {{ obj.projectClass }}
  49. </td>
  50. <td>
  51. {{ obj.draftGenre }}
  52. </td>
  53. <td>
  54. {{ obj.contentClass }}
  55. </td>
  56. <td>
  57. {{ obj.articleTitle }}
  58. </td>
  59. <td>
  60. {{ obj.articleLink }}
  61. </td>
  62. <td class="operationStyle">
  63. <span @click="toggleModal">编辑</span>
  64. <span
  65. @click="
  66. toggleModal2();
  67. nowIndex = index;
  68. "
  69. >删除</span
  70. >
  71. <!-- 弹窗: 确定删除? -->
  72. <div class="modal-backdrop" v-show="showModal2">
  73. <div class="modal">
  74. <div class="modal-body">
  75. <div class="bodyRow">确定删除?</div>
  76. </div>
  77. <div class="modal-footer">
  78. <button
  79. type="button"
  80. class="btn-confirm"
  81. @click="
  82. toDel(nowIndex);
  83. closeme2();
  84. "
  85. >
  86. 确定
  87. </button>
  88. <button type="button" class="btn-close" @click="closeme2">
  89. 取消
  90. </button>
  91. </div>
  92. </div>
  93. </div>
  94. </td>
  95. </tr>
  96. </tbody>
  97. </table>
  98. </div>
  99. <!-- 弹窗: 编辑表格内容 -->
  100. <Modal
  101. v-show="showModal"
  102. v-on:closeme="closeme"
  103. :dataset_title="tableData.articleTitle"
  104. @update="editTitle"
  105. ></Modal>
  106. <div class="timeLimitStyle">
  107. <span>仅可对上传时间为{{ feedbackTimeLimit }}个月内的资料进行反馈</span>
  108. </div>
  109. <div class="pageBottom">
  110. <div class="fileOperation">
  111. <span class="operationStyle">导入模板</span>
  112. <button @click="toggleModal3()">导入</button>
  113. <button>导出</button>
  114. </div>
  115. <TablePage
  116. :currentPage="currentPage"
  117. :totalPage="totalPage"
  118. @change_page="changePage"
  119. @jump_page="jumpPage"
  120. class="tablePageStyle"
  121. ></TablePage>
  122. </div>
  123. <!-- 弹窗: 上传链接超过剩余限制数量,请修改后重新导入 -->
  124. <div class="modal-backdrop" v-show="showModal3">
  125. <div class="modal">
  126. <div class="modal-body">
  127. <div class="bodyRow">上传链接超过剩余限制数量,请修改后重新导入</div>
  128. </div>
  129. <div class="modal-footer">
  130. <button type="button" class="btn-confirm" @click="closeme3()">
  131. 确定
  132. </button>
  133. <button type="button" class="btn-close" @click="closeme3">
  134. 取消
  135. </button>
  136. </div>
  137. </div>
  138. </div>
  139. <!-- 弹窗: 资料名称无法匹配,请修改后重新导入 -->
  140. <div class="modal-backdrop" v-show="showModal4">
  141. <div class="modal">
  142. <div class="modal-body">
  143. <div class="bodyRow">资料名称无法匹配,请修改后重新导入</div>
  144. <div class="bodyRow">成功{{ 1 }}条,失败{{ 1 }}条</div>
  145. </div>
  146. <div class="modal-footer" style="position: relative; top: 95px;">
  147. <button type="button" class="btn-confirm" @click="closeme4()">
  148. 确定
  149. </button>
  150. <button type="button" class="btn-close" @click="closeme4">
  151. 取消
  152. </button>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </template>
  158. <script>
  159. import Modal from "../../components/Modal";
  160. import TablePage from "../../components/TablePage";
  161. export default {
  162. props: {
  163. isManufacturer: {
  164. type: String,
  165. default: "distributor",
  166. },
  167. },
  168. components: {
  169. Modal,
  170. TablePage,
  171. },
  172. data() {
  173. return {
  174. feedbackTimeLimit: 6,
  175. showModal: false,
  176. showModal2: false,
  177. showModal3: false,
  178. showModal4: false,
  179. sonConsfirmFlag: false,
  180. // 表格配置
  181. sum: 240, // 一共有多少条数据
  182. pageSize: 20, // 每页展示的数据
  183. discolor: false, // false是隔行变色
  184. currentPage: 1,
  185. tableHeader: [
  186. "NO.",
  187. "发布日期",
  188. "资料名称",
  189. "车系",
  190. "车型",
  191. "发布版块",
  192. "项目分类",
  193. "内容分类1",
  194. "内容分类2",
  195. "标题",
  196. "链接",
  197. "操作",
  198. ],
  199. tableData: [
  200. {
  201. releaseTime: "2021/03/04",
  202. dataName: "雷克萨斯ES上市",
  203. carSeries: "雷克萨斯ES",
  204. carType: "ES雷克萨斯",
  205. releaseMedia: "S雷克萨斯",
  206. // releasePlate: " ",
  207. projectClass: "东区",
  208. draftGenre: "雷克萨斯ES",
  209. contentClass: "ES雷克萨斯",
  210. articleTitle: "S雷克萨斯",
  211. articleLink: "d",
  212. },
  213. {
  214. releaseTime: "2021/03/04",
  215. dataName: "雷克萨斯ES上市",
  216. carSeries: "雷克萨斯ES",
  217. carType: "ES雷克萨斯",
  218. releaseMedia: "S雷克萨斯",
  219. // releasePlate: " ",
  220. projectClass: "东区",
  221. draftGenre: "雷克萨斯ES",
  222. contentClass: "ES雷克萨斯",
  223. articleTitle: "S雷克萨斯",
  224. articleLink: "d",
  225. },
  226. {
  227. releaseTime: "",
  228. dataName: "",
  229. carSeries: "",
  230. carType: "",
  231. releaseMedia: "",
  232. // releasePlate: " ",
  233. projectClass: "",
  234. draftGenre: "",
  235. contentClass: "",
  236. articleTitle: "",
  237. articleLink: "",
  238. },
  239. {
  240. releaseTime: "",
  241. dataName: "",
  242. carSeries: "",
  243. carType: "",
  244. releaseMedia: "",
  245. // releasePlate: " ",
  246. projectClass: "",
  247. draftGenre: "",
  248. contentClass: "",
  249. articleTitle: "",
  250. articleLink: "",
  251. },
  252. ],
  253. flag: true,
  254. operation: [
  255. {
  256. name: "编辑",
  257. function: () => {
  258. this.EditForm();
  259. },
  260. },
  261. {
  262. name: "删除",
  263. function: () => {
  264. this.showDetail();
  265. },
  266. },
  267. ],
  268. };
  269. },
  270. computed: {
  271. // 表格总页数
  272. totalPage() {
  273. return Math.ceil(this.sum / this.pageSize);
  274. },
  275. },
  276. methods: {
  277. EditForm: () => {
  278. alert("编辑");
  279. },
  280. showDetail: () => {
  281. alert("展示详情");
  282. },
  283. /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗; */
  284. toggleModal: function () {
  285. this.showModal = !this.showModal;
  286. },
  287. closeme: function () {
  288. this.showModal = !this.showModal;
  289. },
  290. toggleModal2: function () {
  291. this.showModal2 = !this.showModal2;
  292. },
  293. closeme2: function () {
  294. this.showModal2 = !this.showModal2;
  295. },
  296. toggleModal3: function () {
  297. this.showModal3 = !this.showModal3;
  298. },
  299. closeme3: function () {
  300. this.showModal3 = !this.showModal3;
  301. },
  302. toggleModal4: function () {
  303. this.showModal4 = !this.showModal4;
  304. },
  305. closeme4: function () {
  306. this.showModal4 = !this.showModal4;
  307. },
  308. editTitle: function (val) {
  309. this.dataset_title = new Array(val);
  310. console.log("inEditTitle:", this.dataset_title);
  311. },
  312. /* add: function () {
  313. this.myData.push({
  314. username: this.username,
  315. age: this.age,
  316. });
  317. (this.username = ""), (this.age = "");
  318. }, */
  319. toDel: function (n) {
  320. console.log("inToDel:", n, this.sonConsfirmFlag);
  321. // if (this.sonConsfirmFlag) {
  322. //清空数据
  323. if (n == -2) {
  324. this.tableData = "";
  325. }
  326. //清空某一项数据
  327. {
  328. let obj = this.tableData[n];
  329. console.log(obj);
  330. Object.keys(obj).forEach((key) => {
  331. obj[key] = "";
  332. });
  333. }
  334. // }
  335. // this.sonConsfirmFlag = false;
  336. },
  337. /* toDel2: function (flag) {
  338. this.sonConsfirmFlag = flag;
  339. console.log("inToDel2:", this.sonConsfirmFlag);
  340. }, */
  341. getIndex: function (index) {
  342. console.log("inGetIndex", index);
  343. },
  344. /* 表格翻页 */
  345. changePage: function (page) {
  346. this.currentPage = page;
  347. console.log(page);
  348. },
  349. // 点击上一页,下一页,首页,尾页
  350. jumpPage: function (item) {
  351. switch (item) {
  352. case 1:
  353. this.currentPage = 1;
  354. break;
  355. case 2:
  356. this.currentPage = this.currentPage - 1;
  357. break;
  358. case 3:
  359. this.currentPage = this.currentPage + 1;
  360. break;
  361. case 4:
  362. this.currentPage = this.totalPage;
  363. break;
  364. }
  365. console.log(this.currentPage);
  366. },
  367. },
  368. };
  369. </script>
  370. <style scoped lang="less">
  371. .contentHead {
  372. height: 55px;
  373. display: flex;
  374. align-items: center;
  375. }
  376. .contentHead span {
  377. margin-right: 15px;
  378. }
  379. .tableBox {
  380. width: 1030px;
  381. overflow-y: hidden;
  382. }
  383. .tableBox {
  384. text-align: center;
  385. .table {
  386. table-layout: fixed;
  387. background-color: #fff;
  388. border-collapse: collapse;
  389. border: none;
  390. td {
  391. border: 1px solid #ccc;
  392. }
  393. span {
  394. &:hover {
  395. cursor: pointer;
  396. }
  397. }
  398. }
  399. }
  400. .table_gray {
  401. background-color: #00549f;
  402. }
  403. .tableBox table{
  404. border-collapse: collapse;
  405. border: 0px;
  406. }
  407. .tableBox table td {
  408. border: 1px solid #ccc;
  409. border-right: 0px;
  410. border-bottom: 0px;
  411. text-overflow: ellipsis;
  412. overflow: hidden;
  413. white-space: nowrap;
  414. }
  415. // 表头样式
  416. .theadStyle tr td {
  417. color: white;
  418. }
  419. .tableHeadStyle1 {
  420. background: #848484;
  421. height: 30px;
  422. color: #fff;
  423. display: flex;
  424. align-items: center;
  425. }
  426. .tableHeadStyle1 td {
  427. width: 100%;
  428. padding: 7px 5px;
  429. }
  430. .tableHeadStyle2 {
  431. background: #848484;
  432. height: 30px;
  433. color: #fff;
  434. display: flex;
  435. align-items: center;
  436. }
  437. .tableHeadStyle2 td {
  438. width: 60px;
  439. padding: 7px 5px;
  440. }
  441. .tableHeadStyle2 td:nth-child(10) {
  442. width: 100px;
  443. padding: 7px 5px;
  444. }
  445. .tableHeadStyle2 td:nth-child(11) {
  446. width: 100px;
  447. padding: 7px 5px;
  448. }
  449. .tableHeadStyle2 td:nth-child(12) {
  450. width: 100px;
  451. padding: 7px 5px;
  452. }
  453. .tableHeadStyle2 td:nth-child(2) {
  454. width: 100px;
  455. padding: 7px 5px;
  456. }
  457. .tableHeadStyle2 td:nth-child(3) {
  458. width: 100px;
  459. padding: 7px 5px;
  460. }
  461. .bodyStyle {
  462. display: block;
  463. background-color: #fff;
  464. }
  465. .bodyStyle tr > td:nth-last-child(2) {
  466. color: #0000ff;
  467. }
  468. .bodyContent td {
  469. background-color: #fff;
  470. height: 20px;
  471. }
  472. .operationStyle {
  473. color: #0000ff;
  474. display: flex;
  475. justify-content: space-around;
  476. }
  477. .operationStyle span {
  478. color: #0000ff;
  479. }
  480. .fileOperation {
  481. display: flex;
  482. justify-content: flex-start;
  483. margin: 10px;
  484. align-items: center;
  485. }
  486. .fileOperation button{
  487. border-radius: 4px;
  488. }
  489. .timeLimitStyle {
  490. padding: 10px;
  491. }
  492. .modal-backdrop {
  493. position: fixed;
  494. top: 0;
  495. right: 0;
  496. bottom: 0;
  497. left: 0;
  498. background-color: rgba(0, 0, 0, 0.3);
  499. display: flex;
  500. justify-content: center;
  501. align-items: center;
  502. }
  503. .modal {
  504. background-color: #ffffff;
  505. box-shadow: 2px 2px 20px 1px;
  506. overflow-x: auto;
  507. display: flex;
  508. flex-direction: column;
  509. width: 500px;
  510. border-radius: 0px;
  511. height: 230px;
  512. }
  513. .modal-footer {
  514. border-top: 1px solid #eee;
  515. position: relative;
  516. top: 124px;
  517. left: 232px;
  518. width: 208px;
  519. display: flex;
  520. justify-content: space-between;
  521. padding: 0px;
  522. }
  523. .modal-footer button {
  524. border-radius: 4px;
  525. margin-left: 0px;
  526. width: 80px;
  527. font-size: 14px;
  528. }
  529. .modal-footer button:nth-child(1) {
  530. background-color: #0056a0;
  531. }
  532. .modal-footer button:nth-child(2) {
  533. background-color: #eeeeee;
  534. }
  535. .modal-body {
  536. position: relative;
  537. top: 64px;
  538. margin-left: 50px;
  539. padding: 0px;
  540. }
  541. .btn-close,
  542. .btn-confirm {
  543. margin-left: 16px;
  544. width: 56px;
  545. height: 36px;
  546. border: none;
  547. cursor: pointer;
  548. }
  549. .btn-close {
  550. color: #313131;
  551. background-color: gray;
  552. }
  553. .btn-confirm {
  554. color: #fff;
  555. background-color: #2d8cf0;
  556. }
  557. .bodyRow {
  558. font-size: 16px;
  559. font-family: Arial;
  560. }
  561. /* .tablePageStyle{
  562. position: relative;
  563. left: 266px;
  564. } */
  565. .pageBottom{
  566. display: flex;
  567. justify-content: space-between;
  568. align-items: center;
  569. }
  570. </style>