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,14 +41,24 @@ export const tableOption = { ...@@ -41,14 +41,24 @@ export const tableOption = {
}, },
{ {
label: '天数', label: '天数',
prop: 'days' prop: 'days',
type: 'number'
}, },
{ {
label: '请假时间', label: '请假时间',
prop: 'createTime', prop: 'leaveTime',
type: 'datetime', type: 'datetime',
format: 'yyyy-MM-dd HH:mm' format: 'yyyy-MM-dd HH:mm',
}, valueFormat: "yyyy-MM-dd hh:mm:ss"
},
{
label: '提交时间',
prop: 'createTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
editDisabled: true,
addVisdiplay: false
},
{ {
label: '备注', label: '备注',
prop: 'content', prop: 'content',
......
...@@ -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,63 +18,66 @@ ...@@ -18,63 +18,66 @@
<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 () {
return {
json: null
}
},
// 注入vueJsonEditor组件
components: {
vueJsonEditor
},
created () { export default {
this.getList() data() {
}, return {
json: null
}
},
methods: { // 注入vueJsonEditor组件
getList () { components: {
fetchList().then(response => { vueJsonEditor
this.json = response.data
console.log(this.json)
})
}, },
fallback (){ created() {
fallback(this.json).then(response => { this.getList()
this.$notify({
title: '成功',
message: '回滚成功',
type: 'success',
duration: 2000
})
})
}, },
edit (){ methods: {
putObj(this.json).then(response => { getList() {
this.$notify({ fetchList().then(response => {
title: '成功', let result = response.data.data;
message: '更新成功', for (var i = 0; i < result.length; i++) {
type: 'success', let route = result[i]
duration: 2000 if(route.predicates){
let predicates = route.predicates
route.predicates = JSON.parse(predicates)
}
if(route.filters){
let filters = route.filters
route.filters = JSON.parse(filters)
}
}
this.json = result
}) })
}) },
},
edit() {
putObj(this.json).then(response => {
this.$notify({
title: '成功',
message: '更新成功',
type: 'success',
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