feat: ai生成页面功能屏蔽
This commit is contained in:
parent
d1da92d040
commit
7fff2833c3
|
@ -164,15 +164,6 @@ 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) => {
|
export const addFunc = (data) => {
|
||||||
return service({
|
return service({
|
||||||
url: '/autoCode/addFunc',
|
url: '/autoCode/addFunc',
|
||||||
|
|
|
@ -10,16 +10,6 @@
|
||||||
"/src/view/dashboard/components/quickLinks.vue": "QuickLinks",
|
"/src/view/dashboard/components/quickLinks.vue": "QuickLinks",
|
||||||
"/src/view/dashboard/components/table.vue": "Table",
|
"/src/view/dashboard/components/table.vue": "Table",
|
||||||
"/src/view/dashboard/components/wiki.vue": "Wiki",
|
"/src/view/dashboard/components/wiki.vue": "Wiki",
|
||||||
"/src/view/dashboard/components/banner.vue": "Banner",
|
|
||||||
"/src/view/dashboard/components/card.vue": "Card",
|
|
||||||
"/src/view/dashboard/components/charts-content-numbers.vue": "ChartsContentNumbers",
|
|
||||||
"/src/view/dashboard/components/charts-people-numbers.vue": "ChartsPeopleNumbers",
|
|
||||||
"/src/view/dashboard/components/charts.vue": "Charts",
|
|
||||||
"/src/view/dashboard/components/notice.vue": "Notice",
|
|
||||||
"/src/view/dashboard/components/pluginTable.vue": "PluginTable",
|
|
||||||
"/src/view/dashboard/components/quickLinks.vue": "QuickLinks",
|
|
||||||
"/src/view/dashboard/components/table.vue": "Table",
|
|
||||||
"/src/view/dashboard/components/wiki.vue": "Wiki",
|
|
||||||
"/src/view/dashboard/index.vue": "Dashboard",
|
"/src/view/dashboard/index.vue": "Dashboard",
|
||||||
"/src/view/error/index.vue": "Error",
|
"/src/view/error/index.vue": "Error",
|
||||||
"/src/view/error/reload.vue": "Reload",
|
"/src/view/error/reload.vue": "Reload",
|
||||||
|
@ -60,10 +50,8 @@
|
||||||
"/src/view/superAdmin/params/sysParams.vue": "SysParams",
|
"/src/view/superAdmin/params/sysParams.vue": "SysParams",
|
||||||
"/src/view/superAdmin/user/user.vue": "User",
|
"/src/view/superAdmin/user/user.vue": "User",
|
||||||
"/src/view/system/state.vue": "State",
|
"/src/view/system/state.vue": "State",
|
||||||
"/src/view/systemTools/aiPainter/aiPainter.vue": "AiPainter",
|
|
||||||
"/src/view/systemTools/aiPainter/components/dynamicHtmlRenderer.vue": "DynamicHtmlRenderer",
|
|
||||||
"/src/view/systemTools/autoCode/component/fieldDialog.vue": "FieldDialog",
|
"/src/view/systemTools/autoCode/component/fieldDialog.vue": "FieldDialog",
|
||||||
"/src/view/systemTools/autoCode/component/previewCodeDialg.vue": "PreviewCodeDialg",
|
"/src/view/systemTools/autoCode/component/previewCodeDialog.vue": "PreviewCodeDialog",
|
||||||
"/src/view/systemTools/autoCode/index.vue": "AutoCode",
|
"/src/view/systemTools/autoCode/index.vue": "AutoCode",
|
||||||
"/src/view/systemTools/autoCodeAdmin/index.vue": "AutoCodeAdmin",
|
"/src/view/systemTools/autoCodeAdmin/index.vue": "AutoCodeAdmin",
|
||||||
"/src/view/systemTools/autoPkg/autoPkg.vue": "AutoPkg",
|
"/src/view/systemTools/autoPkg/autoPkg.vue": "AutoPkg",
|
||||||
|
@ -72,15 +60,6 @@
|
||||||
"/src/view/systemTools/index.vue": "System",
|
"/src/view/systemTools/index.vue": "System",
|
||||||
"/src/view/systemTools/installPlugin/index.vue": "Index",
|
"/src/view/systemTools/installPlugin/index.vue": "Index",
|
||||||
"/src/view/systemTools/pubPlug/pubPlug.vue": "PubPlug",
|
"/src/view/systemTools/pubPlug/pubPlug.vue": "PubPlug",
|
||||||
"/src/view/layout/aside/index.vue": "Index",
|
|
||||||
"/src/view/layout/header/index.vue": "Index",
|
|
||||||
"/src/view/layout/header/tools.vue": "Tools",
|
|
||||||
"/src/view/superAdmin/menu/components/components-cascader.vue": "ComponentsCascader",
|
|
||||||
"/src/view/systemTools/aiPainter/aiPainter.vue": "UnNameComponent",
|
|
||||||
"/src/view/systemTools/aiPainter/components/dynamicHtmlRenderer.vue": "UnNameComponent",
|
|
||||||
"/src/view/systemTools/autoCode/component/previewCodeDialg.vue": "PreviewCodeDialg",
|
|
||||||
"/src/view/systemTools/installPlugin/index.vue": "Index",
|
|
||||||
"/src/view/systemTools/pubPlug/pubPlug.vue": "PubPlug",
|
|
||||||
"/src/view/systemTools/system/system.vue": "Config",
|
"/src/view/systemTools/system/system.vue": "Config",
|
||||||
"/src/plugin/announcement/form/info.vue": "InfoForm",
|
"/src/plugin/announcement/form/info.vue": "InfoForm",
|
||||||
"/src/plugin/announcement/view/info.vue": "Info",
|
"/src/plugin/announcement/view/info.vue": "Info",
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
<template>
|
|
||||||
<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>
|
|
||||||
<div class="absolute right-2 bottom-2">
|
|
||||||
<el-button :loading="loading" @click="aiPainter()" type="primary"><ai-gva />{{html?'修改':'生成'}}</el-button>
|
|
||||||
<el-button :loading="loading" v-if="html" @click="aiPainter(true)" type="primary"><ai-gva />重新生成</el-button>
|
|
||||||
<el-button :loading="loading" v-if="html" @click="getCode" type="primary">复制代码</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="w-full">
|
|
||||||
<DynamicHtmlRenderer :htmlContent="html" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {painter} from "@/api/autoCode";
|
|
||||||
import DynamicHtmlRenderer from "@/view/systemTools/aiPainter/components/dynamicHtmlRenderer.vue";
|
|
||||||
import { ref } from 'vue'
|
|
||||||
const loading = ref(false)
|
|
||||||
const prompt = ref('')
|
|
||||||
const html = ref(``)
|
|
||||||
const aiPainter = async (flag) => {
|
|
||||||
const res = await painter({
|
|
||||||
html: flag?'':html.value,
|
|
||||||
prompt: prompt.value
|
|
||||||
})
|
|
||||||
html.value = res.data
|
|
||||||
}
|
|
||||||
const getCode = () => {
|
|
||||||
navigator.clipboard.writeText(html.value).then(() => {
|
|
||||||
Message.success('复制成功');
|
|
||||||
}, () => {
|
|
||||||
Message.error('复制失败');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -1,46 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<iframe ref="iframe" class="w-full h-screen"></iframe>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, ref, watch } from 'vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
htmlContent: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const iframe = ref(null);
|
|
||||||
|
|
||||||
const updateIframeContent = () => {
|
|
||||||
if (iframe.value) {
|
|
||||||
const doc = iframe.value.contentDocument || iframe.value.contentWindow.document;
|
|
||||||
doc.open();
|
|
||||||
doc.write(`
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body>${props.htmlContent}</body>
|
|
||||||
</html>
|
|
||||||
`);
|
|
||||||
doc.close();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
updateIframeContent();
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(() => props.htmlContent, () => {
|
|
||||||
updateIframeContent();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -805,7 +805,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
import FieldDialog from '@/view/systemTools/autoCode/component/fieldDialog.vue'
|
import FieldDialog from '@/view/systemTools/autoCode/component/fieldDialog.vue'
|
||||||
import PreviewCodeDialog from '@/view/systemTools/autoCode/component/previewCodeDialg.vue'
|
import PreviewCodeDialog from '@/view/systemTools/autoCode/component/previewCodeDialog.vue'
|
||||||
import { toUpperCase, toHump, toSQLLine, toLowerCase } from '@/utils/stringFun'
|
import { toUpperCase, toHump, toSQLLine, toLowerCase } from '@/utils/stringFun'
|
||||||
import { createTemp, getDB, getTable, getColumn, preview, getMeta, getPackageApi,llmAuto } from '@/api/autoCode'
|
import { createTemp, getDB, getTable, getColumn, preview, getMeta, getPackageApi,llmAuto } from '@/api/autoCode'
|
||||||
import { getDict } from '@/utils/dictionary'
|
import { getDict } from '@/utils/dictionary'
|
||||||
|
|
Loading…
Reference in New Issue