@lx-frontend/wrap-element-ui 1.0.19-beta.0 → 1.0.19-beta.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,10 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lx-frontend/wrap-element-ui",
|
|
3
|
-
"version": "1.0.19-beta.
|
|
3
|
+
"version": "1.0.19-beta.2",
|
|
4
4
|
"description": "wrap-element-ui",
|
|
5
5
|
"author": "",
|
|
6
6
|
"main": "src/components/index.ts",
|
|
7
7
|
"private": false,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"clean": "rimraf dist",
|
|
10
|
+
"dev": "cross-env MODE=development storybook dev -p 6006",
|
|
11
|
+
"dist": "cross-env MODE=production pnpm build:lib && storybook dev -p 6006",
|
|
12
|
+
"build:lib": "pnpm clean && vite build",
|
|
13
|
+
"build:sb": "cross-env MODE=production rimraf storybook-static && pnpm build:lib && storybook build",
|
|
14
|
+
"preview": "serve ./storybook-static",
|
|
15
|
+
"publish:dev": "npm publish --access public --tag beta",
|
|
16
|
+
"publish:prod": "npm publish --access public",
|
|
17
|
+
"cdn": "gulp oss",
|
|
18
|
+
"lint": "eslint src"
|
|
19
|
+
},
|
|
8
20
|
"files": [
|
|
9
21
|
"README.md",
|
|
10
22
|
"package.json",
|
|
@@ -57,17 +69,5 @@
|
|
|
57
69
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
58
70
|
"vite-tsconfig-paths": "^4.3.2",
|
|
59
71
|
"vue-template-compiler": "^2.6.10"
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"clean": "rimraf dist",
|
|
63
|
-
"dev": "cross-env MODE=development storybook dev -p 6006",
|
|
64
|
-
"dist": "cross-env MODE=production pnpm build:lib && storybook dev -p 6006",
|
|
65
|
-
"build:lib": "pnpm clean && vite build",
|
|
66
|
-
"build:sb": "cross-env MODE=production rimraf storybook-static && pnpm build:lib && storybook build",
|
|
67
|
-
"preview": "serve ./storybook-static",
|
|
68
|
-
"publish:dev": "npm publish --access public --tag beta",
|
|
69
|
-
"publish:prod": "npm publish --access public",
|
|
70
|
-
"cdn": "gulp oss",
|
|
71
|
-
"lint": "eslint src"
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -88,7 +88,6 @@ type _IColumnConfigRequired = {
|
|
|
88
88
|
/** 自定义颜色表头label */
|
|
89
89
|
customColorLabel?: boolean;
|
|
90
90
|
filters?: FilterListType;
|
|
91
|
-
selectOptions?: any
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
export type IColumnConfigRequired = _IColumnConfigRequired & Partial<Omit<TableColumn, keyof _IColumnConfigRequired>>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
|
|
3
|
+
/** 开始日期禁用配置 */
|
|
4
|
+
export function genStartDateDisabledOptions(endDate: string, limit: number = 0) {
|
|
5
|
+
return {
|
|
6
|
+
disabledDate: (time: Date) => {
|
|
7
|
+
if (!endDate) return false;
|
|
8
|
+
|
|
9
|
+
const currentDate = dayjs(time);
|
|
10
|
+
return currentDate.isAfter(dayjs(endDate).add(limit, 'day'), 'day');
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** 结束日期禁用配置 */
|
|
16
|
+
export function genEndDateDisabledOptions(startDate: string, limit: number = 0) {
|
|
17
|
+
return {
|
|
18
|
+
disabledDate: (time: Date) => {
|
|
19
|
+
if (!startDate) return false;
|
|
20
|
+
|
|
21
|
+
const currentDate = dayjs(time);
|
|
22
|
+
return currentDate.isBefore(dayjs(startDate).subtract(limit, 'day'), 'day');
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
v-for="({
|
|
9
9
|
isEmpty = true, key, type, prop, label, placeholder, candidate, filterable=false, withoutAll=false, collapseTags=false,
|
|
10
10
|
clearable=false, multiple=false, multipleLimit=0, changeCb, inputLimitCallback, slotName, dateType='date',
|
|
11
|
-
doubleIsInline = true, maxlength = 255,
|
|
11
|
+
doubleIsInline = true, maxlength = 255, doubleDatePickerLimit,
|
|
12
12
|
}) in config"
|
|
13
13
|
:key="label"
|
|
14
14
|
:label="showLabel ? label : ''"
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
format="yyyy-MM-dd"
|
|
86
86
|
type="date"
|
|
87
87
|
:placeholder="(placeholder || [])[0] || '开始日期'"
|
|
88
|
+
:picker-options="genStartDateDisabledOptions(formData[prop[1]], doubleDatePickerLimit)"
|
|
88
89
|
/>
|
|
89
90
|
<el-date-picker
|
|
90
91
|
@input="val => handleInput(val, prop[1], '', key)"
|
|
@@ -94,6 +95,7 @@
|
|
|
94
95
|
format="yyyy-MM-dd"
|
|
95
96
|
type="date"
|
|
96
97
|
:placeholder="(placeholder || [])[1] || '结束日期'"
|
|
98
|
+
:picker-options="genEndDateDisabledOptions(formData[prop[0]], doubleDatePickerLimit)"
|
|
97
99
|
/>
|
|
98
100
|
<el-checkbox
|
|
99
101
|
:value="checkedIds[key]"
|
|
@@ -124,6 +126,8 @@
|
|
|
124
126
|
</template>
|
|
125
127
|
|
|
126
128
|
<script>
|
|
129
|
+
import { genStartDateDisabledOptions, genEndDateDisabledOptions } from './helper';
|
|
130
|
+
|
|
127
131
|
export default {
|
|
128
132
|
name: 'SearchForm',
|
|
129
133
|
props: {
|
|
@@ -187,6 +191,8 @@ export default {
|
|
|
187
191
|
this.initialData = Object.freeze({ ...this.formData })
|
|
188
192
|
},
|
|
189
193
|
methods: {
|
|
194
|
+
genStartDateDisabledOptions,
|
|
195
|
+
genEndDateDisabledOptions,
|
|
190
196
|
handleInput (val, prop, inputLimitCallback, key) {
|
|
191
197
|
if (inputLimitCallback && !inputLimitCallback(val)) return false
|
|
192
198
|
if (val) {
|