chore: 格式化代码 (#3972)
This commit is contained in:
parent
1745f480fd
commit
baf406e7e2
|
|
@ -34,14 +34,10 @@ const DATE_TYPE = ['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker'];
|
||||||
/**
|
/**
|
||||||
* 上传组件
|
* 上传组件
|
||||||
*/
|
*/
|
||||||
export const uploadItemType: ComponentType[] = [
|
export const uploadItemType: ComponentType[] = ['Upload', 'ImageUpload'];
|
||||||
'Upload',
|
|
||||||
'ImageUpload'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
function genType() {
|
function genType() {
|
||||||
return [...DATE_TYPE, 'RangePicker',"TimeRangePicker"];
|
return [...DATE_TYPE, 'RangePicker', 'TimeRangePicker'];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setComponentRuleType(
|
export function setComponentRuleType(
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ export function useFormEvents({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
validKeys.push(key);
|
validKeys.push(key);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
// Adapt common component
|
// Adapt common component
|
||||||
if (hasKey) {
|
if (hasKey) {
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@
|
||||||
import UploadPreviewModal from './components/UploadPreviewModal.vue';
|
import UploadPreviewModal from './components/UploadPreviewModal.vue';
|
||||||
import { BaseFileItem } from './types/typing';
|
import { BaseFileItem } from './types/typing';
|
||||||
import { buildUUID } from '@/utils/uuid';
|
import { buildUUID } from '@/utils/uuid';
|
||||||
|
|
||||||
defineOptions({ name: 'BasicUpload' });
|
defineOptions({ name: 'BasicUpload' });
|
||||||
|
|
||||||
const props = defineProps(uploadContainerProps);
|
const props = defineProps(uploadContainerProps);
|
||||||
|
|
@ -86,9 +87,9 @@
|
||||||
return omit(value, 'onChange');
|
return omit(value, 'onChange');
|
||||||
});
|
});
|
||||||
|
|
||||||
const isFirstRender = ref<boolean>(true)
|
const isFirstRender = ref<boolean>(true);
|
||||||
|
|
||||||
function getValue(valueKey="url") {
|
function getValue(valueKey = 'url') {
|
||||||
const list = (fileList.value || []).map((item: any) => {
|
const list = (fileList.value || []).map((item: any) => {
|
||||||
return item[valueKey];
|
return item[valueKey];
|
||||||
});
|
});
|
||||||
|
|
@ -113,7 +114,7 @@
|
||||||
} else if (typeof v == 'string') {
|
} else if (typeof v == 'string') {
|
||||||
values.push(v);
|
values.push(v);
|
||||||
}
|
}
|
||||||
fileList.value = values.map((item,i) => {
|
fileList.value = values.map((item) => {
|
||||||
if (item && isString(item)) {
|
if (item && isString(item)) {
|
||||||
return {
|
return {
|
||||||
uid: buildUUID(),
|
uid: buildUUID(),
|
||||||
|
|
@ -129,7 +130,7 @@
|
||||||
emit('update:value', values);
|
emit('update:value', values);
|
||||||
if (!isFirstRender.value) {
|
if (!isFirstRender.value) {
|
||||||
emit('change', values);
|
emit('change', values);
|
||||||
isFirstRender.value = false
|
isFirstRender.value = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
const fileList = ref<UploadProps['fileList']>([]);
|
const fileList = ref<UploadProps['fileList']>([]);
|
||||||
const isLtMsg = ref<boolean>(true);
|
const isLtMsg = ref<boolean>(true);
|
||||||
const isActMsg = ref<boolean>(true);
|
const isActMsg = ref<boolean>(true);
|
||||||
const isFirstRender = ref<boolean>(true)
|
const isFirstRender = ref<boolean>(true);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
emit('update:value', value);
|
emit('update:value', value);
|
||||||
if (!isFirstRender.value) {
|
if (!isFirstRender.value) {
|
||||||
emit('change', value);
|
emit('change', value);
|
||||||
isFirstRender.value = false
|
isFirstRender.value = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
import { BasicColumn } from '@/components/Table';
|
import { BasicColumn } from '@/components/Table';
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
import { buildUUID } from '@/utils/uuid';
|
import { buildUUID } from '@/utils/uuid';
|
||||||
|
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
|
|
||||||
const props = defineProps(previewProps);
|
const props = defineProps(previewProps);
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ type SortableOptions = Merge<
|
||||||
// ...可扩展
|
// ...可扩展
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
export type handleFnKey = "record" | "valueKey" | "uidKey"
|
export type handleFnKey = 'record' | 'valueKey' | 'uidKey';
|
||||||
export type previewColumnsFnType = {
|
export type previewColumnsFnType = {
|
||||||
handleRemove: (record: Record<handleFnKey, any>) => any;
|
handleRemove: (record: Record<handleFnKey, any>) => any;
|
||||||
handleAdd: (record: Record<handleFnKey, any>) => any;
|
handleAdd: (record: Record<handleFnKey, any>) => any;
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,9 @@ export const useMultipleTabStore = defineStore({
|
||||||
// Existing pages, do not add tabs repeatedly
|
// Existing pages, do not add tabs repeatedly
|
||||||
const tabHasExits = this.tabList.some((tab, index) => {
|
const tabHasExits = this.tabList.some((tab, index) => {
|
||||||
updateIndex = index;
|
updateIndex = index;
|
||||||
return decodeURIComponent(tab.fullPath || tab.path) === decodeURIComponent(fullPath || path);
|
return (
|
||||||
|
decodeURIComponent(tab.fullPath || tab.path) === decodeURIComponent(fullPath || path)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// If the tab already exists, perform the update operation
|
// If the tab already exists, perform the update operation
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
import { PageWrapper } from '@/components/Page';
|
import { PageWrapper } from '@/components/Page';
|
||||||
import { isAccountExist } from '@/api/demo/system';
|
import { isAccountExist } from '@/api/demo/system';
|
||||||
import dayjs from "dayjs"
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
const schemas: FormSchema[] = [
|
const schemas: FormSchema[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -236,7 +236,7 @@
|
||||||
field5: ['1'],
|
field5: ['1'],
|
||||||
field7: '1',
|
field7: '1',
|
||||||
field33: '2020-12-12',
|
field33: '2020-12-12',
|
||||||
field3: dayjs('2020-12-12',"YYYY-MM-DD"),
|
field3: dayjs('2020-12-12', 'YYYY-MM-DD'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue