Commit bc2ac026 authored by 冷冷's avatar 冷冷

🐛 Fixing a bug.工作流 几个bug 修改

parent e664230b
...@@ -19,22 +19,15 @@ import request from '@/router/axios' ...@@ -19,22 +19,15 @@ import request from '@/router/axios'
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/route', url: '/admin/route',
method: 'get', method: 'get',
params: query params: query
}) })
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/route', url: '/admin/route',
method: 'put', method: 'put',
data: obj data: obj
}) })
} }
export function fallback(obj) {
return request({
url: '/route/fallback',
method: 'get',
data: obj
})
}
...@@ -41,13 +41,23 @@ export const tableOption = { ...@@ -41,13 +41,23 @@ export const tableOption = {
}, },
{ {
label: '天数', label: '天数',
prop: 'days' prop: 'days',
type: 'number'
}, },
{ {
label: '请假时间', label: '请假时间',
prop: 'leaveTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: "yyyy-MM-dd hh:mm:ss"
},
{
label: '提交时间',
prop: 'createTime', prop: 'createTime',
type: 'datetime', type: 'datetime',
format: 'yyyy-MM-dd HH:mm' format: 'yyyy-MM-dd HH:mm',
editDisabled: true,
addVisdiplay: false
}, },
{ {
label: '备注', label: '备注',
......
...@@ -125,7 +125,7 @@ export const taskOption = { ...@@ -125,7 +125,7 @@ export const taskOption = {
}, },
{ {
label:'用户', label:'用户',
prop:'username' prop:'userId'
}, },
{ {
label:'批注', label:'批注',
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
:data="tableData" :data="tableData"
:table-loading="tableLoading" :table-loading="tableLoading"
:option="tableOption" :option="tableOption"
@search-change="searchChange"
@current-change="currentChange" @current-change="currentChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@size-change="sizeChange" @size-change="sizeChange"
...@@ -192,6 +193,13 @@ ...@@ -192,6 +193,13 @@
this.getList() this.getList()
}) })
}, },
/**
* 搜索回调
*/
searchChange(form) {
this.listQuery.state = form.state
this.getList()
},
/** /**
* 刷新回调 * 刷新回调
*/ */
......
...@@ -18,19 +18,23 @@ ...@@ -18,19 +18,23 @@
<template> <template>
<div class="app-container pull-auto"> <div class="app-container pull-auto">
<basic-container> <basic-container>
<el-alert
title="路由配置是非常专业的事情,不建议非工程师操作"
type="warning">
</el-alert>
<vue-json-editor v-model="json" :show-btns="false"></vue-json-editor> <vue-json-editor v-model="json" :show-btns="false"></vue-json-editor>
<div align="center"> <div align="center">
<el-button @click="edit()">更新</el-button> <el-button @click="edit()">更新</el-button>
<el-button type="warning" @click="fallback()">回滚</el-button>
</div> </div>
</basic-container> </basic-container>
</div> </div>
</template> </template>
<script> <script>
import vueJsonEditor from 'vue-json-editor' import vueJsonEditor from 'vue-json-editor'
import {fetchList, putObj,fallback} from '@/api/route' import {fetchList, putObj, fallback} from '@/api/route'
export default {
data () { export default {
data() {
return { return {
json: null json: null
} }
...@@ -41,30 +45,30 @@ export default { ...@@ -41,30 +45,30 @@ export default {
vueJsonEditor vueJsonEditor
}, },
created () { created() {
this.getList() this.getList()
}, },
methods: { methods: {
getList () { getList() {
fetchList().then(response => { fetchList().then(response => {
this.json = response.data let result = response.data.data;
console.log(this.json) for (var i = 0; i < result.length; i++) {
}) let route = result[i]
}, if(route.predicates){
let predicates = route.predicates
fallback (){ route.predicates = JSON.parse(predicates)
fallback(this.json).then(response => { }
this.$notify({ if(route.filters){
title: '成功', let filters = route.filters
message: '回滚成功', route.filters = JSON.parse(filters)
type: 'success', }
duration: 2000 }
}) this.json = result
}) })
}, },
edit (){ edit() {
putObj(this.json).then(response => { putObj(this.json).then(response => {
this.$notify({ this.$notify({
title: '成功', title: '成功',
...@@ -73,8 +77,7 @@ export default { ...@@ -73,8 +77,7 @@ export default {
duration: 2000 duration: 2000
}) })
}) })
},
} }
} }
}
</script> </script>
...@@ -36,13 +36,6 @@ module.exports = { ...@@ -36,13 +36,6 @@ module.exports = {
'^/code': '/code' '^/code': '/code'
} }
}, },
'/route': {
target: url,
ws: true,
pathRewrite: {
'^/route': '/route'
}
},
'/gen': { '/gen': {
target: url, target: url,
ws: true, ws: true,
......
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