meixioacomponent 0.3.71 → 0.3.74

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "0.3.71",
3
+ "version": "0.3.74",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -10,13 +10,23 @@
10
10
  :close-on-click-modal="false"
11
11
  :close-on-press-escape="false"
12
12
  :append-to-body="appendToBody"
13
- :destroy-on-close="isDestroy"
13
+ :destroy-on-close="destroyOnClose"
14
14
  :visible.sync="centerDialogVisible"
15
15
  :modal-append-to-body="appendToBody"
16
16
  >
17
17
  <div class="dialog-title-wrap" slot="title" ref="dialogTitleWrap">
18
18
  <span>{{ title }}</span>
19
19
  <div class="title-handle-wrap">
20
+ <base-icon
21
+ :size="`d`"
22
+ :color="`d`"
23
+ v-if="isCache"
24
+ :event="true"
25
+ @iconClick="handleCache"
26
+ :iconClass="`element`"
27
+ :name="`el-icon-minus`"
28
+ ></base-icon>
29
+
20
30
  <base-icon
21
31
  :size="`d`"
22
32
  :color="`d`"
@@ -69,6 +79,10 @@ export default {
69
79
  })
70
80
  },
71
81
  beforeDestroy() {
82
+ const { isCache } = this.$props
83
+ if (isCache) {
84
+ this.$store.dispatch('dialogCacheStore/closeCache', this)
85
+ }
72
86
  this.$emit('destroy')
73
87
  },
74
88
  props: {
@@ -122,6 +136,11 @@ export default {
122
136
  type: Boolean,
123
137
  default: true,
124
138
  },
139
+
140
+ isCache: {
141
+ type: Boolean,
142
+ default: true,
143
+ },
125
144
  },
126
145
 
127
146
  computed: {
@@ -130,6 +149,13 @@ export default {
130
149
  height: this.$props.contentHeight,
131
150
  }
132
151
  },
152
+ destroyOnClose() {
153
+ const { isDestroy, isCache } = this.$props
154
+ if (isCache) {
155
+ return false
156
+ }
157
+ return isDestroy
158
+ },
133
159
  },
134
160
  methods: {
135
161
  init() {
@@ -169,18 +195,19 @@ export default {
169
195
  })
170
196
  },
171
197
  closeDialog() {
172
- if (this.$props.isDestroy) {
173
- this.isShow = false
174
- this.$nextTick(() => {
175
- this.$destroy()
176
- })
177
- } else {
178
- this.centerDialogVisible = false
179
- }
198
+ this.isShow = false
199
+ this.$nextTick(() => {
200
+ this.$destroy()
201
+ })
180
202
  },
181
203
  iconClick() {
182
204
  this.closeDialog()
183
205
  },
206
+
207
+ handleCache() {
208
+ this.centerDialogVisible = false
209
+ this.$store.dispatch('dialogCacheStore/pushCache', this)
210
+ },
184
211
  },
185
212
  }
