给所有组件添加name属性预防未知bug!!!

This commit is contained in:
puhui999
2023-04-14 21:32:11 +08:00
parent 44c18473d7
commit b93491579c
133 changed files with 1126 additions and 993 deletions

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="BackTop" setup>
import { ElBacktop } from 'element-plus'
import { useDesign } from '@/hooks/web/useDesign'

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="ConfigGlobal" setup>
import { propTypes } from '@/utils/propTypes'
import { useLocaleStore } from '@/store/modules/locale'
import { useAppStore } from '@/store/modules/app'
@ -51,9 +51,9 @@ const currentLocale = computed(() => localeStore.currentLocale)
<template>
<ElConfigProvider
:namespace="variables.elNamespace"
:locale="currentLocale.elLocale"
:message="{ max: 1 }"
:namespace="variables.elNamespace"
:size="size"
>
<slot></slot>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="ContentDetailWrap" setup>
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
@ -21,7 +21,7 @@ onMounted(() => {
</script>
<template>
<div :class="[`${prefixCls}-container`]" ref="contentDetailWrap">
<div ref="contentDetailWrap" :class="[`${prefixCls}-container`]">
<Sticky :offset="offset">
<div
:class="[
@ -31,7 +31,7 @@ onMounted(() => {
>
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">
<ElButton @click="emit('back')">
<Icon icon="ep:arrow-left" class="mr-5px" />
<Icon class="mr-5px" icon="ep:arrow-left" />
{{ t('common.back') }}
</ElButton>
</div>
@ -47,7 +47,9 @@ onMounted(() => {
</Sticky>
<div style="padding: var(--app-content-padding)">
<ElCard :class="[`${prefixCls}-body`, 'mb-20px']" shadow="never">
<div> <slot></slot> </div>
<div>
<slot></slot>
</div>
</ElCard>
</div>
</div>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="ContentWrap" setup>
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
@ -21,7 +21,7 @@ defineProps({
<template #content>
<div class="max-w-200px">{{ message }}</div>
</template>
<Icon class="ml-5px" icon="ep:question-filled" :size="14" />
<Icon :size="14" class="ml-5px" icon="ep:question-filled" />
</ElTooltip>
</div>
</template>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="CountTo" setup>
import { PropType } from 'vue'
import { isNumber } from '@/utils/is'
import { propTypes } from '@/utils/propTypes'

View File

@ -1,10 +1,12 @@
<script setup lang="ts">
<script lang="ts" name="Crontab" setup>
import { ElMessage } from 'element-plus'
import { PropType } from 'vue'
interface shortcutsType {
text: string
value: string
}
const props = defineProps({
modelValue: {
type: String,
@ -501,7 +503,7 @@ const submit = () => {
}
</script>
<template>
<el-input v-model="defaultValue" v-bind="$attrs" class="input-with-select">
<el-input v-model="defaultValue" class="input-with-select" v-bind="$attrs">
<template #append>
<el-select v-model="select" placeholder="生成器" style="width: 115px">
<el-option label="每分钟" value="0 * * * * ?" />
@ -522,11 +524,11 @@ const submit = () => {
</el-input>
<el-dialog
title="cron规则生成器"
v-model="dialogVisible"
:width="580"
destroy-on-close
append-to-body
destroy-on-close
title="cron规则生成器"
>
<div class="sc-cron">
<el-tabs>
@ -546,38 +548,38 @@ const submit = () => {
<el-radio-button label="3">指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.second.type == '1'">
<el-form-item v-if="cronValue.second.type == '1'" label="范围">
<el-input-number
v-model="cronValue.second.range.start"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
<span style="padding: 0 15px">-</span>
<el-input-number
v-model="cronValue.second.range.end"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.second.type == '2'">
<el-form-item v-if="cronValue.second.type == '2'" label="间隔">
<el-input-number
v-model="cronValue.second.loop.start"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
秒开始
<el-input-number
v-model="cronValue.second.loop.end"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
秒执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.second.type == '3'">
<el-form-item v-if="cronValue.second.type == '3'" label="指定">
<el-select v-model="cronValue.second.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.second"
@ -605,38 +607,38 @@ const submit = () => {
<el-radio-button label="3">指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.minute.type == '1'">
<el-form-item v-if="cronValue.minute.type == '1'" label="范围">
<el-input-number
v-model="cronValue.minute.range.start"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
<span style="padding: 0 15px">-</span>
<el-input-number
v-model="cronValue.minute.range.end"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.minute.type == '2'">
<el-form-item v-if="cronValue.minute.type == '2'" label="间隔">
<el-input-number
v-model="cronValue.minute.loop.start"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
分钟开始
<el-input-number
v-model="cronValue.minute.loop.end"
:min="0"
:max="59"
:min="0"
controls-position="right"
/>
分钟执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.minute.type == '3'">
<el-form-item v-if="cronValue.minute.type == '3'" label="指定">
<el-select v-model="cronValue.minute.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.minute"
@ -664,38 +666,38 @@ const submit = () => {
<el-radio-button label="3">指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.hour.type == '1'">
<el-form-item v-if="cronValue.hour.type == '1'" label="范围">
<el-input-number
v-model="cronValue.hour.range.start"
:min="0"
:max="23"
:min="0"
controls-position="right"
/>
<span style="padding: 0 15px">-</span>
<el-input-number
v-model="cronValue.hour.range.end"
:min="0"
:max="23"
:min="0"
controls-position="right"
/>
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.hour.type == '2'">
<el-form-item v-if="cronValue.hour.type == '2'" label="间隔">
<el-input-number
v-model="cronValue.hour.loop.start"
:min="0"
:max="23"
:min="0"
controls-position="right"
/>
小时开始
<el-input-number
v-model="cronValue.hour.loop.end"
:min="0"
:max="23"
:min="0"
controls-position="right"
/>
小时执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.hour.type == '3'">
<el-form-item v-if="cronValue.hour.type == '3'" label="指定">
<el-select v-model="cronValue.hour.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.hour"
@ -725,38 +727,38 @@ const submit = () => {
<el-radio-button label="5">不指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.day.type == '1'">
<el-form-item v-if="cronValue.day.type == '1'" label="范围">
<el-input-number
v-model="cronValue.day.range.start"
:min="1"
:max="31"
:min="1"
controls-position="right"
/>
<span style="padding: 0 15px">-</span>
<el-input-number
v-model="cronValue.day.range.end"
:min="1"
:max="31"
:min="1"
controls-position="right"
/>
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.day.type == '2'">
<el-form-item v-if="cronValue.day.type == '2'" label="间隔">
<el-input-number
v-model="cronValue.day.loop.start"
:min="1"
:max="31"
:min="1"
controls-position="right"
/>
号开始
<el-input-number
v-model="cronValue.day.loop.end"
:min="1"
:max="31"
:min="1"
controls-position="right"
/>
天执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.day.type == '3'">
<el-form-item v-if="cronValue.day.type == '3'" label="指定">
<el-select v-model="cronValue.day.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.day"
@ -784,38 +786,38 @@ const submit = () => {
<el-radio-button label="3">指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.month.type == '1'">
<el-form-item v-if="cronValue.month.type == '1'" label="范围">
<el-input-number
v-model="cronValue.month.range.start"
:min="1"
:max="12"
:min="1"
controls-position="right"
/>
<span style="padding: 0 15px">-</span>
<el-input-number
v-model="cronValue.month.range.end"
:min="1"
:max="12"
:min="1"
controls-position="right"
/>
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.month.type == '2'">
<el-form-item v-if="cronValue.month.type == '2'" label="间隔">
<el-input-number
v-model="cronValue.month.loop.start"
:min="1"
:max="12"
:min="1"
controls-position="right"
/>
月开始
<el-input-number
v-model="cronValue.month.loop.end"
:min="1"
:max="12"
:min="1"
controls-position="right"
/>
月执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.month.type == '3'">
<el-form-item v-if="cronValue.month.type == '3'" label="指定">
<el-select v-model="cronValue.month.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.month"
@ -846,7 +848,7 @@ const submit = () => {
<el-radio-button label="5">不指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.week.type == '1'">
<el-form-item v-if="cronValue.week.type == '1'" label="范围">
<el-select v-model="cronValue.week.range.start">
<el-option
v-for="(item, index) in data.week"
@ -865,12 +867,12 @@ const submit = () => {
/>
</el-select>
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.week.type == '2'">
<el-form-item v-if="cronValue.week.type == '2'" label="间隔">
<el-input-number
v-model="cronValue.week.loop.start"
:min="1"
:max="4"
:min="1"
controls-position="right"
/>
周的星期
@ -884,7 +886,7 @@ const submit = () => {
</el-select>
执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.week.type == '3'">
<el-form-item v-if="cronValue.week.type == '3'" label="指定">
<el-select v-model="cronValue.week.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.week"
@ -894,7 +896,7 @@ const submit = () => {
/>
</el-select>
</el-form-item>
<el-form-item label="最后一周" v-if="cronValue.week.type == '4'">
<el-form-item v-if="cronValue.week.type == '4'" label="最后一周">
<el-select v-model="cronValue.week.last">
<el-option
v-for="(item, index) in data.week"
@ -924,12 +926,12 @@ const submit = () => {
<el-radio-button label="3">指定</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="范围" v-if="cronValue.year.type == '1'">
<el-form-item v-if="cronValue.year.type == '1'" label="范围">
<el-input-number v-model="cronValue.year.range.start" controls-position="right" />
<span style="padding: 0 15px">-</span>
<el-input-number v-model="cronValue.year.range.end" controls-position="right" />
</el-form-item>
<el-form-item label="间隔" v-if="cronValue.year.type == '2'">
<el-form-item v-if="cronValue.year.type == '2'" label="间隔">
<el-input-number v-model="cronValue.year.loop.start" controls-position="right" />
年开始
<el-input-number
@ -939,7 +941,7 @@ const submit = () => {
/>
年执行一次
</el-form-item>
<el-form-item label="指定" v-if="cronValue.year.type == '3'">
<el-form-item v-if="cronValue.year.type == '3'" label="指定">
<el-select v-model="cronValue.year.appoint" multiple style="width: 100%">
<el-option
v-for="(item, index) in data.year"
@ -968,16 +970,19 @@ const submit = () => {
padding: 0 7px;
vertical-align: bottom;
}
.sc-cron-num {
text-align: center;
margin-bottom: 15px;
width: 100%;
}
.sc-cron-num h2 {
font-size: 12px;
margin-bottom: 15px;
font-weight: normal;
}
.sc-cron-num h4 {
display: block;
height: 32px;
@ -988,13 +993,16 @@ const submit = () => {
background: var(--el-color-primary-light-9);
border-radius: 4px;
}
.sc-cron:deep(.el-tabs__item.is-active) .sc-cron-num h4 {
background: var(--el-color-primary);
color: #fff;
}
[data-theme='dark'] .sc-cron-num h4 {
background: var(--el-color-white);
}
.input-with-select .el-input-group__prepend {
background-color: var(--el-fill-color-blank);
}

View File

@ -2,26 +2,26 @@
<div>
<Dialog
v-model="dialogVisible"
:title="t('cropper.modalTitle')"
width="800px"
maxHeight="380px"
:canFullscreen="false"
:title="t('cropper.modalTitle')"
maxHeight="380px"
width="800px"
>
<div :class="prefixCls">
<div :class="`${prefixCls}-left`">
<div :class="`${prefixCls}-cropper`">
<CropperImage
v-if="src"
:circled="circled"
:src="src"
height="300px"
:circled="circled"
@cropend="handleCropend"
@ready="handleReady"
/>
</div>
<div :class="`${prefixCls}-toolbar`">
<el-upload :fileList="[]" accept="image/*" :beforeUpload="handleBeforeUpload">
<el-upload :beforeUpload="handleBeforeUpload" :fileList="[]" accept="image/*">
<el-tooltip :content="t('cropper.selectImage')" placement="bottom">
<XButton preIcon="ant-design:upload-outlined" type="primary" />
</el-tooltip>
@ -29,64 +29,64 @@
<el-space>
<el-tooltip :content="t('cropper.btn_reset')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="ant-design:reload-outlined"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('reset')"
/>
</el-tooltip>
<el-tooltip :content="t('cropper.btn_rotate_left')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="ant-design:rotate-left-outlined"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('rotate', -45)"
/>
</el-tooltip>
<el-tooltip :content="t('cropper.btn_rotate_right')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="ant-design:rotate-right-outlined"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('rotate', 45)"
/>
</el-tooltip>
<el-tooltip :content="t('cropper.btn_scale_x')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="vaadin:arrows-long-h"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('scaleX')"
/>
</el-tooltip>
<el-tooltip :content="t('cropper.btn_scale_y')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="vaadin:arrows-long-v"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('scaleY')"
/>
</el-tooltip>
<el-tooltip :content="t('cropper.btn_zoom_in')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="ant-design:zoom-in-outlined"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('zoom', 0.1)"
/>
</el-tooltip>
<el-tooltip :content="t('cropper.btn_zoom_out')" placement="bottom">
<XButton
type="primary"
:disabled="!src"
preIcon="ant-design:zoom-out-outlined"
size="small"
:disabled="!src"
type="primary"
@click="handlerToolbar('zoom', -0.1)"
/>
</el-tooltip>
@ -95,14 +95,14 @@
</div>
<div :class="`${prefixCls}-right`">
<div :class="`${prefixCls}-preview`">
<img :src="previewSource" v-if="previewSource" :alt="t('cropper.preview')" />
<img v-if="previewSource" :alt="t('cropper.preview')" :src="previewSource" />
</div>
<template v-if="previewSource">
<div :class="`${prefixCls}-group`">
<el-avatar :src="previewSource" size="large" />
<el-avatar :src="previewSource" :size="48" />
<el-avatar :src="previewSource" :size="64" />
<el-avatar :src="previewSource" :size="80" />
<el-avatar :size="48" :src="previewSource" />
<el-avatar :size="64" :src="previewSource" />
<el-avatar :size="80" :src="previewSource" />
</div>
</template>
</div>
@ -113,7 +113,7 @@
</Dialog>
</div>
</template>
<script setup lang="ts">
<script lang="ts" name="CopperModal" setup>
import { useDesign } from '@/hooks/web/useDesign'
import { dataURLtoBlob } from '@/utils/filt'
import { useI18n } from 'vue-i18n'
@ -173,12 +173,15 @@ async function handleOk() {
const blob = dataURLtoBlob(previewSource.value)
emit('uploadSuccess', { source: previewSource.value, data: blob, filename: filename })
}
function openModal() {
dialogVisible.value = true
}
function closeModal() {
dialogVisible.value = false
}
defineExpose({ openModal, closeModal })
</script>
<style lang="scss">

View File

@ -3,14 +3,14 @@
<img
v-show="isReady"
ref="imgElRef"
:src="src"
:alt="alt"
:crossorigin="crossorigin"
:src="src"
:style="getImageStyle"
/>
</div>
</template>
<script setup lang="ts">
<script lang="ts" name="Cropper" setup>
import { CSSProperties, PropType } from 'vue'
import Cropper from 'cropperjs'
import 'cropperjs/dist/cropper.css'

View File

@ -1,17 +1,17 @@
<template>
<div class="user-info-head" @click="open()">
<img :src="sourceValue" v-if="sourceValue" class="img-circle img-lg" alt="avatar" />
<el-button :class="`${prefixCls}-upload-btn`" @click="open()" v-if="showBtn">
<img v-if="sourceValue" :src="sourceValue" alt="avatar" class="img-circle img-lg" />
<el-button v-if="showBtn" :class="`${prefixCls}-upload-btn`" @click="open()">
{{ btnText ? btnText : t('cropper.selectImage') }}
</el-button>
<CopperModal
ref="cropperModelRef"
@upload-success="handleUploadSuccess"
:srcValue="sourceValue"
@upload-success="handleUploadSuccess"
/>
</div>
</template>
<script setup lang="ts">
<script lang="ts" name="CropperAvatar" setup>
import { useDesign } from '@/hooks/web/useDesign'
import { propTypes } from '@/utils/propTypes'
@ -54,9 +54,11 @@ function handleUploadSuccess({ source, data, filename }) {
function open() {
cropperModelRef.value.openModal()
}
function close() {
cropperModelRef.value.closeModal()
}
defineExpose({
open,
close
@ -104,17 +106,21 @@ $prefix-cls: #{$namespace}--cropper-avatar;
margin: 10px auto;
}
}
.user-info-head {
position: relative;
display: inline-block;
}
.img-circle {
border-radius: 50%;
}
.img-lg {
width: 120px;
height: 120px;
}
.user-info-head:hover:after {
content: '+';
position: absolute;

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="Descriptions" setup>
import { PropType } from 'vue'
import dayjs from 'dayjs'
import { useDesign } from '@/hooks/web/useDesign'
@ -84,7 +84,7 @@ const toggleClick = () => {
<div class="flex items-center">
{{ title }}
<ElTooltip v-if="message" :content="message" placement="right">
<Icon icon="ep:warning" class="ml-5px" />
<Icon class="ml-5px" icon="ep:warning" />
</ElTooltip>
</div>
</div>
@ -95,8 +95,8 @@ const toggleClick = () => {
<div v-show="show" :class="[`${prefixCls}-content`, 'p-10px']">
<ElDescriptions
:column="props.columns"
border
:direction="mobile ? 'vertical' : 'horizontal'"
border
v-bind="getBindValue"
>
<template v-if="slots['extra']" #extra>
@ -114,8 +114,8 @@ const toggleClick = () => {
:row="{
label: item.label
}"
>{{ item.label }}</slot
>
>{{ item.label }}
</slot>
</template>
<template #default>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="Dialog" setup>
import { propTypes } from '@/utils/propTypes'
import { isNumber } from '@/utils/is'
@ -59,13 +59,13 @@ const dialogStyle = computed(() => {
<template>
<ElDialog
v-bind="getBindValue"
:fullscreen="isFullscreen"
destroy-on-close
lock-scroll
draggable
:width="width"
:close-on-click-modal="true"
:fullscreen="isFullscreen"
:width="width"
destroy-on-close
draggable
lock-scroll
v-bind="getBindValue"
>
<template #header>
<div class="flex justify-between">
@ -74,8 +74,8 @@ const dialogStyle = computed(() => {
</slot>
<Icon
v-if="fullscreen"
class="mr-22px cursor-pointer is-hover mt-2px z-10"
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
class="mr-22px cursor-pointer is-hover mt-2px z-10"
color="var(--el-color-info)"
@click="toggleFull"
/>
@ -83,7 +83,7 @@ const dialogStyle = computed(() => {
</template>
<!-- 情况一如果 scroll true说明开启滚动条 -->
<ElScrollbar :style="dialogStyle" v-if="scroll">
<ElScrollbar v-if="scroll" :style="dialogStyle">
<slot></slot>
</ElScrollbar>
<!-- 情况二如果 scroll false说明关闭滚动条滚动条 -->

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="EChart" setup>
import type { EChartsOption } from 'echarts'
import echarts from '@/plugins/echarts'
import { debounce } from 'lodash-es'

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
<script lang="ts" name="Editor" setup>
import { PropType } from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { IDomEditor, IEditorConfig, i18nChangeLanguage } from '@wangeditor/editor'
import { i18nChangeLanguage, IDomEditor, IEditorConfig } from '@wangeditor/editor'
import { propTypes } from '@/utils/propTypes'
import { isNumber } from '@/utils/is'
import { ElMessage } from 'element-plus'
@ -188,8 +188,8 @@ defineExpose({
<!-- 编辑器 -->
<Editor
v-model="valueHtml"
:editorId="editorId"
:defaultConfig="editorConfig"
:editorId="editorId"
:style="editorStyle"
@on-change="handleChange"
@on-created="handleCreated"

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="Error" setup>
import pageError from '@/assets/svgs/404.svg'
import networkError from '@/assets/svgs/500.svg'
import noPermission from '@/assets/svgs/403.svg'
@ -46,7 +46,7 @@ const btnClick = () => {
<template>
<div class="flex justify-center">
<div class="text-center">
<img width="350" :src="errorMap[type].url" alt="" />
<img :src="errorMap[type].url" alt="" width="350" />
<div class="text-14px text-[var(--el-color-info)]">{{ errorMap[type].message }}</div>
<div class="mt-20px">
<ElButton type="primary" @click="btnClick">{{ errorMap[type].buttonText }}</ElButton>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="IFrame" setup>
import { propTypes } from '@/utils/propTypes'
const props = defineProps({
@ -20,11 +20,11 @@ onMounted(() => {
<template>
<div v-loading="loading" :style="'height:' + height">
<iframe
ref="frameRef"
:src="props.src"
style="width: 100%; height: 100%"
frameborder="no"
scrolling="auto"
ref="frameRef"
style="width: 100%; height: 100%"
></iframe>
</div>
</template>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="Icon" setup>
import { propTypes } from '@/utils/propTypes'
import Iconify from '@purge-icons/generated'
import { useDesign } from '@/hooks/web/useDesign'
@ -72,7 +72,7 @@ watch(
<template>
<ElIcon :class="prefixCls" :color="color" :size="size">
<svg v-if="isLocal" aria-hidden="true" :class="getSvgClass">
<svg v-if="isLocal" :class="getSvgClass" aria-hidden="true">
<use :xlink:href="symbolId" />
</svg>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="IconSelect" setup>
import { CSSProperties } from 'vue'
import { cloneDeep } from 'lodash-es'
import { IconJson } from '@/components/Icon/src/data'
@ -116,13 +116,13 @@ watch(
<ElInput v-model="inputValue" @click="visible = !visible">
<template #append>
<ElPopover
:width="350"
trigger="click"
popper-class="pure-popper"
:popper-options="{
placement: 'auto'
}"
:visible="visible"
:width="350"
popper-class="pure-popper"
trigger="click"
>
<template #reference>
<div
@ -133,7 +133,7 @@ watch(
</div>
</template>
<ElInput class="p-2" v-model="filterValue" placeholder="搜索图标" clearable />
<ElInput v-model="filterValue" class="p-2" clearable placeholder="搜索图标" />
<ElDivider border-style="dashed" />
<ElTabs v-model="currentActiveType" @tab-click="handleClick">
@ -143,15 +143,15 @@ watch(
:label="pane.label"
:name="pane.name"
>
<ElDivider class="tab-divider" border-style="dashed" />
<ElDivider border-style="dashed" class="tab-divider" />
<ElScrollbar height="220px">
<ul class="flex flex-wrap px-2 ml-2">
<li
v-for="(item, key) in pageList"
:key="key"
:style="iconItemStyle(item)"
:title="item"
class="icon-item p-2 w-1/10 cursor-pointer mr-2 mt-1 flex justify-center items-center border border-solid"
:style="iconItemStyle(item)"
@click="onChangeIcon(item)"
>
<Icon :icon="currentActiveType + item" />
@ -163,13 +163,13 @@ watch(
<ElDivider border-style="dashed" />
<ElPagination
small
:total="iconCount"
:page-size="pageSize"
:current-page="currentPage"
:page-size="pageSize"
:total="iconCount"
background
layout="prev, pager, next"
class="flex items-center justify-center h-10"
layout="prev, pager, next"
small
@current-change="onCurrentChange"
/>
</ElPopover>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="ImageViewer" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="InfoTip" setup>
import { PropType } from 'vue'
import { useDesign } from '@/hooks/web/useDesign'
import { propTypes } from '@/utils/propTypes'
@ -34,14 +34,14 @@ const keyClick = (key: string) => {
]"
>
<div v-if="title" :class="[`${prefixCls}__header`, 'flex items-center']">
<Icon icon="ep:warning-filled" :size="22" color="var(--el-color-primary)" />
<Icon :size="22" color="var(--el-color-primary)" icon="ep:warning-filled" />
<span :class="[`${prefixCls}__title`, 'pl-5px text-16px font-bold']">{{ title }}</span>
</div>
<div :class="`${prefixCls}__content`">
<p v-for="(item, $index) in schema" :key="$index" class="text-14px mt-15px">
<Highlight
:keys="typeof item === 'string' ? [] : item.keys"
:color="highlightColor"
:keys="typeof item === 'string' ? [] : item.keys"
@click="keyClick"
>
{{ showIndex ? `${$index + 1}` : '' }}{{ typeof item === 'string' ? item : item.label }}

View File

@ -1,8 +1,8 @@
<script setup lang="ts">
<script lang="ts" name="InputPassword" setup>
import { propTypes } from '@/utils/propTypes'
import { useConfigGlobal } from '@/hooks/web/useConfigGlobal'
import { zxcvbn } from '@zxcvbn-ts/core'
import type { ZxcvbnResult } from '@zxcvbn-ts/core'
import { zxcvbn } from '@zxcvbn-ts/core'
import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls } = useDesign()
@ -57,9 +57,9 @@ const getIconName = computed(() => (unref(textType) === 'password' ? 'ep:hide' :
<template>
<div :class="[prefixCls, `${prefixCls}--${configGlobal?.size}`]">
<ElInput v-bind="$attrs" v-model="valueRef" :type="textType">
<ElInput v-model="valueRef" :type="textType" v-bind="$attrs">
<template #suffix>
<Icon class="el-input__icon cursor-pointer" :icon="getIconName" @click="changeTextType" />
<Icon :icon="getIconName" class="el-input__icon cursor-pointer" @click="changeTextType" />
</template>
</ElInput>
<div

View File

@ -2,19 +2,19 @@
<template>
<el-pagination
v-show="total > 0"
class="float-right mt-15px mb-15px"
:background="true"
layout="total, sizes, prev, pager, next, jumper"
:page-sizes="[10, 20, 30, 50, 100]"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:background="true"
:page-sizes="[10, 20, 30, 50, 100]"
:pager-count="pagerCount"
:total="total"
class="float-right mt-15px mb-15px"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</template>
<script setup>
<script name="Pagination" setup>
import { computed } from 'vue'
const props = defineProps({

View File

@ -1,7 +1,6 @@
<script setup lang="ts">
import { PropType, nextTick, ref, watch, computed, unref } from 'vue'
import QRCode from 'qrcode'
import { QRCodeRenderersOptions } from 'qrcode'
<script lang="ts" name="Qrcode" setup>
import { computed, nextTick, PropType, ref, unref, watch } from 'vue'
import QRCode, { QRCodeRenderersOptions } from 'qrcode'
import { cloneDeep } from 'lodash-es'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
@ -230,7 +229,7 @@ const disabledClick = () => {
@click="disabledClick"
>
<div class="absolute top-[50%] left-[50%] font-bold">
<Icon icon="ep:refresh-right" :size="30" color="var(--el-color-primary)" />
<Icon :size="30" color="var(--el-color-primary)" icon="ep:refresh-right" />
<div>{{ disabledText }}</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="Search" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
@ -100,25 +100,25 @@ const setVisible = () => {
<template>
<!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 -->
<Form
:is-custom="false"
:label-width="labelWidth"
hide-required-asterisk
:inline="inline"
:is-col="isCol"
:is-custom="false"
:label-width="labelWidth"
:schema="newSchema"
@register="register"
class="-mb-15px"
hide-required-asterisk
@register="register"
>
<template #action>
<div v-if="layout === 'inline'">
<!-- update by 芋艿去除搜索的 type="primary"颜色变淡一点 -->
<ElButton v-if="showSearch" @click="search">
<Icon icon="ep:search" class="mr-5px" />
<Icon class="mr-5px" icon="ep:search" />
{{ t('common.query') }}
</ElButton>
<!-- update by 芋艿 icon="ep:refresh-right" 修改成 icon="ep:refresh" ruoyi-vue 搜索保持一致 -->
<ElButton v-if="showReset" @click="reset">
<Icon icon="ep:refresh" class="mr-5px" />
<Icon class="mr-5px" icon="ep:refresh" />
{{ t('common.reset') }}
</ElButton>
<ElButton v-if="expand" text @click="setVisible">
@ -129,19 +129,19 @@ const setVisible = () => {
<slot name="actionMore"></slot>
</div>
</template>
<template #[name] v-for="name in Object.keys($slots)" :key="name"
><slot :name="name"></slot
></template>
<template v-for="name in Object.keys($slots)" :key="name" #[name]>
<slot :name="name"></slot>
</template>
</Form>
<template v-if="layout === 'bottom'">
<div :style="bottonButtonStyle">
<ElButton v-if="showSearch" type="primary" @click="search">
<Icon icon="ep:search" class="mr-5px" />
<Icon class="mr-5px" icon="ep:search" />
{{ t('common.query') }}
</ElButton>
<ElButton v-if="showReset" @click="reset">
<Icon icon="ep:refresh-right" class="mr-5px" />
<Icon class="mr-5px" icon="ep:refresh-right" />
{{ t('common.reset') }}
</ElButton>
<ElButton v-if="expand" text @click="setVisible">

View File

@ -1,7 +1,8 @@
<script setup lang="ts">
<script lang="ts" name="Sticky" setup>
import { propTypes } from '@/utils/propTypes'
import { isClient, useEventListener, useWindowSize } from '@vueuse/core'
import type { CSSProperties } from 'vue'
const props = defineProps({
// 距离顶部或者底部的距离(单位px)
offset: propTypes.number.def(0),
@ -120,7 +121,7 @@ const reset = () => {
}
</script>
<template>
<div :style="{ height: height, zIndex: zIndex }" ref="refSticky">
<div ref="refSticky" :style="{ height: height, zIndex: zIndex }">
<div
:class="className"
:style="{

View File

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

View File

@ -1,42 +1,42 @@
<template>
<div :class="mode == 'pop' ? 'mask' : ''" v-show="showBox">
<div v-show="showBox" :class="mode == 'pop' ? 'mask' : ''">
<div
:class="mode == 'pop' ? 'verifybox' : ''"
:style="{ 'max-width': parseInt(imgSize.width) + 20 + 'px' }"
>
<div class="verifybox-top" v-if="mode == 'pop'">
<div v-if="mode == 'pop'" class="verifybox-top">
{{ t('captcha.verification') }}
<span class="verifybox-close" @click="closeBox">
<i class="iconfont icon-close"></i>
</span>
</div>
<div class="verifybox-bottom" :style="{ padding: mode == 'pop' ? '10px' : '0' }">
<div :style="{ padding: mode == 'pop' ? '10px' : '0' }" class="verifybox-bottom">
<!-- 验证码容器 -->
<component
v-if="componentType"
:is="componentType"
:captchaType="captchaType"
:type="verifyType"
:figure="figure"
:arith="arith"
:mode="mode"
:vSpace="vSpace"
:explain="explain"
:imgSize="imgSize"
:blockSize="blockSize"
:barSize="barSize"
v-if="componentType"
ref="instance"
:arith="arith"
:barSize="barSize"
:blockSize="blockSize"
:captchaType="captchaType"
:explain="explain"
:figure="figure"
:imgSize="imgSize"
:mode="mode"
:type="verifyType"
:vSpace="vSpace"
/>
</div>
</div>
</div>
</template>
<script type="text/babel">
<script name="Verify" type="text/babel">
/**
* Verify 验证码组件
* @description 分发验证码使用
* */
import { VerifySlide, VerifyPoints } from './Verify'
import { VerifyPoints, VerifySlide } from './Verify'
import { computed, ref, toRefs, watchEffect } from 'vue'
export default {
@ -155,6 +155,7 @@ export default {
border-radius: 5px;
transform: translate(-50%, -50%);
}
.verifybox-top {
padding: 0 15px;
height: 40px;
@ -165,10 +166,12 @@ export default {
border-bottom: 1px solid #e4e7eb;
box-sizing: border-box;
}
.verifybox-bottom {
padding: 10px;
box-sizing: border-box;
}
.verifybox-close {
position: absolute;
top: 13px;
@ -178,6 +181,7 @@ export default {
text-align: center;
cursor: pointer;
}
.mask {
position: fixed;
top: 0;
@ -189,6 +193,7 @@ export default {
/* display: none; */
transition: all 0.5s;
}
.verify-tips {
text-indent: 10px;
position: absolute;
@ -199,22 +204,27 @@ export default {
line-height: 30px;
color: #fff;
}
.suc-bg {
background-color: rgba(92, 184, 92, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#7f5CB85C, endcolorstr=#7f5CB85C);
}
.err-bg {
background-color: rgba(217, 83, 79, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#7fD9534F, endcolorstr=#7fD9534F);
}
.tips-enter,
.tips-leave-to {
bottom: -30px;
}
.tips-enter-active,
.tips-leave-active {
transition: bottom 0.5s;
}
/* ---------------------------- */
/*常规验证码*/
.verify-code {

View File

@ -2,20 +2,20 @@
<div style="position: relative">
<div class="verify-img-out">
<div
class="verify-img-panel"
:style="{
width: setSize.imgWidth,
height: setSize.imgHeight,
'background-size': setSize.imgWidth + ' ' + setSize.imgHeight,
'margin-bottom': vSpace + 'px'
}"
class="verify-img-panel"
>
<div class="verify-refresh" style="z-index: 3" @click="refresh" v-show="showRefresh">
<div v-show="showRefresh" class="verify-refresh" style="z-index: 3" @click="refresh">
<i class="iconfont icon-refresh"></i>
</div>
<img
:src="'data:image/png;base64,' + pointBackImgBase"
ref="canvas"
:src="'data:image/png;base64,' + pointBackImgBase"
alt=""
style="width: 100%; height: 100%; display: block"
@click="bindingClick ? canvasClick($event) : undefined"
@ -24,7 +24,6 @@
<div
v-for="(tempPoint, index) in tempPoints"
:key="index"
class="point-area"
:style="{
'background-color': '#1abd6c',
color: '#fff',
@ -38,6 +37,7 @@
top: parseInt(tempPoint.y - 10) + 'px',
left: parseInt(tempPoint.x - 10) + 'px'
}"
class="point-area"
>
{{ index + 1 }}
</div>
@ -45,19 +45,19 @@
</div>
<!-- 'height': this.barSize.height, -->
<div
class="verify-bar-area"
:style="{
width: setSize.imgWidth,
color: barAreaColor,
'border-color': barAreaBorderColor,
'line-height': barSize.height
}"
class="verify-bar-area"
>
<span class="verify-msg">{{ text }}</span>
</div>
</div>
</template>
<script type="text/babel" setup>
<script name="VerifyPoints" setup type="text/babel">
/**
* VerifyPoints
* @description 点选
@ -65,7 +65,7 @@
import { resetSize } from './../utils/util'
import { aesEncrypt } from './../utils/ase'
import { getCode, reqCheck } from '@/api/login'
import { onMounted, reactive, ref, nextTick, toRefs, getCurrentInstance } from 'vue'
import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs } from 'vue'
const props = defineProps({
//弹出式pop固定fixed

View File

@ -2,20 +2,20 @@
<div style="position: relative">
<div
v-if="type === '2'"
class="verify-img-out"
:style="{ height: parseInt(setSize.imgHeight) + vSpace + 'px' }"
class="verify-img-out"
>
<div class="verify-img-panel" :style="{ width: setSize.imgWidth, height: setSize.imgHeight }">
<div :style="{ width: setSize.imgWidth, height: setSize.imgHeight }" class="verify-img-panel">
<img
:src="'data:image/png;base64,' + backImgBase"
alt=""
style="width: 100%; height: 100%; display: block"
/>
<div class="verify-refresh" @click="refresh" v-show="showRefresh">
<div v-show="showRefresh" class="verify-refresh" @click="refresh">
<i class="iconfont icon-refresh"></i>
</div>
<transition name="tips">
<span class="verify-tips" v-if="tipWords" :class="passFlag ? 'suc-bg' : 'err-bg'">
<span v-if="tipWords" :class="passFlag ? 'suc-bg' : 'err-bg'" class="verify-tips">
{{ tipWords }}
</span>
</transition>
@ -23,24 +23,21 @@
</div>
<!-- 公共部分 -->
<div
class="verify-bar-area"
:style="{ width: setSize.imgWidth, height: barSize.height, 'line-height': barSize.height }"
class="verify-bar-area"
>
<span class="verify-msg" v-text="text"></span>
<div
class="verify-left-bar"
:style="{
width: leftBarWidth !== undefined ? leftBarWidth : barSize.height,
height: barSize.height,
'border-color': leftBarBorderColor,
transaction: transitionWidth
}"
class="verify-left-bar"
>
<span class="verify-msg" v-text="finishText"></span>
<div
class="verify-move-block"
@touchstart="start"
@mousedown="start"
:style="{
width: barSize.height,
height: barSize.height,
@ -48,17 +45,20 @@
left: moveBlockLeft,
transition: transitionLeft
}"
class="verify-move-block"
@mousedown="start"
@touchstart="start"
>
<i :class="['verify-icon iconfont', iconClass]" :style="{ color: iconColor }"></i>
<div
v-if="type === '2'"
class="verify-sub-block"
:style="{
width: Math.floor((parseInt(setSize.imgWidth) * 47) / 310) + 'px',
height: setSize.imgHeight,
top: '-' + (parseInt(setSize.imgHeight) + vSpace) + 'px',
'background-size': setSize.imgWidth + ' ' + setSize.imgHeight
}"
class="verify-sub-block"
>
<img
:src="'data:image/png;base64,' + blockBackImgBase"
@ -71,7 +71,7 @@
</div>
</div>
</template>
<script type="text/babel" setup>
<script name="VerifySlide" setup type="text/babel">
/**
* VerifySlide
* @description 滑块

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="XButton" setup>
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
@ -30,9 +30,9 @@ const getBindValue = computed(() => {
<template>
<el-button v-bind="getBindValue" @click="onClick">
<Icon :icon="preIcon" v-if="preIcon" class="mr-1px" />
<Icon v-if="preIcon" :icon="preIcon" class="mr-1px" />
{{ title ? title : '' }}
<Icon :icon="postIcon" v-if="postIcon" class="mr-1px" />
<Icon v-if="postIcon" :icon="postIcon" class="mr-1px" />
</el-button>
</template>
<style lang="scss" scoped>
@ -40,6 +40,7 @@ const getBindValue = computed(() => {
margin-left: 0;
padding: 8px 4px;
}
:deep(.el-button.is-link) {
margin-left: 0;
padding: 8px 4px;

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" name="XTextButton" setup>
import { propTypes } from '@/utils/propTypes'
import { PropType } from 'vue'
@ -29,9 +29,9 @@ const getBindValue = computed(() => {
<template>
<el-button link v-bind="getBindValue" @click="onClick">
<Icon :icon="preIcon" v-if="preIcon" class="mr-1px" />
<Icon v-if="preIcon" :icon="preIcon" class="mr-1px" />
{{ title ? title : '' }}
<Icon :icon="postIcon" v-if="postIcon" class="mr-1px" />
<Icon v-if="postIcon" :icon="postIcon" class="mr-1px" />
</el-button>
</template>
<style lang="scss" scoped>
@ -39,6 +39,7 @@ const getBindValue = computed(() => {
margin-left: 0;
padding: 8px 4px;
}
:deep(.el-button.is-link) {
margin-left: 0;
padding: 8px 4px;