vue2-client 1.19.0 → 1.19.2

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": "vue2-client",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,3 +1,3 @@
1
- import AmapPointRendering from './AmapPointRendering'
2
-
3
- export default AmapPointRendering
1
+ import AmapPointRendering from './AmapPointRendering'
2
+
3
+ export default AmapPointRendering
@@ -11,7 +11,7 @@ export default {
11
11
  }
12
12
  },
13
13
  mounted() {
14
- getConfigByNameAsync('CardSellGasForm', 'af-revenue').then(res => {
14
+ getConfigByNameAsync('测试Form', 'af-safecheck').then(res => {
15
15
  this.$refs.xAddFrom.init(
16
16
  Object.assign(res, {
17
17
  modifyModelData: {
@@ -199,6 +199,80 @@ export default {
199
199
  }
200
200
  }
201
201
  return {}
202
+ },
203
+ // 日期范围限制函数
204
+ disabledDate () {
205
+ // 查询模式下不进行范围限制
206
+ if (this.mode === '查询') {
207
+ return undefined
208
+ }
209
+
210
+ const dateRangeOption = this.attr.dateRangeOption
211
+ if (!dateRangeOption || !dateRangeOption.type) {
212
+ return undefined
213
+ }
214
+
215
+ const { type, beforeDays, afterDays } = dateRangeOption
216
+ const today = moment().startOf('day')
217
+
218
+ return (current) => {
219
+ // 根据组件类型处理不同的时间粒度
220
+ let currentDate, comparisonDate
221
+
222
+ if (['monthPicker', 'monthRangePicker'].includes(this.attr.type)) {
223
+ // 月份选择器:比较月份
224
+ currentDate = moment(current).startOf('month')
225
+ comparisonDate = moment(today).startOf('month')
226
+ } else if (['yearPicker', 'yearRangePicker'].includes(this.attr.type)) {
227
+ // 年份选择器:比较年份
228
+ currentDate = moment(current).startOf('year')
229
+ comparisonDate = moment(today).startOf('year')
230
+ } else {
231
+ // 日期选择器:比较日期
232
+ currentDate = moment(current).startOf('day')
233
+ comparisonDate = today
234
+ }
235
+
236
+ switch (type) {
237
+ case 'afterToday':
238
+ // 只能选择今天及以后的日期/月份/年份
239
+ return currentDate.isBefore(comparisonDate)
240
+ case 'beforeToday':
241
+ // 只能选择今天及以前的日期/月份/年份
242
+ return currentDate.isAfter(comparisonDate)
243
+ case 'custom':
244
+ // 自定义范围:beforeDays(今天前多少天)、afterDays(今天后多少天)
245
+ if (beforeDays && beforeDays > 0) {
246
+ let minDate
247
+ if (['monthPicker', 'monthRangePicker'].includes(this.attr.type)) {
248
+ minDate = moment(comparisonDate).subtract(beforeDays, 'months')
249
+ } else if (['yearPicker', 'yearRangePicker'].includes(this.attr.type)) {
250
+ minDate = moment(comparisonDate).subtract(beforeDays, 'years')
251
+ } else {
252
+ minDate = moment(comparisonDate).subtract(beforeDays, 'days')
253
+ }
254
+ if (currentDate.isBefore(minDate)) {
255
+ return true
256
+ }
257
+ }
258
+ if (afterDays && afterDays > 0) {
259
+ let maxDate
260
+ if (['monthPicker', 'monthRangePicker'].includes(this.attr.type)) {
261
+ maxDate = moment(comparisonDate).add(afterDays, 'months')
262
+ } else if (['yearPicker', 'yearRangePicker'].includes(this.attr.type)) {
263
+ maxDate = moment(comparisonDate).add(afterDays, 'years')
264
+ } else {
265
+ maxDate = moment(comparisonDate).add(afterDays, 'days')
266
+ }
267
+ if (currentDate.isAfter(maxDate)) {
268
+ return true
269
+ }
270
+ }
271
+ return false
272
+ default:
273
+ return false
274
+ }
275
+ }
202
276
  }
203
277
  },
204
278
  methods: {
@@ -234,6 +308,7 @@ export default {
234
308
  :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
235
309
  v-model="localValue"
236
310
  :disabled="disabled || readOnly"
311
+ :disabledDate="disabledDate"
237
312
  style="width: 100%"
238
313
  :showToday="true"
239
314
  placeholder="请选择日期"
@@ -251,6 +326,7 @@ export default {
251
326
  :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
252
327
  v-model="localValue"
253
328
  :disabled="disabled || readOnly"
329
+ :disabledDate="disabledDate"
254
330
  :show-time="true"
255
331
  placeholder="请选择月份"
256
332
  :valueFormat="formatType"
@@ -266,6 +342,7 @@ export default {
266
342
  :getPopupContainer="enablePopupToBody? getBodyContainer : undefined"
267
343
  v-model="localValue"
268
344
  :disabled="disabled || readOnly"
345
+ :disabledDate="disabledDate"
269
346
  format="YYYY"
270
347
  :valueFormat="formatType"
271
348
  :open="yearShowOne"
@@ -328,6 +405,7 @@ export default {
328
405
  "
329
406
  v-model="localValue"
330
407
  :disabled="disabled"
408
+ :disabledDate="disabledDate"
331
409
  :placeholder="placeholder"
332
410
  :show-time="
333
411
  ['yearRangePicker', 'monthRangePicker'].includes(attr.type)
@@ -1,3 +1,3 @@
1
- import XDetailsView from './XDetailsView'
2
-
3
- export default XDetailsView
1
+ import XDetailsView from './XDetailsView'
2
+
3
+ export default XDetailsView
@@ -1,3 +1,3 @@
1
- import XFormGroupDetails from './XFormGroupDetails'
2
-
3
- export default XFormGroupDetails
1
+ import XFormGroupDetails from './XFormGroupDetails'
2
+
3
+ export default XFormGroupDetails
@@ -12,7 +12,7 @@
12
12
  <div class="title-content">
13
13
  <div class="title-dot"></div>
14
14
  <a-icon v-if="attrs.icon && !attrs.customIcon" :type="attrs.icon" class="title-icon" />
15
- <XIcon v-if="attrs.customIcon" :name="attrs.customIcon" class="title-icon" />
15
+ <XIcon v-if="attrs.customIcon" :name="attrs.customIcon" class="title-icon"/>
16
16
  <span>{{ config.label }}</span>
17
17
  </div>
18
18
  <div
@@ -33,7 +33,7 @@
33
33
  </template>
34
34
 
35
35
  <script setup>
36
- import { ref, computed, onMounted, useAttrs } from 'vue'
36
+ import {ref, computed, onMounted, useAttrs} from 'vue'
37
37
  import XIcon from '../XIcon/XIcon.vue'
38
38
 
39
39
  const props = defineProps({
@@ -101,11 +101,36 @@ const isShowTopLine = computed(() => {
101
101
  const isShowBottomLine = computed(() => {
102
102
  return attrs.showBottomLine === 'true' || attrs.showBottomLine === true
103
103
  })
104
+ // 暴露方法供外部调用,动态修改标题
105
+ const updateTitle = (newTitle) => {
106
+ if (newTitle !== undefined && newTitle !== null) {
107
+ config.value.label = String(newTitle)
108
+ config.value.type = 'title'
109
+ config.value.line = ''
110
+ config.value.color = ''
111
+ config.value.lineLength = ''
112
+ config.value.clickName = ''
113
+ // 强制更新(以防万一)
114
+ config.value = {...config.value}
115
+ }
116
+ }
117
+
118
+ // 暴露方法供外部调用,动态修改 queryParamsName
119
+ const updateQueryParamsName = (newParams) => {
120
+ parseConfig(newParams)
121
+ }
122
+
104
123
  const handleClick = () => {
105
124
  if (config.value.clickName) {
106
125
  emit(config.value.clickName)
107
126
  }
108
127
  }
128
+
129
+ // 暴露组件方法
130
+ defineExpose({
131
+ updateTitle,
132
+ updateQueryParamsName
133
+ })
109
134
  const parseConfig = (data) => {
110
135
  // 如果设置了title属性,直接使用title作为标签
111
136
  if (props.title) {
@@ -156,6 +181,7 @@ const parseConfig = (data) => {
156
181
  }
157
182
  }
158
183
 
184
+
159
185
  onMounted(() => {
160
186
  parseConfig(props.queryParamsName)
161
187
  })
@@ -181,6 +207,7 @@ onMounted(() => {
181
207
  overflow: hidden;
182
208
  text-overflow: ellipsis;
183
209
  }
210
+
184
211
  .underline {
185
212
  position: absolute;
186
213
  bottom: 0;
@@ -193,6 +220,7 @@ onMounted(() => {
193
220
  .x-button-container {
194
221
  text-align: right;
195
222
  }
223
+
196
224
  .x-title-center {
197
225
  &.x-title-container,
198
226
  .x-title-container {
@@ -201,6 +229,7 @@ onMounted(() => {
201
229
  }
202
230
  }
203
231
  }
232
+
204
233
  .x-title-littlefont {
205
234
  &.x-title-container,
206
235
  .x-title-container {
@@ -239,6 +268,7 @@ onMounted(() => {
239
268
  align-items: baseline;
240
269
  }
241
270
  }
271
+
242
272
  // 顶部分割线
243
273
  .top-line {
244
274
  width: 100%;
@@ -248,6 +278,7 @@ onMounted(() => {
248
278
  margin: 8px 0;
249
279
  opacity: 1;
250
280
  }
281
+
251
282
  .x-title-dot,
252
283
  .x-title-nodot {
253
284
  &.x-title-container,
@@ -271,12 +302,14 @@ onMounted(() => {
271
302
  }
272
303
  }
273
304
  }
305
+
274
306
  .x-title-yizhu-title {
275
307
  &.x-title-container,
276
308
  .x-title-container {
277
309
  margin-top: 3px;
278
310
  margin-left: 6px;
279
311
  margin-bottom: 7px;
312
+
280
313
  :deep(.x-title) {
281
314
  height: 26px;
282
315
  opacity: 1;
@@ -290,10 +323,12 @@ onMounted(() => {
290
323
  }
291
324
  }
292
325
  }
326
+
293
327
  .x-title-left-title {
294
328
  &.x-title-container,
295
329
  .x-title-container {
296
330
  margin: 15px auto 15px 6px;
331
+
297
332
  :deep(.x-title) {
298
333
  height: 26px;
299
334
  opacity: 1;
@@ -304,6 +339,7 @@ onMounted(() => {
304
339
  }
305
340
  }
306
341
  }
342
+
307
343
  // nodot 样式特有部分
308
344
  .x-title-nodot {
309
345
  &.x-title-container,
@@ -314,12 +350,14 @@ onMounted(() => {
314
350
  }
315
351
  }
316
352
  }
353
+
317
354
  .x-title-line-style {
318
355
  background: #0057FE;
319
356
  height: 2px;
320
357
  }
358
+
321
359
  .x-title-compact {
322
- :deep(.x-title){
360
+ :deep(.x-title) {
323
361
  height: 23px;
324
362
  opacity: 1;
325
363
  font-family: "Source Han Sans";
@@ -6,7 +6,7 @@ export default {
6
6
  components: { WorkflowDetail },
7
7
  mounted () {
8
8
  this.$refs.workFlow.init({
9
- workflowId: 4640
9
+ workflowId: 5958
10
10
  })
11
11
  },
12
12
  methods: {
@@ -61,8 +61,8 @@ routerResource.example = {
61
61
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
62
62
  // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
63
63
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
64
- // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue')
65
- component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue')
64
+ component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue')
65
+ // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue')
66
66
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
67
67
  // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
68
68
  // component: () => import('@vue2-client/base-client/components/common/HIS/demo.vue'),
File without changes