index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {include file="/shopro/common/script" /}
  2. <style>
  3. .reply-index .reply-main {
  4. --el-main-padding: 0 20px;
  5. }
  6. .reply-index .card-wrap {
  7. padding: 12px;
  8. line-height: 1;
  9. box-shadow: 0 1px 6px #5959591f;
  10. border-radius: 8px;
  11. border: 1px solid var(--sa-space);
  12. margin-bottom: 24px;
  13. }
  14. .reply-index .card-wrap:hover {
  15. box-shadow: 0 3px 12px #59595933;
  16. transform: translateY(-4px);
  17. }
  18. .reply-index .card-wrap .item-type-text {
  19. font-size: 12px;
  20. color: var(--sa-subfont);
  21. margin-bottom: 12px;
  22. }
  23. .reply-index .card-wrap .item-content {
  24. height: 40px;
  25. line-height: 20px;
  26. word-break: break-all;
  27. font-size: 12px;
  28. color: var(--sa-subfont);
  29. margin-bottom: 12px;
  30. }
  31. .reply-index .card-wrap .item-keywords {
  32. border: none;
  33. border-radius: 12px;
  34. margin-right: 4px;
  35. margin-bottom: 12px;
  36. }
  37. .reply-index .card-wrap .item-keywords:last-of-type {
  38. margin-right: 0;
  39. }
  40. </style>
  41. <div id="index" class="reply-index panel panel-default panel-intro" v-cloak>
  42. <el-container class="panel-block">
  43. <el-header class="sa-header">
  44. <el-tabs class="sa-tabs" v-model="state.group" @tab-change="getData">
  45. <el-tab-pane label="关键字回复" name="keywords"></el-tab-pane>
  46. <el-tab-pane label="关注回复" name="subscribe"></el-tab-pane>
  47. <el-tab-pane label="默认回复" name="default"></el-tab-pane>
  48. </el-tabs>
  49. <div class="sa-title sa-flex sa-row-between">
  50. <div class="sa-title-left">
  51. <div class="left-name">自动回复</div>
  52. </div>
  53. <div class="sa-title-right">
  54. <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
  55. {if $auth->check('shopro/wechat/reply/add')}
  56. <el-button icon="Plus" type="primary" @click="onAdd">添加</el-button>
  57. {/if}
  58. </div>
  59. </div>
  60. </el-header>
  61. <el-main class="reply-main">
  62. <el-row :gutter="16">
  63. <el-col v-for="item in state.data" :key="item" :xs="12" :sm="8" :md="6" :lg="4" :xl="4">
  64. <div class="card-wrap">
  65. <div class="item-type-text">{{ item.type_text }}</div>
  66. <div class="item-content sa-line-2">{{ item.content }}</div>
  67. <el-scrollbar v-if="state.group=='keywords'">
  68. <div class="sa-flex">
  69. <el-tag class="item-keywords" v-for="keyword in item.keywords">{{keyword}}</el-tag>
  70. </div>
  71. </el-scrollbar>
  72. <div class="sa-flex sa-row-between">
  73. <el-tooltip effect="dark" :content="item.status_text" placement="top-start">
  74. {if $auth->check('shopro/wechat/reply/edit')}
  75. <el-switch v-model="item.status" active-value="enable" inactive-value="disabled"
  76. @change="onChangeStatus(item)"></el-switch>
  77. {/if}
  78. </el-tooltip>
  79. <div class="sa-flex">
  80. {if $auth->check('shopro/wechat/reply/edit')}
  81. <el-button type="primary" link @click="onEdit(item.id)">编辑</el-button>
  82. {/if}
  83. <el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
  84. title="确认删除这条记录?" @confirm="onDelete(item.id)">
  85. <template #reference>
  86. {if $auth->check('shopro/wechat/reply/delete')}
  87. <el-button type="danger" link>删除</el-button>
  88. {/if}
  89. </template>
  90. </el-popconfirm>
  91. </div>
  92. </div>
  93. </div>
  94. </el-col>
  95. </el-row>
  96. </el-main>
  97. </el-container>
  98. </div>