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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 77 additions and 87 deletions

View File

@ -60,7 +60,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
# - uses: NullVoxPopuli/action-setup-pnpm@v2 # - uses: NullVoxPopuli/action-setup-pnpm@v2
- name: Sed Config Base - name: Sed Config Base
shell: bash shell: bash
@ -80,17 +80,17 @@ jobs:
with: with:
node-version: '20.x' node-version: '20.x'
# - name: Get yarn cache directory path # - name: Get yarn cache directory path
# id: yarn-cache-dir-path # id: yarn-cache-dir-path
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT # run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# #
# - name: Cache dependencies # - name: Cache dependencies
# uses: actions/cache@v3 # uses: actions/cache@v3
# with: # with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }} # path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} # key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: | # restore-keys: |
# ${{ runner.os }}-yarn- # ${{ runner.os }}-yarn-
- name: Set SSH Environment - name: Set SSH Environment
env: env:

View File

@ -1,18 +1,18 @@
name: "Close stale issues" name: 'Close stale issues'
on: on:
schedule: schedule:
- cron: "30 1 * * *" - cron: '30 1 * * *'
jobs: jobs:
stale: stale:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v3 - uses: actions/stale@v3
with: with:
repo-token: ${{ secrets.OPER_TOKEN }} repo-token: ${{ secrets.OPER_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days' stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days' stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
exempt-issue-labels: 'bug,enhancement' exempt-issue-labels: 'bug,enhancement'
days-before-stale: 60 days-before-stale: 60
days-before-close: 7 days-before-close: 7

View File

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

2
.vscode/launch.json vendored
View File

@ -10,4 +10,4 @@
"sourceMaps": true "sourceMaps": true
} }
] ]
} }

28
.vscode/settings.json vendored
View File

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

View File

@ -308,7 +308,7 @@
- Fix the height issue of the lock screen pop-up window - Fix the height issue of the lock screen pop-up window
- Fixed the problem that the half-selected state of the `Column Display` checkbox of `BaiscTable` was incorrectly displayed - Fixed the problem that the half-selected state of the `Column Display` checkbox of `BaiscTable` was incorrectly displayed
- Fixed the problem that the preview list of the `BasicUpload` component could not be displayed in some cases - Fixed the problem that the preview list of the `BasicUpload` component could not be displayed in some cases
- Fix the problem that the `options` setting of ` RadioButtonGroup``disabled ` does not take effect - Fix the problem that the `options` setting of `RadioButtonGroup``disabled` does not take effect
- Fix the problem that the button for uploading pictures in the read-only mode of the `Tinymce` component is still available - Fix the problem that the button for uploading pictures in the read-only mode of the `Tinymce` component is still available
- Fix the stuttering problem of `BasicForm` under certain circumstances - Fix the stuttering problem of `BasicForm` under certain circumstances
- Fix the problem that "directory" routing does not work - Fix the problem that "directory" routing does not work

View File

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

View File

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

View File

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

View File

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

View File

@ -71,7 +71,7 @@
import { areaRecord } from '@/api/demo/cascader'; import { areaRecord } from '@/api/demo/cascader';
import { uploadApi } from '@/api/sys/upload'; import { uploadApi } from '@/api/sys/upload';
let debounceOptionsFn = useDebounceFn(onSearch, 300) let debounceOptionsFn = useDebounceFn(onSearch, 300);
const valueSelectA = ref<string[]>([]); const valueSelectA = ref<string[]>([]);
const valueSelectB = ref<string[]>([]); const valueSelectB = ref<string[]>([]);
const options = ref<Required<SelectProps>['options']>([]); const options = ref<Required<SelectProps>['options']>([]);
@ -412,7 +412,7 @@
params: { params: {
id: 1, id: 1,
}, },
resultField: 'list', resultField: 'list',
// use name as label // use name as label
labelField: 'name', labelField: 'name',