Commit 84b8302c0921ea7fbcd1c42fa057b94660129857

Authored by vben
1 parent da4aea13

fix(table): fix table search criteria collapse failure

src/components/Form/src/BasicForm.vue
@@ -24,9 +24,9 @@ @@ -24,9 +24,9 @@
24 </template> 24 </template>
25 <script lang="ts"> 25 <script lang="ts">
26 import type { FormActionType, FormProps, FormSchema } from './types/form'; 26 import type { FormActionType, FormProps, FormSchema } from './types/form';
27 - import type { Form as FormType, ValidateFields } from 'ant-design-vue/types/form/form';  
28 import type { AdvanceState } from './types/hooks'; 27 import type { AdvanceState } from './types/hooks';
29 import type { Ref } from 'vue'; 28 import type { Ref } from 'vue';
  29 + import type { ValidateFields } from 'ant-design-vue/lib/form/interface';
30 30
31 import { 31 import {
32 defineComponent, 32 defineComponent,
@@ -41,12 +41,13 @@ @@ -41,12 +41,13 @@
41 import { Form, Row } from 'ant-design-vue'; 41 import { Form, Row } from 'ant-design-vue';
42 import FormItem from './FormItem'; 42 import FormItem from './FormItem';
43 import { basicProps } from './props'; 43 import { basicProps } from './props';
44 - import { deepMerge } from '/@/utils';  
45 import FormAction from './FormAction'; 44 import FormAction from './FormAction';
46 45
47 import { dateItemType } from './helper'; 46 import { dateItemType } from './helper';
48 import moment from 'moment'; 47 import moment from 'moment';
49 import { cloneDeep } from 'lodash-es'; 48 import { cloneDeep } from 'lodash-es';
  49 + import { deepMerge } from '/@/utils';
  50 +
50 import { useFormValues } from './hooks/useFormValues'; 51 import { useFormValues } from './hooks/useFormValues';
51 import useAdvanced from './hooks/useAdvanced'; 52 import useAdvanced from './hooks/useAdvanced';
52 import { useFormAction } from './hooks/useFormAction'; 53 import { useFormAction } from './hooks/useFormAction';
@@ -75,7 +76,7 @@ @@ -75,7 +76,7 @@
75 const defaultValueRef = ref<any>({}); 76 const defaultValueRef = ref<any>({});
76 const propsRef = ref<Partial<FormProps>>({}); 77 const propsRef = ref<Partial<FormProps>>({});
77 const schemaRef = ref<FormSchema[] | null>(null); 78 const schemaRef = ref<FormSchema[] | null>(null);
78 - const formElRef = ref<Nullable<FormType>>(null); 79 + const formElRef = ref<Nullable<FormActionType>>(null);
79 80
80 const getMergePropsRef = computed( 81 const getMergePropsRef = computed(
81 (): FormProps => { 82 (): FormProps => {
src/components/Form/src/FormAction.tsx
  1 +import type { ColEx } from './types/index';
  2 +
1 import { defineComponent, unref, computed, PropType } from 'vue'; 3 import { defineComponent, unref, computed, PropType } from 'vue';
2 import { Form, Col } from 'ant-design-vue'; 4 import { Form, Col } from 'ant-design-vue';
3 -import type { ColEx } from './types/index';  
4 -import { getSlot } from '/@/utils/helper/tsxHelper';  
5 import Button from '/@/components/Button/index.vue'; 5 import Button from '/@/components/Button/index.vue';
6 -import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'; 6 +import { BasicArrow } from '/@/components/Basic/index';
  7 +
  8 +import { getSlot } from '/@/utils/helper/tsxHelper';
7 9
8 export default defineComponent({ 10 export default defineComponent({
9 name: 'BasicFormAction', 11 name: 'BasicFormAction',
@@ -107,11 +109,7 @@ export default defineComponent({ @@ -107,11 +109,7 @@ export default defineComponent({
107 {() => ( 109 {() => (
108 <> 110 <>
109 {isAdvanced ? '收起' : '展开'} 111 {isAdvanced ? '收起' : '展开'}
110 - {isAdvanced ? (  
111 - <UpOutlined class="advanced-icon" />  
112 - ) : (  
113 - <DownOutlined class="advanced-icon" />  
114 - )} 112 + <BasicArrow expand={!isAdvanced} />
115 </> 113 </>
116 )} 114 )}
117 </Button> 115 </Button>
src/components/Form/src/FormItem.tsx
1 -import type { ValidationRule } from 'ant-design-vue/types/form/form';  
2 import type { PropType } from 'vue'; 1 import type { PropType } from 'vue';
3 import type { FormProps } from './types/form'; 2 import type { FormProps } from './types/form';
4 import type { FormSchema } from './types/form'; 3 import type { FormSchema } from './types/form';
  4 +import type { ValidationRule } from 'ant-design-vue/lib/form/Form';
5 5
6 import { defineComponent, computed, unref, toRef } from 'vue'; 6 import { defineComponent, computed, unref, toRef } from 'vue';
7 import { Form, Col } from 'ant-design-vue'; 7 import { Form, Col } from 'ant-design-vue';
@@ -54,10 +54,25 @@ export default defineComponent({ @@ -54,10 +54,25 @@ export default defineComponent({
54 }; 54 };
55 }); 55 });
56 56
57 - const getShowRef = computed(() => {  
58 - const { show, ifShow, isAdvanced } = props.schema; 57 + const getDisableRef = computed(() => {
  58 + const { disabled: globDisabled } = props.formProps;
  59 + const { dynamicDisabled } = props.schema;
  60 + let disabled = !!globDisabled;
  61 + if (isBoolean(dynamicDisabled)) {
  62 + disabled = dynamicDisabled;
  63 + }
  64 +
  65 + if (isFunction(dynamicDisabled)) {
  66 + disabled = dynamicDisabled(unref(getValuesRef));
  67 + }
  68 +
  69 + return disabled;
  70 + });
  71 +
  72 + function getShow() {
  73 + const { show, ifShow } = props.schema;
59 const { showAdvancedButton } = props.formProps; 74 const { showAdvancedButton } = props.formProps;
60 - const itemIsAdvanced = showAdvancedButton ? !!isAdvanced : true; 75 + const itemIsAdvanced = showAdvancedButton ? !!props.schema.isAdvanced : true;
61 let isShow = true; 76 let isShow = true;
62 let isIfShow = true; 77 let isIfShow = true;
63 78
@@ -75,22 +90,7 @@ export default defineComponent({ @@ -75,22 +90,7 @@ export default defineComponent({
75 } 90 }
76 isShow = isShow && itemIsAdvanced; 91 isShow = isShow && itemIsAdvanced;
77 return { isShow, isIfShow }; 92 return { isShow, isIfShow };
78 - });  
79 -  
80 - const getDisableRef = computed(() => {  
81 - const { disabled: globDisabled } = props.formProps;  
82 - const { dynamicDisabled } = props.schema;  
83 - let disabled = !!globDisabled;  
84 - if (isBoolean(dynamicDisabled)) {  
85 - disabled = dynamicDisabled;  
86 - }  
87 -  
88 - if (isFunction(dynamicDisabled)) {  
89 - disabled = dynamicDisabled(unref(getValuesRef));  
90 - }  
91 -  
92 - return disabled;  
93 - }); 93 + }
94 94
95 function handleRules(): ValidationRule[] { 95 function handleRules(): ValidationRule[] {
96 const { 96 const {
@@ -246,7 +246,7 @@ export default defineComponent({ @@ -246,7 +246,7 @@ export default defineComponent({
246 <Form.Item 246 <Form.Item
247 name={field} 247 name={field}
248 colon={colon} 248 colon={colon}
249 - {...itemProps} 249 + {...(itemProps as any)}
250 label={renderLabelHelpMessage()} 250 label={renderLabelHelpMessage()}
251 rules={handleRules()} 251 rules={handleRules()}
252 labelCol={labelCol} 252 labelCol={labelCol}
@@ -261,7 +261,7 @@ export default defineComponent({ @@ -261,7 +261,7 @@ export default defineComponent({
261 if (!componentMap.has(component)) return null; 261 if (!componentMap.has(component)) return null;
262 const { baseColProps = {} } = props.formProps; 262 const { baseColProps = {} } = props.formProps;
263 const realColProps = { ...baseColProps, ...colProps }; 263 const realColProps = { ...baseColProps, ...colProps };
264 - const { isIfShow, isShow } = unref(getShowRef); 264 + const { isIfShow, isShow } = getShow();
265 const getContent = () => { 265 const getContent = () => {
266 return colSlot 266 return colSlot
267 ? getSlot(slots, colSlot) 267 ? getSlot(slots, colSlot)
src/components/Form/src/hooks/useAdvanced.ts
1 import type { ColEx } from '../types'; 1 import type { ColEx } from '../types';
2 import type { AdvanceState } from '../types/hooks'; 2 import type { AdvanceState } from '../types/hooks';
3 -import type { ComputedRef, Ref } from 'vue'; 3 +import { ComputedRef, Ref } from 'vue';
4 import type { FormProps, FormSchema } from '../types/form'; 4 import type { FormProps, FormSchema } from '../types/form';
5 5
6 import { computed, unref, watch } from 'vue'; 6 import { computed, unref, watch } from 'vue';
@@ -69,6 +69,7 @@ export default function ({ @@ -69,6 +69,7 @@ export default function ({
69 actionColOptions, 69 actionColOptions,
70 }; 70 };
71 }); 71 });
  72 +
72 watch( 73 watch(
73 [() => unref(getSchema), () => advanceState.isAdvanced, () => unref(realWidthRef)], 74 [() => unref(getSchema), () => advanceState.isAdvanced, () => unref(realWidthRef)],
74 () => { 75 () => {
@@ -169,6 +170,7 @@ export default function ({ @@ -169,6 +170,7 @@ export default function ({
169 itemColSum, 170 itemColSum,
170 true 171 true
171 ); 172 );
  173 +
172 emit('advanced-change'); 174 emit('advanced-change');
173 } 175 }
174 176
src/components/Menu/src/BasicMenu.tsx
@@ -60,13 +60,13 @@ export default defineComponent({ @@ -60,13 +60,13 @@ export default defineComponent({
60 const { showLogo, search } = props; 60 const { showLogo, search } = props;
61 let offset = 0; 61 let offset = 0;
62 if (search) { 62 if (search) {
63 - offset += 60; 63 + offset += 54;
64 } 64 }
65 if (showLogo) { 65 if (showLogo) {
66 - offset += 54; 66 + offset += 46;
67 } 67 }
68 return { 68 return {
69 - height: `calc(100% - ${offset - 38}px)`, 69 + height: `calc(100% - ${offset - 10}px)`,
70 position: 'relative', 70 position: 'relative',
71 overflow: 'auto', 71 overflow: 'auto',
72 }; 72 };
src/components/Table/src/BasicTable.vue
@@ -21,11 +21,9 @@ @@ -21,11 +21,9 @@
21 </BasicForm> 21 </BasicForm>
22 <Table 22 <Table
23 ref="tableElRef" 23 ref="tableElRef"
24 - v-bind="getBindValues"  
25 :rowClassName="getRowClassName" 24 :rowClassName="getRowClassName"
26 - :class="{  
27 - hidden: !getEmptyDataIsShowTable,  
28 - }" 25 + v-bind="getBindValues"
  26 + v-show="getEmptyDataIsShowTable"
29 @change="handleTableChange" 27 @change="handleTableChange"
30 > 28 >
31 <template #[item]="data" v-for="item in Object.keys($slots)"> 29 <template #[item]="data" v-for="item in Object.keys($slots)">
@@ -44,6 +42,8 @@ @@ -44,6 +42,8 @@
44 GetColumnsParams, 42 GetColumnsParams,
45 TableActionType, 43 TableActionType,
46 SizeType, 44 SizeType,
  45 + SorterResult,
  46 + TableCustomRecord,
47 } from './types/table'; 47 } from './types/table';
48 48
49 import { isFunction, isString } from '/@/utils/is'; 49 import { isFunction, isString } from '/@/utils/is';
@@ -64,7 +64,6 @@ @@ -64,7 +64,6 @@
64 import { ROW_KEY } from './const'; 64 import { ROW_KEY } from './const';
65 import { PaginationProps } from './types/pagination'; 65 import { PaginationProps } from './types/pagination';
66 import { deepMerge } from '/@/utils'; 66 import { deepMerge } from '/@/utils';
67 - import { SorterResult, TableCustomRecord } from 'ant-design-vue/types/table/table';  
68 import { useEvent } from '/@/hooks/event/useEvent'; 67 import { useEvent } from '/@/hooks/event/useEvent';
69 68
70 import './style/index.less'; 69 import './style/index.less';
@@ -199,7 +198,7 @@ @@ -199,7 +198,7 @@
199 { immediate: true } 198 { immediate: true }
200 ); 199 );
201 200
202 - function getRowClassName(record: TableCustomRecord<any>, index: number) { 201 + function getRowClassName(record: TableCustomRecord, index: number) {
203 const { striped, rowClassName } = unref(getMergeProps); 202 const { striped, rowClassName } = unref(getMergeProps);
204 if (!striped) return; 203 if (!striped) return;
205 if (rowClassName && isFunction(rowClassName)) { 204 if (rowClassName && isFunction(rowClassName)) {
@@ -218,6 +217,7 @@ @@ -218,6 +217,7 @@
218 217
219 function handleTableChange( 218 function handleTableChange(
220 pagination: PaginationProps, 219 pagination: PaginationProps,
  220 + // @ts-ignore
221 filters: Partial<Record<string, string[]>>, 221 filters: Partial<Record<string, string[]>>,
222 sorter: SorterResult<any> 222 sorter: SorterResult<any>
223 ) { 223 ) {
src/layouts/default/LayoutHeader.tsx
@@ -145,6 +145,7 @@ export default defineComponent({ @@ -145,6 +145,7 @@ export default defineComponent({
145 <Badge 145 <Badge
146 count={errorStore.getErrorListCountState} 146 count={errorStore.getErrorListCountState}
147 offset={[0, 10]} 147 offset={[0, 10]}
  148 + dot
148 overflowCount={99} 149 overflowCount={99}
149 > 150 >
150 {() => ( 151 {() => (
src/layouts/default/actions/notice/NoticeActionItem.vue
1 <template> 1 <template>
2 <div class="layout-header__action-item notify-action"> 2 <div class="layout-header__action-item notify-action">
3 <Popover title="" trigger="click"> 3 <Popover title="" trigger="click">
4 - <Badge :count="count" :numberStyle="numberStyle"> 4 + <Badge :count="count" dot :numberStyle="numberStyle">
5 <BellOutlined class="layout-header__action-icon" /> 5 <BellOutlined class="layout-header__action-icon" />
6 </Badge> 6 </Badge>
7 <template #content> 7 <template #content>
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 56
57 .ant-badge-multiple-words { 57 .ant-badge-multiple-words {
58 padding: 0 4px; 58 padding: 0 4px;
59 - transform: translate(26%, -40%); 59 + // transform: translate(26%, -40%);
60 } 60 }
61 61
62 svg { 62 svg {
src/views/sys/login/Login.vue
@@ -134,16 +134,17 @@ @@ -134,16 +134,17 @@
134 display: none; 134 display: none;
135 height: 100%; 135 height: 100%;
136 background: url(../../../assets/images/login/login-in.png) no-repeat; 136 background: url(../../../assets/images/login/login-in.png) no-repeat;
137 - background-size: 100% 100%; 137 + background-position: 50% 30%;
  138 + background-size: 80% 80%;
138 139
139 - .respond-to(large, { display: block;}); 140 + .respond-to(xlarge, { display: block;});
140 } 141 }
141 142
142 &-form { 143 &-form {
143 width: 100%; 144 width: 100%;
144 background: @white; 145 background: @white;
145 border: 10px solid rgba(255, 255, 255, 0.5); 146 border: 10px solid rgba(255, 255, 255, 0.5);
146 - border-width: 10px; 147 + border-width: 8px;
147 border-radius: 4px; 148 border-radius: 4px;
148 background-clip: padding-box; 149 background-clip: padding-box;
149 .respond-to(xlarge, { margin: 0 56px}); 150 .respond-to(xlarge, { margin: 0 56px});
@@ -157,8 +158,11 @@ @@ -157,8 +158,11 @@
157 height: 100%; 158 height: 100%;
158 justify-content: center; 159 justify-content: center;
159 align-items: center; 160 align-items: center;
160 - .respond-to(large, { width: 40%;});  
161 - .respond-to(xlarge, { width: 33.3%;}); 161 + .respond-to(large, {
  162 + width: 520px;
  163 + right: calc(50% - 260px);
  164 + });
  165 + .respond-to(xlarge, { width: 520px; right:0});
162 } 166 }
163 167
164 &__content { 168 &__content {
@@ -174,7 +178,7 @@ @@ -174,7 +178,7 @@
174 178
175 img { 179 img {
176 display: inline-block; 180 display: inline-block;
177 - width: 80px; 181 + width: 64px;
178 } 182 }
179 183
180 h1 { 184 h1 {