Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_43487029
AI 绘画 - 极简版
提交
d40e147b
A
AI 绘画 - 极简版
项目概览
qq_43487029
/
AI 绘画 - 极简版
与 Fork 源项目一致
Fork自
ylwdev / AI 绘画 - 极简版
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AI 绘画 - 极简版
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d40e147b
编写于
1月 31, 2024
作者:
Q
qq_43487029
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Wed Jan 31 10:50:00 CST 2024 inscode
上级
c45b7546
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
112 deletion
+0
-112
src/App.vue
src/App.vue
+0
-112
未找到文件。
src/App.vue
浏览文件 @
d40e147b
<
template
>
<Layout>
<!--
<Header
class=
"layout-header"
>
<ai-header></ai-header>
</Header>
-->
<Layout>
<Sider
class=
"layout-sider"
hide-trigger
:width=
"320"
>
<ai-sider
:loading-data=
"getSdData"
></ai-sider>
</Sider>
<Content
class=
"layout-content"
>
<div
class=
"ai-generate-image-inner"
>
<img
class=
"ai-generate-image-self"
v-if=
"image && !loading"
:src=
"image"
/>
<div
class=
"ai-generate-loading"
v-if=
"loading && !image"
>
<div
class=
"ai-generate-loading-inner"
>
<Spin
fix
>
<Icon
type=
"ios-loading"
size=
18
class=
"demo-spin-icon-load"
></Icon>
<div>
生成图片中
</div>
</Spin>
</div>
</div>
</div>
</Content>
</Layout>
</Layout>
</
template
>
<
script
>
import
{
defineComponent
,
ref
}
from
'
vue
'
;
import
aiHeader
from
'
./components/ai-header.vue
'
;
import
aiSider
from
'
./components/ai-sider.vue
'
;
import
request
from
'
@/api/sd
'
;
export
default
defineComponent
({
name
:
'
App
'
,
components
:
{
aiHeader
,
aiSider
},
setup
()
{
const
image
=
ref
(
'
/img/default.png
'
)
const
loading
=
ref
(
false
);
const
getSdData
=
(
item
)
=>
{
image
.
value
=
''
;
loading
.
value
=
true
;
console
.
log
(
'
request gpt data ...
'
)
return
request
.
gpt
(
item
.
prompt
).
then
(
res
=>
{
console
.
log
(
'
request sd data...
'
,
item
)
return
request
.
draw
(
item
).
then
(
res
=>
{
if
(
res
)
image
.
value
=
res
;
loading
.
value
=
false
;
return
res
;
})
}).
catch
((
err
)
=>
{
loading
.
value
=
false
;
alert
(
err
);
// console.error('gpt err:',err)
})
}
return
{
getSdData
,
image
,
loading
}
}
})
</
script
>
<
style
lang=
"less"
>
.ivu-layout {
width: 100%;
height: 100%;
.ivu-layout-header,
.layout-sider{
background: #FFF;
}
.layout-content {
overflow-y: scroll;
width: 100%!important;
padding: 16px;
}
.ai-generate-image-inner {
width: 100%;
display: flex;
margin-top:36px;
justify-content: center;
align-items: center;
height: 100%;
}
.ai-generate-image-self {
max-width: 100%;
display: block;
}
.ai-generate-loading {
position: relative;
width: 200px;
height: 100%;
display: flex;
align-items: center;
&-inner {
height: 40px;
width: 200px;
position: relative;
}
.ivu-spin {
background: none;
}
}
.demo-spin-icon-load{
animation: ani-demo-spin 1s linear infinite;
}
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录