refactor: vue3.3 defineOptions

This commit is contained in:
shizhong 2023-09-22 14:00:50 +08:00
parent 20f483f561
commit 7e5ad60d1d
23 changed files with 122 additions and 104 deletions

View File

@ -968,37 +968,37 @@ const submit = () => {
<style scoped> <style scoped>
.sc-cron:deep(.el-tabs__item) { .sc-cron:deep(.el-tabs__item) {
height: auto; height: auto;
line-height: 1;
padding: 0 7px; padding: 0 7px;
line-height: 1;
vertical-align: bottom; vertical-align: bottom;
} }
.sc-cron-num { .sc-cron-num {
text-align: center;
margin-bottom: 15px;
width: 100%; width: 100%;
margin-bottom: 15px;
text-align: center;
} }
.sc-cron-num h2 { .sc-cron-num h2 {
font-size: 12px;
margin-bottom: 15px; margin-bottom: 15px;
font-size: 12px;
font-weight: normal; font-weight: normal;
} }
.sc-cron-num h4 { .sc-cron-num h4 {
display: block; display: block;
height: 32px;
line-height: 30px;
width: 100%; width: 100%;
font-size: 12px; height: 32px;
padding: 0 15px; padding: 0 15px;
font-size: 12px;
line-height: 30px;
background: var(--el-color-primary-light-9); background: var(--el-color-primary-light-9);
border-radius: 4px; border-radius: 4px;
} }
.sc-cron:deep(.el-tabs__item.is-active) .sc-cron-num h4 { .sc-cron:deep(.el-tabs__item.is-active) .sc-cron-num h4 {
background: var(--el-color-primary);
color: #fff; color: #fff;
background: var(--el-color-primary);
} }
[data-theme='dark'] .sc-cron-num h4 { [data-theme='dark'] .sc-cron-num h4 {

View File

@ -2,6 +2,7 @@
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { isNumber } from '@/utils/is' import { isNumber } from '@/utils/is'
// eslint-disable-next-line vue/no-reserved-component-names
defineOptions({ name: 'Dialog' }) defineOptions({ name: 'Dialog' })
const slots = useSlots() const slots = useSlots()

View File

@ -27,8 +27,8 @@ const getEnable = () => {
</script> </script>
<style scoped> <style scoped>
.el-alert--success.is-light { .el-alert--success.is-light {
border: 1px solid green;
margin-bottom: 10px; margin-bottom: 10px;
cursor: pointer; cursor: pointer;
border: 1px solid green;
} }
</style> </style>

View File

@ -191,10 +191,10 @@ watch(
.icon-item { .icon-item {
&:hover { &:hover {
border-color: var(--el-color-primary);
color: var(--el-color-primary); color: var(--el-color-primary);
transition: all 0.4s; border-color: var(--el-color-primary);
transform: scaleX(1.05); transform: scaleX(1.05);
transition: all 0.4s;
} }
} }
@ -215,15 +215,15 @@ watch(
} }
:deep(.el-tabs__item) { :deep(.el-tabs__item) {
height: 30px;
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: normal;
height: 30px;
line-height: 30px; line-height: 30px;
} }
:deep(.el-tabs__header), :deep(.el-tabs__header),
:deep(.el-tabs__nav-wrap) { :deep(.el-tabs__nav-wrap) {
margin: 0;
position: static; position: static;
margin: 0;
} }
</style> </style>

View File

@ -96,7 +96,7 @@ $prefix-cls: #{$namespace}-input-password;
background-color: transparent; background-color: transparent;
border-color: var(--el-color-white); border-color: var(--el-color-white);
border-style: solid; border-style: solid;
border-width: 0 5px 0 5px; border-width: 0 5px;
content: ''; content: '';
} }

View File

@ -243,7 +243,7 @@ $prefix-cls: #{$namespace}-qrcode;
.#{$prefix-cls} { .#{$prefix-cls} {
&--disabled { &--disabled {
background: rgba(255, 255, 255, 0.95); background: rgb(255 255 255 / 95%);
& > div { & > div {
transform: translate(-50%, -50%); transform: translate(-50%, -50%);

View File

@ -145,21 +145,25 @@ const listToString = (list: UploadUserFile[], separator?: string) => {
.upload-file-uploader { .upload-file-uploader {
margin-bottom: 5px; margin-bottom: 5px;
} }
:deep(.upload-file-list .el-upload-list__item) { :deep(.upload-file-list .el-upload-list__item) {
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
line-height: 2; line-height: 2;
margin-bottom: 10px; margin-bottom: 10px;
position: relative; position: relative;
} }
:deep(.el-upload-list__item-file-name) { :deep(.el-upload-list__item-file-name) {
max-width: 250px; max-width: 250px;
} }
:deep(.upload-file-list .ele-upload-list__item-content) { :deep(.upload-file-list .ele-upload-list__item-content) {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
color: inherit; color: inherit;
} }
:deep(.ele-upload-list__item-content-action .el-link) { :deep(.ele-upload-list__item-content-action .el-link) {
margin-right: 10px; margin-right: 10px;
} }

View File

@ -81,7 +81,7 @@ const props = defineProps({
fileType: propTypes.array.def(['image/jpeg', 'image/png', 'image/gif']), // ==> ["image/jpeg", "image/png", "image/gif"] fileType: propTypes.array.def(['image/jpeg', 'image/png', 'image/gif']), // ==> ["image/jpeg", "image/png", "image/gif"]
height: propTypes.string.def('150px'), // ==> 150px height: propTypes.string.def('150px'), // ==> 150px
width: propTypes.string.def('150px'), // ==> 150px width: propTypes.string.def('150px'), // ==> 150px
borderRadius: propTypes.string.def('8px') // ==> 8px borderradius: propTypes.string.def('8px') // ==> 8px
}) })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -132,29 +132,34 @@ const uploadError = () => {
:deep(.el-upload), :deep(.el-upload),
:deep(.el-upload-dragger) { :deep(.el-upload-dragger) {
border: 1px dashed var(--el-color-danger) !important; border: 1px dashed var(--el-color-danger) !important;
&:hover { &:hover {
border-color: var(--el-color-primary) !important; border-color: var(--el-color-primary) !important;
} }
} }
} }
} }
:deep(.disabled) { :deep(.disabled) {
.el-upload, .el-upload,
.el-upload-dragger { .el-upload-dragger {
cursor: not-allowed !important; cursor: not-allowed !important;
background: var(--el-disabled-bg-color); background: var(--el-disabled-bg-color);
border: 1px dashed var(--el-border-color-darker) !important; border: 1px dashed var(--el-border-color-darker) !important;
&:hover { &:hover {
border: 1px dashed var(--el-border-color-darker) !important; border: 1px dashed var(--el-border-color-darker) !important;
} }
} }
} }
.upload-box { .upload-box {
.no-border { .no-border {
:deep(.el-upload) { :deep(.el-upload) {
border: none !important; border: none !important;
} }
} }
:deep(.upload) { :deep(.upload) {
.el-upload { .el-upload {
position: relative; position: relative;
@ -165,14 +170,17 @@ const uploadError = () => {
height: v-bind(height); height: v-bind(height);
overflow: hidden; overflow: hidden;
border: 1px dashed var(--el-border-color-darker); border: 1px dashed var(--el-border-color-darker);
border-radius: v-bind(borderRadius); border-radius: v-bind(borderradius);
transition: var(--el-transition-duration-fast); transition: var(--el-transition-duration-fast);
&:hover { &:hover {
border-color: var(--el-color-primary); border-color: var(--el-color-primary);
.upload-handle { .upload-handle {
opacity: 1; opacity: 1;
} }
} }
.el-upload-dragger { .el-upload-dragger {
display: flex; display: flex;
align-items: center; align-items: center;
@ -183,20 +191,24 @@ const uploadError = () => {
overflow: hidden; overflow: hidden;
background-color: transparent; background-color: transparent;
border: 1px dashed var(--el-border-color-darker); border: 1px dashed var(--el-border-color-darker);
border-radius: v-bind(borderRadius); border-radius: v-bind(borderradius);
&:hover { &:hover {
border: 1px dashed var(--el-color-primary); border: 1px dashed var(--el-color-primary);
} }
} }
.el-upload-dragger.is-dragover { .el-upload-dragger.is-dragover {
background-color: var(--el-color-primary-light-9); background-color: var(--el-color-primary-light-9);
border: 2px dashed var(--el-color-primary) !important; border: 2px dashed var(--el-color-primary) !important;
} }
.upload-image { .upload-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
.upload-empty { .upload-empty {
position: relative; position: relative;
display: flex; display: flex;
@ -206,11 +218,13 @@ const uploadError = () => {
font-size: 12px; font-size: 12px;
line-height: 30px; line-height: 30px;
color: var(--el-color-info); color: var(--el-color-info);
.el-icon { .el-icon {
font-size: 28px; font-size: 28px;
color: var(--el-text-color-secondary); color: var(--el-text-color-secondary);
} }
} }
.upload-handle { .upload-handle {
position: absolute; position: absolute;
top: 0; top: 0;
@ -225,6 +239,7 @@ const uploadError = () => {
background: rgb(0 0 0 / 60%); background: rgb(0 0 0 / 60%);
opacity: 0; opacity: 0;
transition: var(--el-transition-duration-fast); transition: var(--el-transition-duration-fast);
.handle-icon { .handle-icon {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -232,11 +247,13 @@ const uploadError = () => {
justify-content: center; justify-content: center;
padding: 0 6%; padding: 0 6%;
color: aliceblue; color: aliceblue;
.el-icon { .el-icon {
margin-bottom: 40%; margin-bottom: 40%;
font-size: 130%; font-size: 130%;
line-height: 130%; line-height: 130%;
} }
span { span {
font-size: 85%; font-size: 85%;
line-height: 85%; line-height: 85%;
@ -245,6 +262,7 @@ const uploadError = () => {
} }
} }
} }
.el-upload__tip { .el-upload__tip {
line-height: 18px; line-height: 18px;
text-align: center; text-align: center;

View File

@ -82,7 +82,7 @@ const props = defineProps({
fileType: propTypes.array.def(['image/jpeg', 'image/png', 'image/gif']), // ==> ["image/jpeg", "image/png", "image/gif"] fileType: propTypes.array.def(['image/jpeg', 'image/png', 'image/gif']), // ==> ["image/jpeg", "image/png", "image/gif"]
height: propTypes.string.def('150px'), // ==> 150px height: propTypes.string.def('150px'), // ==> 150px
width: propTypes.string.def('150px'), // ==> 150px width: propTypes.string.def('150px'), // ==> 150px
borderRadius: propTypes.string.def('8px') // ==> 8px borderradius: propTypes.string.def('8px') // ==> 8px
}) })
const uploadHeaders = ref({ const uploadHeaders = ref({
@ -90,7 +90,7 @@ const uploadHeaders = ref({
'tenant-id': getTenantId() 'tenant-id': getTenantId()
}) })
const fileList = ref<UploadUserFile[]>() const fileList = ref<UploadUserFile[]>([])
// fix: // fix:
watch( watch(
() => props.modelValue, () => props.modelValue,
@ -218,7 +218,7 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
border: 1px dashed var(--el-border-color-darker); border: 1px dashed var(--el-border-color-darker);
border-radius: v-bind(borderRadius); border-radius: v-bind(borderradius);
&:hover { &:hover {
border: 1px dashed var(--el-color-primary); border: 1px dashed var(--el-color-primary);
@ -235,7 +235,7 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
width: v-bind(width); width: v-bind(width);
height: v-bind(height); height: v-bind(height);
background-color: transparent; background-color: transparent;
border-radius: v-bind(borderRadius); border-radius: v-bind(borderradius);
} }
.upload-image { .upload-image {

File diff suppressed because one or more lines are too long

View File

@ -7,8 +7,9 @@
href="https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B" href="https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B"
type="danger" type="danger"
target="_blank" target="_blank"
>如何实现实现会签或签</el-link
> >
如何实现实现会签或签
</el-link>
<el-form-item label="流程标识" prop="id"> <el-form-item label="流程标识" prop="id">
<el-input <el-input
v-model="needProps.id" v-model="needProps.id"

View File

@ -6,17 +6,18 @@
<el-table-column label="属性值" prop="value" min-width="100px" show-overflow-tooltip /> <el-table-column label="属性值" prop="value" min-width="100px" show-overflow-tooltip />
<el-table-column label="操作" width="110px"> <el-table-column label="操作" width="110px">
<template #default="scope"> <template #default="scope">
<el-button link @click="openAttributesForm(scope.row, scope.$index)" size="small" <el-button link @click="openAttributesForm(scope.row, scope.$index)" size="small">
>编辑</el-button 编辑
> </el-button>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<el-button <el-button
link link
size="small" size="small"
style="color: #ff4d4f" style="color: #ff4d4f"
@click="removeAttributes(scope.row, scope.$index)" @click="removeAttributes(scope.row, scope.$index)"
>移除</el-button
> >
移除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="panel-tab__content"> <div class="panel-tab__content">
<div class="panel-tab__content--title"> <div class="panel-tab__content--title">
<span><Icon icon="ep:menu" style="margin-right: 8px; color: #555555" />消息列表</span> <span><Icon icon="ep:menu" style="margin-right: 8px; color: #555" />消息列表</span>
<XButton type="primary" title="创建新消息" preIcon="ep:plus" @click="openModel('message')" /> <XButton type="primary" title="创建新消息" preIcon="ep:plus" @click="openModel('message')" />
</div> </div>
<el-table :data="messageList" border> <el-table :data="messageList" border>
@ -11,9 +11,9 @@
</el-table> </el-table>
<div <div
class="panel-tab__content--title" class="panel-tab__content--title"
style="padding-top: 8px; margin-top: 8px; border-top: 1px solid #eeeeee" style="padding-top: 8px; margin-top: 8px; border-top: 1px solid #eee"
> >
<span><Icon icon="ep:menu" style="margin-right: 8px; color: #555555" />信号列表</span> <span><Icon icon="ep:menu" style="margin-right: 8px; color: #555" />信号列表</span>
<XButton type="primary" title="创建新信号" preIcon="ep:plus" @click="openModel('signal')" /> <XButton type="primary" title="创建新信号" preIcon="ep:plus" @click="openModel('signal')" />
</div> </div>
<el-table :data="signalList" border> <el-table :data="signalList" border>

View File

@ -68,7 +68,7 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
border: 2px solid #e5e7eb; border: 2px solid #e5e7eb;
border-radius: 4px; border-radius: 4px;
&:before { &::before {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -80,14 +80,14 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
content: ''; content: '';
} }
&:after { &::after {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 25%; height: 25%;
background-color: #fff; background-color: #fff;
border-radius: 4px 4px 0 4px; border-radius: 4px 4px 0;
content: ''; content: '';
} }
} }
@ -96,7 +96,7 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
border: 2px solid #e5e7eb; border: 2px solid #e5e7eb;
border-radius: 4px; border-radius: 4px;
&:before { &::before {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -108,7 +108,7 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
content: ''; content: '';
} }
&:after { &::after {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -124,7 +124,7 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
border: 2px solid #e5e7eb; border: 2px solid #e5e7eb;
border-radius: 4px; border-radius: 4px;
&:before { &::before {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -141,7 +141,7 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
border: 2px solid #e5e7eb; border: 2px solid #e5e7eb;
border-radius: 4px; border-radius: 4px;
&:before { &::before {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -153,7 +153,7 @@ $prefix-cls: #{$namespace}-layout-radio-picker;
content: ''; content: '';
} }
&:after { &::after {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;

View File

@ -1,6 +1,8 @@
<template> <template>
<Error type="403" @error-click="push('/')" /> <Error type="403" @error-click="push('/')" />
</template> </template>
<script lang="ts" name="Error403" setup> <script lang="ts" setup>
defineOptions({ name: 'Error403' })
const { push } = useRouter() const { push } = useRouter()
</script> </script>

View File

@ -1,6 +1,8 @@
<template> <template>
<Error @error-click="push('/')" /> <Error @error-click="push('/')" />
</template> </template>
<script lang="ts" name="Error404" setup> <script lang="ts" setup>
defineOptions({ name: 'Error404' })
const { push } = useRouter() const { push } = useRouter()
</script> </script>

View File

@ -1,6 +1,8 @@
<template> <template>
<Error type="500" @error-click="push('/')" /> <Error type="500" @error-click="push('/')" />
</template> </template>
<script lang="ts" name="Error500" setup> <script lang="ts" setup>
defineOptions({ name: 'Error500' })
const { push } = useRouter() const { push } = useRouter()
</script> </script>

View File

@ -14,8 +14,6 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { FormRules } from 'element-plus' import type { FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import { FormSchema } from '@/types/form' import { FormSchema } from '@/types/form'
import type { FormExpose } from '@/components/Form' import type { FormExpose } from '@/components/Form'
import { import {
@ -27,6 +25,7 @@ import {
defineOptions({ name: 'BasicInfo' }) defineOptions({ name: 'BasicInfo' })
const { t } = useI18n() const { t } = useI18n()
const message = useMessage() //
// //
const rules = reactive<FormRules>({ const rules = reactive<FormRules>({
nickname: [{ required: true, message: t('profile.rules.nickname'), trigger: 'blur' }], nickname: [{ required: true, message: t('profile.rules.nickname'), trigger: 'blur' }],
@ -78,7 +77,7 @@ const submit = () => {
if (valid) { if (valid) {
const data = unref(formRef)?.formModel as UserProfileUpdateReqVO const data = unref(formRef)?.formModel as UserProfileUpdateReqVO
await updateUserProfileApi(data) await updateUserProfileApi(data)
ElMessage.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
await init() await init()
} }
}) })

View File

@ -81,7 +81,7 @@ onMounted(async () => {
} }
.list-group { .list-group {
padding-left: 0px; padding-left: 0;
list-style: none; list-style: none;
} }
@ -89,7 +89,7 @@ onMounted(async () => {
border-bottom: 1px solid #e7eaec; border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec; border-top: 1px solid #e7eaec;
margin-bottom: -1px; margin-bottom: -1px;
padding: 11px 0px; padding: 11px 0;
font-size: 13px; font-size: 13px;
} }

View File

@ -2,7 +2,6 @@
<div></div> <div></div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
defineOptions({ name: 'Redirect' }) defineOptions({ name: 'Redirect' })
const { currentRoute, replace } = useRouter() const { currentRoute, replace } = useRouter()

View File

@ -264,6 +264,7 @@ import { PropertyAndValues } from './index'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
defineOptions({ name: 'SkuList' }) defineOptions({ name: 'SkuList' })
const message = useMessage() // const message = useMessage() //
const props = defineProps({ const props = defineProps({

View File

@ -92,7 +92,7 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<ExpressTemplateForm ref="formRef" @success="getList" /> <ExpressTemplateForm ref="formRef" @success="getList" />
</template> </template>
<script lang="ts" setup> <script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as DeliveryExpressTemplateApi from '@/api/mall/trade/delivery/expressTemplate' import * as DeliveryExpressTemplateApi from '@/api/mall/trade/delivery/expressTemplate'

View File

@ -99,7 +99,7 @@ const handleDelete = async (item: any) => {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@media (min-width: 992px) and (max-width: 1300px) { @media (width >= 992px) and (width <= 1300px) {
.waterfall { .waterfall {
column-count: 3; column-count: 3;
} }
@ -109,7 +109,7 @@ const handleDelete = async (item: any) => {
} }
} }
@media (min-width: 768px) and (max-width: 991px) { @media (width >= 768px) and (width <= 991px) {
.waterfall { .waterfall {
column-count: 2; column-count: 2;
} }
@ -119,7 +119,7 @@ const handleDelete = async (item: any) => {
} }
} }
@media (max-width: 767px) { @media (width <= 767px) {
.waterfall { .waterfall {
column-count: 1; column-count: 1;
} }