|
@@ -8,7 +8,8 @@
|
|
<div class="tabBody">
|
|
<div class="tabBody">
|
|
<a-tabs v-model="tabKey" @change="tabChange">
|
|
<a-tabs v-model="tabKey" @change="tabChange">
|
|
<a-tab-pane key="1" tab="模板列表"></a-tab-pane>
|
|
<a-tab-pane key="1" tab="模板列表"></a-tab-pane>
|
|
- <a-tab-pane key="2" tab="我的模板"></a-tab-pane>
|
|
|
|
|
|
+ <a-tab-pane key="2" tab="我的模板"> </a-tab-pane>
|
|
|
|
+ <a-button slot="tabBarExtraContent" type="link"> 预警历史 </a-button>
|
|
</a-tabs>
|
|
</a-tabs>
|
|
</div>
|
|
</div>
|
|
<div class="tableBody">
|
|
<div class="tableBody">
|
|
@@ -25,6 +26,29 @@
|
|
@search="onSearch"
|
|
@search="onSearch"
|
|
/>
|
|
/>
|
|
</div> -->
|
|
</div> -->
|
|
|
|
+ <div class="table-page-search-wrapper" v-if="tabKey == '2'">
|
|
|
|
+ <a-form layout="inline">
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
|
+ <a-form-item label="账户名称">
|
|
|
|
+ <Treeselect :appId.sync="projectId" :multiple="false" ref="treeSelect" style="width: 100%" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
|
+ <a-form-item label="绑定人">
|
|
|
|
+ <a-input placeholder="请输入绑定的运营" v-model="userName"></a-input>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+
|
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
|
+ <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
|
|
|
+ <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
|
|
|
+ <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
|
+ </span>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </div>
|
|
<div class="table">
|
|
<div class="table">
|
|
<a-table
|
|
<a-table
|
|
size="middle"
|
|
size="middle"
|
|
@@ -49,9 +73,9 @@
|
|
{{ text | handleMediaType }}
|
|
{{ text | handleMediaType }}
|
|
</span>
|
|
</span>
|
|
<span slot="accountStatus" slot-scope="text">
|
|
<span slot="accountStatus" slot-scope="text">
|
|
- <span class="bohui" v-if="text==1"></span>
|
|
|
|
- <span class="shenhe" v-if="text==0"></span>
|
|
|
|
- {{text?'暂停':'投放中'}}
|
|
|
|
|
|
+ <span class="bohui" v-if="text == 1"></span>
|
|
|
|
+ <span class="shenhe" v-if="text == 0"></span>
|
|
|
|
+ {{ text ? '暂停' : '投放中' }}
|
|
</span>
|
|
</span>
|
|
<span slot="processMethod" slot-scope="text">
|
|
<span slot="processMethod" slot-scope="text">
|
|
{{ text == 'SEND' ? '仅发送通知' : '发送并关停组' }}
|
|
{{ text == 'SEND' ? '仅发送通知' : '发送并关停组' }}
|
|
@@ -72,7 +96,14 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- pushRuleVisible -->
|
|
<!-- pushRuleVisible -->
|
|
- <a-modal v-model="pushRuleVisible" title="推送账户选择" @ok="handleOk" @cancel='cancelPush' :confirmLoading="confirmLoading" width="60%">
|
|
|
|
|
|
+ <a-modal
|
|
|
|
+ v-model="pushRuleVisible"
|
|
|
|
+ title="推送账户选择"
|
|
|
|
+ @ok="handleOk"
|
|
|
|
+ @cancel="cancelPush"
|
|
|
|
+ :confirmLoading="confirmLoading"
|
|
|
|
+ width="60%"
|
|
|
|
+ >
|
|
<a-form layout="inline" class="rule-tree-select">
|
|
<a-form layout="inline" class="rule-tree-select">
|
|
<a-form-item
|
|
<a-form-item
|
|
label="请选择账户"
|
|
label="请选择账户"
|
|
@@ -89,7 +120,7 @@
|
|
<script>
|
|
<script>
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import Treeselect from './pushTreeSelect.vue'
|
|
import Treeselect from './pushTreeSelect.vue'
|
|
-import { getAction, postAction, downFile, downFilePost, deleteAction , putAction } from '@/api/manage'
|
|
|
|
|
|
+import { getAction, postAction, downFile, downFilePost, deleteAction, putAction } from '@/api/manage'
|
|
let existColumns = [
|
|
let existColumns = [
|
|
// {
|
|
// {
|
|
// title: '运行/暂停',
|
|
// title: '运行/暂停',
|
|
@@ -134,14 +165,13 @@ let existColumns = [
|
|
]
|
|
]
|
|
|
|
|
|
let recordsColumns = [
|
|
let recordsColumns = [
|
|
-
|
|
|
|
- {
|
|
|
|
- title: '运行/暂停',
|
|
|
|
- dataIndex: 'status',
|
|
|
|
- align: 'center',
|
|
|
|
- width:100,
|
|
|
|
- key: 'status',
|
|
|
|
- scopedSlots: { customRender: 'status' }
|
|
|
|
|
|
+ {
|
|
|
|
+ title: '运行/暂停',
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 100,
|
|
|
|
+ key: 'status',
|
|
|
|
+ scopedSlots: { customRender: 'status' },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '模板名称',
|
|
title: '模板名称',
|
|
@@ -201,6 +231,8 @@ export default {
|
|
name: 'useRuleList',
|
|
name: 'useRuleList',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ projectId: '',
|
|
|
|
+ userName: '',
|
|
relationCount: 2,
|
|
relationCount: 2,
|
|
pushRuleVisible: false,
|
|
pushRuleVisible: false,
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
@@ -251,12 +283,40 @@ export default {
|
|
Treeselect,
|
|
Treeselect,
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ searchQuery() {
|
|
|
|
+ this.ipagination.current = 1
|
|
|
|
+ let url = ''
|
|
|
|
+ if (this.tabKey == '1') {
|
|
|
|
+ this.columns = [...existColumns]
|
|
|
|
+ url = '/ruleTemplate/list'
|
|
|
|
+ } else {
|
|
|
|
+ this.columns = [...recordsColumns]
|
|
|
|
+ url = '/ruleAccountTemplate/getTemplateApplied'
|
|
|
|
+ }
|
|
|
|
+ this.getTableListHttp(url)
|
|
|
|
+ },
|
|
|
|
+ searchReset() {
|
|
|
|
+ this.ipagination.current = 1
|
|
|
|
+ this.projectId = ''
|
|
|
|
+ this.userName = ''
|
|
|
|
+ let url = ''
|
|
|
|
+ if (this.tabKey == '1') {
|
|
|
|
+ this.columns = [...existColumns]
|
|
|
|
+ url = '/ruleTemplate/list'
|
|
|
|
+ } else {
|
|
|
|
+ this.columns = [...recordsColumns]
|
|
|
|
+ url = '/ruleAccountTemplate/getTemplateApplied'
|
|
|
|
+ }
|
|
|
|
+ this.getTableListHttp(url)
|
|
|
|
+ },
|
|
moment,
|
|
moment,
|
|
onSearch(value) {
|
|
onSearch(value) {
|
|
console.log(value)
|
|
console.log(value)
|
|
},
|
|
},
|
|
tabChange(key) {
|
|
tabChange(key) {
|
|
console.log(key)
|
|
console.log(key)
|
|
|
|
+ this.projectId = ''
|
|
|
|
+ this.userName = ''
|
|
this.ipagination.current = 1
|
|
this.ipagination.current = 1
|
|
let url = ''
|
|
let url = ''
|
|
if (key == '1') {
|
|
if (key == '1') {
|
|
@@ -298,8 +358,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
handleOk() {
|
|
handleOk() {
|
|
-
|
|
|
|
- if(this.accountId){
|
|
|
|
|
|
+ if (this.accountId) {
|
|
this.confirmLoading = true
|
|
this.confirmLoading = true
|
|
getAction('/ruleAccountTemplate/checkAccountTemplate', { accountId: this.accountId }).then((res) => {
|
|
getAction('/ruleAccountTemplate/checkAccountTemplate', { accountId: this.accountId }).then((res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
@@ -309,16 +368,15 @@ export default {
|
|
templateId: this.templateId,
|
|
templateId: this.templateId,
|
|
accountId: this.accountId,
|
|
accountId: this.accountId,
|
|
}).then((r) => {
|
|
}).then((r) => {
|
|
- if(r.success){
|
|
|
|
|
|
+ if (r.success) {
|
|
var data = { id: this.templateId, edit: true, accountId: this.accountId }
|
|
var data = { id: this.templateId, edit: true, accountId: this.accountId }
|
|
localStorage.setItem('getRuleDetail', JSON.stringify(data))
|
|
localStorage.setItem('getRuleDetail', JSON.stringify(data))
|
|
this.$router.push('/earlyWarningRules/ruleModule')
|
|
this.$router.push('/earlyWarningRules/ruleModule')
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
- this.accountId=undefined
|
|
|
|
- }else{
|
|
|
|
|
|
+ this.accountId = undefined
|
|
|
|
+ } else {
|
|
this.$message.error(r.message)
|
|
this.$message.error(r.message)
|
|
}
|
|
}
|
|
-
|
|
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
// this.accountId = ''
|
|
// this.accountId = ''
|
|
@@ -331,15 +389,12 @@ export default {
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.$message.error('请选择需要推送的账户')
|
|
this.$message.error('请选择需要推送的账户')
|
|
}
|
|
}
|
|
-
|
|
|
|
},
|
|
},
|
|
- cancelPush(){
|
|
|
|
-
|
|
|
|
- this.accountId=''
|
|
|
|
-
|
|
|
|
|
|
+ cancelPush() {
|
|
|
|
+ this.accountId = ''
|
|
},
|
|
},
|
|
// recordsRule(record){
|
|
// recordsRule(record){
|
|
// console.log(record);
|
|
// console.log(record);
|
|
@@ -388,7 +443,7 @@ export default {
|
|
},
|
|
},
|
|
switchChange(text, record) {
|
|
switchChange(text, record) {
|
|
console.log(text, record)
|
|
console.log(text, record)
|
|
- if(record.accountStatus==0 || record.accountStatus==1&&text){
|
|
|
|
|
|
+ if (record.accountStatus == 0 || (record.accountStatus == 1 && text)) {
|
|
record.spin = true
|
|
record.spin = true
|
|
let templateStatus = 0
|
|
let templateStatus = 0
|
|
if (text) {
|
|
if (text) {
|
|
@@ -419,19 +474,24 @@ export default {
|
|
// this.getTableListHttp()
|
|
// this.getTableListHttp()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
- this.$message.error('当前账户已关停,预警规则不支持开启!')
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('当前账户已关停,预警规则不支持开启!')
|
|
}
|
|
}
|
|
-
|
|
|
|
},
|
|
},
|
|
|
|
|
|
getTableListHttp(url) {
|
|
getTableListHttp(url) {
|
|
this.data = []
|
|
this.data = []
|
|
this.loading = true
|
|
this.loading = true
|
|
// let url='/alarm/alarmEventRule/list'
|
|
// let url='/alarm/alarmEventRule/list'
|
|
|
|
+ var params = {}
|
|
|
|
+ if (this.tabKey == '2') {
|
|
|
|
+ params.accountId = this.projectId
|
|
|
|
+ params.userName = this.userName
|
|
|
|
+ }
|
|
getAction(url, {
|
|
getAction(url, {
|
|
pageNo: this.ipagination.current,
|
|
pageNo: this.ipagination.current,
|
|
pageSize: this.ipagination.pageSize,
|
|
pageSize: this.ipagination.pageSize,
|
|
|
|
+ ...params,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -519,7 +579,7 @@ export default {
|
|
margin-bottom: 15px;
|
|
margin-bottom: 15px;
|
|
}
|
|
}
|
|
|
|
|
|
- .shenhe{
|
|
|
|
|
|
+ .shenhe {
|
|
width: 6px;
|
|
width: 6px;
|
|
height: 6px;
|
|
height: 6px;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
@@ -528,7 +588,7 @@ export default {
|
|
position: relative;
|
|
position: relative;
|
|
top: -2px;
|
|
top: -2px;
|
|
}
|
|
}
|
|
- .bohui{
|
|
|
|
|
|
+ .bohui {
|
|
width: 6px;
|
|
width: 6px;
|
|
height: 6px;
|
|
height: 6px;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
@@ -538,6 +598,5 @@ export default {
|
|
top: -2px;
|
|
top: -2px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|