Skip to content

Commit

Permalink
更新界面
Browse files Browse the repository at this point in the history
  • Loading branch information
siqiii committed Sep 13, 2022
1 parent fbdbccb commit 02950ad
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 45 deletions.
13 changes: 5 additions & 8 deletions open-web/src/components/common/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
<div style="height: 60px; display: flex; justify-content: center;align-items: center" @click="go2home">
<p>野火开放平台</p>
</div>
<el-menu :default-openeds="['1']" router>
<el-submenu index="1">
<template slot="title"><i class="el-icon-menu"></i>开发</template>
<el-menu-item index="/dev/app">应用开发</el-menu-item>
<el-menu-item index="/dev/channel">频道开发</el-menu-item>
<el-menu-item index="/dev/robot">机器人开发</el-menu-item>
</el-submenu>
<el-menu default-active='/dev/app' router>
<el-menu-item index="/dev/app">应用</el-menu-item>
<el-menu-item index="/dev/channel">频道</el-menu-item>
<el-menu-item index="/dev/robot">机器人</el-menu-item>
<el-menu-item>
<template slot="title"><i class="el-icon-document"></i>
<template slot="title">
<a href="https://docs.wildfirechat.cn/open" style="color: #303133" target="_blank">开发文档</a>
</template>
</el-menu-item>
Expand Down
23 changes: 13 additions & 10 deletions open-web/src/components/page/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
<el-main>
<el-card>
<h2>应用</h2>
<p>在客户端工作台有入口,开发文档请看
<el-link href="https://docs.wildfirechat.cn/open" target="_blank" type="primary">开发文档</el-link>
</p>
<el-row :gutter="20">
<el-col :span="6">
<div class="create-button-container" @click="createAppDialogVisible = true">
<el-button type="medium" class="button">+创建应用</el-button>
</div>
</el-col>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: center">
<p>在客户端工作台有入口,开发文档请看
<el-link href="https://docs.wildfirechat.cn/open" style="flex: 1" target="_blank" type="primary">开发文档</el-link>
</p>
<el-button type="primary" @click="createAppDialogVisible = true">创建应用</el-button>
</div>
<el-row :gutter="20" v-if="apps && apps.length > 0">
<el-col :span="6" v-for="(app, index) in apps" :key="index" @click.native="showAppInfo(app)">
<AppCard :app="app"/>
</el-col>
</el-row>
<el-empty v-else description="暂无应用" image=""></el-empty>
</el-card>
<el-dialog title="创建应用" :visible.sync="createAppDialogVisible">
<el-form :model="createAppInfo" :rules="rules" ref="createAppForm">
Expand Down Expand Up @@ -77,7 +76,7 @@
</el-upload>
</el-form-item>
<el-form-item label="应用名称" :label-width="formLabelWidth" prop="name">
<el-input v-model="modifyAppInfo.name" autocomplete="off" placeholder="测试应用"></el-input>
<el-input v-model="modifyAppInfo.name" autocomplete="off" placeholder="应用名称"></el-input>
</el-form-item>
<el-form-item label="应用描述" :label-width="formLabelWidth" prop="description">
<el-input v-model="modifyAppInfo.description" autocomplete="off" placeholder="应用的一句话描述"></el-input>
Expand Down Expand Up @@ -236,4 +235,8 @@ export default {
.create-button-container .button {
padding: 20px 30px;
}
>>> .el-empty__image {
display: none;
}
</style>
29 changes: 16 additions & 13 deletions open-web/src/components/page/channel/channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
<el-main>
<el-card>
<h2>频道</h2>
<p>类似微信公众号,开发文档请看
<el-link href="https://docs.wildfirechat.cn/open" target="_blank" type="primary">开发文档</el-link>
</p>
<el-row :gutter="20">
<el-col :span="6">
<div class="create-button-container" @click="createAppDialogVisible = true">
<el-button type="medium" class="button">+创建频道</el-button>
</div>
</el-col>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: center">
<p>类似微信公众号,开发文档请看
<el-link href="https://docs.wildfirechat.cn/open" style="flex: 1" target="_blank" type="primary">开发文档</el-link>
</p>
<el-button type="primary" @click="createAppDialogVisible = true">创建频道</el-button>
</div>
<el-row :gutter="20" v-if="apps && apps.length > 0">
<el-col :span="6" v-for="(app, index) in apps" :key="index" @click.native="showAppInfo(app)">
<AppCard :app="app"/>
</el-col>
</el-row>
<el-empty v-else description="暂无频道" image=""></el-empty>
</el-card>
<el-dialog title="创建频道" :visible.sync="createAppDialogVisible">
<el-form :model="createAppInfo" :rules="rules" ref="createAppForm">
Expand All @@ -33,15 +32,15 @@
</el-upload>
</el-form-item>
<el-form-item label="频道名称" :label-width="formLabelWidth" prop="name">
<el-input v-model="createAppInfo.name" autocomplete="off" placeholder="测试频道"></el-input>
<el-input v-model="createAppInfo.name" autocomplete="off" placeholder="频道名称"></el-input>
</el-form-item>
<el-form-item label="频道描述" :label-width="formLabelWidth" prop="description">
<el-input v-model="createAppInfo.description" autocomplete="off" placeholder="频道的一句话描述"></el-input>
</el-form-item>
<el-form-item label="回调/服务端地址" :label-width="formLabelWidth" prop="serverUrl">
<el-input v-model="createAppInfo.serverUrl" autocomplete="off" placeholder="https://wildfirechat.cn"></el-input>
</el-form-item>
<el-checkbox label="是否是广播号(默认是订阅号,发送消息时,只给已经订阅了的用户发送;广播号,发送消息时,给所有人发送)" v-model="modifyAppInfo.global"></el-checkbox>
<el-checkbox label="广播号(默认是订阅号,发送消息时,只给已经订阅了的用户发送;广播号,发送消息时,给所有人发送)" v-model="modifyAppInfo.global"></el-checkbox>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="createAppDialogVisible = false">取 消</el-button>
Expand Down Expand Up @@ -79,7 +78,7 @@
<el-form-item label="回调/服务端地址" :label-width="formLabelWidth" prop="serverUrl">
<el-input v-model="modifyAppInfo.serverUrl" autocomplete="off" placeholder="https://wildfirechat.cn"></el-input>
</el-form-item>
<el-checkbox label="是否是广播号(默认是订阅号,发送消息时,只能给已经订阅了的用户发送;广播号,发送消息时,给所有人发送)" v-model="modifyAppInfo.global"></el-checkbox>
<el-checkbox label="广播号(默认是订阅号,发送消息时,只能给已经订阅了的用户发送;广播号,发送消息时,给所有人发送)" v-model="modifyAppInfo.global"></el-checkbox>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="modifyAppDialogVisible = false">取 消</el-button>
Expand Down Expand Up @@ -123,7 +122,7 @@ export default {
{min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur'}
],
serverUrl: [
{required: true, message: '请输入回调地址', trigger: 'blur'},
{required: false, message: '请输入回调地址', trigger: 'blur'},
],
}
}
Expand Down Expand Up @@ -220,4 +219,8 @@ export default {
padding: 20px 30px;
}
>>> .el-empty__image {
display: none;
}
</style>
27 changes: 15 additions & 12 deletions open-web/src/components/page/robot/robot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
<el-main>
<el-card>
<h2>机器人</h2>
<p>对应机器人服务,开发文档请看
<el-link href="https://docs.wildfirechat.cn/open" target="_blank" type="primary">开发文档</el-link>
</p>
<el-row :gutter="20">
<el-col :span="6">
<div class="create-button-container" @click="createAppDialogVisible = true">
<el-button type="medium" class="button">+创建机器人</el-button>
</div>
</el-col>
<div style="display: flex; flex-direction: row; justify-content: space-between; align-items: center">
<p>对应机器人服务,开发文档请看
<el-link href="https://docs.wildfirechat.cn/open" style="flex: 1" target="_blank" type="primary">开发文档</el-link>
</p>
<el-button type="primary" @click="createAppDialogVisible = true">创建机器人</el-button>
</div>
<el-row :gutter="20" v-if="apps && apps.length > 0">
<el-col :span="6" v-for="(app, index) in apps" :key="index" @click.native="showAppInfo(app)">
<AppCard :app="app"/>
</el-col>
</el-row>
<el-empty v-else description="暂无机器人" image=""></el-empty>
</el-card>
<el-dialog title="创建机器人" :visible.sync="createAppDialogVisible">
<el-form :model="createAppInfo" :rules="rules" ref="createAppForm">
Expand All @@ -33,7 +32,7 @@
</el-upload>
</el-form-item>
<el-form-item label="机器人名称" :label-width="formLabelWidth" prop="name">
<el-input v-model="createAppInfo.name" autocomplete="off" placeholder="测试机器人"></el-input>
<el-input v-model="createAppInfo.name" autocomplete="off" placeholder="机器人名称"></el-input>
</el-form-item>
<el-form-item label="机器人描述" :label-width="formLabelWidth" prop="description">
<el-input v-model="createAppInfo.description" autocomplete="off" placeholder="机器人的一句话描述"></el-input>
Expand Down Expand Up @@ -121,7 +120,7 @@ export default {
{min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur'}
],
serverUrl: [
{required: true, message: '请输入回调地址', trigger: 'blur'},
{required: false, message: '请输入回调地址', trigger: 'blur'},
],
}
}
Expand Down Expand Up @@ -190,7 +189,7 @@ export default {
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
}
return (isJPG || isPNG )&& isLt2M;
return (isJPG || isPNG) && isLt2M;
}
},
computed: mapState({
Expand Down Expand Up @@ -218,4 +217,8 @@ export default {
padding: 20px 30px;
}
>>> .el-empty__image {
display: none;
}
</style>
9 changes: 7 additions & 2 deletions open-web/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ export default new Router({
component: resolve => require(['../components/common/Home.vue'], resolve),
meta: {title: '系统首页'},
children: [
// {
// path: '/index',
// component: resolve => require(['../components/page/Index.vue'], resolve),
// meta: {title: '野火开放平台'}
// },
{
path: '/index',
component: resolve => require(['../components/page/Index.vue'], resolve),
meta: {title: '野火开放平台'}
component: resolve => require(['../components/page/app/app.vue'], resolve),
meta: {title: '应用开发'}
},
{
path: '/dev/app',
Expand Down

0 comments on commit 02950ad

Please sign in to comment.