提交 788ccd60 作者: 方治民

chore: 依赖升级、代码格式化

上级 a48c2f1d
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 })
......
...@@ -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>
......
...@@ -66,19 +66,19 @@ ...@@ -66,19 +66,19 @@
} }
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-app": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-app-plus": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-components": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-components": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-h5": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-h5": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-alipay": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-baidu": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-jd": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-jd": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-lark": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-qq": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-ui": "^1.4.26", "@dcloudio/uni-ui": "^1.4.26",
"@faker-js/faker": "^7.6.0", "@faker-js/faker": "^7.6.0",
"@vue/runtime-core": "^3.2.47", "@vue/runtime-core": "^3.2.47",
...@@ -98,16 +98,16 @@ ...@@ -98,16 +98,16 @@
"vue-types": "^5.0.2" "vue-types": "^5.0.2"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^0.37.0", "@antfu/eslint-config": "^0.38.2",
"@commitlint/cli": "^17.5.1", "@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4", "@commitlint/config-conventional": "^17.4.4",
"@dcloudio/types": "^3.3.2", "@dcloudio/types": "^3.3.2",
"@dcloudio/uni-automator": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-automator": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3071220230331002",
"@dcloudio/uni-helper-json": "^1.0.13", "@dcloudio/uni-helper-json": "^1.0.13",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-stacktracey": "3.0.0-alpha-3071220230331002",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3071220230324001", "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3071220230331002",
"@iconify/json": "^2.2.42", "@iconify/json": "^2.2.43",
"@types/crypto-js": "^4.1.1", "@types/crypto-js": "^4.1.1",
"@types/lodash-es": "^4.17.7", "@types/lodash-es": "^4.17.7",
"@types/node": "^18.15.11", "@types/node": "^18.15.11",
...@@ -143,12 +143,11 @@ ...@@ -143,12 +143,11 @@
"rimraf": "^4.4.1", "rimraf": "^4.4.1",
"sass": "^1.60.0", "sass": "^1.60.0",
"sort-package-json": "^2.4.1", "sort-package-json": "^2.4.1",
"stylelint": "^14.16.1", "stylelint": "^15.4.0",
"stylelint-config-html": "^1.1.0", "stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.5", "stylelint-config-recommended": "^11.0.0",
"stylelint-config-recommended": "^9.0.0", "stylelint-config-standard": "^32.0.0",
"stylelint-config-standard": "^29.0.0", "stylelint-order": "^6.0.3",
"stylelint-order": "^5.0.0",
"terser": "^5.16.8", "terser": "^5.16.8",
"typescript": "^5.0.3", "typescript": "^5.0.3",
"unocss": "^0.50.6", "unocss": "^0.50.6",
...@@ -159,6 +158,7 @@ ...@@ -159,6 +158,7 @@
"vue-eslint-parser": "^9.1.1" "vue-eslint-parser": "^9.1.1"
}, },
"engines": { "engines": {
"node": ">=16" "node": ">=16",
"pnpm": ">=8.1.0"
} }
} }
// 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 相同
...@@ -44,7 +45,7 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -44,7 +45,7 @@ export default class BasicGenerator extends CodeGenerator {
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`
} }
......
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
......
...@@ -36,15 +36,15 @@ ...@@ -36,15 +36,15 @@
/* 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 */ /** #ifdef H5 */
uni-page-body, uni-page-body,
......
...@@ -45,6 +45,6 @@ ...@@ -45,6 +45,6 @@
.empty .empty-tips { .empty .empty-tips {
display: flex; display: flex;
font-size: 30rpx; font-size: 30rpx;
color: #999999; color: #999;
} }
</style> </style>
<script lang="ts" setup> <script lang="ts" setup>
import type { PropType } from 'vue'
import md5 from 'crypto-js/md5' import md5 from 'crypto-js/md5'
import { nanoid } from 'nanoid' import { nanoid } from 'nanoid'
import { getPoster, isImage, isVideo } from './utils' import { getPoster, isImage, isVideo } from './utils'
...@@ -29,13 +28,13 @@ ...@@ -29,13 +28,13 @@
}) })
// 生成预览容器高度 // 生成预览容器高度
const containerHeight = `${props.height}rpx` const height = computed(() => `${props.height}rpx`)
// 分离图片和视频资源地址 // 分离图片和视频资源地址
const images = computed(() => props.assets.filter((item) => isImage(item.url))) const images = computed(() => props.assets.filter((item) => isImage(item.url)))
const videos = computed(() => props.assets.filter((item) => isVideo(item.url))) const videos = computed(() => props.assets.filter((item) => isVideo(item.url)))
// 预览图片 // 预览图片
const preview = (index: number) => { function preview(index: number) {
uni.previewImage({ uni.previewImage({
urls: images.value.map((item) => { urls: images.value.map((item) => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
...@@ -57,12 +56,12 @@ ...@@ -57,12 +56,12 @@
const videoContext = ref() const videoContext = ref()
const playVideoSrc = ref() const playVideoSrc = ref()
// 播放视频 // 播放视频
const play = (index: number) => { function play(index: number) {
playVideoSrc.value = videos.value[index].url playVideoSrc.value = videos.value[index].url
videoContext.value?.requestFullScreen() videoContext.value?.requestFullScreen()
videoContext.value?.play() videoContext.value?.play()
} }
const videoFullScreenChange = (e: any) => { function videoFullScreenChange(e: any) {
// 非全屏状态下停止播放 // 非全屏状态下停止播放
if (!e.detail.fullScreen) { if (!e.detail.fullScreen) {
videoContext.value.seek(0) videoContext.value.seek(0)
...@@ -134,7 +133,7 @@ ...@@ -134,7 +133,7 @@
position: relative; position: relative;
:deep(.fui-lazyload__img) { :deep(.fui-lazyload__img) {
height: v-bind(containerHeight) !important; height: v-bind(height) !important;
} }
.icon-wrap { .icon-wrap {
...@@ -143,7 +142,7 @@ ...@@ -143,7 +142,7 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, 0.5); background-color: rgb(0 0 0 / 50%);
border-radius: 10rpx; border-radius: 10rpx;
.video-play-icon { .video-play-icon {
......
...@@ -57,4 +57,6 @@ export function useI18n(namespace?: string): { ...@@ -57,4 +57,6 @@ export function useI18n(namespace?: string): {
// 为什么要编写此函数? // 为什么要编写此函数?
// 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n // 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n
export const t = (key: string) => key export function t(key: string) {
return key
}
...@@ -26,7 +26,7 @@ const Message = { ...@@ -26,7 +26,7 @@ const Message = {
}, },
} }
const createErrorModal = (options: { title: string; content: string }) => { function createErrorModal(options: { title: string; content: string }) {
uni.showModal({ uni.showModal({
title: options.title, title: options.title,
content: options.content, content: options.content,
......
...@@ -2,7 +2,7 @@ import type { GlobConfig } from '/#/config' ...@@ -2,7 +2,7 @@ import type { GlobConfig } from '/#/config'
import { getAppEnvConfig } from '/@/utils/env' import { getAppEnvConfig } from '/@/utils/env'
export const useGlobSetting = (): Readonly<GlobConfig> => { export function useGlobSetting(): Readonly<GlobConfig> {
const { const {
VITE_GLOB_APP_NAME, VITE_GLOB_APP_NAME,
VITE_GLOB_APP_DESCRIPTION, VITE_GLOB_APP_DESCRIPTION,
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
.fui-title { .fui-title {
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
color: #333333; color: #333;
padding-top: 48rpx; padding-top: 48rpx;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
})) }))
}) })
const preview = (index: number) => { function preview(index: number) {
uni.previewImage({ uni.previewImage({
urls: images.value.map((item: { src: string }) => item.src), urls: images.value.map((item: { src: string }) => item.src),
current: index, current: index,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
}) })
}) })
const surprise = () => { function surprise() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
const orientation = plus.navigator.getOrientation() const orientation = plus.navigator.getOrientation()
if (orientation === 0) { if (orientation === 0) {
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
} }
const animate = ref() const animate = ref()
const handUp = () => { function handUp() {
if (animate.value) { if (animate.value) {
return return
} }
......
...@@ -5,7 +5,9 @@ import { isFunction } from '/@/utils/is' ...@@ -5,7 +5,9 @@ import { isFunction } from '/@/utils/is'
// Used to store the identification and cancellation function of each request // Used to store the identification and cancellation function of each request
let pendingMap = new Map<string, Canceler>() let pendingMap = new Map<string, Canceler>()
export const getPendingUrl = (config: AxiosRequestConfig) => [config.method, config.url].join('&') export function getPendingUrl(config: AxiosRequestConfig) {
return [config.method, config.url].join('&')
}
export class AxiosCanceler { export class AxiosCanceler {
/** /**
......
...@@ -3,7 +3,7 @@ import type { App, Plugin } from 'vue' ...@@ -3,7 +3,7 @@ import type { App, Plugin } from 'vue'
import { unref } from 'vue' import { unref } from 'vue'
import { isObject } from '/@/utils/is' import { isObject } from '/@/utils/is'
export const noop = () => {} export function noop() {}
/** /**
* @description: Set ui mount node * @description: Set ui mount node
...@@ -50,7 +50,7 @@ export function getDynamicProps<T, U>(props: T): Partial<U> { ...@@ -50,7 +50,7 @@ export function getDynamicProps<T, U>(props: T): Partial<U> {
return ret as Partial<U> return ret as Partial<U>
} }
export const withInstall = <T>(component: T, alias?: string) => { export function withInstall<T>(component: T, alias?: string) {
const comp = component as any const comp = component as any
comp.install = (app: App) => { comp.install = (app: App) => {
app.component(comp.name || comp.displayName, component) app.component(comp.name || comp.displayName, component)
......
...@@ -15,7 +15,7 @@ const PROXY_LIST: [[string, string]?] = [ ...@@ -15,7 +15,7 @@ const PROXY_LIST: [[string, string]?] = [
* 将内部地址(内网)转换成代理/预览地址(公网) * 将内部地址(内网)转换成代理/预览地址(公网)
* @param url 内网地址 * @param url 内网地址
*/ */
export const getExtranetUrl = (url: string): string => { export function getExtranetUrl(url: string): string {
let uri = url let uri = url
PROXY_LIST.forEach((proxy) => { PROXY_LIST.forEach((proxy) => {
...@@ -30,7 +30,7 @@ export const getExtranetUrl = (url: string): string => { ...@@ -30,7 +30,7 @@ export const getExtranetUrl = (url: string): string => {
* eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题 * eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题
* @param url 包含代理/公网地址的内容 * @param url 包含代理/公网地址的内容
*/ */
export const getIntranetUrl = (url: string): string => { export function getIntranetUrl(url: string): string {
let uri = url let uri = url
PROXY_LIST.forEach((proxy) => { PROXY_LIST.forEach((proxy) => {
...@@ -45,7 +45,7 @@ export const getIntranetUrl = (url: string): string => { ...@@ -45,7 +45,7 @@ export const getIntranetUrl = (url: string): string => {
* @param body 接口返回的内容 * @param body 接口返回的内容
* @returns 替换本地链接后的数据结果 * @returns 替换本地链接后的数据结果
*/ */
export const handleResponseResource = <T>(body: T, options: Recordable) => { export function handleResponseResource<T>(body: T, options: Recordable) {
for (const [intranet, extranet] of PROXY_LIST) { for (const [intranet, extranet] of PROXY_LIST) {
// 当需要处理内外网资源地址映射时,进行内容处理 // 当需要处理内外网资源地址映射时,进行内容处理
const isIntranet = options.apiUrl.includes(intranet) const isIntranet = options.apiUrl.includes(intranet)
......
...@@ -2,7 +2,7 @@ module.exports = { ...@@ -2,7 +2,7 @@ module.exports = {
root: true, root: true,
plugins: ['stylelint-order'], plugins: ['stylelint-order'],
customSyntax: 'postcss-less', customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-prettier'], extends: ['stylelint-config-standard'],
rules: { rules: {
'selector-class-pattern': null, 'selector-class-pattern': null,
'selector-pseudo-class-no-unknown': [ 'selector-pseudo-class-no-unknown': [
...@@ -36,12 +36,8 @@ module.exports = { ...@@ -36,12 +36,8 @@ module.exports = {
], ],
'no-empty-source': null, 'no-empty-source': null,
'named-grid-areas-no-invalid': null, 'named-grid-areas-no-invalid': null,
'unicode-bom': 'never',
'no-descending-specificity': null, 'no-descending-specificity': null,
'font-family-no-missing-generic-family-keyword': null, 'font-family-no-missing-generic-family-keyword': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
// 'declaration-block-trailing-semicolon': 'always',
'rule-empty-line-before': [ 'rule-empty-line-before': [
'always', 'always',
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论