mirror of
https://gitee.com/blackfox/geekai.git
synced 2024-12-02 04:07:41 +08:00
opt: styles and view micro optimization
This commit is contained in:
parent
cc1a3ce343
commit
e589f25a05
@ -74,6 +74,7 @@
|
||||
}
|
||||
|
||||
|
||||
color var(--van-text-color)
|
||||
.pt-6 {
|
||||
padding 15px 10px
|
||||
}
|
||||
|
@ -80,6 +80,8 @@
|
||||
}
|
||||
|
||||
|
||||
color var(--van-text-color)
|
||||
|
||||
.pt-6 {
|
||||
padding 15px 10px
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<span class="name">{{ scope.item.name }}</span>
|
||||
<div class="opt">
|
||||
<div v-if="hasRole(scope.item.key)">
|
||||
<el-button size="small" type="success" @click="useRole(scope.item.id)">使用</el-button>
|
||||
<el-button size="small" type="success" @click="useRole(scope.item)">使用</el-button>
|
||||
<el-button size="small" type="danger" @click="updateRole(scope.item,'remove')">移除</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small"
|
||||
@ -110,8 +110,8 @@ const hasRole = (roleKey) => {
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const useRole = (roleId) => {
|
||||
router.push({name: "chat", params: {role_id: roleId}})
|
||||
const useRole = (role) => {
|
||||
router.push(`/chat?role_id=${role.id}`)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -358,8 +358,8 @@ const initData = () => {
|
||||
// 加载角色列表
|
||||
httpGet(`/api/role/list`).then((res) => {
|
||||
roles.value = res.data;
|
||||
if (router.currentRoute.value.params.role_id) {
|
||||
roleId.value = parseInt(router.currentRoute.value.params["role_id"])
|
||||
if (router.currentRoute.value.query.role_id) {
|
||||
roleId.value = parseInt(router.currentRoute.value.query.role_id)
|
||||
} else {
|
||||
roleId.value = roles.value[0]['id']
|
||||
}
|
||||
|
@ -5,9 +5,9 @@
|
||||
<h2>AI 绘画作品墙</h2>
|
||||
<div class="settings">
|
||||
<el-radio-group v-model="imgType" @change="changeImgType">
|
||||
<el-radio label="mj" size="large">MidJourney</el-radio>
|
||||
<el-radio label="sd" size="large">Stable Diffusion</el-radio>
|
||||
<el-radio label="dall" size="large">DALL-E</el-radio>
|
||||
<el-radio value="mj" size="large">MidJourney</el-radio>
|
||||
<el-radio value="sd" size="large">Stable Diffusion</el-radio>
|
||||
<el-radio value="dall" size="large">DALL-E</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
@ -338,7 +338,6 @@ const getNext = () => {
|
||||
loading.value = true
|
||||
page.value = page.value + 1
|
||||
let url = ""
|
||||
console.log(imgType.value)
|
||||
switch (imgType.value) {
|
||||
case "mj":
|
||||
url = "/api/mj/imgWall"
|
||||
|
@ -264,9 +264,10 @@ const connect = (userId) => {
|
||||
|
||||
_socket.addEventListener('close', () => {
|
||||
loading.value = false
|
||||
if (socket.value !== null) {
|
||||
checkSession().then(() => {
|
||||
connect(userId)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user