[update]修改路由, 通配编辑路由

This commit is contained in:
OrangeM21
2020-03-21 04:15:32 +08:00
parent 88b3cb6c31
commit d4a941cd80
5 changed files with 53 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.backplayground{ .backplayground{
height: 100%; height: 100%;
background-color: #ffffff;
margin-left:0.5%; margin-left:0.5%;
margin-right:0.5%; margin-right:0.5%;
margin-top:1%; margin-top:1%;

View File

@@ -6,7 +6,7 @@
{{ tabletitle }} {{ tabletitle }}
</div> </div>
<el-row class="tableTitle-menu"> <el-row class="tableTitle-menu">
<el-col :span="2"><el-button size="small" type="primary" @click="$router.push({ name: tableroute })">{{ tablebotton }}</el-button></el-col> <el-col :span="2"><el-button size="small" type="primary" @click="$router.push({ name: tableroute, params:{id:'create'} })">{{ tablebotton }}</el-button></el-col>
<el-col :span="3" :offset="17"> <el-col :span="3" :offset="17">
<el-input <el-input
size="small" size="small"

View File

@@ -256,15 +256,17 @@ export const asyncRoutes = [
}, },
children: [ children: [
{ {
path: 'list', path: 'user/list',
component: () => import('@/views/users/List.vue'), // Parent router-view component: () => import('@/views/users/List.vue'), // Parent router-view
name: 'List', name: 'List',
meta: { title: 'List' } meta: { title: 'List' }
}, },
{ {
path: 'menu2', path: 'user/:id',
component: () => import('@/views/nested/menu2/index'), component: () => import('@/views/users/Edit.vue'), // Parent router-view
meta: { title: 'menu2' } name: 'Edit',
meta: { title: 'Edit' },
hidden: true
} }
] ]
}, },

39
src/views/users/Edit.vue Normal file
View File

@@ -0,0 +1,39 @@
<template>
<BackPlayground>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="审批人">
<el-input v-model="formInline.user" placeholder="审批人" />
</el-form-item>
<el-form-item label="活动区域">
<el-select v-model="formInline.region" placeholder="活动区域">
<el-option label="区域一" value="shanghai" />
<el-option label="区域二" value="beijing" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
</el-form>
</BackPlayground>
</template>
<script>
import { BackPlayground } from '@/layout/components'
export default {
components: {
BackPlayground
},
data() {
return {
formInline: {
user: '',
region: ''
}
}
}
}
</script>
<style>
</style>

View File

@@ -3,11 +3,12 @@
<ListTables <ListTables
:tabletitle="$t('users.usergrouplist')" :tabletitle="$t('users.usergrouplist')"
:tablebotton="$t('users.createusergroup')" :tablebotton="$t('users.createusergroup')"
:tableroute="404" tableroute="Edit"
@SizeChange="handleSizeChange" @SizeChange="handleSizeChange"
@CurrentChange="handleCurrentChange" @CurrentChange="handleCurrentChange"
> >
<el-table <el-table
v-loading="listLoading"
:data="tableData" :data="tableData"
stripe stripe
border border
@@ -83,7 +84,8 @@ export default {
mixins: [Tables], mixins: [Tables],
data() { data() {
return { return {
tableData: [] tableData: [],
listLoading: true
} }
}, },
created() { created() {
@@ -101,9 +103,11 @@ export default {
this.getUsers(val, this.page_size, this.offset) this.getUsers(val, this.page_size, this.offset)
}, },
getUsers(draw, limit, offset) { getUsers(draw, limit, offset) {
this.listLoading = true
getUserList({ draw, limit, offset }).then(response => { getUserList({ draw, limit, offset }).then(response => {
this.tableData = response.results this.tableData = response.results
this.total = response.count this.total = response.count
this.listLoading = false
}) })
} }
} }