-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:biaov/ecosystem into feature/202309…
…08-release
- Loading branch information
Showing
24 changed files
with
25,915 additions
and
25,904 deletions.
There are no files selected for viewing
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,18 +1,18 @@ | ||
import { service } from '@/utils/request' | ||
import { defaultPageSize } from '@/config' | ||
import { PagingResponse } from './types' | ||
|
||
export const restful = (path: string) => ({ | ||
paging: <T>(query = {}): Promise<PagingResponse<T>> => service.get(path, { params: { current: 1, pageSize: defaultPageSize, ...query } }), | ||
all: <T>(query = {}) => service.get(path, { params: { ...query, all: true } }) as Promise<T>, | ||
get: <T>(id: number): Promise<T> => service.get(`${path}/${id}`), | ||
create: (data = {}) => service.post(path, data), | ||
delete: (id: number) => service.delete(`${path}/${id}`), | ||
update: (id: number, data = {}) => service.patch(`${path}/${id}`, data), | ||
replace: (id: number, data = {}) => service.put(`${path}/${id}`, data) | ||
}) | ||
|
||
export const command = (path: string) => ({ | ||
get: <T>(query = {}) => service.get(path, { params: query }) as Promise<T>, | ||
post: <T>(data = {}, config = {}) => service.post(path, data, config) as Promise<T> | ||
}) | ||
import { service } from '@/utils/request' | ||
import { defaultPageSize } from '@/config' | ||
import { PagingResponse } from './types' | ||
|
||
export const restful = (path: string) => ({ | ||
paging: <T>(query = {}): Promise<PagingResponse<T>> => service.get(path, { params: { current: 1, pageSize: defaultPageSize, ...query } }), | ||
all: <T>(query = {}) => service.get(path, { params: { ...query, all: true } }) as Promise<T>, | ||
get: <T>(id: number): Promise<T> => service.get(`${path}/${id}`), | ||
create: (data = {}) => service.post(path, data), | ||
delete: (id: number) => service.delete(`${path}/${id}`), | ||
update: (id: number, data = {}) => service.patch(`${path}/${id}`, data), | ||
replace: (id: number, data = {}) => service.put(`${path}/${id}`, data) | ||
}) | ||
|
||
export const command = (path: string) => ({ | ||
get: <T>(query = {}) => service.get(path, { params: query }) as Promise<T>, | ||
post: <T>(data = {}, config = {}) => service.post(path, data, config) as Promise<T> | ||
}) |
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,42 +1,42 @@ | ||
import { useEffect, useState } from 'react' | ||
import ReactQuill from 'react-quill' | ||
import 'react-quill/dist/quill.snow.css' | ||
import type { Props } from './types' | ||
|
||
export default function richTextComponent(props: Partial<Props> = {}) { | ||
const { value = '', onChange } = props | ||
const [richTextValue, setRichTextValue] = useState('') | ||
|
||
useEffect(() => { | ||
setRichTextValue(value) | ||
}, []) | ||
|
||
const modules = { | ||
toolbar: [ | ||
['bold', 'italic', 'underline', 'strike'], | ||
['blockquote', 'code-block'], | ||
|
||
[{ header: 1 }, { header: 2 }], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
[{ script: 'sub' }, { script: 'super' }], | ||
[{ indent: '-1' }, { indent: '+1' }], | ||
[{ direction: 'rtl' }], | ||
|
||
[{ size: ['small', false, 'large', 'huge'] }], | ||
[{ header: [1, 2, 3, 4, 5, 6, false] }], | ||
|
||
[{ color: [] }, { background: [] }], | ||
[{ font: [] }], | ||
[{ align: [] }], | ||
|
||
['clean'] | ||
] | ||
} | ||
|
||
const onChangeRichText = (val: string) => { | ||
setRichTextValue(val) | ||
onChange && onChange(val) | ||
} | ||
|
||
return <ReactQuill placeholder="请输入内容" theme="snow" {...{ richTextValue, modules }} style={{ height: '300px', marginBottom: '43px' }} onChange={onChangeRichText} /> | ||
} | ||
import { useEffect, useState } from 'react' | ||
import ReactQuill from 'react-quill' | ||
import 'react-quill/dist/quill.snow.css' | ||
import type { Props } from './types' | ||
|
||
export default function richTextComponent(props: Partial<Props> = {}) { | ||
const { value = '', onChange } = props | ||
const [richTextValue, setRichTextValue] = useState('') | ||
|
||
useEffect(() => { | ||
setRichTextValue(value) | ||
}, []) | ||
|
||
const modules = { | ||
toolbar: [ | ||
['bold', 'italic', 'underline', 'strike'], | ||
['blockquote', 'code-block'], | ||
|
||
[{ header: 1 }, { header: 2 }], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
[{ script: 'sub' }, { script: 'super' }], | ||
[{ indent: '-1' }, { indent: '+1' }], | ||
[{ direction: 'rtl' }], | ||
|
||
[{ size: ['small', false, 'large', 'huge'] }], | ||
[{ header: [1, 2, 3, 4, 5, 6, false] }], | ||
|
||
[{ color: [] }, { background: [] }], | ||
[{ font: [] }], | ||
[{ align: [] }], | ||
|
||
['clean'] | ||
] | ||
} | ||
|
||
const onChangeRichText = (val: string) => { | ||
setRichTextValue(val) | ||
onChange && onChange(val) | ||
} | ||
|
||
return <ReactQuill placeholder="请输入内容" theme="snow" {...{ richTextValue, modules }} style={{ height: '300px', marginBottom: '43px' }} onChange={onChangeRichText} /> | ||
} |
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,69 +1,69 @@ | ||
const developmentOff = process.env.NODE_ENV === 'development' ? 'off' : 'error' | ||
// 配置信息 | ||
const config = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
'vue/setup-compiler-macros': true | ||
}, | ||
globals: { | ||
uni: 'readonly', | ||
UniApp: 'readonly', | ||
defineSlots: 'readonly', | ||
defineOptions: 'readonly' | ||
}, | ||
extends: ['plugin:vue/vue3-essential', 'airbnb-base', 'plugin:prettier/recommended', './types/.eslintrc-auto-import.json'], | ||
parserOptions: { | ||
ecmaVersion: 14, | ||
parser: '@typescript-eslint/parser', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['vue', '@typescript-eslint'], | ||
settings: {}, | ||
overrides: [ | ||
{ | ||
files: ['**/components/*.vue'], | ||
rules: { | ||
'vue/multi-word-component-names': 'error' | ||
} | ||
}, | ||
{ | ||
files: ['./mobile/**/*.ts'], | ||
rules: { | ||
'no-console': 'off' // 禁止 console | ||
} | ||
}, | ||
{ | ||
files: ['**/*.vue', '**/types.ts'], | ||
rules: { | ||
'no-unused-vars': 'off' // 禁止未使用的变量, ts 变量 | ||
} | ||
} | ||
], | ||
rules: { | ||
'no-unused-vars': developmentOff, // 禁止未使用的变量 | ||
'no-console': developmentOff, // 禁止 console | ||
'no-unused-expressions': [ | ||
'error', | ||
{ | ||
allowShortCircuit: true, // 允许短路逻辑 | ||
allowTernary: true // 允许三目运算 | ||
} | ||
], | ||
'import/prefer-default-export': 'off', // 如果只有一个值,要用 default 导出 | ||
'import/no-unresolved': 'off', // import 识别路径,因为 alias 设置 | ||
'import/extensions': 'off', // 扩展简写 | ||
'no-param-reassign': 'off', // 函数参数修改 | ||
'no-plusplus': 'off', // 一元操作符 | ||
'no-nested-ternary': 'off', // 禁用嵌套的三元表达式 | ||
'no-bitwise': 'off', // 禁用按位运算符 | ||
'no-multi-assign': 'off', // 禁止连续赋值 | ||
'no-restricted-exports': 'off', // 禁止默认导出 | ||
'vue/multi-word-component-names': 'off', // 禁止多个单词名称 | ||
'default-case': 'off', // switch...case 一定要有 default | ||
'consistent-return': 'off' // 函数末尾返回值 | ||
} | ||
} | ||
|
||
module.exports = config | ||
const developmentOff = process.env.NODE_ENV === 'development' ? 'off' : 'error' | ||
// 配置信息 | ||
const config = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
'vue/setup-compiler-macros': true | ||
}, | ||
globals: { | ||
uni: 'readonly', | ||
UniApp: 'readonly', | ||
defineSlots: 'readonly', | ||
defineOptions: 'readonly' | ||
}, | ||
extends: ['plugin:vue/vue3-essential', 'airbnb-base', 'plugin:prettier/recommended', './types/.eslintrc-auto-import.json'], | ||
parserOptions: { | ||
ecmaVersion: 14, | ||
parser: '@typescript-eslint/parser', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['vue', '@typescript-eslint'], | ||
settings: {}, | ||
overrides: [ | ||
{ | ||
files: ['**/components/*.vue'], | ||
rules: { | ||
'vue/multi-word-component-names': 'error' | ||
} | ||
}, | ||
{ | ||
files: ['./mobile/**/*.ts'], | ||
rules: { | ||
'no-console': 'off' // 禁止 console | ||
} | ||
}, | ||
{ | ||
files: ['**/*.vue', '**/types.ts'], | ||
rules: { | ||
'no-unused-vars': 'off' // 禁止未使用的变量, ts 变量 | ||
} | ||
} | ||
], | ||
rules: { | ||
'no-unused-vars': developmentOff, // 禁止未使用的变量 | ||
'no-console': developmentOff, // 禁止 console | ||
'no-unused-expressions': [ | ||
'error', | ||
{ | ||
allowShortCircuit: true, // 允许短路逻辑 | ||
allowTernary: true // 允许三目运算 | ||
} | ||
], | ||
'import/prefer-default-export': 'off', // 如果只有一个值,要用 default 导出 | ||
'import/no-unresolved': 'off', // import 识别路径,因为 alias 设置 | ||
'import/extensions': 'off', // 扩展简写 | ||
'no-param-reassign': 'off', // 函数参数修改 | ||
'no-plusplus': 'off', // 一元操作符 | ||
'no-nested-ternary': 'off', // 禁用嵌套的三元表达式 | ||
'no-bitwise': 'off', // 禁用按位运算符 | ||
'no-multi-assign': 'off', // 禁止连续赋值 | ||
'no-restricted-exports': 'off', // 禁止默认导出 | ||
'vue/multi-word-component-names': 'off', // 禁止多个单词名称 | ||
'default-case': 'off', // switch...case 一定要有 default | ||
'consistent-return': 'off' // 函数末尾返回值 | ||
} | ||
} | ||
|
||
module.exports = config |
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,18 +1,18 @@ | ||
<!doctype html> | ||
<html lang="zh-cn"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="shortcut icon" href="/static/logo.svg" type="image/svg+xml" /> | ||
<script> | ||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) | ||
document.write( | ||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />' | ||
) | ||
</script> | ||
<title>生态系统-移动端</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> | ||
<!doctype html> | ||
<html lang="zh-cn"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="shortcut icon" href="/static/logo.svg" type="image/svg+xml" /> | ||
<script> | ||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) | ||
document.write( | ||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />' | ||
) | ||
</script> | ||
<title>生态系统-移动端</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.