From 2c7c0d8523909254c76d5cb57d7a2d2a39781462 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Fri, 17 Feb 2023 11:46:07 +0800 Subject: [PATCH] =?UTF-8?q?:rocket:=20push=20=E6=A8=A1=E5=9D=97=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/push/pushPassList/PassListModal.vue | 10 +++++++++- src/views/common/push/pushPassList/index.vue | 5 +++++ src/views/common/push/pushPassList/passList.data.ts | 9 ++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/views/common/push/pushPassList/PassListModal.vue b/src/views/common/push/pushPassList/PassListModal.vue index 90cdbb5..e138ecd 100644 --- a/src/views/common/push/pushPassList/PassListModal.vue +++ b/src/views/common/push/pushPassList/PassListModal.vue @@ -14,16 +14,18 @@ * Copyright © 2020-2022 entfrm All rights reserved. * author entfrm开发团队-王翔 */ - import { ref, unref } from 'vue'; + import {ref, toRaw, unref} from 'vue'; import { BasicForm, useForm } from '/@/components/Form/index'; import { formSchema } from './passList.data'; import { addPushPassList, editPushPassList, getPushPassList } from '/@/api/platform/common/controller/pushPassList'; import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal'; + import { useRoute } from "vue-router"; /** 通用变量统一声明区域 */ const tag = ref>(''); /** https://v3.cn.vuejs.org/api/options-data.html#emits */ const emit = defineEmits(['success', 'register']); + const router = useRoute(); const [registerForm, { resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({ labelWidth: 100, schemas: formSchema, @@ -38,6 +40,12 @@ tag.value = data._tag; const refId = data.record?.id; const props: Partial = { confirmLoading: false }; + await updateSchema([ + { + field: 'type', + defaultValue: router.query.type + }, + ]); // 采用tag标签区分操作 switch (unref(tag)) { case 'add': diff --git a/src/views/common/push/pushPassList/index.vue b/src/views/common/push/pushPassList/index.vue index 2a3ee4e..8337692 100644 --- a/src/views/common/push/pushPassList/index.vue +++ b/src/views/common/push/pushPassList/index.vue @@ -51,6 +51,7 @@ import PassListModal from './PassListModal.vue'; import { columns, searchFormSchema } from './passList.data'; import { useMessage } from '/@/hooks/web/useMessage'; + import { useRoute } from "vue-router"; /** 类型规范统一声明定义区域 */ interface TableState { @@ -65,6 +66,7 @@ // 非多个禁用 multiple: true }); + const router = useRoute(); const { createConfirm, createMessage } = useMessage(); const [registerModal, { openModal }] = useModal(); const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ @@ -90,6 +92,9 @@ slots: { customRender: 'action' }, fixed: false }, + searchInfo: { + type: router.query.type + }, handleSearchInfoFn: () => clearSelectedRowKeys() }); diff --git a/src/views/common/push/pushPassList/passList.data.ts b/src/views/common/push/pushPassList/passList.data.ts index 5cb3ae8..0e6872a 100644 --- a/src/views/common/push/pushPassList/passList.data.ts +++ b/src/views/common/push/pushPassList/passList.data.ts @@ -43,6 +43,13 @@ export const formSchema: FormSchema[] = [ component: 'Input', show: false }, + { + field: 'type', + label: '名单类型', + component: 'Input', + required: true, + show: false + }, { field: 'name', label: '推送名称', @@ -60,5 +67,5 @@ export const formSchema: FormSchema[] = [ colProps: { span: 24 } - } + }, ];