Skip to content

Commit

Permalink
Merge branch 'main' of github.com:biaov/ecosystem into feature/202309…
Browse files Browse the repository at this point in the history
…08-release
  • Loading branch information
biaov committed Sep 8, 2023
2 parents 4ac3505 + 803882d commit ac6b03a
Show file tree
Hide file tree
Showing 24 changed files with 25,915 additions and 25,904 deletions.
36 changes: 18 additions & 18 deletions admin/src/api/factory.ts
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>
})
84 changes: 42 additions & 42 deletions admin/src/components/rich-text/index.tsx
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} />
}
138 changes: 69 additions & 69 deletions mobile/.eslintrc.js
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
36 changes: 18 additions & 18 deletions mobile/index.html
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>
Loading

0 comments on commit ac6b03a

Please sign in to comment.