update 修改页面代码 去除ele的引入以及vue的类型声明

This commit is contained in:
LiuHao
2023-06-06 22:23:43 +08:00
parent 490d4ef47e
commit 6af68085ff
35 changed files with 704 additions and 773 deletions

View File

@ -145,8 +145,6 @@ import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenant
import { selectTenantPackage } from '@/api/system/tenantPackage';
import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
import { TenantPkgVO } from '@/api/system/tenantPackage/types';
import { ComponentInternalInstance } from 'vue';
import { ElForm } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -160,8 +158,8 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref(ElForm);
const tenantFormRef = ref(ElForm);
const queryFormRef = ref<ElFormInstance>();
const tenantFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
@ -253,7 +251,7 @@ const cancel = () => {
// 表单重置
const reset = () => {
form.value = {...initFormData};
tenantFormRef.value.resetFields();
tenantFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
@ -264,7 +262,7 @@ const handleQuery = () => {
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields();
queryFormRef.value?.resetFields();
handleQuery();
}
@ -292,7 +290,7 @@ const handleUpdate = (row?: TenantVO) => {
dialog.title = "修改租户";
nextTick(async () => {
reset();
getTenantPackage();
await getTenantPackage();
const _id = row?.id || ids.value[0];
const res = await getTenant(_id);
loading.value = false;
@ -302,7 +300,7 @@ const handleUpdate = (row?: TenantVO) => {
/** 提交按钮 */
const submitForm = () => {
tenantFormRef.value.validate(async (valid: boolean) => {
tenantFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
@ -323,7 +321,7 @@ const handleDelete = async (row?: TenantVO) => {
await proxy?.$modal.confirm('是否确认删除租户编号为"' + _ids + '"的数据项?')
loading.value = true;
await delTenant(_ids).finally(() => loading.value = false);
getList();
await getList();
proxy?.$modal.msgSuccess("删除成功");
@ -335,7 +333,7 @@ const handleSyncTenantPackage = async (row: TenantVO) => {
await proxy?.$modal.confirm('是否确认同步租户套餐租户编号为"' + row.tenantId + '"的数据项?');
loading.value = true;
await syncTenantPackage(row.tenantId, row.packageId);
getList();
await getList();
proxy?.$modal.msgSuccess("同步成功");
} catch {return} finally {
loading.value = false;