adPlaceList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. <template>
  2. <!-- 广告位管理 -->
  3. <div>
  4. <!-- 头部搜索框部分 -->
  5. <div class="title">
  6. <el-row>
  7. <el-col :span="6" class="left">
  8. <div class="searchBox">
  9. <div class="searchTitle">网站名称</div>
  10. <el-select v-model="webSiteName_id" :multiple="false" :multiple-limit="1" filterable remote
  11. reserve-keyword placeholder="请输入网站名称" clearable :remote-method="getWebNavList"
  12. :loading="webSiteLoading" @change="selectWebSite">
  13. <el-option v-for="item in webSiteList" :key="item.value" :label="item.label"
  14. :value="item.value">
  15. </el-option>
  16. </el-select>
  17. </div>
  18. </el-col>
  19. <el-col :span="6" class="left">
  20. <div class="searchBox">
  21. <div class="searchTitle">广告位名称</div>
  22. <el-input v-model="adPlaceName" class="input" clearable placeholder="请输入广告位名称"></el-input>
  23. </div>
  24. </el-col>
  25. <el-col :span="8" class="right">
  26. <div class="btnList">
  27. <button class="search" @click="goSearch">搜索</button>
  28. <button class="reset" @click="goReset">重置</button>
  29. </div>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. <!--表格内容 start------------------------------------------------------------>
  34. <div class="layerBox">
  35. <tableTitle :name="tableDivTitle" />
  36. <button class="btn" @click="addWebsite">添加广告位</button>
  37. <el-row>
  38. <template>
  39. <el-table class="my-table" v-loading="loading" :data="tableData" style="width: 100%">
  40. <el-table-column fixed prop="id" label="编号" width="90">
  41. </el-table-column>
  42. <el-table-column prop="website_name" label="网站名称" width="160">
  43. </el-table-column>
  44. <el-table-column prop="name" label="广告位名称" width="220">
  45. </el-table-column>
  46. <el-table-column prop="type_name" label="广告类型" width="130">
  47. </el-table-column>
  48. <el-table-column prop="size" label="宽/高 (PX)" width="140">
  49. </el-table-column>
  50. <el-table-column prop="price" label="价格 (天)" width="130">
  51. </el-table-column>
  52. <el-table-column prop="created_at" label="创建时间" width="220">
  53. </el-table-column>
  54. <el-table-column prop="updated_at" label="修改时间" width="220">
  55. </el-table-column>
  56. <el-table-column fixed="right" label="操作" width="200">
  57. <template slot-scope="scope">
  58. <div class="listBtnBox">
  59. <div class="listEditBtn" @click="goEdit(scope.row.id, scope.row)"><i
  60. class="el-icon-edit-outline"></i>编辑</div>
  61. <div class="listLookBtn" @click="goLook(scope.row.id)"><i
  62. class="el-icon-view"></i>查看</div>
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <!-- <el-table-column prop="created_at" label="创建时间" width="190">
  67. </el-table-column>
  68. <el-table-column prop="updated_at" label="修改时间" width="190">
  69. </el-table-column> -->
  70. <!-- <el-table-column fixed="right" label="操作" width="300">
  71. <template slot-scope="scope">
  72. <div class="listBtnBox">
  73. <div class="listDeleteBtn" @click="deleteRow(scope.row.id)"><i
  74. class="el-icon-delete"></i>删除</div>
  75. <div class="listEditBtn" @click="goEdit(scope.row.id, scope.row)"><i
  76. class="el-icon-edit-outline"></i>编辑</div>
  77. <div class="listLookBtn" @click="goLook(scope.row.id)"><i
  78. class="el-icon-view"></i>查看</div>
  79. </div>
  80. </template>
  81. </el-table-column> -->
  82. </el-table>
  83. </template>
  84. </el-row>
  85. </div>
  86. <!--分页 start------------------------------------------------------------>
  87. <div class="alignBox">
  88. <el-row>
  89. <el-col :span="24">
  90. <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
  91. :current-page="page" :page-size="pageSize" layout="total, prev, pager, next, jumper"
  92. :total="total">
  93. </el-pagination>
  94. </el-col>
  95. </el-row>
  96. </div>
  97. <!--分页 end------------------------------------------------------------>
  98. <!--表格内容 end------------------------------------------------------------>
  99. <!-- 弹出框 编辑 start----------------------------------------------------------->
  100. <el-dialog :title="dialogName" :visible.sync="dialogTableVisible" width="50%" top="8vh"
  101. :close-on-click-modal="false">
  102. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  103. <div class="dialogText">
  104. <el-form-item label="网站名称:" prop="webName">
  105. <el-select v-model="ruleForm.webName" :multiple="false" :multiple-limit="1" filterable remote
  106. reserve-keyword placeholder="请输入网站名称" :remote-method="getWebNavList"
  107. :loading="webSiteLoading" @change="detectionWebSite">
  108. <el-option v-for="item in webSiteList" :key="item.value" :label="item.label"
  109. :value="item.value">
  110. </el-option>
  111. </el-select>
  112. </el-form-item>
  113. <el-form-item label="广告位名称:" prop="adName">
  114. <el-input v-model="ruleForm.adName" placeholder="请输入广告位名称"></el-input>
  115. </el-form-item>
  116. <el-form-item label="广告位标识:" prop="adTag">
  117. <el-input v-model="ruleForm.adTag" placeholder="请输入广告位标识"></el-input>
  118. </el-form-item>
  119. <el-form-item label="广告位介绍:" prop="adDesc">
  120. <el-input v-model="ruleForm.adDesc" type="textarea" :rows="2" placeholder="请输入广告位介绍"
  121. resize="none">
  122. </el-input>
  123. </el-form-item>
  124. <el-form-item label="广告示例图:" prop="adPhoto" :label-width="formLabelWidth"
  125. :class="['custom-form-item']" class="custom-align-right">
  126. <div class="uploaderBox">
  127. <!--图片上传组件 start ------------------------------------------------------------>
  128. <div class="avatar-upload-container" @mouseenter="hovering = true"
  129. @mouseleave="hovering = false">
  130. <!-- 上传组件 -->
  131. <el-upload class="avatar-uploader" action="#" :show-file-list="false"
  132. :before-upload="beforeAvatarUpload">
  133. <!-- 预览图片 -->
  134. <img v-if="logoUrl" :src="logoUrl" class="avatar">
  135. <div v-else class="chooseImgDiv">
  136. <div>
  137. <img src="@/assets/public/upload/noImage.png">
  138. <div>选择图片</div>
  139. </div>
  140. </div>
  141. <input type="hidden" name="logo" v-model="ruleForm.adPhoto">
  142. </el-upload>
  143. <!-- 删除按钮,当鼠标悬浮时显示 -->
  144. <div v-if="hovering && logoUrl" class="delete-button" @click="handleDelete">
  145. <i class="el-icon-delete"></i>
  146. </div>
  147. </div>
  148. <!--图片上传组件 end ------------------------------------------------------------>
  149. </div>
  150. </el-form-item>
  151. <el-form-item label="广告类型:" prop="adType">
  152. <el-radio v-model="ruleForm.adType" label='2'>图片</el-radio>
  153. </el-form-item>
  154. <el-form-item label="广告位大小:" prop="adSize">
  155. <el-select v-model="ruleForm.adSize" placeholder="请选择广告位大小" @change="change">
  156. <el-option v-for="item in options" :key="item.id" :label="item.size" :value="item.id">
  157. </el-option>
  158. </el-select>
  159. </el-form-item>
  160. <el-form-item label="价格:" prop="price">
  161. <el-input v-model="ruleForm.price" placeholder="请输入价格"></el-input>
  162. </el-form-item>
  163. <el-form-item label="状态:" prop="status">
  164. <el-radio v-model="ruleForm.status" label="1">通过</el-radio>
  165. <el-radio v-model="ruleForm.status" label="2">下架</el-radio>
  166. </el-form-item>
  167. </div>
  168. <div class="dialogBtn">
  169. <!-- <button class="cancel" @click="cancelForm">取消</button>
  170. <button class="submit" @click="submitForm">提交</button> -->
  171. <el-button type="info" @click="cancelForm">取消</el-button>
  172. <el-button type="primary" @click="submitForm">提交</el-button>
  173. </div>
  174. </el-form>
  175. </el-dialog>
  176. <!-- 弹出框 编辑 end----------------------------------------------------------->
  177. </div>
  178. </template>
  179. <script>
  180. //表格标题
  181. import tableTitle from './components/tableTitle.vue';
  182. //引入公用样式
  183. import '@/styles/global.less';
  184. import { createAdPlace, getAdPlaceList, delAdPlace, updateAdPlace, getAdList, getAdPlaceInfo, getSize } from '@/api/advertise'
  185. export default {
  186. components: {
  187. tableTitle,//表格标题-
  188. },
  189. data() {
  190. const validateEmpty = (rule, value, callback) => {
  191. if (value.length == 0) {
  192. callback(new Error('该项不能为空!'))
  193. } else {
  194. callback()
  195. }
  196. }
  197. return {
  198. tableDivTitle: "广告列表", //列表标题
  199. dialogTableVisible: false, //编辑弹框
  200. dialogName: '编辑', //编辑弹窗名称
  201. loading: true, //加载中
  202. tableData: [],//表格数据
  203. // 可以输入的搜索框相关
  204. webSiteList: [],//获取关联网站列表
  205. webSiteLoading: false,
  206. //3.4 上传logo图片
  207. logoUrl: '',
  208. hovering: false, // 鼠标悬浮状态 悬浮时显示删除
  209. value: '',
  210. //活动id
  211. activeid: "",
  212. // 分页相关
  213. page: 1,
  214. pageSize: 10,
  215. total: 0,
  216. options: [], //广告尺寸
  217. formLabelWidth: '', //广告示例图相关
  218. // 搜索框相关
  219. webSiteName_id: '', //网站名称id
  220. adPlaceName: '', //广告位名称
  221. website_id: "", //网站id
  222. ruleForm: {
  223. webName: '', //网站名称
  224. adName: '', //广告位名称
  225. adTag: '', //广告位标识
  226. adDesc: '',//广告位介绍
  227. adPhoto: '', //广告示例图
  228. adType: '',//广告类型
  229. adSize: '', //广告位大小
  230. ad_size_id: 1, //广告位大小
  231. price: '', //价格
  232. status: '', //状态
  233. },
  234. rules: {
  235. webName: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  236. adName: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  237. adTag: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  238. adDesc: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  239. adPhoto: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  240. adType: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  241. adSize: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  242. price: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  243. status: [{ required: true, trigger: 'blur', validator: validateEmpty }],
  244. }
  245. }
  246. },
  247. methods: {
  248. //1.列表和分页相关 start ------------------------------------------------------------>
  249. //1.1 开始请求列表信息方法
  250. getData() {
  251. if (this.adPlaceName !== '' || this.webSiteName_id !== '') {
  252. getAdPlaceList({
  253. page: this.page,
  254. pageSize: this.pageSize,
  255. name: this.adPlaceName,
  256. website_id: this.webSiteName_id, //广告位名称 id
  257. }).then(data => {
  258. console.log(data);
  259. this.tableData = data.data.rows
  260. this.total = data.data.count
  261. for (let item of this.tableData) {
  262. item.size = item.width + 'x' + item.height
  263. if (item.typeid == 2) {
  264. item.type_name = '图文'
  265. } else if (item.typeid == 1) {
  266. item.type_name = '文字'
  267. }
  268. }
  269. })
  270. } else {
  271. getAdPlaceList({
  272. page: this.page,
  273. pageSize: this.pageSize
  274. }).then(data => {
  275. this.loading = false
  276. console.log(data.data.rows);
  277. this.tableData = data.data.rows
  278. this.total = data.data.count
  279. for (let item of this.tableData) {
  280. item.size = item.width + 'x' + item.height
  281. if (item.typeid == 2) {
  282. item.type_name = '图文'
  283. } else if (item.typeid == 1) {
  284. item.type_name = '文字'
  285. }
  286. }
  287. })
  288. }
  289. },
  290. //获取广告尺寸
  291. getSize() {
  292. getSize().then(data => {
  293. console.log(data.data);
  294. this.options = data.data
  295. for (let item of this.options) {
  296. item.size = item.width + 'x' + item.height
  297. }
  298. console.log(this.options);
  299. })
  300. },
  301. change(val) {
  302. console.log('val1111111111', val);
  303. this.ruleForm.ad_size_id = val
  304. console.log('this.ruleForm.adSize', this.ruleForm.adSize);
  305. },
  306. //1.2 删除内容
  307. deleteRow(id) {
  308. console.log(id);
  309. let data = new FormData()
  310. data.append('id', id)
  311. this.$confirm('注意:删除后,该条信息及其绑定关系全部删除', '是否确认删除该条信息?', {
  312. confirmButtonText: '确定',
  313. cancelButtonText: '取消',
  314. }).then(() => {
  315. console.log("当前删除:" + id)
  316. delAdPlace({
  317. id: id
  318. }).then(data => {
  319. console.log(data);
  320. if (data.code = 200) {
  321. this.$message({
  322. message: '删除成功',
  323. type: 'success'
  324. })
  325. this.getData()
  326. } else if (data.code == 0) {
  327. this.$message({
  328. message: data.message,
  329. type: 'error'
  330. })
  331. }
  332. })
  333. }).catch(() => {
  334. this.$message({
  335. type: 'warning',
  336. message: '已取消删除'
  337. });
  338. });
  339. },
  340. //1.3 查看示例图
  341. // goGraph() {
  342. // this.dialogVisible = true
  343. // },
  344. //1.4 列表内容分页
  345. //直接跳转
  346. handleSizeChange(val) {
  347. this.page = val;
  348. this.getData();
  349. },
  350. //1.5 点击分页
  351. handleCurrentChange(val) {
  352. this.page = val;
  353. this.getData();
  354. },
  355. // 1.6 搜索按钮
  356. goSearch() {
  357. getAdPlaceList({
  358. page: this.page,
  359. pageSize: this.pageSize,
  360. name: this.adPlaceName,
  361. website_id: this.webSiteName_id, //广告位名称 id
  362. }).then(data => {
  363. console.log(data);
  364. this.tableData = data.data.rows
  365. this.total = data.data.count
  366. for (let item of this.tableData) {
  367. item.size = item.width + 'x' + item.height
  368. if (item.typeid == 2) {
  369. item.type_name = '图文'
  370. } else if (item.typeid == 1) {
  371. item.type_name = '文字'
  372. }
  373. }
  374. })
  375. },
  376. //1.7 重置按钮
  377. goReset() {
  378. this.webSiteName_id = ""
  379. this.adPlaceName = ""
  380. this.getData()
  381. },
  382. //列表和分页相关 end ------------------------------------------------------------>
  383. //1.8 编辑
  384. goEdit(id, val) {
  385. // console.log(id);
  386. this.dialogName = '编辑'
  387. this.activeid = id
  388. this.dialogTableVisible = true
  389. console.log(id, val);
  390. // console.log("状态", val.status);
  391. //数据回显
  392. this.website_id = val.website_id
  393. this.ruleForm.webName = val.website_name //网站名称
  394. this.ruleForm.adName = val.name //广告位名称
  395. this.ruleForm.adDesc = val.introduce //广告位介绍
  396. this.logoUrl = val.thumb //广告示例图
  397. this.ruleForm.adPhoto = val.thumb //广告示例图
  398. this.ruleForm.price = val.price //价格
  399. this.ruleForm.status = val.status //状态
  400. // this.ad_size_id=val.ad_size_id
  401. if (val.ad_size_id == 1) {
  402. this.ruleForm.adSize = '1200x90' //广告位大小
  403. } else if (val.ad_size_id == 2) {
  404. this.ruleForm.adSize = '420x560' //广告位大小
  405. }
  406. if (val.typeid == 2) {
  407. this.ruleForm.adType = '2' //广告类型
  408. }
  409. if (val.status == 1) {
  410. this.ruleForm.status = '1' //状态
  411. } else if (val.status == 2) {
  412. this.ruleForm.status = '2' //状态
  413. }
  414. },
  415. //1.9 查看
  416. goLook(id) {
  417. this.activeid = id
  418. this.$router.push({
  419. path: '/adPlaceDetail',
  420. query: {
  421. id: this.activeid
  422. }
  423. })
  424. },
  425. //2.0 添加
  426. addWebsite() {
  427. this.dialogTableVisible = true
  428. this.dialogName = "添加"
  429. //添加时清空回显回来的数据
  430. this.ruleForm.webName = '' //网站名称
  431. this.ruleForm.adName = '' //广告位名称
  432. this.ruleForm.adTag = '' //广告位标识
  433. this.ruleForm.adDesc = '' //广告位介绍
  434. this.ruleForm.adPhoto = '' //广告示例图
  435. this.ruleForm.adSize = '' //广告尺寸
  436. this.ruleForm.adType = '2' //广告类型
  437. this.ruleForm.price = '' //价格
  438. this.ruleForm.status = '' //状态
  439. this.logoUrl = ''
  440. },
  441. // 2.1 弹出层相关方法
  442. // 提交表单
  443. submitForm() {
  444. // 判断用户是否输入数据
  445. if (this.ruleForm.webName == '') {
  446. this.$message({
  447. message: '请将数据填写完整',
  448. type: 'error'
  449. })
  450. return
  451. }
  452. if (this.ruleForm.adTag == '') {
  453. this.$message({
  454. message: '请将数据填写完整',
  455. type: 'error'
  456. })
  457. return
  458. }
  459. if (this.dialogName == "添加") {
  460. createAdPlace({
  461. name: this.ruleForm.adName,
  462. website_id: this.website_id,
  463. ad_tag: this.ruleForm.adTag,
  464. price: this.ruleForm.price,
  465. thumb: this.ruleForm.adPhoto,
  466. typeid: this.ruleForm.adType,
  467. ad_size_id: this.ruleForm.adSize,
  468. status: this.ruleForm.status,
  469. introduce: this.ruleForm.adDesc,
  470. }).then(data => {
  471. console.log(data);
  472. if (data.code == 200) {
  473. this.$message({
  474. message: '添加成功',
  475. type: 'success'
  476. })
  477. this.dialogTableVisible = false
  478. this.getData()
  479. } else if (data.code == 0) {
  480. this.$message({
  481. message: data.message,
  482. type: 'error'
  483. })
  484. this.dialogTableVisible = true
  485. return
  486. } else {
  487. this.$message({
  488. message: data.message,
  489. type: 'error'
  490. })
  491. this.dialogTableVisible = true
  492. return
  493. }
  494. })
  495. }
  496. if (this.website_id == '') {
  497. this.$message({
  498. message: '请输入并选择网站名称',
  499. type: 'error'
  500. })
  501. this.dialogVisible = true
  502. }
  503. if (this.ruleForm.adTag == '') {
  504. this.$message({
  505. message: '请将数据填写完整',
  506. type: 'error'
  507. })
  508. return
  509. }
  510. if (this.dialogName == "编辑") {
  511. updateAdPlace({
  512. name: this.ruleForm.adName,
  513. website_id: this.website_id,
  514. ad_tag: this.ruleForm.adTag,
  515. price: this.ruleForm.price,
  516. thumb: this.ruleForm.adPhoto,
  517. typeid: Number(this.ruleForm.adType),
  518. ad_size_id: Number(this.ruleForm.ad_size_id),
  519. status: Number(this.ruleForm.status),
  520. introduce: this.ruleForm.adDesc,
  521. id: this.activeid
  522. }).then(data => {
  523. console.log(data);
  524. if (data.code == 200) {
  525. this.$message({
  526. message: '编辑成功',
  527. type: 'success'
  528. })
  529. this.dialogTableVisible = false
  530. }
  531. if (data.code == 0) {
  532. this.$message({
  533. message: data.message,
  534. type: 'error'
  535. })
  536. this.dialogTableVisible = true
  537. }
  538. this.getData()
  539. })
  540. }
  541. },
  542. //取消添加或编辑
  543. cancelForm() {
  544. this.dialogTableVisible = false
  545. },
  546. //3.6 上传图片操作
  547. beforeAvatarUpload(file) {
  548. const isJPG = file.type === 'image/jpeg';
  549. const isPNG = file.type === 'image/png';
  550. const isLt2M = file.size / 1024 / 1024 < 2;
  551. if (!isJPG && !isPNG) {
  552. this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
  553. return false;
  554. }
  555. if (!isLt2M) {
  556. this.$message.error('上传图片大小不能超过 2MB!');
  557. return false;
  558. }
  559. const formData = new FormData();
  560. formData.append('file', file);
  561. this.$store.dispatch('pool/uploadFile', formData).then(res => {
  562. this.logoUrl = res.data.imgUrl;//显示缩略图
  563. this.ruleForm.adPhoto = res.data.imgUrl;//提供表单地址
  564. console.log(res.data.imgUrl)
  565. }).catch(() => {
  566. this.$message({
  567. type: 'info',
  568. message: '网络错误,请重试!'
  569. });
  570. })
  571. // 阻止默认的上传行为
  572. return false;
  573. },
  574. handleDelete() {
  575. // 删除图片
  576. this.logoUrl = ''; // 清空图片 URL
  577. },
  578. //搜索部分的输入关键词下拉框
  579. selectWebSite(value) {
  580. this.webSiteName_id = value
  581. },
  582. //添加 / 编辑弹窗中输入关键词下拉框
  583. // 判断是否已经关联了网站
  584. detectionWebSite(value) {
  585. console.log(value);
  586. this.website_id = value
  587. console.log(this.website_id);
  588. },
  589. //
  590. getWebNavList(query) {
  591. if (query !== '') {
  592. this.webSiteLoading = true;
  593. let data = { keyword: query }
  594. let dataArr = [];
  595. this.$store.dispatch('pool/getNavWebList', data).then(res => {
  596. console.log(res.data)
  597. for (let item of res.data) {
  598. let data = {};
  599. data.key = item.id;
  600. data.value = item.id;
  601. data.label = item.website_name;
  602. dataArr.push(data)
  603. }
  604. this.webSiteList = dataArr;
  605. this.webSiteLoading = false;
  606. }).catch(() => {
  607. this.$message({
  608. type: 'info',
  609. message: '网络错误,请重试!'
  610. });
  611. })
  612. } else {
  613. this.navList = [];
  614. }
  615. },
  616. },
  617. mounted() {
  618. this.getData()
  619. this.getSize()
  620. },
  621. }
  622. </script>
  623. <style scoped lang="less">
  624. input[aria-hidden=true] {
  625. display: none !important;
  626. }
  627. // 提示信息
  628. .tips {
  629. margin: 30px;
  630. background-color: #e9ecf9;
  631. border-radius: 11px;
  632. .tipsIcon {
  633. margin: 10px 15px;
  634. display: inline-block;
  635. width: 24px;
  636. height: 24px;
  637. background: url("../../assets/advertise/Info Circle.png") no-repeat;
  638. vertical-align: middle;
  639. }
  640. .tipsText {
  641. font-size: 14px;
  642. color: #666666;
  643. }
  644. }
  645. // 头部
  646. .title {
  647. margin: 30px 30px 20px 30px;
  648. padding: 30px 30px 40px 30px;
  649. background-color: #fff;
  650. border-radius: 20px 20px 20px 20px;
  651. border: 1px solid #E9EDF7;
  652. .left {
  653. float: left;
  654. }
  655. .right {
  656. float: right;
  657. }
  658. .searchBox {
  659. ::v-deep .el-input {
  660. position: relative;
  661. font-size: 14px;
  662. display: inline-block;
  663. width: 80%;
  664. }
  665. .searchTitle {
  666. padding-bottom: 10px;
  667. font-family: Microsoft YaHei, Microsoft YaHei;
  668. font-weight: 400;
  669. font-size: 14px;
  670. color: #999999;
  671. line-height: 16px;
  672. }
  673. .el-select {
  674. width: 100%;
  675. display: inline-block;
  676. position: relative;
  677. }
  678. }
  679. .btnList {
  680. float: right;
  681. padding-top: 28px;
  682. button {
  683. height: 38px;
  684. border: none;
  685. border-radius: 8px;
  686. padding: 0 30px;
  687. }
  688. .search {
  689. background-color: #5570f1;
  690. color: #fff;
  691. margin-right: 20px;
  692. }
  693. .reset {
  694. font-family: Microsoft YaHei, Microsoft YaHei;
  695. font-weight: 400;
  696. font-size: 16px;
  697. color: #333333;
  698. background: #F5F7FB;
  699. border-radius: 8px 8px 8px 8px;
  700. border: 1px solid rgba(85, 112, 241, 0.11);
  701. }
  702. }
  703. }
  704. .layerBox {
  705. padding: 30px 20px;
  706. position: relative;
  707. .btn {
  708. position: absolute;
  709. top: 30px;
  710. right: 20px;
  711. height: 38px;
  712. color: #fff;
  713. background-color: #5570f1;
  714. border: none;
  715. border-radius: 8px;
  716. padding: 8px 28px 9px;
  717. box-sizing: border-box;
  718. }
  719. .listBtnBox {
  720. justify-content: left;
  721. }
  722. .listDeleteBtn,
  723. .listEditBtn,
  724. .listLookBtn {
  725. margin-left: 0px;
  726. padding-left: 0px;
  727. margin-right: 20px;
  728. width: 76px;
  729. height: 36px;
  730. line-height: 36px;
  731. }
  732. .listLookBtn {
  733. text-align: center;
  734. border-radius: 8px;
  735. cursor: pointer;
  736. color: #55b5f1;
  737. background-color: rgba(85, 181, 241, 0.16);
  738. >i {
  739. padding-right: 8px;
  740. }
  741. }
  742. ::v-deep .el-form-item {
  743. margin-bottom: 50px;
  744. }
  745. ::v-deep .el-select {
  746. width: 100%;
  747. }
  748. ::v-deep .el-input--medium,
  749. ::v-deep .el-form-item__label {
  750. line-height: 36px;
  751. font-size: 16px;
  752. }
  753. }
  754. // 弹出层内容
  755. .dialogText {
  756. margin: 0 7px 0 3px;
  757. padding-bottom: 1px;
  758. padding: 30px 60px 1px 20px;
  759. background-color: #f5f7fb;
  760. .adImage {
  761. width: 140px;
  762. height: 140px;
  763. line-height: 210px;
  764. border-radius: 12px;
  765. border: 1px solid rgba(85, 112, 241, 0.11);
  766. img {
  767. width: 140px;
  768. height: 80px;
  769. }
  770. }
  771. ::v-deep .avatar {
  772. width: 140px;
  773. height: auto;
  774. }
  775. .price {
  776. ::v-deep .el-input {
  777. width: 29%;
  778. }
  779. }
  780. .example {
  781. font-family: Microsoft YaHei;
  782. color: #5570F1;
  783. }
  784. .el_btnList {
  785. margin-right: 15px;
  786. margin-top: 20px;
  787. }
  788. //日期时间选择器的宽
  789. ::v-deep .el-date-editor.el-input {
  790. width: 48%;
  791. }
  792. ::v-deep .el-button+.el-button {
  793. margin-left: 0px;
  794. }
  795. ::v-deep .el-select {
  796. width: 100%;
  797. }
  798. ::v-deep .el-form-item {
  799. margin-bottom: 50px;
  800. }
  801. }
  802. // 弹出层按钮
  803. .dialogBtn {
  804. text-align: center;
  805. margin: 50px auto 20px;
  806. button {
  807. width: 184px;
  808. padding: 16px;
  809. font-family: Microsoft YaHei, Microsoft YaHei;
  810. font-weight: 400;
  811. font-size: 20px;
  812. border: none;
  813. border-radius: 12px 12px 12px 12px;
  814. }
  815. // 取消
  816. .cancel {
  817. color: #333333;
  818. background-color: #f5f7fb;
  819. border: 2px solid rgba(85, 112, 241, 0.11);
  820. }
  821. // 提交
  822. .submit {
  823. color: #fff;
  824. background-color: #5570F1;
  825. margin-left: 40px;
  826. }
  827. }
  828. //审核弹出框
  829. .radioGroup {
  830. ::v-deep .el-form-item {
  831. margin-top: 40px;
  832. margin-bottom: 0;
  833. }
  834. }
  835. .graph {
  836. background-color: #f5f7fb;
  837. padding: 60px 100px;
  838. overflow: hidden;
  839. li {
  840. float: left;
  841. }
  842. >li:first-child {
  843. margin-right: 100px;
  844. }
  845. }
  846. .dialog-footer {
  847. margin: 0 auto;
  848. }
  849. </style>