Skip to content

Commit

Permalink
feat: 增加ai绘制页面功能
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelmaxQm committed Oct 25, 2024
1 parent 05242c0 commit 7d62700
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
9 changes: 9 additions & 0 deletions web/src/api/autoCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ export const butler = (data) => {
})
}

export const painter = (data) => {
return service({
url: '/autoCode/llmAuto',
method: 'post',
data:{...data,mode:'painter'},
timeout: 1000 * 60 * 10,
})
}

export const addFunc = (data) => {
return service({
url: '/autoCode/addFunc',
Expand Down
27 changes: 27 additions & 0 deletions web/src/view/systemTools/aiPainter/aiPainter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div>
<div class="w-full">
</div>
<div class="gva-search-box" >
<div class="w-full relative">
<el-input v-model="prompt" type="textarea" :rows="8" class="w-full"></el-input>
<el-button :loading="loading" @click="aiPainter" type="primary" class="absolute right-2 bottom-2"><ai-gva />{{html?'修改':'生成'}}</el-button>
</div>
</div>
</div>
</template>

<script setup>
import {painter} from "@/api/autoCode";
import { ref } from 'vue'
const loading = ref(false)
const prompt = ref('')
const html = ref(``)
const aiPainter = async () => {
const res = await painter({
html: html.value,
prompt: prompt.value
})
html.value = res.data
}
</script>
5 changes: 1 addition & 4 deletions web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ module.exports = {
},
},
darkMode: "class",
plugins: [],
corePlugins: {
preflight: false
}
plugins: []
}

0 comments on commit 7d62700

Please sign in to comment.