策略
This commit is contained in:
@ -1,28 +1,31 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-button type="primary" plain @click="settingStrategy" style="margin-bottom: 20px;">新增策略</el-button>
|
||||
<cl-container v-for="(item,index) in list" :key="index+'clContainer'" :info="item" class="contain" @update="init" @showSetting="settingStrategy(item)">
|
||||
<template v-slot:default>
|
||||
<div class="cl-items cl-items-main" @click="toDetail(item.mainStrategyId)">
|
||||
<div class="cl-header">主策略</div>
|
||||
<div class="cl-content" >
|
||||
<div class="cl-name">{{item.mainStrategyName}}</div>
|
||||
<template v-if="!showTemp">
|
||||
<el-button v-if="!showTemp" type="primary" plain @click="settingStrategy" style="margin-bottom: 20px;">新增策略</el-button>
|
||||
<cl-container v-for="(item,index) in list" :key="index+'clContainer'" :info="item" :hide-setting-btn="showTemp" class="contain" @update="init" @showSetting="settingStrategy(item)">
|
||||
<template v-slot:default>
|
||||
<div class="cl-items cl-items-main" @click="toDetail(item.mainStrategyId,item.mainStrategyName)">
|
||||
<div class="cl-header">主策略</div>
|
||||
<div class="cl-content" >
|
||||
<div class="cl-name">{{item.mainStrategyName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl-items" v-show="item.auxStrategyName" @click="toDetail(item.auxStrategyId)">
|
||||
<div class="cl-header">辅助策略</div>
|
||||
<div class="cl-content">
|
||||
<div class="cl-name">{{item.auxStrategyName}}</div>
|
||||
<div class="cl-items" v-show="item.auxStrategyName" @click="toDetail(item.auxStrategyId,item.auxStrategyName)">
|
||||
<div class="cl-header">辅助策略</div>
|
||||
<div class="cl-content">
|
||||
<div class="cl-name">{{item.auxStrategyName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</cl-container>
|
||||
<div v-if="list.length === 0">
|
||||
<el-empty :image-size="200" ></el-empty>
|
||||
</div>
|
||||
<setting ref="setting"/>
|
||||
</div>
|
||||
</template>
|
||||
</cl-container>
|
||||
<div v-if="list.length === 0">
|
||||
<el-empty :image-size="200" ></el-empty>
|
||||
</div>
|
||||
</template>
|
||||
<xftg ref="xftgTemp" v-else/>
|
||||
<setting ref="setting"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -30,13 +33,17 @@
|
||||
import Setting from './../Setting.vue'
|
||||
import ClContainer from './../ClContainer.vue'
|
||||
import getQuerySiteId from '@/mixins/ems/getQuerySiteId'
|
||||
import Xftg from './../xftg/index.vue'
|
||||
import {strategyRunningList} from '@/api/ems/dzjk'
|
||||
export default {
|
||||
name:'DzjkClpzClyx',
|
||||
components:{ClContainer,Setting},
|
||||
components:{ClContainer,Setting,Xftg},
|
||||
mixins: [getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
showTemp:false,
|
||||
updateStrategyId:'',
|
||||
updateStrategyName:'',
|
||||
loading:false,
|
||||
list:[],
|
||||
}
|
||||
@ -54,14 +61,20 @@ export default {
|
||||
strategyRunningList(this.siteId).then(response => {
|
||||
this.list =JSON.parse(JSON.stringify(response?.data || {}))
|
||||
}).finally(() => {this.loading=false})
|
||||
this.$nextTick(() => {
|
||||
// 每次切换站点 展示策略运行 清空策略配置的数据
|
||||
this.$refs['xftgTemp'] && this.$refs['xftgTemp'].changeSiteId()
|
||||
this.showTemp=false
|
||||
this.updateStrategyId=''
|
||||
this.updateStrategyName=''
|
||||
})
|
||||
},
|
||||
toDetail(id){
|
||||
id && this.$router.push({
|
||||
path:'/dzjk/clpz/xftg',
|
||||
query:{
|
||||
...this.$route.query,
|
||||
id
|
||||
}
|
||||
toDetail(id,name){
|
||||
this.updateStrategyId=id
|
||||
this.updateStrategyName = name
|
||||
this.showTemp = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['xftgTemp'].init()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user