diff --git a/package.json b/package.json index dce5244d..1a836c5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yudao-ui-admin-vue3", - "version": "1.7.1-snapshot.1961", + "version": "1.7.2-snapshot", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index d3b18d9c..55e933ed 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -272,7 +272,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/manager/task-assign-rule', component: () => import('@/views/bpm/taskAssignRule/index.vue'), - name: 'BpmTaskAssignRule', + name: 'BpmTaskAssignRuleList', meta: { noCache: true, hidden: true, diff --git a/src/utils/routerHelper.ts b/src/utils/routerHelper.ts index af6a9c3c..a6825653 100644 --- a/src/utils/routerHelper.ts +++ b/src/utils/routerHelper.ts @@ -1,10 +1,22 @@ +import type { RouteLocationNormalized, Router, RouteRecordNormalized } from 'vue-router' import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' -import type { Router, RouteLocationNormalized, RouteRecordNormalized } from 'vue-router' import { isUrl } from '@/utils/is' -import { omit, cloneDeep } from 'lodash-es' +import { cloneDeep, omit } from 'lodash-es' const modules = import.meta.glob('../views/**/*.{vue,tsx}') - +/** + * 注册一个异步组件 + * @param componentPath 例:/bpm/oa/leave/detail + */ +export const registerComponent = (componentPath: string) => { + for (const item in modules) { + if (item.includes(componentPath)) { + // 使用异步组件的方式来动态加载组件 + // @ts-ignore + return defineAsyncComponent(modules[item]) + } + } +} /* Layout */ export const Layout = () => import('@/layout/Layout.vue') diff --git a/src/views/bpm/form/editor/index.vue b/src/views/bpm/form/editor/index.vue index c56a7747..f11c1228 100644 --- a/src/views/bpm/form/editor/index.vue +++ b/src/views/bpm/form/editor/index.vue @@ -44,10 +44,13 @@ import { CommonStatusEnum } from '@/utils/constants' import * as FormApi from '@/api/bpm/form' import FcDesigner from '@form-create/designer' import { encodeConf, encodeFields, setConfAndFields } from '@/utils/formCreate' +import { useTagsViewStore } from '@/store/modules/tagsView' const { t } = useI18n() // 国际化 const message = useMessage() // 消息 -const { query } = useRoute() // 路由 +const { push, currentRoute } = useRouter() // 路由 +const { query } = useRoute() // 路由信息 +const { delView } = useTagsViewStore() // 视图操作 const designer = ref() // 表单设计器 const dialogVisible = ref(false) // 弹窗是否展示 @@ -88,10 +91,16 @@ const submitForm = async () => { message.success(t('common.updateSuccess')) } dialogVisible.value = false + close() } finally { formLoading.value = false } } +/** 关闭按钮 */ +const close = () => { + delView(unref(currentRoute)) + push('/bpm/manager/form') +} /** 初始化 **/ onMounted(async () => { diff --git a/src/views/bpm/form/index.vue b/src/views/bpm/form/index.vue index 915bd0bd..48bb3698 100644 --- a/src/views/bpm/form/index.vue +++ b/src/views/bpm/form/index.vue @@ -2,26 +2,33 @@ - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 + + + + 新增 @@ -30,38 +37,38 @@ - - - + + + - + - + - diff --git a/src/views/mp/autoReply/components/ReplyTable.vue b/src/views/mp/autoReply/components/ReplyTable.vue index ef17dfe8..0b739cef 100644 --- a/src/views/mp/autoReply/components/ReplyTable.vue +++ b/src/views/mp/autoReply/components/ReplyTable.vue @@ -93,7 +93,6 @@ - - - diff --git a/src/views/mp/autoReply/components/types.ts b/src/views/mp/autoReply/components/types.ts index d4d79ca4..0d78fd85 100644 --- a/src/views/mp/autoReply/components/types.ts +++ b/src/views/mp/autoReply/components/types.ts @@ -1,5 +1,5 @@ // 消息类型(Follow: 关注时回复;Message: 消息回复;Keyword: 关键词回复) -// 作为tab.name,enum的数字不能随意修改,与api参数相关 +// 作为 tab.name,enum 的数字不能随意修改,与 api 参数相关 export enum MsgType { Follow = 1, Message = 2, @@ -31,6 +31,7 @@ export interface ReplyForm { responseHqMusicUrl?: string } +// TODO @Dhb52:ObjData 这个类名可以在看看,ObjData 有点通用 export interface ObjData { type: ReplyType accountId?: number diff --git a/src/views/mp/autoReply/index.vue b/src/views/mp/autoReply/index.vue index a28d23d5..2d9b492d 100644 --- a/src/views/mp/autoReply/index.vue +++ b/src/views/mp/autoReply/index.vue @@ -49,11 +49,12 @@ :loading="loading" :list="list" :msg-type="msgType" - @on-update="(id) => onUpdate(id)" - @on-delete="(id) => onDelete(id)" + @on-update="onUpdate" + @on-delete="onDelete" /> + @@ -70,7 +71,7 @@ (MsgType.Keyword) -// 允许选择的请求消息类型 -const RequestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'location', 'link'] -// 遮罩层 -const loading = ref(true) -// 总条数 -const total = ref(0) -// 自动回复列表 -const list = ref([]) - +const msgType = ref(MsgType.Keyword) // 消息类型 +const RequestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'location', 'link'] // 允许选择的请求消息类型 +const loading = ref(true) // 遮罩层 +const total = ref(0) // 总条数 +const list = ref([]) // 自动回复列表 +const formRef = ref() // 表单 ref // 查询参数 interface QueryParams { pageNo: number @@ -127,13 +121,9 @@ const queryParams: QueryParams = reactive({ accountId: undefined }) -// 弹出层标题 -const dialogTitle = ref('') -// 是否显示弹出层 -const showFormDialog = ref(false) -// 表单参数 - -const replyForm = ref({}) +const dialogTitle = ref('') // 弹出层标题 +const showFormDialog = ref(false) // 是否显示弹出层 +const replyForm = ref({}) // 表单参数 // 回复消息 const objData = ref({ type: 'text', diff --git a/src/views/mp/components/wx-location/main.vue b/src/views/mp/components/wx-location/main.vue index 17598136..7f1333ee 100644 --- a/src/views/mp/components/wx-location/main.vue +++ b/src/views/mp/components/wx-location/main.vue @@ -1,5 +1,5 @@ -