186
213
  </script>
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <div
3
+ tabindex="-1"
4
+ v-show="getRenderShow"
5
+ ref="dialogCacheWrapRef"
6
+ class="dialog-cache-wrap"
7
+ @blur="dialogCacheWrapOnBlue"
8
+ >
9
+ <div class="dialog-no-cache" v-if="getCacheList.length <= 0">
10
+ <baseDefaultSvg
11
+ :width="100"
12
+ :height="100"
13
+ :svgName="`404`"
14
+ :text="`暂无缓存表单`"
15
+ ></baseDefaultSvg>
16
+ </div>
17
+ <div class="dialog-cache-content" v-else>
18
+ <el-button
19
+ type="info"
20
+ :key="index"
21
+ size="medium"
22
+ icon="el-icon-tickets"
23
+ @click="openDialogCache(index)"
24
+ v-for="(item, index) in getCacheList"
25
+ >
26
+ {{ item.title }}
27
+ </el-button>
28
+ </div>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+ import store from '../../../src/store'
34
+ import baseDefaultSvg from '../base/baseDefaultSvg/baseDefaultSvg.vue'
35
+ export default {
36
+ data() {
37
+ return {}
38
+ },
39
+ created() {},
40
+ mounted() {},
41
+ computed: {
42
+ getCacheList() {
43
+ return store.getters['dialogCacheStore/getCacheList']
44
+ },
45
+ getRenderShow() {
46
+ return store.getters['dialogCacheStore/getRenderShow']
47
+ },
48
+ },
49
+ components: { baseDefaultSvg },
50
+ methods: {
51
+ openDialogCache(index) {
52
+ store.commit('dialogCacheStore/OPEN_DIALOG_CACHE', index)
53
+ },
54
+ dialogCacheWrapOnBlue() {
55
+ this.$store.commit('dialogCacheStore/SET_RENDER_SHOW', false)
56
+ },
57
+ },
58
+ watch: {
59
+ getRenderShow(newVal, oldVal) {
60
+ if (newVal) {
61
+ this.$nextTick(() => {
62
+ this.$refs.dialogCacheWrapRef.focus()
63
+ })
64
+ }
65
+ },
66
+ },
67
+ }
68
+ </script>
69
+
70
+ <style lang="less" scoped>
71
+ .dialog-cache-wrap {
72
+ top: 56px;
73
+ left: 0px;
74
+ z-index: 4;
75
+ width: 100vw;
76
+ height: auto;
77
+ position: fixed;
78
+ box-sizing: border-box;
79
+ background: var(--bg-white);
80
+ padding: calc(var(--padding-4) * 2);
81
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
82
+ .dialog-no-cache {
83
+ width: 100%;
84
+ height: auto;
85
+ display: flex;
86
+ align-items: center;
87
+ flex-flow: row nowrap;
88
+ justify-content: center;
89
+ }
90
+ .dialog-cache-content {
91
+ }
92
+ }
93
+ </style>
@@ -6,6 +6,7 @@
6
6
  :width="width"
7
7
  :onDrag="onDrag"
8
8
  :isDestroy="true"
9
+ :isCache="isCache"
9
10
  :contentHeight="contentHeight"
10
11
  @destroy="destroyForDialog"
11
12
  >
@@ -27,7 +28,9 @@
27
28
  :form="true"
28
29
  :size="size"
29
30
  :footer="false"
31
+ ref="proFormVue"
30
32
  :formConfig="item"
33
+ :isDialogForm="true"
31
34
  :disables="disables"
32
35
  :rowNumber="rowNumber"
33
36
  :labelWidth="labelWidth"
@@ -35,7 +38,6 @@
35
38
  :rules="returnRules(item.key)"
36
39
  :labelPosition="setLabelPosition(item.formType)"
37
40
  :formType="item.formType ? item.formType : 'default'"
38
- ref="proFormVue"
39
41
  @disableWatcherResult="disableWatcherResult"
40
42
  >
41
43
  <template v-for="slotItem in slotList">
@@ -59,20 +61,20 @@
59
61
  </template>
60
62
 
61
63
  <script>
62
- import pro_formVue from "../proForm/pro_form.vue";
63
- import baseButtonHandleVue from "../../base/baseButtonHandle/baseButtonHandle.vue";
64
+ import pro_formVue from '../proForm/pro_form.vue'
65
+ import baseButtonHandleVue from '../../base/baseButtonHandle/baseButtonHandle.vue'
64
66
  export default {
65
- name: "baseDialogForm",
67
+ name: 'baseDialogForm',
66
68
  data() {
67
69
  return {
68
70
  slotList: [],
69
- };
71
+ }
70
72
  },
71
73
  created() {
72
- this.createSlots();
74
+ this.createSlots()
73
75
  },
74
76
  beforeDestroy() {
75
- this.$parent.$destroy();
77
+ this.$parent.$destroy()
76
78
  },
77
79
  mounted() {},
