doway-coms 1.4.46 → 1.4.47
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,159 +1,166 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<span v-if="rules && rules['required']" class="d-control-label-required"
|
|
2
|
+
<div class="d-control-container">
|
|
3
|
+
<div
|
|
4
|
+
class="d-control-label"
|
|
5
|
+
:style="{ width: labelWidth > 0 ? labelWidth + 'px' : 'none' }"
|
|
6
|
+
>
|
|
7
|
+
{{ label }}
|
|
8
|
+
<span v-if="rules && rules['required']" class="d-control-label-required"
|
|
10
9
|
>*</span
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</div>
|
|
10
|
+
>
|
|
11
|
+
<Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
|
|
12
|
+
<img src="../../styles/icon/help.png" alt="" style="width: 14px" />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="d-control">
|
|
16
|
+
<ValidationProvider
|
|
17
|
+
:name="label"
|
|
18
|
+
v-slot="v"
|
|
19
|
+
:rules="rules"
|
|
20
|
+
v-if="edit === true"
|
|
21
|
+
>
|
|
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 }"
|
|
32
|
+
/>
|
|
33
|
+
<div class="d-error-msg">
|
|
34
|
+
{{ v.errors[0] }}
|
|
35
|
+
</div>
|
|
36
|
+
</ValidationProvider>
|
|
37
|
+
<span v-else>{{ moment(currentValue).format("YYYY-MM-DD") }}</span>
|
|
40
38
|
</div>
|
|
41
|
-
</
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
42
41
|
|
|
43
42
|
<script>
|
|
44
|
-
import { DatePicker } from
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
import { Tooltip } from
|
|
43
|
+
import { DatePicker } from "ant-design-vue";
|
|
44
|
+
import { ValidationProvider } from "vee-validate";
|
|
45
|
+
import moment from "moment";
|
|
46
|
+
import { Tooltip } from "ant-design-vue";
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
export default {
|
|
49
|
+
name: "BaseDate",
|
|
50
|
+
components: {
|
|
51
|
+
DatePicker,
|
|
53
52
|
ValidationProvider,
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
Tooltip,
|
|
56
54
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
moment,
|
|
58
|
+
filterValue: "",
|
|
59
|
+
isInputChanged: false,
|
|
60
|
+
inputTimeout: null,
|
|
61
|
+
searchRows: [],
|
|
62
|
+
filterCols: [],
|
|
63
|
+
gridLoading: false,
|
|
64
|
+
gridPagerConfig: {
|
|
65
|
+
total: 0,
|
|
66
|
+
currentPage: 1,
|
|
67
|
+
pageSize: 10,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
computed: {
|
|
72
|
+
currentValue: {
|
|
73
|
+
// 动态计算currentValue的值
|
|
74
|
+
get: function () {
|
|
75
|
+
return this.value; // 将props中的value赋值给currentValue
|
|
76
|
+
},
|
|
77
|
+
set: function (val) {
|
|
78
|
+
this.$emit("input", val); // 通过$emit触发父组件
|
|
79
|
+
},
|
|
72
80
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.$emit('input', val) // 通过$emit触发父组件
|
|
81
|
-
}
|
|
82
|
-
}
|
|
81
|
+
},
|
|
82
|
+
props: {
|
|
83
|
+
rules: {
|
|
84
|
+
type: Object,
|
|
85
|
+
default: function () {
|
|
86
|
+
return null;
|
|
87
|
+
},
|
|
83
88
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return null
|
|
89
|
-
}
|
|
89
|
+
value: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: function () {
|
|
92
|
+
return "";
|
|
90
93
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
},
|
|
95
|
+
pastDate: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: function () {
|
|
98
|
+
return false;
|
|
96
99
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
},
|
|
101
|
+
labelWidth: {
|
|
102
|
+
type: Number,
|
|
103
|
+
default: function () {
|
|
104
|
+
return 0;
|
|
102
105
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
},
|
|
107
|
+
edit: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: function () {
|
|
110
|
+
return false;
|
|
108
111
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
},
|
|
113
|
+
name: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: function () {
|
|
116
|
+
return "";
|
|
114
117
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
},
|
|
119
|
+
label: {
|
|
120
|
+
type: String,
|
|
121
|
+
default: function () {
|
|
122
|
+
return "";
|
|
120
123
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
},
|
|
125
|
+
placeholder: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: function () {
|
|
128
|
+
return "";
|
|
126
129
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
},
|
|
131
|
+
tooltip: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: function () {
|
|
134
|
+
return "";
|
|
132
135
|
},
|
|
133
|
-
tooltip: {
|
|
134
|
-
type: String,
|
|
135
|
-
default: function() {
|
|
136
|
-
return ''
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
136
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
disabledDateValue: {
|
|
138
|
+
type: Number,
|
|
139
|
+
default: function () {
|
|
140
|
+
return 0;
|
|
144
141
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
created() {},
|
|
145
|
+
methods: {
|
|
146
|
+
change() {
|
|
147
|
+
this.$emit("change");
|
|
148
|
+
},
|
|
149
|
+
disabledDate(current) {
|
|
150
|
+
if (this.pastDate === true) {
|
|
151
|
+
//如果允许过期时间
|
|
152
|
+
return false;
|
|
151
153
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
return (
|
|
155
|
+
current &&
|
|
156
|
+
current.diff(moment().add(this.disabledDateValue, "day"), "days") < 0
|
|
157
|
+
);
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
</script>
|
|
155
162
|
|
|
156
163
|
<style lang="less">
|
|
157
|
-
@import
|
|
164
|
+
@import "../../styles/default.less";
|
|
158
165
|
</style>
|
|
159
166
|
|
|
@@ -135,6 +135,12 @@ export default {
|
|
|
135
135
|
return "";
|
|
136
136
|
},
|
|
137
137
|
},
|
|
138
|
+
disabledDateValue: {
|
|
139
|
+
type: Number,
|
|
140
|
+
default: function () {
|
|
141
|
+
return 0;
|
|
142
|
+
},
|
|
143
|
+
},
|
|
138
144
|
},
|
|
139
145
|
created() {},
|
|
140
146
|
methods: {
|
|
@@ -143,8 +149,7 @@ export default {
|
|
|
143
149
|
//如果允许过期时间
|
|
144
150
|
return false;
|
|
145
151
|
}
|
|
146
|
-
return current && current.diff(moment(), "minutes") < 0;
|
|
147
|
-
// return current && current.isBefore(moment())
|
|
152
|
+
return current && current.diff(moment().add(this.disabledDateValue, 'day'), "minutes") < 0;
|
|
148
153
|
},
|
|
149
154
|
change() {
|
|
150
155
|
this.$emit("change");
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
:tooltip="col.tooltip"
|
|
115
115
|
:pastDate="col.pastDate"
|
|
116
116
|
:rules="col.rules"
|
|
117
|
+
:disabledDateValue="col.disabledDateValue"
|
|
117
118
|
@change="
|
|
118
119
|
() => {
|
|
119
120
|
inputChange(col);
|
|
@@ -132,6 +133,7 @@
|
|
|
132
133
|
:tooltip="col.tooltip"
|
|
133
134
|
:edit="col.edit"
|
|
134
135
|
:rules="col.rules"
|
|
136
|
+
:disabledDateValue="col.disabledDateValue"
|
|
135
137
|
@change="
|
|
136
138
|
() => {
|
|
137
139
|
inputChange(col);
|