tianheng-ui 0.1.21 → 0.1.22

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,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.1.21",
4
+ "version": "0.1.22",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -35,7 +35,7 @@
35
35
  <el-form-item label="默认值">
36
36
  <el-input
37
37
  :value="
38
- ['datetimerange', 'daterange', 'monthrange'].includes(
38
+ ['dates', 'datetimerange', 'daterange', 'monthrange'].includes(
39
39
  widget.options.type
40
40
  )
41
41
  ? JSON.stringify(widget.options.defaultValue || [])
@@ -51,16 +51,19 @@
51
51
  </el-form-item>
52
52
 
53
53
  <el-form-item label="显示类型">
54
- <el-select v-model="widget.options.type">
55
- <el-option value="year"></el-option>
56
- <el-option value="month"></el-option>
57
- <el-option value="date"></el-option>
58
- <el-option value="dates"></el-option>
54
+ <el-select v-model="widget.options.type" @change="handleTypeChange">
55
+ <el-option value="year" label="年"></el-option>
56
+ <el-option value="month" label="年月"></el-option>
57
+ <el-option value="date" label="年月日"></el-option>
58
+ <el-option value="dates" label="年月日(多选)"></el-option>
59
59
  <!-- <el-option value="week"></el-option> -->
60
- <el-option value="datetime"></el-option>
61
- <el-option value="monthrange"></el-option>
62
- <el-option value="datetimerange"></el-option>
63
- <el-option value="daterange"></el-option>
60
+ <el-option value="datetime" label="年月日时分秒"></el-option>
61
+ <el-option value="monthrange" label="年月(范围)"></el-option>
62
+ <el-option
63
+ value="datetimerange"
64
+ label="年月日时分秒(范围)"
65
+ ></el-option>
66
+ <el-option value="daterange" label="年月日(范围)"></el-option>
64
67
  </el-select>
65
68
  </el-form-item>
66
69
 
@@ -151,7 +154,48 @@ export default {
151
154
  props: {},
152
155
  mixins: [configComponent],
153
156
  mounted() {},
154
- methods: {}
157
+ methods: {
158
+ handleTypeChange(val) {
159
+ switch (val) {
160
+ case "year":
161
+ this.widget.options.format = "yyyy";
162
+ this.widget.options.defaultValue = "";
163
+ break;
164
+ case "month":
165
+ this.widget.options.format = "yyyy-MM";
166
+ this.widget.options.defaultValue = "";
167
+ break;
168
+ case "date":
169
+ this.widget.options.format = "yyyy-MM-dd";
170
+ this.widget.options.defaultValue = "";
171
+ break;
172
+ case "dates":
173
+ this.widget.options.format = "yyyy-MM-dd";
174
+ this.widget.options.defaultValue = [];
175
+ break;
176
+ case "datetime":
177
+ this.widget.options.format = "yyyy-MM-dd HH:mm:ss";
178
+ this.widget.options.defaultValue = "";
179
+ break;
180
+ case "monthrange":
181
+ this.widget.options.format = "yyyy-MM";
182
+ this.widget.options.defaultValue = [];
183
+ break;
184
+ case "datetimerange":
185
+ this.widget.options.format = "yyyy-MM-dd HH:mm:ss";
186
+ this.widget.options.defaultValue = [];
187
+ break;
188
+ case "daterange":
189
+ this.widget.options.format = "yyyy-MM-dd";
190
+ this.widget.options.defaultValue = [];
191
+ break;
192
+ default:
193
+ this.widget.options.format = "yyyy-MM-dd";
194
+ this.widget.options.defaultValue = "";
195
+ break;
196
+ }
197
+ }
198
+ }
155
199
  };
156
200
  </script>
157
201