doway-coms 2.10.8 → 2.10.9
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,8 +1,8 @@
|
|
|
1
|
-
// 导入组件,组件必须声明 name
|
|
2
|
-
import BaseDateMonth from './src/index.vue';
|
|
3
|
-
// 为组件提供 install 安装方法,供按需引入
|
|
4
|
-
BaseDateMonth.install = function(Vue) {
|
|
5
|
-
Vue.component(BaseDateMonth.name, BaseDateMonth);
|
|
6
|
-
};
|
|
7
|
-
// 默认导出组件
|
|
1
|
+
// 导入组件,组件必须声明 name
|
|
2
|
+
import BaseDateMonth from './src/index.vue';
|
|
3
|
+
// 为组件提供 install 安装方法,供按需引入
|
|
4
|
+
BaseDateMonth.install = function(Vue) {
|
|
5
|
+
Vue.component(BaseDateMonth.name, BaseDateMonth);
|
|
6
|
+
};
|
|
7
|
+
// 默认导出组件
|
|
8
8
|
export default BaseDateMonth;
|
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="d-control-container">
|
|
3
|
-
<div class="d-control-label">
|
|
4
|
-
{{ label }}
|
|
5
|
-
<span v-if="rules && rules['required']" class="d-control-label-required"
|
|
6
|
-
>*</span
|
|
7
|
-
>
|
|
8
|
-
<Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
|
|
9
|
-
<img src="../../styles/icon/help.png" alt="" style="width: 14px" />
|
|
10
|
-
</Tooltip>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="d-control">
|
|
13
|
-
<ValidationProvider
|
|
14
|
-
:name="label"
|
|
15
|
-
v-slot="v"
|
|
16
|
-
:rules="rules"
|
|
17
|
-
v-if="edit === true"
|
|
18
|
-
>
|
|
19
|
-
<MonthPicker
|
|
20
|
-
:size="'small'"
|
|
21
|
-
placeholder="选择月"
|
|
22
|
-
v-model="currentValue"
|
|
23
|
-
value-format="YYYY-MM-DD"
|
|
24
|
-
style="width: 100%"
|
|
25
|
-
:class="{ 'd-error-input': v.errors.length > 0 }"
|
|
26
|
-
@change="change"
|
|
27
|
-
/>
|
|
28
|
-
<div class="d-error-msg">
|
|
29
|
-
{{ v.errors[0] }}
|
|
30
|
-
</div>
|
|
31
|
-
</ValidationProvider>
|
|
32
|
-
<Tooltip placement="topLeft" v-else>
|
|
33
|
-
<template slot="title">
|
|
34
|
-
{{ moment(currentValue).format("YYYY-MM") }}
|
|
35
|
-
</template>
|
|
36
|
-
<span @contextmenu.prevent="(event) => onContextmenu(event, currentValue)">
|
|
37
|
-
{{ moment(currentValue).format("YYYY-MM") }}
|
|
38
|
-
</span>
|
|
39
|
-
</Tooltip>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<script>
|
|
45
|
-
//VXETable插件
|
|
46
|
-
import VXETable from "vxe-table";
|
|
47
|
-
//轻量级剪贴板复制函数
|
|
48
|
-
import XEClipboard from "xe-clipboard";
|
|
49
|
-
import moment from "moment";
|
|
50
|
-
import { DatePicker } from "ant-design-vue";
|
|
51
|
-
import { ValidationProvider } from "vee-validate";
|
|
52
|
-
import { Tooltip } from "ant-design-vue";
|
|
53
|
-
export default {
|
|
54
|
-
name: "BaseDateMonth",
|
|
55
|
-
components: {
|
|
56
|
-
MonthPicker: DatePicker.MonthPicker,
|
|
57
|
-
ValidationProvider,
|
|
58
|
-
Tooltip,
|
|
59
|
-
},
|
|
60
|
-
data() {
|
|
61
|
-
return {
|
|
62
|
-
moment,
|
|
63
|
-
filterValue: "",
|
|
64
|
-
isInputChanged: false,
|
|
65
|
-
inputTimeout: null,
|
|
66
|
-
searchRows: [],
|
|
67
|
-
filterCols: [],
|
|
68
|
-
gridLoading: false,
|
|
69
|
-
gridPagerConfig: {
|
|
70
|
-
total: 0,
|
|
71
|
-
currentPage: 1,
|
|
72
|
-
pageSize: 10,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
computed: {
|
|
77
|
-
currentValue: {
|
|
78
|
-
// 动态计算currentValue的值
|
|
79
|
-
get: function () {
|
|
80
|
-
return this.value; // 将props中的value赋值给currentValue
|
|
81
|
-
},
|
|
82
|
-
set: function (val) {
|
|
83
|
-
this.$emit("input", val); // 通过$emit触发父组件
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
props: {
|
|
88
|
-
rules: {
|
|
89
|
-
type: Object,
|
|
90
|
-
default: function () {
|
|
91
|
-
return null;
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
value: {
|
|
95
|
-
type: String,
|
|
96
|
-
default: function () {
|
|
97
|
-
return "";
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
edit: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
default: function () {
|
|
103
|
-
return false;
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
name: {
|
|
107
|
-
type: String,
|
|
108
|
-
default: function () {
|
|
109
|
-
return "";
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
label: {
|
|
113
|
-
type: String,
|
|
114
|
-
default: function () {
|
|
115
|
-
return "";
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
placeholder: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: function () {
|
|
121
|
-
return "";
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
tooltip: {
|
|
125
|
-
type: String,
|
|
126
|
-
default: function () {
|
|
127
|
-
return "";
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
created() {},
|
|
132
|
-
methods: {
|
|
133
|
-
change() {
|
|
134
|
-
this.$emit("change");
|
|
135
|
-
},
|
|
136
|
-
onContextmenu(event, currentValue) {
|
|
137
|
-
this.$contextmenu({
|
|
138
|
-
items: [
|
|
139
|
-
{
|
|
140
|
-
icon: 'ant-design:folder-open-filled',
|
|
141
|
-
label: "复制",
|
|
142
|
-
onClick: () => {
|
|
143
|
-
if (XEClipboard.copy(currentValue)) {
|
|
144
|
-
VXETable.modal.message({
|
|
145
|
-
content: "已复制到剪贴板!",
|
|
146
|
-
status: "success",
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
event,
|
|
153
|
-
zIndex: 1000,
|
|
154
|
-
minWidth: 150
|
|
155
|
-
});
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
</script>
|
|
161
|
-
|
|
162
|
-
<style lang="less">
|
|
163
|
-
@import "../../styles/default.less";
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-control-container">
|
|
3
|
+
<div class="d-control-label">
|
|
4
|
+
{{ label }}
|
|
5
|
+
<span v-if="rules && rules['required']" class="d-control-label-required"
|
|
6
|
+
>*</span
|
|
7
|
+
>
|
|
8
|
+
<Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
|
|
9
|
+
<img src="../../styles/icon/help.png" alt="" style="width: 14px" />
|
|
10
|
+
</Tooltip>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="d-control">
|
|
13
|
+
<ValidationProvider
|
|
14
|
+
:name="label"
|
|
15
|
+
v-slot="v"
|
|
16
|
+
:rules="rules"
|
|
17
|
+
v-if="edit === true"
|
|
18
|
+
>
|
|
19
|
+
<MonthPicker
|
|
20
|
+
:size="'small'"
|
|
21
|
+
placeholder="选择月"
|
|
22
|
+
v-model="currentValue"
|
|
23
|
+
value-format="YYYY-MM-DD"
|
|
24
|
+
style="width: 100%"
|
|
25
|
+
:class="{ 'd-error-input': v.errors.length > 0 }"
|
|
26
|
+
@change="change"
|
|
27
|
+
/>
|
|
28
|
+
<div class="d-error-msg">
|
|
29
|
+
{{ v.errors[0] }}
|
|
30
|
+
</div>
|
|
31
|
+
</ValidationProvider>
|
|
32
|
+
<Tooltip placement="topLeft" v-else>
|
|
33
|
+
<template slot="title">
|
|
34
|
+
{{ moment(currentValue).format("YYYY-MM") }}
|
|
35
|
+
</template>
|
|
36
|
+
<span @contextmenu.prevent="(event) => onContextmenu(event, currentValue)">
|
|
37
|
+
{{ moment(currentValue).format("YYYY-MM") }}
|
|
38
|
+
</span>
|
|
39
|
+
</Tooltip>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script>
|
|
45
|
+
//VXETable插件
|
|
46
|
+
import VXETable from "vxe-table";
|
|
47
|
+
//轻量级剪贴板复制函数
|
|
48
|
+
import XEClipboard from "xe-clipboard";
|
|
49
|
+
import moment from "moment";
|
|
50
|
+
import { DatePicker } from "ant-design-vue";
|
|
51
|
+
import { ValidationProvider } from "vee-validate";
|
|
52
|
+
import { Tooltip } from "ant-design-vue";
|
|
53
|
+
export default {
|
|
54
|
+
name: "BaseDateMonth",
|
|
55
|
+
components: {
|
|
56
|
+
MonthPicker: DatePicker.MonthPicker,
|
|
57
|
+
ValidationProvider,
|
|
58
|
+
Tooltip,
|
|
59
|
+
},
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
moment,
|
|
63
|
+
filterValue: "",
|
|
64
|
+
isInputChanged: false,
|
|
65
|
+
inputTimeout: null,
|
|
66
|
+
searchRows: [],
|
|
67
|
+
filterCols: [],
|
|
68
|
+
gridLoading: false,
|
|
69
|
+
gridPagerConfig: {
|
|
70
|
+
total: 0,
|
|
71
|
+
currentPage: 1,
|
|
72
|
+
pageSize: 10,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
currentValue: {
|
|
78
|
+
// 动态计算currentValue的值
|
|
79
|
+
get: function () {
|
|
80
|
+
return this.value; // 将props中的value赋值给currentValue
|
|
81
|
+
},
|
|
82
|
+
set: function (val) {
|
|
83
|
+
this.$emit("input", val); // 通过$emit触发父组件
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
props: {
|
|
88
|
+
rules: {
|
|
89
|
+
type: Object,
|
|
90
|
+
default: function () {
|
|
91
|
+
return null;
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
value: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: function () {
|
|
97
|
+
return "";
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
edit: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: function () {
|
|
103
|
+
return false;
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
name: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: function () {
|
|
109
|
+
return "";
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
label: {
|
|
113
|
+
type: String,
|
|
114
|
+
default: function () {
|
|
115
|
+
return "";
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
placeholder: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: function () {
|
|
121
|
+
return "";
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
tooltip: {
|
|
125
|
+
type: String,
|
|
126
|
+
default: function () {
|
|
127
|
+
return "";
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
created() {},
|
|
132
|
+
methods: {
|
|
133
|
+
change() {
|
|
134
|
+
this.$emit("change");
|
|
135
|
+
},
|
|
136
|
+
onContextmenu(event, currentValue) {
|
|
137
|
+
this.$contextmenu({
|
|
138
|
+
items: [
|
|
139
|
+
{
|
|
140
|
+
icon: 'ant-design:folder-open-filled',
|
|
141
|
+
label: "复制",
|
|
142
|
+
onClick: () => {
|
|
143
|
+
if (XEClipboard.copy(currentValue)) {
|
|
144
|
+
VXETable.modal.message({
|
|
145
|
+
content: "已复制到剪贴板!",
|
|
146
|
+
status: "success",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
event,
|
|
153
|
+
zIndex: 1000,
|
|
154
|
+
minWidth: 150
|
|
155
|
+
});
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
</script>
|
|
161
|
+
|
|
162
|
+
<style lang="less">
|
|
163
|
+
@import "../../styles/default.less";
|
|
164
164
|
</style>
|
|
@@ -2966,7 +2966,7 @@ export default {
|
|
|
2966
2966
|
column.formatter !== 'defaultFormat' &&
|
|
2967
2967
|
VXETable.formats.store[column.formatter]
|
|
2968
2968
|
) {
|
|
2969
|
-
tempSumVal = VXETable.formats.store[column.formatter]({
|
|
2969
|
+
tempSumVal = VXETable.formats.store[column.formatter].cellFormatMethod({
|
|
2970
2970
|
cellValue: tempSumVal,
|
|
2971
2971
|
})
|
|
2972
2972
|
}
|