mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	fix: 修复代码生成前端模板部分错误
This commit is contained in:
		| @@ -15,7 +15,7 @@ | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { Message } from '@arco-design/web-vue' | ||||
| import { get${classNamePrefix}, add${classNamePrefix}, update${classNamePrefix} } from '@/apis' | ||||
| import { get${classNamePrefix}, add${classNamePrefix}, update${classNamePrefix} } from '@/apis/${apiModuleName}/${apiName}' | ||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||
| import { useForm } from '@/hooks' | ||||
| import { useDict } from '@/hooks/app' | ||||
| @@ -67,22 +67,16 @@ const columns: Columns = [ | ||||
|     type: 'switch', | ||||
|     <#elseif fieldConfig.formType = 'CHECK_BOX'> | ||||
|     type: 'check-group', | ||||
|     props: { | ||||
|     options: ${fieldConfig.columnName}_enum, | ||||
|     },         | ||||
|    	<#elseif fieldConfig.formType = 'TREE_SELECT'> | ||||
|     type: 'tree-select', | ||||
|     data: '${fieldConfig.columnName}_enum', | ||||
|     <#elseif fieldConfig.formType = 'SELECT'> | ||||
|     type: 'select',  | ||||
|     props: { | ||||
|     options: ${fieldConfig.columnName}_enum, | ||||
|     }, | ||||
|     <#elseif fieldConfig.formType = 'RADIO'> | ||||
|     type: 'radio-group',    | ||||
|     props: { | ||||
|     options: ${fieldConfig.columnName}_enum, | ||||
|     }, | ||||
|     </#if> | ||||
|     <#if fieldConfig.isRequired> | ||||
|     rules: [{ required: true, message: '请输入${fieldConfig.comment}' }] | ||||
|   | ||||
| @@ -15,7 +15,7 @@ | ||||
|  | ||||
| <script lang="ts" setup> | ||||
| import { useWindowSize } from '@vueuse/core' | ||||
| import { type ${classNamePrefix}DetailResp, get${classNamePrefix} } from '@/apis' | ||||
| import { type ${classNamePrefix}DetailResp, get${classNamePrefix} } from '@/apis/${apiModuleName}/${apiName}' | ||||
|  | ||||
| const { width } = useWindowSize() | ||||
|  | ||||
|   | ||||
| @@ -27,13 +27,32 @@ | ||||
| 	        <#elseif fieldConfig.formType == "RADIO"><#-- 单选框 --> | ||||
| 			<a-radio-group v-model="queryForm.${fieldConfig.fieldName}" :options="${fieldConfig.columnName}_enum" @change="search"/>	         | ||||
| 	        <#elseif fieldConfig.formType == "DATE"><#-- 日期框 --> | ||||
|             <#if fieldConfig.queryType == "BETWEEN"> | ||||
|             <a-range-picker | ||||
|                     v-model="queryForm.${fieldConfig.fieldName}" | ||||
|                     :placeholder="['请选择开始${fieldConfig.comment}','请选择结束${fieldConfig.comment}']" | ||||
|                     format="YYYY-MM-DD" | ||||
|                     style="width: 100%" | ||||
|             /> | ||||
|             <#else> | ||||
|             <a-date-picker | ||||
|                     v-model="queryForm.${fieldConfig.fieldName}" | ||||
|                     placeholder="请选择${fieldConfig.comment}" | ||||
|                     format="YYYY-MM-DD" | ||||
|                     style="width: 100%" | ||||
|             /> | ||||
|             </#if> | ||||
|  | ||||
|         <#elseif fieldConfig.formType == "DATE_TIME"><#-- 日期时间框 --> | ||||
|             <#if fieldConfig.queryType == "BETWEEN"> | ||||
|           <a-range-picker | ||||
|                   v-model="queryForm.${fieldConfig.fieldName}" | ||||
|                   :placeholder="['请选择开始${fieldConfig.comment}','请选择结束${fieldConfig.comment}']" | ||||
|                   show-time | ||||
|                   format="YYYY-MM-DD HH:mm:ss" | ||||
|                   style="width: 100%" | ||||
|             /> | ||||
|             <#else> | ||||
|           <a-date-picker | ||||
|                   v-model="queryForm.${fieldConfig.fieldName}" | ||||
|                   placeholder="请选择${fieldConfig.comment}" | ||||
| @@ -41,6 +60,7 @@ | ||||
|                   format="YYYY-MM-DD HH:mm:ss" | ||||
|                   style="width: 100%" | ||||
|             /> | ||||
|             </#if> | ||||
| 	        <#else> | ||||
| 	        <a-input v-model="queryForm.${fieldConfig.fieldName}" placeholder="请输入${fieldConfig.comment}" allow-clear @change="search"> | ||||
| 	          <template #prefix><icon-search /></template> | ||||
| @@ -89,7 +109,7 @@ | ||||
| <script setup lang="ts"> | ||||
| import ${classNamePrefix}AddModal from './${classNamePrefix}AddModal.vue' | ||||
| import ${classNamePrefix}DetailDrawer from './${classNamePrefix}DetailDrawer.vue' | ||||
| import { type ${classNamePrefix}Resp, type ${classNamePrefix}Query, delete${classNamePrefix}, export${classNamePrefix}, list${classNamePrefix} } from '@/apis' | ||||
| import { type ${classNamePrefix}Resp, type ${classNamePrefix}Query, delete${classNamePrefix}, export${classNamePrefix}, list${classNamePrefix} } from '@/apis/${apiModuleName}/${apiName}' | ||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||
| import { useDownload, useTable } from '@/hooks' | ||||
| import { isMobile } from '@/utils' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 zhangzhengmeng
					zhangzhengmeng