doway-coms 2.11.41 → 2.11.42

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": "doway-coms",
3
- "version": "2.11.41",
3
+ "version": "2.11.42",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -29,6 +29,7 @@
29
29
  style="width: 100%"
30
30
  @change="change"
31
31
  :class="{ 'd-error-input': v.errors.length > 0 }"
32
+ :dropdown-class-name="getDatePickerClass({disablePrevYearBtn, disableNextYearBtn})"
32
33
  />
33
34
  <div class="d-error-msg">
34
35
  {{ v.errors[0] }}
@@ -45,19 +46,23 @@
45
46
  </div>
46
47
  </div>
47
48
  </template>
48
-
49
+
49
50
  <script>
50
51
  //VXETable插件
51
52
  import VXETable from "vxe-table";
52
53
  //轻量级剪贴板复制函数
53
54
  import XEClipboard from "xe-clipboard";
54
- import { DatePicker, Tooltip } from "ant-design-vue";
55
+ import {DatePicker as a, DatePicker as a, DatePicker, Tooltip} from "ant-design-vue";
55
56
  import { ValidationProvider } from "vee-validate";
56
57
  import moment from "moment";
58
+ import {DatePicker as a
59
+ import {DatePicker as a
57
60
 
58
61
  export default {
59
62
  name: "BaseDate",
60
63
  components: {
64
+ a-date - picker,
65
+ a-date - picker,
61
66
  DatePicker,
62
67
  ValidationProvider,
63
68
  Tooltip,
@@ -150,6 +155,18 @@ export default {
150
155
  return 0;
151
156
  },
152
157
  },
158
+ disablePrevYearBtn: {
159
+ type: Boolean,
160
+ default: function () {
161
+ return false;
162
+ },
163
+ },
164
+ disableNextYearBtn: {
165
+ type: Boolean,
166
+ default: function () {
167
+ return false;
168
+ },
169
+ },
153
170
  },
154
171
  created() {},
155
172
  methods: {
@@ -159,7 +176,7 @@ export default {
159
176
  {
160
177
  icon: 'ant-design:folder-open-filled',
161
178
  label: "复制",
162
- onClick: () => {
179
+ onClick: () => {
163
180
  if (XEClipboard.copy(currentValue)) {
164
181
  VXETable.modal.message({
165
182
  content: "已复制到剪贴板!",
@@ -188,11 +205,35 @@ export default {
188
205
  current.diff(moment().add(this.disabledDateValue, "day"), "days") < 0
189
206
  );
190
207
  },
208
+ getDatePickerClass({disablePrevYearBtn, disableNextYearBtn}) {
209
+ const classes = [];
210
+
211
+ if (disablePrevYearBtn) {
212
+ classes.push('hide-prev-year');
213
+ }
214
+
215
+ if (disableNextYearBtn) {
216
+ classes.push('hide-next-year');
217
+ }
218
+
219
+ return classes.join(' ');
220
+ },
191
221
  },
192
222
  };
193
223
  </script>
194
-
224
+
195
225
  <style lang="less">
196
226
  @import "../../styles/default.less";
197
227
  </style>
198
-
228
+
229
+ <style>
230
+ /* 隐藏上一年按钮 */
231
+ .hide-prev-year .ant-calendar-prev-year-btn {
232
+ display: none !important;
233
+ }
234
+
235
+ /* 隐藏下一年按钮 */
236
+ .hide-next-year .ant-calendar-next-year-btn {
237
+ display: none !important;
238
+ }
239
+ </style>
@@ -138,6 +138,8 @@
138
138
  :pastDate="col.pastDate"
139
139
  :rules="col.rules"
140
140
  :disabledDateValue="col.disabledDateValue"
141
+ :disablePrevYearBtn="col.disablePrevYearBtn"
142
+ :disableNextYearBtn="col.disableNextYearBtn"
141
143
  @change="
142
144
  () => {
143
145
  inputChange(col)
@@ -157,6 +159,8 @@
157
159
  :edit="col.edit"
158
160
  :rules="col.rules"
159
161
  :disabledDateValue="col.disabledDateValue"
162
+ :disablePrevYearBtn="col.disablePrevYearBtn"
163
+ :disableNextYearBtn="col.disableNextYearBtn"
160
164
  @change="
161
165
  () => {
162
166
  inputChange(col)
@@ -234,6 +234,7 @@
234
234
  <a-date-picker
235
235
  v-model="scope.row[scope.column.property]"
236
236
  class="inner-cell-control"
237
+ :dropdown-class-name="getDatePickerClass(scope)"
237
238
  size="small"
238
239
  @change="cellValueChange(scope)"
239
240
  value-format="YYYY-MM-DD"
@@ -245,7 +246,8 @@
245
246
  <div class="interceptor-class">
246
247
  <a-date-picker
247
248
  :style="{color:scope.column.params.fontColor?scope.column.params.fontColor:null}"
248
- v-model="scope.row[scope.column.property]"
249
+ :dropdown-class-name="getDatePickerClass(scope)"
250
+ v-model="scope.row[scope.column.property]"
249
251
  format="YYYY-MM-DD HH:mm:ss"
250
252
  size="small"
251
253
  value-format="YYYY-MM-DD HH:mm:ss"
@@ -2673,7 +2675,7 @@ export default {
2673
2675
  let commonColumns =XEUtils.orderBy(XEUtils.filter(tableCollectColumn,p=>p.fixed!=='left' && p.fixed!=='right'),p=>p.sortNumber)
2674
2676
  //最后再试固定列右边
2675
2677
  let rightColumns =XEUtils.orderBy(XEUtils.filter(tableCollectColumn,p=>p.fixed==='right'),p=>p.sortNumber)
2676
-
2678
+
2677
2679
  tempColumns = [...leftColumns,...commonColumns,...rightColumns]
2678
2680
  // console.debug('tableCollectColumn',tempColumns)
2679
2681
  if (this.isSeqPopover) {
@@ -3160,7 +3162,7 @@ export default {
3160
3162
  },
3161
3163
  reloadColumn(columns) {
3162
3164
  this.internalColumns = []
3163
-
3165
+
3164
3166
  columns.forEach((column) => {
3165
3167
  this.internalColumns.push(this.initColumns(column))
3166
3168
  })
@@ -3188,7 +3190,7 @@ export default {
3188
3190
  },
3189
3191
  })
3190
3192
  }
3191
-
3193
+
3192
3194
  //设置验证规则信息,如果没有验证规则的情况下一定要设置null值,设置{}的话会导致点击编辑行会有问题
3193
3195
  this.editRules =XEUtils.isEmpty(this.validRules)?null:this.validRules
3194
3196
 
@@ -3995,7 +3997,7 @@ export default {
3995
3997
  // const pastDate = picker.getAttribute('custom-pastDate');
3996
3998
  // const disabledDateValue = picker.getAttribute('custom-disabledDateValue');
3997
3999
  // // 这里获取到的 column 是字符串形式,可能需要转换为对象
3998
- // const columnObj = JSON.parse(column);
4000
+ // const columnObj = JSON.parse(column);
3999
4001
  // console.debug('columnObj',columnObj)
4000
4002
  return false
4001
4003
  // if (params.pastDate === true) {
@@ -4051,6 +4053,21 @@ export default {
4051
4053
  // EQ、NE、NI、IN
4052
4054
  return !edit
4053
4055
  },
4056
+ getDatePickerClass(scope) {
4057
+ const { disablePrevYearBtn, disableNextYearBtn } = scope.column.params;
4058
+
4059
+ const classes = [];
4060
+
4061
+ if (disablePrevYearBtn) {
4062
+ classes.push('hide-prev-year');
4063
+ }
4064
+
4065
+ if (disableNextYearBtn) {
4066
+ classes.push('hide-next-year');
4067
+ }
4068
+
4069
+ return classes.join(' ');
4070
+ },
4054
4071
  },
4055
4072
  }
4056
4073
  </script>
@@ -4064,7 +4081,7 @@ export default {
4064
4081
  }
4065
4082
  .vxe-table--render-default .vxe-body--row.row--current{
4066
4083
  background-color:#9accff !important;
4067
- }
4084
+ }
4068
4085
  .vxe-body--row.row--hover{
4069
4086
  background-color: #bfbfbf!important;
4070
4087
  }*/
@@ -4280,3 +4297,14 @@ export default {
4280
4297
  border-color: #1890ff;
4281
4298
  }
4282
4299
  </style>
4300
+ <style>
4301
+ /* 隐藏上一年按钮 */
4302
+ .hide-prev-year .ant-calendar-prev-year-btn {
4303
+ display: none !important;
4304
+ }
4305
+
4306
+ /* 隐藏下一年按钮 */
4307
+ .hide-next-year .ant-calendar-next-year-btn {
4308
+ display: none !important;
4309
+ }
4310
+ </style>