refactor: vue3.3 defineOptions

This commit is contained in:
shizhong 2023-09-22 12:49:25 +08:00
parent 6ec2ee8af4
commit 20f483f561
189 changed files with 589 additions and 187 deletions

View File

@ -1,10 +1,12 @@
<script lang="ts" name="APP" setup>
<script lang="ts" setup>
import { isDark } from '@/utils/is'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import routerSearch from '@/components/RouterSearch/index.vue'
defineOptions({ name: 'APP' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('app')
const appStore = useAppStore()

View File

@ -1,7 +1,9 @@
<script lang="ts" name="BackTop" setup>
<script lang="ts" setup>
import { ElBacktop } from 'element-plus'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'BackTop' })
const { getPrefixCls, variables } = useDesign()
const prefixCls = getPrefixCls('backtop')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="ConfigGlobal" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { useLocaleStore } from '@/store/modules/locale'
import { useAppStore } from '@/store/modules/app'
@ -7,6 +7,8 @@ import { useDesign } from '@/hooks/web/useDesign'
import { ElementPlusSize } from '@/types/elementPlus'
import { useWindowSize } from '@vueuse/core'
defineOptions({ name: 'ConfigGlobal' })
const { variables } = useDesign()
const appStore = useAppStore()

View File

@ -1,7 +1,9 @@
<script lang="ts" name="ContentDetailWrap" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'ContentDetailWrap' })
const { t } = useI18n()
const { getPrefixCls } = useDesign()

View File

@ -1,7 +1,9 @@
<script lang="ts" name="ContentWrap" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'ContentWrap' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('content-wrap')

View File

@ -1,9 +1,11 @@
<script lang="ts" name="CountTo" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { isNumber } from '@/utils/is'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'CountTo' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('count-to')

View File

