doway-coms 2.11.41 → 2.11.43

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.43",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div class="d-control-container">
3
3
  <div
4
- class="d-control-label"
5
- :style="{ width: labelWidth > 0 ? labelWidth + 'px' : 'none' }"
4
+ class="d-control-label"
5
+ :style="{ width: labelWidth > 0 ? labelWidth + 'px' : 'none' }"
6
6
  >
7
7
  {{ label }}
8
8
  <span v-if="rules && rules['required']" class="d-control-label-required"
9
- >*</span
9
+ >*</span
10
10
  >
11
11
  <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
12
12
  <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
@@ -14,21 +14,22 @@
14
14
  </div>
15
15
  <div class="d-control">
16
16
  <ValidationProvider
17
- :name="label"
18
- v-slot="v"
19
- :rules="rules"
20
- v-if="edit === true"
17
+ :name="label"
18
+ v-slot="v"
19
+ :rules="rules"
20
+ v-if="edit === true"
21
21
  >
22
22
  <DatePicker
23
- :size="'small'"
24
- placeholder="选择日期"
25
- v-model="currentValue"
26
- :disabled-date="disabledDate"
27
- format="YYYY-MM-DD"
28
- value-format="YYYY-MM-DD"
29
- style="width: 100%"
30
- @change="change"
31
- :class="{ 'd-error-input': v.errors.length > 0 }"
23
+ :size="'small'"
24
+ placeholder="选择日期"
25
+ v-model="currentValue"
26
+ :disabled-date="disabledDate"
27
+ format="YYYY-MM-DD"
28
+ value-format="YYYY-MM-DD"
29
+ style="width: 100%"
30
+ @change="change"
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,7 +46,7 @@
45
46
  </div>
46
47
  </div>
47
48
  </template>
48
-
49
+
49
50
  <script>
50
51
  //VXETable插件
51
52
  import VXETable from "vxe-table";
@@ -150,6 +151,18 @@ export default {
150
151
  return 0;
151
152
  },
152
153
  },
154
+ disablePrevYearBtn: {
155
+ type: Boolean,
156
+ default: function () {
157
+ return false;
158
+ },
159
+ },
160
+ disableNextYearBtn: {
161
+ type: Boolean,
162
+ default: function () {
163
+ return false;
164
+ },
165
+ },
153
166
  },
154
167
  created() {},
155
168
  methods: {
@@ -159,7 +172,7 @@ export default {
159
172
  {
160
173
  icon: 'ant-design:folder-open-filled',
161
174
  label: "复制",
162
- onClick: () => {
175
+ onClick: () => {
163
176
  if (XEClipboard.copy(currentValue)) {
164
177
  VXETable.modal.message({
165
178
  content: "已复制到剪贴板!",
@@ -184,15 +197,37 @@ export default {
184
197
  return false;
185
198
  }
186
199
  return (
187
- current &&
188
- current.diff(moment().add(this.disabledDateValue, "day"), "days") < 0
200
+ current &&
201
+ current.diff(moment().add(this.disabledDateValue, "day"), "days") < 0
189
202
  );
190
203
  },
204
+ getDatePickerClass({ disablePrevYearBtn, disableNextYearBtn }) {
205
+
206
+ const classes = [];
207
+
208
+ if (disablePrevYearBtn) {
209
+ classes.push('hide-prev-year');
210
+ }
211
+
212
+ if (disableNextYearBtn) {
213
+ classes.push('hide-next-year');
214
+ }
215
+
216
+ return classes.join(' ');
217
+ },
191
218
  },
192
219
  };
193
220
  </script>
194
-
195
- <style lang="less">
221
+
222
+ <style lang="less">
196
223
  @import "../../styles/default.less";
197
224
  </style>
198
-
225
+ /* 隐藏上一年按钮 */
226
+ .hide-prev-year .ant-calendar-prev-year-btn {
227
+ display: none !important;
228
+ }
229
+
230
+ /* 隐藏下一年按钮 */
231
+ .hide-next-year .ant-calendar-next-year-btn {
232
+ display: none !important;
233
+ }
@@ -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>