提交 b0086031 作者: 陈楚尹

Merge branch 'main' of https://gitlab.yiring.com/hntq/hntq-v5 into dev_ccy

# API 接口地址 # API 接口地址
VITE_GLOB_API_URL=http://192.168.0.156:17181 VITE_GLOB_API_URL=http://192.168.0.156:8081
# API 接口地址前缀 # API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/api VITE_GLOB_API_URL_PREFIX=/api
...@@ -10,7 +10,12 @@ module.exports = { ...@@ -10,7 +10,12 @@ module.exports = {
jsx: true, jsx: true,
}, },
}, },
extends: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], extends: [
'@antfu',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: { rules: {
'vue/script-setup-uses-vars': 'error', 'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off', '@typescript-eslint/ban-ts-ignore': 'off',
...@@ -62,5 +67,6 @@ module.exports = { ...@@ -62,5 +67,6 @@ module.exports = {
}, },
], ],
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'no-console': 'off',
}, },
} }
node_modules node_modules
.DS_Store .DS_Store
dist dist
.npmrc
.cache .cache
tests/server/static tests/server/static
...@@ -33,3 +32,5 @@ pnpm-debug.log* ...@@ -33,3 +32,5 @@ pnpm-debug.log*
.mocks/ .mocks/
.pnpm-debug.log .pnpm-debug.log
unpackage/release
strict-peer-dependencies=false
shell-emulator=true
/dist/* /dist/*
.local .local
.output.js .output.js
.npmrc
.nvmrc
/node_modules/** /node_modules/**
**/*.svg **/*.svg
......
{
"recommendations": [
"vue.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"antfu.unocss",
"antfu.iconify",
"lokalise.i18n-ally",
"mrmlnc.vscode-less",
"aaron-bond.better-comments",
"shardulm94.trailing-spaces",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"vincaslt.highlight-matching-tag",
"ChakrounAnas.turbo-console-log",
"mikestead.dotenv",
"redhat.vscode-yaml",
"eamodio.gitlens",
"christian-kohler.path-intellisense",
"IBM.output-colorizer",
"PKief.material-icon-theme"
]
}
{ {
"typescript.tsdk": "./node_modules/typescript/lib",
"npm.packageManager": "pnpm", "npm.packageManager": "pnpm",
"editor.tabSize": 4,
"files.eol": "\n",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"i18n-ally.localesPaths": ["src/locales/lang"], "i18n-ally.localesPaths": ["src/locales/lang"],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",
"i18n-ally.readonly": true, "i18n-ally.readonly": true,
...@@ -9,5 +15,97 @@ ...@@ -9,5 +15,97 @@
"i18n-ally.enabledParsers": ["ts", "json"], "i18n-ally.enabledParsers": ["ts", "json"],
"i18n-ally.sourceLanguage": "en", "i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-Hans", "i18n-ally.displayLanguage": "zh-Hans",
"i18n-ally.enabledFrameworks": ["vue", "react"] "i18n-ally.enabledFrameworks": ["vue", "react"],
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"path-intellisense.mappings": {
"/@/": "${workspaceRoot}/src"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}
},
"search.exclude": {
"**/node_modules": true,
"**/*.log": true,
"**/*.log*": true,
"**/bower_components": true,
"**/dist": true,
"**/elehukouben": true,
"**/.git": true,
"**/.gitignore": true,
"**/.svn": true,
"**/.DS_Store": true,
"**/.idea": true,
"**/.vscode": false,
"**/yarn.lock": true,
"**/tmp": true,
"out": true,
"dist": true,
"node_modules": true,
"CHANGELOG.md": true,
"examples": true,
"res": true,
"screenshots": true,
"yarn-error.log": true,
"**/.yarn": true,
"**/.pnpm": true
},
"files.exclude": {
"**/.cache": true,
"**/.editorconfig": true,
"**/.eslintcache": true,
"**/bower_components": true,
"**/.idea": true,
"**/tmp": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/.vscode/**": true,
"**/node_modules/**": true,
"**/tmp/**": true,
"**/bower_components/**": true,
"**/dist/**": true,
"**/yarn.lock": true,
"**/pnpm-lock.yaml": true
}
} }
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
- [x] 集成 [Stomp WebSocket](https://github.com/jmesnil/stomp-websocket) - [x] 集成 [Stomp WebSocket](https://github.com/jmesnil/stomp-websocket)
- [x] 集成 [Pont](https://github.com/alibaba/pont) - [x] 集成 [Pont](https://github.com/alibaba/pont)
- [x] 集成 [Pinia](https://pinia.vuejs.org/) - [x] 集成 [Pinia](https://pinia.vuejs.org/)
- [x] 集成 [vue-i18n](https://github.com/intlify/vue-i18n-next) - [x] 集成 [Vue-i18n](https://github.com/intlify/vue-i18n-next)
- [x] 集成 [UnoCSS](https://github.com/antfu/unocss)
- [x] UI 组件集成 [FirstUI](https://gitlab.yiring.com/open/first-ui), [uni-ui](https://uniapp.dcloud.net.cn/component/uniui/quickstart.html) - [x] UI 组件集成 [FirstUI](https://gitlab.yiring.com/open/first-ui), [uni-ui](https://uniapp.dcloud.net.cn/component/uniui/quickstart.html)
- [x] 接入 [消息推送](https://uniapp.dcloud.net.cn/unipush.html) - [x] 接入 [消息推送](https://uniapp.dcloud.net.cn/unipush.html)
- [x] 接入 [APP 升级中心](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html) - [x] 接入 [APP 升级中心](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html)
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
* Get the configuration file variable name * Get the configuration file variable name
* @param env * @param env
*/ */
export const getConfigFileName = (env: Record<string, any>) => { export function getConfigFileName(env: Record<string, any>) {
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '') return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '')
} }
import fs from 'fs' import fs from 'node:fs'
import path from 'path' import path from 'node:path'
import dotenv from 'dotenv' import dotenv from 'dotenv'
export function isDevFn(mode: string): boolean { export function isDevFn(mode: string): boolean {
...@@ -40,7 +40,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv { ...@@ -40,7 +40,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
*/ */
function getConfFiles() { function getConfFiles() {
const script = process.env.npm_lifecycle_script const script = process.env.npm_lifecycle_script
const reg = new RegExp('--mode ([a-z_\\d]+)') const reg = /--mode ([a-z_\d]+)/
const result = reg.exec(script as string) as any const result = reg.exec(script as string) as any
if (result) { if (result) {
const mode = result[1] as string const mode = result[1] as string
......
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
import colors from 'picocolors' import colors from 'picocolors'
import pkg from '../../package.json'
import { configUniPlugin } from './uni' import { configUniPlugin } from './uni'
import { configImportPlugin } from './unplugin' import { configImportPlugin } from './unplugin'
import pkg from '../../package.json' import { configUnocssPlugin } from './unocss'
export function createVitePlugins(viteEnv: ViteEnv) { export function createVitePlugins(viteEnv: ViteEnv) {
const { VITE_GLOB_APP_NAME, VITE_GLOB_APP_DESCRIPTION, VITE_GLOB_API_URL, VITE_GLOB_API_URL_PREFIX } = viteEnv const { VITE_GLOB_APP_NAME, VITE_GLOB_APP_DESCRIPTION, VITE_GLOB_API_URL, VITE_GLOB_API_URL_PREFIX } = viteEnv
...@@ -18,6 +19,9 @@ export function createVitePlugins(viteEnv: ViteEnv) { ...@@ -18,6 +19,9 @@ export function createVitePlugins(viteEnv: ViteEnv) {
// plugins // plugins
const vitePlugins: (Plugin | Plugin[])[] = [] const vitePlugins: (Plugin | Plugin[])[] = []
// unocss
vitePlugins.push(configUnocssPlugin())
// unplugin-auto-import // unplugin-auto-import
// unplugin-vue-components // unplugin-vue-components
vitePlugins.push(configImportPlugin()) vitePlugins.push(configImportPlugin())
......
import fs from 'node:fs'
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
import fs from 'fs'
import prettier from 'prettier' import prettier from 'prettier'
// uni-app // uni-app
import uni from '@dcloudio/vite-plugin-uni' import uni from '@dcloudio/vite-plugin-uni'
// @dcloudio/uni-helper-json // @dcloudio/uni-helper-json
import tags from '@dcloudio/uni-helper-json/dist/tags.json' import tags from '@dcloudio/uni-helper-json/dist/tags.json'
...@@ -11,12 +12,19 @@ import tags from '@dcloudio/uni-helper-json/dist/tags.json' ...@@ -11,12 +12,19 @@ import tags from '@dcloudio/uni-helper-json/dist/tags.json'
* 根据 @dcloudio/uni-helper-json 生成组件 .d.ts 描述文件,对组件进行高亮展示 * 根据 @dcloudio/uni-helper-json 生成组件 .d.ts 描述文件,对组件进行高亮展示
*/ */
function generateUniComponentsTypes() { function generateUniComponentsTypes() {
const components = Object.keys(tags).map((key) => `'${key}': typeof HTMLElement`) const components = Object.keys(tags).map((key) => `'${key}': UniComponent`)
const content = ` const content = `
// generated by @dcloudio/uni-helper-json/dist/tags.json // generated by @dcloudio/uni-helper-json/dist/tags.json
declare module 'vue' { declare module 'vue' {
// uni-app 内置组件高亮 // shime-uni.d.ts
type Hooks = App.AppInstance & Page.PageInstance;
type ComponentCustomOptions = Hooks
// uni-app components
interface UniComponent {
[key in string]: any
}
export interface GlobalComponents { export interface GlobalComponents {
${components.join(',\n\t')} ${components.join(',\n\t')}
} }
...@@ -26,9 +34,10 @@ function generateUniComponentsTypes() { ...@@ -26,9 +34,10 @@ function generateUniComponentsTypes() {
const formatted = prettier.format(content, { const formatted = prettier.format(content, {
parser: 'typescript', parser: 'typescript',
// eslint-disable-next-line @typescript-eslint/no-require-imports
...require('../../prettier.config'), ...require('../../prettier.config'),
}) })
fs.writeFileSync('./types/uni-components.d.ts', formatted, 'utf8') fs.writeFileSync('./types/uni.d.ts', formatted, 'utf8')
} }
/** /**
......
import type { Plugin } from 'vite'
// https://github.com/antfu/unocss
import Unocss from 'unocss/vite'
import { presetIcons } from 'unocss'
export function configUnocssPlugin(): Plugin[] {
return Unocss({
presets: [
presetIcons({
prefix: 'icon-',
extraProperties: {
display: 'inline-flex',
},
}),
],
})
}
import path from 'node:path'
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
import path from 'path'
// https://github.com/antfu/unplugin-auto-import // https://github.com/antfu/unplugin-auto-import
import AutoImport from 'unplugin-auto-import/vite' import AutoImport from 'unplugin-auto-import/vite'
// https://github.com/antfu/unplugin-vue-components // https://github.com/antfu/unplugin-vue-components
import Components from 'unplugin-vue-components/vite' import Components from 'unplugin-vue-components/vite'
......
const fs = require('fs') const fs = require('node:fs')
const path = require('path') const path = require('node:path')
const { execSync } = require('child_process') const { execSync } = require('node:child_process')
const scopes = fs const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true }) .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
- ⭐TODO Highlight - ⭐TODO Highlight
- ⭐Volar (Vue3 + TS 开发首选) - ⭐Volar (Vue3 + TS 开发首选)
-[Pont-engine](https://marketplace.visualstudio.com/items?itemName=jasonHzq.vscode-pont) 接口自动化工具,**必装** -[Pont-engine](https://marketplace.visualstudio.com/items?itemName=jasonHzq.vscode-pont) 接口自动化工具,**必装**
- ⭐UnoCSS
- ESLint - ESLint
- stylelint - stylelint
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- prettier-ignore --> <!-- prettier-ignore -->
- [Vue v3.x](https://v3.vuejs.org/guide/introduction.html) - [Vue v3.x](https://v3.vuejs.org/guide/introduction.html)
- [uni-app@vue3 v3.x](https://uniapp.dcloud.io/tutorial/migration-to-vue3.html), 依赖 `HBuilderX v3.4.x+` 版本编辑器 - [uni-app@vue3 v3.x](https://uniapp.dcloud.io/tutorial/migration-to-vue3.html), 依赖 `HBuilderX v3.6.x+` 版本编辑器
- [TypeScript](https://www.typescriptlang.org/zh/) - [TypeScript](https://www.typescriptlang.org/zh/)
- [Less](https://lesscss.org/) - [Less](https://lesscss.org/)
- [Sass](https://www.sass.hk/) - [Sass](https://www.sass.hk/)
...@@ -21,13 +21,15 @@ ...@@ -21,13 +21,15 @@
- [Lodash](https://github.com/lodash/lodash) 函数库 - [Lodash](https://github.com/lodash/lodash) 函数库
- [Dayjs](https://github.com/iamkun/dayjs) 时间库 - [Dayjs](https://github.com/iamkun/dayjs) 时间库
- [@vueuse/core](https://github.com/vueuse/vueuse) Vue2/3 实用工具集 - [@vueuse/core](https://github.com/vueuse/vueuse) Vue2/3 实用工具集
- [mock.js](https://github.com/nuysoft/Mock) 数据模拟 - [faker-js](https://github.com/faker-js/faker) 数据模拟
- [UnoCSS](https://github.com/unocss/unocss) UnoCSS
### 网络 ### 网络
<!-- prettier-ignore --> <!-- prettier-ignore -->
- [uni.request](https://uniapp.dcloud.net.cn/api/request/request.html) - [uni.request](https://uniapp.dcloud.net.cn/api/request/request.html)
- [axios](https://github.com/axios/axios) - [axios](https://github.com/axios/axios)
- [vue-request@next](https://github.com/AttoJS/vue-request)
### 图表 ### 图表
...@@ -38,7 +40,7 @@ ...@@ -38,7 +40,7 @@
<!-- prettier-ignore --> <!-- prettier-ignore -->
- [HBuilderX Latest](https://www.dcloud.io/hbuilderx.html) - [HBuilderX Latest](https://www.dcloud.io/hbuilderx.html)
- [Vite v3.x](https://vitejs.dev) - [Vite](https://vitejs.dev)
### 其他插件 ### 其他插件
......
File added
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<script> <script>
var coverSupport = const coverSupport =
'CSS' in window && 'CSS' in window &&
typeof CSS.supports === 'function' && typeof CSS.supports === 'function' &&
(CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write( document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + `<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' : '') + coverSupport ? ', viewport-fit=cover' : ''
'" />', }" />`,
) )
</script> </script>
<title></title> <title></title>
......
logo.png

17.8 KB

...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js", "lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s", "log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"u": "pnpx @dcloudio/uvm vue3",
"prepare": "husky install" "prepare": "husky install"
}, },
"config": { "config": {
...@@ -65,90 +66,98 @@ ...@@ -65,90 +66,98 @@
} }
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-app": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-app-plus": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-components": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-components": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-h5": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-h5": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-alipay": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-baidu": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-jd": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-lark": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-qq": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-ui": "^1.4.23", "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3080320230523001",
"@vue/runtime-core": "^3.2.45", "@dcloudio/uni-ui": "^1.4.27",
"@vueuse/core": "^9.10.0", "@faker-js/faker": "^8.0.2",
"axios": "^0.26.1", "@vue/runtime-core": "~3.2.47",
"@vueuse/core": "^10.1.2",
"axios": "^1.4.0",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mockjs": "^1.1.0", "nanoid": "^4.0.2",
"nanoid": "^4.0.0", "pinia": "~2.0.36",
"pinia": "^2.0.28",
"qs": "~6.9.7", "qs": "~6.9.7",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"urijs": "^1.19.11", "urijs": "^1.19.11",
"vue": "^3.2.45", "vue": "~3.2.47",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-types": "^5.0.2" "vue-request": "2.0.0-rc.4",
"vue-types": "^5.0.3"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.4.0", "@antfu/eslint-config": "^0.39.3",
"@commitlint/config-conventional": "^17.4.0", "@commitlint/cli": "^17.6.3",
"@dcloudio/types": "^3.2.7", "@commitlint/config-conventional": "^17.6.3",
"@dcloudio/uni-automator": "3.0.0-alpha-3061620230106001", "@dcloudio/types": "^3.3.3",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-automator": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-helper-json": "^1.0.13", "@dcloudio/uni-helper-json": "^1.0.13",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3061620230106001", "@dcloudio/uni-stacktracey": "3.0.0-alpha-3080320230523001",
"@types/lodash-es": "^4.17.6", "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3080320230523001",
"@types/mockjs": "^1.0.7", "@iconify/json": "^2.2.71",
"@types/node": "^18.11.18", "@types/crypto-js": "^4.1.1",
"@types/lodash-es": "^4.17.7",
"@types/node": "^18.16.16",
"@types/prettier": "^2.7.2", "@types/prettier": "^2.7.2",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@types/stompjs": "^2.3.5", "@types/stompjs": "^2.3.5",
"@types/urijs": "^1.19.19", "@types/urijs": "^1.19.19",
"@typescript-eslint/eslint-plugin": "^5.48.0", "@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.48.0", "@typescript-eslint/parser": "^5.59.8",
"commitizen": "^4.2.6", "commitizen": "^4.3.0",
"conventional-changelog-cli": "^2.2.2", "conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^7.0.0", "cz-customizable": "^7.0.0",
"cz-git": "^1.4.1", "cz-git": "^1.6.1",
"czg": "^1.4.1", "czg": "^1.6.1",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"eslint": "^8.31.0", "eslint": "^8.41.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.8.0", "eslint-plugin-vue": "^9.14.1",
"husky": "^8.0.3", "husky": "^8.0.3",
"jest": "27.0.4",
"jest-environment-node": "27.5.1",
"less": "^4.1.3", "less": "^4.1.3",
"lint-staged": "^13.1.0", "lint-staged": "^13.2.2",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"pont-engine": "^1.5.4", "pont-engine": "^1.5.10",
"postcss": "^8.4.21", "postcss": "^8.4.24",
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^2.8.2", "prettier": "^2.8.8",
"rimraf": "^3.0.2", "rimraf": "^5.0.1",
"sass": "^1.57.1", "sass": "^1.62.1",
"sort-package-json": "^2.1.0", "sort-package-json": "^2.4.1",
"stylelint": "^14.16.1", "stylelint": "^15.6.2",
"stylelint-config-html": "^1.1.0", "stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.4", "stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended": "^9.0.0", "stylelint-config-standard": "^33.0.0",
"stylelint-config-standard": "^29.0.0", "stylelint-order": "^6.0.3",
"stylelint-order": "^5.0.0", "typescript": "^5.0.4",
"stylus": "^0.59.0", "unocss": "^0.52.4",
"terser": "^5.16.1", "unocss-preset-weapp": "^0.6.3",
"typescript": "^4.9.4", "unplugin-auto-import": "^0.16.2",
"unplugin-auto-import": "^0.12.1", "unplugin-vue-components": "^0.24.1",
"unplugin-vue-components": "^0.22.12", "vite": "^4.3.9",
"vite": "^4.0.4", "vue-eslint-parser": "^9.3.0"
"vue-eslint-parser": "^9.1.0"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=16",
"pnpm": ">=8.1.0"
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"originType": "SwaggerV2", "originType": "SwaggerV3",
"originUrl": "http://127.0.0.1:8081/api/v2/api-docs", "originUrl": "http://192.168.0.156:8081/api/v3/api-docs",
"templateType": "fetch", "templateType": "fetch",
"templatePath": "./pont-template", "templatePath": "./pont-template",
"transformPath": "./pont-transform", "transformPath": "./pont-transform",
"outDir": "./src/api/services", "outDir": "./src/api/services",
"surrounding": "typeScript", "surrounding": "typeScript",
"usingOperationId": true,
"mocks": { "mocks": {
"enable": true, "enable": true,
"basePath": "", "basePath": "",
......
import * as Pont from 'pont-engine' // import * as Pont from 'pont-engine'
import { Interface, BaseClass, Property, CodeGenerator } from 'pont-engine' import type { BaseClass, Interface } from 'pont-engine'
import { CodeGenerator, Property } from 'pont-engine'
// 接口 API 前缀 // 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同 // 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
const API_URL_PREFIX = '/api' const API_URL_PREFIX = '/api'
export class FileStructures extends Pont.FileStructures {
getModsDeclaration(originCode: string): string {
return originCode
}
}
export default class BasicGenerator extends CodeGenerator { export default class BasicGenerator extends CodeGenerator {
checkJsonParam(inter: Interface, paramsCode: string): boolean { checkJsonParam(inter: Interface, paramsCode: string): boolean {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const prettier = require('prettier') const prettier = require('prettier')
const requestParams = inter.getRequestParams(this.surrounding) const requestParams = inter.getRequestParams(this.surrounding)
const code = prettier.format(paramsCode, { parser: 'typescript' }) const code = prettier.format(paramsCode, { parser: 'typescript' })
...@@ -21,6 +17,7 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -21,6 +17,7 @@ export default class BasicGenerator extends CodeGenerator {
// 认为没有返回值的接口表示下载(通常是) // 认为没有返回值的接口表示下载(通常是)
isDownload(inter: Interface): boolean { isDownload(inter: Interface): boolean {
console.log(inter.name, inter.responseType)
return inter.responseType === 'any' return inter.responseType === 'any'
} }
...@@ -33,6 +30,7 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -33,6 +30,7 @@ export default class BasicGenerator extends CodeGenerator {
let requestParams = inter.getRequestParams(this.surrounding) let requestParams = inter.getRequestParams(this.surrounding)
let bodyTypeDef = '' let bodyTypeDef = ''
// eslint-disable-next-line @typescript-eslint/no-require-imports
const prettier = require('prettier') const prettier = require('prettier')
if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) { if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) {
if (!requestParams.includes('form')) { if (!requestParams.includes('form')) {
...@@ -40,15 +38,16 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -40,15 +38,16 @@ export default class BasicGenerator extends CodeGenerator {
} }
if (requestParams.includes('body')) { if (requestParams.includes('body')) {
requestParams = requestParams.replace('params?: Params, ', '')
bodyTypeDef = requestParams.replace(/^.*body: (.*),.*$/gi, '$1') bodyTypeDef = requestParams.replace(/^.*body: (.*),.*$/gi, '$1')
requestParams = requestParams.replace('params?: Params, ', '')
requestParams = requestParams.replace('body:', 'body?:')
} }
} }
return `${requestParams.replace( return `${requestParams.replace(
'options?: any', 'options?: any',
`config?: http.RequestConfig<${ `config?: http.RequestConfig<${
bodyTypeDef ? bodyTypeDef : `Params${requestParams.includes('form') ? ' | FormData' : ''}` bodyTypeDef || `Params${requestParams.includes('form') ? ' | FormData' : ''}`
}>`, }>`,
)}, options?: http.RequestOptions` )}, options?: http.RequestOptions`
} }
...@@ -56,11 +55,18 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -56,11 +55,18 @@ export default class BasicGenerator extends CodeGenerator {
getInterfaceContentInDeclaration(inter: Interface) { getInterfaceContentInDeclaration(inter: Interface) {
const paramsCode = inter.getParamsCode('Params') const paramsCode = inter.getParamsCode('Params')
const requestParams = this.getParams(inter, paramsCode) const requestParams = this.getParams(inter, paramsCode)
const sourceResponseType = inter.responseType
const targetResponseType =
sourceResponseType === 'File'
? 'void'
: sourceResponseType === 'defs.ResultString'
? 'string'
: sourceResponseType.replace(/defs.Result(.*)/, 'defs.$1')
return ` return `
export ${paramsCode} export ${paramsCode}
export type Response = ${inter.responseType.replace(/defs.Result\<(.*)\>/, '$1')}; export type Response = ${targetResponseType};
export const init: Response; export const init: Response;
...@@ -88,7 +94,8 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -88,7 +94,8 @@ export default class BasicGenerator extends CodeGenerator {
const method = inter.method.toUpperCase() const method = inter.method.toUpperCase()
const paramsCode = inter.getParamsCode('Params', this.surrounding) const paramsCode = inter.getParamsCode('Params', this.surrounding)
const requestParams = this.getParams(inter, paramsCode) const requestParams = this.getParams(inter, paramsCode)
const undef = inter.response.getInitialValue() === 'undefined' const initValue = inter.response.getInitialValue(true)
const undef = initValue === 'undefined' || initValue === `''`
const isBody = this.checkJsonParam(inter, paramsCode) const isBody = this.checkJsonParam(inter, paramsCode)
// TODO // TODO
...@@ -105,7 +112,7 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -105,7 +112,7 @@ export default class BasicGenerator extends CodeGenerator {
${isBody ? '' : `export ${paramsCode}`} ${isBody ? '' : `export ${paramsCode}`}
${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`} ${undef ? '' : `export const init = ${initValue};`}
export function request(${requestParams}) { export function request(${requestParams}) {
return defHttp.request({ return defHttp.request({
......
import { StandardDataSource } from 'pont-engine' import type { StandardDataSource } from 'pont-engine'
export default function (dataSource: StandardDataSource): StandardDataSource { export default function (dataSource: StandardDataSource): StandardDataSource {
return dataSource return dataSource
......
<script setup lang="ts"> <script setup lang="ts">
import { checkUpgrade } from '@/utils/upgrade' import { checkUpgrade } from '@/utils/upgrade'
// import * as Push from '@/utils/push' // import * as Push from '@/utils/push'
onLaunch(() => { onLaunch(() => {
...@@ -9,10 +10,10 @@ ...@@ -9,10 +10,10 @@
checkUpgrade() checkUpgrade()
// 清除消息角标 // 清除消息角标
// Push.setBadge() // Push.setBadge(0)
// 监听在线消息 // 监听在线消息
// Push.listenMessage() // Push.listen()
}) })
onShow(() => { onShow(() => {
...@@ -24,11 +25,11 @@ ...@@ -24,11 +25,11 @@
}) })
onError((err) => { onError((err) => {
Message.toast('App Error: ' + err) Message.toast(`App Error: ${err}`)
}) })
onUnhandledRejection((err) => { onUnhandledRejection((err) => {
Message.toast('App UnhandledRejection: ' + err) Message.toast(`App UnhandledRejection: ${err}`)
}) })
</script> </script>
...@@ -36,18 +37,20 @@ ...@@ -36,18 +37,20 @@
/* common css */ /* common css */
/* #ifndef APP-PLUS-NVUE */ /* #ifndef APP-PLUS-NVUE */
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */ /* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
@import './common/uni.css'; @import url('./common/uni.css');
/* #endif */ /* #endif */
/*每个页面公共css */ /* 每个页面公共css */
@import './common/fui-app.css'; @import url('./common/fui-app.css');
@import './components/firstui/fui-theme/fui-theme.css'; @import url('./components/firstui/fui-theme/fui-theme.css');
// 全局样式 // 全局样式
@import './common/public.less'; @import url('./common/public.less');
/** #ifdef H5 */
uni-page-body, uni-page-body,
page { page {
height: 100%; height: 100%;
} }
/** #endif */
</style> </style>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import * as login from './login' import * as login from './login'
import * as logout from './logout' import * as logout from './logout'
import * as register from './register' import * as register from './register'
import * as safe from './safe'
import * as valid from './valid' import * as valid from './valid'
export { login, logout, register, valid } export { login, logout, register, safe, valid }
...@@ -12,7 +12,7 @@ export class Params { ...@@ -12,7 +12,7 @@ export class Params {
password: string password: string
} }
export const init = new defs.Result() export const init = new defs.ResultLoginVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -6,25 +6,23 @@ import * as defs from '../../baseClass' ...@@ -6,25 +6,23 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** 用户名 */
username: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 手机号 */
mobile: string
/** 头像 */ /** 头像 */
avatar?: string avatar?: string
/** 邮箱 */ /** 邮箱 */
email?: string email?: string
/** 是否启用 */ /** 是否启用 */
enable?: boolean enable?: boolean
/** 简介 */
introduction?: string
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 用户名 */
username: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
/**
* @desc 安全验证
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 密码 */
password: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/auth/safe',
method: 'GET',
params,
...config,
},
options,
)
}
/** /**
* @desc 检查登录状态 * @desc 检查登录
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultBoolean()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
}
export const init = new defs.ResultDictVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description 字典管理
*/
import * as add from './add'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, find, modify, page, remove, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export const init = new defs.ResultPageVoDictVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/page',
method: 'GET',
params,
...config,
},
options,
)
}
...@@ -10,12 +10,12 @@ export class Params { ...@@ -10,12 +10,12 @@ export class Params {
ids: string ids: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/sys/role/deleted', url: '/sys/dict/remove',
method: 'POST', method: 'POST',
data: params, data: params,
......
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.ResultArrayListKeyValueVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/selector',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
}
export const init = new defs.ResultDictItemVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description 字典选项管理
*/
import * as add from './add'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, find, modify, page, remove, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export const init = new defs.ResultPageVoDictItemVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/remove',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 字典 ID */
dictId?: string
/** 字典 ID */
dictCode?: string
/** 字典选项是否启用 */
enable?: boolean
}
export const init = new defs.ResultArrayListKeyValueVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/selector',
method: 'GET',
params,
...config,
},
options,
)
}
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultUserExtensionVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,5 +7,6 @@ import * as fail from './fail' ...@@ -7,5 +7,6 @@ import * as fail from './fail'
import * as findUserExtensionInfo from './findUserExtensionInfo' import * as findUserExtensionInfo from './findUserExtensionInfo'
import * as json from './json' import * as json from './json'
import * as page from './page' import * as page from './page'
import * as upload from './upload'
export { hello, download, fail, findUserExtensionInfo, json, page } export { hello, download, fail, findUserExtensionInfo, json, page, upload }
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export const init = new defs.Result() export const init = new defs.ResultPageVoString()
export function request( export function request(
body: defs.PageParam, body?: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>, config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions, options?: http.RequestOptions,
) { ) {
......
...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass' ...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */ /** 分页条数 */
pageSize: number pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */ /** 排序字段 */
sortField?: string sortField?: string
/** 排序方向(ASC|DESC) */ /** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC' sortOrder?: string
} }
export const init = new defs.Result() export const init = new defs.ResultPageVoString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
/**
* @desc 文件上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.ResultString()
export function request(body?: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/example/upload',
method: 'POST',
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
options,
)
}
...@@ -5,22 +5,15 @@ ...@@ -5,22 +5,15 @@
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params {} export const init = new defs.ResultString()
export const init = new defs.Result() export function request(body?: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
export function request(
params: Params,
form: FormData,
config?: http.RequestConfig<Params | FormData>,
options?: http.RequestOptions,
) {
return defHttp.request( return defHttp.request(
{ {
url: '/common/file/upload', url: '/common/file/upload',
method: 'POST', method: 'POST',
data: form || params, data: body,
headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' }, headers: { 'Content-Type': 'application/json' },
...config, ...config,
}, },
......
...@@ -5,19 +5,15 @@ ...@@ -5,19 +5,15 @@
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export const init = new defs.ResultString()
/** Base64 图片信息 */
base64Image: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(body?: string, config?: http.RequestConfig<string>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/common/file/uploadBase64Image', url: '/common/file/uploadBase64Image',
method: 'POST', method: 'POST',
data: params, data: body,
headers: { 'Content-Type': 'application/json' },
...config, ...config,
}, },
......
import * as auth from './auth' import * as auth from './auth'
import * as dict from './dict'
import * as dictItem from './dictItem'
import * as example from './example' import * as example from './example'
import * as file from './file' import * as file from './file'
import * as permission from './permission' import * as permission from './permission'
...@@ -8,6 +10,8 @@ import * as userView from './userView' ...@@ -8,6 +10,8 @@ import * as userView from './userView'
export const API = { export const API = {
auth, auth,
dict,
dictItem,
example, example,
file, file,
permission, permission,
......
...@@ -5,41 +5,19 @@ ...@@ -5,41 +5,19 @@
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export const init = new defs.ResultString()
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
) {
return defHttp.request( return defHttp.request(
{ {
url: '/sys/permission/add', url: '/sys/permission/add',
method: 'POST', method: 'POST',
data: params, data: body,
headers: { 'Content-Type': 'application/json' },
...config, ...config,
}, },
......
...@@ -10,7 +10,7 @@ export class Params { ...@@ -10,7 +10,7 @@ export class Params {
id: string id: string
} }
export const init = new defs.Result() export const init = new defs.ResultPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
* @description 权限管理 * @description 权限管理
*/ */
import * as add from './add' import * as add from './add'
import * as deleted from './deleted'
import * as find from './find' import * as find from './find'
import * as modify from './modify' import * as modify from './modify'
import * as page from './page' import * as page from './page'
import * as remove from './remove'
import * as tree from './tree' import * as tree from './tree'
export { add, deleted, find, modify, page, tree } export { add, find, modify, page, remove, tree }
...@@ -5,43 +5,19 @@ ...@@ -5,43 +5,19 @@
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export const init = new defs.ResultString()
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: string
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
) {
return defHttp.request( return defHttp.request(
{ {
url: '/sys/permission/modify', url: '/sys/permission/modify',
method: 'POST', method: 'POST',
data: params, data: body,
headers: { 'Content-Type': 'application/json' },
...config, ...config,
}, },
......
...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass' ...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */ /** 分页条数 */
pageSize: number pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */ /** 排序字段 */
sortField?: string sortField?: string
/** 排序方向(ASC|DESC) */ /** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC' sortOrder?: string
} }
export const init = new defs.Result() export const init = new defs.ResultPageVoPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -10,12 +10,12 @@ export class Params { ...@@ -10,12 +10,12 @@ export class Params {
id: string id: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/sys/permission/deleted', url: '/sys/permission/remove',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -7,10 +7,10 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,10 +7,10 @@ import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** pid */ /** pid */
pid?: string pid: string
} }
export const init = new defs.Result() export const init = new defs.ResultArrayListPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -6,13 +6,15 @@ import * as defs from '../../baseClass' ...@@ -6,13 +6,15 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** 名称 */ /** id */
name: string id: string
/** 标识 */ /** 标识 */
uid: string uid: string
/** 名称 */
name: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -12,7 +12,7 @@ export class Params { ...@@ -12,7 +12,7 @@ export class Params {
ids: string ids: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -10,7 +10,7 @@ export class Params { ...@@ -10,7 +10,7 @@ export class Params {
id: string id: string
} }
export const init = new defs.Result() export const init = new defs.ResultRoleVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
*/ */
import * as add from './add' import * as add from './add'
import * as assign from './assign' import * as assign from './assign'
import * as deleted from './deleted'
import * as find from './find' import * as find from './find'
import * as modify from './modify' import * as modify from './modify'
import * as page from './page' import * as page from './page'
import * as remove from './remove'
import * as selector from './selector' import * as selector from './selector'
export { add, assign, deleted, find, modify, page, selector } export { add, assign, find, modify, page, remove, selector }
...@@ -8,13 +8,13 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -8,13 +8,13 @@ import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** id */ /** id */
id: string id: string
/** 名称 */
name: string
/** 标识 */ /** 标识 */
uid: string uid: string
/** 名称 */
name: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass' ...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */ /** 分页条数 */
pageSize: number pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */ /** 排序字段 */
sortField?: string sortField?: string
/** 排序方向(ASC|DESC) */ /** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC' sortOrder?: string
} }
export const init = new defs.Result() export const init = new defs.ResultPageVoRoleVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/role/remove',
method: 'POST',
data: params,
...config,
},
options,
)
}
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultArrayListRoleVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -12,7 +12,7 @@ export class Params { ...@@ -12,7 +12,7 @@ export class Params {
ids: string ids: string
} }
export const init = new defs.Result() export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass' ...@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */ /** 分页条数 */
pageSize: number pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */ /** 排序字段 */
sortField?: string sortField?: string
/** 排序方向(ASC|DESC) */ /** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC' sortOrder?: string
} }
export const init = new defs.Result() export const init = new defs.ResultPageVoUserVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultArrayListMenuVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultArrayListString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {} export class Params {}
export const init = new defs.Result() export const init = new defs.ResultUserInfo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
......
export const Message = { export const Message = {
/** /**
* 消息轻提示 * 消息轻提示
* @param text 消息内容 * @param title 消息内容
*/ */
toast: (text: string, duration?: 'short' | 'long'): void => { toast: (title: string, duration?: 'short' | 'long'): void => {
if (text) { if (title) {
// #ifndef APP-PLUS // #ifndef APP-PLUS
uni.showToast({ uni.showToast({
title: text, title,
icon: 'none', icon: 'none',
duration: duration === 'short' ? 2000 : 3500, duration: duration === 'short' ? 2000 : 3500,
}) })
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.nativeUI.toast(text, { plus.nativeUI.toast(title, {
duration: duration || 'short', duration: duration || 'short',
}) })
// #endif // #endif
...@@ -22,51 +22,51 @@ export const Message = { ...@@ -22,51 +22,51 @@ export const Message = {
}, },
/** /**
* 消息弹窗提示 * 消息弹窗提示
* @param message 消息内容 * @param content 消息内容
* @param title 标题 * @param title 标题
* @returns Promise<void> * @returns Promise<void>
*/ */
alert: (message: string, title = '提示', confirmText = '确定'): Promise<void> => { alert: (content: string, title = '提示', confirmText = '确定'): Promise<void> => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifndef APP-PLUS // #ifndef APP-PLUS
uni.showModal({ uni.showModal({
title: title, title,
content: message, content,
showCancel: false, showCancel: false,
confirmText: confirmText, confirmText,
success: () => resolve(), success: () => resolve(),
fail: (err) => reject(err), fail: (err) => reject(err),
}) })
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.nativeUI.alert(message, resolve, title, confirmText) plus.nativeUI.alert(content, resolve, title, confirmText)
// #endif // #endif
}) })
}, },
/** /**
* 消息确认提示 * 消息确认提示
* @param title 标题 * @param title 标题
* @param message 提示内容 * @param content 提示内容
* @param confirmText 确认按钮文字 * @param confirmText 确认按钮文字
* @param showCancel 是否显示取消按钮 * @param showCancel 是否显示取消按钮
* @returns Promise<boolean> 是否点击了确认按钮 * @returns Promise<boolean> 是否点击了确认按钮
*/ */
confirm: (message: string, title = '提示', confirmText = '确定', showCancel = true): Promise<boolean> => { confirm: (content: string, title = '提示', confirmText = '确定', showCancel = true): Promise<boolean> => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// #ifndef APP-PLUS // #ifndef APP-PLUS
uni.showModal({ uni.showModal({
title: title, title,
content: message, content,
showCancel: showCancel, showCancel,
confirmText: confirmText, confirmText,
success: (res) => resolve(res.confirm), success: (res) => resolve(res.confirm),
fail: (err) => reject(err), fail: (err) => reject(err),
}) })
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.nativeUI.confirm(message, ({ index }) => resolve(index === 0), { plus.nativeUI.confirm(content, ({ index }) => resolve(index === 0), {
title, title,
buttons: ['确认', '取消'], buttons: ['确认', '取消'],
verticalAlign: 'center', verticalAlign: 'center',
...@@ -74,4 +74,20 @@ export const Message = { ...@@ -74,4 +74,20 @@ export const Message = {
// #endif // #endif
}) })
}, },
/**
* 加载中
* @param title 加载中文字
*/
loading: (title = '加载中...'): void => {
uni.showLoading({
title,
mask: true,
})
},
/**
* 隐藏加载中
*/
hideLoading: (): void => {
uni.hideLoading()
},
} }
...@@ -4,116 +4,3 @@ ...@@ -4,116 +4,3 @@
align-items: center; align-items: center;
height: 100vh; height: 100vh;
} }
// ================ mapbox-gl ================
// 自定义 popup 内容样式
.mapboxgl-popup-content {
box-shadow: 0 1px 5px #6e6e6e !important;
}
.mapboxgl-popup-content .mapboxgl-custom-popup {
position: relative;
}
.mapboxgl-custom-popup .popup-title {
font-weight: bold;
}
.mapboxgl-ctrl-group:not(:empty) {
box-shadow: 0 0 6px #000 !important;
}
.mapboxgl-ctrl-group button {
display: flex !important;
overflow: visible !important;
}
.mapboxgl-ctrl-logo {
display: none !important;
}
.mapboxgl-ctrl-bottom-left {
display: flex;
bottom: 0;
left: 2px;
}
.mapboxgl-ctrl-lnglat {
background: rgb(0 0 0 / 40%);
color: white;
line-height: 2em;
padding: 0 10px;
}
// 覆盖全屏控件的图标
.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="currentColor" d="M3.75 3a.75.75 0 0 0-.75.75V5.5a.5.5 0 0 1-1 0V3.75C2 2.784 2.784 2 3.75 2H5.5a.5.5 0 0 1 0 1H3.75ZM10 2.5a.5.5 0 0 1 .5-.5h1.75c.966 0 1.75.784 1.75 1.75V5.5a.5.5 0 0 1-1 0V3.75a.75.75 0 0 0-.75-.75H10.5a.5.5 0 0 1-.5-.5ZM2.5 10a.5.5 0 0 1 .5.5v1.75c0 .414.336.75.75.75H5.5a.5.5 0 0 1 0 1H3.75A1.75 1.75 0 0 1 2 12.25V10.5a.5.5 0 0 1 .5-.5Zm11 0a.5.5 0 0 1 .5.5v1.75A1.75 1.75 0 0 1 12.25 14H10.5a.5.5 0 0 1 0-1h1.75a.75.75 0 0 0 .75-.75V10.5a.5.5 0 0 1 .5-.5Z"%2F%3E%3C%2Fsvg%3E') !important;
}
.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="currentColor" d="M11 4a1 1 0 0 0 1 1h1.5a.5.5 0 0 1 0 1H12a2 2 0 0 1-2-2V2.5a.5.5 0 0 1 1 0V4Zm0 8a1 1 0 0 1 1-1h1.5a.5.5 0 0 0 0-1H12a2 2 0 0 0-2 2v1.5a.5.5 0 0 0 1 0V12Zm-7-1a1 1 0 0 1 1 1v1.5a.5.5 0 0 0 1 0V12a2 2 0 0 0-2-2H2.5a.5.5 0 0 0 0 1H4Zm1-7a1 1 0 0 1-1 1H2.5a.5.5 0 0 0 0 1H4a2 2 0 0 0 2-2V2.5a.5.5 0 0 0-1 0V4Z"%2F%3E%3C%2Fsvg%3E') !important;
}
.mapboxgl-ctrl .mapboxgl-ctrl-reset-button .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3s-3 1.331-3 3s1.329 3 3 3z"%2F%3E%3Cpath fill="currentColor" d="M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219a9.053 9.053 0 0 0-2.43-2.43a8.95 8.95 0 0 0-3.219-1.355a9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053a7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725a7.11 7.11 0 0 1-.644 1.188a7.2 7.2 0 0 1-.858 1.039a7.028 7.028 0 0 1-3.536 1.907a7.13 7.13 0 0 1-2.822 0a6.961 6.961 0 0 1-2.503-1.054a7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034a9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183a9.014 9.014 0 0 0 3.218-1.355a8.886 8.886 0 0 0 1.331-1.099a9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"%2F%3E%3C%2Fsvg%3E') !important;
}
/* stylelint-disable-next-line selector-no-vendor-prefix */
.mapboxgl-map:-webkit-full-screen {
.mapboxgl-ctrl-bottom-left {
bottom: 0;
}
}
// 自定义图层控制器样式
.mapboxgl-ctrl button.-active svg {
color: #4264fb;
}
.mapboxgl-ctrl-layer-button {
position: relative;
.mapboxgl-ctrl-layer-wrap {
display: none;
justify-items: center;
align-items: center;
position: absolute;
right: 40px;
padding: 10px;
border-radius: 3px;
box-shadow: 0 0 3px #333;
background-color: #fff;
.mapboxgl-ctrl-layer {
width: 60px;
height: 60px;
display: flex;
justify-content: center;
border: 2px solid #fff;
position: relative;
&.active {
border-color: #3385ff;
}
img {
width: 100%;
height: 100%;
}
span {
display: inline-flex;
justify-content: center;
background-color: rgb(0 0 0 / 60%);
color: white;
position: absolute;
bottom: 0;
width: 100%;
}
}
}
&.-active .mapboxgl-ctrl-layer-wrap {
display: flex;
}
}
<script setup lang="ts">
import md5 from 'crypto-js/md5'
const props = defineProps({
width: {
type: [String, Number],
default: '320',
},
height: {
type: [String, Number],
default: '240',
},
radius: {
type: [String, Number],
default: 0,
},
mode: {
type: String,
default: 'scaleToFill',
},
background: {
type: String,
default: '#F7F7F7',
},
src: {
type: String,
required: true,
},
debug: {
type: Boolean,
default: false,
},
})
const srcImage = ref()
const hashCacheKey = ref()
onMounted(async () => {
await tryCache()
})
// 监听 src 变化
watch(
() => props.src,
async () => await tryCache(),
)
function log(...args: any[]) {
if (props.debug) {
console.log('[CacheImage]', ...args)
}
}
// 尝试缓存图片,如果失败则使用原始图片
async function tryCache() {
let url = props.src
if (!url) {
return
}
// 如果是网络图片,则缓存到本地
if (url.startsWith('http')) {
// #ifdef APP-PLUS
const hash = md5(url).toString()
hashCacheKey.value = `G_CACHE_IMAGE_${hash}`
if (uni.getStorageSync(hashCacheKey.value)) {
log('cache hit', url)
url = uni.getStorageSync(hashCacheKey.value)
} else {
log('cache miss', url)
try {
const res = await uni.downloadFile({ url })
if (res.statusCode === 200) {
const { savedFilePath } = await new Promise<UniApp.SaveFileSuccess>((resolve, reject) => {
uni.saveFile({
tempFilePath: res.tempFilePath,
success: (res) => resolve(res),
fail: (err) => reject(err),
})
})
url = `${savedFilePath}`
// 缓存图片本地地址
uni.setStorageSync(hashCacheKey.value, url)
} else {
log('cache error', url, res)
url = props.src
}
} catch (e) {
console.error(e)
}
}
log(props.src, '=>', url, hash, hashCacheKey.value)
// #endif
}
srcImage.value = url
}
const hasError = ref(false)
function onError() {
if (hasError.value) {
return
}
hasError.value = true
srcImage.value = props.src
// 清除缓存
hashCacheKey.value && uni.removeStorageSync(hashCacheKey.value)
console.warn('CacheImage cache error')
}
</script>
<template>
<fui-lazyload
v-bind="$attrs"
:mode="props.mode"
:width="props.width"
:height="props.height"
:radius="props.radius"
:background="props.background"
:src="srcImage"
@error="onError"
>
<slot></slot>
</fui-lazyload>
</template>
<script setup lang="ts">
defineProps({
/**
* 提示内容
*/
tips: {
type: String,
default: '',
},
/**
* 提示内容颜色
*/
tipsColor: {
type: String,
default: '#9C9C9C',
},
/**
* 背景颜色
*/
bgColor: {
type: String,
default: 'transparent',
},
})
</script>
<template> <template>
<view class="empty" :style="[{ background: bgColor }]"> <view class="empty" :style="{ background: bgColor }">
<!-- 暂无数据/空数据 --> <!-- 暂无数据/空数据 -->
<image src="../../static/images/empty.png" /> <image src="../../static/images/empty.png" />
<!-- 提示内容 --> <!-- 提示内容 -->
<view class="empty-tips" :style="[{ color: tipsColor }]">{{ tips }}</view> <view class="empty-tips" :style="{ color: tipsColor }">{{ tips }}</view>
</view> </view>
</template> </template>
<script>
export default { <style scoped>
props: {
tips: {
type: String,
default: '',
},
tipsColor: {
type: String,
default: '#9C9C9C',
},
bgColor: {
type: String,
default: 'transparent',
},
},
}
</script>
<style>
.empty { .empty {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -43,6 +52,6 @@ ...@@ -43,6 +52,6 @@
.empty .empty-tips { .empty .empty-tips {
display: flex; display: flex;
font-size: 30rpx; font-size: 30rpx;
color: #999999; color: #999;
} }
</style> </style>
<script setup lang="ts">
const props = defineProps({
icon: {
type: String,
required: true,
},
size: {
type: [Number, String],
default: 32,
},
color: {
type: String,
default: '#000',
},
})
const size = computed(() => `${props.size}rpx`)
const color = computed(() => props.color)
</script>
<template>
<view class="icon" />
</template>
<style lang="less" scoped>
.icon {
width: v-bind(size);
height: v-bind(size);
color: v-bind(color);
}
</style>
<script lang="ts" setup>
import md5 from 'crypto-js/md5'
import { nanoid } from 'nanoid'
import { getPoster, isImage, isVideo } from './utils'
import CacheImage from '@/components/CacheImage/index.vue'
type Asset = Recordable & { url: string }
const props = defineProps({
width: {
type: [String, Number],
default: '96',
},
height: {
type: [String, Number],
default: '96',
},
mode: {
type: String,
default: 'aspectFit',
},
background: {
type: String,
default: '#F7F7f7',
},
assets: {
type: Array as PropType<Asset[]>,
},
})
// 生成预览容器高度
const height = computed(() => `${props.height}rpx`)
// 分离图片和视频资源地址
const images = computed(() => props.assets.filter((item) => isImage(item.url)))
const videos = computed(() => props.assets.filter((item) => isVideo(item.url)))
// 预览图片
function preview(index: number) {
uni.previewImage({
urls: images.value.map((item) => {
// #ifdef APP-PLUS
const hash = md5(item.url).toString()
const key = `G_CACHE_IMAGE_${hash}`
if (uni.getStorageSync(key)) {
return uni.getStorageSync(key)
}
// #endif
return item.url
}),
current: index,
})
}
// 初始化视频组件配置
const videoId = nanoid()
const videoContext = ref()
const playVideoSrc = ref()
// 播放视频
function play(index: number) {
playVideoSrc.value = videos.value[index].url
videoContext.value?.requestFullScreen()
videoContext.value?.play()
}
function videoFullScreenChange(e: any) {
// 非全屏状态下停止播放
if (!e.detail.fullScreen) {
videoContext.value.seek(0)
videoContext.value.pause()
}
}
onMounted(() => {
// 初始化视频组件上下文对象
videoContext.value = uni.createVideoContext(videoId)
})
</script>
<template>
<view class="preview-wrap">
<!-- 视频预览 -->
<CacheImage
class="preview-video"
:background="props.background"
:mode="props.mode"
v-for="(item, index) in videos"
:key="item.url"
:src="getPoster(item.url)"
:width="props.width"
:height="props.height"
:radius="10"
@tap="play(index)"
>
<view class="icon-wrap" :style="{ width: props.width, height: props.height }">
<fui-icon class="video-play-icon" name="suspend" size="40" color="#fff" />
</view>
</CacheImage>
<!-- 图片预览 -->
<CacheImage
class="preview-image"
:background="props.background"
:mode="props.mode"
v-for="(item, index) in images"
:key="item.url"
:src="getPoster(item.url)"
:width="props.width"
:height="props.height"
:radius="10"
@tap="preview(index)"
/>
<!-- 视频 -->
<video
:id="videoId"
:src="playVideoSrc"
class="video"
autoplay
controls
@fullscreenchange="videoFullScreenChange"
></video>
</view>
</template>
<style lang="less" scoped>
.preview-wrap {
display: flex;
flex-wrap: wrap;
margin: -10rpx;
.preview-image,
.preview-video {
margin: 10rpx !important;
position: relative;
:deep(.fui-lazyload__img) {
height: v-bind(height) !important;
}
.icon-wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgb(0 0 0 / 50%);
border-radius: 10rpx;
.video-play-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
.video {
position: absolute;
top: -999999px;
}
}
</style>
export type FileType = 'image' | 'video' | 'audio'
export function isImage(url: string) {
return /\.(png|jpe?g|webp|tif?f|avif|gif|svg)(\?.*)?$/i.test(url)
}
export function isVideo(url: string) {
return /\.(mp4|flv|mov|mkv|mpeg|mpg|wmv|m3u8)(\?.*)?$/i.test(url)
}
export function isAudio(url: string) {
return /\.(mp3|wav|ogg|aac|flac)(\?.*)?$/i.test(url)
}
export function getPoster(url: string) {
if (!isVideo(url)) {
return url
}
return `${url}.jpg`
}
# 组件更新说明
1. 从 https://firstui.cn/user/order 下载更新版本包
2. 在本地解压,找到 \FirstUI\components\firstui 目录,使用 vscode 打开当前目录
3. 清理掉组件文件头部的 license 信息,使用 vscode 全局替换
4. 全局替换换行符 \r\n\n [引用](https://segmentfault.com/q/1010000011799577)
5. 将文件拷贝到 src\components\FirstUI\ 目录下,检查 git diff,手动处理哪些文件需要更新
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 6 1 6 2 60195,身份证尾号: 503 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template> <template>
<view @touchmove.stop.prevent="stop" v-if="isShow || !isNvue"> <view @touchmove.stop.prevent="stop" v-if="isShow || !isNvue">
<view class="fui-actionsheet__mask" :class="{'fui-actionsheet__mask-show':show}" ref="fui_asm_ani" <view class="fui-actionsheet__mask" :class="{'fui-actionsheet__mask-show':show}" ref="fui_asm_ani"
...@@ -215,7 +214,8 @@ ...@@ -215,7 +214,8 @@
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax',
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', 'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini',
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', 'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini',
'iphone14pro', 'iphone14promax' 'iphone14pro', 'iphone14promax', 'iphone15', 'iphone15mini',
'iphone15pro', 'iphone15promax'
] ]
const model = res.model.replace(/\s/g, "").toLowerCase() const model = res.model.replace(/\s/g, "").toLowerCase()
const newModel = model.split('<')[0] const newModel = model.split('<')[0]
...@@ -306,11 +306,12 @@ ...@@ -306,11 +306,12 @@
.fui-actionsheet__btn { .fui-actionsheet__btn {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
width: 100%; width: 100%;
box-sizing: content-box;
/* #endif */ /* #endif */
flex: 1;
height: 100rpx; height: 100rpx;
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
line-height: 100rpx; line-height: 100rpx;
flex: 1;
/* #endif */ /* #endif */
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -431,4 +432,4 @@ ...@@ -431,4 +432,4 @@
opacity: 1; opacity: 1;
/* #endif */ /* #endif */
} }
</style> </style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 56 16 2 60 1 95,身份证尾号:5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template> <template>
<view class="fui-alert__wrap" :class="[background?'':('fui-alert__'+type)]" <view class="fui-alert__wrap" :class="[background?'':('fui-alert__'+type)]"
:style="{background:background || getColor(type),borderRadius:radius,paddingTop:padding[0] || 0,paddingRight:padding[1]||0,paddingBottom:padding[2] || padding[0]||0,paddingLeft:padding[3] || padding[1]||0,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}"> :style="{background:background || getColor(type),borderRadius:radius,paddingTop:padding[0] || 0,paddingRight:padding[1]||0,paddingBottom:padding[2] || padding[0]||0,paddingLeft:padding[3] || padding[1]||0,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}">
...@@ -240,4 +239,4 @@ ...@@ -240,4 +239,4 @@
cursor: pointer; cursor: pointer;
/* #endif */ /* #endif */
} }
</style> </style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 16 2 6 019 5,身份证尾号:5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template> <template>
<view class="fui-popup__animation" :class="[ani.in]" :style="'transform:' + transform + ';' + stylesObject" <view class="fui-popup__animation" :class="[ani.in]" :style="'transform:' + transform + ';' + stylesObject"
@tap="change" v-if="isShow" ref="fui_ani"> @tap="change" v-if="isShow" ref="fui_ani">
...@@ -38,18 +37,7 @@ ...@@ -38,18 +37,7 @@
styles: { styles: {
type: Object, type: Object,
default () { default () {
return { return {}
position: 'fixed',
bottom: 0,
top: 0,
left: 0,
right: 0,
// #ifndef APP-NVUE
display: 'flex',
// #endif
'justify-content': 'center',
'align-items': 'center'
};
} }
} }
}, },
...@@ -77,8 +65,22 @@ ...@@ -77,8 +65,22 @@
}, },
computed: { computed: {
stylesObject() { stylesObject() {
let styles = { //默认值
...this.styles, const defStyles = {
position: 'fixed',
bottom: 0,
top: 0,
left: 0,
right: 0,
// #ifndef APP-NVUE
display: 'flex',
// #endif
'justify-content': 'center',
'align-items': 'center'
};
const mergeStyles = Object.assign({}, defStyles, this.styles);
const styles = {
...mergeStyles,
'transition-duration': this.duration / 1000 + 's' 'transition-duration': this.duration / 1000 + 's'
}; };
let transfrom = ''; let transfrom = '';
...@@ -212,4 +214,4 @@ ...@@ -212,4 +214,4 @@
.fui-popup__fade-in { .fui-popup__fade-in {
opacity: 1; opacity: 1;
} }
</style> </style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5616 2 6 019 5,身份证尾号: 5 0 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template> <template>
<view class="fui-autograph__wrap" :style="{ width: w + 'px', height:h + 'px',background:background }" <view class="fui-autograph__wrap" :style="{ width: w + 'px', height:h + 'px',background:background }"
ref="fui_gcanvas_ag"> ref="fui_gcanvas_ag">
...@@ -8,17 +7,23 @@ ...@@ -8,17 +7,23 @@
</gcanvas> </gcanvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE || MP-TOUTIAO--> <!-- #ifndef APP-NVUE || MP-TOUTIAO || MP-QQ-->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart" <canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel" @touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}" @mousedown="mousedown" @mousemove="mousemove" @mouseup="mouseup" :style="{width:w+'px',height:h+'px'}" @mousedown="mousedown" @mousemove="mousemove" @mouseup="mouseup"
@mouseleave="mouseleave"></canvas> @mouseleave="mouseleave"></canvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-QQ -->
<canvas :disable-scroll="!completed" canvas-id="canvas_autograph" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}"></canvas>
<!-- #endif -->
<!-- #ifdef MP-TOUTIAO --> <!-- #ifdef MP-TOUTIAO -->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart" <canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove.stop.prevent="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel" @touchmove.stop.prevent="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}"></canvas> :style="{width:w+'px',height:h+'px'}" v-if="canvasId"></canvas>
<!-- #endif --> <!-- #endif -->
</view> </view>
</template> </template>
...@@ -62,7 +67,11 @@ ...@@ -62,7 +67,11 @@
tips: { tips: {
type: String, type: String,
default: '请签名!' default: '请签名!'
} },
suffix: {
type: String,
default: 'png'
},
}, },
watch: { watch: {
width(val) { width(val) {
...@@ -77,16 +86,19 @@ ...@@ -77,16 +86,19 @@
} }
}, },
data() { data() {
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN || MP-QQ
const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
// #ifdef MP-QQ
const canvasId = 'canvas_autograph'
// #endif
return { return {
// #ifdef APP-NVUE // #ifdef APP-NVUE
isAndroid: true, isAndroid: true,
nTop: 0, nTop: 0,
nLeft: 0, nLeft: 0,
// #endif // #endif
canvasId:canvasId, canvasId: canvasId,
w: 300, w: 300,
h: 200, h: 200,
completed: false, completed: false,
...@@ -104,32 +116,34 @@ ...@@ -104,32 +116,34 @@
this.touchs = null; this.touchs = null;
}, },
mounted() { mounted() {
setTimeout(() => { this.$nextTick(() => {
// #ifdef APP-NVUE setTimeout(() => {
let ganvas = this.$refs[this.canvasId]; // #ifdef APP-NVUE
/*通过元素引用获取canvas对象*/ let ganvas = this.$refs[this.canvasId];
let canvasObj = enable(ganvas, { /*通过元素引用获取canvas对象*/
bridge: WeexBridge let canvasObj = enable(ganvas, {
}); bridge: WeexBridge
/*获取绘图所需的上下文,暂不支持3d*/ });
this.ctx = canvasObj.getContext('2d'); /*获取绘图所需的上下文,暂不支持3d*/
if (!this.isAndroid) { this.ctx = canvasObj.getContext('2d');
this.getDom() if (!this.isAndroid) {
} this.getDom()
// #endif }
// #endif
// #ifndef APP-NVUE // #ifndef APP-NVUE
this.ctx = uni.createCanvasContext(this.canvasId, this) this.ctx = uni.createCanvasContext(this.canvasId, this)
// #endif // #endif
// #ifdef MP-BAIDU // #ifdef MP-BAIDU
this.redraw() this.redraw()
// #endif // #endif
this.$emit('ready', { this.$emit('ready', {
canvasId: this.canvasId canvasId: this.canvasId
}) })
}, 50) }, 50)
})
}, },
// #ifndef VUE3 // #ifndef VUE3
beforeDestroy() { beforeDestroy() {
...@@ -302,7 +316,7 @@ ...@@ -302,7 +316,7 @@
x: 0, x: 0,
y: 0, y: 0,
canvasId: this.canvasId, canvasId: this.canvasId,
fileType: 'png', fileType: this.suffix,
quality: 1, quality: 1,
success: function(res) { success: function(res) {
callback && callback(res.tempFilePath) callback && callback(res.tempFilePath)
...@@ -321,7 +335,7 @@ ...@@ -321,7 +335,7 @@
this.h * 2, this.h * 2,
this.w * 2, this.w * 2,
this.h * 2, this.h * 2,
"png", this.suffix,
1, 1,
function(res) { function(res) {
callback && callback(res.tempFilePath) callback && callback(res.tempFilePath)
...@@ -337,4 +351,4 @@ ...@@ -337,4 +351,4 @@
} }
</script> </script>
<style scoped></style> <style scoped></style>
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 15 6162 6019 5,身份证尾号: 5037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
const isWeex = typeof WXEnvironment !== 'undefined'; const isWeex = typeof WXEnvironment !== 'undefined';
const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform); const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform);
const isWeexAndroid = isWeex && !isWeexIOS; const isWeexAndroid = isWeex && !isWeexIOS;
...@@ -239,4 +238,4 @@ const GBridge = { ...@@ -239,4 +238,4 @@ const GBridge = {
} }
} }
export default GBridge; export default GBridge;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 15 61 62 60 19 5,身份证尾号: 5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleLinearGradient { class FillStyleLinearGradient {
constructor(x0, y0, x1, y1) { constructor(x0, y0, x1, y1) {
...@@ -16,4 +15,4 @@ class FillStyleLinearGradient { ...@@ -16,4 +15,4 @@ class FillStyleLinearGradient {
} }
} }
export default FillStyleLinearGradient; export default FillStyleLinearGradient;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 561 6 26 01 95,身份证尾号:5 03 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStylePattern { class FillStylePattern {
constructor(img, pattern) { constructor(img, pattern) {
this._style = pattern; this._style = pattern;
...@@ -6,4 +5,4 @@ class FillStylePattern { ...@@ -6,4 +5,4 @@ class FillStylePattern {
} }
} }
export default FillStylePattern; export default FillStylePattern;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:156 1 6 2 601 9 5,身份证尾号:5 0 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleRadialGradient { class FillStyleRadialGradient {
constructor(x0, y0, r0, x1, y1, r1) { constructor(x0, y0, r0, x1, y1, r1) {
this._start_pos = { _x: x0, _y: y0, _r: r0 }; this._start_pos = { _x: x0, _y: y0, _r: r0 };
...@@ -15,4 +14,4 @@ class FillStyleRadialGradient { ...@@ -15,4 +14,4 @@ class FillStyleRadialGradient {
} }
} }
export default FillStyleRadialGradient; export default FillStyleRadialGradient;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:156 1 62 60 1 9 5,身份证尾号: 50 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import FillStylePattern from './FillStylePattern'; import FillStylePattern from './FillStylePattern';
import FillStyleLinearGradient from './FillStyleLinearGradient'; import FillStyleLinearGradient from './FillStyleLinearGradient';
import FillStyleRadialGradient from './FillStyleRadialGradient'; import FillStyleRadialGradient from './FillStyleRadialGradient';
...@@ -664,4 +663,4 @@ export default class CanvasRenderingContext2D { ...@@ -664,4 +663,4 @@ export default class CanvasRenderingContext2D {
} }
}); });
} }
} }
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论