chore: format code (#3753)

* feat: 格式化代码

* feat: 修改 gitlinter.yml node 版本配置

* feat: 补充格式化代码

---------

Co-authored-by: fuwedong <fuwendong5@outlook.com>
This commit is contained in:
fwd01
2024-04-22 10:41:30 +08:00
committed by GitHub
parent d53a5b22cc
commit 4e8ac0ec4c
11 changed files with 77 additions and 87 deletions

View File

@@ -1,8 +1,8 @@
name: "Close stale issues"
name: 'Close stale issues'
on:
schedule:
- cron: "30 1 * * *"
- cron: '30 1 * * *'
jobs:
stale:

View File

@@ -9,6 +9,6 @@
"antfu.iconify",
"antfu.unocss",
"mikestead.dotenv",
"warmthsea.vscode-custom-code-color",
"warmthsea.vscode-custom-code-color"
]
}

26
.vscode/settings.json vendored
View File

@@ -55,14 +55,7 @@
"**/yarn.lock": true
},
"stylelint.enable": true,
"stylelint.validate": [
"css",
"less",
"postcss",
"scss",
"vue",
"sass"
],
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"path-intellisense.mappings": {
"@/": "${workspaceRoot}/src"
},
@@ -101,24 +94,15 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"i18n-ally.localesPaths": [
"src/locales/lang"
],
"i18n-ally.localesPaths": ["src/locales/lang"],
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
"i18n-ally.enabledParsers": [
"json",
"ts",
"js"
],
"i18n-ally.enabledParsers": ["json", "ts", "js"],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.enabledFrameworks": [
"vue",
"react"
],
"i18n-ally.enabledFrameworks": ["vue", "react"],
"cSpell.words": [
"antd",
"antv",
@@ -188,5 +172,5 @@
"terminal.integrated.scrollback": 10000,
"nuxt.isNuxtApp": false,
"vscodeCustomCodeColor.highlightValue": "v-auth",
"vscodeCustomCodeColor.highlightValueColor": "#6366f1",
"vscodeCustomCodeColor.highlightValueColor": "#6366f1"
}

View File

@@ -163,7 +163,7 @@ export function useFormEvents({
} else {
nestKeyArray.forEach((nestKey: string) => {
try {
const value = get(values,nestKey)
const value = get(values, nestKey);
if (isDef(value)) {
unref(formModel)[nestKey] = unref(value);
validKeys.push(nestKey);

View File

@@ -127,7 +127,6 @@
}
}
@media screen and (max-height: 600px) {
.ant-modal {
top: 60px;

View File

@@ -180,7 +180,7 @@
submitFunc: () => {
return new Promise((resolve) => {
validate()
.then((_e) => {
.then(() => {
resolve();
console.log(getFieldsValueValiate());
createMessage.success(`请到控制台查看结果`);

View File

@@ -13,12 +13,9 @@
</CollapseContainer>
<CollapseContainer title="表单组增删" class="my-3">
<a-button @click="setGroup">设置初始值</a-button>
<a-button class="m-2" @click="addGroup">
批量添加表单
</a-button>
<a-button class="m-2" @click="addGroup"> 批量添加表单 </a-button>
<a-button @click="delGroup">批量减少表单</a-button>
<BasicForm @register="registerGroup" @submit="handleSubmitGroup">
</BasicForm>
<BasicForm @register="registerGroup" @submit="handleSubmitGroup" />
</CollapseContainer>
</PageWrapper>
</template>
@@ -29,6 +26,7 @@
import { PageWrapper } from '@/components/Page';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const count = ref(0);
const [register, { appendSchemaByField, removeSchemaByField, validate }] = useForm({
@@ -60,7 +58,7 @@
async function handleSubmit() {
try {
const data = await validate();
createMessage.success("请前往控制台查看输出")
createMessage.success('请前往控制台查看输出');
console.log(data);
} catch (e) {
console.log(e);
@@ -136,7 +134,12 @@
}
const [
registerGroup,
{ appendSchemaByField: appendSchemaByFieldGroup, removeSchemaByField:removeSchemaByFieldGroup, getFieldsValue:getFieldsValueGroup,setFieldsValue },
{
appendSchemaByField: appendSchemaByFieldGroup,
removeSchemaByField: removeSchemaByFieldGroup,
getFieldsValue: getFieldsValueGroup,
setFieldsValue,
},
] = useForm({
schemas: [
{
@@ -144,7 +147,6 @@
component: 'Input',
label: '字段a',
colProps: { span: 9 },
},
{
field: `field[${count.value}].b`,
@@ -152,7 +154,6 @@
component: 'Input',
label: '字段b',
},
],
labelWidth: 100,
actionColOptions: { span: 24 },
@@ -161,7 +162,9 @@
function addGroup() {
count.value++;
appendSchemaByFieldGroup([ {
appendSchemaByFieldGroup(
[
{
field: `field[${count.value}].a`,
component: 'Input',
colProps: { span: 9 },
@@ -173,7 +176,9 @@
colProps: { span: 9 },
label: '字段b',
},
],"")
],
'',
);
}
function delGroup() {
@@ -183,15 +188,17 @@
function setGroup() {
setFieldsValue({
field:[{
a:"默认a",
b:"默认b"
}]
})
field: [
{
a: '默认a',
b: '默认b',
},
],
});
}
function handleSubmitGroup() {
createMessage.success("请前往控制台查看输出")
console.log(getFieldsValueGroup())
createMessage.success('请前往控制台查看输出');
console.log(getFieldsValueGroup());
}
</script>

View File

@@ -71,7 +71,7 @@
import { areaRecord } from '@/api/demo/cascader';
import { uploadApi } from '@/api/sys/upload';
let debounceOptionsFn = useDebounceFn(onSearch, 300)
let debounceOptionsFn = useDebounceFn(onSearch, 300);
const valueSelectA = ref<string[]>([]);
const valueSelectB = ref<string[]>([]);
const options = ref<Required<SelectProps>['options']>([]);