collectEdbMenu.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <el-tree
  3. ref="catalogTree"
  4. class="catalog-tree other-tree"
  5. empty-text="暂无图库"
  6. :data="data"
  7. node-key="UniqueCode"
  8. :expand-on-click-node="false"
  9. @current-change="(data,node)=>{$parent.nodeChange(data,node)}"
  10. >
  11. <div class="custom-tree-node" slot-scope="{ data }">
  12. <span class="tree-label">{{ data.ClassifyName }}</span>
  13. <div class="right-item right-item-box" >
  14. <img
  15. src="~@/assets/img/set_m/edit.png"
  16. alt=""
  17. style="width: 15px; height: 14px; margin-right: 8px"
  18. @click.stop="$parent.handleOpenCollectClassify(data)"
  19. v-if="!data.EdbCode&&$parent.isEdbBtnShow('edbData_edbCollectClassify_save')"
  20. />
  21. <img
  22. src="~@/assets/img/set_m/del_icon.png"
  23. alt=""
  24. style="width: 14px; height: 14px;"
  25. @click.stop="removeCollectNode(data)"
  26. v-if="!data.EdbCode&&$parent.isEdbBtnShow('edbData_edbCollectClassify_remove')"
  27. />
  28. </div>
  29. </div>
  30. </el-tree>
  31. </template>
  32. <script>
  33. import { edbCollectInterface } from '@/api/modules/chartApi'
  34. export default {
  35. props: {
  36. data: {
  37. type: Object
  38. },
  39. },
  40. data() {
  41. return {
  42. }
  43. },
  44. methods: {
  45. removeCollectNode({ClassifyId}) {
  46. this.$confirm('若删除该目录,则目录下收藏的所有指标将被清除, 是否继续?',
  47. '提示',
  48. { type: 'warning' }
  49. ).then(async () => {
  50. const res = await edbCollectInterface.delCollectClassify({
  51. ClassifyId
  52. })
  53. if(res.Ret !== 200) return
  54. this.$message.success('删除成功')
  55. this.$emit('change')
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style>
  62. </style>