index.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <link rel="stylesheet" href="/resources/unpkg/element-ui@2.15.14/lib/theme-chalk/index.css">
  5. <link rel="stylesheet" href="/resources/css/flex.css">
  6. <link rel="stylesheet" href="/resources/css/qimall.css?t=<?= Yii::$app->params['css_cache_time'] ?>"">
  7. <script src="/resources/unpkg/vue@2.6.10/dist/vue.js"></script>
  8. <script src="/resources/unpkg/element-ui@2.12.0/lib/index.js"></script>
  9. <style>
  10. .table-info-img-text{
  11. display: flex;
  12. align-items: center;
  13. justify-content: space-between;
  14. }
  15. .table-info-img-text .table-info-img{
  16. width: 50px;
  17. height: 50px;
  18. }
  19. .circle{
  20. border-radius: 50%;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <div id="table-data-list">
  26. <div style="width:1570px;">
  27. <h3>列表标准样式</h3>
  28. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  29. <el-table-column label="会员" width="180" >
  30. <template slot-scope="scope">
  31. <div class="table-info-img-text">
  32. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  33. <div slot="error" class="image-slot">
  34. <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
  35. </div>
  36. </el-image>
  37. <div class="table-info-text">
  38. <div>{{scope.row.user.nickname}}<span style="color:blue">({{scope.row.user.id}})</span></div>
  39. <div>{{scope.row.user.mobile}}</div>
  40. </div>
  41. </div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="应用标题" prop="title" align="center" max-width="180">
  45. <template slot-scope="scope">
  46. <div size="small">{{scope.row.title}}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="应用名称" prop="name" align="center" max-width="180">
  50. <template slot-scope="scope">
  51. <div size="small">{{scope.row.name}}</div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="应用封面" prop="name" align="center" max-width="180">
  55. <template slot-scope="scope">
  56. <div size="small">
  57. <el-image class="table-info-img" :src="scope.row.cover">
  58. <div slot="error" class="image-slot">
  59. <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
  60. </div>
  61. </el-image>
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="作者" prop="author" align="center">
  66. <template slot-scope="scope">
  67. <div size="small">{{scope.row.author}}</div>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="应用分组" prop="group" align="center">
  71. <template slot-scope="scope">
  72. <div size="small">{{scope.row.group_name}}</div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="版本号" prop="version" align="center">
  76. <template slot-scope="scope">
  77. <div size="small">{{scope.row.version}}</div>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="简介" prop="version" align="center" max-width="280" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. <div size="small">{{scope.row.brief_introduction}}</div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="状态" prop="group" align="center" max-width="50">
  86. <template slot-scope="scope">
  87. <el-button v-if="scope.row.status == 1" size="mini" type="success" icon="el-icon-check" circle></el-button>
  88. <el-button v-else size="mini" type="danger" icon="el-icon-close" circle></el-button>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="是否上架" prop="group" align="center">
  92. <template slot-scope="scope">
  93. <el-button v-if="scope.row.is_online == 1" size="mini" type="success" icon="el-icon-check" circle></el-button>
  94. <el-button v-if="scope.row.is_online == 0" size="mini" type="danger" icon="el-icon-close" circle></el-button>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="操作" min-width="100" align="center">
  98. <template slot-scope="scope">
  99. <el-button type="text" @click="operate()">编辑</el-button>
  100. <el-button type="text" v-if="scope.row.status == 1" @click="operate()">禁用</el-button>
  101. <el-button type="text" v-if="scope.row.status == 0" @click="operate()">启用</el-button>
  102. <el-popover placement="right" width="150" trigger="hover">
  103. <div style="display: flex;flex-direction: column;">
  104. <el-button type="text" @click="operate()">卸载</el-button>
  105. <el-button type="text" @click="operate()">更新配置</el-button>
  106. <el-button type="text" @click="operate()">升级数据库</el-button>
  107. <el-button v-if="scope.row.is_online == 1" type="text" @click="operate()">下架</el-button>
  108. <el-button v-if="scope.row.is_online == 0" type="text" @click="operate()">上架</el-button>
  109. </div>
  110. <el-button slot="reference" @click.stop style="margin-left: 10px;" size="mini" type="text">更多</el-button>
  111. </el-popover>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. </div>
  116. </div>
  117. </body>
  118. <script>
  119. const app = new Vue({
  120. el: '#table-data-list',
  121. data() {
  122. return {
  123. listLoading:false,
  124. list:[{
  125. "title": "九宫格",
  126. "name": "Sudoku",
  127. "author": "Qimall",
  128. "cover": "https://shuzixiangdao.oss-cn-guangzhou.aliyuncs.com/images/2021/12/22/image_1640158496_ET0llpJp.png",
  129. "group": "operate",
  130. "group_name": "私域运营",
  131. "status": 1,
  132. "is_online": 1,
  133. "version": "1.0.0",
  134. "brief_introduction":"九宫格抽奖",
  135. user:{
  136. "id": 116,
  137. "mobile": 13200000004,
  138. "nickname": "test3",
  139. // "avatar_url": "https://shuzixiangdao.oss-cn-guangzhou.aliyuncs.com/images/2021/12/21/image_1640050882_BGl0tTZa.jpeg",
  140. "avatar_url": "",
  141. "parent_id": 115,
  142. "username": 13200000004
  143. }
  144. }],
  145. }
  146. },
  147. });
  148. </script>
  149. </html>