fix(ts): 收敛局部类型并删除 XButton
- 删除 XButton/XTextButton,调用点改回 el-button - ContextMenu 收窄 trigger,移除 Element Plus 不支持的 focus - RewardActivityVO 三个商品范围数组改必填,表单创建/加载/重置均初始化为 [] - SpuShowcase 恢复直接 v-model,移除 computed 中转 - MES、Demo03、Codegen 等 VO 对齐表单场景,减少局部 Omit/unknown 断言 - MP 补 SimpleTagVO,修复用户标签 never[] 问题 - Redis 图表 option 在声明处定型,模板去除 EChartsOption cast - 修复 member 统计页 fenToYuan 漏导入 ts:check 252 → 133,无新增类型错误master
parent
f4b2cc4569
commit
08abd54ca0
|
|
@ -20,6 +20,45 @@ export type CodegenTableVO = {
|
|||
parentMenuId: number
|
||||
}
|
||||
|
||||
export type CodegenTableSaveReqVO = CodegenTableVO & {
|
||||
frontType?: number | null
|
||||
genPath?: string
|
||||
genType?: string
|
||||
masterTableId?: number
|
||||
subJoinColumnId?: number
|
||||
subJoinMany?: boolean
|
||||
treeParentColumnId?: number
|
||||
treeNameColumnId?: number
|
||||
}
|
||||
|
||||
export const createEmptyCodegenTableSaveReqVO = (): CodegenTableSaveReqVO => ({
|
||||
id: 0,
|
||||
tableId: 0,
|
||||
isParentMenuIdValid: false,
|
||||
dataSourceConfigId: 0,
|
||||
scene: 0,
|
||||
tableName: '',
|
||||
tableComment: '',
|
||||
remark: '',
|
||||
moduleName: '',
|
||||
businessName: '',
|
||||
className: '',
|
||||
classComment: '',
|
||||
author: '',
|
||||
createTime: new Date(),
|
||||
updateTime: new Date(),
|
||||
templateType: 0,
|
||||
parentMenuId: 0,
|
||||
frontType: null,
|
||||
genPath: '',
|
||||
genType: '',
|
||||
masterTableId: undefined,
|
||||
subJoinColumnId: undefined,
|
||||
subJoinMany: undefined,
|
||||
treeParentColumnId: undefined,
|
||||
treeNameColumnId: undefined
|
||||
})
|
||||
|
||||
export type CodegenColumnVO = {
|
||||
id: number
|
||||
tableId: number
|
||||
|
|
@ -52,7 +91,7 @@ export type CodegenPreviewVO = {
|
|||
}
|
||||
|
||||
export type CodegenUpdateReqVO = {
|
||||
table: CodegenTableVO | any
|
||||
table: CodegenTableSaveReqVO
|
||||
columns: CodegenColumnVO[]
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +107,7 @@ export const getCodegenTablePage = (params: PageParam) => {
|
|||
|
||||
// 查询详情代码生成表定义
|
||||
export const getCodegenTable = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/detail?tableId=' + id })
|
||||
return request.get<CodegenUpdateReqVO>({ url: '/infra/codegen/detail?tableId=' + id })
|
||||
}
|
||||
|
||||
// 修改代码生成表定义
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
score?: number // 分数
|
||||
|
|
@ -11,7 +10,7 @@ export interface Demo03Course {
|
|||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
teacher?: string // 班主任
|
||||
|
|
@ -19,10 +18,10 @@ export interface Demo03Grade {
|
|||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生日期
|
||||
birthday?: string | number // 出生日期
|
||||
description?: string // 简介
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
score?: number // 分数
|
||||
|
|
@ -11,7 +10,7 @@ export interface Demo03Course {
|
|||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
teacher?: string // 班主任
|
||||
|
|
@ -19,10 +18,10 @@ export interface Demo03Grade {
|
|||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生日期
|
||||
birthday?: string | number // 出生日期
|
||||
description?: string // 简介
|
||||
demo03courses?: Demo03Course[]
|
||||
demo03grade?: Demo03Grade
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
score?: number // 分数
|
||||
|
|
@ -11,7 +10,7 @@ export interface Demo03Course {
|
|||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
teacher?: string // 班主任
|
||||
|
|
@ -19,10 +18,10 @@ export interface Demo03Grade {
|
|||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number // 编号
|
||||
id?: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生日期
|
||||
birthday?: string | number // 出生日期
|
||||
description?: string // 简介
|
||||
demo03courses?: Demo03Course[]
|
||||
demo03grade?: Demo03Grade
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ export interface CombinationActivityVO {
|
|||
id?: number
|
||||
name?: string
|
||||
spuId?: number
|
||||
spuName?: string
|
||||
picUrl?: string
|
||||
totalLimitCount?: number
|
||||
singleLimitCount?: number
|
||||
startTime?: Date
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ export interface RewardActivityVO {
|
|||
conditionType?: number
|
||||
productScope?: number
|
||||
rules: RewardRule[]
|
||||
productScopeValues: number[] // 商品范围:值为品类编号列表、商品编号列表
|
||||
// 如下仅用于表单,不提交
|
||||
productScopeValues?: number[] // 商品范围:值为品类编号列表、商品编号列表
|
||||
productCategoryIds?: number[]
|
||||
productSpuIds?: number[]
|
||||
productCategoryIds: number[]
|
||||
productSpuIds: number[]
|
||||
}
|
||||
|
||||
// 优惠规则
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export interface SeckillActivityVO {
|
|||
id?: number
|
||||
spuId?: number
|
||||
name?: string
|
||||
picUrl?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
startTime?: Date
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ import request from '@/config/axios'
|
|||
|
||||
// MES 物料产品分类 VO
|
||||
export interface MdItemTypeVO {
|
||||
id: number // 分类编号
|
||||
parentId: number // 父分类编号
|
||||
code: string // 分类编码
|
||||
name: string // 分类名称
|
||||
id?: number // 分类编号
|
||||
parentId?: number // 父分类编号
|
||||
code?: string // 分类编码
|
||||
name?: string // 分类名称
|
||||
itemOrProduct: string // 物料/产品标识
|
||||
sort: number // 显示排序
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
remark?: string // 备注
|
||||
}
|
||||
|
||||
// MES 物料产品分类 API
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ import request from '@/config/axios'
|
|||
|
||||
// MES 计量单位 VO
|
||||
export interface MdUnitMeasureVO {
|
||||
id: number // 单位编号
|
||||
code: string // 单位编码
|
||||
name: string // 单位名称
|
||||
id?: number // 单位编号
|
||||
code?: string // 单位编码
|
||||
name?: string // 单位名称
|
||||
primaryFlag: boolean // 是否主单位
|
||||
primaryId: number // 主单位编号
|
||||
changeRate: number // 与主单位换算比例
|
||||
primaryId?: number // 主单位编号
|
||||
changeRate?: number // 与主单位换算比例
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
remark?: string // 备注
|
||||
}
|
||||
|
||||
// MES 计量单位 API
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ export interface TagVO {
|
|||
createTime: Date
|
||||
}
|
||||
|
||||
export interface SimpleTagVO {
|
||||
tagId: number
|
||||
name: string
|
||||
}
|
||||
|
||||
// 创建公众号标签
|
||||
export const createTag = (data: TagVO) => {
|
||||
return request.post({
|
||||
|
|
@ -47,7 +52,7 @@ export const getTagPage = (query: PageParam) => {
|
|||
|
||||
// 获取公众号标签精简信息列表
|
||||
export const getSimpleTagList = () => {
|
||||
return request.get({
|
||||
return request.get<SimpleTagVO[]>({
|
||||
url: '/mp/tag/list-all-simple'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ onMounted(() => {
|
|||
]"
|
||||
>
|
||||
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">
|
||||
<ElButton @click="emit('back')">
|
||||
<el-button @click="emit('back')">
|
||||
<Icon class="mr-5px" icon="ep:arrow-left" />
|
||||
{{ t('common.back') }}
|
||||
</ElButton>
|
||||
</el-button>
|
||||
</div>
|
||||
<div :class="[`${prefixCls}-header__title`, 'flex flex-1 justify-center']">
|
||||
<slot name="title">
|
||||
|
|
|
|||
|
|
@ -23,72 +23,81 @@
|
|||
<div :class="`${prefixCls}-toolbar`">
|
||||
<el-upload :beforeUpload="handleBeforeUpload" :fileList="[]" accept="image/*">
|
||||
<el-tooltip :content="t('cropper.selectImage')" placement="bottom">
|
||||
<XButton preIcon="ant-design:upload-outlined" type="primary" />
|
||||
<el-button type="primary">
|
||||
<Icon icon="ant-design:upload-outlined" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</el-upload>
|
||||
<el-space>
|
||||
<el-tooltip :content="t('cropper.btn_reset')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="ant-design:reload-outlined"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('reset')"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ant-design:reload-outlined" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_rotate_left')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="ant-design:rotate-left-outlined"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('rotate', -45)"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ant-design:rotate-left-outlined" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_rotate_right')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="ant-design:rotate-right-outlined"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('rotate', 45)"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ant-design:rotate-right-outlined" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_scale_x')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="vaadin:arrows-long-h"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('scaleX')"
|
||||
/>
|
||||
>
|
||||
<Icon icon="vaadin:arrows-long-h" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_scale_y')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="vaadin:arrows-long-v"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('scaleY')"
|
||||
/>
|
||||
>
|
||||
<Icon icon="vaadin:arrows-long-v" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_zoom_in')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="ant-design:zoom-in-outlined"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('zoom', 0.1)"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ant-design:zoom-in-outlined" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_zoom_out')" placement="bottom">
|
||||
<XButton
|
||||
<el-button
|
||||
:disabled="!src"
|
||||
preIcon="ant-design:zoom-out-outlined"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handlerToolbar('zoom', -0.1)"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ant-design:zoom-out-outlined" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</el-space>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ const btnClick = () => {
|
|||
<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>
|
||||
<el-button type="primary" @click="btnClick">{{ errorMap[type].buttonText }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -114,19 +114,17 @@ const setVisible = () => {
|
|||
<template #action>
|
||||
<div v-if="layout === 'inline'">
|
||||
<!-- update by 芋艿:去除搜索的 type="primary",颜色变淡一点 -->
|
||||
<ElButton v-if="showSearch" @click="search">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
{{ t('common.query') }}
|
||||
</ElButton>
|
||||
<el-button v-if="showSearch" @click="search">
|
||||
<Icon class="mr-5px" icon="ep:search" /> {{ t('common.query') }}
|
||||
</el-button>
|
||||
<!-- update by 芋艿:将 icon="ep:refresh-right" 修改成 icon="ep:refresh",和 ruoyi-vue 搜索保持一致 -->
|
||||
<ElButton v-if="showReset" @click="reset">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
{{ t('common.reset') }}
|
||||
</ElButton>
|
||||
<ElButton v-if="expand" text @click="setVisible">
|
||||
<el-button v-if="showReset" @click="reset">
|
||||
<Icon class="mr-5px" icon="ep:refresh" /> {{ t('common.reset') }}
|
||||
</el-button>
|
||||
<el-button v-if="expand" text @click="setVisible">
|
||||
{{ t(visible ? 'common.shrink' : 'common.expand') }}
|
||||
<Icon :icon="visible ? 'ep:arrow-up' : 'ep:arrow-down'" />
|
||||
</ElButton>
|
||||
</el-button>
|
||||
<!-- add by 芋艿:补充在搜索后的按钮 -->
|
||||
<slot name="actionMore"></slot>
|
||||
</div>
|
||||
|
|
@ -138,18 +136,16 @@ const setVisible = () => {
|
|||
|
||||
<template v-if="layout === 'bottom'">
|
||||
<div :style="bottonButtonStyle">
|
||||
<ElButton v-if="showSearch" type="primary" @click="search">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
{{ t('common.query') }}
|
||||
</ElButton>
|
||||
<ElButton v-if="showReset" @click="reset">
|
||||
<Icon class="mr-5px" icon="ep:refresh-right" />
|
||||
{{ t('common.reset') }}
|
||||
</ElButton>
|
||||
<ElButton v-if="expand" text @click="setVisible">
|
||||
<el-button v-if="showSearch" type="primary" @click="search">
|
||||
<Icon class="mr-5px" icon="ep:search" /> {{ t('common.query') }}
|
||||
</el-button>
|
||||
<el-button v-if="showReset" @click="reset">
|
||||
<Icon class="mr-5px" icon="ep:refresh-right" /> {{ t('common.reset') }}
|
||||
</el-button>
|
||||
<el-button v-if="expand" text @click="setVisible">
|
||||
{{ t(visible ? 'common.shrink' : 'common.expand') }}
|
||||
<Icon :icon="visible ? 'ep:arrow-up' : 'ep:arrow-down'" />
|
||||
</ElButton>
|
||||
</el-button>
|
||||
<!-- add by 芋艿:补充在搜索后的按钮 -->
|
||||
<slot name="actionMore"></slot>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
import XButton from './src/XButton.vue'
|
||||
import XTextButton from './src/XTextButton.vue'
|
||||
|
||||
export { XButton, XTextButton }
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
<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),
|
||||
preIcon: propTypes.string.def(''),
|
||||
postIcon: propTypes.string.def(''),
|
||||
title: propTypes.string.def(''),
|
||||
type: propTypes.oneOf(['', 'primary', 'success', 'warning', 'danger', 'info']).def(''),
|
||||
link: propTypes.bool.def(false),
|
||||
circle: propTypes.bool.def(false),
|
||||
round: propTypes.bool.def(false),
|
||||
plain: propTypes.bool.def(false),
|
||||
onClick: { type: Function as PropType<(...args) => any>, default: null }
|
||||
})
|
||||
const getBindValue = computed(() => {
|
||||
const delArr: string[] = ['title', 'preIcon', 'postIcon', 'onClick']
|
||||
const attrs = useAttrs()
|
||||
const obj = { ...attrs, ...props }
|
||||
for (const key in obj) {
|
||||
if (delArr.indexOf(key) !== -1) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
return obj
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-button v-bind="getBindValue" @click="onClick">
|
||||
<Icon v-if="preIcon" :icon="preIcon" class="mr-1px" />
|
||||
{{ title ? title : '' }}
|
||||
<Icon v-if="postIcon" :icon="postIcon" class="mr-1px" />
|
||||
</el-button>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-button.is-text) {
|
||||
padding: 8px 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
:deep(.el-button.is-link) {
|
||||
padding: 8px 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<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),
|
||||
preIcon: propTypes.string.def(''),
|
||||
postIcon: propTypes.string.def(''),
|
||||
title: propTypes.string.def(''),
|
||||
type: propTypes.oneOf(['', 'primary', 'success', 'warning', 'danger', 'info']).def('primary'),
|
||||
circle: propTypes.bool.def(false),
|
||||
round: propTypes.bool.def(false),
|
||||
plain: propTypes.bool.def(false),
|
||||
onClick: { type: Function as PropType<(...args) => any>, default: null }
|
||||
})
|
||||
const getBindValue = computed(() => {
|
||||
const delArr: string[] = ['title', 'preIcon', 'postIcon', 'onClick']
|
||||
const attrs = useAttrs()
|
||||
const obj = { ...attrs, ...props }
|
||||
for (const key in obj) {
|
||||
if (delArr.indexOf(key) !== -1) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
return obj
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-button link v-bind="getBindValue" @click="onClick">
|
||||
<Icon v-if="preIcon" :icon="preIcon" class="mr-1px" />
|
||||
{{ title ? title : '' }}
|
||||
<Icon v-if="postIcon" :icon="postIcon" class="mr-1px" />
|
||||
</el-button>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-button.is-text) {
|
||||
padding: 8px 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
:deep(.el-button.is-link) {
|
||||
padding: 8px 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,32 +4,34 @@
|
|||
<slot name="control-header"></slot>
|
||||
<template v-if="!$slots['control-header']">
|
||||
<ElButtonGroup key="file-control">
|
||||
<XButton preIcon="ep:folder-opened" title="打开文件" @click="refFile.click()" />
|
||||
<el-button @click="refFile.click()">
|
||||
<Icon icon="ep:folder-opened" class="mr-1px" /> 打开文件
|
||||
</el-button>
|
||||
<el-tooltip effect="light" placement="bottom">
|
||||
<template #content>
|
||||
<div style="color: #409eff">
|
||||
<!-- <el-button link @click="downloadProcessAsXml()">下载为XML文件</el-button> -->
|
||||
<XTextButton title="下载为XML文件" @click="downloadProcessAsXml()" />
|
||||
<el-button link @click="downloadProcessAsXml()">下载为XML文件</el-button>
|
||||
<br />
|
||||
|
||||
<!-- <el-button link @click="downloadProcessAsSvg()">下载为SVG文件</el-button> -->
|
||||
<XTextButton title="下载为SVG文件" @click="downloadProcessAsSvg()" />
|
||||
<el-button link @click="downloadProcessAsSvg()">下载为SVG文件</el-button>
|
||||
<br />
|
||||
|
||||
<!-- <el-button link @click="downloadProcessAsBpmn()">下载为BPMN文件</el-button> -->
|
||||
<XTextButton title="下载为BPMN文件" @click="downloadProcessAsBpmn()" />
|
||||
<el-button link @click="downloadProcessAsBpmn()">下载为BPMN文件</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<XButton title="下载文件" preIcon="ep:download" />
|
||||
<el-button> <Icon icon="ep:download" class="mr-1px" /> 下载文件 </el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light">
|
||||
<XButton preIcon="ep:view" title="浏览" />
|
||||
<el-button> <Icon icon="ep:view" class="mr-1px" /> 浏览 </el-button>
|
||||
<template #content>
|
||||
<!-- <el-button link @click="previewProcessXML">预览XML</el-button> -->
|
||||
<XTextButton title="预览XML" @click="previewProcessXML" />
|
||||
<el-button link @click="previewProcessXML">预览XML</el-button>
|
||||
<br />
|
||||
<!-- <el-button link @click="previewProcessJson">预览JSON</el-button> -->
|
||||
<XTextButton title="预览JSON" @click="previewProcessJson" />
|
||||
<el-button link @click="previewProcessJson">预览JSON</el-button>
|
||||
</template>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
|
|
@ -37,7 +39,9 @@
|
|||
effect="light"
|
||||
:content="simulationStatus ? '退出模拟' : '开启模拟'"
|
||||
>
|
||||
<XButton preIcon="ep:cpu" title="模拟" @click="processSimulation" />
|
||||
<el-button @click="processSimulation">
|
||||
<Icon icon="ep:cpu" class="mr-1px" /> 模拟
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</ElButtonGroup>
|
||||
<ElButtonGroup key="align-control">
|
||||
|
|
@ -47,11 +51,9 @@
|
|||
icon="el-icon-s-data"
|
||||
@click="elementsAlign('left')"
|
||||
/> -->
|
||||
<XButton
|
||||
preIcon="fa:align-left"
|
||||
class="align align-bottom"
|
||||
@click="elementsAlign('left')"
|
||||
/>
|
||||
<el-button class="align align-bottom" @click="elementsAlign('left')">
|
||||
<Icon icon="fa:align-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="向右对齐">
|
||||
<!-- <el-button
|
||||
|
|
@ -59,11 +61,9 @@
|
|||
icon="el-icon-s-data"
|
||||
@click="elementsAlign('right')"
|
||||
/> -->
|
||||
<XButton
|
||||
preIcon="fa:align-left"
|
||||
class="align align-top"
|
||||
@click="elementsAlign('right')"
|
||||
/>
|
||||
<el-button class="align align-top" @click="elementsAlign('right')">
|
||||
<Icon icon="fa:align-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="向上对齐">
|
||||
<!-- <el-button
|
||||
|
|
@ -71,11 +71,9 @@
|
|||
icon="el-icon-s-data"
|
||||
@click="elementsAlign('top')"
|
||||
/> -->
|
||||
<XButton
|
||||
preIcon="fa:align-left"
|
||||
class="align align-left"
|
||||
@click="elementsAlign('top')"
|
||||
/>
|
||||
<el-button class="align align-left" @click="elementsAlign('top')">
|
||||
<Icon icon="fa:align-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="向下对齐">
|
||||
<!-- <el-button
|
||||
|
|
@ -83,11 +81,9 @@
|
|||
icon="el-icon-s-data"
|
||||
@click="elementsAlign('bottom')"
|
||||
/> -->
|
||||
<XButton
|
||||
preIcon="fa:align-left"
|
||||
class="align align-right"
|
||||
@click="elementsAlign('bottom')"
|
||||
/>
|
||||
<el-button class="align align-right" @click="elementsAlign('bottom')">
|
||||
<Icon icon="fa:align-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="水平居中">
|
||||
<!-- <el-button
|
||||
|
|
@ -96,11 +92,9 @@
|
|||
@click="elementsAlign('center')"
|
||||
/> -->
|
||||
<!-- class="align align-center" -->
|
||||
<XButton
|
||||
preIcon="fa:align-left"
|
||||
class="align align-center"
|
||||
@click="elementsAlign('center')"
|
||||
/>
|
||||
<el-button class="align align-center" @click="elementsAlign('center')">
|
||||
<Icon icon="fa:align-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="垂直居中">
|
||||
<!-- <el-button
|
||||
|
|
@ -108,11 +102,9 @@
|
|||
icon="el-icon-s-data"
|
||||
@click="elementsAlign('middle')"
|
||||
/> -->
|
||||
<XButton
|
||||
preIcon="fa:align-left"
|
||||
class="align align-middle"
|
||||
@click="elementsAlign('middle')"
|
||||
/>
|
||||
<el-button class="align align-middle" @click="elementsAlign('middle')">
|
||||
<Icon icon="fa:align-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</ElButtonGroup>
|
||||
<ElButtonGroup key="scale-control">
|
||||
|
|
@ -122,11 +114,9 @@
|
|||
icon="el-icon-zoom-out"
|
||||
@click="processZoomOut()"
|
||||
/> -->
|
||||
<XButton
|
||||
preIcon="ep:zoom-out"
|
||||
@click="processZoomOut()"
|
||||
:disabled="defaultZoom < 0.2"
|
||||
/>
|
||||
<el-button @click="processZoomOut()" :disabled="defaultZoom < 0.2">
|
||||
<Icon icon="ep:zoom-out" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-button>{{ Math.floor(defaultZoom * 10 * 10) + '%' }}</el-button>
|
||||
<el-tooltip effect="light" content="放大视图">
|
||||
|
|
@ -135,17 +125,23 @@
|
|||
icon="el-icon-zoom-in"
|
||||
@click="processZoomIn()"
|
||||
/> -->
|
||||
<XButton preIcon="ep:zoom-in" @click="processZoomIn()" :disabled="defaultZoom > 4" />
|
||||
<el-button @click="processZoomIn()" :disabled="defaultZoom > 4">
|
||||
<Icon icon="ep:zoom-in" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="重置视图并居中">
|
||||
<!-- <el-button icon="el-icon-c-scale-to-original" @click="processReZoom()" /> -->
|
||||
<XButton preIcon="ep:scale-to-original" @click="processReZoom()" />
|
||||
<el-button @click="processReZoom()">
|
||||
<Icon icon="ep:scale-to-original" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</ElButtonGroup>
|
||||
<ElButtonGroup key="stack-control">
|
||||
<el-tooltip effect="light" content="撤销">
|
||||
<!-- <el-button :disabled="!revocable" icon="el-icon-refresh-left" @click="processUndo()" /> -->
|
||||
<XButton preIcon="ep:refresh-left" @click="processUndo()" :disabled="!revocable" />
|
||||
<el-button @click="processUndo()" :disabled="!revocable">
|
||||
<Icon icon="ep:refresh-left" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="恢复">
|
||||
<!-- <el-button
|
||||
|
|
@ -153,11 +149,15 @@
|
|||
icon="el-icon-refresh-right"
|
||||
@click="processRedo()"
|
||||
/> -->
|
||||
<XButton preIcon="ep:refresh-right" @click="processRedo()" :disabled="!recoverable" />
|
||||
<el-button @click="processRedo()" :disabled="!recoverable">
|
||||
<Icon icon="ep:refresh-right" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="light" content="重新绘制">
|
||||
<!-- <el-button icon="el-icon-refresh" @click="processRestart" /> -->
|
||||
<XButton preIcon="ep:refresh" @click="processRestart()" />
|
||||
<el-button @click="processRestart()">
|
||||
<Icon icon="ep:refresh" class="mr-1px" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</ElButtonGroup>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<!-- </el-table>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="element-drawer__button">-->
|
||||
<!-- <XButton type="primary" proIcon="ep:plus" title="添加字段" @click="openFieldForm(null, -1)" />-->
|
||||
<!-- <el-button type="primary" proIcon="ep:plus" @click="openFieldForm(null, -1)">添加字段</el-button>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!--字段配置侧边栏-->
|
||||
|
|
|
|||
|
|
@ -22,20 +22,12 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="element-drawer__button">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加监听器"
|
||||
size="small"
|
||||
@click="openListenerForm(null)"
|
||||
/>
|
||||
<XButton
|
||||
type="success"
|
||||
preIcon="ep:select"
|
||||
title="选择监听器"
|
||||
size="small"
|
||||
@click="openProcessListenerDialog"
|
||||
/>
|
||||
<el-button type="primary" size="small" @click="openListenerForm(null)">
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 添加监听器
|
||||
</el-button>
|
||||
<el-button type="success" size="small" @click="openProcessListenerDialog">
|
||||
<Icon icon="ep:select" class="mr-1px" /> 选择监听器
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 监听器 编辑/创建 部分 -->
|
||||
|
|
@ -141,7 +133,7 @@
|
|||
<el-divider />
|
||||
<p class="listener-filed__title">
|
||||
<span><Icon icon="ep:menu" />注入字段:</span>
|
||||
<XButton type="primary" @click="openListenerFieldForm(null)" title="添加字段" />
|
||||
<el-button type="primary" @click="openListenerFieldForm(null)">添加字段</el-button>
|
||||
</p>
|
||||
<el-table
|
||||
:data="fieldsListOfListener"
|
||||
|
|
|
|||
|
|
@ -33,20 +33,12 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="element-drawer__button">
|
||||
<XButton
|
||||
size="small"
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加监听器"
|
||||
@click="openListenerForm(null)"
|
||||
/>
|
||||
<XButton
|
||||
type="success"
|
||||
preIcon="ep:select"
|
||||
title="选择监听器"
|
||||
size="small"
|
||||
@click="openProcessListenerDialog"
|
||||
/>
|
||||
<el-button size="small" type="primary" @click="openListenerForm(null)">
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 添加监听器
|
||||
</el-button>
|
||||
<el-button type="success" size="small" @click="openProcessListenerDialog">
|
||||
<Icon icon="ep:select" class="mr-1px" /> 选择监听器
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 监听器 编辑/创建 部分 -->
|
||||
|
|
|
|||
|
|
@ -22,12 +22,9 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="element-drawer__button">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加属性"
|
||||
@click="openAttributesForm(null, -1)"
|
||||
/>
|
||||
<el-button type="primary" @click="openAttributesForm(null, -1)">
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
<div class="panel-tab__content">
|
||||
<div class="panel-tab__content--title">
|
||||
<span><Icon icon="ep:menu" style="margin-right: 8px; color: #555" />消息列表</span>
|
||||
<XButton type="primary" title="创建新消息" preIcon="ep:plus" @click="openModel('message')" />
|
||||
<el-button type="primary" @click="openModel('message')">
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 创建新消息
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="messageList" border>
|
||||
<el-table-column type="index" label="序号" width="60px" />
|
||||
|
|
@ -31,7 +33,9 @@
|
|||
style="padding-top: 8px; margin-top: 8px; border-top: 1px solid #eee"
|
||||
>
|
||||
<span><Icon icon="ep:menu" style="margin-right: 8px; color: #555" />信号列表</span>
|
||||
<XButton type="primary" title="创建新信号" preIcon="ep:plus" @click="openModel('signal')" />
|
||||
<el-button type="primary" @click="openModel('signal')">
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 创建新信号
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="signalList" border>
|
||||
<el-table-column type="index" label="序号" width="60px" />
|
||||
|
|
|
|||
|
|
@ -47,14 +47,14 @@
|
|||
<div>
|
||||
<div class="flex mb-10px">
|
||||
<el-text>输入参数</el-text>
|
||||
<XButton
|
||||
<el-button
|
||||
class="ml-auto"
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加参数"
|
||||
size="small"
|
||||
@click="openVariableForm('in', null, -1)"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 添加参数
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="inVariableList" max-height="240" fit border>
|
||||
<el-table-column label="源" prop="source" min-width="100px" show-overflow-tooltip />
|
||||
|
|
@ -82,14 +82,14 @@
|
|||
<div>
|
||||
<div class="flex mb-10px">
|
||||
<el-text>输出参数</el-text>
|
||||
<XButton
|
||||
<el-button
|
||||
class="ml-auto"
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加参数"
|
||||
size="small"
|
||||
@click="openVariableForm('out', null, -1)"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-1px" /> 添加参数
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="outVariableList" max-height="240" fit border>
|
||||
<el-table-column label="源" prop="source" min-width="100px" show-overflow-tooltip />
|
||||
|
|
|
|||
|
|
@ -17,12 +17,9 @@
|
|||
:key="key"
|
||||
/>
|
||||
</el-select>
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
style="margin-left: 8px"
|
||||
@click="openMessageModel"
|
||||
/>
|
||||
<el-button type="primary" style="margin-left: 8px" @click="openMessageModel">
|
||||
<Icon icon="ep:plus" class="mr-1px" />
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-dialog
|
||||
|
|
|
|||
|
|
@ -186,14 +186,14 @@
|
|||
style="width: 100%"
|
||||
@change="updateElementTask"
|
||||
/>
|
||||
<XButton
|
||||
<el-button
|
||||
class="!w-1/1 mt-5px"
|
||||
type="success"
|
||||
preIcon="ep:select"
|
||||
title="选择表达式"
|
||||
size="small"
|
||||
@click="openProcessExpressionDialog"
|
||||
/>
|
||||
>
|
||||
<Icon icon="ep:select" class="mr-1px" /> 选择表达式
|
||||
</el-button>
|
||||
<!-- 选择弹窗 -->
|
||||
<ProcessExpressionDialog ref="processExpressionDialogRef" @select="selectProcessExpression" />
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ const props = defineProps({
|
|||
default: () => []
|
||||
},
|
||||
trigger: {
|
||||
type: String as PropType<'click' | 'hover' | 'focus' | 'contextmenu'>,
|
||||
type: String as PropType<'click' | 'hover' | 'contextmenu'>,
|
||||
default: 'contextmenu'
|
||||
},
|
||||
tagItem: {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,9 @@ onMounted(() => {
|
|||
</ElTabs>
|
||||
<!-- 更多 -->
|
||||
<div style="margin-top: 10px; text-align: right">
|
||||
<XButton preIcon="ep:view" title="查看全部" type="primary" @click="goMyList" />
|
||||
<el-button type="primary" @click="goMyList">
|
||||
<Icon icon="ep:view" class="mr-1px" /> 查看全部
|
||||
</el-button>
|
||||
</div>
|
||||
</ElPopover>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -275,12 +275,14 @@ const clear = () => {
|
|||
|
||||
<ElDivider />
|
||||
<div>
|
||||
<ElButton class="w-full" type="primary" @click="copyConfig">{{ t('setting.copy') }}</ElButton>
|
||||
<el-button class="w-full" type="primary" @click="copyConfig">
|
||||
{{ t('setting.copy') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="mt-5px">
|
||||
<ElButton class="w-full" type="danger" @click="clear">
|
||||
<el-button class="w-full" type="danger" @click="clear">
|
||||
{{ t('setting.clearAndReset') }}
|
||||
</ElButton>
|
||||
</el-button>
|
||||
</div>
|
||||
</ElDrawer>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ const handleLock = async () => {
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<ElButton type="primary" @click="handleLock">{{ t('lock.lock') }}</ElButton>
|
||||
<el-button type="primary" @click="handleLock">{{ t('lock.lock') }}</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ function handleShowForm(show = false) {
|
|||
{{ t('lock.message') }}
|
||||
</span>
|
||||
<div :class="`${prefixCls}-entry__footer enter-x`">
|
||||
<ElButton
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
class="mt-2 mr-2 enter-x"
|
||||
|
|
@ -115,8 +115,8 @@ function handleShowForm(show = false) {
|
|||
@click="handleShowForm(true)"
|
||||
>
|
||||
{{ t('common.back') }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
class="mt-2 mr-2 enter-x"
|
||||
|
|
@ -125,8 +125,8 @@ function handleShowForm(show = false) {
|
|||
@click="goLogin"
|
||||
>
|
||||
{{ t('lock.backToLogin') }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mt-2"
|
||||
size="small"
|
||||
|
|
@ -135,7 +135,7 @@ function handleShowForm(show = false) {
|
|||
:disabled="loading"
|
||||
>
|
||||
{{ t('lock.entrySystem') }}
|
||||
</ElButton>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -376,6 +376,13 @@ export const fenToYuan = (price: string | number): string => {
|
|||
return formatToFraction(price)
|
||||
}
|
||||
|
||||
/**
|
||||
* 分转元,返回数字
|
||||
*/
|
||||
export const fenToYuanNumber = (price: string | number): number => {
|
||||
return Number(fenToYuan(price))
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算环比
|
||||
*
|
||||
|
|
|
|||
|
|
@ -123,13 +123,14 @@
|
|||
</el-col>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
<el-button
|
||||
:loading="loginLoading"
|
||||
:title="t('login.login')"
|
||||
class="w-[100%]"
|
||||
type="primary"
|
||||
@click="getCode()"
|
||||
/>
|
||||
>
|
||||
{{ t('login.login') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<Verify
|
||||
|
|
|
|||
|
|
@ -97,23 +97,16 @@
|
|||
<!-- 登录按钮 / 返回按钮 -->
|
||||
<el-col :span="24" class="px-10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.resetPassword')"
|
||||
class="w-full"
|
||||
type="primary"
|
||||
@click="resetPassword()"
|
||||
/>
|
||||
<el-button :loading="loginLoading" class="w-full" type="primary" @click="resetPassword()">
|
||||
{{ t('login.resetPassword') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="px-10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.backLogin')"
|
||||
class="w-full"
|
||||
@click="handleBackLogin()"
|
||||
/>
|
||||
<el-button :loading="loginLoading" class="w-full" @click="handleBackLogin()">
|
||||
{{ t('login.backLogin') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
|
|
@ -69,13 +69,9 @@
|
|||
</el-col>
|
||||
<el-col :span="24" class="px-10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.login')"
|
||||
class="w-full"
|
||||
type="primary"
|
||||
@click="getCode()"
|
||||
/>
|
||||
<el-button :loading="loginLoading" class="w-full" type="primary" @click="getCode()">
|
||||
{{ t('login.login') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<Verify
|
||||
|
|
@ -90,25 +86,19 @@
|
|||
<el-form-item>
|
||||
<el-row :gutter="5" justify="space-between" style="width: 100%">
|
||||
<el-col :span="8">
|
||||
<XButton
|
||||
:title="t('login.btnMobile')"
|
||||
class="w-full"
|
||||
@click="setLoginState(LoginStateEnum.MOBILE)"
|
||||
/>
|
||||
<el-button class="w-full" @click="setLoginState(LoginStateEnum.MOBILE)">
|
||||
{{ t('login.btnMobile') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<XButton
|
||||
:title="t('login.btnQRCode')"
|
||||
class="w-full"
|
||||
@click="setLoginState(LoginStateEnum.QR_CODE)"
|
||||
/>
|
||||
<el-button class="w-full" @click="setLoginState(LoginStateEnum.QR_CODE)">
|
||||
{{ t('login.btnQRCode') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<XButton
|
||||
:title="t('login.btnRegister')"
|
||||
class="w-full"
|
||||
@click="setLoginState(LoginStateEnum.REGISTER)"
|
||||
/>
|
||||
<el-button class="w-full" @click="setLoginState(LoginStateEnum.REGISTER)">
|
||||
{{ t('login.btnRegister') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -70,23 +70,16 @@
|
|||
<!-- 登录按钮 / 返回按钮 -->
|
||||
<el-col :span="24" class="px-10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.login')"
|
||||
class="w-full"
|
||||
type="primary"
|
||||
@click="signIn()"
|
||||
/>
|
||||
<el-button :loading="loginLoading" class="w-full" type="primary" @click="signIn()">
|
||||
{{ t('login.login') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="px-10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.backLogin')"
|
||||
class="w-full"
|
||||
@click="handleBackLogin()"
|
||||
/>
|
||||
<el-button :loading="loginLoading" class="w-full" @click="handleBackLogin()">
|
||||
{{ t('login.backLogin') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<el-divider class="enter-x">{{ t('login.qrcode') }}</el-divider>
|
||||
<el-col :span="24" class="px-10px">
|
||||
<div class="mt-4 w-full">
|
||||
<XButton :title="t('login.backLogin')" class="w-full" @click="handleBackLogin()" />
|
||||
<el-button class="w-full" @click="handleBackLogin()">{{ t('login.backLogin') }}</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
|
|
@ -75,13 +75,9 @@
|
|||
</el-col>
|
||||
<el-col :span="24" class="px-10px">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.register')"
|
||||
class="w-full"
|
||||
type="primary"
|
||||
@click="getCode()"
|
||||
/>
|
||||
<el-button :loading="loginLoading" class="w-full" type="primary" @click="getCode()">
|
||||
{{ t('login.register') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<Verify
|
||||
|
|
@ -93,7 +89,7 @@
|
|||
@success="handleRegister"
|
||||
/>
|
||||
</el-row>
|
||||
<XButton :title="t('login.hasUser')" class="w-full" @click="handleBackLogin()" />
|
||||
<el-button class="w-full" @click="handleBackLogin()">{{ t('login.hasUser') }}</el-button>
|
||||
</el-form>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
</template>
|
||||
</Form>
|
||||
<div style="text-align: center">
|
||||
<XButton :title="t('common.save')" type="primary" @click="submit()" />
|
||||
<XButton :title="t('common.reset')" type="danger" @click="init()" />
|
||||
<el-button type="primary" @click="submit()">{{ t('common.save') }}</el-button>
|
||||
<el-button type="danger" @click="init()">{{ t('common.reset') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
<InputPassword v-model="password.confirmPassword" strength />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<XButton :title="t('common.save')" type="primary" @click="submit(formRef)" />
|
||||
<XButton :title="t('common.reset')" type="danger" @click="reset(formRef)" />
|
||||
<el-button type="primary" @click="submit(formRef)">{{ t('common.save') }}</el-button>
|
||||
<el-button type="danger" @click="reset(formRef)">{{ t('common.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
<template #default="{ row }">
|
||||
<template v-if="row.openid">
|
||||
已绑定
|
||||
<XTextButton class="mr-5" title="(解绑)" type="primary" @click="unbind(row)" />
|
||||
<el-button link class="mr-5" type="primary" @click="unbind(row)">(解绑)</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
未绑定
|
||||
<XTextButton class="mr-5" title="(绑定)" type="primary" @click="bind(row)" />
|
||||
<el-button link class="mr-5" type="primary" @click="bind(row)">(绑定)</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ const activeName = ref('colum') // Tag 激活的窗口
|
|||
const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>()
|
||||
const generateInfoRef = ref<ComponentRef<typeof GenerateInfoForm>>()
|
||||
const formData = ref<CodegenApi.CodegenUpdateReqVO>({
|
||||
table: {},
|
||||
table: CodegenApi.createEmptyCodegenTableSaveReqVO(),
|
||||
columns: []
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -48,19 +48,15 @@ defineOptions({ name: 'InfraCodegenBasicInfoForm' })
|
|||
|
||||
const props = defineProps({
|
||||
table: {
|
||||
type: Object as PropType<Nullable<CodegenApi.CodegenTableVO>>,
|
||||
type: Object as PropType<Nullable<CodegenApi.CodegenTableSaveReqVO>>,
|
||||
default: () => null
|
||||
}
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
const formData = ref({
|
||||
tableName: '',
|
||||
tableComment: '',
|
||||
className: '',
|
||||
author: '',
|
||||
remark: ''
|
||||
})
|
||||
const formData = ref<CodegenApi.CodegenTableSaveReqVO>(
|
||||
CodegenApi.createEmptyCodegenTableSaveReqVO()
|
||||
)
|
||||
const rules = reactive({
|
||||
tableName: [required],
|
||||
tableComment: [required],
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ defineOptions({ name: 'InfraCodegenGenerateInfoForm' })
|
|||
|
||||
const props = defineProps({
|
||||
table: {
|
||||
type: Object as PropType<Nullable<CodegenApi.CodegenTableVO>>,
|
||||
type: Object as PropType<Nullable<CodegenApi.CodegenTableSaveReqVO>>,
|
||||
default: () => null
|
||||
},
|
||||
columns: {
|
||||
|
|
@ -314,23 +314,9 @@ const props = defineProps({
|
|||
})
|
||||
|
||||
const formRef = ref()
|
||||
const formData = ref({
|
||||
templateType: null,
|
||||
frontType: null,
|
||||
scene: null,
|
||||
moduleName: '',
|
||||
businessName: '',
|
||||
className: '',
|
||||
classComment: '',
|
||||
parentMenuId: null,
|
||||
genPath: '',
|
||||
genType: '',
|
||||
masterTableId: undefined,
|
||||
subJoinColumnId: undefined,
|
||||
subJoinMany: undefined,
|
||||
treeParentColumnId: undefined,
|
||||
treeNameColumnId: undefined
|
||||
})
|
||||
const formData = ref<CodegenApi.CodegenTableSaveReqVO>(
|
||||
CodegenApi.createEmptyCodegenTableSaveReqVO()
|
||||
)
|
||||
|
||||
const rules = reactive({
|
||||
templateType: [required],
|
||||
|
|
@ -348,7 +334,7 @@ const rules = reactive({
|
|||
treeNameColumnId: [required]
|
||||
})
|
||||
|
||||
const tables = ref([]) // 表定义列表
|
||||
const tables = ref<CodegenApi.CodegenTableVO[]>([]) // 表定义列表
|
||||
const menus = ref<any[]>([])
|
||||
const menuTreeProps = {
|
||||
label: 'name'
|
||||
|
|
@ -358,7 +344,7 @@ watch(
|
|||
() => props.table,
|
||||
async (table) => {
|
||||
if (!table) return
|
||||
formData.value = table as any
|
||||
formData.value = table
|
||||
// 加载表列表
|
||||
if (table.dataSourceConfigId >= 0) {
|
||||
tables.value = await CodegenApi.getCodegenTableList(formData.value.dataSourceConfigId)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<Demo03Student>({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
|
|
@ -94,7 +94,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as Demo03Student
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await Demo03StudentApi.createDemo03Student(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<Demo03Course>({
|
||||
id: undefined,
|
||||
studentId: undefined,
|
||||
name: undefined,
|
||||
|
|
@ -49,7 +49,7 @@ const open = async (type: string, id?: number, studentId?: number) => {
|
|||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
formData.value.studentId = studentId as any
|
||||
formData.value.studentId = studentId
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
|
|
@ -70,7 +70,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as Demo03Course
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await Demo03StudentApi.createDemo03Course(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
|
|||
|
|
@ -158,6 +158,6 @@ const handleDeleteBatch = async () => {
|
|||
|
||||
const checkedIds = ref<number[]>([])
|
||||
const handleRowCheckboxChange = (records: Demo03Course[]) => {
|
||||
checkedIds.value = records.map((item) => item.id)
|
||||
checkedIds.value = records.map((item) => item.id!)
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<Demo03Grade>({
|
||||
id: undefined,
|
||||
studentId: undefined,
|
||||
name: undefined,
|
||||
|
|
@ -49,7 +49,7 @@ const open = async (type: string, id?: number, studentId?: number) => {
|
|||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
formData.value.studentId = studentId as any
|
||||
formData.value.studentId = studentId
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
|
|
@ -70,7 +70,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as Demo03Grade
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await Demo03StudentApi.createDemo03Grade(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
|
|||
|
|
@ -158,6 +158,6 @@ const handleDeleteBatch = async () => {
|
|||
|
||||
const checkedIds = ref<number[]>([])
|
||||
const handleRowCheckboxChange = (records: Demo03Grade[]) => {
|
||||
checkedIds.value = records.map((item) => item.id)
|
||||
checkedIds.value = records.map((item) => item.id!)
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -142,10 +142,10 @@
|
|||
<ContentWrap>
|
||||
<el-tabs model-value="demo03Course">
|
||||
<el-tab-pane label="学生课程" name="demo03Course">
|
||||
<Demo03CourseList :student-id="currentRow.id" />
|
||||
<Demo03CourseList :student-id="currentRow?.id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="学生班级" name="demo03Grade">
|
||||
<Demo03GradeList :student-id="currentRow.id" />
|
||||
<Demo03GradeList :student-id="currentRow?.id" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</ContentWrap>
|
||||
|
|
@ -238,7 +238,7 @@ const handleDeleteBatch = async () => {
|
|||
|
||||
const checkedIds = ref<number[]>([])
|
||||
const handleRowCheckboxChange = (records: Demo03Student[]) => {
|
||||
checkedIds.value = records.map((item) => item.id)
|
||||
checkedIds.value = records.map((item) => item.id!)
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
|
@ -257,8 +257,8 @@ const handleExport = async () => {
|
|||
}
|
||||
|
||||
/** 选中行操作 */
|
||||
const currentRow = ref({}) // 选中行
|
||||
const handleCurrentChange = (row) => {
|
||||
const currentRow = ref<Demo03Student>() // 选中行
|
||||
const handleCurrentChange = (row: Demo03Student) => {
|
||||
currentRow.value = row
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<Demo03Student>({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
|
|
@ -123,7 +123,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as Demo03Student
|
||||
const data = formData.value
|
||||
// 拼接子表的数据
|
||||
data.demo03courses = demo03CourseFormRef.value.getData()
|
||||
data.demo03grade = demo03GradeFormRef.value.getData()
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
import { Demo03StudentApi } from '@/api/infra/demo/demo03/inner'
|
||||
|
||||
const props = defineProps<{
|
||||
studentId: number // 学生编号(主表的关联字段)
|
||||
studentId?: number // 学生编号(主表的关联字段)
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref<any[]>([])
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
import { Demo03StudentApi } from '@/api/infra/demo/demo03/inner'
|
||||
|
||||
const props = defineProps<{
|
||||
studentId: number // 学生编号(主表的关联字段)
|
||||
studentId?: number // 学生编号(主表的关联字段)
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref<any>({})
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { Demo03StudentApi } from '@/api/infra/demo/demo03/inner'
|
||||
import { Demo03Grade, Demo03StudentApi } from '@/api/infra/demo/demo03/inner'
|
||||
|
||||
const props = defineProps<{
|
||||
studentId?: number // 学生编号(主表的关联字段)
|
||||
}>()
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const list = ref<Demo03Grade[]>([]) // 列表的数据
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ const handleDeleteBatch = async () => {
|
|||
|
||||
const checkedIds = ref<number[]>([])
|
||||
const handleRowCheckboxChange = (records: Demo03Student[]) => {
|
||||
checkedIds.value = records.map((item) => item.id)
|
||||
checkedIds.value = records.map((item) => item.id!)
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<Demo03Student>({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
|
|
@ -123,7 +123,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as Demo03Student
|
||||
const data = formData.value
|
||||
// 拼接子表的数据
|
||||
data.demo03courses = demo03CourseFormRef.value.getData()
|
||||
data.demo03grade = demo03GradeFormRef.value.getData()
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
import { Demo03StudentApi } from '@/api/infra/demo/demo03/normal'
|
||||
|
||||
const props = defineProps<{
|
||||
studentId: number // 学生编号(主表的关联字段)
|
||||
studentId?: number // 学生编号(主表的关联字段)
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref<any[]>([])
|
||||
|
|
|
|||
|
|
@ -15,13 +15,18 @@
|
|||
</el-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { Demo03StudentApi } from '@/api/infra/demo/demo03/normal'
|
||||
import { Demo03Grade, Demo03StudentApi } from '@/api/infra/demo/demo03/normal'
|
||||
|
||||
const props = defineProps<{
|
||||
studentId: number // 学生编号(主表的关联字段)
|
||||
studentId?: number // 学生编号(主表的关联字段)
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref({})
|
||||
const formData = ref<Demo03Grade>({
|
||||
id: undefined,
|
||||
studentId: undefined,
|
||||
name: undefined,
|
||||
teacher: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
studentId: [{ required: true, message: '学生编号不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '名字不能为空', trigger: 'blur' }],
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ const handleDeleteBatch = async () => {
|
|||
|
||||
const checkedIds = ref<number[]>([])
|
||||
const handleRowCheckboxChange = (records: Demo03Student[]) => {
|
||||
checkedIds.value = records.map((item) => item.id)
|
||||
checkedIds.value = records.map((item) => item.id!)
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
|
|
|||
|
|
@ -66,24 +66,26 @@
|
|||
<script lang="ts" setup>
|
||||
import * as RedisApi from '@/api/infra/redis'
|
||||
import { RedisMonitorInfoVO } from '@/api/infra/redis/types'
|
||||
import type { EChartsOption } from 'echarts'
|
||||
|
||||
const cache = ref<RedisMonitorInfoVO>()
|
||||
|
||||
// 基本信息
|
||||
const readRedisInfo = async () => {
|
||||
const data = await RedisApi.getCache()
|
||||
cache.value = data
|
||||
cache.value = await RedisApi.getCache()
|
||||
}
|
||||
|
||||
// 内存使用情况
|
||||
const usedmemoryEchartChika = reactive<any>({
|
||||
const usedmemoryEchartChika = reactive<EChartsOption>({
|
||||
title: {
|
||||
// 仪表盘标题。
|
||||
text: '内存使用情况',
|
||||
left: 'center',
|
||||
show: true, // 是否显示标题,默认 true。
|
||||
offsetCenter: [0, '20%'], //相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
|
||||
color: 'yellow', // 文字的颜色,默认 #333。
|
||||
fontSize: 20 // 文字的字体大小,默认 15。
|
||||
textStyle: {
|
||||
color: 'yellow', // 文字的颜色,默认 #333。
|
||||
fontSize: 20 // 文字的字体大小,默认 15。
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
show: false,
|
||||
|
|
@ -146,12 +148,10 @@ const usedmemoryEchartChika = reactive<any>({
|
|||
show: true
|
||||
},
|
||||
detail: {
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
// 里面文字下的数值大小(50)
|
||||
fontSize: 15,
|
||||
color: '#FFFFFF'
|
||||
},
|
||||
fontWeight: 'normal',
|
||||
// 里面文字下的数值大小(50)
|
||||
fontSize: 15,
|
||||
color: '#FFFFFF',
|
||||
valueAnimation: true
|
||||
},
|
||||
progress: {
|
||||
|
|
@ -159,10 +159,10 @@ const usedmemoryEchartChika = reactive<any>({
|
|||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}) as EChartsOption
|
||||
|
||||
// 指令使用情况
|
||||
const commandStatsRefChika = reactive({
|
||||
const commandStatsRefChika = reactive<EChartsOption>({
|
||||
title: {
|
||||
text: '命令统计',
|
||||
left: 'center'
|
||||
|
|
@ -205,7 +205,7 @@ const commandStatsRefChika = reactive({
|
|||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}) as EChartsOption
|
||||
|
||||
/** 加载数据 */
|
||||
const getSummary = () => {
|
||||
|
|
@ -216,7 +216,8 @@ const getSummary = () => {
|
|||
|
||||
/** 命令使用情况 */
|
||||
const initCommandStatsChart = async () => {
|
||||
usedmemoryEchartChika.series[0].data = []
|
||||
const usedMemorySeries = usedmemoryEchartChika.series![0] as any
|
||||
usedMemorySeries.data = []
|
||||
// 发起请求
|
||||
try {
|
||||
const data = await RedisApi.getCache()
|
||||
|
|
@ -231,8 +232,8 @@ const initCommandStatsChart = async () => {
|
|||
})
|
||||
nameList.push(row.command)
|
||||
})
|
||||
commandStatsRefChika.legend.data = nameList
|
||||
commandStatsRefChika.series[0].data = commandStats
|
||||
;(commandStatsRefChika.legend as any).data = nameList
|
||||
;(commandStatsRefChika.series![0] as any).data = commandStats
|
||||
} catch {}
|
||||
}
|
||||
const usedMemoryInstance = async () => {
|
||||
|
|
@ -240,7 +241,8 @@ const usedMemoryInstance = async () => {
|
|||
const data = await RedisApi.getCache()
|
||||
cache.value = data
|
||||
// 仪表盘详情,用于显示数据。
|
||||
usedmemoryEchartChika.series[0].detail = {
|
||||
const usedMemorySeries = usedmemoryEchartChika.series![0] as any
|
||||
usedMemorySeries.detail = {
|
||||
show: true, // 是否显示详情,默认 true。
|
||||
offsetCenter: [0, '50%'], // 相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
|
||||
color: 'auto', // 文字的颜色,默认 auto。
|
||||
|
|
@ -248,12 +250,12 @@ const usedMemoryInstance = async () => {
|
|||
formatter: cache.value!.info.used_memory_human // 格式化函数或者字符串
|
||||
}
|
||||
|
||||
usedmemoryEchartChika.series[0].data[0] = {
|
||||
usedMemorySeries.data[0] = {
|
||||
value: cache.value!.info.used_memory_human,
|
||||
name: '内存消耗'
|
||||
}
|
||||
console.log(cache.value!.info)
|
||||
usedmemoryEchartChika.tooltip = {
|
||||
;(usedmemoryEchartChika as any).tooltip = {
|
||||
formatter: '{b} <br/>{a} : ' + cache.value!.info.used_memory_human
|
||||
}
|
||||
} catch {}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-360px"
|
||||
:shortcuts="defaultShortcuts"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-360px"
|
||||
:shortcuts="defaultShortcuts"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,16 @@ defineOptions({ name: 'OperationDataCard' })
|
|||
|
||||
const router = useRouter() // 路由
|
||||
|
||||
type OperationDataItem = {
|
||||
name: string
|
||||
value: number
|
||||
routerName: string
|
||||
prefix?: string
|
||||
decimals?: number
|
||||
}
|
||||
|
||||
/** 数据 */
|
||||
const data = reactive({
|
||||
const data = reactive<Record<string, OperationDataItem>>({
|
||||
orderUndelivered: { name: '待发货订单', value: 9, routerName: 'TradeOrder' },
|
||||
orderAfterSaleApply: { name: '退款中订单', value: 4, routerName: 'TradeAfterSale' },
|
||||
orderWaitePickUp: { name: '待核销订单', value: 0, routerName: 'TradeOrder' },
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
import dayjs, { Dayjs } from 'dayjs'
|
||||
import { EChartsOption } from 'echarts'
|
||||
import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
|
||||
import { fenToYuan } from '@/utils'
|
||||
import { fenToYuanNumber } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { CardTitle } from '@/components/Card'
|
||||
|
||||
|
|
@ -185,11 +185,11 @@ const getOrderCountTrendComparison = async (
|
|||
for (let item of list) {
|
||||
dates.push(item.value.date)
|
||||
if (series.length === 2) {
|
||||
series[0].data.push(fenToYuan(item?.value?.orderPayPrice || 0)) // 当前金额
|
||||
series[0].data.push(fenToYuanNumber(item?.value?.orderPayPrice || 0)) // 当前金额
|
||||
series[1].data.push(item?.value?.orderPayCount || 0) // 当前数量
|
||||
} else {
|
||||
series[0].data.push(fenToYuan(item?.reference?.orderPayPrice || 0)) // 对照金额
|
||||
series[1].data.push(fenToYuan(item?.value?.orderPayPrice || 0)) // 当前金额
|
||||
series[0].data.push(fenToYuanNumber(item?.reference?.orderPayPrice || 0)) // 对照金额
|
||||
series[1].data.push(fenToYuanNumber(item?.value?.orderPayPrice || 0)) // 当前金额
|
||||
series[2].data.push(item?.reference?.orderPayCount || 0) // 对照数量
|
||||
series[3].data.push(item?.value?.orderPayCount || 0) // 当前数量
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ const getOrderCountTrendComparison = async (
|
|||
eChartOptions.xAxis!['data'] = dates
|
||||
eChartOptions.series = series
|
||||
// legend 在 4 个切换到 2 个的时候,还是显示成 4 个,需要手动配置一下
|
||||
eChartOptions.legend['data'] = series.map((item) => item.name)
|
||||
;(eChartOptions.legend as Record<string, unknown>)['data'] = series.map((item) => item.name)
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,16 +10,16 @@
|
|||
title="销售额"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(orderComparison?.value?.orderPayPrice || 0)"
|
||||
:reference="fenToYuan(orderComparison?.reference?.orderPayPrice || 0)"
|
||||
:value="fenToYuanNumber(orderComparison?.value?.orderPayPrice || 0)"
|
||||
:reference="fenToYuanNumber(orderComparison?.reference?.orderPayPrice || 0)"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
|
||||
<ComparisonCard
|
||||
tag="今日"
|
||||
title="用户访问量"
|
||||
:value="userComparison?.value?.visitUserCount || 0"
|
||||
:reference="userComparison?.reference?.visitUserCount || 0"
|
||||
:value="Number(userComparison?.value?.visitUserCount || 0)"
|
||||
:reference="Number(userComparison?.reference?.visitUserCount || 0)"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
|
||||
|
|
@ -71,7 +71,7 @@ import * as MemberStatisticsApi from '@/api/mall/statistics/member'
|
|||
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
|
||||
import { TradeOrderSummaryRespVO } from '@/api/mall/statistics/trade'
|
||||
import { MemberCountRespVO } from '@/api/mall/statistics/member'
|
||||
import { fenToYuan } from '@/utils'
|
||||
import { fenToYuanNumber } from '@/utils'
|
||||
import ComparisonCard from './components/ComparisonCard.vue'
|
||||
import MemberStatisticsCard from './components/MemberStatisticsCard.vue'
|
||||
import OperationDataCard from './components/OperationDataCard.vue'
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ const formData = ref({
|
|||
id: undefined,
|
||||
name: '',
|
||||
picUrl: '',
|
||||
sort: 0,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
description: ''
|
||||
})
|
||||
|
|
@ -115,6 +116,7 @@ const resetForm = () => {
|
|||
id: undefined,
|
||||
name: '',
|
||||
picUrl: '',
|
||||
sort: 0,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
description: ''
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@
|
|||
:key="index"
|
||||
:src="picUrl"
|
||||
:preview-src-list="scope.row.picUrls"
|
||||
:initial-index="index"
|
||||
:initial-index="Number(index)"
|
||||
class="h-40px w-40px"
|
||||
preview-teleported
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -32,9 +32,10 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<PropertyApi.PropertyVO>({
|
||||
id: undefined,
|
||||
name: ''
|
||||
name: '',
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||
|
|
@ -69,7 +70,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as PropertyApi.PropertyVO
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await PropertyApi.createProperty(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
@ -89,7 +90,8 @@ const submitForm = async () => {
|
|||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: ''
|
||||
name: '',
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
v-for="item in propertyOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:value="item.id!"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -101,15 +101,15 @@ const { params } = useRoute() // 查询参数
|
|||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数据
|
||||
const list = ref<PropertyApi.PropertyValueVO[]>([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
propertyId: params.propertyId,
|
||||
propertyId: Number(params.propertyId),
|
||||
name: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const propertyOptions = ref([]) // 属性项的列表
|
||||
const propertyOptions = ref<PropertyApi.PropertyVO[]>([]) // 属性项的列表
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
|
|
|||
|
|
@ -493,22 +493,17 @@ const validateData = (propertyList: any[]) => {
|
|||
}
|
||||
|
||||
/** 构建所有排列组合 */
|
||||
const build = (propertyValuesList: Property[][]) => {
|
||||
const build = (propertyValuesList: Property[][]): Property[][] => {
|
||||
if (propertyValuesList.length === 0) {
|
||||
return []
|
||||
} else if (propertyValuesList.length === 1) {
|
||||
return propertyValuesList[0]
|
||||
return propertyValuesList[0].map((item) => [item])
|
||||
} else {
|
||||
const result: Property[][] = []
|
||||
const rest = build(propertyValuesList.slice(1))
|
||||
for (let i = 0; i < propertyValuesList[0].length; i++) {
|
||||
for (let j = 0; j < rest.length; j++) {
|
||||
// 第一次不是数组结构,后面的都是数组结构
|
||||
if (Array.isArray(rest[j])) {
|
||||
result.push([propertyValuesList[0][i], ...rest[j]])
|
||||
} else {
|
||||
result.push([propertyValuesList[0][i], rest[j]])
|
||||
}
|
||||
result.push([propertyValuesList[0][i], ...rest[j]])
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import { fenToYuan } from '@/utils'
|
|||
defineOptions({ name: 'SkuTableSelect' })
|
||||
|
||||
const props = defineProps({
|
||||
spuId: propTypes.number.def(null)
|
||||
spuId: propTypes.number.def(undefined)
|
||||
})
|
||||
|
||||
const list = ref<any[]>([]) // 列表的数据
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
<UploadImg v-model="formData.picUrl" :disabled="isDetail" height="80px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品轮播图" prop="sliderPicUrls">
|
||||
<UploadImgs v-model="formData.sliderPicUrls" :disabled="isDetail" />
|
||||
<UploadImgs v-model="sliderPicUrls" :disabled="isDetail" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
|
@ -92,6 +92,12 @@ const formData = reactive<Spu>({
|
|||
introduction: '', // 商品简介
|
||||
brandId: undefined // 商品品牌
|
||||
})
|
||||
const sliderPicUrls = computed({
|
||||
get: () => formData.sliderPicUrls || [],
|
||||
set: (value: string[]) => {
|
||||
formData.sliderPicUrls = value
|
||||
}
|
||||
})
|
||||
const rules = reactive({
|
||||
name: [required],
|
||||
categoryId: [required],
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
import * as PropertyApi from '@/api/mall/product/property'
|
||||
import { PropertyAndValues } from '@/views/mall/product/spu/components'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
defineOptions({ name: 'ProductAttributes' })
|
||||
|
||||
|
|
@ -82,8 +83,8 @@ const attributeList = ref<PropertyAndValues[]>([]) // 商品属性列表
|
|||
const attributeOptions = ref([] as PropertyApi.PropertyValueVO[]) // 商品属性名称下拉框
|
||||
const props = defineProps({
|
||||
propertyList: {
|
||||
type: Array,
|
||||
default: () => {}
|
||||
type: Array as PropType<PropertyAndValues[]>,
|
||||
default: () => []
|
||||
},
|
||||
isDetail: propTypes.bool.def(false) // 是否作为详情组件
|
||||
})
|
||||
|
|
@ -92,7 +93,7 @@ watch(
|
|||
() => props.propertyList,
|
||||
(data) => {
|
||||
if (!data) return
|
||||
attributeList.value = data as any
|
||||
attributeList.value = data
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
|
|
@ -114,9 +115,9 @@ const handleCloseProperty = (index: number) => {
|
|||
/** 显示输入框并获取焦点 */
|
||||
const showInput = async (index: number) => {
|
||||
attributeIndex.value = index
|
||||
inputRef.value[index].focus()
|
||||
inputRef.value[index]?.focus()
|
||||
// 获取属性下拉选项
|
||||
await getAttributeOptions(attributeList.value[index].id)
|
||||
await getAttributeOptions(attributeList.value[index]!.id)
|
||||
}
|
||||
|
||||
/** 输入框失去焦点或点击回车时触发 */
|
||||
|
|
@ -124,7 +125,8 @@ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成
|
|||
const handleInputConfirm = async (index: number, propertyId: number) => {
|
||||
if (inputValue.value) {
|
||||
// 1. 重复添加校验
|
||||
if (attributeList.value[index].values.find((item) => item.name === inputValue.value)) {
|
||||
const values = attributeList.value[index]!.values || []
|
||||
if (values.find((item) => item.name === inputValue.value)) {
|
||||
message.warning('已存在相同属性值,请重试')
|
||||
attributeIndex.value = null
|
||||
inputValue.value = ''
|
||||
|
|
@ -136,7 +138,8 @@ const handleInputConfirm = async (index: number, propertyId: number) => {
|
|||
if (existValue) {
|
||||
attributeIndex.value = null
|
||||
inputValue.value = ''
|
||||
attributeList.value[index].values.push({ id: existValue.id, name: existValue.name })
|
||||
values.push({ id: existValue.id!, name: existValue.name })
|
||||
attributeList.value[index]!.values = values
|
||||
emit('success', attributeList.value)
|
||||
return
|
||||
}
|
||||
|
|
@ -144,7 +147,8 @@ const handleInputConfirm = async (index: number, propertyId: number) => {
|
|||
// 2.2 情况二:新属性值,则进行保存
|
||||
try {
|
||||
const id = await PropertyApi.createPropertyValue({ propertyId, name: inputValue.value })
|
||||
attributeList.value[index].values.push({ id, name: inputValue.value })
|
||||
values.push({ id, name: inputValue.value })
|
||||
attributeList.value[index]!.values = values
|
||||
message.success(t('common.createSuccess'))
|
||||
emit('success', attributeList.value)
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import * as PropertyApi from '@/api/mall/product/property'
|
||||
import type { PropType } from 'vue'
|
||||
import { PropertyAndValues } from '@/views/mall/product/spu/components'
|
||||
|
||||
defineOptions({ name: 'ProductPropertyForm' })
|
||||
|
||||
|
|
@ -51,12 +53,12 @@ const formRules = reactive({
|
|||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const attributeList = ref([]) // 商品属性列表
|
||||
const attributeList = ref<PropertyAndValues[]>([]) // 商品属性列表
|
||||
const attributeOptions = ref([] as PropertyApi.PropertyVO[]) // 商品属性名称下拉框
|
||||
const props = defineProps({
|
||||
propertyList: {
|
||||
type: Array,
|
||||
default: () => {}
|
||||
type: Array as PropType<PropertyAndValues[]>,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -99,7 +101,7 @@ const submitForm = async () => {
|
|||
if (existProperty) {
|
||||
// 添加到属性列表
|
||||
attributeList.value.push({
|
||||
id: existProperty.id,
|
||||
id: existProperty.id!,
|
||||
...formData.value,
|
||||
values: []
|
||||
})
|
||||
|
|
|
|||
|
|
@ -130,8 +130,8 @@ const getSpuDetails = async (
|
|||
if (typeof products !== 'undefined') {
|
||||
const product = products.find((item) => item.skuId === sku.id)
|
||||
if (product) {
|
||||
product.bargainFirstPrice = formatToFraction(product.bargainFirstPrice)
|
||||
product.bargainMinPrice = formatToFraction(product.bargainMinPrice)
|
||||
product.bargainFirstPrice = Number(formatToFraction(product.bargainFirstPrice))
|
||||
product.bargainMinPrice = Number(formatToFraction(product.bargainMinPrice))
|
||||
}
|
||||
config = product || config
|
||||
}
|
||||
|
|
@ -163,8 +163,8 @@ const open = async (type: string, id?: number) => {
|
|||
id
|
||||
)) as BargainActivityApi.BargainActivityVO
|
||||
// 用户每次砍价金额分转元, 分转元
|
||||
data.randomMinPrice = formatToFraction(data.randomMinPrice)
|
||||
data.randomMaxPrice = formatToFraction(data.randomMaxPrice)
|
||||
data.randomMinPrice = Number(formatToFraction(data.randomMinPrice))
|
||||
data.randomMaxPrice = Number(formatToFraction(data.randomMaxPrice))
|
||||
// 对齐活动商品处理结构
|
||||
await getSpuDetails(
|
||||
data.spuId!,
|
||||
|
|
|
|||
|
|
@ -39,23 +39,6 @@
|
|||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['promotion:bargain-record:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['promotion:bargain-record:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
|
@ -152,10 +135,9 @@ const queryParams = reactive({
|
|||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
status: null,
|
||||
createTime: []
|
||||
createTime: [] as string[]
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ const getSpuDetails = async (
|
|||
if (typeof products !== 'undefined') {
|
||||
const product = products.find((item) => item.skuId === sku.id)
|
||||
if (product) {
|
||||
product.combinationPrice = formatToFraction(product.combinationPrice)
|
||||
product.combinationPrice = Number(formatToFraction(product.combinationPrice))
|
||||
}
|
||||
config = product || config
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ const dialogVisible = ref(false)
|
|||
const queryParams = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
name: undefined as string | undefined,
|
||||
status: undefined
|
||||
})
|
||||
|
||||
|
|
@ -235,8 +235,8 @@ const resetQuery = () => {
|
|||
queryParams.value = {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: '',
|
||||
createTime: []
|
||||
name: undefined,
|
||||
status: undefined
|
||||
}
|
||||
getList()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ onMounted(() => {
|
|||
for (const dict of getIntDictOptions(DICT_TYPE.PROMOTION_COUPON_STATUS)) {
|
||||
statusTabs.push({
|
||||
label: dict.label,
|
||||
value: dict.value as string
|
||||
value: String(dict.value)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
>
|
||||
<el-date-picker
|
||||
v-model="formData.validTimes"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
type="datetimerange"
|
||||
value-format="x"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
:key="index"
|
||||
:src="url"
|
||||
:preview-src-list="scope.row.previewPicUrls"
|
||||
:initial-index="index"
|
||||
:initial-index="Number(index)"
|
||||
preview-teleported
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -131,7 +131,7 @@ const queryParams = reactive({
|
|||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
createTime: []
|
||||
createTime: [] as string[]
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
:key="index"
|
||||
:src="url"
|
||||
:preview-src-list="scope.row.previewPicUrls"
|
||||
:initial-index="index"
|
||||
:initial-index="Number(index)"
|
||||
preview-teleported
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -147,7 +147,7 @@ const queryParams = reactive({
|
|||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
createTime: []
|
||||
createTime: [] as string[]
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
:key="pointActivity.id"
|
||||
class="select-box spu-pic"
|
||||
>
|
||||
<el-tooltip :content="pointActivity.name">
|
||||
<el-tooltip :content="pointActivity.spuName">
|
||||
<div class="relative h-full w-full">
|
||||
<el-image :src="pointActivity.picUrl" class="h-full w-full" />
|
||||
<Icon
|
||||
|
|
|
|||
|
|
@ -90,8 +90,11 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|||
const formData = ref<RewardActivityApi.RewardActivityVO>({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: []
|
||||
} as RewardActivityApi.RewardActivityVO)
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '活动名称不能为空', trigger: 'blur' }],
|
||||
startAndEndTime: [{ required: true, message: '活动时间不能为空', trigger: 'blur' }],
|
||||
|
|
@ -113,9 +116,16 @@ const open = async (type: string, id?: number) => {
|
|||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = await RewardActivityApi.getReward(id)
|
||||
const data: RewardActivityApi.RewardActivityVO = {
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
...(await RewardActivityApi.getReward(id))
|
||||
}
|
||||
// 转区段时间
|
||||
data.startAndEndTime = [data.startTime, data.endTime]
|
||||
if (data.startTime && data.endTime) {
|
||||
data.startAndEndTime = [data.startTime, data.endTime]
|
||||
}
|
||||
// 规则分转元
|
||||
data.rules?.forEach((item: any) => {
|
||||
item.discountPrice = fenToYuan(item.discountPrice || 0)
|
||||
|
|
@ -180,8 +190,11 @@ const resetForm = () => {
|
|||
formData.value = {
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: []
|
||||
} as RewardActivityApi.RewardActivityVO
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品范围 */
|
||||
|
|
@ -193,13 +206,8 @@ const getProductScope = async () => {
|
|||
break
|
||||
case PromotionProductScopeEnum.CATEGORY.scope:
|
||||
await nextTick()
|
||||
let productCategoryIds = formData.value.productScopeValues as any
|
||||
if (Array.isArray(productCategoryIds) && productCategoryIds.length === 1) {
|
||||
// 单选时使用数组不能反显
|
||||
productCategoryIds = productCategoryIds[0]
|
||||
}
|
||||
// 设置品类编号
|
||||
formData.value.productCategoryIds = productCategoryIds
|
||||
formData.value.productCategoryIds = formData.value.productScopeValues
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
|
@ -213,9 +221,7 @@ function setProductScopeValues(data: any) {
|
|||
data.productScopeValues = formData.value.productSpuIds
|
||||
break
|
||||
case PromotionProductScopeEnum.CATEGORY.scope:
|
||||
data.productScopeValues = Array.isArray(formData.value.productCategoryIds)
|
||||
? formData.value.productCategoryIds
|
||||
: [formData.value.productCategoryIds]
|
||||
data.productScopeValues = formData.value.productCategoryIds
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ const initGiveCouponList = async () => {
|
|||
if (isEmpty(rewardRule.value) || isEmpty(rewardRule.value.giveCouponTemplateCounts)) {
|
||||
return
|
||||
}
|
||||
const tempLateIds = Object.keys(rewardRule.value.giveCouponTemplateCounts!)
|
||||
const tempLateIds = Object.keys(rewardRule.value.giveCouponTemplateCounts!).map(Number)
|
||||
const data = await CouponTemplateApi.getCouponTemplateList(tempLateIds)
|
||||
if (!data) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ const getSpuDetails = async (
|
|||
typeof skuIds === 'undefined' ? spu?.skus : spu?.skus?.filter((sku) => skuIds.includes(sku.id!))
|
||||
selectSkus?.forEach((sku) => {
|
||||
let config: SeckillActivityApi.SeckillProductVO = {
|
||||
spuId: spu.id!,
|
||||
skuId: sku.id!,
|
||||
stock: 0,
|
||||
seckillPrice: 0
|
||||
|
|
@ -113,7 +114,7 @@ const getSpuDetails = async (
|
|||
if (typeof products !== 'undefined') {
|
||||
const product = products.find((item) => item.skuId === sku.id)
|
||||
if (product) {
|
||||
product.seckillPrice = formatToFraction(product.seckillPrice)
|
||||
product.seckillPrice = Number(formatToFraction(product.seckillPrice))
|
||||
}
|
||||
config = product || config
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@
|
|||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as SeckillActivityApi from '@/api/mall/promotion/seckill/seckillActivity'
|
||||
import { SeckillConfigApi } from '@/api/mall/promotion/seckill/seckillConfig'
|
||||
import { SeckillConfigApi, SeckillConfigVO } from '@/api/mall/promotion/seckill/seckillConfig'
|
||||
import SeckillActivityForm from './SeckillActivityForm.vue'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
|
|
@ -235,7 +235,7 @@ const handleDelete = async (id: number) => {
|
|||
} catch {}
|
||||
}
|
||||
|
||||
const configList = ref([]) // 时段配置精简列表
|
||||
const configList = ref<SeckillConfigVO[]>([]) // 时段配置精简列表
|
||||
const formatConfigNames = (configId) => {
|
||||
const config = configList.value.find((item) => item.id === configId)
|
||||
return config != null ? `${config.name}[${config.startTime} ~ ${config.endTime}]` : ''
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ const canAdd = computed(() => {
|
|||
return Activitys.value.length < props.limit
|
||||
})
|
||||
|
||||
// 拼团活动列表
|
||||
// 秒杀活动列表
|
||||
const Activitys = ref<SeckillActivityApi.SeckillActivityVO[]>([])
|
||||
|
||||
watch(
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ const dialogVisible = ref(false)
|
|||
const queryParams = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
name: undefined as string | undefined,
|
||||
status: undefined
|
||||
})
|
||||
|
||||
|
|
@ -234,7 +234,7 @@ const resetQuery = () => {
|
|||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
createTime: []
|
||||
status: undefined
|
||||
}
|
||||
getList()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
:key="index"
|
||||
:src="url"
|
||||
:preview-src-list="scope?.row.sliderPicUrls"
|
||||
:initial-index="index"
|
||||
:initial-index="Number(index)"
|
||||
preview-teleported
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<el-col v-loading="loading" :sm="6" :xs="12">
|
||||
<SummaryCard
|
||||
:decimals="2"
|
||||
:value="fenToYuan(summary?.rechargePrice || 0)"
|
||||
:value="fenToYuanNumber(summary?.rechargePrice || 0)"
|
||||
icon="fa-solid:money-check-alt"
|
||||
icon-bg-color="text-yellow-500"
|
||||
icon-color="bg-yellow-100"
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
<el-col v-loading="loading" :sm="6" :xs="12">
|
||||
<SummaryCard
|
||||
:decimals="2"
|
||||
:value="fenToYuan(summary?.expensePrice || 0)"
|
||||
:value="fenToYuanNumber(summary?.expensePrice || 0)"
|
||||
icon="fa-solid:yen-sign"
|
||||
icon-bg-color="text-green-500"
|
||||
icon-color="bg-green-100"
|
||||
|
|
@ -131,7 +131,7 @@ import {
|
|||
import SummaryCard from '@/components/SummaryCard/index.vue'
|
||||
import { EChartsOption } from 'echarts'
|
||||
import china from '@/assets/map/json/china.json'
|
||||
import { areaReplace, fenToYuan } from '@/utils'
|
||||
import { areaReplace, fenToYuan, fenToYuanNumber } from '@/utils'
|
||||
import { DICT_TYPE, DictDataType, getIntDictOptions } from '@/utils/dict'
|
||||
import echarts from '@/plugins/echarts'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
icon-bg-color="text-green-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.orderPayPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.orderPayPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.orderPayPrice,
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
icon-bg-color="text-yellow-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.afterSaleRefundPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.afterSaleRefundPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.afterSaleRefundPrice,
|
||||
|
|
@ -139,7 +139,7 @@ import { ProductStatisticsApi, ProductStatisticsVO } from '@/api/mall/statistics
|
|||
import SummaryCard from '@/components/SummaryCard/index.vue'
|
||||
import { EChartsOption } from 'echarts'
|
||||
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
|
||||
import { calculateRelativeRate, fenToYuan } from '@/utils'
|
||||
import { calculateRelativeRate, fenToYuanNumber } from '@/utils'
|
||||
import download from '@/utils/download'
|
||||
import { CardTitle } from '@/components/Card'
|
||||
import * as DateUtil from '@/utils/formatTime'
|
||||
|
|
@ -174,8 +174,8 @@ const lineChartOptions = reactive<EChartsOption>({
|
|||
series: [
|
||||
{ name: '商品浏览量', type: 'line', smooth: true, itemStyle: { color: '#B37FEB' } },
|
||||
{ name: '商品访客数', type: 'line', smooth: true, itemStyle: { color: '#FFAB2B' } },
|
||||
{ name: '支付金额', type: 'bar', smooth: true, yAxisIndex: 1, itemStyle: { color: '#1890FF' } },
|
||||
{ name: '退款金额', type: 'bar', smooth: true, yAxisIndex: 1, itemStyle: { color: '#00C050' } }
|
||||
{ name: '支付金额', type: 'bar', yAxisIndex: 1, itemStyle: { color: '#1890FF' } },
|
||||
{ name: '退款金额', type: 'bar', yAxisIndex: 1, itemStyle: { color: '#00C050' } }
|
||||
],
|
||||
toolbox: {
|
||||
feature: {
|
||||
|
|
@ -272,8 +272,8 @@ const getProductStatisticsList = async () => {
|
|||
const list: ProductStatisticsVO[] = await ProductStatisticsApi.getProductStatisticsList({ times })
|
||||
// 处理数据
|
||||
for (let item of list) {
|
||||
item.orderPayPrice = fenToYuan(item.orderPayPrice)
|
||||
item.afterSaleRefundPrice = fenToYuan(item.afterSaleRefundPrice)
|
||||
item.orderPayPrice = fenToYuanNumber(item.orderPayPrice)
|
||||
item.afterSaleRefundPrice = fenToYuanNumber(item.afterSaleRefundPrice)
|
||||
}
|
||||
// 更新 Echarts 数据
|
||||
if (lineChartOptions.dataset && lineChartOptions.dataset['source']) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
title="昨日支付金额"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(summary?.value?.yesterdayPayPrice || 0)"
|
||||
:value="fenToYuanNumber(summary?.value?.yesterdayPayPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
summary?.value?.yesterdayPayPrice,
|
||||
|
|
@ -49,8 +49,8 @@
|
|||
tooltip="本月支付金额"
|
||||
title="本月支付金额"
|
||||
prefix="¥"
|
||||
::decimals="2"
|
||||
:value="fenToYuan(summary?.value?.monthPayPrice || 0)"
|
||||
:decimals="2"
|
||||
:value="fenToYuanNumber(summary?.value?.monthPayPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(summary?.value?.monthPayPrice, summary?.reference?.monthPayPrice)
|
||||
"
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
icon-bg-color="text-blue-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.turnoverPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.turnoverPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.turnoverPrice,
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
icon-bg-color="text-purple-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.orderPayPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.orderPayPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.orderPayPrice,
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
icon-bg-color="text-yellow-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.rechargePrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.rechargePrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.rechargePrice,
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
icon-bg-color="text-green-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.expensePrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.expensePrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.expensePrice,
|
||||
|
|
@ -158,7 +158,7 @@
|
|||
icon-bg-color="text-cyan-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.walletPayPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.walletPayPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.walletPayPrice,
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
icon-bg-color="text-yellow-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.brokerageSettlementPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.brokerageSettlementPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.brokerageSettlementPrice,
|
||||
|
|
@ -194,7 +194,7 @@
|
|||
icon-bg-color="text-blue-500"
|
||||
prefix="¥"
|
||||
:decimals="2"
|
||||
:value="fenToYuan(trendSummary?.value?.afterSaleRefundPrice || 0)"
|
||||
:value="fenToYuanNumber(trendSummary?.value?.afterSaleRefundPrice || 0)"
|
||||
:percent="
|
||||
calculateRelativeRate(
|
||||
trendSummary?.value?.afterSaleRefundPrice,
|
||||
|
|
@ -218,7 +218,7 @@ import SummaryCard from '@/components/SummaryCard/index.vue'
|
|||
import { EChartsOption } from 'echarts'
|
||||
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
|
||||
import { TradeSummaryRespVO, TradeTrendSummaryRespVO } from '@/api/mall/statistics/trade'
|
||||
import { calculateRelativeRate, fenToYuan } from '@/utils'
|
||||
import { calculateRelativeRate, fenToYuanNumber } from '@/utils'
|
||||
import download from '@/utils/download'
|
||||
import { CardTitle } from '@/components/Card'
|
||||
import * as DateUtil from '@/utils/formatTime'
|
||||
|
|
@ -322,10 +322,10 @@ const getTradeStatisticsList = async () => {
|
|||
const list = await TradeStatisticsApi.getTradeStatisticsList({ times })
|
||||
// 处理数据
|
||||
for (let item of list) {
|
||||
item.turnoverPrice = fenToYuan(item.turnoverPrice)
|
||||
item.orderPayPrice = fenToYuan(item.orderPayPrice)
|
||||
item.rechargePrice = fenToYuan(item.rechargePrice)
|
||||
item.expensePrice = fenToYuan(item.expensePrice)
|
||||
item.turnoverPrice = fenToYuanNumber(item.turnoverPrice)
|
||||
item.orderPayPrice = fenToYuanNumber(item.orderPayPrice)
|
||||
item.rechargePrice = fenToYuanNumber(item.rechargePrice)
|
||||
item.expensePrice = fenToYuanNumber(item.expensePrice)
|
||||
}
|
||||
// 更新 Echarts 数据
|
||||
if (lineChartOptions.dataset && lineChartOptions.dataset['source']) {
|
||||
|
|
|
|||
|
|
@ -231,9 +231,27 @@ import { ref, onMounted } from 'vue'
|
|||
import { getCurrentUserId } from '@/utils/auth'
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const port = ref('')
|
||||
const ports = ref([])
|
||||
const reader = ref('')
|
||||
type SerialReader = ReadableStreamDefaultReader<Uint8Array>
|
||||
type SerialPort = {
|
||||
readable: ReadableStream<Uint8Array>
|
||||
open: (options: SerialOptions) => Promise<void>
|
||||
close: () => Promise<void>
|
||||
}
|
||||
type SerialOptions = {
|
||||
baudRate: number
|
||||
dataBits?: number
|
||||
stopBits?: number
|
||||
}
|
||||
type SerialNavigator = Navigator & {
|
||||
serial: {
|
||||
requestPort: () => Promise<SerialPort>
|
||||
getPorts: () => Promise<SerialPort[]>
|
||||
}
|
||||
}
|
||||
|
||||
const port = ref<SerialPort>()
|
||||
const ports = ref<SerialPort[]>([])
|
||||
const reader = ref<SerialReader>()
|
||||
|
||||
defineOptions({ name: 'PickUpOrder' })
|
||||
|
||||
|
|
@ -335,22 +353,17 @@ const handlePickup = () => {
|
|||
const connectToSerialPort = async () => {
|
||||
try {
|
||||
// 判断浏览器支持串口通信
|
||||
if (
|
||||
'serial' in navigator &&
|
||||
navigator.serial != null &&
|
||||
typeof navigator.serial === 'object' &&
|
||||
'requestPort' in navigator.serial
|
||||
) {
|
||||
if ('serial' in navigator) {
|
||||
const serial = (navigator as SerialNavigator).serial
|
||||
// 提示用户选择一个串口
|
||||
port.value = await navigator.serial.requestPort()
|
||||
port.value = await serial.requestPort()
|
||||
// 获取用户之前授予该网站访问权限的所有串口。
|
||||
ports.value = await serial.getPorts()
|
||||
} else {
|
||||
message.error('浏览器不支持扫码枪连接,请更换浏览器重试')
|
||||
return
|
||||
}
|
||||
|
||||
// 获取用户之前授予该网站访问权限的所有串口。
|
||||
ports.value = await navigator.serial.getPorts()
|
||||
|
||||
// console.log(port.value, ports.value);
|
||||
// console.log(port.value)
|
||||
// 等待串口打开
|
||||
|
|
@ -369,6 +382,9 @@ const connectToSerialPort = async () => {
|
|||
|
||||
/** 监听扫码枪输入 */
|
||||
const readData = async () => {
|
||||
if (!port.value) {
|
||||
return
|
||||
}
|
||||
reader.value = port.value.readable.getReader()
|
||||
let data = '' //扫码数据
|
||||
// 监听来自串口的数据
|
||||
|
|
@ -395,10 +411,10 @@ const readData = async () => {
|
|||
|
||||
/** 断开扫码枪 */
|
||||
const cutPort = async () => {
|
||||
if (port.value !== '') {
|
||||
await reader.value.cancel()
|
||||
if (port.value) {
|
||||
await reader.value?.cancel()
|
||||
await port.value.close()
|
||||
port.value = ''
|
||||
port.value = undefined
|
||||
console.log('断开扫码枪连接')
|
||||
message.success('已成功断开扫码枪连接')
|
||||
serialPort.value = false
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ const formData = ref<ConfigApi.ConfigVO>({
|
|||
|
||||
// 创建一个计算属性,用于将 pointTradeDeductUnitPrice 显示为带两位小数的形式
|
||||
const computedPointTradeDeductUnitPrice = computed({
|
||||
get: () => (formData.value.pointTradeDeductUnitPrice / 100).toFixed(2),
|
||||
set: (newValue: number) => {
|
||||
formData.value.pointTradeDeductUnitPrice = Math.round(newValue * 100)
|
||||
get: () => formData.value.pointTradeDeductUnitPrice / 100,
|
||||
set: (newValue?: number) => {
|
||||
formData.value.pointTradeDeductUnitPrice = Math.round((newValue ?? 0) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -81,15 +81,15 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined as unknown as number,
|
||||
parentId: undefined as unknown as number,
|
||||
code: undefined as unknown as string,
|
||||
name: undefined as unknown as string,
|
||||
itemOrProduct: MesItemOrProductEnum.ITEM.value as string,
|
||||
const formData = ref<MdItemTypeVO>({
|
||||
id: undefined,
|
||||
parentId: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
itemOrProduct: MesItemOrProductEnum.ITEM.value,
|
||||
sort: 0,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined as unknown as string
|
||||
remark: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
parentId: [{ required: true, message: '上级分类不能为空', trigger: 'blur' }],
|
||||
|
|
@ -133,7 +133,7 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as MdItemTypeVO
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await MdItemTypeApi.createItemType(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ const filterNode = (value: string, data: MdItemTypeVO) => {
|
|||
if (!value) {
|
||||
return true
|
||||
}
|
||||
return data.name?.includes(value)
|
||||
return data.name?.includes(value) ?? false
|
||||
}
|
||||
|
||||
/** 监听搜索关键字变化,触发树过滤 */
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
v-for="item in primaryUnitList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:value="item.id!"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -83,15 +83,15 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined as unknown as number,
|
||||
code: undefined as unknown as string,
|
||||
name: undefined as unknown as string,
|
||||
primaryFlag: true as boolean,
|
||||
primaryId: undefined as unknown as number,
|
||||
changeRate: undefined as unknown as number,
|
||||
const formData = ref<MdUnitMeasureVO>({
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
primaryFlag: true,
|
||||
primaryId: undefined,
|
||||
changeRate: undefined,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined as unknown as string
|
||||
remark: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
code: [{ required: true, message: '单位编码不能为空', trigger: 'blur' }],
|
||||
|
|
@ -136,13 +136,13 @@ const submitForm = async () => {
|
|||
await formRef.value.validate()
|
||||
// 如果是主单位,清空主单位和换算比例
|
||||
if (formData.value.primaryFlag) {
|
||||
formData.value.primaryId = undefined as unknown as number
|
||||
formData.value.changeRate = undefined as unknown as number
|
||||
formData.value.primaryId = undefined
|
||||
formData.value.changeRate = undefined
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as MdUnitMeasureVO
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await MdUnitMeasureApi.createUnitMeasure(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
class="!w-1/1"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option v-for="item in filteredList" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-option v-for="item in filteredList" :key="item.id" :label="item.name" :value="item.id!">
|
||||
<div class="flex items-center gap-8px">
|
||||
<span>{{ item.name }}</span>
|
||||
<el-tag v-if="item.code" size="small" type="info" class="ml-4px">
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ const props = withDefaults(
|
|||
workOrderId?: number // 可选,打开弹窗时默认按此工单过滤
|
||||
workstationId?: number // 可选,打开弹窗时默认按此工位过滤
|
||||
statuses?: number[] // 可选,任务状态列表(IN 查询)
|
||||
m?: boolean // 是否禁用
|
||||
disabled?: boolean // 是否禁用
|
||||
clearable?: boolean // 是否允许清空
|
||||
placeholder?: string // 占位文字
|
||||
}>(),
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue