update 修改页面代码 去除ele的引入以及vue的类型声明
This commit is contained in:
		| @ -31,15 +31,10 @@ | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { PropType } from 'vue'; | ||||
| import { propTypes } from "@/utils/propTypes"; | ||||
|  | ||||
| const prop = defineProps({ | ||||
|     info: { | ||||
|         type: Object as PropType<any>, | ||||
|         default: () => { | ||||
|             return {}; | ||||
|         } | ||||
|     } | ||||
|     info: propTypes.any.def({}) | ||||
| }); | ||||
|  | ||||
| const infoForm = computed(() => prop.info) | ||||
|  | ||||
| @ -117,9 +117,8 @@ import { getGenTable, updateGenTable } from '@/api/tool/gen'; | ||||
| import { DbColumnVO, DbTableVO } from '@/api/tool/gen/types'; | ||||
| import { optionselect as getDictOptionselect } from '@/api/system/dict/type'; | ||||
| import { DictTypeVO } from '@/api/system/dict/type/types'; | ||||
| import basicInfoForm from './basicInfoForm.vue'; | ||||
| import genInfoForm from "./genInfoForm.vue"; | ||||
| import { ComponentInternalInstance } from "vue"; | ||||
| import BasicInfoForm from './basicInfoForm.vue'; | ||||
| import GenInfoForm from "./genInfoForm.vue"; | ||||
|  | ||||
| const route = useRoute(); | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| @ -131,8 +130,8 @@ const columns = ref<DbColumnVO[]>([]); | ||||
| const dictOptions = ref<DictTypeVO[]>([]); | ||||
| const info = ref<Partial<DbTableVO>>({}); | ||||
|  | ||||
| const basicInfo = ref(basicInfoForm); | ||||
| const genInfo = ref(genInfoForm); | ||||
| const basicInfo = ref<InstanceType<typeof BasicInfoForm>>(); | ||||
| const genInfo = ref<InstanceType<typeof GenInfoForm>>(); | ||||
|  | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|  | ||||
| @ -223,7 +223,7 @@ | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { listMenu } from '@/api/system/menu'; | ||||
| import { ComponentInternalInstance, PropType } from 'vue'; | ||||
| import { propTypes } from "@/utils/propTypes"; | ||||
|  | ||||
| interface MenuOptionsType { | ||||
|   menuId: number | string; | ||||
| @ -236,14 +236,8 @@ const menuOptions = ref<Array<MenuOptionsType>>([]); | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
|  | ||||
| const props = defineProps({ | ||||
|   info: { | ||||
|     type: Object as PropType<any>, | ||||
|     default: null | ||||
|   }, | ||||
|   tables: { | ||||
|     type: Array as PropType<any[]>, | ||||
|     default: null | ||||
|   } | ||||
|   info: propTypes.any.def(null), | ||||
|   tables: propTypes.any.def(null) | ||||
| }); | ||||
|  | ||||
| const infoForm = computed(() => props.info); | ||||
| @ -268,7 +262,7 @@ const tplSelectChange = (value: string) => { | ||||
|   } | ||||
| } | ||||
| const setSubTableColumns = (value: string) => { | ||||
|   table.value.forEach(item => { | ||||
|   table.value.forEach((item: any) => { | ||||
|     const name = item.tableName; | ||||
|     if (value === name) { | ||||
|       subColumns.value = item.columns; | ||||
|  | ||||
| @ -3,11 +3,11 @@ | ||||
|   <el-dialog title="导入表" v-model="visible" width="1100px" top="5vh" append-to-body> | ||||
|     <el-form :model="queryParams" ref="queryFormRef" :inline="true"> | ||||
|       <el-form-item label="数据源" prop="dataName"> | ||||
|             <el-select v-model="queryParams.dataName" filterable placeholder="请选择/输入数据源名称" style="width: 200px"> | ||||
|               <el-option v-for="item in dataNameList" :key="item" :label="item" :value="item"> </el-option> | ||||
|             </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="表名称" prop="tableName"> | ||||
|         <el-select v-model="queryParams.dataName" filterable placeholder="请选择/输入数据源名称" style="width: 200px"> | ||||
|           <el-option v-for="item in dataNameList" :key="item" :label="item" :value="item"> </el-option> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="表名称" prop="tableName"> | ||||
|         <el-input v-model="queryParams.tableName" placeholder="请输入表名称" clearable @keyup.enter="handleQuery" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="表描述" prop="tableComment"> | ||||
| @ -40,8 +40,6 @@ | ||||
| <script setup lang="ts"> | ||||
| import { listDbTable, importTable, getDataNames } from '@/api/tool/gen'; | ||||
| import { DbTableQuery, DbTableVO } from '@/api/tool/gen/types'; | ||||
| import { ComponentInternalInstance } from 'vue'; | ||||
| import { ElTable, ElForm } from 'element-plus'; | ||||
|  | ||||
| const total = ref(0); | ||||
| const visible = ref(false); | ||||
| @ -49,8 +47,8 @@ const tables = ref<Array<string>>([]); | ||||
| const dbTableList = ref<Array<DbTableVO>>([]); | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
|  | ||||
| const tableRef = ref(ElTable); | ||||
| const queryFormRef = ref(ElForm); | ||||
| const tableRef = ref<ElTableInstance>(); | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
|  | ||||
| const queryParams = reactive<DbTableQuery>({ | ||||
|     pageNum: 1, | ||||
| @ -76,7 +74,8 @@ const show = (dataName: string) => { | ||||
| } | ||||
| /** 单击选择行 */ | ||||
| const clickRow = (row: DbTableVO) => { | ||||
|     tableRef.value.toggleRowSelection(row); | ||||
|     // ele bug | ||||
|     tableRef.value?.toggleRowSelection(row); | ||||
| } | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: DbTableVO[]) => { | ||||
| @ -95,7 +94,7 @@ const handleQuery = () => { | ||||
| } | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|     queryFormRef.value.resetFields(); | ||||
|     queryFormRef.value?.resetFields(); | ||||
|     handleQuery(); | ||||
| } | ||||
| /** 导入按钮操作 */ | ||||
|  | ||||
| @ -116,9 +116,7 @@ | ||||
| import { listTable, previewTable, delTable, genCode, synchDb, getDataNames } from '@/api/tool/gen'; | ||||
| import { TableQuery, TableVO } from '@/api/tool/gen/types'; | ||||
| import router from '@/router'; | ||||
| import importTable from './importTable.vue'; | ||||
| import { ComponentInternalInstance } from 'vue'; | ||||
| import { ElForm, DateModelType } from 'element-plus'; | ||||
| import ImportTable from './importTable.vue'; | ||||
|  | ||||
| const route = useRoute(); | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| @ -134,8 +132,8 @@ const dateRange = ref<[DateModelType, DateModelType]>(['', '']); | ||||
| const uniqueId = ref(""); | ||||
| const dataNameList = ref<Array<string>>([]); | ||||
|  | ||||
| const queryFormRef = ref(ElForm); | ||||
| const importRef = ref(importTable); | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const importRef = ref<InstanceType<typeof ImportTable>>(); | ||||
|  | ||||
| const queryParams = ref<TableQuery>({ | ||||
|     pageNum: 1, | ||||
| @ -160,7 +158,7 @@ onActivated(() => { | ||||
|         uniqueId.value = time as string; | ||||
|         queryParams.value.pageNum = Number(route.query.pageNum); | ||||
|         dateRange.value = ['', '']; | ||||
|         queryFormRef.value.resetFields(); | ||||
|         queryFormRef.value?.resetFields(); | ||||
|         getList(); | ||||
|     } | ||||
| }) | ||||
| @ -212,7 +210,7 @@ const openImportTable = () => { | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|     dateRange.value = ['', '']; | ||||
|     queryFormRef.value.resetFields(); | ||||
|     queryFormRef.value?.resetFields(); | ||||
|     handleQuery(); | ||||
| } | ||||
| /** 预览按钮 */ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 LiuHao
					LiuHao