UploadLink.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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="tableHeadStyle2 bodyContent"
  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 @click="toDel(index)">删除</span> -->
  65. <span
  66. @click="
  67. toggleModal2();
  68. getIndex(index);nowIndex=index
  69. "
  70. >删除</span
  71. >
  72. <!-- <Modal2
  73. v-show="showModal2"
  74. v-on:closeme2="closeme2"
  75. v-on:del="toDel2"
  76. :itemIndex="index"
  77. ></Modal2> -->
  78. <div class="modal-backdrop" v-show="showModal2">
  79. <div class="modal">
  80. <div class="modal-body">
  81. <div class="bodyRow">确认删除?</div>
  82. </div>
  83. <div class="modal-footer">
  84. <button type="button" class="btn-confirm" @click="toDel(nowIndex);closeme2()">
  85. 确认
  86. </button>
  87. <button type="button" class="btn-close" @click="closeme2">
  88. 取消
  89. </button>
  90. </div>
  91. </div>
  92. </div>
  93. </td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. </div>
  98. <Modal
  99. v-show="showModal"
  100. v-on:closeme="closeme"
  101. :dataset_title="tableData.articleTitle"
  102. @update="editTitle"
  103. ></Modal>
  104. <div class="timeLimitStyle">
  105. <span>仅可对上传时间为{{ feedbackTimeLimit }}个月内的资料进行反馈</span>
  106. </div>
  107. <div class="fileOperation">
  108. <span class="operationStyle">导入模板</span>
  109. <button>导入</button>
  110. <button>导出</button>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import Modal from "../../components/Modal";
  116. /* import Modal2 from "../../components/Modal2"; */
  117. export default {
  118. props: {
  119. isManufacturer: {
  120. type: String,
  121. default: "distributor",
  122. },
  123. },
  124. components: {
  125. Modal,
  126. /* Modal2, */
  127. },
  128. data() {
  129. return {
  130. feedbackTimeLimit: 6,
  131. showModal: false,
  132. showModal2: false,
  133. sonConsfirmFlag: false,
  134. // 表格配置
  135. sum: 240, // 一共有多少条数据
  136. pageSize: 20, // 每页展示的数据
  137. discolor: false, // 是否隔行变色
  138. currentPage: 1,
  139. /* tableHeader: [
  140. "NO.",
  141. "DLR Code",
  142. "经销商名称",
  143. "所属区域",
  144. "发布日期",
  145. "资料名称",
  146. "反馈日期",
  147. "发布平台",
  148. "发布版块",
  149. "项目分类",
  150. ], */
  151. tableHeader: [
  152. "NO.",
  153. "发布日期",
  154. "资料名称",
  155. "车系",
  156. "车型",
  157. "发布版块",
  158. "项目分类",
  159. "内容分类1",
  160. "内容分类2",
  161. "标题",
  162. "链接",
  163. "操作",
  164. ],
  165. tableData: [
  166. {
  167. releaseTime: "2021/03/04",
  168. dataName: "雷克萨斯ES上市",
  169. carSeries: "雷克萨斯ES",
  170. carType: "ES雷克萨斯",
  171. releaseMedia: "S雷克萨斯",
  172. // releasePlate: " ",
  173. projectClass: "东区",
  174. draftGenre: "雷克萨斯ES",
  175. contentClass: "ES雷克萨斯",
  176. articleTitle: "S雷克萨斯",
  177. articleLink: "d",
  178. },
  179. {
  180. releaseTime: "2021/03/04",
  181. dataName: "雷克萨斯ES上市",
  182. carSeries: "雷克萨斯ES",
  183. carType: "ES雷克萨斯",
  184. releaseMedia: "S雷克萨斯",
  185. // releasePlate: " ",
  186. projectClass: "东区",
  187. draftGenre: "雷克萨斯ES",
  188. contentClass: "ES雷克萨斯",
  189. articleTitle: "S雷克萨斯",
  190. articleLink: "d",
  191. },
  192. {
  193. releaseTime: "",
  194. dataName: "",
  195. carSeries: "",
  196. carType: "",
  197. releaseMedia: "",
  198. // releasePlate: " ",
  199. projectClass: "",
  200. draftGenre: "",
  201. contentClass: "",
  202. articleTitle: "",
  203. articleLink: "",
  204. },
  205. {
  206. releaseTime: "",
  207. dataName: "",
  208. carSeries: "",
  209. carType: "",
  210. releaseMedia: "",
  211. // releasePlate: " ",
  212. projectClass: "",
  213. draftGenre: "",
  214. contentClass: "",
  215. articleTitle: "",
  216. articleLink: "",
  217. },
  218. ],
  219. flag: true,
  220. operation: [
  221. {
  222. name: "编辑",
  223. function: () => {
  224. this.EditForm();
  225. },
  226. },
  227. {
  228. name: "删除",
  229. function: () => {
  230. this.showDetail();
  231. },
  232. },
  233. ],
  234. };
  235. },
  236. methods: {
  237. EditForm: () => {
  238. alert("编辑");
  239. },
  240. showDetail: () => {
  241. alert("展示详情");
  242. },
  243. toggleModal: function () {
  244. this.showModal = !this.showModal;
  245. },
  246. closeme: function () {
  247. this.showModal = !this.showModal;
  248. },
  249. toggleModal2: function () {
  250. this.showModal2 = !this.showModal2;
  251. },
  252. closeme2: function () {
  253. this.showModal2 = !this.showModal2;
  254. },
  255. editTitle: function (val) {
  256. this.dataset_title = new Array(val);
  257. console.log("inEditTitle:", this.dataset_title);
  258. },
  259. /* add: function () {
  260. this.myData.push({
  261. username: this.username,
  262. age: this.age,
  263. });
  264. (this.username = ""), (this.age = "");
  265. }, */
  266. toDel: function (n) {
  267. console.log("inToDel:", n, this.sonConsfirmFlag);
  268. // if (this.sonConsfirmFlag) {
  269. //清空数据
  270. if (n == -2) {
  271. this.tableData = "";
  272. }
  273. //清空某一项数据
  274. {
  275. let obj = this.tableData[n];
  276. console.log(obj);
  277. Object.keys(obj).forEach((key) => {
  278. obj[key] = "";
  279. });
  280. }
  281. // }
  282. // this.sonConsfirmFlag = false;
  283. },
  284. /* toDel2: function (flag) {
  285. this.sonConsfirmFlag = flag;
  286. console.log("inToDel2:", this.sonConsfirmFlag);
  287. }, */
  288. getIndex: function (index) {
  289. console.log("inGetIndex", index);
  290. },
  291. },
  292. };
  293. </script>
  294. <style scoped lang="less">
  295. .contentHead {
  296. height: 55px;
  297. display: flex;
  298. align-items: center;
  299. }
  300. .contentHead span {
  301. margin-right: 15px;
  302. }
  303. .tableBox {
  304. width: 1030px;
  305. overflow: auto;
  306. }
  307. .tableBox {
  308. text-align: center;
  309. .table {
  310. table-layout: fixed;
  311. background-color: #fff;
  312. border-collapse: collapse;
  313. border: none;
  314. td {
  315. border: 1px solid #ccc;
  316. }
  317. span {
  318. &:hover {
  319. cursor: pointer;
  320. }
  321. }
  322. }
  323. }
  324. .table_gray {
  325. background: #f5f5f5;
  326. }
  327. .tableBox table td {
  328. border: 1px solid #ccc;
  329. text-overflow: ellipsis;
  330. overflow: hidden;
  331. white-space: nowrap;
  332. }
  333. // 表头样式
  334. .theadStyle tr td {
  335. color: white;
  336. }
  337. .tableHeadStyle1 {
  338. background: #848484;
  339. height: 30px;
  340. color: #fff;
  341. display: flex;
  342. align-items: center;
  343. }
  344. .tableHeadStyle1 td {
  345. width: 100%;
  346. padding: 7px 5px;
  347. }
  348. .tableHeadStyle2 {
  349. background: #848484;
  350. height: 30px;
  351. color: #fff;
  352. display: flex;
  353. align-items: center;
  354. }
  355. .tableHeadStyle2 td {
  356. width: 60px;
  357. padding: 7px 5px;
  358. }
  359. .tableHeadStyle2 td:nth-child(10) {
  360. width: 100px;
  361. padding: 7px 5px;
  362. }
  363. .tableHeadStyle2 td:nth-child(11) {
  364. width: 100px;
  365. padding: 7px 5px;
  366. }
  367. .tableHeadStyle2 td:nth-child(12) {
  368. width: 100px;
  369. padding: 7px 5px;
  370. }
  371. .tableHeadStyle2 td:nth-child(2) {
  372. width: 100px;
  373. padding: 7px 5px;
  374. }
  375. .tableHeadStyle2 td:nth-child(3) {
  376. width: 100px;
  377. padding: 7px 5px;
  378. }
  379. .bodyStyle {
  380. display: block;
  381. background-color: #fff;
  382. }
  383. .bodyContent td {
  384. background-color: #fff;
  385. height: 17px;
  386. }
  387. .operationStyle {
  388. color: #0000ff;
  389. display: flex;
  390. justify-content: space-around;
  391. }
  392. .operationStyle span {
  393. color: #0000ff;
  394. }
  395. .fileOperation {
  396. display: flex;
  397. justify-content: flex-start;
  398. margin: 10px;
  399. align-items: center;
  400. }
  401. .timeLimitStyle {
  402. padding: 10px;
  403. }
  404. .modal-backdrop {
  405. position: fixed;
  406. top: 0;
  407. right: 0;
  408. bottom: 0;
  409. left: 0;
  410. background-color: rgba(0, 0, 0, 0.3);
  411. display: flex;
  412. justify-content: center;
  413. align-items: center;
  414. }
  415. .modal {
  416. background-color: #eeeeee;
  417. box-shadow: 2px 2px 20px 1px;
  418. overflow-x: auto;
  419. display: flex;
  420. flex-direction: column;
  421. border-radius: 16px;
  422. width: 1030px;
  423. }
  424. .modal-header {
  425. border-bottom: 1px solid #eee;
  426. color: #313131;
  427. justify-content: space-between;
  428. padding: 15px;
  429. display: flex;
  430. }
  431. .modal-footer {
  432. border-top: 1px solid #eee;
  433. justify-content: center;
  434. padding: 15px;
  435. display: flex;
  436. }
  437. .modal-body {
  438. position: relative;
  439. padding: 20px 150px 20px 150px;
  440. }
  441. .btn-close,
  442. .btn-confirm {
  443. border-radius: 8px;
  444. margin-left: 16px;
  445. width: 56px;
  446. height: 36px;
  447. border: none;
  448. cursor: pointer;
  449. }
  450. .btn-close {
  451. color: #313131;
  452. background-color: gray;
  453. }
  454. .btn-confirm {
  455. color: #fff;
  456. background-color: #2d8cf0;
  457. }
  458. .bodyRow {
  459. display: flex;
  460. justify-content: flex-start;
  461. align-items: center;
  462. }
  463. </style>