jobsys-explore 4.0.13 → 4.0.15
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/.changeset/healthy-candles-wink.md +5 -0
- package/.changeset/modern-clocks-notice.md +5 -0
- package/CHANGELOG.md +37 -0
- package/components/form/ExCascader.jsx +1 -1
- package/components/form/ExDate.jsx +20 -11
- package/components/form/ExForm.jsx +13 -2
- package/components/search/ExSearch.jsx +1 -1
- package/dist/jobsys-explore.cjs +6 -6
- package/dist/jobsys-explore.cjs.map +1 -1
- package/dist/jobsys-explore.js +597 -595
- package/dist/jobsys-explore.js.map +1 -1
- package/package.json +1 -1
- package/playground/TestForm.vue +71 -48
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# jobsys-explore
|
|
2
2
|
|
|
3
|
+
## 4.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- address
|
|
8
|
+
- y
|
|
9
|
+
- add exPros parameter
|
|
10
|
+
- option fetch data only once
|
|
11
|
+
- add form reset
|
|
12
|
+
- fixed
|
|
13
|
+
- add sm2 encrypt
|
|
14
|
+
- form expose fetchItem method
|
|
15
|
+
- fixed address modelValue
|
|
16
|
+
- fixed textInValue
|
|
17
|
+
- fixed textInValue
|
|
18
|
+
- add key_cn
|
|
19
|
+
- search watch model value
|
|
20
|
+
- e
|
|
21
|
+
|
|
22
|
+
## 4.0.14
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- address
|
|
27
|
+
- add exPros parameter
|
|
28
|
+
- option fetch data only once
|
|
29
|
+
- add form reset
|
|
30
|
+
- fixed
|
|
31
|
+
- add sm2 encrypt
|
|
32
|
+
- form expose fetchItem method
|
|
33
|
+
- fixed address modelValue
|
|
34
|
+
- fixed textInValue
|
|
35
|
+
- fixed textInValue
|
|
36
|
+
- add key_cn
|
|
37
|
+
- search watch model value
|
|
38
|
+
- e
|
|
39
|
+
|
|
3
40
|
## 4.0.13
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
|
@@ -23,13 +23,8 @@ export default defineComponent({
|
|
|
23
23
|
emits: ["update:modelValue"],
|
|
24
24
|
setup(props, { emit, slots, expose }) {
|
|
25
25
|
const columnsType = props.defaultProps?.columnsType || ["year", "month", "day"]
|
|
26
|
-
const prepareDate = (date) => {
|
|
27
|
-
const value = []
|
|
28
|
-
|
|
29
|
-
if (!date) {
|
|
30
|
-
return value
|
|
31
|
-
}
|
|
32
26
|
|
|
27
|
+
const _setValueByColumns = (columnsType, value, date) => {
|
|
33
28
|
columnsType.forEach((column) => {
|
|
34
29
|
if (column === "year") {
|
|
35
30
|
value.push(date.getFullYear())
|
|
@@ -39,15 +34,23 @@ export default defineComponent({
|
|
|
39
34
|
value.push(date.getDate())
|
|
40
35
|
}
|
|
41
36
|
})
|
|
42
|
-
|
|
43
37
|
return value
|
|
44
38
|
}
|
|
39
|
+
const prepareDate = (date) => {
|
|
40
|
+
const value = []
|
|
41
|
+
|
|
42
|
+
if (!date) {
|
|
43
|
+
return value
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return _setValueByColumns(columnsType, value, date)
|
|
47
|
+
}
|
|
45
48
|
|
|
46
49
|
let defaultValue = prepareDate(props.modelValue)
|
|
47
50
|
|
|
48
51
|
if (!defaultValue.length) {
|
|
49
52
|
const now = new Date()
|
|
50
|
-
defaultValue =
|
|
53
|
+
defaultValue = _setValueByColumns(columnsType, defaultValue, now)
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
const componentValue = ref(defaultValue)
|
|
@@ -66,11 +69,17 @@ export default defineComponent({
|
|
|
66
69
|
let text = ""
|
|
67
70
|
columnsType.forEach((column) => {
|
|
68
71
|
if (column === "year") {
|
|
69
|
-
text +=
|
|
72
|
+
text += props.modelValue.getFullYear()
|
|
70
73
|
} else if (column === "month") {
|
|
71
|
-
|
|
74
|
+
if (text) {
|
|
75
|
+
text += "/"
|
|
76
|
+
}
|
|
77
|
+
text += padZero(props.modelValue.getMonth() + 1, 2)
|
|
72
78
|
} else if (column === "day") {
|
|
73
|
-
|
|
79
|
+
if (text) {
|
|
80
|
+
text += "/"
|
|
81
|
+
}
|
|
82
|
+
text += padZero(props.modelValue.getDate(), 2)
|
|
74
83
|
}
|
|
75
84
|
})
|
|
76
85
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, defineComponent, inject, onMounted, reactive, ref, watch } from "vue"
|
|
1
|
+
import { computed, defineComponent, inject, nextTick, onMounted, reactive, ref, watch } from "vue"
|
|
2
2
|
import { EX_UPLOADER, EX_FORM } from "../provider/ExProvider.jsx"
|
|
3
3
|
import { cloneDeep, every, isEqual, isFunction, isObject, isString, pick } from "lodash-es"
|
|
4
4
|
import { initItemDefaultValue } from "./utils"
|
|
@@ -354,7 +354,18 @@ export default defineComponent({
|
|
|
354
354
|
return !isEqual(state.submitForm, state.submitFormBackup)
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
|
|
357
|
+
/**
|
|
358
|
+
* 重置表单
|
|
359
|
+
* @param {Object} formData 表单数据
|
|
360
|
+
*/
|
|
361
|
+
const reset = (formData) => {
|
|
362
|
+
initFormData(formData)
|
|
363
|
+
nextTick(() => {
|
|
364
|
+
formRef.value.resetValidation()
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
expose({ getForm, getFormStandalone, setForm, isDirty, fetchItem, reset })
|
|
358
369
|
|
|
359
370
|
/********** render **********/
|
|
360
371
|
|