EditTitle.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <!-- -->
  2. <template>
  3. <div class="GCLS-center-top">
  4. <h2 class="title">{{ title }}
  5. <span :class="['message-box',is_exist == 'true'?'hasMessage':'noMessage']" v-if="from=='message'" @click="handleReadAllMessage">{{$t("Key802")}}</span>
  6. </h2>
  7. <div class="GCLS-center-op" v-if="isDel == 1">
  8. <template v-if="!isShowCheckBox">
  9. <el-button
  10. size="small"
  11. class="common-btn edit-btn"
  12. @click="changeIsDel(true)"
  13. >
  14. <img src="@/assets/Personalcenter/edit-icon.png" class="edit-icon" />
  15. <!-- 编辑 -->
  16. <span>{{ $t("Key123") }}</span>
  17. </el-button>
  18. </template>
  19. <template v-else>
  20. <span class="choice-num">{{ selectedCount }}/{{ listCount }}</span>
  21. <el-popover
  22. placement="top"
  23. width="160"
  24. class="delOrgBox"
  25. v-model="isPop"
  26. >
  27. <p>{{ $t("Key478") }} {{ selectedCount }} {{ $t("Key479") }}?</p>
  28. <div style="text-align: right; margin: 0">
  29. <el-button size="mini" type="text" @click="isPop = false">{{
  30. $t("Key83")
  31. }}</el-button>
  32. <!-- 确定 -->
  33. <el-button type="primary" size="mini" @click="sureDel">{{
  34. $t("Key94")
  35. }}</el-button>
  36. </div>
  37. <el-button
  38. size="small"
  39. class="common-btn delete-btn"
  40. slot="reference"
  41. >
  42. <img
  43. src="@/assets/Personalcenter/delete-icon.png"
  44. class="edit-icon"
  45. />
  46. <!-- 删除 -->
  47. <span>{{ $t("Key172") }}</span>
  48. </el-button>
  49. </el-popover>
  50. <el-button
  51. size="small"
  52. class="common-btn cancle-btn"
  53. @click="changeIsCancle(false)"
  54. >
  55. <!-- 取消 -->
  56. <span>{{ $t("Key83") }}</span>
  57. </el-button>
  58. <el-button
  59. size="small"
  60. class="common-btn complete-btn"
  61. @click="changeIsDel(false)"
  62. >
  63. <img
  64. src="@/assets/Personalcenter/complete-icon.png"
  65. class="edit-icon"
  66. />
  67. <!-- 完成 -->
  68. <span>{{ $t("Key82") }}</span>
  69. </el-button>
  70. </template>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import { mapGetters } from "vuex";
  76. import { getLearnWebContent } from "@/api/ajax";
  77. export default {
  78. components: {},
  79. props: [
  80. "title",
  81. "isDel",
  82. "isShow",
  83. "isShowCheckBox",
  84. "changeIsDel",
  85. "changeIsCancle",
  86. "delCount",
  87. "listCount",
  88. "deleteMyCollection",
  89. "from"
  90. ],
  91. data() {
  92. return {
  93. isPop: false,
  94. };
  95. },
  96. computed: {
  97. ...mapGetters(["is_exist"]),
  98. selectedCount() {
  99. return this.delCount;
  100. },
  101. },
  102. watch: {},
  103. //方法集合
  104. methods: {
  105. async sureDel() {
  106. await this.deleteMyCollection();
  107. this.isPop = false;
  108. },
  109. handleReadAllMessage(){
  110. let MethodName = "message-message_manager-ReadMyMessage";
  111. let data = {
  112. is_all_read: 'true'
  113. };
  114. getLearnWebContent(MethodName, data).then((res) => {
  115. // this.is_exist = res.is_exist;
  116. if(res.status==1){
  117. this.$emit('load','1')
  118. this.$store.dispatch("message/updateIsExist", 'false');
  119. }
  120. });
  121. }
  122. },
  123. //生命周期 - 创建完成(可以访问当前this实例)
  124. created() {},
  125. //生命周期 - 挂载完成(可以访问DOM元素)
  126. mounted() {},
  127. beforeCreate() {}, //生命周期 - 创建之前
  128. beforeMount() {}, //生命周期 - 挂载之前
  129. beforeUpdate() {}, //生命周期 - 更新之前
  130. updated() {}, //生命周期 - 更新之后
  131. beforeDestroy() {}, //生命周期 - 销毁之前
  132. destroyed() {}, //生命周期 - 销毁完成
  133. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  134. };
  135. </script>
  136. <style lang='scss' scoped>
  137. //@import url(); 引入公共css类
  138. .GCLS-center-top {
  139. width: 100%;
  140. height: 78px;
  141. padding: 24px 32px;
  142. background: #fff;
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. box-sizing: border-box;
  147. > .title {
  148. font-size: 20px;
  149. line-height: 150%;
  150. color: #000000;
  151. margin: 0;
  152. .message-box{
  153. font-weight: 400;
  154. font-size: 14px;
  155. line-height: 150%;
  156. background: url('../../assets/Personalcenter/icon-message.png') 24px center no-repeat;
  157. background-size: 16px;
  158. padding: 0 0 0 46px;
  159. cursor: pointer;
  160. &.noMessage{
  161. opacity: 0.55;
  162. }
  163. }
  164. }
  165. > .GCLS-center-op {
  166. display: flex;
  167. justify-content: flex-end;
  168. align-items: center;
  169. .choice-num {
  170. margin-right: 10px;
  171. font-size: 16px;
  172. line-height: 150%;
  173. color: #000000;
  174. }
  175. .common-btn {
  176. > span {
  177. display: flex;
  178. align-items: center;
  179. }
  180. .edit-icon {
  181. width: 24px;
  182. height: 24px;
  183. margin-right: 8px;
  184. }
  185. }
  186. }
  187. }
  188. </style>
  189. <style lang='scss'>
  190. .GCLS-center-top {
  191. .common-btn {
  192. cursor: pointer;
  193. > span {
  194. display: flex;
  195. align-items: center;
  196. }
  197. }
  198. .el-button--small,
  199. .el-button--small.is-round {
  200. padding: 7px 16px;
  201. font-size: 16px;
  202. }
  203. .cancle-btn {
  204. width: 96px;
  205. height: 40px;
  206. padding: 7px 31px;
  207. }
  208. .edit-btn {
  209. &.el-button {
  210. border: 1px solid rgba(44, 44, 44, 0.15);
  211. color: #000;
  212. }
  213. &.el-button:active {
  214. color: #000;
  215. border-color: #d3d4d6;
  216. outline: 0;
  217. }
  218. &.el-button:hover {
  219. background: #f4f4f5;
  220. border-color: #d3d4d6;
  221. }
  222. }
  223. .cancle-btn {
  224. &.el-button {
  225. border: 1px solid rgba(44, 44, 44, 0.15);
  226. color: #000;
  227. }
  228. &.el-button:active {
  229. color: #000;
  230. border-color: #d3d4d6;
  231. outline: 0;
  232. }
  233. &.el-button:hover {
  234. background: #f4f4f5;
  235. border-color: #d3d4d6;
  236. }
  237. }
  238. .delete-btn {
  239. &.el-button {
  240. border: 1px solid #fff;
  241. color: #eb5757;
  242. }
  243. &.el-button:active {
  244. color: #fff;
  245. border-color: #fff;
  246. outline: 0;
  247. }
  248. &.el-button:hover {
  249. background: #f3b2b2;
  250. }
  251. }
  252. .complete-btn {
  253. &.el-button {
  254. border: 1px solid #ff9900;
  255. color: #ff9900;
  256. }
  257. &.el-button:active {
  258. color: #ff9900;
  259. border-color: #ff9900;
  260. outline: 0;
  261. }
  262. &.el-button:hover {
  263. background: #f5dab1;
  264. }
  265. }
  266. }
  267. </style>