Skip to content

Commit

Permalink
Merge pull request #28 from shuaijinchao/bugfix/routing/drawer
Browse files Browse the repository at this point in the history
bugfix: routing drawer questions.
  • Loading branch information
shuaijinchao authored Apr 23, 2020
2 parents ec0f7b7 + 630d94a commit b7cd9e3
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 40 deletions.
5 changes: 5 additions & 0 deletions src/components/layouts/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
mounted() {
this.defaultActiveMenu = this.$route.name;
},
watch: {
'$route.name': function (newName, oldName) {
this.defaultActiveMenu = newName;
}
}
};
</script>

Expand Down
30 changes: 15 additions & 15 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Vue from "vue";
import App from "./App.vue";
import ApioakCookie from 'vue-cookies';
import ApioakElement from 'element-ui';
import ApioakBackend from '@/apioak/backend';
import ApioakRequest from '@/apioak/request';
import ApioakConst from "@/apioak/const";
import ApioakRouter from '@/apioak/router';
import ApioakStore from '@/store'
import APIOAKCookie from 'vue-cookies';
import APIOAKElement from 'element-ui';
import APIOAKBackend from '@/apioak/backend';
import APIOAKRequest from '@/apioak/request';
import APIOAKConst from "@/apioak/const";
import APIOAKRouter from '@/router';
import APIOAKStore from '@/store/index';

Vue.use(ApioakRouter);
Vue.use(ApioakCookie);
Vue.use(ApioakElement);
Vue.use(ApioakBackend);
Vue.use(ApioakRequest);
Vue.use(ApioakConst);
Vue.use(APIOAKRouter);
Vue.use(APIOAKCookie);
Vue.use(APIOAKElement);
Vue.use(APIOAKBackend);
Vue.use(APIOAKRequest);
Vue.use(APIOAKConst);

Vue.config.productionTip = false;

new Vue({
router: ApioakRouter,
store: ApioakStore,
router: APIOAKRouter,
store: APIOAKStore,
render: h => h(App),
}).$mount("#app");
File renamed without changes.
6 changes: 3 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import global from './modules/global'
Vue.use(Vuex);

