提交 9f07107d 作者: 方治民

合并分支 '3.x' 到 'main'

3.x

查看合并请求 !20
......@@ -30,6 +30,7 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
......
const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process')
const fs = require('node:fs')
const path = require('node:path')
const { execSync } = require('node:child_process')
const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
......
......@@ -57,17 +57,17 @@
"@ant-design/colors": "^7.0.0",
"@ant-design/icons-vue": "^6.1.0",
"@iconify/iconify": "^3.1.0",
"@logicflow/core": "^1.2.1",
"@logicflow/extension": "^1.2.1",
"@logicflow/core": "^1.2.8",
"@logicflow/extension": "^1.2.8",
"@stomp/stompjs": "^7.0.0",
"@vue/runtime-core": "^3.2.47",
"@vue/shared": "^3.2.47",
"@vueuse/core": "^9.13.0",
"@vueuse/shared": "^9.13.0",
"@vue/runtime-core": "^3.3.4",
"@vue/shared": "^3.3.4",
"@vueuse/core": "^10.1.2",
"@vueuse/shared": "^10.1.2",
"@zxcvbn-ts/core": "^2.2.1",
"ant-design-vue": "^3.2.16",
"ant-design-vue": "^3.2.20",
"axios": "^0.26.1",
"codemirror": "^6.0.1",
"codemirror": "^5.65.13",
"cropperjs": "^1.5.13",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.7",
......@@ -80,53 +80,52 @@
"nanoid": "^4.0.2",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.1",
"pinia": "^2.0.33",
"pinia": "^2.1.3",
"print-js": "^1.6.0",
"qrcode": "^1.5.1",
"qs": "^6.11.1",
"qrcode": "^1.5.3",
"qs": "^6.11.2",
"resize-observer-polyfill": "^1.5.1",
"showdown": "^2.1.0",
"sockjs-client": "^1.6.1",
"sortablejs": "^1.15.0",
"stompjs": "^2.3.3",
"tinymce": "^5.10.7",
"vditor": "^3.9.1",
"vue": "^3.2.47",
"vditor": "^3.9.3",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2",
"vue-json-pretty": "^2.2.4",
"vue-router": "^4.1.6",
"vue-types": "^5.0.2",
"vue-router": "^4.2.2",
"vue-types": "^5.0.3",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@antfu/eslint-config": "^0.38.2",
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@iconify/json": "^2.2.43",
"@purge-icons/generated": "^0.9.0",
"@antfu/eslint-config": "^0.39.4",
"@commitlint/cli": "^17.6.5",
"@commitlint/config-conventional": "^17.6.5",
"@iconify/json": "^2.2.72",
"@types/codemirror": "^5.60.7",
"@types/crypto-js": "^4.1.1",
"@types/fs-extra": "^11.0.1",
"@types/inquirer": "^9.0.3",
"@types/intro.js": "^5.1.1",
"@types/lodash": "^4.14.192",
"@types/lodash": "^4.14.195",
"@types/lodash-es": "^4.17.7",
"@types/mockjs": "^1.0.7",
"@types/node": "^18.15.11",
"@types/node": "^18.16.16",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.5.0",
"@types/qs": "^6.9.7",
"@types/showdown": "^2.0.0",
"@types/showdown": "^2.0.1",
"@types/sockjs-client": "^1.5.1",
"@types/sortablejs": "^1.15.1",
"@types/stompjs": "^2.3.5",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"@vitejs/plugin-legacy": "^4.0.2",
"@vitejs/plugin-vue": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"@vitejs/plugin-legacy": "^4.0.4",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue/compiler-dom": "^3.2.47",
"@vue/compiler-sfc": "^3.2.47",
"@vue/compiler-dom": "^3.3.4",
"@vue/compiler-sfc": "^3.3.4",
"@vue/test-utils": "^2.3.2",
"autoprefixer": "^10.4.14",
"commitizen": "^4.3.0",
......@@ -135,52 +134,52 @@
"cz-conventional-changelog": "^3.3.0",
"cz-git": "^1.6.1",
"czg": "^1.6.1",
"dotenv": "^16.0.3",
"eslint": "^8.37.0",
"dotenv": "^16.1.3",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.10.0",
"eslint-plugin-vue": "^9.14.1",
"esno": "^0.16.3",
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"inquirer": "^9.1.5",
"inquirer": "^9.2.6",
"less": "^4.1.3",
"lint-staged": "^13.2.0",
"lint-staged": "^13.2.2",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"pont-engine": "^1.5.7",
"postcss": "^8.4.21",
"pont-engine": "^1.5.10",
"postcss": "^8.4.24",
"postcss-html": "^1.5.0",
"postcss-less": "^6.0.0",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"rollup": "^2.79.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"rollup": "^3.23.0",
"rollup-plugin-visualizer": "^5.9.0",
"sort-package-json": "^2.4.1",
"stylelint": "^15.4.0",
"stylelint-config-recommended": "^11.0.0",
"stylelint": "^15.6.2",
"stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^32.0.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-order": "^6.0.3",
"terser": "^5.16.8",
"terser": "^5.17.7",
"ts-node": "^10.9.1",
"typescript": "^5.0.3",
"unplugin-auto-import": "^0.15.2",
"vite": "^4.2.1",
"typescript": "^4.9.5",
"unplugin-auto-import": "^0.16.4",
"vite": "^4.3.9",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mkcert": "^1.14.0",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-mkcert": "^1.15.0",
"vite-plugin-mock": "^2.9.8",
"vite-plugin-purge-icons": "^0.9.2",
"vite-plugin-pwa": "^0.14.7",
"vite-plugin-pwa": "^0.16.1",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-theme": "^0.8.6",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vite-plugin-windicss": "^1.8.10",
"vue-eslint-parser": "^9.1.1",
"vue-tsc": "^1.2.0"
"vite-plugin-windicss": "^1.9.0",
"vue-eslint-parser": "^9.3.0",
"vue-tsc": "^1.6.5"
},
"engines": {
"node": ">=14"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,6 +8,7 @@ const API_URL_PREFIX = '/api'
export default class BasicGenerator extends CodeGenerator {
isRequestBody(inter: Interface, paramsCode: string): boolean {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const prettier = require('prettier')
const requestParams = inter.getRequestParams(this.surrounding)
const code = prettier.format(paramsCode, { parser: 'typescript' })
......@@ -23,6 +24,7 @@ export default class BasicGenerator extends CodeGenerator {
let requestParams = inter.getRequestParams(this.surrounding)
let bodyTypeDef = ''
// eslint-disable-next-line @typescript-eslint/no-require-imports
const prettier = require('prettier')
if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) {
if (!requestParams.includes('form')) {
......
......@@ -5,6 +5,7 @@
import { useLocale } from '/@/locales/useLocale'
import 'dayjs/locale/zh-cn'
// support Multi-language
const { getAntdLocale } = useLocale()
......
import type { RouteMeta } from 'vue-router'
export interface RouteItem {
path: string
component: any
......
......@@ -2,6 +2,7 @@
import AppSearchKeyItem from './AppSearchKeyItem.vue'
import { useDesign } from '/@/hooks/web/useDesign'
import { useI18n } from '/@/hooks/web/useI18n'
const { prefixCls } = useDesign('app-search-footer')
const { t } = useI18n()
</script>
......
<script lang="ts" setup>
import { Icon } from '/@/components/Icon'
defineProps({
icon: String,
})
......
......@@ -3,6 +3,7 @@
import { SearchOutlined } from '@ant-design/icons-vue'
import AppSearchFooter from './AppSearchFooter.vue'
import Icon from '/@/components/Icon'
// @ts-expect-error
import vClickOutside from '/@/directives/clickOutside'
import { useDesign } from '/@/hooks/web/useDesign'
......
......@@ -8,6 +8,7 @@
import { Button } from '/@/components/Button'
import { isFunction } from '/@/utils/is'
import { grid, useSlider } from './data'
// 组件接收参数
const props = defineProps({
// 请求API的参数
......
import { ref } from 'vue'
// 每行个数
export const grid = ref(12)
// slider属性
......
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { onClickOutside } from '@vueuse/core'
const emit = defineEmits(['mounted', 'clickOutside'])
const wrap = ref<ElRef>(null)
......
......@@ -5,10 +5,12 @@
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'
import CodeMirror from 'codemirror'
import { MODE } from './../typing'
// css
import './codemirror.css'
import 'codemirror/theme/idea.css'
import 'codemirror/theme/material-palenight.css'
// modes
import 'codemirror/mode/javascript/javascript'
import 'codemirror/mode/css/css'
......
......@@ -2,12 +2,14 @@ import CodeMirror from 'codemirror'
import './codemirror.css'
import 'codemirror/theme/idea.css'
import 'codemirror/theme/material-palenight.css'
// import 'codemirror/addon/lint/lint.css';
// modes
import 'codemirror/mode/javascript/javascript'
import 'codemirror/mode/css/css'
import 'codemirror/mode/htmlmixed/htmlmixed'
// addons
// import 'codemirror/addon/edit/closebrackets';
// import 'codemirror/addon/edit/closetag';
......
......@@ -2,14 +2,17 @@
import type { PropType } from 'vue'
import { ref } from 'vue'
import { isNil } from 'lodash-es'
// component
import { Skeleton } from 'ant-design-vue'
import { CollapseTransition } from '/@/components/Transition'
import CollapseHeader from './CollapseHeader.vue'
import { triggerWindowResize } from '/@/utils/event'
import { triggerWindowResize as triggerWindowResizeFn } from '/@/utils/event'
// hook
import { useTimeoutFn } from '/@/hooks/core/useTimeout'
import { useDesign } from '/@/hooks/web/useDesign'
const props = defineProps({
title: { type: String, default: '' },
loading: { type: Boolean },
......@@ -43,7 +46,7 @@
show.value = isNil(val) ? !show.value : val
if (props.triggerWindowResize) {
// 200 milliseconds here is because the expansion has animation,
useTimeoutFn(triggerWindowResize, 200)
useTimeoutFn(triggerWindowResizeFn, 200)
}
}
defineExpose({
......
......@@ -4,6 +4,7 @@
import Icon from '/@/components/Icon'
import { Divider, Menu } from 'ant-design-vue'
import type { Axis, ContextMenuItem, ItemContentProps } from './typing'
const prefixCls = 'context-menu'
const props = {
width: { type: Number, default: 156 },
......
......@@ -8,13 +8,14 @@
import { useI18n } from '/@/hooks/web/useI18n'
import type { ButtonProps } from '/@/components/Button'
import Icon from '/@/components/Icon'
const props = {
width: { type: [String, Number], default: '200px' },
value: { type: String },
showBtn: { type: Boolean, default: true },
btnProps: { type: Object as PropType<ButtonProps> },
btnText: { type: String, default: '' },
uploadApi: { type: Function as PropType<({ file: Blob, name: string }) => Promise<void>> },
uploadApi: { type: Function as PropType<(param: { file: Blob; name: string }) => Promise<void>> },
}
export default defineComponent({
name: 'CropperAvatar',
......@@ -29,7 +30,7 @@
const { t } = useI18n()
const getClass = computed(() => [prefixCls])
const getWidth = computed(() => `${`${props.width}`.replace(/px/, '')}px`)
const getIconWidth = computed(() => `${parseInt(`${props.width}`.replace(/px/, '')) / 2}px`)
const getIconWidth = computed(() => `${Number.parseInt(`${props.width}`.replace(/px/, '')) / 2}px`)
const getStyle = computed((): CSSProperties => ({ width: unref(getWidth) }))
const getImageWrapperStyle = computed(
(): CSSProperties => ({ width: unref(getWidth), height: unref(getWidth) }),
......
......@@ -11,6 +11,7 @@
import { isFunction } from '/@/utils/is'
import { getSlot } from '/@/utils/helper/tsxHelper'
import { useAttrs } from '/@/hooks/core/useAttrs'
const props = {
useCollapse: { type: Boolean, default: true },
title: { type: String, default: '' },
......
......@@ -4,6 +4,7 @@
import { useDesign } from '/@/hooks/web/useDesign'
import { footerProps } from '../props'
export default defineComponent({
name: 'BasicDrawerFooter',
props: {
......
......@@ -6,6 +6,7 @@
import { useDesign } from '/@/hooks/web/useDesign'
import { propTypes } from '/@/utils/propTypes'
export default defineComponent({
name: 'BasicDrawerHeader',
components: { BasicTitle, ArrowLeftOutlined },
......
import type { PropType } from 'vue'
import { useI18n } from '/@/hooks/web/useI18n'
const { t } = useI18n()
export const footerProps = {
......
......@@ -3,6 +3,7 @@
import * as XLSX from 'xlsx'
import { dateUtil } from '/@/utils/dateUtil'
import type { ExcelData } from './typing'
export default defineComponent({
name: 'ImportExcel',
props: {
......
......@@ -10,6 +10,7 @@
import FormAction from './components/FormAction.vue'
import { dateItemType } from './helper'
import { dateUtil } from '/@/utils/dateUtil'
// import { cloneDeep } from 'lodash-es';
import { deepMerge } from '/@/utils'
import { useFormValues } from './hooks/useFormValues'
......@@ -20,6 +21,7 @@
import { useModalContext } from '/@/components/Modal'
import { basicProps } from './props'
import { useDesign } from '/@/hooks/web/useDesign'
export default defineComponent({
name: 'BasicForm',
components: { FormItem, Form, Row, FormAction },
......
......@@ -8,6 +8,7 @@
import { useRuleFormItem } from '/@/hooks/component/useFormItem'
import { LoadingOutlined } from '@ant-design/icons-vue'
import { useI18n } from '/@/hooks/web/useI18n'
interface Option {
value: string
label: string
......
......@@ -11,6 +11,7 @@
import { propTypes } from '/@/utils/propTypes'
import { get, omit } from 'lodash-es'
import { useI18n } from '/@/hooks/web/useI18n'
interface OptionsItem {
label: string
value: string | number | boolean
......
......@@ -9,6 +9,7 @@
import { LoadingOutlined } from '@ant-design/icons-vue'
import { useI18n } from '/@/hooks/web/useI18n'
import { propTypes } from '/@/utils/propTypes'
interface OptionsItem {
label: string
value: string
......
......@@ -6,6 +6,7 @@
import { propTypes } from '/@/utils/propTypes'
import { useI18n } from '/@/hooks/web/useI18n'
import type { TransferDirection, TransferItem } from 'ant-design-vue/lib/transfer'
export default defineComponent({
name: 'ApiTransfer',
components: { Transfer },
......
......@@ -5,6 +5,7 @@
import { get } from 'lodash-es'
import { propTypes } from '/@/utils/propTypes'
import { LoadingOutlined } from '@ant-design/icons-vue'
export default defineComponent({
name: 'ApiTree',
components: { ATree: Tree, LoadingOutlined },
......
......@@ -5,6 +5,7 @@
import { get } from 'lodash-es'
import { propTypes } from '/@/utils/propTypes'
import { LoadingOutlined } from '@ant-design/icons-vue'
export default defineComponent({
name: 'ApiTreeSelect',
components: { ATreeSelect: TreeSelect, LoadingOutlined },
......
<script lang="ts">
import type { ColEx } from '../types/index'
// import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
import type { PropType } from 'vue'
import { computed, defineComponent } from 'vue'
......
......@@ -13,6 +13,7 @@
import { cloneDeep, upperFirst } from 'lodash-es'
import { useItemLabelWidth } from '../hooks/useLabelWidth'
import { useI18n } from '/@/hooks/web/useI18n'
export default defineComponent({
name: 'BasicFormItem',
inheritAttrs: false,
......
......@@ -60,15 +60,15 @@ export default function ({ advanceState, emit, getProps, getSchema, formModel, d
const width = unref(realWidthRef)
const mdWidth =
parseInt(itemCol.md as string) ||
parseInt(itemCol.xs as string) ||
parseInt(itemCol.sm as string) ||
Number.parseInt(itemCol.md as string) ||
Number.parseInt(itemCol.xs as string) ||
Number.parseInt(itemCol.sm as string) ||
(itemCol.span as number) ||
BASIC_COL_LEN
const lgWidth = parseInt(itemCol.lg as string) || mdWidth
const xlWidth = parseInt(itemCol.xl as string) || lgWidth
const xxlWidth = parseInt(itemCol.xxl as string) || xlWidth
const lgWidth = Number.parseInt(itemCol.lg as string) || mdWidth
const xlWidth = Number.parseInt(itemCol.xl as string) || lgWidth
const xxlWidth = Number.parseInt(itemCol.xxl as string) || xlWidth
if (width <= screenEnum.LG) {
itemColSum += mdWidth
} else if (width < screenEnum.XL) {
......
......@@ -2,7 +2,7 @@
import type { CSSProperties, PropType } from 'vue'
import { computed, defineComponent, nextTick, onMounted, ref, unref, watch } from 'vue'
import SvgIcon from './SvgIcon.vue'
import Iconify from '@purge-icons/generated'
import Iconify from '@iconify/iconify/dist/iconify'
import { isString } from '/@/utils/is'
import { propTypes } from '/@/utils/propTypes'
......@@ -57,7 +57,7 @@
const { size, color } = props
let fs = size
if (isString(size)) {
fs = parseInt(size, 10)
fs = Number.parseInt(size, 10)
}
return {
......
......@@ -8,6 +8,7 @@
import { useRootSetting } from '/@/hooks/setting/useRootSetting'
import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated'
import { getTheme } from './getTheme'
type Lang = 'zh_CN' | 'en_US' | 'ja_JP' | 'ko_KR' | undefined
export default defineComponent({
inheritAttrs: false,
......
......@@ -5,6 +5,7 @@
import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated'
import { useRootSetting } from '/@/hooks/setting/useRootSetting'
import { getTheme } from './getTheme'
const props = defineProps({
value: { type: String },
class: { type: String },
......
import type Vditor from 'vditor'
export interface MarkDownActionType {
getVditor: () => Vditor
}
......@@ -4,6 +4,7 @@
import { itemProps } from '../props'
import MenuItemContent from './MenuItemContent.vue'
export default defineComponent({
name: 'BasicMenuItem',
components: { MenuItem: Menu.Item, MenuItemContent },
......
......@@ -5,6 +5,7 @@
import { useI18n } from '/@/hooks/web/useI18n'
import { useDesign } from '/@/hooks/web/useDesign'
import { contentProps } from '../props'
const { t } = useI18n()
export default defineComponent({
......
......@@ -6,6 +6,7 @@ import { ThemeEnum } from '/@/enums/appEnum'
import { propTypes } from '/@/utils/propTypes'
import type { MenuTheme } from 'ant-design-vue'
import type { MenuMode } from 'ant-design-vue/lib/menu/src/interface'
export const basicProps = {
items: {
type: Array as PropType<Menu[]>,
......
......@@ -2,6 +2,7 @@
import { defineComponent } from 'vue'
import { basicProps } from '../props'
export default defineComponent({
name: 'BasicModalFooter',
props: basicProps,
......
import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes'
import type { CSSProperties, ComputedRef, VNodeChild } from 'vue'
/**
* @description: 弹窗对外暴露的方法
*/
......
import { isString } from '/@/utils/is'
import type { LogoType, RenderQrCodeParams } from './typing'
export function drawLogo({ canvas, logo }: RenderQrCodeParams) {
if (!logo) {
return new Promise((resolve) => {
......
// 参考 qr-code-with-logo 进行ts版本修改
import { toCanvas } from './toCanvas'
export * from './typing'
export { toCanvas }
import { renderQrCode } from './drawCanvas'
import { drawLogo } from './drawLogo'
import type { RenderQrCodeParams } from './typing'
export function toCanvas(options: RenderQrCodeParams) {
return renderQrCode(options)
.then(() => {
......
......@@ -4,6 +4,7 @@
import { toObject } from './util'
import { computed, defineComponent, nextTick, onBeforeUnmount, onMounted, provide, ref, unref } from 'vue'
import Bar from './bar'
const { scrollbar } = componentSetting
export default defineComponent({
......
import type { BarMap } from './types'
export const BAR_MAP: BarMap = {
vertical: {
offset: 'offsetHeight',
......
......@@ -14,6 +14,7 @@
import { openWindow } from '/@/utils'
import { useOpenKeys } from './useOpenKeys'
export default defineComponent({
name: 'SimpleMenu',
components: {
......
......@@ -9,6 +9,7 @@
import { propTypes } from '/@/utils/propTypes'
import { useI18n } from '/@/hooks/web/useI18n'
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'
export default defineComponent({
name: 'SimpleSubMenu',
components: {
......
......@@ -17,6 +17,7 @@
import { propTypes } from '/@/utils/propTypes'
import { createSimpleRootMenuContext } from './useSimpleMenuContext'
import mitt from '/@/utils/mitt'
export default defineComponent({
name: 'Menu',
props: {
......
......@@ -6,6 +6,7 @@
import { Tooltip } from 'ant-design-vue'
import { useMenuItem } from './useMenu'
import { useSimpleRootMenuContext } from './useSimpleMenuContext'
export default defineComponent({
name: 'MenuItem',
components: { Tooltip },
......
......@@ -24,6 +24,7 @@
import { basicProps } from './props'
import { isFunction } from '/@/utils/is'
import { warn } from '/@/utils/log'
export default defineComponent({
components: {
Table,
......
<script lang="ts">
import { defineComponent } from 'vue'
import { FormOutlined } from '@ant-design/icons-vue'
export default defineComponent({
name: 'EditTableHeaderIcon',
components: { FormOutlined },
......
......@@ -14,6 +14,7 @@
import { createPlaceholderMessage } from './helper'
import { CellComponent } from './CellComponent'
import type { EditRecordRow } from './index'
export default defineComponent({
name: 'EditableCell',
components: { FormOutlined, CloseOutlined, CheckOutlined, CellComponent, Spin },
......
......@@ -7,6 +7,7 @@
import { ScrollContainer } from '/@/components/Container'
import { useI18n } from '/@/hooks/web/useI18n'
import { useDesign } from '/@/hooks/web/useDesign'
// import { useSortable } from '/@/hooks/web/useSortable';
import { isFunction, isNullAndUnDef } from '/@/utils/is'
import { getPopupContainer as getParentContainer } from '/@/utils'
......@@ -15,6 +16,7 @@
import type Sortable from 'sortablejs'
import { useTableContext } from '../../hooks/useTableContext'
import type { BasicColumn, ColumnChangeParam } from '../../types/table'
interface State {
checkAll: boolean
isInit?: boolean
......
import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'
import type { TooltipProps } from 'ant-design-vue/es/tooltip/Tooltip'
import type { RoleEnum } from '/@/enums/roleEnum'
export interface ActionItem extends ButtonProps {
onClick?: Fn
label?: string
......
......@@ -79,7 +79,7 @@
resStr = t('component.time.just')
// Less than or equal to 59 seconds
} else if (diff < ONE_MINUTES) {
resStr = parseInt(diff / ONE_SECONDS) + t('component.time.seconds') + dirStr
resStr = Math.floor(diff / ONE_SECONDS) + t('component.time.seconds') + dirStr
// More than 59 seconds, less than or equal to 59 minutes and 59 seconds
} else if (diff >= ONE_MINUTES && diff < ONE_HOUR) {
resStr = Math.floor(diff / ONE_MINUTES) + t('component.time.minutes') + dirStr
......
......@@ -26,6 +26,7 @@
import 'tinymce/plugins/searchreplace'
import 'tinymce/plugins/spellchecker'
import 'tinymce/plugins/tabfocus'
// import 'tinymce/plugins/table';
import 'tinymce/plugins/template'
import 'tinymce/plugins/textpattern'
......
......@@ -15,6 +15,7 @@
import type { CreateContextOptions } from '/@/components/ContextMenu'
import { treeEmits, treeProps } from './types/tree'
import { createBEM } from '/@/utils/bem'
export default defineComponent({
name: 'BasicTree',
inheritAttrs: false,
......@@ -41,7 +42,7 @@
children: 'children',
title: 'title',
key: 'key',
...fieldNames,
...(fieldNames as Recordable),
}
})
const getBindValues = computed(() => {
......@@ -226,7 +227,7 @@
treeDataRef.value = props.treeData as TreeItem[]
})
onMounted(() => {
const level = parseInt(props.defaultExpandLevel)
const level = Number.parseInt(props.defaultExpandLevel as string)
if (level > 0) {
state.expandedKeys = filterByLevel(level)
} else if (props.defaultExpandAll) {
......
......@@ -7,6 +7,7 @@
import { useDebounceFn } from '@vueuse/core'
import { createBEM } from '/@/utils/bem'
import { ToolbarEnum } from '../types/tree'
const props = defineProps({
helpMessage: {
type: [String, Array] as PropType<string | string[]>,
......
......@@ -3,15 +3,18 @@
import { computed, defineComponent, reactive, ref, toRefs, unref } from 'vue'
import { Alert, Upload } from 'ant-design-vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
// import { BasicTable, useTable } from '/@/components/Table';
// hooks
import { useUploadType } from './useUpload'
import { useMessage } from '/@/hooks/web/useMessage'
// types
import type { FileItem } from './typing'
import { UploadResultStatus } from './typing'
import { basicProps } from './props'
import { createActionColumn, createTableColumns } from './data'
// utils
import { checkImgType, getBase64WithFile } from './helper'
import { buildUUID } from '/@/utils/uuid'
......
<script lang="ts">
import { defineComponent, ref, watch } from 'vue'
// import { BasicTable, useTable } from '/@/components/Table';
import FileList from './FileList.vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
......
import type { Ref } from 'vue'
import { computed, unref } from 'vue'
import { useI18n } from '/@/hooks/web/useI18n'
const { t } = useI18n()
export function useUploadType({
acceptRef,
......
......@@ -38,7 +38,7 @@
const getActionStyleRef = computed(() => {
const { height, actionStyle } = props
const h = `${parseInt(height as string)}px`
const h = `${Number.parseInt(height as string)}px`
return {
left: 0,
width: h,
......@@ -49,8 +49,8 @@
const getWrapStyleRef = computed(() => {
const { height, width, circle, wrapStyle } = props
const h = parseInt(height as string)
const w = `${parseInt(width as string)}px`
const h = Number.parseInt(height as string)
const w = `${Number.parseInt(width as string)}px`
return {
width: w,
height: `${h}px`,
......@@ -62,7 +62,7 @@
const getBarStyleRef = computed(() => {
const { height, circle, barStyle } = props
const h = parseInt(height as string)
const h = Number.parseInt(height as string)
return {
height: `${h}px`,
borderRadius: circle ? `${h / 2}px 0 0 ${h / 2}px` : 0,
......@@ -72,8 +72,8 @@
const getContentStyleRef = computed(() => {
const { height, width, contentStyle } = props
const h = `${parseInt(height as string)}px`
const w = `${parseInt(width as string)}px`
const h = `${Number.parseInt(height as string)}px`
const w = `${Number.parseInt(width as string)}px`
return {
height: h,
......@@ -110,15 +110,15 @@
const actionEl = unref(actionElRef)
if (!actionEl) return
emit('start', e)
state.moveDistance = getEventPageX(e) - parseInt(actionEl.style.left.replace('px', ''), 10)
state.moveDistance = getEventPageX(e) - Number.parseInt(actionEl.style.left.replace('px', ''), 10)
state.startTime = new Date().getTime()
state.isMoving = true
}
function getOffset(el: HTMLDivElement) {
const actionWidth = parseInt(el.style.width)
const actionWidth = Number.parseInt(el.style.width)
const { width } = props
const widthNum = parseInt(width as string)
const widthNum = Number.parseInt(width as string)
const offset = widthNum - actionWidth - 6
return { offset, widthNum, actionWidth }
}
......@@ -169,7 +169,7 @@
} else {
const contentEl = unref(contentElRef)
if (contentEl) {
contentEl.style.width = `${parseInt(barEl.style.width)}px`
contentEl.style.width = `${Number.parseInt(barEl.style.width)}px`
}
}
}, 0)
......
......@@ -65,7 +65,7 @@
const { imgWidth, height, maxDegree } = props
const { moveX } = data
const currentRotate = Math.ceil(
(moveX / (imgWidth! - parseInt(height as string))) * maxDegree! * unref(getFactorRef),
(moveX / (imgWidth! - Number.parseInt(height as string))) * maxDegree! * unref(getFactorRef),
)
state.currentRotate = currentRotate
state.imgStyle = hackCss('transform', `rotateZ(${state.randomRotate - currentRotate}deg)`)
......@@ -130,7 +130,7 @@
<img
src={src}
onLoad={handleImgOnLoad}
width={parseInt(props.width as string)}
width={Number.parseInt(props.width as string)}
class={imgCls}
style={state.imgStyle}
onClick={() => {
......
......@@ -32,7 +32,7 @@
function convertToUnit(str: string | number | null | undefined, unit = 'px'): string | undefined {
if (str == null || str === '') {
return undefined
} else if (isNaN(+str!)) {
} else if (Number.isNaN(+str!)) {
return String(str)
} else {
return `${Number(str)}${unit}`
......@@ -51,11 +51,11 @@
})
const getBenchRef = computed(() => {
return parseInt(props.bench as string, 10)
return Number.parseInt(props.bench as string, 10)
})
const getItemHeightRef = computed(() => {
return parseInt(props.itemHeight as string, 10)
return Number.parseInt(props.itemHeight as string, 10)
})
const getFirstToRenderRef = computed(() => {
......@@ -99,7 +99,8 @@
if (!wrapEl) {
return 0
}
const height = parseInt(props.height || 0, 10) || wrapEl.clientHeight
// @ts-expect-error
const height = Number.parseInt(props.height || 0, 10) || wrapEl.clientHeight
return first + Math.ceil(height / unref(getItemHeightRef))
}
......
import type { Directive } from 'vue'
import './index.less'
export interface RippleOptions {
event: string
transition: number
......@@ -47,7 +48,7 @@ const RippleDirective: Directive & RippleProto = {
}
function rippler({ event, el, zIndex, background }: { event: EventType; el: HTMLElement } & RippleProto) {
const targetBorder = parseInt(getComputedStyle(el).borderWidth.replace('px', ''))
const targetBorder = Number.parseInt(getComputedStyle(el).borderWidth.replace('px', ''))
const clientX = event.clientX || event.touches[0].clientX
const clientY = event.clientY || event.touches[0].clientY
......@@ -172,7 +173,7 @@ function rippler({ event, el, zIndex, background }: { event: EventType; el: HTML
function setProps(modifiers: Recordable, props: Recordable) {
modifiers.forEach((item: Recordable) => {
if (isNaN(Number(item))) props.event = item
if (Number.isNaN(Number(item))) props.event = item
else props.transition = item
})
}
......
import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue'
import type { Ref } from 'vue'
interface Params {
excludeListeners?: boolean
excludeKeys?: string[]
......
import { getCurrentInstance, onUnmounted } from 'vue'
import { createContextMenu, destroyContextMenu } from '/@/components/ContextMenu'
import type { ContextMenuItem } from '/@/components/ContextMenu'
export type { ContextMenuItem }
export function useContextMenu(authRemove = true) {
if (getCurrentInstance() && authRemove) {
......
import { ref, watch } from 'vue'
import { isDef } from '/@/utils/is'
interface Options {
target?: HTMLElement
}
......
import { useAppProviderContext } from '/@/components/Application'
// import { computed } from 'vue';
// import { lowerFirst } from 'lodash-es';
export function useDesign(scope: string) {
......
......@@ -7,6 +7,7 @@ import { useUserStore } from '/@/store/modules/user'
import { useTabs } from './useTabs'
import { resetRouter, router } from '/@/router'
// import { RootRoute } from '/@/router/routes';
import projectSetting from '/@/settings/projectSetting'
......
......@@ -11,6 +11,7 @@
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'
import SessionTimeoutLogin from '/@/views/sys/login/SessionTimeoutLogin.vue'
export default defineComponent({
name: 'LayoutFeatures',
components: {
......
......@@ -4,6 +4,7 @@
import { useI18n } from '/@/hooks/web/useI18n'
import { useFullscreen } from '@vueuse/core'
import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons-vue'
export default defineComponent({
name: 'FullScreen',
components: { FullscreenExitOutlined, FullscreenOutlined, Tooltip },
......
......@@ -8,6 +8,7 @@
import { useUserStore } from '/@/store/modules/user'
import { useLockStore } from '/@/store/modules/lock'
import headerImg from '/@/assets/images/header.jpg'
export default defineComponent({
name: 'LockModal',
components: { BasicModal, BasicForm },
......
......@@ -5,6 +5,7 @@
import { useDesign } from '/@/hooks/web/useDesign'
import { Avatar, List, Tag, Typography } from 'ant-design-vue'
import { isNumber } from '/@/utils/is'
export default defineComponent({
components: {
[Avatar.name]: Avatar,
......
......@@ -13,6 +13,7 @@
import { propTypes } from '/@/utils/propTypes'
import { openWindow } from '/@/utils'
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'
type MenuEvent = 'logout' | 'doc' | 'lock'
export default defineComponent({
name: 'UserDropdown',
......
......@@ -242,7 +242,7 @@ export default defineComponent({
event={HandlerEnum.LOCK_TIME}
defaultValue={unref(getLockTime)}
formatter={(value: string) => {
return parseInt(value) === 0
return Number.parseInt(value) === 0
? `0(${t('layout.setting.notAutoScreenLock')})`
: `${value}${t('layout.setting.minute')}`
}}
......@@ -255,7 +255,7 @@ export default defineComponent({
event={HandlerEnum.MENU_WIDTH}
disabled={!unref(getShowMenuRef)}
defaultValue={unref(getMenuWidth)}
formatter={(value: string) => `${parseInt(value)}px`}
formatter={(value: string) => `${Number.parseInt(value)}px`}
/>
</>
)
......
......@@ -6,6 +6,7 @@
import { useDesign } from '/@/hooks/web/useDesign'
import type { menuTypeList } from '../enum'
export default defineComponent({
name: 'MenuTypePicker',
components: { Tooltip },
......
......@@ -14,6 +14,7 @@
import { useDesign } from '/@/hooks/web/useDesign'
import DragBar from './DragBar.vue'
export default defineComponent({
name: 'LayoutSideBar',
components: { Sider: Layout.Sider, LayoutMenu, DragBar, LayoutTrigger },
......
......@@ -8,6 +8,7 @@
import { useAppInject } from '/@/hooks/web/useAppInject'
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'
import { useDesign } from '/@/hooks/web/useDesign'
export default defineComponent({
name: 'SiderWrapper',
components: { Sider, Drawer, MixSider },
......
......@@ -83,6 +83,7 @@ export function useDragLine(siderRef: Ref<any>, dragBarRef: Ref<any>, mix = fals
function handleMouseMove(ele: HTMLElement, wrap: HTMLElement, clientX: number) {
document.onmousemove = function (innerE) {
let iT = (ele as any).left + (innerE.clientX - clientX)
// @ts-expect-error
innerE = innerE || window.event
const maxT = 800
const minT = unref(getMiniWidthNumber)
......@@ -101,7 +102,7 @@ export function useDragLine(siderRef: Ref<any>, dragBarRef: Ref<any>, mix = fals
document.onmousemove = null
document.onmouseup = null
wrap.style.transition = 'width 0.2s'
const width = parseInt(wrap.style.width)
const width = Number.parseInt(wrap.style.width)
if (!mix) {
const miniWidth = unref(getMiniWidthNumber)
......
......@@ -6,6 +6,7 @@
import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'
import { getTransitionName } from './transition'
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
export default defineComponent({
name: 'PageLayout',
components: { FrameLayout },
......
......@@ -2,6 +2,7 @@ import 'virtual:windi-base.css'
import 'virtual:windi-components.css'
import '/@/design/index.less'
import 'virtual:windi-utilities.css'
// Register icon sprite
import 'virtual:svg-icons-register'
import { createApp } from 'vue'
......
......@@ -42,7 +42,7 @@ export function hexToRGB(hex: string) {
}
const sColorChange: number[] = []
for (let i = 1; i < 7; i += 2) {
sColorChange.push(parseInt(`0x${sHex.slice(i, i + 2)}`))
sColorChange.push(Number.parseInt(`0x${sHex.slice(i, i + 2)}`))
}
return `RGB(${sColorChange.join(',')})`
}
......@@ -96,7 +96,7 @@ export function lighten(color: string, amount: number) {
* @returns {string} The processed part of the color
*/
function addLight(color: string, amount: number) {
const cc = parseInt(color, 16) + amount
const cc = Number.parseInt(color, 16) + amount
const c = cc > 255 ? 255 : cc
return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`
}
......@@ -142,7 +142,7 @@ export function calculateBestTextColor(hexColor: string) {
* @returns {string} The processed part of the color
*/
function subtractLight(color: string, amount: number) {
const cc = parseInt(color, 16) - amount
const cc = Number.parseInt(color, 16) - amount
const c = cc < 0 ? 0 : cc
return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`
}
......@@ -169,6 +169,7 @@ export function useRafThrottle<T extends FunctionArgs>(fn: T): T {
locked = true
window.requestAnimationFrame(() => {
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-invalid-this
fn.apply(this, args)
locked = false
})
......
import type { AxiosError, AxiosInstance } from 'axios'
/**
* 请求重试机制
*/
......
import type { ErrorMessageMode } from '/#/axios'
import { useMessage } from '/@/hooks/web/useMessage'
import { useI18n } from '/@/hooks/web/useI18n'
// import router from '/@/router';
// import { PageEnum } from '/@/enums/pageEnum';
import { useUserStoreWithOut } from '/@/store/modules/user'
......
......@@ -11,6 +11,16 @@ const PROXY_LIST = [
// ['http://192.168.0.100:18100', `https://oss.app.yiring.com`],
]
// 监测是否为开发环境
// FIXED: 使用 try catch 的方式来判断是否为开发环境,因为在 Webview/RenderJS 中无法使用 import.meta.env
function isDevEnv() {
try {
return import.meta.env.MODE === 'development'
} catch (_) {
return false
}
}
/**
* 将内部地址(内网)转换成代理/预览地址(公网)
* @param url 内网地址
......@@ -28,7 +38,7 @@ export function getExtranetUrl(url: string): string {
/**
* 将代理/预览地址(公网)转换成内部地址(内网)
* eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题
* @param url 代理/公网地址
* @param url 包含代理/公网地址的内容
*/
export function getIntranetUrl(url: string): string {
let uri = url
......@@ -46,13 +56,22 @@ export function getIntranetUrl(url: string): string {
* @returns 替换本地链接后的数据结果
*/
export function handleResponseResource<T>(body: T, options: Recordable) {
if (options.apiUrl.includes('proxy.yiring.com') && typeof body === 'object') {
let text = JSON.stringify(body)
// 处理内网地址的预览问题
text = getExtranetUrl(text)
for (const [intranet, extranet] of PROXY_LIST) {
// 当需要处理内外网资源地址映射时,进行内容处理
const isIntranet = options.apiUrl.includes(intranet)
const isExtranet = isDevEnv() ? true : options.apiUrl.includes(extranet)
if (isIntranet || isExtranet) {
const isString = typeof body === 'string'
const isObject = typeof body === 'object'
return JSON.parse(text) as T
// 处理有效数据
if (isString || isObject) {
let text = isString ? body : JSON.stringify(body)
// 说明: 如果接口地址是内网,就需要将外网链接转换成内网链接,如果是外网接口地址,则需要将内网地址转换成外网链接,来保证无论内外网访问平台资源都是正常的
text = isExtranet ? getExtranetUrl(text) : getIntranetUrl(text)
return (isString ? text : JSON.parse(text)) as T
}
}
}
return body
......
......@@ -33,7 +33,7 @@ export interface Indexable<T> {
export type Hash<T> = Indexable<T>
export type TimeoutHandle = ReturnType<typeof global.setTimeout>
export type TimeoutHandle = ReturnType<typeof setTimeout>
export type ComponentSize = 'large' | 'medium' | 'small' | 'mini'
......
......@@ -10,6 +10,7 @@
import { fireErrorApi } from '/@/api/demo/error'
import { getColumns } from './data'
import { cloneDeep } from 'lodash-es'
const rowInfo = ref<ErrorLogInfo>()
const imgList = ref<string[]>([])
const { t } = useI18n()
......
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
name: 'FrameBlank',
})
......
......@@ -10,6 +10,7 @@
import { useI18n } from '/@/hooks/web/useI18n'
import { useDesign } from '/@/hooks/web/useDesign'
import { useLocaleStore } from '/@/store/modules/locale'
defineProps({
sessionTimeout: {
type: Boolean,
......
......@@ -17,6 +17,7 @@
import { useUserStore } from '/@/store/modules/user'
import { LoginStateEnum, useFormRules, useFormValid, useLoginState } from './useLogin'
import { useDesign } from '/@/hooks/web/useDesign'
// import { onKeyStroke } from '@vueuse/core';
const ACol = Col
......
......@@ -51,6 +51,7 @@ declare global {
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论