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

View File

@ -1,18 +1,18 @@
name: "Close stale issues"
name: 'Close stale issues'
on:
schedule:
- cron: "30 1 * * *"
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
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-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'
days-before-stale: 60
days-before-close: 7
- uses: actions/stale@v3
with:
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-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'
days-before-stale: 60
days-before-close: 7

View File

@ -9,6 +9,6 @@
"antfu.iconify",
"antfu.unocss",
"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
}
]
}
}

28
.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

@ -308,7 +308,7 @@
- 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 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 stuttering problem of `BasicForm` under certain circumstances
- Fix the problem that "directory" routing does not work

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>
@ -27,8 +24,9 @@
import { BasicForm, useForm } from '@/components/Form';
import { CollapseContainer } from '@/components/Container';
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,23 +134,26 @@
}
const [
registerGroup,
{ appendSchemaByField: appendSchemaByFieldGroup, removeSchemaByField:removeSchemaByFieldGroup, getFieldsValue:getFieldsValueGroup,setFieldsValue },
{
appendSchemaByField: appendSchemaByFieldGroup,
removeSchemaByField: removeSchemaByFieldGroup,
getFieldsValue: getFieldsValueGroup,
setFieldsValue,
},
] = useForm({
schemas: [
{
field: `field[${count.value}].a`,
component: 'Input',
label: '字段a',
colProps:{span:9},
colProps: { span: 9 },
},
{
field: `field[${count.value}].b`,
colProps:{span:9},
colProps: { span: 9 },
component: 'Input',
label: '字段b',
},
],
labelWidth: 100,
actionColOptions: { span: 24 },
@ -161,19 +162,23 @@
function addGroup() {
count.value++;
appendSchemaByFieldGroup([ {
field: `field[${count.value}].a`,
component: 'Input',
colProps:{span:9},
label: '字段a',
},
{
field: `field[${count.value}].b`,
component: 'Input',
colProps:{span:9},
label: '字段b',
},
],"")
appendSchemaByFieldGroup(
[
{
field: `field[${count.value}].a`,
component: 'Input',
colProps: { span: 9 },
label: '字段a',
},
{
field: `field[${count.value}].b`,
component: 'Input',
colProps: { span: 9 },
label: '字段b',
},
],
'',
);
}
function delGroup() {
@ -181,17 +186,19 @@
count.value--;
}
function setGroup(){
function setGroup() {
setFieldsValue({
field:[{
a:"默认a",
b:"默认b"
}]
})
field: [
{
a: '默认a',
b: '默认b',
},
],
});
}
function handleSubmitGroup(){
createMessage.success("请前往控制台查看输出")
console.log(getFieldsValueGroup())
function handleSubmitGroup() {
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']>([]);
@ -412,7 +412,7 @@
params: {
id: 1,
},
resultField: 'list',
// use name as label
labelField: 'name',