|
@@ -0,0 +1,272 @@
|
|
|
+<template>
|
|
|
+ <a-card :bordered="false">
|
|
|
+ <!-- 查询区域 -->
|
|
|
+ <!-- <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="queryParam.name"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="6">
|
|
|
+ <a-form-item label="行业">
|
|
|
+ <j-tree-select
|
|
|
+ v-model="queryParam.industryId"
|
|
|
+ ref="treeSelect"
|
|
|
+ placeholder="请选择行业"
|
|
|
+ dict="sys_category,name,id"
|
|
|
+ pidField="pid"
|
|
|
+ pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
|
|
|
+ >
|
|
|
+ </j-tree-select>
|
|
|
+ </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="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
+ </span>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <!-- 操作按钮区域 -->
|
|
|
+ <div class="table-operator" style="float:right">
|
|
|
+ <!-- <a-button @click="handleAddElse" type="primary" icon="plus">新增</a-button> -->
|
|
|
+ <a-dropdown :trigger="['click']">
|
|
|
+ <a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
|
+ Click me
|
|
|
+ <a-icon type="down" />
|
|
|
+ </a>
|
|
|
+ <a-menu slot="overlay">
|
|
|
+ <a-menu-item key="0">
|
|
|
+ <a href="http://www.alipay.com/">1st menu item</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item key="1">
|
|
|
+ <a href="http://www.taobao.com/">2nd menu item</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-divider />
|
|
|
+ <a-menu-item key="3">
|
|
|
+ 3rd menu item
|
|
|
+ </a-menu-item>
|
|
|
+ </a-menu>
|
|
|
+ </a-dropdown>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- table区域-begin -->
|
|
|
+ <div>
|
|
|
+ <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
|
|
|
+ :pagination="ipagination" :loading="loading" @change="handleTableChange">
|
|
|
+ <span slot="action" slot-scope="text, record">
|
|
|
+ <a @click="handleEdit(record)">编辑</a>
|
|
|
+
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
|
|
+ <a>删除</a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ <a-modal title="新建文件" v-model="visible" @ok="handleSubmit" :width="800"
|
|
|
+ :okButtonProps="{ props: { disabled: false } }" :cancelButtonProps="{ props: { disabled: false } }">
|
|
|
+
|
|
|
+ </a-modal>
|
|
|
+ </div>
|
|
|
+ <!-- table区域-end -->
|
|
|
+
|
|
|
+ <!-- 表单区域 -->
|
|
|
+ <j-select-user ref="userForm" @ok="modalFormOk"></j-select-user>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ JeecgListMixin
|
|
|
+ } from '@/mixins/JeecgListMixin'
|
|
|
+ import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
|
|
+ import AFormItem from 'ant-design-vue/es/form/FormItem'
|
|
|
+ import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
|
|
+ import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
|
|
+ import JSelectUser from '@/components/jeecgbiz/JSelectUser'
|
|
|
+ // import { postAction } from '../../../api/manage'
|
|
|
+ import {
|
|
|
+ getAction,
|
|
|
+ postAction,
|
|
|
+ postFile,
|
|
|
+ deleteAction
|
|
|
+ } from '@/api/manage'
|
|
|
+ import {
|
|
|
+ mapActions,
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'AdvertiserList',
|
|
|
+ mixins: [JeecgListMixin],
|
|
|
+ components: {
|
|
|
+ AFormItem,
|
|
|
+ JTreeSelect,
|
|
|
+ JSelectUserByDep,
|
|
|
+ JSelectDepart,
|
|
|
+ JSelectUser
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ departDisabled: false, //是否是我的部门调用该页面
|
|
|
+ users: this.userInfo().realname, //用户名称
|
|
|
+ departmentId: this.userInfo().departId, //部门id
|
|
|
+ description: '广告主信息表管理页面',
|
|
|
+ visible: false,
|
|
|
+ accountName: '',
|
|
|
+ password: '',
|
|
|
+ mode: 'login',
|
|
|
+ showLogin: true,
|
|
|
+ showAuthorization: false,
|
|
|
+ authorizationType: 'kuaishou',
|
|
|
+ loginType: 'kuaishou',
|
|
|
+ form: this.$form.createForm(this),
|
|
|
+ // 表头
|
|
|
+ columns: [{
|
|
|
+ title: '脚本名称',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '分类',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'industryId_dictText'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目名称',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'contact'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上传人',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'mobile'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '发布时间',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'email'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'action'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ url: {
|
|
|
+ list: '/ctop/wpsFile/list',
|
|
|
+ delete: '/ctop/advertiser/delete',
|
|
|
+ deleteBatch: '/ctop/advertiser/deleteBatch',
|
|
|
+ exportXlsUrl: 'ctop/advertiser/exportXls',
|
|
|
+ importExcelUrl: 'ctop/advertiser/importExcel',
|
|
|
+ bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
|
|
|
+ bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
|
|
|
+ getLoginInfo: '/ctop/bindAccount/getLoginInfo',
|
|
|
+ userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
|
|
|
+ userWithDepart: '/sys/user/userDepartList' // 引入为指定用户查看部门信息需要的url
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ importExcelUrl: function () {
|
|
|
+ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.queryParam.userId = this.userInfo().id
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
+ handleAddElse() {
|
|
|
+
|
|
|
+ },
|
|
|
+ searchRe() {
|
|
|
+ this.queryParam.name = ''
|
|
|
+ this.queryParam.industryId = ''
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ handleSubmit() {
|
|
|
+ let params = {}
|
|
|
+ params.advertiserId = this.record.id
|
|
|
+ params.advertiser_name = this.record.name
|
|
|
+ params.userId = this.userInfo().id
|
|
|
+ params.userName = this.userInfo().realname
|
|
|
+ params.projectId = this.record.projectId
|
|
|
+ params.projectName = this.record.projectName
|
|
|
+
|
|
|
+ // 触发表单验证
|
|
|
+ this.form.validateFields(err => {
|
|
|
+ if (!err) {
|
|
|
+ if (this.mode == 'login') {
|
|
|
+ params.accountName = this.accountName
|
|
|
+ params.password = this.password
|
|
|
+ params.loginType = this.loginType
|
|
|
+ if (this.loginType == 'kuaishou') {
|
|
|
+ params.mediaId = 2
|
|
|
+ } else if (this.loginType == 'bytedance') {
|
|
|
+ params.mediaId = 1
|
|
|
+ }
|
|
|
+ postAction(this.url.bindAccountLoginUrl, params).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ alert('绑定成功')
|
|
|
+ this.accountName = ''
|
|
|
+ this.password = ''
|
|
|
+ this.loginType = ''
|
|
|
+ } else {
|
|
|
+ alert(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 授权登录
|
|
|
+ if (this.mode == 'authorization') {
|
|
|
+ params.authorizationType = this.authorizationType
|
|
|
+ if (this.authorizationType == 'kuaishou') {
|
|
|
+ params.mediaId = 2
|
|
|
+ } else if (this.authorizationType == 'bytedance') {
|
|
|
+ params.mediaId = 1
|
|
|
+ }
|
|
|
+ postAction(this.url.bindAuthorizationUrl, params).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ window.open(res.message, '_blank')
|
|
|
+ } else {
|
|
|
+ alert('绑定失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ onChageLogin() {
|
|
|
+ console.log(this.mode)
|
|
|
+ if (this.mode == 'login') {
|
|
|
+ this.showLogin = true
|
|
|
+ this.showAuthorization = false
|
|
|
+ } else {
|
|
|
+ this.showLogin = false
|
|
|
+ this.showAuthorization = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showModal(record) {
|
|
|
+ this.record = record
|
|
|
+ this.visible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ handleCancel() {
|
|
|
+ this.close()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+ @import '~@assets/less/common.less';
|
|
|
+</style>
|