78
80
  props: {
@@ -83,7 +85,7 @@ export default {
83
85
  top: {
84
86
  type: Number,
85
87
  default: () => {
86
- return document.documentElement.clientHeight * 0.15;
88
+ return document.documentElement.clientHeight * 0.15
87
89
  },
88
90
  },
89
91
  // 是否开启拖拽
@@ -108,7 +110,7 @@ export default {
108
110
  // 每一个itemlabel的宽度
109
111
  labelWidth: {
110
112
  type: String,
111
- default: "100px",
113
+ default: '100px',
112
114
  },
113
115
  // 弹框尾部
114
116
  footerHandleConfig: {
@@ -121,7 +123,7 @@ export default {
121
123
  },
122
124
  size: {
123
125
  type: String,
124
- default: "small",
126
+ default: 'small',
125
127
  },
126
128
  rowNumber: {
127
129
  type: Number,
@@ -130,17 +132,22 @@ export default {
130
132
 
131
133
  footerButtonSize: {
132
134
  type: String,
133
- default: "small",
135
+ default: 'small',
134
136
  },
135
137
 
136
138
  contentHeight: {
137
139
  type: String,
138
- default: "50vh",
140
+ default: '50vh',
139
141
  },
140
142
  labelPosition: {
141
143
  type: String,
142
144
  default: `right`,
143
145
  },
146
+
147
+ isCache: {
148
+ type: Boolean,
149
+ default: true,
150
+ },
144
151
  },
145
152
  components: {
146
153
  pro_formVue,
@@ -149,102 +156,102 @@ export default {
149
156
  computed: {
150
157
  module: {
151
158
  set(val) {
152
- this.$emit("input", val);
159
+ this.$emit('input', val)
153
160
  },
154
161
  get() {
155
- return this.$props.value;
162
+ return this.$props.value
156
163
  },
157
164
  },
158
165
  },
159
166
  methods: {
160
167
  createSlots() {
161
168
  for (let i = 0; i < this.module.length; i++) {
162
- let item = this.module[i];
169
+ let item = this.module[i]
163
170
  for (let j = 0; j < item.formList.length; j++) {
164
- let citem = item.formList[j];
165
- if (citem.type == "template") {
166
- this.slotList.push(citem.key);
171
+ let citem = item.formList[j]
172
+ if (citem.type == 'template') {
173
+ this.slotList.push(citem.key)
167
174
  }
168
175
  }
169
176
  }
170
177
  },
171
178
  disableWatcherResult(params) {
172
- const { result, type, key } = params;
173
- let index = 0;
174
- let cindex = -1;
179
+ const { result, type, key } = params
180
+ let index = 0
181
+ let cindex = -1
175
182
 
176
183
  for (let i = 0; i < this.module.length; i++) {
177
- let item = this.module[i];
184
+ let item = this.module[i]
178
185
  for (let j = 0; j < item.formList.length; j++) {
179
- let citem = item.formList[j];
186
+ let citem = item.formList[j]
180
187
  if (citem.key == key) {
181
- index = i;
182
- cindex = j;
183
- break;
188
+ index = i
189
+ cindex = j
190
+ break
184
191
  }
185
192
  }
186
193
  }
187
194
 
188
195
  if (cindex > -1) {
189
- let formItem = this.module[index].formList[cindex];
190
- if (type == "hide") {
191
- this.$set(formItem, "renderHide", result);
192
- } else if (type == "disable") {
193
- this.$set(formItem, "disabled", result);
196
+ let formItem = this.module[index].formList[cindex]
197
+ if (type == 'hide') {
198
+ this.$set(formItem, 'renderHide', result)
199
+ } else if (type == 'disable') {
200
+ this.$set(formItem, 'disabled', result)
194
201
  }
195
202
  }
196
203
  },
197
204
  setLabelPosition(type) {
198
205
  if (!type) {
199
- return this.$props.labelPosition;
200
- } else if (type == "upload") {
201
- return "top";
206
+ return this.$props.labelPosition
207
+ } else if (type == 'upload') {
208
+ return 'top'
202
209
  }
203
210
  },
204
211
  returnRules(key) {
205
- let rulesList = this.$props.rulesList;
206
- if (!rulesList) return null;
207
- let listItem = rulesList[`${key}`] ? rulesList[`${key}`] : null;
212
+ let rulesList = this.$props.rulesList
213
+ if (!rulesList) return null
214
+ let listItem = rulesList[`${key}`] ? rulesList[`${key}`] : null
208
215
  if (listItem) {
209
- return listItem;
216
+ return listItem
210
217
  }
211
- return null;
218
+ return null
212
219
  },
213
220
  showDialog() {
214
- this.$refs.dialog.showDialog();
221
+ this.$refs.dialog.showDialog()
215
222
  },
216
223
  closeDialog() {
217
- this.$refs.dialog.closeDialog();
224
+ this.$refs.dialog.closeDialog()
218
225
  },
219
226
 
220
227
  getFormValue() {
221
- let obj = {};
228
+ let obj = {}
222
229
  for (let i = 0; i < this.module.length; i++) {
223
- let result = this.$refs.proFormVue[i].returnFormValue();
230
+ let result = this.$refs.proFormVue[i].returnFormValue()
224
231
  // obj[`${this.module[i].key}`] = result;
225
- obj = { ...obj, ...result };
232
+ obj = { ...obj, ...result }
226
233
  }
227
- return obj;
234
+ return obj
228
235
  },
229
236
  async checkValidate() {
230
- let refs = this.$refs.proFormVue;
231
- let validateResult = true;
237
+ let refs = this.$refs.proFormVue
238
+ let validateResult = true
232
239
  for (let i = 0; i < refs.length; i++) {
233
- let validate = await refs[i].checkValidate();
234
- validateResult = validate.result;
240
+ let validate = await refs[i].checkValidate()
241
+ validateResult = validate.result
235
242
  //console.log(result);
236
243
  if (!validateResult) {
237
- return validateResult;
244
+ return validateResult
238
245
  }
239
246
  }
240
- return validateResult;
247
+ return validateResult
241
248
  },
242
249
  destroyForDialog() {
243
- this.$destroy();
250
+ this.$destroy()
244
251
  },
245
252
  },
246
253
  watch: {},
247
- };
254
+ }
248
255
  </script>
249
256
 
250
257
  <style lang="less" scoped>
@@ -265,7 +272,7 @@ export default {
265
272
  justify-content: flex-start;
266
273
  margin-bottom: var(--margin-4);
267
274
  &::before {
268
- content: "";
275
+ content: '';
269
276
  top: 0px;
270
277
  width: 4px;
271
278
  height: 100%;
@@ -173,6 +173,11 @@ export default {
173
173
  default: 'small',
174
174
  },
175
175
 
176
+ isDialogForm: {
177
+ type: Boolean,
178
+ default: false,
179
+ },
180
+
176
181
  footButtonText: { type: Array, default: () => ['取消', '确定'] },
177
182
  },
178
183
  components: {
@@ -370,8 +375,8 @@ export default {
370
375
  },
371
376
 
372
377
  disableWatcherResult(params) {
373
- const isBaseDialogForm = this.$parent.$options.name == 'baseDialogForm'
374
- if (isBaseDialogForm) {
378
+ const { isDialogForm } = this.$props
379
+ if (isDialogForm) {
375
380
  this.$emit('disableWatcherResult', params)
376
381
  } else {
377
382
  const { result, type, key } = params
@@ -584,6 +584,16 @@ export default {
584
584
  }
585
585
  }
586
586
  }
587
+
588
+ .item-content {
589
+ /deep/ textarea {
590
+ border: 0px !important;
591
+ line-height: 1.9 !important;
592
+ &:hover {
593
+ border-color: transparent !important ;
594
+ }
595
+ }
596
+ }
587
597
  .disabled {
588
598
  cursor: not-allowed !important;
589
599
 
@@ -23,7 +23,11 @@
23
23
  {{ handleScreenText }}
24
24
  <i :class="handleScreenIcon"></i>
25
25
  </el-button>
26
- <el-button size="small" @click="handleOpenProScreen">
26
+ <el-button
27
+ size="small"
28
+ @click="handleOpenProScreen"
29
+ :disabled="proScreenConfig.length <= 0"
30
+ >
27
31
  <i class="meixicomponenticonfont meixicomponenticon-shaixuan"></i>
28
32
  高级筛选
29
33
  </el-button>
@@ -20,11 +20,11 @@
20
20
  :label="item.label"
21
21
  :disabled="item.isCheck"
22
22
  >
23
- <template
24
- ><div @click="typeChange(index)">
23
+ <template>
24
+ <div @click="typeChange(index)">
25
25
  {{ item.label }}
26
- </div></template
27
- >
26
+ </div>
27
+ </template>
28
28
  </el-option>
29
29
  </el-select>
30
30
  </div>
@@ -63,8 +63,7 @@
63
63
  :key="item.value"
64
64
  :value="item.value"
65
65
  :label="item.label"
66
- >
67
- </el-option>
66
+ ></el-option>
68
67
  </el-select>
69
68
  </div>
70
69
  <div class="item-wrap-handle" v-if="!disable">
@@ -74,9 +73,9 @@
74
73
  @iconClick="deleteProscreen"
75
74
  :name="`meixicomponenticon-close`"
76
75
  ></base-icon>
77
- <el-checkbox v-model="item.exposed" :disabled="!item.key"
78
- >外露</el-checkbox
79
- >
76
+ <el-checkbox v-model="item.exposed" :disabled="!item.key">
77
+ 外露
78
+ </el-checkbox>
80
79
  </div>
81
80
  </div>
82
81
  </template>
@@ -86,13 +85,13 @@ export default {
86
85
  data() {
87
86
  return {
88
87
  privateConfigIndex: null,
89
- };
88
+ }
90
89
  },
91
90
  created() {
92
- this.privateConfigIndex = this.$props.configIndex;
91
+ this.privateConfigIndex = this.$props.configIndex
93
92
  },
94
93
  mounted() {
95
- console.log(this.config);
94
+ console.log(this.config)
96
95
  },
97
96
  props: {
98
97
  item: {},
@@ -106,51 +105,53 @@ export default {
106
105
  },
107
106
  computed: {
108
107
  screenItem() {
109
- return this.$props.item;
108
+ return this.$props.item
110
109
  },
111
110
  },
112
111
  methods: {
113
112
  typeChange(index) {
114
- if (this.$props.config[index].isCheck == true) return;
115
- this.privateConfigIndex = index;
116
- this.$props.item.key = this.$props.config[this.privateConfigIndex].key;
117
- this.trigerCheck(this.privateConfigIndex, true);
113
+ if (this.$props.config[index].isCheck == true) return
114
+ this.privateConfigIndex = index
115
+ this.$props.item.key = this.$props.config[this.privateConfigIndex].key
116
+ this.trigerCheck(this.privateConfigIndex, true)
118
117
  },
119
118
 
120
119
  deleteProscreen() {
121
- const { config } = this.$props;
120
+ const { config } = this.$props
122
121
  if (config) {
123
122
  let index = config.findIndex((configItem) => {
124
- return configItem.key == this.item.key;
125
- });
126
- config[index].isCheck = false;
123
+ return configItem.key == this.item.key
124
+ })
125
+ if (index >= 0) {
126
+ config[index].isCheck = false
127
+ }
127
128
  }
128
129
 
129
- this.$emit("deleteProscreenItem");
130
+ this.$emit('deleteProscreenItem')
130
131
  },
131
132
  trigerCheck(index, params) {
132
133
  setTimeout(() => {
133
- this.$props.config[index].isCheck = params;
134
- }, 120);
134
+ this.$props.config[index].isCheck = params
135
+ }, 120)
135
136
  },
136
137
 
137
138
  findProselectList(item) {
138
- const { config } = this.$props;
139
+ const { config } = this.$props
139
140
  let index = config.findIndex((configItem) => {
140
- return configItem.key == item.key;
141
- });
142
- return index;
141
+ return configItem.key == item.key
142
+ })
143
+ return index
143
144
  },
144
145
  },
145
146
 
146
147
  watch: {
147
148
  privateConfigIndex(newVal, oldVal) {
148
149
  if (oldVal != null) {
149
- this.trigerCheck(oldVal, false);
150
+ this.trigerCheck(oldVal, false)
150
151
  }
151
152
  },
152
153
  },
153
- };
154
+ }
154
155
  </script>
155
156
 
156
157
  <style lang="less" scoped>