meixioacomponent 0.2.27 → 0.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,10 +2,6 @@
2
2
  //
3
3
  --hover-gray: var(--color-gray-m);
4
4
  --hover-primary: var(--color-active-primary);
5
- // 图标颜色
6
- --icon-color-d: var(--font-color-m);
7
- --icon-color-m: var(--font-color-s);
8
- --icon-color-s: var(--font-color-ds);
9
5
  // 阴影
10
6
  --shadow: 0px 2px 4px #0000001f, 0 0 6px #0000001f;
11
7
  --shadow-2: 0px 1px 1px rgba(9, 30, 66, 0.25),
@@ -58,6 +54,11 @@
58
54
  // 字体颜色
59
55
  --text-white: white;
60
56
  --text-black: #333;
57
+ --text-disabled: #a5adba;
58
+ // 图标颜色
59
+ --icon-color-d: var(--font-color-m);
60
+ --icon-color-m: var(--font-color-s);
61
+ --icon-color-s: var(--font-color-ds);
61
62
  // 选择类的背景色
62
63
  //警告色
63
64
  --color-warn: #ff991f;
@@ -69,7 +70,7 @@
69
70
  --color-info: var(--color-gray-d);
70
71
  //滚动条样式
71
72
  // hover 主题色颜色
72
- --hover-light-primary: #deebff;
73
+ --hover-light-primary: #e6eefa;
73
74
  // 选中色
74
75
  --color-selected: #213f72;
75
76
  --scrollbar-color: #4b4b4be6;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "0.2.27",
3
+ "version": "0.2.30",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="dialog-wrap" v-if="isShow">
3
3
  <el-dialog
4
- :top="top"
4
+ :top="`0px`"
5
5
  ref="dialog"
6
6
  :modal="modal"
7
7
  :width="width"
@@ -14,15 +14,27 @@
14
14
  :visible.sync="centerDialogVisible"
15
15
  :modal-append-to-body="appendToBody"
16
16
  >
17
- <div class="dialog-title-wrap" slot="title">
17
+ <div class="dialog-title-wrap" slot="title" ref="dialogTitleWrap">
18
18
  <span>{{ title }}</span>
19
- <base-icon
20
- :size="`d`"
21
- :color="`d`"
22
- :event="true"
23
- :name="`meixicomponenticon-close`"
24
- @iconClick="iconClick"
25
- ></base-icon>
19
+ <div class="title-handle-wrap">
20
+ <base-icon
21
+ :size="`d`"
22
+ :color="`d`"
23
+ v-if="onDrag"
24
+ :event="true"
25
+ ref="dragIcon"
26
+ :iconClass="`element`"
27
+ :name="`el-icon-rank`"
28
+ ></base-icon>
29
+
30
+ <base-icon
31
+ :size="`d`"
32
+ :color="`d`"
33
+ :event="true"
34
+ :name="`meixicomponenticon-close`"
35
+ @iconClick="iconClick"
36
+ ></base-icon>
37
+ </div>
26
38
  </div>
27
39
  <div class="dialog-content-wrap" :style="dialogContentStyle">
28
40
  <slot name="dialog-content"></slot>
@@ -34,16 +46,30 @@
34
46
  </template>
35
47
 
36
48
  <script>
