|
@@ -1,27 +1,34 @@
|
|
|
<template>
|
|
|
- <a-card :bordered="false">
|
|
|
+ <a-card :bordered="false" title="预警管理">
|
|
|
<!-- 查询区域 -->
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-form layout="inline">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="产品名称">
|
|
|
- <a-input placeholder="请输入产品名称" v-model="productName"></a-input>
|
|
|
+ <a-form-item label="媒体">
|
|
|
+ <a-radio-group v-model="mediaType">
|
|
|
+ <a-radio-button value=""> 全部 </a-radio-button>
|
|
|
+ <a-radio-button value="快手"> 快手 </a-radio-button>
|
|
|
+ <a-radio-button value="头条"> 头条 </a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="广告主名称">
|
|
|
- <a-input placeholder="请输入广告主名称" v-model="advertiserName"></a-input>
|
|
|
+ <a-form-item label="运营名称">
|
|
|
+ <a-input placeholder="请输入运营名称" v-model="userId"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <template>
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-item label="账户ID">
|
|
|
+ <Treeselect :appId.sync="accountId" :multiple="false" ref="treeSelect" style="width: 100%" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
<a-col :md="6" :sm="8">
|
|
|
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
|
+ <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>
|
|
|
- <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
|
|
|
- {{ toggleSearchStatus ? '收起' : '展开' }}
|
|
|
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
|
|
- </a> -->
|
|
|
</span>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -29,315 +36,215 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 操作按钮区域 -->
|
|
|
- <div class="table-operator">
|
|
|
+ <!-- <div class="table-operator">
|
|
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
|
|
- </div>
|
|
|
+ </div>-->
|
|
|
|
|
|
<!-- table区域-begin -->
|
|
|
<!-- 供应商 -->
|
|
|
<div>
|
|
|
-
|
|
|
- <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
|
|
|
- :pagination="ipagination" :loading="loading" @change="handleTableChange"
|
|
|
- style="word-break: break-all;font-size:16px;font-weight:600">
|
|
|
- <span slot="mediaId"
|
|
|
- slot-scope="mediaId">{{ mediaId == 1 ? '头条' :mediaId == 2? '快手':mediaId == 3?'头条内广':'快手内广' }}</span>
|
|
|
- <span slot="projectList" slot-scope="text">
|
|
|
- <span v-for="(item,index) in text"
|
|
|
- :key="index">{{index+1}}.{{item.projectName}}{{index==(text.length-1)?'':';'}}</span>
|
|
|
- </span>
|
|
|
- <span slot="yunyingList" slot-scope="text">
|
|
|
- <span v-for="(item,index) in text" :key="index">{{item.realname}}{{index==(text.length-1)?'':','}}</span>
|
|
|
- </span>
|
|
|
- <span slot="saleList" slot-scope="text">
|
|
|
- <span v-for="(item,index) in text" :key="index">{{item.saleName}}{{index==(text.length-1)?'':','}}</span>
|
|
|
- </span>
|
|
|
- <span slot="action" slot-scope="text, record">
|
|
|
- <a @click="handleAddList(record)">绑定项目</a>
|
|
|
-
|
|
|
- <a-divider type="vertical" />
|
|
|
-
|
|
|
- <a @click="handleEdit(record)">编辑</a>
|
|
|
-
|
|
|
- <a-divider type="vertical" />
|
|
|
-
|
|
|
- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
|
|
- <a>删除</a>
|
|
|
- </a-popconfirm>
|
|
|
- </span>
|
|
|
+ <a-table
|
|
|
+ ref="table"
|
|
|
+ size="middle"
|
|
|
+ bordered
|
|
|
+ rowKey="id"
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="dataSource"
|
|
|
+ :pagination="ipagination"
|
|
|
+ :loading="loading"
|
|
|
+ style="word-break: break-all"
|
|
|
+ >
|
|
|
+ <span slot="userId" slot-scope="text">{{ text.split('_')[0] }}</span>
|
|
|
+ <span slot="createTime" slot-scope="text">{{ text.split(' ')[0] }}</span>
|
|
|
+ <div slot="alarmDetail" slot-scope="text" style="text-align: left; width: 100%; padding: 0 10px">
|
|
|
+ {{ text }}
|
|
|
+ </div>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
- <a-modal title="项目展示" :width="800" :visible="visible" :footer="null" @cancel="handleCancel" destroyOnClose
|
|
|
- cancelText="关闭">
|
|
|
- <a-button @click="handleProjectAdd" type="primary" icon="plus" style="margin:20px 0">新增</a-button>
|
|
|
- <a-list bordered :data-source="dataList">
|
|
|
- <a-list-item slot="renderItem" slot-scope="item, index">
|
|
|
- {{ item.projectName }}
|
|
|
- <div slot="actions">
|
|
|
- <a @click="removeTitleCun(item,index)">删除</a>
|
|
|
- </div>
|
|
|
- </a-list-item>
|
|
|
-
|
|
|
- <!-- <div slot="header">
|
|
|
- Header
|
|
|
- </div>
|
|
|
- <div slot="footer">
|
|
|
- Footer
|
|
|
- </div> -->
|
|
|
- </a-list>
|
|
|
- </a-modal>
|
|
|
- <a-modal title="新增项目" :width="800" :visible="visibleAdd" :confirmLoading="confirmLoading" @ok="handleOk"
|
|
|
- destroyOnClose cancelText="关闭" @cancel="handleCancelAdd">
|
|
|
- <a-select optionFilterProp="children" showSearch :filterOption="filterOption" mode="multiple" v-model="projectIds"
|
|
|
- style="width:100%">
|
|
|
- <a-select-option :value="item.id" v-for="(item, index) of supplierList" :key="index">{{
|
|
|
- item.projectName
|
|
|
- }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-modal>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
|
|
- import {
|
|
|
- httpAction,
|
|
|
- getAction,
|
|
|
- postAction,
|
|
|
- deleteAction
|
|
|
- } from '@/api/manage'
|
|
|
- import {
|
|
|
- JeecgListMixin
|
|
|
- } from '@/mixins/ipagination'
|
|
|
-
|
|
|
- export default {
|
|
|
- name: 'ProjectList',
|
|
|
- mixins: [JeecgListMixin],
|
|
|
- components: {
|
|
|
- JTreeSelect
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- description: '产品管理页面',
|
|
|
- loading: false,
|
|
|
- visible: false,
|
|
|
- visibleAdd: false,
|
|
|
- dataList: [],
|
|
|
- productIdDelete: null,
|
|
|
- confirmLoading: false,
|
|
|
- projectIds: [],
|
|
|
- supplierList: [],
|
|
|
- advertiserId: null,
|
|
|
- // 表头
|
|
|
- columns: [
|
|
|
-
|
|
|
- {
|
|
|
- title: '媒体',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'mediaId',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'mediaId'
|
|
|
- },
|
|
|
- width: 100
|
|
|
- }, {
|
|
|
- title: '产品名称',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'productName',
|
|
|
- width: 200
|
|
|
- },
|
|
|
- {
|
|
|
- title: '广告主名称',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'advertiserName',
|
|
|
- width: 200
|
|
|
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
|
|
+import { httpAction, getAction } from '@/api/manage'
|
|
|
+import Treeselect from './pushTreeSelect.vue'
|
|
|
+export default {
|
|
|
+ name: 'ProjectList',
|
|
|
+ components: {
|
|
|
+ JTreeSelect,
|
|
|
+ Treeselect,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dataSource: [],
|
|
|
+ mediaType: '',
|
|
|
+ userId: '',
|
|
|
+ accountId: '',
|
|
|
+ description: '项目管理页面',
|
|
|
+ // 表头
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '媒体',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'mediaType',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '账户ID',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'accountId',
|
|
|
+ width: 200,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '运营',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'userId',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'userId',
|
|
|
},
|
|
|
- {
|
|
|
- title: '项目名称',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'projectList',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'projectList'
|
|
|
- },
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预警字段',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'groupName',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'groupName',
|
|
|
},
|
|
|
- {
|
|
|
- title: '运营',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'yunyingList',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'yunyingList'
|
|
|
- },
|
|
|
- width: 120,
|
|
|
-
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预警时间',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'createTime',
|
|
|
},
|
|
|
- {
|
|
|
- title: '销售',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'saleList',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'saleList'
|
|
|
- },
|
|
|
- width: 120
|
|
|
+ width: 200,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预警信息',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'alarmDetail',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'alarmDetail',
|
|
|
},
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'action'
|
|
|
- },
|
|
|
- width: 300
|
|
|
- }
|
|
|
- ],
|
|
|
- dataSource: [],
|
|
|
- url: {
|
|
|
- list: '/ctop/product/getProductList',
|
|
|
- delete: '/ctop/product/deleteProduct',
|
|
|
- deleteBatch: '/ctop/project/deleteBatch',
|
|
|
- exportXlsUrl: 'ctop/project/exportXls',
|
|
|
- importExcelUrl: 'ctop/project/importExcel'
|
|
|
},
|
|
|
- options: [],
|
|
|
- advertiserName: null,
|
|
|
- productName: null,
|
|
|
- }
|
|
|
+ ],
|
|
|
+ list: [],
|
|
|
+ options: [],
|
|
|
+ loading: false,
|
|
|
+ ipagination: {
|
|
|
+ current: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ // pageSizeOptions: ['10', '20', '30'],
|
|
|
+ showTotal: (total, range) => {
|
|
|
+ return range[0] + '-' + range[1] + ' 共' + total + '条'
|
|
|
+ },
|
|
|
+ showQuickJumper: true,
|
|
|
+ // showSizeChanger: true,
|
|
|
+ total: 0,
|
|
|
+ onChange: (current) => {
|
|
|
+ // 切换分页时的回调,
|
|
|
+ // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
|
|
|
+ this.ipagination.current = current
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ importExcelUrl: function () {
|
|
|
+ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
|
|
},
|
|
|
- computed: {},
|
|
|
- watch: {
|
|
|
- 'ipagination.current': function (n, o) {
|
|
|
- console.log(n, o)
|
|
|
- if (n != o) {
|
|
|
- this.tableHttp()
|
|
|
- }
|
|
|
-
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'ipagination.current': function (n, o) {
|
|
|
+ if (n != o) {
|
|
|
+ this.getHistoryList()
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
- searchQuery() {
|
|
|
- this.tableHttp()
|
|
|
- },
|
|
|
- searchReset() {
|
|
|
- this.advertiserName = null
|
|
|
- this.productName = null
|
|
|
- this.tableHttp()
|
|
|
- },
|
|
|
- handleTableChange() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ searchQuery() {
|
|
|
+ this.ipagination.current = 1
|
|
|
+ this.getHistoryList()
|
|
|
+ },
|
|
|
+ searchReset() {
|
|
|
+ this.mediaType = ''
|
|
|
+ this.userId = ''
|
|
|
+ this.accountId = ''
|
|
|
+ this.ipagination.current = 1
|
|
|
+ this.getHistoryList()
|
|
|
+ },
|
|
|
+ getHistoryList() {
|
|
|
+ this.loading = true
|
|
|
+ var params = {}
|
|
|
+ params.mediaType = this.mediaType
|
|
|
+ params.userId = this.userId
|
|
|
+ params.accountId = this.accountId
|
|
|
+ params.pageNo = this.ipagination.current
|
|
|
+ params.pageSize = this.ipagination.pageSize
|
|
|
|
|
|
- },
|
|
|
- handleDelete: function (id) {
|
|
|
- if (!this.url.delete) {
|
|
|
- this.$message.error("请设置url.delete属性!")
|
|
|
- return
|
|
|
+ getAction('/alarm/alarmEventSend/pageList', params).then((res) => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.success) {
|
|
|
+ this.dataSource = res.result.list.map((item, index) => {
|
|
|
+ return { ...item, key: index }
|
|
|
+ })
|
|
|
+ this.ipagination.total = res.result.total
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
- var that = this;
|
|
|
- postAction(that.url.delete, {
|
|
|
- productId: id
|
|
|
- }).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- that.$message.success(res.message);
|
|
|
- this.ipagination.current = 1
|
|
|
- this.tableHttp()
|
|
|
- } else {
|
|
|
- that.$message.warning(res.message);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- handleProjectAdd() {
|
|
|
- this.visibleAdd = true
|
|
|
- // this.supplierList =
|
|
|
- postAction('/ctop/product/getProjectListByAdvertiserId', {
|
|
|
- "advertiserId": this.advertiserId
|
|
|
- }).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.supplierList = res.result
|
|
|
- this.projectIds = this.dataList.map(item => {
|
|
|
- return item.projectId
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- handleCancelAdd() {
|
|
|
- this.visibleAdd = false
|
|
|
- },
|
|
|
- handleOk() {
|
|
|
- this.confirmLoading = true
|
|
|
- postAction('/ctop/product/insertProductProjectMap', {
|
|
|
- "productId": this.productIdDelete,
|
|
|
- "projectIds": this.projectIds
|
|
|
- }).then(res => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ var params = {}
|
|
|
+ // params.userId = this.userInfo().id
|
|
|
+ params.pageSize = 1000
|
|
|
+ params.pageNo = 1
|
|
|
+ getAction('/ctop/advertiser/list', params)
|
|
|
+ .then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.confirmLoading = false
|
|
|
- this.visibleAdd = false
|
|
|
- this.handleCancel()
|
|
|
+ this.list = res.result.records
|
|
|
} else {
|
|
|
- this.confirmLoading = false
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- removeTitleCun(item, index) {
|
|
|
- postAction('/ctop/product/deleteByProjectIdAndProductId', {
|
|
|
- "projectId": item.projectId,
|
|
|
- "productId": this.productIdDelete
|
|
|
- }).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.dataList.splice(index, 1)
|
|
|
- this.tableHttp()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- handleCancel() {
|
|
|
- this.visible = false
|
|
|
- this.tableHttp()
|
|
|
- },
|
|
|
-
|
|
|
- handleAddList(record) {
|
|
|
- this.visible = true
|
|
|
- this.dataList = record.projectList
|
|
|
- this.productIdDelete = record.id
|
|
|
- this.advertiserId = record.advertiserId
|
|
|
- },
|
|
|
- handleEdit: function (record) {
|
|
|
- console.log(record)
|
|
|
- this.$refs.modalForm.edit(record);
|
|
|
- this.$refs.modalForm.title = "编辑";
|
|
|
- this.$refs.modalForm.disableSubmit = false;
|
|
|
- },
|
|
|
- handleAdd: function () {
|
|
|
- this.$refs.modalForm.add();
|
|
|
- this.$refs.modalForm.title = "新增";
|
|
|
- this.$refs.modalForm.disableSubmit = false;
|
|
|
- },
|
|
|
- modalFormOk() {
|
|
|
- this.ipagination.current = 1
|
|
|
- this.tableHttp()
|
|
|
- },
|
|
|
- filterOption(input, option) {
|
|
|
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- },
|
|
|
- tableHttp() {
|
|
|
- this.loading = true;
|
|
|
- this.dataSource = []
|
|
|
- var params = {}
|
|
|
- params.pageNum = this.ipagination.current
|
|
|
- params.pageSize = this.ipagination.pageSize
|
|
|
- params.advertiserName = this.advertiserName
|
|
|
- params.productName = this.productName
|
|
|
- // {"pageNum":1,"pageSize":10,"advertiserName":"","productName":""}
|
|
|
- postAction('/ctop/product/getProductList', params).then(res => {
|
|
|
- if (res.success) {
|
|
|
- // console.log(res)
|
|
|
- this.loading = false;
|
|
|
- this.ipagination.total = res.result.total
|
|
|
- this.dataSource = res.result.list
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ .finally(() => {})
|
|
|
+ },
|
|
|
+ filterOption(input, option) {
|
|
|
+ return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.tableHttp()
|
|
|
+ getAllUserList(value) {
|
|
|
+ this.options = []
|
|
|
+ getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: value }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.options = res.result.list
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ search(value) {
|
|
|
+ this.options = []
|
|
|
+ if (value != '') {
|
|
|
+ // this.options = this.list.filter(item => {
|
|
|
+ // var data = item.realName + ' ' + item.roleName
|
|
|
+ // return data.toLowerCase().indexOf(value.toLowerCase()) > -1
|
|
|
+ // })
|
|
|
+ // this.options = [...this.options]
|
|
|
+ this.getAllUserList(value)
|
|
|
+ } else {
|
|
|
+ this.getAllUserList()
|
|
|
+ }
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {
|
|
|
+ this.getHistoryList()
|
|
|
+ // this.getAllUserList()
|
|
|
+ // this.getList()
|
|
|
+ },
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
- @import '~@assets/less/common.less';
|
|
|
+@import '~@assets/less/common.less';
|
|
|
</style>
|