55 title =" 此功能为开发环境使用,不建议发布到生产,具体使用效果请点我观看。"
66 />
77 <div class =" gva-search-box" >
8- <div class =" text-lg mb-2 text-gray-600" >使用AI创建</div >
8+ <div class =" text-lg mb-2 text-gray-600" >使用AI创建<a class = " text-blue-600 text-sm ml-4 " href = " https://plugin.gin-vue-admin.com/#/layout/userInfo/center " target = " _blank " >获取AiPath</ a >< /div >
99 <div class =" relative" >
10- <el-input v-model =" prompt" type =" textarea" :rows =" 5" :maxlength =" 100" :placeholder =" `【Beta】试试描述你的表,让AI帮你完成。\n目前正在测试阶段,遇到问题请及时反馈。\n此功能需要到插件市场个人中心获取自己的AI-Path,把AI-Path填入config.yaml下的autocode-->ai-path,重启项目即可使用。`" resize =" none" />
10+ <el-input v-model =" prompt"
11+ type =" textarea"
12+ :rows =" 5"
13+ :maxlength =" 100"
14+ :placeholder =" `现已完全免费\n试试描述你的表,让AI帮你完成。\n此功能需要到插件市场个人中心获取自己的AI-Path,把AI-Path填入config.yaml下的autocode-->ai-path,重启项目即可使用。\n按下 Ctrl+Enter 或 Cmd+Enter 直接生成`"
15+ resize =" none"
16+ @focus =" handleFocus"
17+ @blur =" handleBlur" />
1118 <div class =" flex absolute right-2 bottom-2" >
1219 <el-tooltip
13- content =" 小奇存在失败概率,面向所有用户开放使用(失败了重新生成一下就好)。"
14- >
15- <el-button type =" primary" @click =" llmAutoFunc('xiaoqi')" >
16- <el-icon size =" 18" >
17- <ai-gva />
18- </el-icon > 小奇
19- </el-button >
20- </el-tooltip >
21- <el-tooltip
22- content =" 小淼基本啥也能设计出来,但是需要消耗积分,测试阶段授权用户自动获得基础积分,开源用户需要填表申请。"
20+ effect =" light"
2321 >
22+ <template #content >
23+ <div >【完全免费】前往<a class =" text-blue-600" href =" https://plugin.gin-vue-admin.com/#/layout/userInfo/center" target =" _blank" >插件市场个人中心</a >申请AIPath,填入config.yaml的ai-path属性即可使用。</div >
24+ </template >
2425 <el-button type =" primary" @click =" llmAutoFunc('xiaomiao')" >
2526 <el-icon size =" 18" >
2627 <ai-gva />
420421 row-key =" fieldName"
421422 >
422423 <el-table-column
424+ fixed =" left"
423425 align =" left"
424426 type =" index"
425427 width =" 60"
431433 </template >
432434 </el-table-column >
433435 <el-table-column
436+ fixed =" left"
434437 align =" left"
435438 type =" index"
436439 label =" 序列"
437440 width =" 60"
438441 />
439442 <el-table-column
443+ fixed =" left"
440444 align =" left"
441445 type =" index"
442446 label =" 主键"
447451 </template >
448452 </el-table-column >
449453 <el-table-column
454+ fixed =" left"
450455 align =" left"
451456 prop =" fieldName"
452457 label =" 字段名称"
525530 <el-table-column
526531 align =" left"
527532 prop =" excel"
533+ width =" 100"
528534 label =" 导入/导出"
529535 >
530536 <template #default =" {row } " >
@@ -791,6 +797,21 @@ import { ElMessage, ElMessageBox } from 'element-plus'
791797import WarningBar from ' @/components/warningBar/warningBar.vue'
792798import Sortable from ' sortablejs'
793799
800+ const handleFocus = () => {
801+ document .addEventListener (' keydown' , handleKeydown);
802+ };
803+
804+ const handleBlur = () => {
805+ document .removeEventListener (' keydown' , handleKeydown);
806+ };
807+
808+
809+ const handleKeydown = (event ) => {
810+ if ((event .ctrlKey || event .metaKey ) && event .key === ' Enter' ) {
811+ llmAutoFunc (' xiaomiao' );
812+ }
813+ };
814+
794815const getOnlyNumber = () => {
795816 let randomNumber = ' ' ;
796817 while (randomNumber .length < 16 ) {
@@ -802,6 +823,10 @@ const getOnlyNumber = () => {
802823const prompt = ref (" " )
803824
804825const llmAutoFunc = async (mode ) => {
826+ if (! prompt .value ) {
827+ ElMessage .error (' 请输入描述' )
828+ return
829+ }
805830 const res = await llmAuto ({prompt: prompt .value ,mode: mode})
806831 if (res .code === 0 ) {
807832 form .value .fields = []
0 commit comments