diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/views/system/log/listLog.vue b/src/views/system/log/listLog.vue index ff96295..da954b9 100644 --- a/src/views/system/log/listLog.vue +++ b/src/views/system/log/listLog.vue @@ -150,11 +150,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/views/system/log/listLog.vue b/src/views/system/log/listLog.vue index ff96295..da954b9 100644 --- a/src/views/system/log/listLog.vue +++ b/src/views/system/log/listLog.vue @@ -150,11 +150,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/log/loginLog.vue b/src/views/system/log/loginLog.vue index 3f50639..9e11c6f 100644 --- a/src/views/system/log/loginLog.vue +++ b/src/views/system/log/loginLog.vue @@ -132,11 +132,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLoginLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/views/system/log/listLog.vue b/src/views/system/log/listLog.vue index ff96295..da954b9 100644 --- a/src/views/system/log/listLog.vue +++ b/src/views/system/log/listLog.vue @@ -150,11 +150,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/log/loginLog.vue b/src/views/system/log/loginLog.vue index 3f50639..9e11c6f 100644 --- a/src/views/system/log/loginLog.vue +++ b/src/views/system/log/loginLog.vue @@ -132,11 +132,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLoginLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/resource/editResource.vue b/src/views/system/resource/editResource.vue index d60482a..a824bdd 100644 --- a/src/views/system/resource/editResource.vue +++ b/src/views/system/resource/editResource.vue @@ -53,7 +53,7 @@ @@ -71,6 +71,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + btnLoading: false, // 保存按钮的加载中状态 resourceForm: { id: '', name: '', @@ -127,6 +128,7 @@ initDialog: function(dialogStatus, dialogFormVisible, row = null) { this.dialogStatus = dialogStatus this.dialogFormVisible = dialogFormVisible + this.btnLoading = false this.fetchPcode() this.fetchResourceType() if (dialogStatus === 'create') { // 如果是新增,清除验证 @@ -193,6 +195,7 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.resourceForm) if (valid) { + this.btnLoading = true addResource(this.resourceForm).then(response => { if (response.code === 200) { this.$confirm('新增成功,是否继续新增?', '提示', { @@ -200,6 +203,7 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.btnLoading = false this.resetForm() this.$nextTick(() => { this.$refs['dataForm'].clearValidate() @@ -210,6 +214,8 @@ this.dialogFormVisible = false }) } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) @@ -218,12 +224,15 @@ updateData: function() { this.$refs['dataForm'].validate((valid) => { if (valid) { + this.btnLoading = true updateResource(this.resourceForm).then(response => { if (response.code === 200) { this.$message.success('修改成功') this.$emit('watchChild') this.dialogFormVisible = false } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/views/system/log/listLog.vue b/src/views/system/log/listLog.vue index ff96295..da954b9 100644 --- a/src/views/system/log/listLog.vue +++ b/src/views/system/log/listLog.vue @@ -150,11 +150,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/log/loginLog.vue b/src/views/system/log/loginLog.vue index 3f50639..9e11c6f 100644 --- a/src/views/system/log/loginLog.vue +++ b/src/views/system/log/loginLog.vue @@ -132,11 +132,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLoginLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/resource/editResource.vue b/src/views/system/resource/editResource.vue index d60482a..a824bdd 100644 --- a/src/views/system/resource/editResource.vue +++ b/src/views/system/resource/editResource.vue @@ -53,7 +53,7 @@ @@ -71,6 +71,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + btnLoading: false, // 保存按钮的加载中状态 resourceForm: { id: '', name: '', @@ -127,6 +128,7 @@ initDialog: function(dialogStatus, dialogFormVisible, row = null) { this.dialogStatus = dialogStatus this.dialogFormVisible = dialogFormVisible + this.btnLoading = false this.fetchPcode() this.fetchResourceType() if (dialogStatus === 'create') { // 如果是新增,清除验证 @@ -193,6 +195,7 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.resourceForm) if (valid) { + this.btnLoading = true addResource(this.resourceForm).then(response => { if (response.code === 200) { this.$confirm('新增成功,是否继续新增?', '提示', { @@ -200,6 +203,7 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.btnLoading = false this.resetForm() this.$nextTick(() => { this.$refs['dataForm'].clearValidate() @@ -210,6 +214,8 @@ this.dialogFormVisible = false }) } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) @@ -218,12 +224,15 @@ updateData: function() { this.$refs['dataForm'].validate((valid) => { if (valid) { + this.btnLoading = true updateResource(this.resourceForm).then(response => { if (response.code === 200) { this.$message.success('修改成功') this.$emit('watchChild') this.dialogFormVisible = false } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) diff --git a/src/views/system/resource/listResource.vue b/src/views/system/resource/listResource.vue index 647b9f1..989050d 100644 --- a/src/views/system/resource/listResource.vue +++ b/src/views/system/resource/listResource.vue @@ -143,7 +143,6 @@ if (value.id === des.id) { console.log('findit') list.splice(index, 1) - } else { if (value.children && value.children.length > 0) { this.deleteItem(value.children, des) diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/views/system/log/listLog.vue b/src/views/system/log/listLog.vue index ff96295..da954b9 100644 --- a/src/views/system/log/listLog.vue +++ b/src/views/system/log/listLog.vue @@ -150,11 +150,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/log/loginLog.vue b/src/views/system/log/loginLog.vue index 3f50639..9e11c6f 100644 --- a/src/views/system/log/loginLog.vue +++ b/src/views/system/log/loginLog.vue @@ -132,11 +132,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLoginLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/resource/editResource.vue b/src/views/system/resource/editResource.vue index d60482a..a824bdd 100644 --- a/src/views/system/resource/editResource.vue +++ b/src/views/system/resource/editResource.vue @@ -53,7 +53,7 @@ @@ -71,6 +71,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + btnLoading: false, // 保存按钮的加载中状态 resourceForm: { id: '', name: '', @@ -127,6 +128,7 @@ initDialog: function(dialogStatus, dialogFormVisible, row = null) { this.dialogStatus = dialogStatus this.dialogFormVisible = dialogFormVisible + this.btnLoading = false this.fetchPcode() this.fetchResourceType() if (dialogStatus === 'create') { // 如果是新增,清除验证 @@ -193,6 +195,7 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.resourceForm) if (valid) { + this.btnLoading = true addResource(this.resourceForm).then(response => { if (response.code === 200) { this.$confirm('新增成功,是否继续新增?', '提示', { @@ -200,6 +203,7 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.btnLoading = false this.resetForm() this.$nextTick(() => { this.$refs['dataForm'].clearValidate() @@ -210,6 +214,8 @@ this.dialogFormVisible = false }) } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) @@ -218,12 +224,15 @@ updateData: function() { this.$refs['dataForm'].validate((valid) => { if (valid) { + this.btnLoading = true updateResource(this.resourceForm).then(response => { if (response.code === 200) { this.$message.success('修改成功') this.$emit('watchChild') this.dialogFormVisible = false } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) diff --git a/src/views/system/resource/listResource.vue b/src/views/system/resource/listResource.vue index 647b9f1..989050d 100644 --- a/src/views/system/resource/listResource.vue +++ b/src/views/system/resource/listResource.vue @@ -143,7 +143,6 @@ if (value.id === des.id) { console.log('findit') list.splice(index, 1) - } else { if (value.children && value.children.length > 0) { this.deleteItem(value.children, des) diff --git a/src/views/system/role/listRole.vue b/src/views/system/role/listRole.vue index f732a82..eee86d4 100644 --- a/src/views/system/role/listRole.vue +++ b/src/views/system/role/listRole.vue @@ -141,7 +141,6 @@ list.forEach((value, index) => { if (value.id === des.id) { list.splice(index, 1) - } else { if (value.children && value.children.length > 0) { // this.deleteItem(value.children, des) diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue new file mode 100644 index 0000000..c31c678 --- /dev/null +++ b/src/components/NomalTable/index.vue @@ -0,0 +1,226 @@ + + + + + + diff --git a/src/components/layout/AppContainer.vue b/src/components/layout/AppContainer.vue new file mode 100644 index 0000000..39bfd87 --- /dev/null +++ b/src/components/layout/AppContainer.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/router/modules/example.js b/src/router/modules/example.js new file mode 100644 index 0000000..9076d50 --- /dev/null +++ b/src/router/modules/example.js @@ -0,0 +1,21 @@ +/* Layout */ +import Layout from '@/layout/Layout' +export const exampleRouters = [{ + path: 'example', + component: Layout, + redirect: '/exampleTable', + name: 'Example', + alwaysShow: true, + meta: { + title: '示例', + icon: 'icon-config' // 图标 + }, + children: [ + { + path: '/exampleTable', + name: 'ExampleTable', + component: () => import('@/views/example/tableExample'), + meta: { title: '表格示例', icon: '' } + } + ] +}] diff --git a/src/views/example/tableExample.vue b/src/views/example/tableExample.vue new file mode 100644 index 0000000..d9dac99 --- /dev/null +++ b/src/views/example/tableExample.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/area/areaSelectTree.vue b/src/views/system/area/areaSelectTree.vue index 00466c2..c2afbdd 100644 --- a/src/views/system/area/areaSelectTree.vue +++ b/src/views/system/area/areaSelectTree.vue @@ -24,7 +24,7 @@ name: 'AreaSelectTree', data() { return { - dialogFormVisible: true, + dialogFormVisible: false, defaultProps: { label: 'name', children: 'children', @@ -36,12 +36,6 @@ } }, methods: { - // 获取数据 - // fetchData() { - // return new Promise(function(resolve, reject) { - // getAreaTree(this.roleId) - // }) - // }, // 初始化对话框 initDialog() { this.dialogFormVisible = true @@ -76,8 +70,8 @@ diff --git a/src/views/system/log/listLog.vue b/src/views/system/log/listLog.vue index ff96295..da954b9 100644 --- a/src/views/system/log/listLog.vue +++ b/src/views/system/log/listLog.vue @@ -150,11 +150,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/log/loginLog.vue b/src/views/system/log/loginLog.vue index 3f50639..9e11c6f 100644 --- a/src/views/system/log/loginLog.vue +++ b/src/views/system/log/loginLog.vue @@ -132,11 +132,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取日志数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getLoginLogList(this.listQuery).then(response => { this.list = response.data.rows this.total = parseInt(response.data.total) diff --git a/src/views/system/resource/editResource.vue b/src/views/system/resource/editResource.vue index d60482a..a824bdd 100644 --- a/src/views/system/resource/editResource.vue +++ b/src/views/system/resource/editResource.vue @@ -53,7 +53,7 @@ @@ -71,6 +71,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + btnLoading: false, // 保存按钮的加载中状态 resourceForm: { id: '', name: '', @@ -127,6 +128,7 @@ initDialog: function(dialogStatus, dialogFormVisible, row = null) { this.dialogStatus = dialogStatus this.dialogFormVisible = dialogFormVisible + this.btnLoading = false this.fetchPcode() this.fetchResourceType() if (dialogStatus === 'create') { // 如果是新增,清除验证 @@ -193,6 +195,7 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.resourceForm) if (valid) { + this.btnLoading = true addResource(this.resourceForm).then(response => { if (response.code === 200) { this.$confirm('新增成功,是否继续新增?', '提示', { @@ -200,6 +203,7 @@ cancelButtonText: '否', type: 'info' }).then(() => { + this.btnLoading = false this.resetForm() this.$nextTick(() => { this.$refs['dataForm'].clearValidate() @@ -210,6 +214,8 @@ this.dialogFormVisible = false }) } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) @@ -218,12 +224,15 @@ updateData: function() { this.$refs['dataForm'].validate((valid) => { if (valid) { + this.btnLoading = true updateResource(this.resourceForm).then(response => { if (response.code === 200) { this.$message.success('修改成功') this.$emit('watchChild') this.dialogFormVisible = false } + }).catch(_ => { // 异常情况,loading置为false + this.btnLoading = false }) } }) diff --git a/src/views/system/resource/listResource.vue b/src/views/system/resource/listResource.vue index 647b9f1..989050d 100644 --- a/src/views/system/resource/listResource.vue +++ b/src/views/system/resource/listResource.vue @@ -143,7 +143,6 @@ if (value.id === des.id) { console.log('findit') list.splice(index, 1) - } else { if (value.children && value.children.length > 0) { this.deleteItem(value.children, des) diff --git a/src/views/system/role/listRole.vue b/src/views/system/role/listRole.vue index f732a82..eee86d4 100644 --- a/src/views/system/role/listRole.vue +++ b/src/views/system/role/listRole.vue @@ -141,7 +141,6 @@ list.forEach((value, index) => { if (value.id === des.id) { list.splice(index, 1) - } else { if (value.children && value.children.length > 0) { // this.deleteItem(value.children, des) diff --git a/src/views/system/user/listUser.vue b/src/views/system/user/listUser.vue index cf0171f..44beb6b 100644 --- a/src/views/system/user/listUser.vue +++ b/src/views/system/user/listUser.vue @@ -74,7 +74,7 @@ {{ scope.row.statusName }} - + @@ -130,7 +130,7 @@ }, registerTime: [], // 注册时间范围 tagNames: { - '已冻结': 'warning', + '已冻结': 'danger', '启用': 'success' }, btnNames: { @@ -138,8 +138,8 @@ '启用': '冻结' }, btnStatus: { - '已冻结': 'success', - '正常': 'danger' + '已冻结': '', + '启用': 'primary' }, columns: [ { @@ -323,11 +323,14 @@ }, // 查询数据 search() { - this.fetchData() + this.fetchData(false) }, // 获取用户数据 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getUserList(this.listQuery).then(response => { this.list = response.data.rows this.total = response.data.total