mirror of https://github.com/shunfei/cronsun
任务页面路由支持 node 参数
parent
e6046a3292
commit
b4eb5fb2e5
|
@ -12,11 +12,11 @@
|
||||||
<div class="two fields">
|
<div class="two fields">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>任务分组</label>
|
<label>任务分组</label>
|
||||||
<Dropdown title="选择分组" v-bind:items="groups" v-on:change="changeGroup" selected="group"/>
|
<Dropdown title="选择分组" v-bind:items="groups" v-on:change="changeGroup" :selected="group"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>节点过滤</label>
|
<label>节点过滤</label>
|
||||||
<Dropdown title="选择节点" v-bind:items="nodes" v-on:change="changeNode" selected="node"/>
|
<Dropdown title="选择节点" v-bind:items="nodes" v-on:change="changeNode" :selected="node"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -85,8 +85,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted: function(){
|
mounted: function(){
|
||||||
|
this.fillParams();
|
||||||
var vm = this;
|
var vm = this;
|
||||||
this.group = this.$route.query.group || '';
|
|
||||||
|
|
||||||
this.$rest.GET('job/groups').onsucceed(200, (resp)=>{
|
this.$rest.GET('job/groups').onsucceed(200, (resp)=>{
|
||||||
!resp.includes('default') && resp.unshift('default');
|
!resp.includes('default') && resp.unshift('default');
|
||||||
|
@ -105,12 +105,17 @@ export default {
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'$route': function(){
|
'$route': function(){
|
||||||
this.group = this.$route.query.group || '';
|
this.fillParams();
|
||||||
this.fetchList(this.buildQuery());
|
this.fetchList(this.buildQuery());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
fillParams: function(){
|
||||||
|
this.group = this.$route.query.group || '';
|
||||||
|
this.node = this.$route.query.node || '';
|
||||||
|
},
|
||||||
|
|
||||||
changeGroup: function(val, text){
|
changeGroup: function(val, text){
|
||||||
var vm = this;
|
var vm = this;
|
||||||
this.group = val;
|
this.group = val;
|
||||||
|
|
|
@ -95,14 +95,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted: function(to, from, next){
|
mounted: function(to, from, next){
|
||||||
this.names = this.$route.query.names || '';
|
this.fillParams();
|
||||||
this.ids = this.$route.query.ids || '';
|
|
||||||
this.nodes = this.$route.query.nodes || '';
|
|
||||||
this.begin = this.$route.query.begin || '';
|
|
||||||
this.end = this.$route.query.end || '';
|
|
||||||
this.page = this.$route.query.page || 1;
|
|
||||||
this.latest = this.$route.query.latest ? true : false;
|
|
||||||
this.failedOnly = this.$route.query.failedOnly ? true : false;
|
|
||||||
this.fetchList(this.buildQuery());
|
this.fetchList(this.buildQuery());
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
@ -112,6 +105,13 @@ export default {
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'$route': function(){
|
'$route': function(){
|
||||||
|
this.fillParams();
|
||||||
|
this.fetchList(this.buildQuery());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
fillParams(){
|
||||||
this.names = this.$route.query.names || '';
|
this.names = this.$route.query.names || '';
|
||||||
this.ids = this.$route.query.ids || '';
|
this.ids = this.$route.query.ids || '';
|
||||||
this.nodes = this.$route.query.nodes || '';
|
this.nodes = this.$route.query.nodes || '';
|
||||||
|
@ -120,11 +120,8 @@ export default {
|
||||||
this.page = this.$route.query.page || 1;
|
this.page = this.$route.query.page || 1;
|
||||||
this.latest = this.$route.query.latest == 'true' ? true : false;
|
this.latest = this.$route.query.latest == 'true' ? true : false;
|
||||||
this.failedOnly = this.$route.query.failedOnly ? true : false;
|
this.failedOnly = this.$route.query.failedOnly ? true : false;
|
||||||
this.fetchList(this.buildQuery());
|
},
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
fetchList(query){
|
fetchList(query){
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
Loading…
Reference in New Issue