Commit dae0736c authored by 冷冷's avatar 冷冷

👽 Updating code due to external API changes.

parent c98f8614
...@@ -25,6 +25,7 @@ export const tableOption = { ...@@ -25,6 +25,7 @@ export const tableOption = {
align: 'center', align: 'center',
editBtn: false, editBtn: false,
delBtn: false, delBtn: false,
menuType:'menu',
searchShow: false, searchShow: false,
labelWidth: 120, labelWidth: 120,
column: [{ column: [{
......
...@@ -25,6 +25,7 @@ export const tableOption = { ...@@ -25,6 +25,7 @@ export const tableOption = {
'editBtn': false, 'editBtn': false,
'delBtn': false, 'delBtn': false,
'addBtn': false, 'addBtn': false,
menuType:'menu',
'dicUrl': '/admin/dict/type/leave_status', 'dicUrl': '/admin/dict/type/leave_status',
'column': [ 'column': [
{ {
......
...@@ -26,6 +26,7 @@ export const tableOption = { ...@@ -26,6 +26,7 @@ export const tableOption = {
addBtn: false, addBtn: false,
editBtn: false, editBtn: false,
delBtn: false, delBtn: false,
menuType:'menu',
searchShow: false, searchShow: false,
column: [{ column: [{
fixed: true, fixed: true,
......
...@@ -24,6 +24,7 @@ export const tableOption = { ...@@ -24,6 +24,7 @@ export const tableOption = {
'editBtn': false, 'editBtn': false,
'delBtn': false, 'delBtn': false,
'addBtn': false, 'addBtn': false,
menuType: 'menu',
'dic': [], 'dic': [],
'column': [ 'column': [
{ {
......
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
@keyup.enter.native="handleLogin"> @keyup.enter.native="handleLogin">
<div class="login-logo animated fadeIn"> <div class="login-logo animated fadeIn">
<el-select v-model="active" <el-select v-model="active"
@change="handleCommand"
placeholder="请选择租户,不选为默认" placeholder="请选择租户,不选为默认"
size="mini"> size="mini">
<el-option label="默认租户"
value="">
</el-option>
<el-option label="租户1" <el-option label="租户1"
value="1"> value="1">
</el-option> </el-option>
...@@ -58,7 +56,7 @@ import codeLogin from "./codelogin"; ...@@ -58,7 +56,7 @@ import codeLogin from "./codelogin";
import thirdLogin from "./thirdlogin"; import thirdLogin from "./thirdlogin";
import topColor from "../index/top/top-color"; import topColor from "../index/top/top-color";
import color from "@/mixins/color"; import color from "@/mixins/color";
import { setStore } from '@/util/store' import { setStore,getStore } from '@/util/store'
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { validatenull } from '@/util/validate' import { validatenull } from '@/util/validate'
export default { export default {
...@@ -95,6 +93,7 @@ export default { ...@@ -95,6 +93,7 @@ export default {
} }
}, },
created () { created () {
this.active = getStore({ name: 'tenantId' });
}, },
mounted () { }, mounted () { },
computed: { computed: {
...@@ -103,7 +102,7 @@ export default { ...@@ -103,7 +102,7 @@ export default {
props: [], props: [],
methods: { methods: {
handleCommand (command) { handleCommand (command) {
setStore({ name: 'tenantId', content: command, type: 'session' }) setStore({ name: 'tenantId', content: command})
} }
} }
}; };
......
...@@ -48,6 +48,14 @@ axios.interceptors.response.use(res => { ...@@ -48,6 +48,14 @@ axios.interceptors.response.use(res => {
NProgress.done(); NProgress.done();
const status = Number(res.status); const status = Number(res.status);
const message = res.data.message || errorCode[status] || errorCode['default']; const message = res.data.message || errorCode[status] || errorCode['default'];
if (status === 401){
store.dispatch('FedLogOut').then(() => {
router.push({
path: '/login'
});
})
}
if (status !== 200) { if (status !== 200) {
Message({ Message({
message: message, message: message,
......
...@@ -23,22 +23,21 @@ ...@@ -23,22 +23,21 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@size-change="sizeChange"
@search-change="searchChange" @search-change="searchChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@row-save="handleSave" @row-save="handleSave"
@row-del="rowDel"> @row-del="rowDel">
<template slot-scope="scope" <template slot-scope="scope"
slot="dropMenu"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del" v-if="permissions.act_model_manage"
@click.native="handleView(scope.row,scope.index)">模型图</el-dropdown-item> @click.native="handleView(scope.row,scope.index)">模型图</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del" v-if="permissions.act_model_manage"
@click.native="handleDeploy(scope.row,scope.index)">部署</el-dropdown-item> @click.native="handleDeploy(scope.row,scope.index)">部署</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del" v-if="permissions.act_model_manage"
@click.native="handleDel(scope.row,scope.index)">删除</el-dropdown-item> @click.native="handleDel(scope.row,scope.index)">删除</el-dropdown-item>
</template> </template>
...@@ -61,41 +60,30 @@ export default { ...@@ -61,41 +60,30 @@ export default {
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
category: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created () {
this.getList()
}, },
mounted: function () { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.tableLoading = true this.tableLoading = true
this.listQuery.orderByField = 'create_time' fetchList(Object.assign({
this.listQuery.isAsc = false orderByField: 'create_time',
fetchList(this.listQuery).then(response => { isAsc: false,
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange (val) {
this.listQuery.page = val
this.getList()
},
sizeChange (val) {
this.listQuery.limit = val
this.getList()
},
handleView (row, index) { handleView (row, index) {
const name = `模型id为${row.id}${row.name}流程图`, const name = `模型id为${row.id}${row.name}流程图`,
src = `/activti/detail/${row.id}`; src = `/activti/detail/${row.id}`;
...@@ -119,7 +107,7 @@ export default { ...@@ -119,7 +107,7 @@ export default {
return deploy(row.id) return deploy(row.id)
}) })
.then(data => { .then(data => {
this.getList() this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '部署成功', message: '部署成功',
...@@ -139,7 +127,7 @@ export default { ...@@ -139,7 +127,7 @@ export default {
return delObj(row.id) return delObj(row.id)
}) })
.then(data => { .then(data => {
this.getList() this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
...@@ -163,21 +151,20 @@ export default { ...@@ -163,21 +151,20 @@ export default {
type: 'success' type: 'success'
}) })
done() done()
this.getList() this.getList(this.page)
}) })
}, },
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange (form) { searchChange (form) {
this.listQuery.category = form.category this.getList(this.page,form)
this.getList()
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange () {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -23,10 +23,9 @@ ...@@ -23,10 +23,9 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@on-load="getList"
@search-change="searchChange" @search-change="searchChange"
@current-change="currentChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange"
@row-update="handleUpdate" @row-update="handleUpdate"
@row-save="handleSave" @row-save="handleSave"
@row-del="rowDel"> @row-del="rowDel">
...@@ -37,7 +36,7 @@ ...@@ -37,7 +36,7 @@
v-if="permissions.act_leavebill_add">新 增</el-button> v-if="permissions.act_leavebill_add">新 增</el-button>
</template> </template>
<template slot-scope="scope" <template slot-scope="scope"
slot="dropMenu"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_edit && scope.row.state == 0" v-if="permissions.act_leavebill_edit && scope.row.state == 0"
@click.native="handleSubmit(scope.row,scope.index)">提交</el-dropdown-item> @click.native="handleSubmit(scope.row,scope.index)">提交</el-dropdown-item>
...@@ -68,42 +67,30 @@ ...@@ -68,42 +67,30 @@
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created() { created() {
this.getList()
}, },
mounted: function() { }, mounted: function() { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList() { getList(page,params) {
this.listQuery.orderByField = 'create_time'
this.listQuery.isAsc = false
this.tableLoading = true this.tableLoading = true
fetchList(this.listQuery).then(response => { fetchList(Object.assign({
orderByField: 'create_time',
isAsc: false,
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange(val) {
this.page.currentPage = val
this.listQuery.page = val
this.getList()
},
sizeChange(val) {
this.page.pageSize = val
this.listQuery.limit = val
this.getList()
},
/** /**
* @title 打开新增窗口 * @title 打开新增窗口
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
...@@ -153,7 +140,7 @@ ...@@ -153,7 +140,7 @@
message: '提交成功', message: '提交成功',
type: 'success' type: 'success'
}) })
this.getList() this.getList(this.page)
}).catch(function(err) { }) }).catch(function(err) { })
}, },
/** /**
...@@ -172,7 +159,7 @@ ...@@ -172,7 +159,7 @@
type: 'success' type: 'success'
}) })
done() done()
this.getList() this.getList(this.page)
}) })
}, },
/** /**
...@@ -190,21 +177,21 @@ ...@@ -190,21 +177,21 @@
type: 'success' type: 'success'
}) })
done() done()
this.getList() this.getList(this.page)
}) })
}, },
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange(form) { searchChange(form) {
this.listQuery.state = form.state this.page.state = form.state
this.getList() this.getList(this.page,form)
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange() { refreshChange() {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -23,27 +23,26 @@ ...@@ -23,27 +23,26 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@size-change="sizeChange"
@search-change="searchChange" @search-change="searchChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@row-del="rowDel"> @row-del="rowDel">
<template slot-scope="scope" <template slot-scope="scope"
slot="dropMenu"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del" v-if="permissions.act_process_manage"
@click.native="handlePic(scope.row,scope.index)">流程图</el-dropdown-item> @click.native="handlePic(scope.row,scope.index)">流程图</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del && scope.row.suspend" v-if="permissions.act_process_manage && scope.row.suspend"
@click.native="handleStatus(scope.row,'active')">激活</el-dropdown-item> @click.native="handleStatus(scope.row,'active')">激活</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del && !scope.row.suspend" v-if="permissions.act_process_manage && !scope.row.suspend"
@click.native="handleStatus(scope.row,'suspend')">失效</el-dropdown-item> @click.native="handleStatus(scope.row,'suspend')">失效</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.sys_log_del" v-if="permissions.act_process_manage"
@click.native="handleDel(scope.row,'suspend')">删除</el-dropdown-item> @click.native="handleDel(scope.row,'suspend')">删除</el-dropdown-item>
</template> </template>
</avue-crud> </avue-crud>
...@@ -71,41 +70,30 @@ export default { ...@@ -71,41 +70,30 @@ export default {
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
category: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created () {
this.getList()
}, },
mounted: function () { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.tableLoading = true this.tableLoading = true
this.listQuery.orderByField = 'create_time' fetchList(Object.assign({
this.listQuery.isAsc = false orderByField: 'create_time',
fetchList(this.listQuery).then(response => { isAsc: false,
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange (val) {
this.listQuery.page = val
this.getList()
},
sizeChange (val) {
this.listQuery.limit = val
this.getList()
},
handlePic (row, index) { handlePic (row, index) {
this.actPicUrl = `/act/process/resource/` + row.deploymentId + '/' + row.processonDefinitionId + "/image" this.actPicUrl = `/act/process/resource/` + row.deploymentId + '/' + row.processonDefinitionId + "/image"
this.showPicDialog = true this.showPicDialog = true
...@@ -119,7 +107,7 @@ export default { ...@@ -119,7 +107,7 @@ export default {
}).then(function () { }).then(function () {
return status(row.processonDefinitionId, type) return status(row.processonDefinitionId, type)
}).then(data => { }).then(data => {
this.getList() this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '操作成功', message: '操作成功',
...@@ -141,7 +129,7 @@ export default { ...@@ -141,7 +129,7 @@ export default {
return delObj(row.deploymentId) return delObj(row.deploymentId)
}) })
.then(data => { .then(data => {
this.getList() this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
...@@ -154,14 +142,13 @@ export default { ...@@ -154,14 +142,13 @@ export default {
* 搜索回调 * 搜索回调
*/ */
searchChange (form) { searchChange (form) {
this.listQuery.category = form.category this.getList(this.page,form)
this.getList()
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange () {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -21,21 +21,20 @@ ...@@ -21,21 +21,20 @@
<avue-crud ref="crud" <avue-crud ref="crud"
:page="page" :page="page"
:data="tableData" :data="tableData"
@on-load="getList"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @refresh-change="refreshChange">
@refresh-change="refreshChange"
@size-change="sizeChange">
<template slot-scope="scope" <template slot-scope="scope"
slot="dropMenu"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_edit" v-if="permissions.act_task_manage"
@click.native="audit(scope.row,scope.index)">审批</el-dropdown-item> @click.native="audit(scope.row,scope.index)">审批</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_edit" v-if="permissions.act_task_manage"
@click.native="comment(scope.row,scope.index)">批注</el-dropdown-item> @click.native="comment(scope.row,scope.index)">批注</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_edit" v-if="permissions.act_task_manage"
@click.native="viewPic(scope.row,scope.index)">流程图</el-dropdown-item> @click.native="viewPic(scope.row,scope.index)">流程图</el-dropdown-item>
</template> </template>
</avue-crud> </avue-crud>
...@@ -83,10 +82,6 @@ ...@@ -83,10 +82,6 @@
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20
},
tableLoading: false, tableLoading: false,
tableOption: tableOption, tableOption: tableOption,
formOption: formOption, formOption: formOption,
...@@ -94,30 +89,23 @@ ...@@ -94,30 +89,23 @@
} }
}, },
created() { created() {
this.getList()
}, },
mounted: function() { }, mounted: function() { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList() { getList(page,params) {
this.tableLoading = true this.tableLoading = true
fetchList(this.listQuery).then(response => { fetchList(Object.assign({
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
})}, })},
currentChange(val) {
this.page.currentPage = val
this.listQuery.page = val
this.getList()
},
sizeChange(val) {
this.page.pageSize = val
this.listQuery.limit = val
this.getList()
},
audit:function(row, index) { audit:function(row, index) {
fetchDetail(row.taskId).then(response => { fetchDetail(row.taskId).then(response => {
this.obj = response.data.data this.obj = response.data.data
...@@ -161,7 +149,7 @@ ...@@ -161,7 +149,7 @@
type: 'success' type: 'success'
}) })
this.showTask = false this.showTask = false
this.getList() this.getList(this.page)
}) })
}, },
viewPic: function(row, index) { viewPic: function(row, index) {
...@@ -172,7 +160,7 @@ ...@@ -172,7 +160,7 @@
* 刷新回调 * 刷新回调
*/ */
refreshChange() { refreshChange() {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange"
@row-update="handleUpdate" @row-update="handleUpdate"
@row-save="handleSave" @row-save="handleSave"
@row-del="rowDel"> @row-del="rowDel">
...@@ -68,32 +67,23 @@ export default { ...@@ -68,32 +67,23 @@ export default {
} }
}, },
created() { created() {
this.getList()
}, },
mounted: function() { }, mounted: function() { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList() { getList(page,params) {
this.tableLoading = true this.tableLoading = true
fetchList({ fetchList(Object.assign({
page: this.page.currentPage, page: page.currentPage,
limit: this.page.pageSize limit: page.pageSize
}).then(response => { }, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange(val) {
this.page.currentPage = val
this.getList()
},
sizeChange(val) {
this.page.pageSize = val
this.getList()
},
/** /**
* @title 打开新增窗口 * @title 打开新增窗口
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
...@@ -167,7 +157,7 @@ export default { ...@@ -167,7 +157,7 @@ export default {
* 刷新回调 * 刷新回调
*/ */
refreshChange() { refreshChange() {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@size-change="sizeChange"
@row-update="handleUpdate" @row-update="handleUpdate"
@row-save="handleSave" @row-save="handleSave"
@search-change="searchChange" @search-change="searchChange"
...@@ -63,41 +62,28 @@ export default { ...@@ -63,41 +62,28 @@ export default {
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
type: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created () {
this.getList()
}, },
mounted: function () { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.tableLoading = true this.tableLoading = true
this.listQuery.orderByField = 'create_time' fetchList(Object.assign({
this.listQuery.isAsc = false page: page.currentPage,
fetchList(this.listQuery).then(response => { limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange (val) {
this.listQuery.page = val
this.getList()
},
sizeChange (val) {
this.listQuery.limit = val
this.getList()
},
/** /**
* @title 打开新增窗口 * @title 打开新增窗口
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
...@@ -123,7 +109,7 @@ export default { ...@@ -123,7 +109,7 @@ export default {
return delObj(row) return delObj(row)
}) })
.then(() => { .then(() => {
this.getList() this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
...@@ -168,8 +154,7 @@ export default { ...@@ -168,8 +154,7 @@ export default {
}) })
}, },
searchChange (form) { searchChange (form) {
this.listQuery.type = form.type this.getList(this.page,form)
this.getList()
} }
} }
} }
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange"
@search-change="searchChange"> @search-change="searchChange">
<template slot-scope="scope" <template slot-scope="scope"
slot="menu"> slot="menu">
...@@ -70,42 +69,29 @@ export default { ...@@ -70,42 +69,29 @@ export default {
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
tableName: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption, tableOption: tableOption,
formOption: formOption formOption: formOption
} }
}, },
created () { created () {
this.getList()
}, },
mounted: function () { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.tableLoading = true this.tableLoading = true
fetchList(this.listQuery).then(response => { fetchList(Object.assign({
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange (val) {
this.page.currentPage = val
this.listQuery.page = val
this.getList()
},
sizeChange (val) {
this.page.pageSize = val
this.listQuery.limit = val
this.getList()
},
handleDown: function (row, index) { handleDown: function (row, index) {
this.formData.tableName = row.tableName this.formData.tableName = row.tableName
this.box = true this.box = true
...@@ -114,11 +100,10 @@ export default { ...@@ -114,11 +100,10 @@ export default {
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange () {
this.getList() this.getList(this.form)
}, },
searchChange (form) { searchChange (form) {
this.listQuery.tableName = form.tableName this.getList(this.page,form)
this.getList()
}, },
gen (form) { gen (form) {
handleDown(this.formData).then(response => { handleDown(this.formData).then(response => {
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@size-change="sizeChange"
@search-change="searchChange" @search-change="searchChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@row-del="rowDel"> @row-del="rowDel">
...@@ -56,41 +55,30 @@ ...@@ -56,41 +55,30 @@
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
type: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created() { created() {
this.getList()
}, },
mounted: function() { }, mounted: function() { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList() { getList(page,params) {
this.tableLoading = true this.tableLoading = true
this.listQuery.orderByField = 'create_time' fetchList(Object.assign({
this.listQuery.isAsc = false orderByField: 'create_time',
fetchList(this.listQuery).then(response => { isAsc: false,
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange(val) {
this.listQuery.page = val
this.getList()
},
sizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
...@@ -105,7 +93,7 @@ ...@@ -105,7 +93,7 @@
return delObj(row.id) return delObj(row.id)
}) })
.then(data => { .then(data => {
this.getList() this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
...@@ -118,14 +106,13 @@ ...@@ -118,14 +106,13 @@
* 搜索回调 * 搜索回调
*/ */
searchChange(form) { searchChange(form) {
this.listQuery.type = form.type this.getList(this.page,form)
this.getList()
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange() { refreshChange() {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
v-model="form" v-model="form"
:table-loading="listLoading" :table-loading="listLoading"
:before-open="handleOpenBefore" :before-open="handleOpenBefore"
@current-change="handleCurrentChange" @on-load="getList"
@size-change="handleSizeChange"
@search-change="handleFilter" @search-change="handleFilter"
@refresh-change="handleRefreshChange" @refresh-change="handleRefreshChange"
@row-update="update" @row-update="update"
...@@ -116,10 +115,6 @@ export default { ...@@ -116,10 +115,6 @@ export default {
menuIds: '', menuIds: '',
list: [], list: [],
listLoading: true, listLoading: true,
listQuery: {
page: 1,
limit: 20
},
form: {}, form: {},
roleId: undefined, roleId: undefined,
roleCode: undefined, roleCode: undefined,
...@@ -132,7 +127,6 @@ export default { ...@@ -132,7 +127,6 @@ export default {
} }
}, },
created () { created () {
this.getList()
this.roleManager_btn_add = this.permissions['sys_role_add'] this.roleManager_btn_add = this.permissions['sys_role_add']
this.roleManager_btn_edit = this.permissions['sys_role_edit'] this.roleManager_btn_edit = this.permissions['sys_role_edit']
this.roleManager_btn_del = this.permissions['sys_role_del'] this.roleManager_btn_del = this.permissions['sys_role_del']
...@@ -142,29 +136,23 @@ export default { ...@@ -142,29 +136,23 @@ export default {
...mapGetters(['elements', 'permissions']) ...mapGetters(['elements', 'permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.listLoading = true this.listLoading = true
fetchList(this.listQuery).then(response => { fetchList(Object.assign({
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.list = response.data.records this.list = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.listLoading = false this.listLoading = false
}) })
}, },
handleRefreshChange () { handleRefreshChange () {
this.getList() this.getList(this.page)
}, },
handleFilter (param) { handleFilter (param) {
this.listQuery = Object.assign(this.listQuery, param) this.page.page = 1;
this.listQuery.page = 1; this.getList(this.page,param);
this.getList();
},
handleSizeChange (val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange (val) {
this.listQuery.page = val
this.getList()
}, },
handleCreate () { handleCreate () {
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
...@@ -230,7 +218,7 @@ export default { ...@@ -230,7 +218,7 @@ export default {
}, },
create (row, done, loading) { create (row, done, loading) {
addObj(this.form).then(() => { addObj(this.form).then(() => {
this.getList() this.getList(this.page)
done(); done();
this.$notify({ this.$notify({
title: '成功', title: '成功',
...@@ -244,7 +232,7 @@ export default { ...@@ -244,7 +232,7 @@ export default {
}, },
update (row, index, done, loading) { update (row, index, done, loading) {
putObj(this.form).then(() => { putObj(this.form).then(() => {
this.getList() this.getList(this.page)
done(); done();
this.$notify({ this.$notify({
title: '成功', title: '成功',
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange"
@search-change="searchChange" @search-change="searchChange"
@row-update="handleUpdate" @row-update="handleUpdate"
@row-save="handleSave" @row-save="handleSave"
...@@ -71,41 +70,28 @@ export default { ...@@ -71,41 +70,28 @@ export default {
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
type: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created () {
this.getList()
}, },
mounted: function () { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.tableLoading = true this.tableLoading = true
fetchList(this.listQuery).then(response => { fetchList(Object.assign({
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange (val) {
this.page.currentPage = val
this.listQuery.page = val
this.getList()
},
sizeChange (val) {
this.page.pageSize = val
this.listQuery.limit = val
this.getList()
},
/** /**
* @title 打开新增窗口 * @title 打开新增窗口
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
...@@ -179,14 +165,13 @@ export default { ...@@ -179,14 +165,13 @@ export default {
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange () {
this.getList() this.getList(this.page)
}, },
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange (form) { searchChange (form) {
this.listQuery.type = form.type this.getList(this.page,form)
this.getList()
} }
} }
} }
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange"
@row-del="rowDel"> @row-del="rowDel">
<template slot-scope="scope" <template slot-scope="scope"
slot="menu"> slot="menu">
...@@ -60,32 +59,23 @@ export default { ...@@ -60,32 +59,23 @@ export default {
} }
}, },
created() { created() {
this.getList()
}, },
mounted: function() { }, mounted: function() { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList() { getList(page,params) {
this.tableLoading = true this.tableLoading = true
fetchList({ fetchList(Object.assign({
page: this.page.currentPage, page: page.currentPage,
limit: this.page.pageSize limit: page.pageSize
}).then(response => { }, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange(val) {
this.page.currentPage = val
this.getList()
},
sizeChange(val) {
this.page.pageSize = val
this.getList()
},
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
...@@ -113,7 +103,7 @@ export default { ...@@ -113,7 +103,7 @@ export default {
* 刷新回调 * 刷新回调
*/ */
refreshChange() { refreshChange() {
this.getList() this.getList(this.page)
} }
} }
} }
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@current-change="currentChange" @on-load="getList"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange"
@search-change="searchChange" @search-change="searchChange"
@row-update="handleUpdate" @row-update="handleUpdate"
@row-save="handleSave" @row-save="handleSave"
...@@ -58,42 +57,28 @@ export default { ...@@ -58,42 +57,28 @@ export default {
currentPage: 1, // 当前页数 currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条 pageSize: 20 // 每页显示多少条
}, },
listQuery: {
page: 1,
limit: 20,
job_name: undefined,
state: undefined
},
tableLoading: false, tableLoading: false,
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created () {
this.getList()
}, },
mounted: function () { }, mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList () { getList (page,params) {
this.tableLoading = true this.tableLoading = true
fetchList(this.listQuery).then(response => { fetchList(Object.assign({
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records this.tableData = response.data.records
this.page.total = response.data.total this.page.total = response.data.total
this.tableLoading = false this.tableLoading = false
}) })
}, },
currentChange (val) {
this.page.currentPage = val
this.listQuery.page = val
this.getList()
},
sizeChange (val) {
this.page.pageSize = val
this.listQuery.limit = val
this.getList()
},
/** /**
* @title 打开新增窗口 * @title 打开新增窗口
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
...@@ -164,15 +149,13 @@ export default { ...@@ -164,15 +149,13 @@ export default {
}) })
}, },
searchChange (form) { searchChange (form) {
this.listQuery.job_name = form.job_name this.getList(this.page,form)
this.listQuery.state = form.state
this.getList()
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange () {
this.getList() this.getList(this.page)
} }
} }
} }
......
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