export default new Vuex.Store({
modules: {
global,
},
modules: {
global,
},
})
40 changes: 37 additions & 3 deletions src/views/project/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<el-form :inline="true" :model="projectQueryData" class="project-form-inline">
<el-form-item>
<el-input v-model="projectQueryData.name" placeholder="输入项目名称"
prefix-icon="el-icon-search"></el-input>
prefix-icon="el-icon-search" @keyup.enter.native="queryProjectByName"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="queryProjectByName" icon="el-icon-search">搜索</el-button>
Expand Down Expand Up @@ -274,10 +274,10 @@
},
queryProjectByName() {
let name = this.projectQueryData.name;
let name = this.projectQueryData.name.trim();
if (name) {
this.projectLists = this.projectLists.filter(ele => {
return ele.name === name.trim();
return ele.name.includes(name);
});
this.initTable();
} else {
Expand All @@ -287,6 +287,40 @@
}
};
</script>
<style lang="css">
.el-drawer__body {
overflow-x: hidden;
overflow-y: auto;
}
.table-expand {
font-size: 0;
}
.table-expand label {
width: 160px;
color: #99a9bf;
text-align: right !important;
}
.table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 100%;
}
.table-expand .el-form-item__content {
padding-left: 160px;
}
.fe-inline-table .resizeInputClass /deep/ .el-form-item__content {
margin-left: 0 !important;
}
.fe-inline-table .resizeInputClass.el-form-item {
margin-bottom: 0 !important;
}
</style>
<style lang="scss" scoped>
.project-container {
width: 100%;
Expand Down
6 changes: 3 additions & 3 deletions src/views/project/updated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

<el-input type="hidden" v-model="projectForm.upstreams[upstreamIndex].id"></el-input>

<el-form-item label="主机地址" :prop="`upstreams[${upstreamIndex}].host`"
<el-form-item label="主机名称" :prop="`upstreams[${upstreamIndex}].host`"
:rules="projectRules.hostname">
<el-input v-model="projectForm.upstreams[upstreamIndex].host" placeholder="主机地址">
<el-input v-model="projectForm.upstreams[upstreamIndex].host" placeholder="主机名称">
</el-input>
</el-form-item>

Expand Down Expand Up @@ -193,7 +193,7 @@
if (reg.test(value)) {
callback();
} else {
return callback(new Error('主机地址不合法'));
return callback(new Error('主机名称不合法,主机名称应为WEB服务器的 Server Name,禁止使用 http:// 或 https:// 开始。'));
}
};
return {
Expand Down
6 changes: 3 additions & 3 deletions src/views/router/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<el-form-item>
<el-input v-model="routerQueryData.name" placeholder="输入路由名称"
prefix-icon="el-icon-search"></el-input>
prefix-icon="el-icon-search" @keyup.enter.native="queryRouterByName"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="queryRouterByName" icon="el-icon-search">查询</el-button>
Expand Down Expand Up @@ -251,10 +251,10 @@
},
methods: {
queryRouterByName() {
let name = this.routerQueryData.name;
let name = this.routerQueryData.name.trim();
if (name) {
this.routerLists = this.routerLists.filter(ele => {
return ele.name === name.trim();
return ele.name.includes(name);
});
this.initTable();
} else {
Expand Down
9 changes: 1 addition & 8 deletions src/views/router/updated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
this.$emit('changeUpdatedRouter', value);
}
this.routerForms = {};
this.routerOperateSection = 1;
this.$refs['routerRequestForms'].resetFields();
this.$refs['routerBackendForms'].resetFields();
this.$refs['routerResponseForms'].resetFields();
Expand Down Expand Up @@ -1145,12 +1146,4 @@
width: 300px;
}
.fe-inline-table .resizeInputClass /deep/ .el-form-item__content {
margin-left: 0 !important;
}
.fe-inline-table .resizeInputClass.el-form-item {
margin-bottom: 0 !important;
}
</style>
22 changes: 17 additions & 5 deletions src/views/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
</el-button>
<el-form :inline="true" :model="userQueryData" class="user-form-inline">
<el-form-item label="">
<el-input v-model="userQueryData.email" placeholder="输入邮箱"></el-input>
<el-input v-model="userQueryData.email" placeholder="输入邮箱"
@keyup.enter.native="executeQueryUserByEmail"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="executeQueryUserByEmail">查询</el-button>
Expand All @@ -24,7 +25,7 @@
<template slot-scope="user">
<el-switch active-color="#13ce66" v-model="user.row.is_enable"
@change='executeUpdatedUserStatus(user.row)' :active-value="1"
:inactive-value="0"></el-switch>
:inactive-value="0" :disabled="loginUID === user.row.id"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作">
Expand All @@ -41,7 +42,8 @@
iconColor="red"
@onConfirm="executeRemoveUser(user.row)"
title="确定删除该项目吗?" style="margin-right:10px;">
<el-button slot="reference" type="danger" size="small">删除
<el-button slot="reference" type="danger" size="small"
:disabled="loginUID === user.row.id">删除
</el-button>
</el-popconfirm>

Expand Down Expand Up @@ -94,6 +96,8 @@
optionPasswordUserOpen: false,
optionPasswordUserId: 0,
loginUID: 0,
userLists: [],
userCount: 0,
userTableLists: [],
Expand All @@ -110,6 +114,7 @@
};
},
created() {
this.getLoginUID();
this.getUsers();
},
methods: {
Expand Down Expand Up @@ -216,11 +221,18 @@
});
},
getLoginUID() {
let loginAdminID = this.$cookies.get(this.$oakConst.cookies.APIOAK_ADMIN_ID);
if (loginAdminID) {
this.loginUID = parseInt(loginAdminID);
}
},
executeQueryUserByEmail() {
let email = this.userQueryData.email;
let email = this.userQueryData.email.trim();
if (email) {
this.userLists = this.userLists.filter(ele => {
return ele.email === email.trim();
return ele.email.includes(email);
});
this.initTable();
} else {
Expand Down

0 comments on commit b7cd9e3

Please sign in to comment.