index.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {include file="/shopro/common/script" /}
  2. <style>
  3. .menu-index .menu-current {
  4. border-bottom: 1px solid var(--sa-space);
  5. }
  6. .menu-index .menu-current .left {
  7. flex-shrink: 0;
  8. font-size: 14px;
  9. color: var(--sa-subtitle);
  10. }
  11. .menu-index .menu-current .right {
  12. flex: 1;
  13. height: 32px;
  14. line-height: 32px;
  15. border: 1px solid var(--sa-border);
  16. box-sizing: border-box;
  17. border-radius: 4px;
  18. position: relative;
  19. }
  20. .menu-index .menu-current .right .menu-current-tag {
  21. height: 30px;
  22. }
  23. .menu-index .menu-current .right .el-button {
  24. position: absolute;
  25. top: -1px;
  26. right: 0;
  27. }
  28. </style>
  29. <div id="index" class="menu-index panel panel-default panel-intro" v-cloak>
  30. <el-container class="panel-block">
  31. <el-header class="sa-header">
  32. <div class="menu-current sa-title sa-flex sa-row-between">
  33. <div class="left mr-4">当前菜单</div>
  34. <div class="right">
  35. <el-scrollbar>
  36. <div class="menu-current-tag sa-flex ml-1">
  37. <el-tag class="mr-1" v-for="item in state.current" :key="item">{{ item.name }}</el-tag>
  38. </div>
  39. </el-scrollbar>
  40. {if $auth->check('shopro/wechat/menu/copy')}
  41. <el-button type="primary" @click="onCopy(0)">复制</el-button>
  42. {/if}
  43. </div>
  44. </div>
  45. <div class="sa-title sa-flex sa-row-between">
  46. <div class="sa-title-left">
  47. <div class="left-name">自定义菜单</div>
  48. </div>
  49. <div class="sa-title-right">
  50. <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
  51. {if $auth->check('shopro/wechat/menu/add')}
  52. <el-button icon="Plus" type="primary" @click="onAdd">添加</el-button>
  53. {/if}
  54. </div>
  55. </div>
  56. </el-header>
  57. <el-main class="sa-main">
  58. <el-table class="sa-table" height="100%" stripe :data="state.data" @sort-change="onChangeSort">
  59. <el-table-column sortable="custom" prop="id" label="ID" min-width="90"> </el-table-column>
  60. <el-table-column label="名称" min-width="160">
  61. <template #default="scope">
  62. <div class="sa-table-line-1">
  63. {{ scope.row.name || '-' }}
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="菜单名称" min-width="260">
  68. <template #default="scope">
  69. <el-scrollbar>
  70. <div class="sa-flex">
  71. <el-tag class="mr-1" v-for="item in scope.row.rules" :key="item.id">{{ item.name }}
  72. </el-tag>
  73. </div>
  74. </el-scrollbar>
  75. </template>
  76. </el-table-column>
  77. <el-table-column sortable="custom" prop="updatetime" label="更新时间" width="172">
  78. <template #default="scope">
  79. {{ scope.row.updatetime || '-' }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column fixed="right" label="菜单状态" width="100">
  83. <template #default="scope">
  84. <div :class="scope.row.status == 0 ? 'sa-color--info' : 'sa-color--success'">
  85. {{ scope.row.status_text}}
  86. </div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column fixed="right" label="操作" min-width="200">
  90. <template #default="scope">
  91. {if $auth->check('shopro/wechat/menu/publish')}
  92. <el-button type="primary" link @click="onPublish(scope.row.id)">发布</el-button>
  93. {/if}
  94. {if $auth->check('shopro/wechat/menu/edit')}
  95. <el-button type="primary" link @click="onEdit(scope.row.id)">编辑</el-button>
  96. {/if}
  97. {if $auth->check('shopro/wechat/menu/copy')}
  98. <el-button type="primary" link @click="onCopy(scope.row.id)">复制</el-button>
  99. {/if}
  100. <el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
  101. title="确认删除这条记录?" @confirm="onDelete(scope.row.id)">
  102. <template #reference>
  103. {if $auth->check('shopro/wechat/menu/delete')}
  104. <el-button type="danger" link>删除</el-button>
  105. {/if}
  106. </template>
  107. </el-popconfirm>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. </el-main>
  112. <el-footer class="sa-footer sa-flex sa-row-right">
  113. <sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
  114. </el-footer>
  115. </el-container>
  116. </div>