meixioacomponent 0.2.25 → 0.2.28

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.2.25",
3
+ "version": "0.2.28",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="table-wrap">
3
- <el-table ref="elTable" :data="tableData">
3
+ <el-table ref="elTable" :data="tableData" :id="id" :height="height">
4
4
  <!-- 表格暂无数据 -->
5
5
  <template slot="empty">
6
6
  <baseDefaultSvgVue
@@ -44,7 +44,14 @@ import baseDefaultSvgVue from "../baseDefaultSvg/baseDefaultSvg.vue";
44
44
  export default {
45
45
  name: "basePlainTable",
46
46
  data() {
47
- return {};
47
+ return {
48
+ id: null,
49
+ };
50
+ },
51
+ created() {
52
+ if (this.$props.tableId) {
53
+ this.id = this.$props.tableId;
54
+ }
48
55
  },
49
56
  components: {
50
57
  baseDefaultSvgVue,
@@ -59,6 +66,13 @@ export default {
59
66
  type: Array,
60
67
  require: true,
61
68
  },
69
+
70
+ tableId: {
71
+ type: String,
72
+ },
73
+ height: {
74
+ default: "auto",
75
+ },
62
76
  },
63
77
  };
64
78
  </script>
@@ -20,14 +20,14 @@
20
20
  >
21
21
  <base-icon
22
22
  :size="`s`"
23
- :color="module ? 'text-white' : 'd'"
24
23
  :plain="true"
25
- :event="true"
26
24
  v-if="buttonIcon"
25
+ :event="!disabled"
27
26
  :name="buttonIcon"
28
27
  class="button-icon"
29
28
  :iconClass="iconClass"
30
29
  @iconClick="iconClick"
30
+ :color="module ? 'text-white' : 'd'"
31
31
  ></base-icon>
32
32
  <span class="inner-span" v-if="buttonText"> {{ buttonText }}</span>
33
33
  </el-button>
@@ -70,14 +70,16 @@
70
70
  <div class="item-handle-wrap" :class="[`${config.type}`]" v-else>
71
71
  <!-- input输入框 -->
72
72
  <el-input
73
- v-if="config.type == 'input'"
73
+ ref="target"
74
74
  :size="size"
75
75
  v-model="module"
76
+ v-if="config.type == 'input'"
76
77
  style="width: 100%; height: 100%"
77
78
  >
78
79
  </el-input>
79
80
  <!-- 数字类型无小数 -->
80
81
  <el-input-number
82
+ ref="target"
81
83
  :size="size"
82
84
  v-else-if="config.type == 'number'"
83
85
  v-model.number="module"
@@ -86,6 +88,7 @@
86
88
  <!--数字类型两位小数 -->
87
89
  <el-input-number
88
90
  :size="size"
91
+ ref="target"
89
92
  :precision="2"
90
93
  v-model.number="module"
91
94
  :controls="false"
@@ -94,6 +97,7 @@
94
97
  <!-- select选择器 -->
95
98
  <el-select
96
99
  :size="size"
100
+ ref="target"
97
101
  v-model="module"
98
102
  placeholder="请选择"
99
103
  :multiple="multiple"
@@ -107,8 +111,8 @@
107
111
  <el-option
108
112
  v-for="item in selectData"
109
113
  :key="item.value"
110
- :label="item[`${selectLabelKey}`]"
111
- :value="item[`${selectValueKey}`]"
114
+ :label="item[`${selectConfig.label}`]"
115
+ :value="item[`${selectConfig.value}`]"
112
116
  >
113
117
  </el-option>
114
118
  </el-select>
@@ -118,6 +122,7 @@
118
122
  align="right"
119
123
  v-model="module"
120
124
  :size="size"
125
+ ref="target"
121
126
  placeholder="选择日期"
122
127
  value-format="timestamp"
123
128
  :prefix-icon="`el-icon-time`"
@@ -158,6 +163,7 @@
158
163
  <!-- 文本输入框 -->
159
164
  <el-input
160
165
  autosize
166
+ ref="target"
161
167
  :size="size"
162
168
  type="textarea"
163
169
  v-model="module"
@@ -236,27 +242,10 @@ export default {
236
242
  return this.selectStore.getData();
237
243
  },
238
244
 
239
- selectLabelKey() {
240
- let config = this.$props.config?.config;
241
-
242
- if (config) {
243
- return config.label.key;
244
- } else {
245
- return `label`;
246
- }
247
- },
248
- selectValueKey() {
249
- let config = this.$props.config?.config;
250
-
251
- if (config) {
252
- return config.value.key;
253
- } else {
254
- return `value`;
255
- }
245
+ selectConfig() {
246
+ return this.selectStore.getConfig();
256
247
  },
257
248
 
258
- selectValue() {},
259
-
260
249
  spContentType() {
261
250
  let configType = this.$props.config.type;
262
251
  if (
@@ -361,6 +350,9 @@ export default {
361
350
  switch (type) {
362
351
  case "edit":
363
352
  this.isEdit = !this.isEdit;
353
+ this.$nextTick(() => {
354
+ this.targetFocus();
355
+ });
364
356
  if (this.isEdit) {
365
357
  this.oldValue = this.value;
366
358
  } else {
@@ -381,11 +373,17 @@ export default {
381
373
  break;
382
374
  }
383
375
  },
376
+ targetFocus() {
377
+ let ref = this.$refs.target;
378
+ console.log(ref);
379
+ if (ref) {
380
+ ref.focus();
381
+ }
382
+ },
384
383
  handleConfirm() {
385
384
  this.isEdit = false;
386
385
  },
387
386
  loadSelectData() {
388
-
389
387
  this.selectStore.loadData();
390
388
  },
391
389
  visibleChange(visible) {
@@ -4,6 +4,10 @@ class SelectStore {
4
4
  this.loading = false;
5
5
  this.name = params.name;
6
6
  this.request = params.request;
7
+ this.config = {
8
+ label: "label",
9
+ value: "value",
10
+ };
7
11
  }
8
12
 
9
13
  async loadData() {
@@ -20,6 +24,10 @@ class SelectStore {
20
24
  getData() {
21
25
  return this.data;
22
26
  }
27
+
28
+ getConfig() {
29
+ return this.config;
30
+ }
23
31
  getLoading() {
24
32
  return this.loading;
25
33
  }