ke_junjie
2025-06-04 bb6e2230bb8ded3c5546bc4e4c282ee343754475
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!--  :style="modabg ? 'background:unset; position: absolute;' : ''"-->
<template>
  <div id="deta-modal">
    <!-- <draggable element="ul" v-model="list"> -->
    <div class="box-modal borderR8"
         :style="modalStyle">
      <div class="title-modal">
        <p class="p-title">
          <slot name="title"></slot>
        </p>
        <i class="el-icon-close pointer fontSize1_2"
           @click="$emit('cancel')"></i>
      </div>
      <div class="centent-modal">
        <!-- <el-scrollbar wrap-class="scrollbar-wrapper" style="height:100%"> -->
        <slot name="centent"></slot>
        <!-- </el-scrollbar> -->
      </div>
    </div>
    <!-- </draggable> -->
  </div>
</template>
 
<script>
import { number } from 'echarts';
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import draggable from 'vuedraggable';
export default {
  data () {
    //这里存放数据
    return {
      ismodal: false,
      list: [{ name: '1' }]
    };
  },
  props: {
    modabg: {
      type: Boolean,
      default: false
    },
    modalStyle: {
      type: Object,
      default: {
        width: '45%' //设置默认的宽度,原先是 40% 【EditBy shaocx,2022-11-10】
      }
    }
  },
  components: { draggable },
  //方法集合
  methods: {
    cancel () {
      this.$emit('cancel');
    }
  },
  //监控data中的数据变化
  watch: {},
  //如果页面有keep-alive缓存功能,这个函数会触发
  activated () { }
};
</script>
<style lang="scss" scoped>
#deta-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  // transition: all 0.3s;
  z-index: 999;
  .box-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 85%;
    border-radius: 6px;
    transform: translate(-50%, -50%);
    background: #fff;
    box-shadow: 0 0 4px #345;
    // transition: all 0.5s;
    overflow: hidden;
    .title-modal {
      padding: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #e6eaf1;
      background: #f5f7fa;
      .p-title {
        font-size: 20px;
        padding-left: 5px;
      }
      .fontSize1_2 {
        font-size: 20px;
        margin-right: 15px;
        &:hover {
          transition: all 0.3s;
          transform: rotate(360deg);
        }
      }
    }
    .centent-modal {
      width: 98%;
      height: calc(100% - 62px);
      padding: 1%;
      overflow: hidden;
    }
  }
  // .el-scrollbar__view {
  //     height: 100%;
  // }
}
</style>