mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-08 12: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'
|
||||
@@ -32,7 +32,7 @@ const formRef = ref<InstanceType<typeof GiForm>>()
|
||||
<#list fieldConfigs as fieldConfig>
|
||||
<#if fieldConfig.showInForm>
|
||||
<#-- SELECT/RADIO/CHECK_BOX/TREE_SELECT控件从服务器端获取数据 -->
|
||||
<#if fieldConfig.formType = 'SELECT' || fieldConfig.formType = 'RADIO'
|
||||
<#if fieldConfig.formType = 'SELECT' || fieldConfig.formType = 'RADIO'
|
||||
|| fieldConfig.formType = 'CHECK_BOX' || fieldConfig.formType = 'TREE_SELECT'>
|
||||
const { ${fieldConfig.columnName}_enum } = useDict('${fieldConfig.columnName}_enum')
|
||||
</#if>
|
||||
@@ -67,23 +67,17 @@ const columns: Columns = [
|
||||
type: 'switch',
|
||||
<#elseif fieldConfig.formType = 'CHECK_BOX'>
|
||||
type: 'check-group',
|
||||
props: {
|
||||
options: ${fieldConfig.columnName}_enum,
|
||||
},
|
||||
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,
|
||||
},
|
||||
options: ${fieldConfig.columnName}_enum,
|
||||
<#elseif fieldConfig.formType = 'RADIO'>
|
||||
type: 'radio-group',
|
||||
props: {
|
||||
options: ${fieldConfig.columnName}_enum,
|
||||
},
|
||||
</#if>
|
||||
options: ${fieldConfig.columnName}_enum,
|
||||
</#if>
|
||||
<#if fieldConfig.isRequired>
|
||||
rules: [{ required: true, message: '请输入${fieldConfig.comment}' }]
|
||||
</#if>
|
||||
|
@@ -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,20 +27,40 @@
|
||||
<#elseif fieldConfig.formType == "RADIO"><#-- 单选框 -->
|
||||
<a-radio-group v-model="queryForm.${fieldConfig.fieldName}" :options="${fieldConfig.columnName}_enum" @change="search"/>
|
||||
<#elseif fieldConfig.formType == "DATE"><#-- 日期框 -->
|
||||
<a-date-picker
|
||||
v-model="queryForm.${fieldConfig.fieldName}"
|
||||
placeholder="请选择${fieldConfig.comment}"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
<#if fieldConfig.queryType == "BETWEEN">
|
||||
<a-range-picker
|
||||
v-model="queryForm.${fieldConfig.fieldName}"
|
||||
:placeholder="['请选择开始${fieldConfig.comment}','请选择结束${fieldConfig.comment}']"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<#elseif fieldConfig.formType == "DATE_TIME"><#-- 日期时间框 -->
|
||||
<#else>
|
||||
<a-date-picker
|
||||
v-model="queryForm.${fieldConfig.fieldName}"
|
||||
placeholder="请选择${fieldConfig.comment}"
|
||||
show-time
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
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}"
|
||||
show-time
|
||||
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