49
+ import UseDrag from "../../../config/use/useDrag";
37
50
  export default {
38
51
  name: "baseDialog",
39
52
  data() {
40
53
  return {
41
54
  isShow: true,
55
+ useDrag: null,
42
56
  centerDialogVisible: false,
43
57
  };
44
58
  },
45
59
 
60
+ mounted() {
61
+ this.$nextTick(() => {
62
+ if (this.$props.onDrag) {
63
+ this.$refs.dragIcon.$el.addEventListener("mousedown", this.startDrag);
64
+ }
65
+ });
66
+ },
46
67
  props: {
68
+ // 是否开启拖拽
69
+ onDrag: {
70
+ type: Boolean,
71
+ default: true,
72
+ },
47
73
  // 标题栏文字
48
74
  title: {
49
75
  type: String,
@@ -55,7 +81,10 @@ export default {
55
81
  },
56
82
  // 距离上部的距离
57
83
  top: {
58
- type: String,
84
+ type: Number,
85
+ default: () => {
86
+ return document.documentElement.clientHeight * 0.15;
87
+ },
59
88
  },
60
89
  // 是否开启遮罩层
61
90
  modal: {
@@ -91,19 +120,44 @@ export default {
91
120
  },
92
121
  },
93
122
  methods: {
123
+ init() {
124
+ let target = this.$refs.dialog.$el.childNodes[0];
125
+ let left =
126
+ (document.documentElement.clientWidth - target.clientWidth) / 2;
127
+ target.style.cssText += `top:${parseInt(this.$props.top)}px;left:${left}px;margin:0px !important`;
128
+ },
129
+ startDrag(e) {
130
+ if (!this.useDrag) {
131
+ let target = this.$refs.dialog.$el.children[0];
132
+ this.useDrag = new UseDrag({
133
+ target: target,
134
+ handle: target.childNodes[0],
135
+ onDragEnd: () => {},
136
+ });
137
+ this.$nextTick(() => {
138
+ this.useDrag.startDrag(e);
139
+ });
140
+ } else {
141
+ this.useDrag.startDrag(e);
142
+ }
143
+ },
144
+
94
145
  showDialog(cb) {
95
- //console.log(this.$refs.dialog);
96
- this.centerDialogVisible = true;
97
- //console.log(this.$refs.dialog);
98
146
  if (cb) {
99
- cb();
147
+ cb(this.startShow);
148
+ } else {
149
+ this.startShow();
100
150
  }
101
151
  },
152
+ startShow() {
153
+ this.centerDialogVisible = true;
154
+ this.$nextTick(() => {
155
+ this.init();
156
+ });
157
+ },
102
158
  closeDialog() {
103
159
  if (this.$props.isDestroy) {
104
160
  this.isShow = false;
105
- //console.log(this.isShow);
106
- // this.$destroy();
107
161
  this.$nextTick(() => {
108
162
  this.$destroy();
109
163
  });
@@ -140,7 +194,12 @@ export default {
140
194
  span {
141
195
  color: var(--font-color-d);
142
196
  font-size: var(--font-size-xl);
143
- font-weight: var(--font-weight-g);
197
+ font-weight: var(--font-weight-kg);
198
+ }
199
+ .title-handle-wrap {
200
+ width: auto;
201
+ height: auto;
202
+ display: flex;
144
203
  }
145
204
  }
146
205
  </style>
@@ -1,8 +1,10 @@
1
1
  <template>
2
2
  <base-dialog
3
+ :top="top"
3
4
  :title="title"
4
5
  ref="dialog"
5
6
  :width="`1000px`"
7
+ :onDrag="onDrag"
6
8
  :isDestroy="isDestroy"
7
9
  :contentHeight="contentHeight"
8
10
  @hook:destroyed="dialogDestroy"
@@ -81,6 +83,17 @@ export default {
81
83
  beforeDestroy() {},
82
84
 
83
85
  props: {
86
+ // 是否开启拖拽
87
+ onDrag: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
91
+ top: {
92
+ type: Number,
93
+ default: () => {
94
+ return document.documentElement.clientHeight * 0.15;
95
+ },
96
+ },
84
97
  contentHeight: {
85
98
  type: String,
86
99
  default: "50vh",
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <el-drawer
3
3
  ref="drawer"
4
- :size="size"
5
4
  :modal="modal"
5
+ :size="drawerSize"
6
6
  :withHeader="false"
7
7
  :visible.sync="open"
8
8
  :direction="direction"
@@ -14,13 +14,18 @@
14
14
  >
15
15
  <!-- 插槽插入你需要渲染的内容 -->
16
16
  <div class="drawer-content-wrap">
17
- <el-button
18
- type="primary"
19
- @click="hiddenDrawer"
20
- icon="el-icon-close"
21
- :style="closeButtonStyle"
22
- class="drawer-close-button"
23
- ></el-button>
17
+ <div class="drawer-handle-wrap" :style="handleStyle" v-if="handleShow">
18
+ <div class="drawer-handle-content">
19
+ <el-button
20
+ type="primary"
21
+ @click="hiddenDrawer"
22
+ icon="el-icon-close"
23
+ class="drawer-close-button"
24
+ ></el-button>
25
+ <div class="drawer-handle-resize" ref="handleResize"></div>
26
+ </div>
27
+ </div>
28
+
24
29
  <div class="drawer-content-title" v-if="header">
25
30
  <span>{{ title }}</span>
26
31
  <base-icon
@@ -39,15 +44,26 @@
39
44
  </template>
40
45
 
41
46
  <script>
47
+ import UseResize from "../../../config/use/UseResize";
42
48
  export default {
43
49
  name: "baseDrawer",
44
50
  data() {
45
51
  return {
46
52
  open: false,
47
- closeButtonStyle: null,
53
+ useResize: null,
54
+ drawerSize: null,
48
55
  };
49
56
  },
57
+ created() {
58
+ this.drawerSize = this.$props.size;
59
+ },
60
+
61
+ mounted() {},
50
62
  props: {
63
+ resize: {
64
+ type: Boolean,
65
+ default: true,
66
+ },
51
67
  // 大小
52
68
  size: {
53
69
  type: Number,
@@ -103,19 +119,24 @@ export default {
103
119
  iconClick() {
104
120
  this.hiddenDrawer();
105
121
  },
106
- showDrawer(cb) {
122
+ openDrawer(cb) {
107
123
  if (this.isExis()) {
108
- this.open = true;
109
124
  if (cb) {
110
- this.$nextTick(() => {
111
- cb();
112
- });
125
+ cb(this.startDrawer);
126
+ } else {
127
+ this.startDrawer();
113
128
  }
114
129
  }
130
+ },
131
+
132
+ startDrawer() {
133
+ this.open = true;
115
134
  this.$nextTick(() => {
116
135
  this.setDrawerStyle();
136
+ console.log(this.$refs.drawer);
117
137
  });
118
138
  },
139
+
119
140
  hiddenDrawer() {
120
141
  if (this.isExis()) {
121
142
  this.$refs.drawer.closeDrawer();
@@ -124,34 +145,46 @@ export default {
124
145
 
125
146
  setDrawerStyle() {
126
147
  let el = this.$refs.drawer.$el;
127
- if (typeof this.$props.size == "number") {
148
+ if (typeof this.drawerSize == "number") {
128
149
  let direction = this.$props.direction;
129
150
  if (direction == "rtl") {
130
151
  el.style.left = "auto";
131
152
  } else if (direction == "ltr") {
132
153
  el.style.right = "auto";
133
154
  }
134
- el.style.width = `${this.$props.size}px`;
155
+ el.style.width = `${this.drawerSize}px`;
135
156
  el.style.boxShadow = `0 2px 12px 0 rgb(0 0 0 / 10%)`;
136
- this.setButtonStyle();
157
+ }
158
+ if (this.$props.resize) {
159
+ this.$refs.handleResize.addEventListener("mousedown", this.mousedown);
137
160
  }
138
161
  },
139
162
 
140
- setButtonStyle() {
141
- let direction = this.$props.direction;
142
-
143
- if (direction == "rtl") {
144
- this.closeButtonStyle = {
145
- left: `calc(100% - 43px - ${this.$props.size}px)`,
146
- };
147
- } else if (direction == "ltr") {
148
- this.closeButtonStyle = {
149
- left: `calc(${this.$props.size}px)`,
150
- };
163
+ mousedown(e) {
164
+ if (this.useResize) {
165
+ this.useResize.startResize(e);
166
+ } else {
167
+ this.useResize = new UseResize({
168
+ type: "width",
169
+ value: this.drawerSize,
170
+ moveing: this.moveing,
171
+ resizeEnd: () => {},
172
+ });
173
+ this.useResize.startResize(e);
151
174
  }
152
175
  },
176
+ moveing(e) {
177
+ let ref = this.$refs.drawer;
178
+ this.drawerSize = e;
179
+ ref.$el.style.cssText += `width:${e}px`;
180
+ },
153
181
  },
154
182
  computed: {
183
+ handleShow() {
184
+ let direction = this.$props.direction;
185
+ return direction == "rtl" || direction == "ltr";
186
+ },
187
+
155
188
  contentStyle() {
156
189
  if (this.$props.header) {
157
190
  return { height: `calc(100% - 56px)` };
@@ -159,6 +192,20 @@ export default {
159
192
  return { height: `calc(100% - var(--margin-4))` };
160
193
  }
161
194
  },
195
+ handleStyle() {
196
+ let direction = this.$props.direction;
197
+ if (direction == "rtl") {
198
+ return {
199
+ width: "44px",
200
+ left: `calc(100% - 44px - ${this.drawerSize}px)`,
201
+ };
202
+ } else if (direction == "ltr") {
203
+ return {
204
+ width: "44px",
205
+ left: `calc(${this.drawerSize}px)`,
206
+ };
207
+ }
208
+ },
162
209
  },
163
210
  };
164
211
  </script>
@@ -190,12 +237,40 @@ export default {
190
237
  margin-top: var(--margin-4);
191
238
  }
192
239
  }
193
- .drawer-close-button {
194
- top: 100px;
195
- width: 40px;
196
- display: flex;
197
- flex-flow: row;
240
+
241
+ .drawer-handle-wrap {
242
+ top: 0px;
243
+ height: 100%;
198
244
  position: fixed;
245
+ background: transparent;
199
246
  justify-content: center;
247
+ .drawer-handle-content {
248
+ width: 100%;
249
+ height: 100%;
250
+ position: relative;
251
+ .drawer-close-button {
252
+ right: 0px;
253
+ top: 100px;
254
+ width: 40px;
255
+ height: 40px;
256
+ display: flex;
257
+ flex-flow: row;
258
+ position: absolute;
259
+ justify-content: center;
260
+ }
261
+ .drawer-handle-resize {
262
+ top: 0px;
263
+ right: 0px;
264
+ width: 4px;
265
+ z-index: 2;
266
+ height: 100%;
267
+ position: absolute;
268
+ background: transparent;
269
+ &:hover {
270
+ cursor: ew-resize;
271
+ background: var(--color-primary);
272
+ }
273
+ }
274
+ }
200
275
  }
201
276
  </style>
@@ -131,6 +131,9 @@ export default {
131
131
  font-size: var(--icon-default);
132
132
  }
133
133
  }
134
+ .base-icon-wrap + .base-icon-wrap {
135
+ margin-left: var(--margin-4);
136
+ }
134
137
  .event {
135
138
  cursor: pointer;
136
139
  transition: all 0.3s var(--ease-out);
@@ -148,10 +151,7 @@ export default {
148
151
  .disable {
149
152
  cursor: not-allowed;
150
153
  i {
151
- color: var(--color-gray-d) !important;
154
+ color: var(--text-disabled) !important;
152
155
  }
153
156
  }
154
- .plain + .plain {
155
- margin-left: var(--margin-4);
156
- }
157
157
  </style>
@@ -70,7 +70,7 @@ export default {
70
70
  tableId: {
71
71
  type: String,
72
72
  },
73
- heigth: {
73
+ height: {
74
74
  default: "auto",
75
75
  },
76
76
  },
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <el-popover
3
+ ref="popover"
3
4
  v-model="module"
4
5
  :trigger="trigger"
5
6
  @show="popoverShow"
@@ -12,6 +13,7 @@
12
13
  </div>
13
14
  </template>
14
15
  <el-button
16
+ v-if="!template"
15
17
  slot="reference"
16
18
  :size="buttonSize"
17
19
  :disabled="disabled"
@@ -31,6 +33,9 @@
31
33
  ></base-icon>
32
34
  <span class="inner-span" v-if="buttonText"> {{ buttonText }}</span>
33
35
  </el-button>
36
+ <template slot="reference" v-else>
37
+ <slot name="popoverReference"></slot>
38
+ </template>
34
39
  </el-popover>
35
40
  </template>
36
41
 
@@ -84,6 +89,11 @@ export default {
84
89
  type: String,
85
90
  default: "meixi",
86
91
  },
92
+
93
+ template: {
94
+ type: Boolean,
95
+ default: false,
96
+ },
87
97
  },
88
98
  computed: {
89
99
  module: {
@@ -103,7 +113,7 @@ export default {
103
113
  this.$emit("poporverHide");
104
114
  },
105
115
  iconClick() {
106
- this.module = true;
116
+ this.module = !this.module;
107
117
  },
108
118
  },
109
119
  };
@@ -41,6 +41,7 @@ import DynamicMountClass from "./dynamicmount/DynamicMount";
41
41
  import SelectStore from "../config/selectStore/SelectStore";
42
42
  //
43
43
  import useImg from "../config/use/UseImg";
44
+ import UseDrag from "../config/use/useDrag";
44
45
  import useFixedHeader from "../config/use/useFixedHeader";
45
46
 
46
47
  const meixicomponents = [
@@ -134,6 +135,7 @@ export default {
134
135
  Theme,
135
136
  SelectStore,
136
137
  useImg,
138
+ UseDrag,
137
139
  useFixedHeader,
138
140
  DynamicMountClass,
139
141
  };
@@ -1,8 +1,10 @@
1
1
  <template>
2
2
  <base-dialog
3
- :title="title"
3
+ :top="top"
4
4
  ref="dialog"
5
- :width="`1000px`"
5
+ :title="title"
6
+ :width="width"
7
+ :onDrag="onDrag"
6
8
  :isDestroy="true"
7
9
  :contentHeight="`50vh`"
8
10
  >
@@ -48,10 +50,24 @@ import baseButtonHandleVue from "../../base/baseButtonHandle/baseButtonHandle.vu
48
50
  export default {
49
51
  name: "baseDialogForm",
50
52
  data() {
51
- return {
52
- };
53
+ return {};
53
54
  },
54
55
  props: {
56
+ top: {
57
+ type: Number,
58
+ default: () => {
59
+ return document.documentElement.clientHeight * 0.15;
60
+ },
61
+ },
62
+ // 是否开启拖拽
63
+ onDrag: {
64
+ type: Boolean,
65
+ default: true,
66
+ },
67
+ width: {
68
+ type: [String, Number],
69
+ default: `1000px`,
70
+ },
55
71
  // 弹窗的标题
56
72
  title: {
57
73
  type: String,
@@ -131,9 +147,7 @@ export default {
131
147
  return validateResult;
132
148
  },
133
149
  },
134
- watch: {
135
-
136
- },
150
+ watch: {},
137
151
  };
138
152
  </script>
139
153