-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
314 changed files
with
35,687 additions
and
5,275 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,3 @@ dist-ssr | |
*.local | ||
.eslintcache | ||
.stylelintcache | ||
src/assets/sprites/*.* | ||
!src/assets/sprites/.gitkeep | ||
public/icons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"*.{ts,tsx,vue}": "eslint --cache --fix --no-ignore --no-error-on-unmatched-pattern --ext .ts,.tsx,.vue src/", | ||
"*.{ts,tsx,vue}": "eslint . --cache --fix", | ||
"*.{css,scss,vue}": "stylelint src/**/*.{css,scss,vue} --cache --fix --allow-empty-input" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
node_modules | ||
src/assets/sprites | ||
public/tinymce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
{ | ||
"eslint.experimental.useFlatConfig": true, | ||
"prettier.enable": false, | ||
"editor.formatOnSave": false, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true, | ||
"source.fixAll.stylelint": true | ||
"source.fixAll.stylelint": true, | ||
"source.organizeImports": false | ||
}, | ||
"stylelint.validate": ["css", "scss", "vue"] | ||
"stylelint.validate": [ | ||
"css", | ||
"scss", | ||
"vue" | ||
], | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue", | ||
"html", | ||
"markdown", | ||
"json", | ||
"jsonc", | ||
"yaml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import antfu from '@antfu/eslint-config' | ||
|
||
export default antfu( | ||
{ | ||
ignores: [ | ||
'public', | ||
'dist*', | ||
], | ||
}, | ||
{ | ||
rules: { | ||
'eslint-comments/no-unlimited-disable': 'off', | ||
'curly': ['error', 'all'], | ||
'antfu/consistent-list-newline': 'off', | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
'src/**/*.vue', | ||
], | ||
rules: { | ||
'vue/component-tags-order': ['error', { | ||
order: ['route', 'script', 'template', 'style'], | ||
}], | ||
}, | ||
}, | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import Mock from 'mockjs' | ||
|
||
const AllList: any[] = [] | ||
for (let i = 0; i < 50; i++) { | ||
AllList.push(Mock.mock({ | ||
id: '@id', | ||
title: '@ctitle(10, 20)', | ||
})) | ||
} | ||
|
||
export default [ | ||
{ | ||
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/list', | ||
method: 'get', | ||
response: (option: any) => { | ||
const { title, from, limit } = option.query | ||
const list = AllList.filter((item) => { | ||
return title ? item.title.includes(title) : true | ||
}) | ||
const pageList = list.filter((item, index) => { | ||
return index >= ~~from && index < (~~from + ~~limit) | ||
}) | ||
return { | ||
error: '', | ||
status: 1, | ||
data: { | ||
list: pageList, | ||
total: list.length, | ||
}, | ||
} | ||
}, | ||
}, | ||
{ | ||
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/detail', | ||
method: 'get', | ||
response: (option: any) => { | ||
const info = AllList.filter(item => item.id === option.query.id) | ||
return { | ||
error: '', | ||
status: 1, | ||
data: info[0], | ||
} | ||
}, | ||
}, | ||
{ | ||
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/create', | ||
method: 'post', | ||
response: { | ||
error: '', | ||
status: 1, | ||
data: { | ||
isSuccess: true, | ||
}, | ||
}, | ||
}, | ||
{ | ||
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/edit', | ||
method: 'post', | ||
response: { | ||
error: '', | ||
status: 1, | ||
data: { | ||
isSuccess: true, | ||
}, | ||
}, | ||
}, | ||
{ | ||
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/delete', | ||
method: 'post', | ||
response: { | ||
error: '', | ||
status: 1, | ||
data: { | ||
isSuccess: true, | ||
}, | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const path = require('node:path') | ||
const fs = require('node:fs') | ||
|
||
function getFolder(path) { | ||
const components = [] | ||
const files = fs.readdirSync(path) | ||
files.forEach((item) => { | ||
const stat = fs.lstatSync(`${path}/${item}`) | ||
if (stat.isDirectory() === true && item !== 'components') { | ||
components.push(`${path}/${item}`) | ||
components.push(...getFolder(`${path}/${item}`)) | ||
} | ||
}) | ||
return components | ||
} | ||
|
||
module.exports = { | ||
description: '创建标准模块 Mock', | ||
prompts: [ | ||
{ | ||
type: 'list', | ||
name: 'path', | ||
message: '请选择模块目录', | ||
choices: getFolder('src/views'), | ||
}, | ||
], | ||
actions: (data) => { | ||
const pathArr = path.relative('src/views', data.path).split('\\') | ||
const moduleName = pathArr.pop() | ||
const relativePath = pathArr.join('/') | ||
const actions = [] | ||
actions.push({ | ||
type: 'add', | ||
path: pathArr.length === 0 ? 'src/mock/{{moduleName}}.ts' : `src/mock/${pathArr.join('.')}.{{moduleName}}.ts`, | ||
templateFile: 'plop-templates/mock/mock.hbs', | ||
data: { | ||
relativePath, | ||
moduleName, | ||
}, | ||
}) | ||
return actions | ||
}, | ||
} |
Empty file.
Empty file.
Oops, something went wrong.