Commit 7eeeabad authored by smallwei's avatar smallwei

搞定bug

parent 0b641730
...@@ -44,6 +44,7 @@ export const tableOption = { ...@@ -44,6 +44,7 @@ export const tableOption = {
editDisabled: true, editDisabled: true,
addVisdiplay: false, addVisdiplay: false,
}, { }, {
width: 150,
fixed: true, fixed: true,
label: '用户名', label: '用户名',
prop: 'username', prop: 'username',
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<span slot="title">{{child[labelKey]}}</span> <span slot="title">{{child[labelKey]}}</span>
</el-menu-item> </el-menu-item>
<sidebar-item v-else <sidebar-item v-else
:menu="child[childrenKey]" :menu="[child]"
:key="cindex" :key="cindex"
:props="props" :props="props"
:screen="screen" :screen="screen"
......
...@@ -59,6 +59,7 @@ axios.interceptors.response.use(res => { ...@@ -59,6 +59,7 @@ axios.interceptors.response.use(res => {
}) })
return Promise.reject(new Error(message)) return Promise.reject(new Error(message))
} }
if (status !== 200) return Promise.reject(res);
return res; return res;
}, error => { }, error => {
NProgress.done() NProgress.done()
......
...@@ -19,6 +19,17 @@ export default [{ ...@@ -19,6 +19,17 @@ export default [{
component: () => component: () =>
import ( /* webpackChunkName: "views" */ '@/views/crud/index') import ( /* webpackChunkName: "views" */ '@/views/crud/index')
}] }]
}, {
path: '/info',
component: Layout,
redirect: '/info/index',
children: [{
path: 'index',
name: '个人信息',
component: () =>
import ( /* webpackChunkName: "page" */ '@/views/admin/user/info'),
}]
}, { }, {
path: '/activti', path: '/activti',
component: Layout, component: Layout,
......
...@@ -101,7 +101,7 @@ const user = { ...@@ -101,7 +101,7 @@ const user = {
commit('SET_ROLES', data.roles || []); commit('SET_ROLES', data.roles || []);
commit('SET_PERMISSIONS', data.permissions || []) commit('SET_PERMISSIONS', data.permissions || [])
resolve(data); resolve(data);
}).catch(() => { }).catch((err) => {
reject(); reject();
}) })
}) })
......
...@@ -204,7 +204,9 @@ export default { ...@@ -204,7 +204,9 @@ export default {
} else { } else {
this.form = data; this.form = data;
} }
setTimeout(() => {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
}, 0);
}) })
}, },
handlerEdit (data) { handlerEdit (data) {
...@@ -218,6 +220,9 @@ export default { ...@@ -218,6 +220,9 @@ export default {
if (validatenull(this.obj)) { if (validatenull(this.obj)) {
this.form.parentId = 0; this.form.parentId = 0;
this.form.parentName = ''; this.form.parentName = '';
setTimeout(() => {
this.$refs.form.clearValidate();
}, 0);
} else { } else {
this.show(this.obj); this.show(this.obj);
} }
...@@ -247,8 +252,6 @@ export default { ...@@ -247,8 +252,6 @@ export default {
}) })
}, },
update () { update () {
this.$refs.form.validate((valid) => {
if (!valid) return
putObj(this.form).then(() => { putObj(this.form).then(() => {
this.onCancel(); this.onCancel();
this.getList() this.getList()
...@@ -259,7 +262,6 @@ export default { ...@@ -259,7 +262,6 @@ export default {
duration: 2000 duration: 2000
}) })
}) })
})
}, },
create () { create () {
...@@ -277,10 +279,10 @@ export default { ...@@ -277,10 +279,10 @@ export default {
onCancel () { onCancel () {
this.formStatus = '' this.formStatus = ''
this.editFlag = false; this.editFlag = false;
setTimeout(() => {
this.$refs.form.resetForm(); this.$refs.form.resetForm();
setTimeout(() => {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
}, 0) }, 0);
} }
} }
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
--> -->
<template> <template>
<div class="app-container pull-auto"> <div class="log">
<basic-container> <basic-container>
<avue-crud ref="crud" <avue-crud ref="crud"
:page="page" :page="page"
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
</template> </template>
<script> <script>
import { fetchList, delObj } from '@/api/log' import { fetchList, delObj } from '@/api/log'
import { tableOption } from '@/const/crud/log' import { tableOption } from '@/const/crud/log'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'log', name: 'log',
data() { data () {
return { return {
tableData: [], tableData: [],
page: { page: {
...@@ -59,14 +59,14 @@ ...@@ -59,14 +59,14 @@
tableOption: tableOption tableOption: tableOption
} }
}, },
created() { created () {
}, },
mounted: function() { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList(page,params) { getList (page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
orderByField: 'create_time', orderByField: 'create_time',
...@@ -79,17 +79,17 @@ ...@@ -79,17 +79,17 @@
this.tableLoading = false this.tableLoading = false
}) })
}, },
handleDel(row, index) { handleDel (row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function(row, index) { rowDel: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认删除ID为"' + row.id + '"的日志?', '警告', { this.$confirm('是否确认删除ID为"' + row.id + '"的日志?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(function() { .then(function () {
return delObj(row.id) return delObj(row.id)
}) })
.then(data => { .then(data => {
...@@ -100,22 +100,22 @@ ...@@ -100,22 +100,22 @@
type: 'success' type: 'success'
}) })
}) })
.catch(function(err) { }) .catch(function (err) { })
}, },
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange(form) { searchChange (form) {
this.getList(this.page,form) this.getList(this.page, form)
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange() { refreshChange () {
this.getList(this.page) this.getList(this.page)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
...mapGetters(['elements', 'permissions']) ...mapGetters(['elements', 'permissions'])
}, },
methods: { methods: {
getList (page,params) { getList (page, params) {
this.listLoading = true this.listLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
page: page.currentPage, page: page.currentPage,
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
}, },
handleFilter (param) { handleFilter (param) {
this.page.page = 1; this.page.page = 1;
this.getList(this.page,param); this.getList(this.page, param);
}, },
handleCreate () { handleCreate () {
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
return fetchTree() return fetchTree()
}) })
.then(response => { .then(response => {
this.form = response.data.data this.treeData = response.data.data
// 解析出所有的太监节点 // 解析出所有的太监节点
this.checkedKeys = this.resolveAllEunuchNodeId(this.treeData, this.checkedKeys, []) this.checkedKeys = this.resolveAllEunuchNodeId(this.treeData, this.checkedKeys, [])
this.dialogStatus = 'permission' this.dialogStatus = 'permission'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment