index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <template>
  2. <doc-alert title="公众号菜单" url="https://doc.iocoder.cn/mp/menu/" />
  3. <!-- 搜索工作栏 -->
  4. <ContentWrap>
  5. <WxAccountSelect @change="(accountId) => accountChanged(accountId)" />
  6. </ContentWrap>
  7. <!-- 列表 -->
  8. <ContentWrap>
  9. <div class="public-account-management clearfix" v-loading="loading">
  10. <!--左边配置菜单-->
  11. <div class="left">
  12. <div class="weixin-hd">
  13. <div class="weixin-title">{{ name }}</div>
  14. </div>
  15. <div class="weixin-menu menu_main clearfix">
  16. <div class="menu_bottom" v-for="(item, i) of menuList" :key="i">
  17. <!-- 一级菜单 -->
  18. <div @click="menuClick(i, item)" class="menu_item" :class="{ active: isActive === i }"
  19. ><Icon icon="ep:fold" color="black" />{{ item.name }}
  20. </div>
  21. <!-- 以下为二级菜单-->
  22. <div class="submenu" v-if="isSubMenuFlag === i">
  23. <div class="subtitle menu_bottom" v-for="(subItem, k) in item.children" :key="k">
  24. <div
  25. class="menu_subItem"
  26. v-if="item.children"
  27. :class="{ active: isSubMenuActive === i + '' + k }"
  28. @click="subMenuClick(subItem, i, k)"
  29. >
  30. {{ subItem.name }}
  31. </div>
  32. </div>
  33. <!-- 二级菜单加号, 当长度 小于 5 才显示二级菜单的加号 -->
  34. <div
  35. class="menu_bottom menu_addicon"
  36. v-if="!item.children || item.children.length < 5"
  37. @click="addSubMenu(i, item)"
  38. >
  39. <Icon icon="ep:plus" />
  40. </div>
  41. </div>
  42. </div>
  43. <!-- 一级菜单加号 -->
  44. <div class="menu_bottom menu_addicon" v-if="menuList.length < 3" @click="addMenu">
  45. <Icon icon="ep:plus" />
  46. </div>
  47. </div>
  48. <div class="save_div">
  49. <el-button
  50. class="save_btn"
  51. type="success"
  52. @click="handleSave"
  53. v-hasPermi="['mp:menu:save']"
  54. >保存并发布菜单</el-button
  55. >
  56. <el-button
  57. class="save_btn"
  58. type="danger"
  59. @click="handleDelete"
  60. v-hasPermi="['mp:menu:delete']"
  61. >清空菜单</el-button
  62. >
  63. </div>
  64. </div>
  65. <!--右边配置-->
  66. <div v-if="showRightFlag" class="right">
  67. <div class="configure_page">
  68. <div class="delete_btn">
  69. <el-button size="small" type="danger" @click="handleDeleteMenu(tempObj)">
  70. 删除当前菜单<Icon icon="ep:delete" />
  71. </el-button>
  72. </div>
  73. <div>
  74. <span>菜单名称:</span>
  75. <el-input
  76. class="input_width"
  77. v-model="tempObj.name"
  78. placeholder="请输入菜单名称"
  79. :maxlength="nameMaxLength"
  80. clearable
  81. />
  82. </div>
  83. <div v-if="showConfigureContent">
  84. <div class="menu_content">
  85. <span>菜单标识:</span>
  86. <el-input
  87. class="input_width"
  88. v-model="tempObj.menuKey"
  89. placeholder="请输入菜单 KEY"
  90. clearable
  91. />
  92. </div>
  93. <div class="menu_content">
  94. <span>菜单内容:</span>
  95. <el-select v-model="tempObj.type" clearable placeholder="请选择" class="menu_option">
  96. <el-option
  97. v-for="item in menuOptions"
  98. :label="item.label"
  99. :value="item.value"
  100. :key="item.value"
  101. />
  102. </el-select>
  103. </div>
  104. <div class="configur_content" v-if="tempObj.type === 'view'">
  105. <span>跳转链接:</span>
  106. <el-input
  107. class="input_width"
  108. v-model="tempObj.url"
  109. placeholder="请输入链接"
  110. clearable
  111. />
  112. </div>
  113. <div class="configur_content" v-if="tempObj.type === 'miniprogram'">
  114. <div class="applet">
  115. <span>小程序的 appid :</span>
  116. <el-input
  117. class="input_width"
  118. v-model="tempObj.miniProgramAppId"
  119. placeholder="请输入小程序的appid"
  120. clearable
  121. />
  122. </div>
  123. <div class="applet">
  124. <span>小程序的页面路径:</span>
  125. <el-input
  126. class="input_width"
  127. v-model="tempObj.miniProgramPagePath"
  128. placeholder="请输入小程序的页面路径,如:pages/index"
  129. clearable
  130. />
  131. </div>
  132. <div class="applet">
  133. <span>小程序的备用网页:</span>
  134. <el-input
  135. class="input_width"
  136. v-model="tempObj.url"
  137. placeholder="不支持小程序的老版本客户端将打开本网页"
  138. clearable
  139. />
  140. </div>
  141. <p class="blue">tips:需要和公众号进行关联才可以把小程序绑定带微信菜单上哟!</p>
  142. </div>
  143. <div class="configur_content" v-if="tempObj.type === 'article_view_limited'">
  144. <el-row>
  145. <div class="select-item" v-if="tempObj && tempObj.replyArticles">
  146. <WxNews :articles="tempObj.replyArticles" />
  147. <el-row class="ope-row" justify="center" align="middle">
  148. <el-button type="danger" circle @click="deleteMaterial">
  149. <icon icon="ep:delete" />
  150. </el-button>
  151. </el-row>
  152. </div>
  153. <div v-else>
  154. <el-row justify="center">
  155. <el-col :span="24" style="text-align: center">
  156. <el-button type="success" @click="openMaterial">
  157. 素材库选择<Icon icon="ep:circle-check" />
  158. </el-button>
  159. </el-col>
  160. </el-row>
  161. </div>
  162. <el-dialog title="选择图文" v-model="dialogNewsVisible" width="90%">
  163. <WxMaterialSelect
  164. :objData="{ type: 'news', accountId: accountId }"
  165. @select-material="selectMaterial"
  166. />
  167. </el-dialog>
  168. </el-row>
  169. </div>
  170. <div
  171. class="configur_content"
  172. v-if="tempObj.type === 'click' || tempObj.type === 'scancode_waitmsg'"
  173. >
  174. <WxReplySelect :objData="tempObj.reply" v-if="hackResetWxReplySelect" />
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- 一进页面就显示的默认页面,当点击左边按钮的时候,就不显示了-->
  180. <div v-else class="right">
  181. <p>请选择菜单配置</p>
  182. </div>
  183. </div>
  184. </ContentWrap>
  185. </template>
  186. <script setup name="MpMenu">
  187. import { handleTree } from '@/utils/tree'
  188. import WxReplySelect from '@/views/mp/components/wx-reply/main.vue'
  189. import WxNews from '@/views/mp/components/wx-news/main.vue'
  190. import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
  191. import WxAccountSelect from '@/views/mp/components/wx-account-select/main.vue'
  192. import * as MpMenuApi from '@/api/mp/menu'
  193. import menuOptions from './menuOptions'
  194. const message = useMessage() // 消息
  195. // ======================== 列表查询 ========================
  196. const loading = ref(true) // 遮罩层
  197. const accountId = ref(undefined) // 公众号Id
  198. const menuList = ref({ children: [] })
  199. // ======================== 菜单操作 ========================
  200. const isActive = ref(-1) // 一级菜单点中样式
  201. const isSubMenuActive = ref(-1) // 一级菜单点中样式
  202. const isSubMenuFlag = ref(-1) // 二级菜单显示标志
  203. // ======================== 菜单编辑 ========================
  204. const showRightFlag = ref(false) // 右边配置显示默认详情还是配置详情
  205. const nameMaxLength = ref(0) // 菜单名称最大长度;1 级是 4 字符;2 级是 7 字符;
  206. const showConfigureContent = ref(true) // 是否展示配置内容;如果有子菜单,就不显示配置内容
  207. const hackResetWxReplySelect = ref(false) // 重置 WxReplySelect 组件
  208. const tempObj = ref({}) // 右边临时变量,作为中间值牵引关系
  209. // 一些临时值放在这里进行判断,如果放在 tempObj,由于引用关系,menu 也会多了多余的参数
  210. const tempSelfObj = ref({})
  211. const dialogNewsVisible = ref(false) // 跳转图文时的素材选择弹窗
  212. /** 侦听公众号变化 **/
  213. const accountChanged = (id) => {
  214. accountId.value = id
  215. getList()
  216. }
  217. /** 查询并转换菜单 **/
  218. const getList = async () => {
  219. loading.value = false
  220. try {
  221. const data = await MpMenuApi.getMenuList(accountId.value)
  222. const menuData = convertMenuList(data)
  223. menuList.value = handleTree(menuData, 'id')
  224. } finally {
  225. loading.value = false
  226. }
  227. }
  228. /** 搜索按钮操作 */
  229. const handleQuery = () => {
  230. resetForm()
  231. getList()
  232. }
  233. // 将后端返回的 menuList,转换成前端的 menuList
  234. const convertMenuList = (list) => {
  235. if (!list) return []
  236. const menuList = []
  237. list.forEach((item) => {
  238. const menu = {
  239. ...item
  240. }
  241. if (item.type === 'click' || item.type === 'scancode_waitmsg') {
  242. delete menu.replyMessageType
  243. delete menu.replyContent
  244. delete menu.replyMediaId
  245. delete menu.replyMediaUrl
  246. delete menu.replyDescription
  247. delete menu.replyArticles
  248. menu.reply = {
  249. type: item.replyMessageType,
  250. accountId: item.accountId,
  251. content: item.replyContent,
  252. mediaId: item.replyMediaId,
  253. url: item.replyMediaUrl,
  254. title: item.replyTitle,
  255. description: item.replyDescription,
  256. thumbMediaId: item.replyThumbMediaId,
  257. thumbMediaUrl: item.replyThumbMediaUrl,
  258. articles: item.replyArticles,
  259. musicUrl: item.replyMusicUrl,
  260. hqMusicUrl: item.replyHqMusicUrl
  261. }
  262. }
  263. menuList.push(menu)
  264. })
  265. return menuList
  266. }
  267. // 重置表单,清空表单数据
  268. const resetForm = () => {
  269. // 菜单操作
  270. isActive.value = -1
  271. isSubMenuActive.value = -1
  272. isSubMenuFlag.value = -1
  273. // 菜单编辑
  274. showRightFlag.value = false
  275. nameMaxLength.value = 0
  276. showConfigureContent.value = 0
  277. hackResetWxReplySelect.value = false
  278. tempObj.value = {}
  279. tempSelfObj.value = {}
  280. dialogNewsVisible.value = false
  281. }
  282. // ======================== 菜单操作 ========================
  283. // 一级菜单点击事件
  284. const menuClick = (i, item) => {
  285. // 右侧的表单相关
  286. resetEditor()
  287. showRightFlag.value = true // 右边菜单
  288. tempObj.value = item // 这个如果放在顶部,flag 会没有。因为重新赋值了。
  289. tempSelfObj.value.grand = '1' // 表示一级菜单
  290. tempSelfObj.value.index = i // 表示一级菜单索引
  291. nameMaxLength.value = 4
  292. showConfigureContent.value = !(item.children && item.children.length > 0) // 有子菜单,就不显示配置内容
  293. // 左侧的选中
  294. isActive.value = i // 一级菜单选中样式
  295. isSubMenuFlag.value = i // 二级菜单显示标志
  296. isSubMenuActive.value = -1 // 二级菜单去除选中样式
  297. }
  298. // 二级菜单点击事件
  299. const subMenuClick = (subItem, index, k) => {
  300. // 右侧的表单相关
  301. resetEditor()
  302. showRightFlag.value = true // 右边菜单
  303. console.log(subItem)
  304. tempObj.value = subItem // 将点击的数据放到临时变量,对象有引用作用
  305. tempSelfObj.value.grand = '2' // 表示二级菜单
  306. tempSelfObj.value.index = index // 表示一级菜单索引
  307. tempSelfObj.value.secondIndex = k // 表示二级菜单索引
  308. nameMaxLength.value = 7
  309. showConfigureContent.value = true
  310. // 左侧的选中
  311. isActive.value = -1 // 一级菜单去除样式
  312. isSubMenuActive.value = index + '' + k // 二级菜单选中样式
  313. }
  314. // 添加横向一级菜单
  315. const addMenu = () => {
  316. const menuKeyLength = menuList.value.length
  317. const addButton = {
  318. name: '菜单名称',
  319. children: [],
  320. reply: {
  321. // 用于存储回复内容
  322. type: 'text',
  323. accountId: accountId.value // 保证组件里,可以使用到对应的公众号
  324. }
  325. }
  326. menuList.value[menuKeyLength] = addButton
  327. menuClick(menuKeyLength.value - 1, addButton)
  328. }
  329. // 添加横向二级菜单;item 表示要操作的父菜单
  330. const addSubMenu = (i, item) => {
  331. // 清空父菜单的属性,因为它只需要 name 属性即可
  332. if (!item.children || item.children.length <= 0) {
  333. item.children = []
  334. delete item['type']
  335. delete item['menuKey']
  336. delete item['miniProgramAppId']
  337. delete item['miniProgramPagePath']
  338. delete item['url']
  339. delete item['reply']
  340. delete item['articleId']
  341. delete item['replyArticles']
  342. // 关闭配置面板
  343. showConfigureContent.value = false
  344. }
  345. let subMenuKeyLength = item.children.length // 获取二级菜单key长度
  346. let addButton = {
  347. name: '子菜单名称',
  348. reply: {
  349. // 用于存储回复内容
  350. type: 'text',
  351. accountId: accountId.value // 保证组件里,可以使用到对应的公众号
  352. }
  353. }
  354. item.children[subMenuKeyLength] = addButton
  355. subMenuClick(item.children[subMenuKeyLength], i, subMenuKeyLength)
  356. }
  357. // 删除当前菜单
  358. const handleDeleteMenu = async () => {
  359. try {
  360. await message.confirm('确定要删除吗?')
  361. if (tempSelfObj.value.grand === '1') {
  362. // 一级菜单的删除方法
  363. menuList.value.splice(tempSelfObj.value.index, 1)
  364. } else if (tempSelfObj.value.grand === '2') {
  365. // 二级菜单的删除方法
  366. menuList.value[tempSelfObj.value.index].children.splice(tempSelfObj.value.secondIndex, 1)
  367. }
  368. // 提示
  369. message.notifySuccess('删除成功')
  370. // 处理菜单的选中
  371. tempObj.value = {}
  372. showRightFlag.value = false
  373. isActive.value = -1
  374. isSubMenuActive.value = -1
  375. } catch {}
  376. }
  377. // ======================== 菜单编辑 ========================
  378. const handleSave = async () => {
  379. try {
  380. await message.confirm('确定要删除吗?')
  381. loading.value = true
  382. await MpMenuApi.saveMenu(accountId.value, convertMenuFormList())
  383. getList()
  384. message.notifySuccess('发布成功')
  385. } finally {
  386. loading.value = false
  387. }
  388. }
  389. // 表单 Editor 重置
  390. const resetEditor = () => {
  391. hackResetWxReplySelect.value = false // 销毁组件
  392. nextTick(() => {
  393. console.log('nextTick')
  394. hackResetWxReplySelect.value = true // 重建组件
  395. })
  396. }
  397. const handleDelete = async () => {
  398. try {
  399. await message.confirm('确定要删除吗?')
  400. loading.value = true
  401. await MpMenuApi.deleteMenu(accountId.value)
  402. handleQuery()
  403. message.notifySuccess('清空成功')
  404. } finally {
  405. loading.value = false
  406. }
  407. }
  408. // 将前端的 menuList,转换成后端接收的 menuList
  409. const convertMenuFormList = () => {
  410. const result = []
  411. menuList.value.forEach((item) => {
  412. let menu = convertMenuForm(item)
  413. result.push(menu)
  414. // 处理子菜单
  415. if (!item.children || item.children.length <= 0) {
  416. return
  417. }
  418. menu.children = []
  419. item.children.forEach((subItem) => {
  420. menu.children.push(convertMenuForm(subItem))
  421. })
  422. })
  423. return result
  424. }
  425. // 将前端的 menu,转换成后端接收的 menu
  426. const convertMenuForm = (menu) => {
  427. let result = {
  428. ...menu,
  429. children: undefined, // 不处理子节点
  430. reply: undefined // 稍后复制
  431. }
  432. if (menu.type === 'click' || menu.type === 'scancode_waitmsg') {
  433. result.replyMessageType = menu.reply.type
  434. result.replyContent = menu.reply.content
  435. result.replyMediaId = menu.reply.mediaId
  436. result.replyMediaUrl = menu.reply.url
  437. result.replyTitle = menu.reply.title
  438. result.replyDescription = menu.reply.description
  439. result.replyThumbMediaId = menu.reply.thumbMediaId
  440. result.replyThumbMediaUrl = menu.reply.thumbMediaUrl
  441. result.replyArticles = menu.reply.articles
  442. result.replyMusicUrl = menu.reply.musicUrl
  443. result.replyHqMusicUrl = menu.reply.hqMusicUrl
  444. }
  445. return result
  446. }
  447. // ======================== 菜单编辑(素材选择) ========================
  448. const openMaterial = () => {
  449. dialogNewsVisible.value = true
  450. }
  451. const selectMaterial = (item) => {
  452. const articleId = item.articleId
  453. const articles = item.content.newsItem
  454. // 提示,针对多图文
  455. if (articles.length > 1) {
  456. message.alertWarning('您选择的是多图文,将默认跳转第一篇')
  457. }
  458. dialogNewsVisible.value = false
  459. // 设置菜单的回复
  460. tempObj.value.articleId = articleId
  461. tempObj.value.replyArticles = []
  462. articles.forEach((article) => {
  463. tempObj.value.replyArticles.push({
  464. title: article.title,
  465. description: article.digest,
  466. picUrl: article.picUrl,
  467. url: article.url
  468. })
  469. })
  470. }
  471. const deleteMaterial = () => {
  472. delete tempObj.value['articleId']
  473. delete tempObj.value['replyArticles']
  474. }
  475. </script>
  476. <!--本组件样式-->
  477. <style lang="scss" scoped="scoped">
  478. /* 公共颜色变量 */
  479. .clearfix {
  480. *zoom: 1;
  481. }
  482. .clearfix::after {
  483. content: '';
  484. display: table;
  485. clear: both;
  486. }
  487. div {
  488. text-align: left;
  489. }
  490. .weixin-hd {
  491. color: #fff;
  492. text-align: center;
  493. position: relative;
  494. bottom: 426px;
  495. left: 0px;
  496. width: 300px;
  497. height: 64px;
  498. background: transparent url('./assets/menu_head.png') no-repeat 0 0;
  499. background-position: 0 0;
  500. background-size: 100%;
  501. }
  502. .weixin-title {
  503. color: #fff;
  504. font-size: 14px;
  505. width: 100%;
  506. text-align: center;
  507. position: absolute;
  508. top: 33px;
  509. left: 0px;
  510. }
  511. .weixin-menu {
  512. background: transparent url('./assets/menu_foot.png') no-repeat 0 0;
  513. padding-left: 43px;
  514. font-size: 12px;
  515. }
  516. .menu_option {
  517. width: 40% !important;
  518. }
  519. .public-account-management {
  520. min-width: 1200px;
  521. width: 1200px;
  522. margin: 0 auto;
  523. .left {
  524. float: left;
  525. display: inline-block;
  526. width: 350px;
  527. height: 715px;
  528. background: url('./assets/iphone_backImg.png') no-repeat;
  529. background-size: 100% auto;
  530. padding: 518px 25px 88px;
  531. position: relative;
  532. box-sizing: border-box;
  533. /*第一级菜单*/
  534. .menu_main {
  535. .menu_bottom {
  536. position: relative;
  537. float: left;
  538. display: inline-block;
  539. box-sizing: border-box;
  540. width: 85.5px;
  541. text-align: center;
  542. border: 1px solid #ebedee;
  543. background-color: #fff;
  544. cursor: pointer;
  545. &.menu_addicon {
  546. height: 46px;
  547. line-height: 46px;
  548. }
  549. .menu_item {
  550. height: 44px;
  551. line-height: 44px;
  552. // text-align: center;
  553. box-sizing: border-box;
  554. width: 100%;
  555. display: flex;
  556. align-items: center;
  557. justify-content: center;
  558. &.active {
  559. border: 1px solid #2bb673;
  560. }
  561. }
  562. .menu_subItem {
  563. height: 44px;
  564. line-height: 44px;
  565. text-align: center;
  566. box-sizing: border-box;
  567. &.active {
  568. border: 1px solid #2bb673;
  569. }
  570. }
  571. }
  572. i {
  573. color: #2bb673;
  574. }
  575. /*第二级菜单*/
  576. .submenu {
  577. position: absolute;
  578. width: 85.5px;
  579. bottom: 45px;
  580. .subtitle {
  581. background-color: #fff;
  582. box-sizing: border-box;
  583. }
  584. }
  585. }
  586. .save_div {
  587. margin-top: 15px;
  588. text-align: center;
  589. .save_btn {
  590. bottom: 20px;
  591. left: 100px;
  592. }
  593. }
  594. }
  595. /*右边菜单内容*/
  596. .right {
  597. float: left;
  598. width: 63%;
  599. background-color: #e8e7e7;
  600. padding: 20px;
  601. margin-left: 20px;
  602. -webkit-box-sizing: border-box;
  603. box-sizing: border-box;
  604. .configure_page {
  605. .delete_btn {
  606. text-align: right;
  607. margin-bottom: 15px;
  608. }
  609. .menu_content {
  610. margin-top: 20px;
  611. }
  612. .configur_content {
  613. margin-top: 20px;
  614. background-color: #fff;
  615. padding: 20px 10px;
  616. border-radius: 5px;
  617. }
  618. .blue {
  619. color: #29b6f6;
  620. margin-top: 10px;
  621. }
  622. .applet {
  623. margin-bottom: 20px;
  624. span {
  625. width: 20%;
  626. }
  627. }
  628. .input_width {
  629. width: 40%;
  630. }
  631. .material {
  632. .input_width {
  633. width: 30%;
  634. }
  635. .el-textarea {
  636. width: 80%;
  637. }
  638. }
  639. }
  640. }
  641. .el-input {
  642. width: 70%;
  643. margin-right: 2%;
  644. }
  645. }
  646. </style>
  647. <!--素材样式-->
  648. <style lang="scss" scoped>
  649. .pagination {
  650. text-align: right;
  651. margin-right: 25px;
  652. }
  653. .select-item {
  654. width: 280px;
  655. padding: 10px;
  656. margin: 0 auto 10px auto;
  657. border: 1px solid #eaeaea;
  658. }
  659. .select-item2 {
  660. padding: 10px;
  661. margin: 0 auto 10px auto;
  662. border: 1px solid #eaeaea;
  663. }
  664. .ope-row {
  665. padding-top: 10px;
  666. text-align: center;
  667. }
  668. .item-name {
  669. font-size: 12px;
  670. overflow: hidden;
  671. text-overflow: ellipsis;
  672. white-space: nowrap;
  673. text-align: center;
  674. }
  675. </style>