Blame view

src/views/form-design/components/VFormDesign/styles/drag.less 4.42 KB
1
2
3
4
5
6
.draggable-box {
  height: 100%;
  overflow: auto;

  :deep(.list-main) {
    position: relative;
7
8
    padding: 5px;
    overflow: hidden;
9
10

    .moving {
11
12
      position: relative;
      box-sizing: border-box;
13
      // 拖放移动中;
14
15
      min-height: 35px;
      padding: 0 !important;
16
      overflow: hidden;
17
18
19
20
21
22

      &::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
23
24
25
        width: 100%;
        height: 5px;
        background-color: @primary-color;
26
27
28
29
30
31
      }
    }

    .drag-move-box {
      position: relative;
      box-sizing: border-box;
32
      min-height: 60px;
33
34
35
36
37
      padding: 8px;
      overflow: hidden;
      transition: all 0.3s;

      &:hover {
38
        background-color: @primary-hover-bg-color;
39
40
41
42
43
44
45
46
      }

      // 选择时 start
      &::before {
        content: '';
        position: absolute;
        top: 0;
        right: -100%;
47
48
        width: 100%;
        height: 5px;
49
        transition: all 0.3s;
50
        background-color: @primary-color;
51
52
53
54
      }

      &.active {
        outline-offset: 0;
55
        background-color: @primary-hover-bg-color;
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

        &::before {
          right: 0;
        }
      }

      // 选择时 end
      .form-item-box {
        position: relative;
        box-sizing: border-box;
        word-wrap: break-word;

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
73
74
          width: 100%;
          height: 100%;
75
76
77
78
79
80
81
82
83
84
85
86
87
        }

        .ant-form-item {
          // 修改ant form-item的margin为padding
          margin: 0;
          padding-bottom: 6px;
        }
      }

      .show-key-box {
        // 显示key
        position: absolute;
        right: 5px;
88
        bottom: 2px;
89
90
        // z-index: 999;
        color: @primary-color;
91
        font-size: 14px;
92
93
94
95
96
97
98
99
100
101
      }

      .copy,
      .delete {
        position: absolute;
        top: 0;
        width: 30px;
        height: 30px;
        // z-index: 989;
        transition: all 0.3s;
102
103
104
        color: #fff;
        line-height: 30px;
        text-align: center;
105
106
107
108
109
110
111
112
113
114
115
116
117

        &.unactivated {
          opacity: 0 !important;
          pointer-events: none;
        }

        &.active {
          opacity: 1 !important;
        }
      }

      .copy {
        right: 30px;
118
        border-radius: 0 0 0 8px;
119
        background-color: @primary-color;
120
121
122
123
      }

      .delete {
        right: 0;
124
        background-color: @primary-color;
125
126
127
128
129
130
131
      }
    }

    .grid-box {
      position: relative;
      box-sizing: border-box;
      width: 100%;
132
      padding: 5px;
133
      overflow: hidden;
134
135
      transition: all 0.3s;
      background-color: @layout-background-color;
136
137
138
139
140
141
142
143
144
145
146
147
148

      .form-item-box {
        position: relative;
        box-sizing: border-box;

        .ant-form-item {
          // 修改ant form-item的margin为padding
          margin: 0;
          padding-bottom: 15px;
        }
      }

      .grid-row {
149
        background-color: @layout-background-color;
150
151
152
153

        .grid-col {
          .draggable-box {
            min-width: 50px;
154
            min-height: 80px;
155
            border: 1px #ccc dashed;
156
            // background: #fff;
157
158
159

            .list-main {
              position: relative;
160
              min-height: 83px;
161
162
163
164
165
166
167
168
169
170
171
172
              border: 1px #ccc dashed;
            }
          }
        }
      }

      // 选择时 start
      &::before {
        content: '';
        position: absolute;
        top: 0;
        right: -100%;
173
174
        width: 100%;
        height: 5px;
175
        transition: all 0.3s;
176
        background: transparent;
177
178
179
180
      }

      &.active {
        outline-offset: 0;
181
        background-color: @layout-hover-bg-color;
182
183
184

        &::before {
          right: 0;
185
          background-color: @layout-color;
186
187
188
189
190
191
192
193
194
195
196
197
        }
      }
      // 选择时 end
      > .copy-delete-box {
        > .copy,
        > .delete {
          position: absolute;
          top: 0;
          width: 30px;
          height: 30px;
          // z-index: 989;
          transition: all 0.3s;
198
199
200
          color: #fff;
          line-height: 30px;
          text-align: center;
201
202
203
204
205
206
207
208
209
210
211
212
213

          &.unactivated {
            opacity: 0 !important;
            pointer-events: none;
          }

          &.active {
            opacity: 1 !important;
          }
        }

        > .copy {
          right: 30px;
214
          border-radius: 0 0 0 8px;
215
          background-color: @layout-color;
216
217
218
219
        }

        > .delete {
          right: 0;
220
          background-color: @layout-color;
221
222
223
224
225
        }
      }
    }
  }
}