@ -1,7 +1,9 @@
<script lang="ts" name="Crontab" setup>
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { PropType } from 'vue'
defineOptions({ name: 'Crontab' })
interface shortcutsType {
text: string
value: string

View File

@ -113,7 +113,7 @@
</Dialog>
</div>
</template>
<script lang="ts" name="CopperModal" setup>
<script lang="ts" setup>
import { useDesign } from '@/hooks/web/useDesign'
import { dataURLtoBlob } from '@/utils/filt'
import { useI18n } from 'vue-i18n'
@ -121,6 +121,8 @@ import type { CropendResult, Cropper } from './types'
import { propTypes } from '@/utils/propTypes'
import { CropperImage } from '@/components/Cropper'
defineOptions({ name: 'CopperModal' })
const props = defineProps({
srcValue: propTypes.string.def(''),
circled: propTypes.bool.def(true)

View File

@ -10,7 +10,7 @@
/>
</div>
</template>
<script lang="ts" name="Cropper" setup>
<script lang="ts" setup>
import { CSSProperties, PropType } from 'vue'
import Cropper from 'cropperjs'
import 'cropperjs/dist/cropper.css'
@ -18,6 +18,8 @@ import { useDesign } from '@/hooks/web/useDesign'
import { propTypes } from '@/utils/propTypes'
import { useDebounceFn } from '@vueuse/core'
defineOptions({ name: 'Cropper' })
type Options = Cropper.Options
const defaultOptions: Options = {

View File

@ -12,7 +12,7 @@
/>
</div>
</template>
<script lang="ts" name="CropperAvatar" setup>
<script lang="ts" setup>
import { useDesign } from '@/hooks/web/useDesign'
import { propTypes } from '@/utils/propTypes'
@ -20,6 +20,8 @@ import { useI18n } from 'vue-i18n'
import CopperModal from './CopperModal.vue'
import avatar from '@/assets/imgs/avatar.jpg'
defineOptions({ name: 'CropperAvatar' })
const props = defineProps({
width: propTypes.string.def('200px'),
value: propTypes.string.def(''),

View File

@ -1,4 +1,4 @@
<script lang="ts" name="Descriptions" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import dayjs from 'dayjs'
import { useDesign } from '@/hooks/web/useDesign'
@ -6,6 +6,8 @@ import { propTypes } from '@/utils/propTypes'
import { useAppStore } from '@/store/modules/app'
import { DescriptionsSchema } from '@/types/descriptions'
defineOptions({ name: 'Descriptions' })
const appStore = useAppStore()
const mobile = computed(() => appStore.getMobile)

View File

@ -1,7 +1,9 @@
<script lang="ts" name="Dialog" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { isNumber } from '@/utils/is'
defineOptions({ name: 'Dialog' })
const slots = useSlots()
const props = defineProps({

View File

@ -5,9 +5,11 @@
</template>
</el-alert>
</template>
<script setup lang="tsx" name="DocAlert">
<script setup lang="tsx">
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'DocAlert' })
const props = defineProps({
title: propTypes.string,
url: propTypes.string

View File

@ -1,4 +1,4 @@
<script lang="ts" name="EChart" setup>
<script lang="ts" setup>
import type { EChartsOption } from 'echarts'
import echarts from '@/plugins/echarts'
import { debounce } from 'lodash-es'
@ -9,6 +9,8 @@ import { useAppStore } from '@/store/modules/app'
import { isString } from '@/utils/is'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'EChart' })
const { getPrefixCls, variables } = useDesign()
const prefixCls = getPrefixCls('echart')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="Editor" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { i18nChangeLanguage, IDomEditor, IEditorConfig } from '@wangeditor/editor'
@ -8,6 +8,8 @@ import { ElMessage } from 'element-plus'
import { useLocaleStore } from '@/store/modules/locale'
import { getAccessToken, getTenantId } from '@/utils/auth'
defineOptions({ name: 'Editor' })
type InsertFnType = (url: string, alt: string, href: string) => void
const localeStore = useLocaleStore()

View File

@ -1,9 +1,11 @@
<script lang="ts" name="Error" setup>
<script lang="ts" setup>
import pageError from '@/assets/svgs/404.svg'
import networkError from '@/assets/svgs/500.svg'
import noPermission from '@/assets/svgs/403.svg'
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'Error' })
interface ErrorMap {
url: string
message: string

View File

@ -1,6 +1,8 @@
<script lang="ts" name="IFrame" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'IFrame' })
const props = defineProps({
src: propTypes.string.def('')
})

View File

@ -1,8 +1,10 @@
<script lang="ts" name="Icon" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import Iconify from '@purge-icons/generated'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'Icon' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('icon')

View File

@ -1,8 +1,10 @@
<script lang="ts" name="IconSelect" setup>
<script lang="ts" setup>
import { CSSProperties } from 'vue'
import { cloneDeep } from 'lodash-es'
import { IconJson } from '@/components/Icon/src/data'
defineOptions({ name: 'IconSelect' })
type ParameterCSSProperties = (item?: string) => CSSProperties | undefined
const props = defineProps({

View File

@ -1,7 +1,9 @@
<script lang="ts" name="ImageViewer" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'ImageViewer' })
const props = defineProps({
urlList: {
type: Array as PropType<string[]>,

View File

@ -1,9 +1,11 @@
<script lang="ts" name="InfoTip" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { useDesign } from '@/hooks/web/useDesign'
import { propTypes } from '@/utils/propTypes'
import { TipSchema } from '@/types/infoTip'
defineOptions({ name: 'InfoTip' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('infotip')

View File

@ -1,10 +1,12 @@
<script lang="ts" name="InputPassword" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { useConfigGlobal } from '@/hooks/web/useConfigGlobal'
import type { ZxcvbnResult } from '@zxcvbn-ts/core'
import { zxcvbn } from '@zxcvbn-ts/core'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'InputPassword' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('input-password')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="Qrcode" setup>
<script lang="ts" setup>
import { computed, nextTick, PropType, ref, unref, watch } from 'vue'
import QRCode, { QRCodeRenderersOptions } from 'qrcode'
import { cloneDeep } from 'lodash-es'
@ -7,6 +7,8 @@ import { useDesign } from '@/hooks/web/useDesign'
import { isString } from '@/utils/is'
import { QrcodeLogo } from '@/types/qrcode'
defineOptions({ name: 'Qrcode' })
const props = defineProps({
// img canvas,imglogo
tag: propTypes.string.validate((v: string) => ['canvas', 'img'].includes(v)).def('canvas'),

View File

@ -1,4 +1,4 @@
<script lang="ts" name="Search" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
@ -7,6 +7,8 @@ import { findIndex } from '@/utils'
import { cloneDeep } from 'lodash-es'
import { FormSchema } from '@/types/form'
defineOptions({ name: 'Search' })
const { t } = useI18n()
const props = defineProps({

View File

@ -1,8 +1,10 @@
<script lang="ts" name="Sticky" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { isClient, useEventListener, useWindowSize } from '@vueuse/core'
import type { CSSProperties } from 'vue'
defineOptions({ name: 'Sticky' })
const props = defineProps({
// (px)
offset: propTypes.number.def(0),

View File

@ -1,6 +1,8 @@
<script lang="ts" name="Tooltip" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'Tooltip' })
defineProps({
titel: propTypes.string.def(''),
message: propTypes.string.def(''),

View File

@ -32,13 +32,15 @@
</el-upload>
</div>
</template>
<script setup lang="ts" name="UploadFile">
<script setup lang="ts">
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
import { getAccessToken, getTenantId } from '@/utils/auth'
import type { UploadInstance, UploadUserFile, UploadProps, UploadRawFile } from 'element-plus'
defineOptions({ name: 'UploadFile' })
const message = useMessage() //
const emit = defineEmits(['update:modelValue'])

View File

@ -50,13 +50,15 @@
</div>
</template>
<script setup lang="ts" name="UploadImg">
<script setup lang="ts">
import type { UploadProps } from 'element-plus'
import { generateUUID } from '@/utils'
import { propTypes } from '@/utils/propTypes'
import { getAccessToken, getTenantId } from '@/utils/auth'
defineOptions({ name: 'UploadImg' })
type FileTypes =
| 'image/apng'
| 'image/bmp'

View File

@ -45,7 +45,7 @@
/>
</div>
</template>
<script lang="ts" name="UploadImgs" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import type { UploadFile, UploadProps, UploadUserFile } from 'element-plus'
import { ElNotification } from 'element-plus'
@ -53,6 +53,8 @@ import { ElNotification } from 'element-plus'
import { propTypes } from '@/utils/propTypes'
import { getAccessToken, getTenantId } from '@/utils/auth'
defineOptions({ name: 'UploadImgs' })
const message = useMessage() //
type FileTypes =

View File

@ -57,7 +57,7 @@
</div>
</div>
</template>
<script name="VerifyPoints" setup type="text/babel">
<script setup type="text/babel">
/**
* VerifyPoints
* @description 点选
@ -67,6 +67,8 @@ import { aesEncrypt } from './../utils/ase'
import { getCodeApi, reqCheckApi } from '@/api/login'
import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs } from 'vue'
defineOptions({ name: 'VerifyPoints' })
const props = defineProps({
//popfixed
mode: {

View File

@ -71,7 +71,7 @@
</div>
</div>
</template>
<script name="VerifySlide" setup type="text/babel">
<script setup type="text/babel">
/**
* VerifySlide
* @description 滑块
@ -80,6 +80,8 @@ import { aesEncrypt } from './../utils/ase'
import { resetSize } from './../utils/util'
import { getCodeApi, reqCheckApi } from '@/api/login'
defineOptions({ name: 'VerifySlide' })
const props = defineProps({
captchaType: {
type: String

View File

@ -1,7 +1,9 @@
<script lang="ts" name="XButton" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'XButton' })
const props = defineProps({
modelValue: propTypes.bool.def(false),
loading: propTypes.bool.def(false),

View File

@ -1,7 +1,9 @@
<script lang="ts" name="XTextButton" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { PropType } from 'vue'
defineOptions({ name: 'XTextButton' })
const props = defineProps({
modelValue: propTypes.bool.def(false),
loading: propTypes.bool.def(false),

View File

@ -1,5 +1,8 @@
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'XModal' })
const slots = useSlots()
const props = defineProps({

View File

@ -5,7 +5,7 @@
</template>
</VxeGrid>
</template>
<script setup lang="ts" name="XTable">
<script setup lang="ts">
import { PropType } from 'vue'
import { SizeType, VxeGridInstance } from 'vxe-table'
import { useAppStore } from '@/store/modules/app'
@ -15,6 +15,8 @@ import { isBoolean, isFunction } from '@/utils/is'
import styleCss from './style/dark.scss?inline'
import download from '@/utils/download'
defineOptions({ name: 'XTable' })
const { t } = useI18n()
const message = useMessage() //

View File

@ -203,7 +203,7 @@
</div>
</template>
<script setup lang="ts" name="MyProcessDesigner">
<script setup lang="ts">
// import 'bpmn-js/dist/assets/diagram-js.css' //
// import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css'
// import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css'
@ -233,6 +233,9 @@ import flowableModdleExtension from './plugins/extension-moddle/flowable'
// import xml2js from 'xml-js'
// import xml2js from 'fast-xml-parser'
import { XmlNode, XmlNodeType, parseXmlString } from 'steady-xml'
defineOptions({ name: 'MyProcessDesigner' })
const bpmnCanvas = ref()
const refFile = ref()
const emit = defineEmits([

View File

@ -6,11 +6,14 @@
</div>
</template>
<script setup lang="ts" name="MyProcessViewer">
<script setup lang="ts">
import BpmnViewer from 'bpmn-js/lib/Viewer'
import DefaultEmptyXML from './plugins/defaultEmpty'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
defineOptions({ name: 'MyProcessViewer' })
const props = defineProps({
value: {
// BPMN XML

View File

@ -5,9 +5,11 @@
</div>
</template>
<script setup lang="ts" name="MyProcessPalette">
<script setup lang="ts">
import { assign } from 'min-dash'
defineOptions({ name: 'MyProcessPalette' })
const bpmnInstances = () => (window as any).bpmnInstances
const addTask = (event, options: any = {}) => {
const ElementFactory = bpmnInstances().elementFactory

View File

@ -62,7 +62,7 @@
</el-collapse>
</div>
</template>
<script setup lang="ts" name="MyPropertiesPanel">
<script setup lang="ts">
import ElementBaseInfo from './base/ElementBaseInfo.vue'
import ElementOtherConfig from './other/ElementOtherConfig.vue'
import ElementTask from './task/ElementTask.vue'
@ -73,6 +73,9 @@ import ElementListeners from './listeners/ElementListeners.vue'
import ElementProperties from './properties/ElementProperties.vue'
// import ElementForm from './form/ElementForm.vue'
import UserTaskListeners from './listeners/UserTaskListeners.vue'
defineOptions({ name: 'MyPropertiesPanel' })
/**
* 侧边栏
* @Author MiyueFE

View File

@ -37,7 +37,9 @@
</el-form>
</div>
</template>
<script setup lang="ts" name="ElementBaseInfo">
<script setup lang="ts">
defineOptions({ name: 'ElementBaseInfo' })
const props = defineProps({
businessObject: {
type: Object,

View File

@ -62,7 +62,9 @@
</div>
</template>
<script setup lang="ts" name="FlowCondition">
<script setup lang="ts">
defineOptions({ name: 'FlowCondition' })
const props = defineProps({
businessObject: Object,
type: String

View File

@ -222,7 +222,9 @@
</div>
</template>
<script setup lang="ts" name="ElementForm">
<script setup lang="ts">
defineOptions({ name: 'ElementForm' })
const props = defineProps({
id: String,
type: String

View File

@ -241,10 +241,13 @@
</el-dialog>
</div>
</template>
<script setup lang="ts" name="ElementListeners">
<script setup lang="ts">
import { ElMessageBox } from 'element-plus'
import { createListenerObject, updateElementExtensions } from '../../utils'
import { initListenerType, initListenerForm, listenerType, fieldType } from './utilSelf'
defineOptions({ name: 'ElementListeners' })
const props = defineProps({
id: String,
type: String

View File

@ -287,10 +287,13 @@
</el-dialog>
</div>
</template>
<script setup lang="ts" name="UserTaskListeners">
<script setup lang="ts">
import { ElMessageBox } from 'element-plus'
import { createListenerObject, updateElementExtensions } from '../../utils'
import { initListenerForm, initListenerType, eventType, listenerType, fieldType } from './utilSelf'
defineOptions({ name: 'UserTaskListeners' })
const props = defineProps({
id: String,
type: String

View File

@ -66,7 +66,9 @@
</div>
</template>
<script setup lang="ts" name="ElementMultiInstance">
<script setup lang="ts">
defineOptions({ name: 'ElementMultiInstance' })
const props = defineProps({
businessObject: Object,
type: String

View File

@ -16,7 +16,9 @@
</div>
</template>
<script setup lang="ts" name="ElementOtherConfig">
<script setup lang="ts">
defineOptions({ name: 'ElementOtherConfig' })
const props = defineProps({
id: String
})

View File

@ -52,8 +52,11 @@
</div>
</template>
<script setup lang="ts" name="ElementProperties">
<script setup lang="ts">
import { ElMessageBox } from 'element-plus'
defineOptions({ name: 'ElementProperties' })
const props = defineProps({
id: String,
type: String

View File

@ -45,7 +45,9 @@
</el-dialog>
</div>
</template>
<script setup lang="ts" name="SignalAndMassage">
<script setup lang="ts">
defineOptions({ name: 'SignalAndMassage' })
const message = useMessage()
const signalList = ref<any[]>([])
const messageList = ref<any[]>([])

View File

@ -20,11 +20,13 @@
</div>
</template>
<script setup lang="ts" name="ElementTaskConfig">
<script setup lang="ts">
import UserTask from './task-components/UserTask.vue'
import ScriptTask from './task-components/ScriptTask.vue'
import ReceiveTask from './task-components/ReceiveTask.vue'
defineOptions({ name: 'ElementTaskConfig' })
const props = defineProps({
id: String,
type: String

View File

@ -48,7 +48,9 @@
</div>
</template>
<script setup lang="ts" name="ReceiveTask">
<script setup lang="ts">
defineOptions({ name: 'ReceiveTask' })
const props = defineProps({
id: String,
type: String

View File

@ -44,7 +44,9 @@
</div>
</template>
<script setup lang="ts" name="ScriptTask">
<script setup lang="ts">
defineOptions({ name: 'ScriptTask' })
const props = defineProps({
id: String,
type: String

View File

@ -37,7 +37,9 @@
</div>
</template>
<script setup lang="ts" name="UserTask">
<script setup lang="ts">
defineOptions({ name: 'UserTask' })
const props = defineProps({
id: String,
type: String

View File

@ -1,8 +1,10 @@
<script lang="ts" name="AppView" setup>
<script lang="ts" setup>
import { useTagsViewStore } from '@/store/modules/tagsView'
import { useAppStore } from '@/store/modules/app'
import { Footer } from '@/layout/components/Footer'
defineOptions({ name: 'AppView' })
const appStore = useAppStore()
const layout = computed(() => appStore.getLayout)

View File

@ -1,8 +1,10 @@
<script lang="ts" name="Collapse" setup>
<script lang="ts" setup>
import { useAppStore } from '@/store/modules/app'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'Collapse' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('collapse')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="ContextMenu" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { useDesign } from '@/hooks/web/useDesign'
@ -6,6 +6,8 @@ import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { contextMenuSchema } from '@/types/contextMenu'
import type { ElDropdown } from 'element-plus'
defineOptions({ name: 'ContextMenu' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('context-menu')

View File

@ -1,9 +1,11 @@
<script lang="ts" name="LocaleDropdown" setup>
<script lang="ts" setup>
import { useLocaleStore } from '@/store/modules/locale'
import { useLocale } from '@/hooks/web/useLocale'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'LocaleDropdown' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('locale-dropdown')

View File

@ -1,8 +1,10 @@
<script lang="ts" name="Logo" setup>
<script lang="ts" setup>
import { computed, onMounted, ref, unref, watch } from 'vue'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'Logo' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('logo')

View File

@ -1,7 +1,9 @@
<script lang="ts" name="Message" setup>
<script lang="ts" setup>
import { formatDate } from '@/utils/formatTime'
import * as NotifyMessageApi from '@/api/system/notify/message'
defineOptions({ name: 'Message' })
const { push } = useRouter()
const activeName = ref('notice')
const unreadCount = ref(0) //

View File

@ -1,9 +1,11 @@
<script lang="ts" name="ScreenFull" setup>
<script lang="ts" setup>
import { Icon } from '@/components/Icon'
import { useFullscreen } from '@vueuse/core'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'ScreenFull' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('screenfull')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="Setting" setup>
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { useClipboard, useCssVar } from '@vueuse/core'
@ -13,6 +13,8 @@ import ColorRadioPicker from './components/ColorRadioPicker.vue'
import InterfaceDisplay from './components/InterfaceDisplay.vue'
import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
defineOptions({ name: 'Setting' })
const { t } = useI18n()
const appStore = useAppStore()

View File

@ -1,8 +1,10 @@
<script lang="ts" name="ColorRadioPicker" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'ColorRadioPicker' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('color-radio-picker')

View File

@ -1,10 +1,12 @@
<script lang="ts" name="InterfaceDisplay" setup>
<script lang="ts" setup>
import { setCssVar } from '@/utils'
import { useDesign } from '@/hooks/web/useDesign'
import { useWatermark } from '@/hooks/web/useWatermark'
import { useAppStore } from '@/store/modules/app'
defineOptions({ name: 'InterfaceDisplay' })
const { t } = useI18n()
const { getPrefixCls } = useDesign()
const { setWatermark } = useWatermark()

View File

@ -1,7 +1,9 @@
<script lang="ts" name="LayoutRadioPicker" setup>
<script lang="ts" setup>
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'LayoutRadioPicker' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('layout-radio-picker')

View File

@ -1,10 +1,12 @@
<script lang="ts" name="SizeDropdown" setup>
<script lang="ts" setup>
import { useAppStore } from '@/store/modules/app'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
import { ElementPlusSize } from '@/types/elementPlus'
defineOptions({ name: 'SizeDropdown' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('size-dropdown')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="TagsView" setup>
<script lang="ts" setup>
import type { RouteLocationNormalizedLoaded, RouterLinkProps } from 'vue-router'
import { usePermissionStore } from '@/store/modules/permission'
import { useTagsViewStore } from '@/store/modules/tagsView'
@ -11,6 +11,8 @@ import { useTemplateRefsList } from '@vueuse/core'
import { ElScrollbar } from 'element-plus'
import { useScrollTo } from '@/hooks/event/useScrollTo'
defineOptions({ name: 'TagsView' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('tags-view')

View File

@ -1,8 +1,10 @@
<script lang="ts" name="ThemeSwitch" setup>
<script lang="ts" setup>
import { useAppStore } from '@/store/modules/app'
import { useIcon } from '@/hooks/web/useIcon'
import { useDesign } from '@/hooks/web/useDesign'
defineOptions({ name: 'ThemeSwitch' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('theme-switch')

View File

@ -1,4 +1,4 @@
<script lang="ts" name="UserInfo" setup>
<script lang="ts" setup>
import { ElMessageBox } from 'element-plus'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
@ -7,6 +7,8 @@ import avatarImg from '@/assets/imgs/avatar.gif'
import { useUserStore } from '@/store/modules/user'
import { useTagsViewStore } from '@/store/modules/tagsView'
defineOptions({ name: 'UserInfo' })
const { t } = useI18n()
const { wsCache } = useCache()

View File

@ -160,7 +160,7 @@
</el-col>
</el-row>
</template>
<script setup lang="ts" name="Home">
<script setup lang="ts">
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
import { formatTime } from '@/utils'
@ -171,6 +171,8 @@ import avatarImg from '@/assets/imgs/avatar.gif'
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
import { pieOptions, barOptions } from './echarts-data'
defineOptions({ name: 'Home' })
const { t } = useI18n()
const userStore = useUserStore()
const { setWatermark } = useWatermark()

View File

@ -140,7 +140,7 @@
</el-col>
</el-row>
</template>
<script lang="ts" name="Home2" setup>
<script lang="ts" setup>
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
@ -148,6 +148,8 @@ import { useDesign } from '@/hooks/web/useDesign'
import type { AnalysisTotalTypes } from './types'
import { barOptions, lineOptions, pieOptions } from './echarts-data'
defineOptions({ name: 'Home2' })
const { t } = useI18n()
const loading = ref(true)
const { getPrefixCls } = useDesign()

View File

@ -62,7 +62,7 @@
</div>
</div>
</template>
<script lang="ts" name="Login" setup>
<script lang="ts" setup>
import { underlineToHump } from '@/utils'
import { useDesign } from '@/hooks/web/useDesign'
@ -72,6 +72,8 @@ import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'
defineOptions({ name: 'Login' })
const { t } = useI18n()
const appStore = useAppStore()
const { getPrefixCls } = useDesign()

View File

@ -143,7 +143,7 @@
</el-row>
</el-form>
</template>
<script lang="ts" name="LoginForm" setup>
<script lang="ts" setup>
import { ElLoading } from 'element-plus'
import LoginFormTitle from './LoginFormTitle.vue'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
@ -155,6 +155,8 @@ import { usePermissionStore } from '@/store/modules/permission'
import * as LoginApi from '@/api/login'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
defineOptions({ name: 'LoginForm' })
const { t } = useI18n()
const message = useMessage()
const iconHouse = useIcon({ icon: 'ep:house' })

View File

@ -3,9 +3,11 @@
{{ getFormTitle }}
</h2>
</template>
<script lang="ts" name="LoginFormTitle" setup>
<script lang="ts" setup>
import { LoginStateEnum, useLoginState } from './useLogin'
defineOptions({ name: 'LoginFormTitle' })
const { t } = useI18n()
const { getLoginState } = useLoginState()

View File

@ -92,7 +92,7 @@
</el-row>
</el-form>
</template>
<script lang="ts" name="MobileForm" setup>
<script lang="ts" setup>
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { useIcon } from '@/hooks/web/useIcon'
@ -103,6 +103,8 @@ import { getTenantIdByNameApi, sendSmsCodeApi, smsLoginApi } from '@/api/login'
import LoginFormTitle from './LoginFormTitle.vue'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
defineOptions({ name: 'MobileForm' })
const { t } = useI18n()
const message = useMessage()
const permissionStore = usePermissionStore()

View File

@ -16,12 +16,14 @@
</el-col>
</el-row>
</template>
<script lang="ts" name="QrCodeForm" setup>
<script lang="ts" setup>
import logoImg from '@/assets/imgs/logo.png'
import LoginFormTitle from './LoginFormTitle.vue'
import { LoginStateEnum, useLoginState } from './useLogin'
defineOptions({ name: 'QrCodeForm' })
const { t } = useI18n()
const { handleBackLogin, getLoginState } = useLoginState()
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.QR_CODE)

View File

@ -35,7 +35,7 @@
</template>
</Form>
</template>
<script lang="ts" name="RegisterForm" setup>
<script lang="ts" setup>
import type { FormRules } from 'element-plus'
import { useForm } from '@/hooks/web/useForm'
@ -44,6 +44,8 @@ import LoginFormTitle from './LoginFormTitle.vue'
import { LoginStateEnum, useLoginState } from './useLogin'
import { FormSchema } from '@/types/form'
defineOptions({ name: 'RegisterForm' })
const { t } = useI18n()
const { required } = useValidator()
const { register, elFormRef } = useForm()

View File

@ -38,11 +38,14 @@
</div>
</div>
</template>
<script lang="ts" name="SSOLogin" setup>
<script lang="ts" setup>
import LoginFormTitle from './LoginFormTitle.vue'
import * as OAuth2Api from '@/api/login/oauth2'
import { LoginStateEnum, useLoginState } from './useLogin'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
defineOptions({ name: 'SSOLogin' })
const route = useRoute() //
const { currentRoute } = useRouter() //
const { getLoginState, setLoginState } = useLoginState()

View File

@ -30,8 +30,11 @@
</el-card>
</div>
</template>
<script setup lang="ts" name="Profile">
<script setup lang="ts">
import { BasicInfo, ProfileUser, ResetPwd, UserSocial } from './components/'
defineOptions({ name: 'Profile' })
const { t } = useI18n()
const activeName = ref('basicInfo')

View File

@ -12,7 +12,7 @@
<XButton :title="t('common.reset')" type="danger" @click="init()" />
</div>
</template>
<script lang="ts" name="BasicInfo" setup>
<script lang="ts" setup>
import type { FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
@ -24,6 +24,8 @@ import {
UserProfileUpdateReqVO
} from '@/api/system/user/profile'
defineOptions({ name: 'BasicInfo' })
const { t } = useI18n()
//
const rules = reactive<FormRules>({

View File

@ -46,12 +46,14 @@
</ul>
</div>
</template>
<script lang="ts" name="ProfileUser" setup>
<script lang="ts" setup>
import { formatDate } from '@/utils/formatTime'
import UserAvatar from './UserAvatar.vue'
import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile'
defineOptions({ name: 'ProfileUser' })
const { t } = useI18n()
const userInfo = ref<ProfileVO>()
const getUserInfo = async () => {

View File

@ -15,12 +15,14 @@
</el-form-item>
</el-form>
</template>
<script lang="ts" name="ResetPwd" setup>
<script lang="ts" setup>
import type { FormInstance, FormRules } from 'element-plus'
import { InputPassword } from '@/components/InputPassword'
import { updateUserPwdApi } from '@/api/system/user/profile'
defineOptions({ name: 'ResetPwd' })
const { t } = useI18n()
const message = useMessage()
const formRef = ref<FormInstance>()

View File

@ -10,10 +10,12 @@
/>
</div>
</template>
<script lang="ts" name="UserAvatar" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import { uploadAvatarApi } from '@/api/system/user/profile'
defineOptions({ name: 'UserAvatar' })
defineProps({
img: propTypes.string.def('')
})

View File

@ -21,11 +21,13 @@
</el-table-column>
</el-table>
</template>
<script lang="ts" name="UserSocial" setup>
<script lang="ts" setup>
import { SystemUserSocialTypeEnum } from '@/utils/constants'
import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile'
import { socialAuthRedirect, socialUnbind } from '@/api/system/user/socialUser'
defineOptions({ name: 'UserSocial' })
const message = useMessage()
const socialUsers = ref<any[]>([])
const userInfo = ref<ProfileVO>()

View File

@ -1,7 +1,10 @@
<template>
<div></div>
</template>
<script setup lang="ts" name="Redirect">
<script setup lang="ts">
defineOptions({ name: 'Redirect' })
const { currentRoute, replace } = useRouter()
const { params, query } = unref(currentRoute)
const { path, _redirect_type = 'path' } = params

View File

@ -59,7 +59,7 @@
</XModal>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmProcessDefinition">
<script setup lang="ts">
// import
import * as DefinitionApi from '@/api/bpm/definition'
// import * as ModelApi from '@/api/bpm/model'
@ -68,6 +68,8 @@ import { setConfAndFields2 } from '@/utils/formCreate'
import { DICT_TYPE } from '@/utils/dict'
import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package'
defineOptions({ name: 'BpmProcessDefinition' })
const bpmnXML = ref(null)
const showBpmnOpen = ref(false)
const bpmnControlForm = ref({

View File

@ -52,7 +52,7 @@
</XModal>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmFormEditor">
<script setup lang="ts">
import { FormInstance } from 'element-plus'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { CommonStatusEnum } from '@/utils/constants'
@ -61,6 +61,8 @@ import FcDesigner from '@form-create/designer'
import { encodeConf, encodeFields, setConfAndFields } from '@/utils/formCreate'
// import { useClipboard } from '@vueuse/core'
defineOptions({ name: 'BpmFormEditor' })
const { t } = useI18n() //
const message = useMessage() //
const { query } = useRoute() //

View File

@ -43,13 +43,15 @@
</ContentWrap>
</template>
<script setup lang="ts" name="BpmForm">
<script setup lang="ts">
// import
import * as FormApi from '@/api/bpm/form'
import { allSchemas } from './form.data'
// import
import { setConfAndFields2 } from '@/utils/formCreate'
defineOptions({ name: 'BpmForm' })
const { t } = useI18n() //
const { push } = useRouter() //

View File

@ -41,12 +41,14 @@
</template>
</Dialog>
</template>
<script lang="ts" name="BpmUserGroupForm" setup>
<script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { CommonStatusEnum } from '@/utils/constants'
import * as UserGroupApi from '@/api/bpm/userGroup'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'BpmUserGroupForm' })
const { t } = useI18n() //
const message = useMessage() //

View File

@ -85,13 +85,15 @@
</XModal>
</template>
<script setup lang="ts" name="BpmUserGroup">
<script setup lang="ts">
// import
import * as UserGroupApi from '@/api/bpm/userGroup'
import { getListSimpleUsersApi, UserVO } from '@/api/system/user'
import { allSchemas, rules } from './group.data'
import { FormExpose } from '@/components/Form'
defineOptions({ name: 'BpmUserGroup' })
const { t } = useI18n() //
const message = useMessage() //
//

View File

@ -316,7 +316,7 @@
</ContentWrap>
</template>
<script setup lang="ts" name="BpmModel">
<script setup lang="ts">
// import
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package'
@ -329,6 +329,8 @@ import * as ModelApi from '@/api/bpm/model'
import { allSchemas, rules } from './model.data'
import { setConfAndFields2 } from '@/utils/formCreate'
defineOptions({ name: 'BpmModel' })
const { t } = useI18n() //
const message = useMessage() //
const router = useRouter() //

View File

@ -26,7 +26,7 @@
</div>
</template>
<script setup lang="ts" name="BpmModelEditor">
<script setup lang="ts">
import { MyProcessDesigner, MyProcessPenal } from '@/components/bpmnProcessDesigner/package'
// import { translations } from '@/components/bpmnProcessDesigner/src/translations'
//
@ -38,6 +38,8 @@ import CustomPaletteProvider from '@/components/bpmnProcessDesigner/package/desi
// import MyProcessPalette from '@/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue'
import { createModelApi, getModelApi, updateModelApi, ModelVO } from '@/api/bpm/model'
defineOptions({ name: 'BpmModelEditor' })
const router = useRouter()
const message = useMessage()

View File

@ -11,7 +11,7 @@
/>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmOALeaveCreate">
<script setup lang="ts">
import { FormExpose } from '@/components/Form'
// import XEUtils from 'xe-utils'
@ -19,6 +19,8 @@ import { FormExpose } from '@/components/Form'
import * as LeaveApi from '@/api/bpm/leave'
import { rules, allSchemas } from './leave.data'
defineOptions({ name: 'BpmOALeaveCreate' })
const { t } = useI18n() //
const message = useMessage() //
const { push } = useRouter() //

View File

@ -6,11 +6,14 @@
</ContentWrap>
</template>
<script setup lang="ts" name="BpmOALeaveDetail">
<script setup lang="ts">
// import
import * as LeaveApi from '@/api/bpm/leave'
import { allSchemas } from '@/views/bpm/oa/leave/leave.data'
import { useRouter } from 'vue-router'
defineOptions({ name: 'BpmOALeaveDetail' })
const router = useRouter()
const { query } = useRoute() //
const message = useMessage() //

View File

@ -23,7 +23,7 @@
</ContentWrap>
</template>
<script setup lang="ts" name="BpmOALeave">
<script setup lang="ts">
// import
import { ElMessageBox } from 'element-plus'
// import
@ -31,6 +31,8 @@ import { allSchemas } from './leave.data'
import * as LeaveApi from '@/api/bpm/leave'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
defineOptions({ name: 'BpmOALeave' })
const { t } = useI18n() //
const message = useMessage() //
const { push } = useRouter() //

View File

@ -53,7 +53,7 @@
</div>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmProcessInstanceCreate">
<script setup lang="ts">
// import
import { allSchemas } from './process.create'
import * as DefinitionApi from '@/api/bpm/definition'
@ -62,6 +62,8 @@ import { setConfAndFields2 } from '@/utils/formCreate'
import type { ApiAttrs } from '@form-create/element-ui/types/config'
import { DICT_TYPE } from '@/utils/dict'
defineOptions({ name: 'BpmProcessInstanceCreate' })
const router = useRouter() //
const message = useMessage() //

View File

@ -191,7 +191,7 @@
</XModal>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmProcessInstanceDetail">
<script setup lang="ts">
import dayjs from 'dayjs'
import * as UserApi from '@/api/system/user'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
@ -205,6 +205,8 @@ import type { ApiAttrs } from '@form-create/element-ui/types/config'
import { useUserStore } from '@/store/modules/user'
import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package'
defineOptions({ name: 'BpmProcessInstanceDetail' })
const { query } = useRoute() //
const message = useMessage() //
const { t } = useI18n() //

View File

@ -14,11 +14,13 @@
/>
</el-card>
</template>
<script lang="ts" name="BpmProcessInstanceBpmnViewer" setup>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
import * as ActivityApi from '@/api/bpm/activity'
import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package'
defineOptions({ name: 'BpmProcessInstanceBpmnViewer' })
const props = defineProps({
loading: propTypes.bool, //
id: propTypes.string, //

View File

@ -41,7 +41,7 @@
</XTable>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmProcessInstance">
<script setup lang="ts">
// import
import { ElMessageBox } from 'element-plus'
import { DICT_TYPE } from '@/utils/dict'
@ -50,6 +50,8 @@ import { DICT_TYPE } from '@/utils/dict'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { allSchemas } from './process.data'
defineOptions({ name: 'BpmProcessInstance' })
const router = useRouter() //
const message = useMessage() //
const { t } = useI18n() //

View File

@ -12,11 +12,13 @@
</XTable>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmDoneTask">
<script setup lang="ts">
// import
import { allSchemas } from './done.data'
import * as TaskApi from '@/api/bpm/task'
defineOptions({ name: 'BpmDoneTask' })
const { push } = useRouter() //
const [registerTable] = useXTable({

View File

@ -13,11 +13,13 @@
</ContentWrap>
</template>
<script setup lang="ts" name="BpmTodoTask">
<script setup lang="ts">
// import
import { allSchemas } from './todo.data'
import * as TaskApi from '@/api/bpm/task'
defineOptions({ name: 'BpmTodoTask' })
const { push } = useRouter() //
const [registerTable] = useXTable({

View File

@ -133,7 +133,7 @@
</XModal>
</ContentWrap>
</template>
<script setup lang="ts" name="BpmTaskAssignRule">
<script setup lang="ts">
// import
import { FormInstance } from 'element-plus'
// import
@ -147,6 +147,8 @@ import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { handleTree, defaultProps } from '@/utils/tree'
import { allSchemas, rules, idShowActionClick } from './taskAssignRule.data'
defineOptions({ name: 'BpmTaskAssignRule' })
const { t } = useI18n() //
const message = useMessage() //
const { query } = useRoute()

Some files were not shown because too many files have changed in this diff Show More