mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	fix: vben codegen
This commit is contained in:
		| @@ -1,4 +1,4 @@ | |||||||
| import { defHttp } from '@/utils/http/axios' | import {defHttp} from '@/utils/http/axios' | ||||||
| #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}") | #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}") | ||||||
|  |  | ||||||
| // 查询${table.classComment}列表 | // 查询${table.classComment}列表 | ||||||
| @@ -28,5 +28,5 @@ export function delete${simpleClassName}(id: number) { | |||||||
|  |  | ||||||
| // 导出${table.classComment} Excel | // 导出${table.classComment} Excel | ||||||
| export function export${simpleClassName}(params) { | export function export${simpleClassName}(params) { | ||||||
|     return defHttp.download({ url: '${baseURL}/export-excel', params }, '${table.classComment}.xls') |   return defHttp.download({ url: '${baseURL}/export-excel', params }, '${table.classComment}.xls') | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import type { BasicColumn, FormSchema } from '@/components/Table' | import type {BasicColumn, FormSchema} from '@/components/Table' | ||||||
| import { useRender } from '@/components/Table' | import {useRender} from '@/components/Table' | ||||||
| import { DICT_TYPE, getDictOptions } from '@/utils/dict' | import {DICT_TYPE, getDictOptions} from '@/utils/dict' | ||||||
|  |  | ||||||
| export const columns: BasicColumn[] = [ | export const columns: BasicColumn[] = [ | ||||||
| #foreach($column in $columns) | #foreach($column in $columns) | ||||||
| @@ -50,7 +50,7 @@ export const searchFormSchema: FormSchema[] = [ | |||||||
|     field: '${javaField}', |     field: '${javaField}', | ||||||
|   #if ($column.htmlType == "input") |   #if ($column.htmlType == "input") | ||||||
|     component: 'Input', |     component: 'Input', | ||||||
|   #elseif ($column.htmlType == "select" || $column.htmlType == "radio") |   #elseif ($column.htmlType == "select") | ||||||
|     component: 'Select', |     component: 'Select', | ||||||
|     componentProps: { |     componentProps: { | ||||||
|       #if ("" != $dictType)## 设置了 dictType 数据字典的情况 |       #if ("" != $dictType)## 设置了 dictType 数据字典的情况 | ||||||
| @@ -59,6 +59,15 @@ export const searchFormSchema: FormSchema[] = [ | |||||||
|         options: [], |         options: [], | ||||||
|       #end |       #end | ||||||
|     }, |     }, | ||||||
|  |   #elseif ($column.htmlType == "radio") | ||||||
|  |     component: 'Radio', | ||||||
|  |     componentProps: { | ||||||
|  |       #if ("" != $dictType)## 设置了 dictType 数据字典的情况 | ||||||
|  |         options: getDictOptions(DICT_TYPE.$dictType.toUpperCase()), | ||||||
|  |       #else## 未设置 dictType 数据字典的情况 | ||||||
|  |         options: [], | ||||||
|  |       #end | ||||||
|  |     }, | ||||||
|   #elseif($column.htmlType == "datetime") |   #elseif($column.htmlType == "datetime") | ||||||
|     component: 'RangePicker', |     component: 'RangePicker', | ||||||
|     #end |     #end | ||||||
| @@ -181,7 +190,8 @@ export const updateFormSchema: FormSchema[] = [ | |||||||
|       fileType: 'file', |       fileType: 'file', | ||||||
|       maxCount: 1, |       maxCount: 1, | ||||||
|     }, |     }, | ||||||
|     #elseif($column.htmlType == "editor")## 文本编辑器component: 'Editor', |     #elseif($column.htmlType == "editor")## 文本编辑器 | ||||||
|  |     component: 'Editor', | ||||||
|     #elseif($column.htmlType == "select")## 下拉框 |     #elseif($column.htmlType == "select")## 下拉框 | ||||||
|     component: 'Select', |     component: 'Select', | ||||||
|     componentProps: { |     componentProps: { | ||||||
|   | |||||||
| @@ -1,12 +1,10 @@ | |||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import ${ simpleClassName }Modal from './${simpleClassName}Modal.vue' |   import {columns, searchFormSchema} from './' | ||||||
| import { columns, searchFormSchema } from './${classNameVar}.data' |   import {useI18n} from '@/hooks/web/useI18n' | ||||||
| import { useI18n } from '@/hooks/web/useI18n' |   import {useMessage} from '@/hooks/web/useMessage' | ||||||
| import { useMessage } from '@/hooks/web/useMessage' |   import {useModal} from '@/components/Modal' | ||||||
| import { useModal } from '@/components/Modal' |   import {useTable} from '@/components/Table' | ||||||
| import { IconEnum } from '@/enums/appEnum' |   import { delete${ simpleClassName }, export${ simpleClassName }, get${ simpleClassName } Page } from '@/api/${table.moduleName}/${classNameVar}' | ||||||
| import { BasicTable, useTable, TableAction } from '@/components/Table' |  | ||||||
| import { delete${ simpleClassName }, export${ simpleClassName }, get${ simpleClassName } Page } from '@/api/${table.moduleName}/${classNameVar}' |  | ||||||
|  |  | ||||||
| defineOptions({ name: '${table.className}' }) | defineOptions({ name: '${table.className}' }) | ||||||
|  |  | ||||||
| @@ -62,7 +60,7 @@ async function handleDelete(record: Recordable) { | |||||||
|         <a-button type="primary" v-auth="['${permissionPrefix}:create']" :preIcon="IconEnum.ADD" @click="handleCreate"> |         <a-button type="primary" v-auth="['${permissionPrefix}:create']" :preIcon="IconEnum.ADD" @click="handleCreate"> | ||||||
|           {{ t('action.create') }} |           {{ t('action.create') }} | ||||||
|         </a-button> |         </a-button> | ||||||
|         <a-button type="warning" v-auth="['${permissionPrefix}:export']" :preIcon="IconEnum.EXPORT" @click="handleExport"> |         <a-button v-auth="['${permissionPrefix}:export']" :preIcon="IconEnum.EXPORT" @click="handleExport"> | ||||||
|           {{ t('action.export') }} |           {{ t('action.export') }} | ||||||
|         </a-button> |         </a-button> | ||||||
|       </template> |       </template> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu
					xingyu