Forráskód Böngészése

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_scrm_adminUI

yzx 2 hónapja
szülő
commit
c20b59deeb

+ 60 - 0
src/api/ad/AdIqiyiAccount.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询爱奇艺广告账号列表
+export function listAdIqiyiAccount(query) {
+  return request({
+    url: '/ad/AdIqiyiAccount/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询爱奇艺广告账号详细
+export function getAdIqiyiAccount(id) {
+  return request({
+    url: '/ad/AdIqiyiAccount/' + id,
+    method: 'get'
+  })
+}
+
+// 查询优酷广告账号详细
+export function listAll() {
+  return request({
+    url: '/ad/AdIqiyiAccount/listAll',
+    method: 'get'
+  })
+}
+// 新增爱奇艺广告账号
+export function addAdIqiyiAccount(data) {
+  return request({
+    url: '/ad/AdIqiyiAccount',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改爱奇艺广告账号
+export function updateAdIqiyiAccount(data) {
+  return request({
+    url: '/ad/AdIqiyiAccount',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除爱奇艺广告账号
+export function delAdIqiyiAccount(id) {
+  return request({
+    url: '/ad/AdIqiyiAccount/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出爱奇艺广告账号
+export function exportAdIqiyiAccount(query) {
+  return request({
+    url: '/ad/AdIqiyiAccount/export',
+    method: 'get',
+    params: query
+  })
+}

+ 60 - 0
src/api/ad/AdYouKuaccount.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询优酷广告账号列表
+export function listAdYouKuAccount(query) {
+  return request({
+    url: '/ad/AdYouKuAccount/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询优酷广告账号详细
+export function getAdYouKuAccount(id) {
+  return request({
+    url: '/ad/AdYouKuAccount/' + id,
+    method: 'get'
+  })
+}
+// 查询优酷广告账号详细
+export function listAll() {
+  return request({
+    url: '/ad/AdYouKuAccount/listAll',
+    method: 'get'
+  })
+}
+
+// 新增优酷广告账号
+export function addAdYouKuAccount(data) {
+  return request({
+    url: '/ad/AdYouKuAccount',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改优酷广告账号
+export function updateAdYouKuAccount(data) {
+  return request({
+    url: '/ad/AdYouKuAccount',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除优酷广告账号
+export function delAdYouKuAccount(id) {
+  return request({
+    url: '/ad/AdYouKuAccount/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出优酷广告账号
+export function exportAdYouKuAccount(query) {
+  return request({
+    url: '/ad/AdYouKuAccount/export',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
src/api/ad/adAccount.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 查询推广账户列表
+export function listAll() {
+  return request({
+    url: '/ad/adAccount/listAll',
+    method: 'get',
+  })
+}

+ 60 - 0
src/api/ad/adDomain.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询广告域名列表
+export function listAdDomain(query) {
+  return request({
+    url: '/ad/adDomain/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询广告域名列表
+export function listAll() {
+  return request({
+    url: '/ad/adDomain/listAll',
+    method: 'get',
+  })
+}
+
+// 查询广告域名详细
+export function getAdDomain(id) {
+  return request({
+    url: '/ad/adDomain/' + id,
+    method: 'get'
+  })
+}
+
+// 新增广告域名
+export function addAdDomain(data) {
+  return request({
+    url: '/ad/adDomain',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改广告域名
+export function updateAdDomain(data) {
+  return request({
+    url: '/ad/adDomain',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除广告域名
+export function delAdDomain(id) {
+  return request({
+    url: '/ad/adDomain/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出广告域名
+export function exportAdDomain(query) {
+  return request({
+    url: '/ad/adDomain/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/ad/adSite.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询站点管理列表
+export function listAdSite(query) {
+  return request({
+    url: '/ad/adSite/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询站点管理详细
+export function getAdSite(id) {
+  return request({
+    url: '/ad/adSite/' + id,
+    method: 'get'
+  })
+}
+
+// 新增站点管理
+export function addAdSite(data) {
+  return request({
+    url: '/ad/adSite',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改站点管理
+export function updateAdSite(data) {
+  return request({
+    url: '/ad/adSite',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除站点管理
+export function delAdSite(id) {
+  return request({
+    url: '/ad/adSite/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出站点管理
+export function exportAdSite(query) {
+  return request({
+    url: '/ad/adSite/export',
+    method: 'get',
+    params: query
+  })
+}

+ 60 - 0
src/api/ad/htmlTemplate.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询广告信息流链接列表
+export function listHtml(query) {
+  return request({
+    url: '/ad/html/template/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询广告信息流链接列表
+export function listAll() {
+  return request({
+    url: '/ad/html/template/listAll',
+    method: 'get',
+  })
+}
+
+// 查询广告信息流链接详细
+export function getHtml(id) {
+  return request({
+    url: '/ad/html/template/' + id,
+    method: 'get'
+  })
+}
+
+// 新增广告信息流链接
+export function addHtml(data) {
+  return request({
+    url: '/ad/html/template',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改广告信息流链接
+export function updateHtml(data) {
+  return request({
+    url: '/ad/html/template',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除广告信息流链接
+export function delHtml(id) {
+  return request({
+    url: '/ad/html/template/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出广告信息流链接
+export function exportHtml(query) {
+  return request({
+    url: '/ad/html/template/export',
+    method: 'get',
+    params: query
+  })
+}

+ 101 - 0
src/api/baidu/BdAccount.js

@@ -0,0 +1,101 @@
+import request from '@/utils/request'
+
+// 查询百度账号列表
+export function listBdAccount(query) {
+  return request({
+    url: '/bd/BdAccount/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询百度账号列表
+export function listAll(query) {
+  return request({
+    url: '/bd/BdAccount/listAll',
+    method: 'get',
+    params: query
+  })
+}
+// 查询百度账号列表
+export function listAllPlan(query) {
+  return request({
+    url: '/bd/BdAccount/listAllPlan',
+    method: 'get',
+    params: query
+  })
+}
+// 查询百度账号列表
+export function listAllUnit(query) {
+  return request({
+    url: '/bd/BdAccount/listAllUnit',
+    method: 'get',
+    params: query
+  })
+}
+// 查询百度账号列表
+export function listAllCreative(query) {
+  return request({
+    url: '/bd/BdAccount/listAllCreative',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询百度账号详细
+export function getBdAccount(id) {
+  return request({
+    url: '/bd/BdAccount/' + id,
+    method: 'get'
+  })
+}
+
+// 新增百度账号
+export function addBdAccount(data) {
+  return request({
+    url: '/bd/BdAccount',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改百度账号
+export function updateBdAccount(data) {
+  return request({
+    url: '/bd/BdAccount',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除百度账号
+export function delBdAccount(id) {
+  return request({
+    url: '/bd/BdAccount/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出百度账号
+export function exportBdAccount(query) {
+  return request({
+    url: '/bd/BdAccount/export',
+    method: 'get',
+    params: query
+  })
+}
+// 导出百度账号
+export function authorizationUrl() {
+  return request({
+    url: '/bd/BdAccount/authorizationUrl',
+    method: 'get',
+  })
+}
+// 导出百度账号
+export function syncAccount(id) {
+  return request({
+    url: '/bd/BdAccount/syncAccount',
+    method: 'get',
+    params:{id}
+  })
+}

+ 38 - 0
src/api/baidu/statistics.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+
+// 查询百度账号列表
+export function conversionStatistics(query) {
+  return request({
+    url: '/baiduStatistics/conversionStatistics',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询百度账号列表
+export function getReportData(query) {
+  return request({
+    url: '/baiduStatistics/getReportData',
+    method: 'get',
+    params: query
+  })
+}
+
+// app投放报表
+export function advSemStatisticsList(query) {
+  return request({
+    url: '/baiduStatistics/selectFsAdvSemStatisticsByDayVo',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出app投放报表
+export function fsAdvSemStatisticsExport(query) {
+  return request({
+    url: '/baiduStatistics/fsAdvSemStatisticsExport',
+    method: 'get',
+    params: query
+  })
+}
+

+ 10 - 1
src/api/company/companySms.js

@@ -9,6 +9,15 @@ export function listCompanySms(query) {
   })
 }
 
+// 充值公司套餐
+export function buySms(query) {
+  return request({
+    url: '/company/companySms/buySms',
+    method: 'post',
+    params: query
+  })
+}
+
 // 查询公司短信详细
 export function getCompanySms(smsId) {
   return request({
@@ -50,4 +59,4 @@ export function exportCompanySms(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 11 - 1
src/api/company/companySmsPackage.js

@@ -9,6 +9,16 @@ export function listCompanySmsPackage(query) {
   })
 }
 
+// 查询所有短信套餐包
+export function listCompanySmsPackageAll(query) {
+  return request({
+    url: '/company/companySmsPackage/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询短信套餐包详细
 export function getCompanySmsPackage(packageId) {
   return request({
@@ -50,4 +60,4 @@ export function exportCompanySmsPackage(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 9 - 2
src/api/company/companyVoice.js

@@ -16,7 +16,14 @@ export function getCompanyVoice(voiceId) {
     method: 'get'
   })
 }
-
+// 购买通话
+export function companyBuyVoice(param) {
+  return request({
+    url: '/company/companyVoice/buy',
+    data: param,
+    method: 'post'
+  })
+}
 // 新增企业通话
 export function addCompanyVoice(data) {
   return request({
@@ -50,4 +57,4 @@ export function exportCompanyVoice(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 9 - 2
src/api/company/companyVoicePackage.js

@@ -8,7 +8,14 @@ export function listCompanyVoicePackage(query) {
     params: query
   })
 }
-
+// 查询所有套餐
+export function listAllCompanyVoicePackage(query) {
+  return request({
+    url: '/company/companyVoicePackage/listAll',
+    method: 'get',
+    params: query
+  })
+}
 // 查询套餐详细
 export function getCompanyVoicePackage(packageId) {
   return request({
@@ -50,4 +57,4 @@ export function exportCompanyVoicePackage(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 61 - 0
src/api/qw/workLink.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询企微获客链接管理列表
+export function listWorkLink(query) {
+  return request({
+    url: '/qw/workLink/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询企微获客链接管理列表-不分页
+export function listAll(query) {
+  return request({
+    url: '/qw/workLink/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询企微获客链接管理详细
+export function getWorkLink(id) {
+  return request({
+    url: '/qw/workLink/' + id,
+    method: 'get'
+  })
+}
+
+// 新增企微获客链接管理
+export function addWorkLink(data) {
+  return request({
+    url: '/qw/workLink',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改企微获客链接管理
+export function updateWorkLink(data) {
+  return request({
+    url: '/qw/workLink',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除企微获客链接管理
+export function delWorkLink(id) {
+  return request({
+    url: '/qw/workLink/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出企微获客链接管理
+export function exportWorkLink(query) {
+  return request({
+    url: '/qw/workLink/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/qw/workLinkUser.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询企微获客链接用户关联列表
+export function listWorkLinkUser(query) {
+  return request({
+    url: '/qw/workLinkUser/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询企微获客链接用户关联详细
+export function getWorkLinkUser(id) {
+  return request({
+    url: '/qw/workLinkUser/' + id,
+    method: 'get'
+  })
+}
+
+// 新增企微获客链接用户关联
+export function addWorkLinkUser(data) {
+  return request({
+    url: '/qw/workLinkUser',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改企微获客链接用户关联
+export function updateWorkLinkUser(data) {
+  return request({
+    url: '/qw/workLinkUser',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除企微获客链接用户关联
+export function delWorkLinkUser(id) {
+  return request({
+    url: '/qw/workLinkUser/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出企微获客链接用户关联
+export function exportWorkLinkUser(query) {
+  return request({
+    url: '/qw/workLinkUser/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/qw/workUser.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询企微获客添加的用户列表
+export function listWorkUser(query) {
+  return request({
+    url: '/qw/workUser/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询企微获客添加的用户详细
+export function getWorkUser(id) {
+  return request({
+    url: '/qw/workUser/' + id,
+    method: 'get'
+  })
+}
+
+// 新增企微获客添加的用户
+export function addWorkUser(data) {
+  return request({
+    url: '/qw/workUser',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改企微获客添加的用户
+export function updateWorkUser(data) {
+  return request({
+    url: '/qw/workUser',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除企微获客添加的用户
+export function delWorkUser(id) {
+  return request({
+    url: '/qw/workUser/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出企微获客添加的用户
+export function exportWorkUser(query) {
+  return request({
+    url: '/qw/workUser/export',
+    method: 'get',
+    params: query
+  })
+}

+ 290 - 0
src/views/ad/AdIqiyiAccount/index.vue

@@ -0,0 +1,290 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="账号ID" prop="accountId">
+        <el-input
+          v-model="queryParams.accountId"
+          placeholder="请输入账号ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号名称" prop="accountName">
+        <el-input
+          v-model="queryParams.accountName"
+          placeholder="请输入账号名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ad:AdIqiyiAccount:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ad:AdIqiyiAccount:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ad:AdIqiyiAccount:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['ad:AdIqiyiAccount:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="AdIqiyiAccountList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="账号ID" align="center" prop="accountId" />
+      <el-table-column label="账号名称" align="center" prop="accountName" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['ad:AdIqiyiAccount:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['ad:AdIqiyiAccount:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改爱奇艺广告账号对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="账号ID" prop="accountId">
+          <el-input v-model="form.accountId" placeholder="请输入账号ID" />
+        </el-form-item>
+        <el-form-item label="账号名称" prop="accountName">
+          <el-input v-model="form.accountName" placeholder="请输入账号名称" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAdIqiyiAccount, getAdIqiyiAccount, delAdIqiyiAccount, addAdIqiyiAccount, updateAdIqiyiAccount, exportAdIqiyiAccount } from "@/api/ad/AdIqiyiAccount";
+
+export default {
+  name: "AdIqiyiAccount",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 爱奇艺广告账号表格数据
+      AdIqiyiAccountList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        accountId: null,
+        accountName: null,
+        appKey: null,
+        token: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询爱奇艺广告账号列表 */
+    getList() {
+      this.loading = true;
+      listAdIqiyiAccount(this.queryParams).then(response => {
+        this.AdIqiyiAccountList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        accountId: null,
+        accountName: null,
+        appKey: null,
+        token: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加爱奇艺广告账号";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAdIqiyiAccount(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改爱奇艺广告账号";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAdIqiyiAccount(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAdIqiyiAccount(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除爱奇艺广告账号编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAdIqiyiAccount(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有爱奇艺广告账号数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportAdIqiyiAccount(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 316 - 0
src/views/ad/AdYouKuaccount/index.vue

@@ -0,0 +1,316 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="账号ID" prop="accountId">
+        <el-input
+          v-model="queryParams.accountId"
+          placeholder="请输入账号ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号名称" prop="accountName">
+        <el-input
+          v-model="queryParams.accountName"
+          placeholder="请输入账号名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="appKey" prop="appKey">
+        <el-input
+          v-model="queryParams.appKey"
+          placeholder="请输入appKey"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="token" prop="token">
+        <el-input
+          v-model="queryParams.token"
+          placeholder="请输入token"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ad:AdYouKuaccount:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ad:AdYouKuaccount:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ad:AdYouKuaccount:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['ad:AdYouKuaccount:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="AdYouKuaccountList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="账号ID" align="center" prop="accountId" />
+      <el-table-column label="账号名称" align="center" prop="accountName" />
+      <el-table-column label="appKey" align="center" prop="appKey" />
+      <el-table-column label="token" align="center" prop="token" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['ad:AdYouKuaccount:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['ad:AdYouKuaccount:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改优酷广告账号对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="账号ID" prop="accountId">
+          <el-input v-model="form.accountId" placeholder="请输入账号ID" />
+        </el-form-item>
+        <el-form-item label="账号名称" prop="accountName">
+          <el-input v-model="form.accountName" placeholder="请输入账号名称" />
+        </el-form-item>
+        <el-form-item label="appKey" prop="appKey">
+          <el-input v-model="form.appKey" placeholder="请输入appKey" />
+        </el-form-item>
+        <el-form-item label="token" prop="token">
+          <el-input v-model="form.token" placeholder="请输入token" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAdYouKuAccount, getAdYouKuAccount, delAdYouKuAccount, addAdYouKuAccount, updateAdYouKuAccount, exportAdYouKuAccount } from "@/api/ad/AdYouKuaccount";
+
+export default {
+  name: "AdYouKuaccount",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 优酷广告账号表格数据
+      AdYouKuaccountList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        accountId: null,
+        accountName: null,
+        appKey: null,
+        token: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询优酷广告账号列表 */
+    getList() {
+      this.loading = true;
+      listAdYouKuAccount(this.queryParams).then(response => {
+        this.AdYouKuaccountList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        accountId: null,
+        accountName: null,
+        appKey: null,
+        token: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加优酷广告账号";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAdYouKuAccount(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改优酷广告账号";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAdYouKuAccount(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAdYouKuAccount(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除优酷广告账号编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAdYouKuAccount(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有优酷广告账号数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportAdYouKuAccount(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 299 - 0
src/views/ad/adAccount/index.vue

@@ -0,0 +1,299 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="媒体类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择媒体类型" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="关联ID" prop="linkId">
+        <el-input
+          v-model="queryParams.linkId"
+          placeholder="请输入关联ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ad:adAccount:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ad:adAccount:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ad:adAccount:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['ad:adAccount:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="adAccountList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="媒体类型" align="center" prop="type" />
+      <el-table-column label="关联ID" align="center" prop="linkId" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['ad:adAccount:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['ad:adAccount:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改推广账户对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="媒体类型" prop="type">
+          <el-select v-model="form.type" placeholder="请选择媒体类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="关联ID" prop="linkId">
+          <el-input v-model="form.linkId" placeholder="请输入关联ID" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAdAccount, getAdAccount, delAdAccount, addAdAccount, updateAdAccount, exportAdAccount } from "@/api/ad/adAccount";
+
+export default {
+  name: "AdAccount",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 推广账户表格数据
+      adAccountList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        type: null,
+        linkId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询推广账户列表 */
+    getList() {
+      this.loading = true;
+      listAdAccount(this.queryParams).then(response => {
+        this.adAccountList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        type: null,
+        linkId: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加推广账户";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAdAccount(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改推广账户";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAdAccount(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAdAccount(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除推广账户编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAdAccount(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有推广账户数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportAdAccount(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 286 - 0
src/views/ad/adDomain/index.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="域名" prop="domain">
+        <el-input
+          v-model="queryParams.domain"
+          placeholder="请输入域名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ad:adDomain:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ad:adDomain:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ad:adDomain:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['ad:adDomain:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="adDomainList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="域名" align="center" prop="domain" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['ad:adDomain:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['ad:adDomain:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改广告域名对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="域名" prop="domain">
+          <el-input v-model="form.domain" placeholder="请输入域名" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAdDomain, getAdDomain, delAdDomain, addAdDomain, updateAdDomain, exportAdDomain } from "@/api/ad/adDomain";
+
+export default {
+  name: "AdDomain",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 广告域名表格数据
+      adDomainList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        domain: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询广告域名列表 */
+    getList() {
+      this.loading = true;
+      listAdDomain(this.queryParams).then(response => {
+        this.adDomainList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        domain: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加广告域名";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAdDomain(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改广告域名";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAdDomain(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAdDomain(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除广告域名编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAdDomain(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有广告域名数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportAdDomain(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 408 - 0
src/views/ad/adSite/index.vue

@@ -0,0 +1,408 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="模板" prop="templateId">
+        <el-select v-model="queryParams.templateId" @change="accountChange" placeholder="请选择模板">
+          <el-option
+            v-for="item in templateList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="媒体类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择媒体类型" clearable size="small">
+          <el-option
+            v-for="item in typeOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+<!--      <el-form-item label="账号ID" prop="accountId">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.accountId"-->
+<!--          placeholder="请输入账号ID"-->
+<!--          clearable-->
+<!--          size="small"-->
+<!--          @keyup.enter.native="handleQuery"-->
+<!--        />-->
+<!--      </el-form-item>-->
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ad:adSite:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ad:adSite:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ad:adSite:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['ad:adSite:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="adSiteList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="模板" align="center" prop="templateName" />
+      <el-table-column label="媒体类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <el-tag prop="type" v-for="(item, index) in typeOptions" v-if="scope.row.type==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="账号" align="center" prop="accountName" />
+      <el-table-column label="链接" align="center">
+        <template slot-scope="scope">
+          <el-tooltip class="item" effect="dark" content="复制链接" placement="top-start">
+            <el-link type="primary" @click="copyUrl(scope.row.url)">{{scope.row.url}}</el-link>
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['ad:adSite:edit']"
+          >修改</el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['ad:adSite:remove']"-->
+<!--          >删除</el-button>-->
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改站点管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="模板" prop="templateId">
+          <el-select v-model="form.templateId" placeholder="请选择模板">
+            <el-option
+              v-for="item in templateList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="媒体类型" prop="type">
+          <el-select v-model="form.type" @change="accountChange" placeholder="请选择媒体类型">
+            <el-option
+              v-for="item in typeOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="Number(item.dictValue)"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="账号" prop="accountId" v-if="form.type != 99">
+          <el-select v-model="form.accountId" filterable v-loading="accountLoading">
+            <el-option v-for="item in accountList" :value="item.id" :key="item.id" :label="item.name" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="域名" prop="domainId">
+          <el-select v-model="form.domainId" filterable>
+            <el-option v-for="item in domainList" :value="item.id" :key="item.id" :label="item.domain" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="获客链接" prop="workId">
+          <el-select v-model="form.workId" filterable>
+            <el-option v-for="item in workList" :value="item.id" :key="item.id" :label="item.linkName" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAdSite, getAdSite, delAdSite, addAdSite, updateAdSite, exportAdSite } from "@/api/ad/adSite";
+import {listAll as templateListAll} from "@/api/ad/htmlTemplate";
+import {listAll as domainListAll} from "@/api/ad/adDomain";
+import {listAll as accountListAll} from "@/api/ad/adAccount";
+import {listAll as workUrlListAll} from '@/api/qw/workLink'
+
+export default {
+  name: "AdSite",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      accountLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 站点管理表格数据
+      adSiteList: [],
+      accountList: [],
+      accountAllList: [],
+      typeOptions: [],
+      templateList: [],
+      domainList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        templateId: null,
+        type: null,
+        accountId: null,
+        url: null,
+      },
+      // 表单参数
+      form: {},
+      workList: [],
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getDicts("ad_type").then((response) => {
+      this.typeOptions = response.data;
+    });
+    templateListAll().then(e => {
+      this.templateList = e.data;
+    })
+    domainListAll().then(e => {
+      this.domainList = e.data;
+    })
+    accountListAll().then(e => {
+      this.accountAllList = e.data;
+    })
+    workUrlListAll().then(e => {
+      this.workList = e.data;
+    })
+    this.getList();
+  },
+  methods: {
+    /** 查询站点管理列表 */
+    getList() {
+      this.loading = true;
+      listAdSite(this.queryParams).then(response => {
+        this.adSiteList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        templateId: null,
+        type: null,
+        accountId: null,
+        url: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    copyUrl(url){
+      navigator.clipboard.writeText(url)
+        .then(() => {
+          this.msgSuccess("复制成功");
+        })
+        .catch(err => {
+          this.msgError("复制失败");
+        });
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加站点管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAdSite(id).then(response => {
+        this.form = response.data;
+        this.accountList = this.accountAllList.filter(item => item.type == this.form.type);
+        this.open = true;
+        this.title = "修改站点管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAdSite(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAdSite(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除站点管理编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAdSite(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有站点管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportAdSite(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+
+    accountChange(){
+      let type = this.form.type;
+      this.form.accountId = undefined;
+      this.accountList = this.accountAllList.filter(item => item.type == type);
+      // if(type == 0){
+      //   this.accountLoading = true;
+      //   bdAccountListAll({}).then(res => {
+      //     this.accountLoading = false;
+      //     this.accountList = res.data;
+      //   })
+      // }
+      // if(type == 1){
+      //   this.accountLoading = true;
+      //   youkuAccountListAll().then(res => {
+      //     this.accountLoading = false;
+      //     this.accountList = res.data;
+      //   })
+      // }
+      // if(type == 2){
+      //   this.accountLoading = true;
+      //   iqiyiAccountListAll().then(res => {
+      //     this.accountLoading = false;
+      //     this.accountList = res.data;
+      //   })
+      // }
+    },
+  }
+};
+</script>

+ 404 - 0
src/views/ad/html/index.vue

@@ -0,0 +1,404 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="编号" prop="no">
+        <el-input
+          v-model="queryParams.no"
+          placeholder="请输入编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ad:html:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ad:html:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ad:html:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['ad:html:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="htmlList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="描述" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['ad:html:edit']"
+          >修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改广告信息流链接对话框 -->
+    <el-dialog :title="title" :visible.sync="open" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" />
+        </el-form-item>
+        <el-form-item label="编辑页面">
+          <el-button type="primary" @click="openH5(form.json)">
+            编辑页面
+          </el-button>
+        </el-form-item>
+        <el-form-item label="描述" prop="remark">
+          <el-input type="textarea" :row="5" v-model="form.remark" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 添加或修改广告信息流链接对话框 -->
+    <el-dialog title="编辑页面" :visible.sync="h5Open" append-to-body fullscreen>
+        <H5Editor ref="h5Editor" />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="h5Ok">确 定</el-button>
+        <el-button @click="h5Cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 添加或修改广告信息流链接对话框 -->
+    <el-dialog title="生成链接" :visible.sync="openUrl" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="链接类型" prop="type">
+          <el-radio v-model="urlForm.type" v-for="item in typeList" :key="item.type" :label="item.type" @change="accountChange">{{item.name}}</el-radio>
+        </el-form-item>
+        <el-form-item label="账号" prop="accountId">
+          <el-select v-model="urlForm.accountId" filterable>
+            <el-option v-for="item in accountList" :value="item.id" :key="item.id" :label="item.accountName" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="链接" prop="type" v-if="this.urlForm.url">
+          <a class="a" :href="this.urlForm.url" target="_blank">{{this.urlForm.url}}</a>
+          <el-tooltip class="item" effect="dark" content="复制链接" placement="top">
+            <i style="margin-left: 10px;cursor: pointer;color: #1890ff" class="el-icon-copy-document" @click="copyUrl"></i>
+          </el-tooltip>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="urlOk">生成</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listHtml, getHtml, delHtml, addHtml, updateHtml, exportHtml } from "@/api/ad/htmlTemplate";
+import { listAll as bdAccountListAll } from "@/api/baidu/BdAccount";
+import { listAll as youkuAccountListAll } from "@/api/ad/AdYouKuaccount.js";
+import { listAll as iqiyiAccountListAll } from "@/api/ad/AdIqiyiAccount.js";
+
+export default {
+  name: "Html",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      accountList: [],
+      typeList: [{type: 0,name: "百度"}, {type: 1,name: "优酷"}, {type: 2,name: "爱奇艺"}],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      h5Open: false,
+      // 总条数
+      total: 0,
+      // 广告信息流链接表格数据
+      htmlList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      openUrl: false,
+      urlForm: {
+        type: 0,
+        accountId: null,
+        url: null,
+      },
+      dataJSON: {},
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        no: null,
+        images: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    openH5(){
+      this.h5Open = true;
+      this.$nextTick(() => {
+        this.$refs.h5Editor.initData(this.form.json || "[]");
+      });
+    },
+    h5Ok(){
+      // 通过ref获取子组件的list数据
+      const listData = this.$refs.h5Editor.list;
+      this.form.json = JSON.stringify(listData);
+      this.h5Open = false; // 关闭对话框
+    },
+    h5Cancel(){
+      this.h5Open = false;
+    },
+    copyUrl(){
+      navigator.clipboard.writeText(this.urlForm.url)
+        .then(() => {
+          this.msgSuccess("复制成功");
+        })
+        .catch(err => {
+          this.msgError("复制失败");
+        });
+    },
+    urlOk(){
+      if(!this.form.url){
+        this.msgError("推广页面信息错误,请联系管理员!");
+        return;
+      }
+      if(this.urlForm.type == null || this.urlForm.type == undefined){
+        this.msgError("链接类型不能为空");
+        return;
+      }
+      if(!this.urlForm.accountId){
+        this.msgError("账号ID不能为空");
+        return;
+      }
+      this.urlForm.url = this.form.url + "&type=" + this.urlForm.type + "&accountId=" + this.urlForm.accountId;
+    },
+    accountChange(){
+      let type = this.urlForm.type;
+      this.urlForm.accountId = undefined;
+      this.urlForm.url = undefined;
+      if(type == 0){
+        bdAccountListAll({}).then(res => {
+          this.accountList = res.data;
+        })
+      }
+      if(type == 1){
+        youkuAccountListAll().then(res => {
+          this.accountList = res.data;
+        })
+      }
+      if(type == 2){
+        iqiyiAccountListAll().then(res => {
+          this.accountList = res.data;
+        })
+      }
+    },
+    openUrlFun(row){
+      getHtml(row.id).then(response => {
+        this.form = response.data;
+        if(this.form.dataJson){
+          this.dataJSON = JSON.parse(this.form.dataJson)
+        }
+        this.urlForm = {
+          type: 0,
+          accountId: null,
+          url: null,
+        };
+        this.accountChange();
+        this.openUrl = true;
+      });
+    },
+    /** 查询广告信息流链接列表 */
+    getList() {
+      this.loading = true;
+      listHtml(this.queryParams).then(response => {
+        this.htmlList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.dataJSON = {};
+      this.form = {
+        id: null,
+        no: null,
+        images: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        dataJSON: "",
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加广告信息流链接";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getHtml(id).then(response => {
+        this.form = response.data;
+        if(this.form.dataJson){
+          this.dataJSON = JSON.parse(this.form.dataJson)
+        }
+        this.open = true;
+        this.title = "修改广告信息流链接";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if(this.dataJSON){
+            this.form.dataJson = JSON.stringify(this.dataJSON);
+          }
+          if (this.form.id != null) {
+            updateHtml(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addHtml(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除广告信息流链接编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delHtml(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有广告信息流链接数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportHtml(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>
+<style>
+.a{
+  text-decoration: underline;
+}
+.a:hover{
+  text-decoration: underline;
+}
+</style>

+ 439 - 0
src/views/ad/statistics/creativeStatistics.vue

@@ -0,0 +1,439 @@
+<template>
+  <div class="app-container">
+    <div class="app-content">
+
+      <div class="title" style="display: flex; justify-content: center; align-items: center;">定向统计</div>
+
+
+      <el-form class="search-form" :inline="true" label-width="90px">
+        <el-form-item label="时间" prop="time">
+          <el-date-picker
+            v-model="queryParams.time"
+            type="daterange"
+            range-separator="至"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="定向维度">
+          <el-select v-model="queryParams.reportType" placeholder="请选择维度">
+            <el-option
+              v-for="item in options2"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="选择部门" prop="userId">
+            <treeselect style="width: 217px" :clearable="false" clearable v-model="deptId" :options="deptOptions" :show-count="true"
+                        placeholder="请选择归属部门"/>
+        </el-form-item>
+        <el-form-item label="选择员工" prop="userId">
+          <el-select v-model="queryParams.userId" filterable clearable @change="accountListFun" placeholder="请选择员工">
+            <el-option
+              v-for="item in users"
+              :key="item.userId"
+              :label="item.nickName"
+              :value="item.userId">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="推广账户" prop="accountId">
+          <el-select v-model="queryParams.id" @change="planLoad" filterable clearable placeholder="请选择推广账户">
+            <el-option
+              v-for="item in accountList"
+              :key="item.id"
+              :label="item.accountName"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+<!--    <div ref="chartContainer" style="width: 100%; height: 400px;"></div>-->
+<!--    <el-button class="export" size="small" @click="handleExport"-->
+<!--               style="float: right; margin-bottom: 15px; margin-right: 40px;">导出-->
+<!--    </el-button>-->
+    <div class="table-box" style="margin: 0 auto">
+      <el-table :data="dataList" border v-loading="loading" style="width: 100%" height="500">
+        <el-table-column label="地区" v-if="queryParams.reportType == 2324048">
+          <template slot-scope="scope">
+            {{scope.row.prov.provinceName}}
+          </template>
+        </el-table-column>
+        <el-table-column label="性别" v-if="queryParams.reportType == 2503330">
+          <template slot-scope="scope">
+            {{scope.row.genderName}}
+          </template>
+        </el-table-column>
+        <el-table-column label="年龄" v-if="queryParams.reportType == 2510393">
+          <template slot-scope="scope">
+            {{scope.row.ageName}}
+          </template>
+        </el-table-column>
+        <el-table-column label="意向词" v-if="queryParams.reportType == 2532512">
+          <template slot-scope="scope">
+            {{scope.row.showWord}} - {{scope.row.feedWord}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="date" label="日期" />
+        <el-table-column prop="impression" label="展现" />
+        <el-table-column prop="click" label="点击" />
+        <el-table-column prop="cost" label="消费" />
+        <el-table-column prop="ctr" label="点击率">
+          <template slot-scope="scope">
+            {{scope.row.ctr}}%
+          </template>
+        </el-table-column>
+        <el-table-column prop="cpc" label="平均点击价格" />
+        <el-table-column prop="cpm" label="千次展现消费" />
+        <el-table-column prop="weixinFollowSuccessConversions" label="微信加粉成功" />
+        <el-table-column prop="weixinFollowSuccessConversionsCost" label="微信加粉成本" />
+        <el-table-column prop="feedOCPCConversionsDetail133" label="直播间微信加粉成功" />
+        <el-table-column prop="feedOCPCConversionsDetail133Cost" label="直播间微信加粉成本" />
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.page"
+        :limit.sync="queryParams.rowCount"
+        @pagination="getReportData"
+      />
+    </div>
+  </div>
+
+</template>
+
+<script>
+import {listStore} from "@/api/his/storeProduct";
+import echarts from 'echarts'
+import {orderChartData, storeOrderChart, storeOrderChartStore, storeExport} from "@/api/his/index";
+import {getReportData} from "@/api/baidu/statistics";
+import {getUserListByDeptId} from "@/api/company/companyUser";
+import {listAll} from "@/api/baidu/BdAccount";
+import Treeselect from "@riophae/vue-treeselect";
+import {treeselect} from "@/api/company/companyDept";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  components: {Treeselect},
+  data() {
+    return {
+      deptOptions: [],
+      loading: false,
+      total: 0,
+      exportLoading: false,
+      deptId: null,
+      queryParams: {
+        id: null,
+        reportType: 2324048,
+        startDate: null,
+        endDate: null,
+        time: '',
+        page: 0,
+        rowCount: 10,
+      },
+      accountList: [],
+      users: [],
+      dateList: [],
+      tableList: [],
+      planList: [],
+      unitList: [],
+      creativeList: [],
+      chart: null,
+      pload: false,
+      uload: false,
+      aload: false,
+      dataList: [],
+      options: [{
+        value: '1',
+        label: '今天'
+      }, {
+        value: '2',
+        label: '昨天'
+      }, {
+        value: '3',
+        label: '本周'
+      }, {
+        value: '4',
+        label: '上周'
+      }, {
+        value: '5',
+        label: '本月'
+      }
+        , {
+          value: '6',
+          label: '上月'
+        },
+        {
+          value: '7',
+          label: '本季度'
+        },
+        {
+          value: '8',
+          label: '上季度'
+        }
+        , {
+          value: '9',
+          label: '本年'
+        }
+        , {
+          value: '10',
+          label: '去年'
+        }],
+      options2: [{
+        value: 2324048,
+        label: '地域'
+      }, {
+        value: 2503330,
+        label: '性别'
+      }, {
+        value: 2510393,
+        label: '年龄'
+      }, {
+        value: 2532512,
+        label: '意图词'
+      }],
+    };
+  },
+  created() {
+  },
+  mounted() {
+    // this.chart = echarts.init(this.$refs.chartContainer, 'macarons');
+    // this.chart.on('mouseout', this.hideTooltip);
+    // this.updateChart();
+    this.getReportData();
+    this.getTreeselect();
+    this.accountListFun();
+  },
+  watch: {
+    // dataList() {
+    //   this.updateChart();
+    // },
+    'deptId': 'currDeptChange'
+  },
+  methods: {
+    planLoad(){
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有数据?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return storeExport(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+        if (response.data != null && response.data.length > 0) {
+          this.dept.deptId = response.data[0].id;
+        }
+      });
+    },
+    currDeptChange(val) {
+      this.deptId = val;
+      this.getUserListByDeptId();
+    },
+    getUserListByDeptId() {
+      this.queryParams.userId = undefined;
+      var data = {deptId: this.deptId};
+      getUserListByDeptId(data).then(response => {
+        this.users = response.data;
+      });
+    },
+    accountListFun() {
+      listAll({userId: this.queryParams.userId}).then(e => {
+        this.accountList = e.data;
+      })
+    },
+    handleQuery() {
+      this.getReportData();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams = {
+        type: null,
+        storeId: null,
+      }
+      this.getReportData()
+    },
+    getReportData() {
+      if(!this.queryParams.id){
+        return;
+      }
+      if(!this.queryParams.time || this.queryParams.time.length < 2){
+        return;
+      }
+      this.queryParams.startDate = this.queryParams.time[0];
+      this.queryParams.endDate = this.queryParams.time[1];
+      this.loading = true;
+      getReportData(this.queryParams).then(e => {
+        this.dataList = e.data;
+        this.loading = false;
+        this.total = e.total;
+      });
+    },
+
+
+    formatter(params) {
+      const item1 = params[0].value;
+      const item2 = params[1].value;
+      const item3 = params[2].value;
+      const item4 = params[3].value;
+      return `
+              <div>
+                <div>日期:${params[0].axisValue}</div>
+                <div>加微量:${item1}</div>
+                <div>注册量:${item2}(${item2 == 0 || item1 == 0 ? "0" :((item2 / item1) * 100).toFixed(2)}%)</div>
+                <div>完课量:${item3}(${item3 == 0 || item2 == 0 ? "0" :((item3 / item2) * 100).toFixed(2)}%)</div>
+                <div>订单转化数:${item4}(${item4 == 0 || item2 == 0 ? "0" :((item4 / item2) * 100).toFixed(2)}%)</div>
+              </div>
+            `;
+    },
+
+    updateChart() {
+      const option = {
+        xAxis: {
+          type: 'category',
+          data: this.dateList,
+        },
+        yAxis: {
+          type: 'value',
+        },
+        tooltip: {
+          trigger: 'axis',
+          formatter: this.formatter,
+          axisPointer: {
+            type: "line",
+            lineStyle: {
+              color: "rgba(227, 242, 252, 0.39)",
+              width: 40,
+              type: "solid",
+            },
+            z: 0,  //注意要设置层级,不然会在覆盖在柱子前面,设置为0就在柱子后面显示了。
+          },
+        },
+        series: [
+          {
+            name: '加微量',
+            type: 'line',
+            barWidth: '40%',
+            label: {
+              show: true,
+              position: 'top',
+            },
+            data: this.dataList[0],
+          },
+          {
+            name: '注册量',
+            type: 'line',
+            barWidth: '40%',
+            label: {
+              show: true,
+              position: 'top',
+            },
+            data: this.dataList[1],
+          },
+          {
+            name: '完课量',
+            type: 'line',
+            barWidth: '40%',
+            label: {
+              show: true,
+              position: 'top',
+            },
+            data: this.dataList[2],
+          },
+          {
+            name: '下单量',
+            type: 'line',
+            barWidth: '40%',
+            label: {
+              show: true,
+              position: 'top',
+            },
+            data: this.dataList[3],
+          },
+        ],
+
+
+      };
+      this.chart.setOption(option);
+    },
+
+    hideTooltip() {
+      this.chart.dispatchAction({
+        type: 'hideTip',
+      });
+    },
+  },
+};
+</script>
+<style>
+.title {
+  padding: 20px 30px 0px 30px;
+  font-size: 18px;
+  font-weight: bold;
+  color: black;
+
+}
+
+.search-form {
+  margin: 20px 30px 0px 30px;
+}
+
+.echart-box {
+  margin: 0 auto;
+  text-align: center;
+}
+
+.el-select {
+  margin: 5px 10px;
+}
+
+.table-box {
+  margin-top: 15px;
+
+  .export {
+    float: right;
+    margin: 10px 0px;
+  }
+}
+
+.app-container {
+  border: 1px solid #e6e6e6;
+  padding: 12px;
+
+
+}
+
+.app-content {
+  background-color: white;
+
+
+}
+
+.data-box {
+  padding: 30px;
+  background-color: rgb(255, 255, 255);
+  height: 100%;
+
+
+}
+</style>

+ 442 - 0
src/views/baidu/BdAccount/index.vue

@@ -0,0 +1,442 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="账户ID" prop="accountId">
+        <el-input
+          v-model="queryParams.accountId"
+          placeholder="请输入账户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账户名称" prop="accountName">
+        <el-input
+          v-model="queryParams.accountName"
+          placeholder="请输入账户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['baidu:BdAccount:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['baidu:BdAccount:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['baidu:BdAccount:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['baidu:BdAccount:export']"
+        >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          size="mini"
+          @click="auth"
+          v-hasPermi="['baidu:BdAccount:list']"
+        >授权链接</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          size="mini"
+          :disabled="loading2"
+          @click="sync"
+          v-loading="loading2"
+          v-hasPermi="['baidu:BdAccount:list']"
+        >同步账户数据</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="BdAccountList">
+<!--      <el-table-column label="账户ID" align="center" prop="accountId" />-->
+      <el-table-column label="账户名称" align="center" prop="accountName" />
+      <el-table-column label="所属用户" align="center" prop="userName" />
+      <el-table-column label="token" align="center" prop="token" />
+      <el-table-column label="计划数量" align="center" prop="planCount" />
+      <el-table-column label="单元数量" align="center" prop="unitCount" />
+      <el-table-column label="创意数量" align="center" prop="creativeCount" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['baidu:BdAccount:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="!scope.row.loading"
+            @click="syncAccount(scope.row)"
+            v-hasPermi="['baidu:BdAccount:list']"
+          >同步账户数据</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            disabled
+            v-if="scope.row.loading"
+          >正在同步数据</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['baidu:BdAccount:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改百度账号对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="账户名称" prop="accountName">
+          <el-input v-model="form.accountName" placeholder="请输入账户名称" />
+        </el-form-item>
+        <el-form-item label="token" prop="token">
+          <el-input v-model="form.token" placeholder="请输入token" />
+        </el-form-item>
+        <el-form-item label="选择部门" prop="userId">
+          <treeselect :clearable="false" v-model="dept.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+        </el-form-item>
+        <el-form-item label="选择用户" prop="userId">
+          <el-select v-model="dept.userId"  placeholder="请选择员工">
+            <el-option
+              v-for="item in users"
+              :key="item.userId"
+              :label="item.nickName"
+              :value="item.userId">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 添加或修改百度账号对话框 -->
+    <el-dialog title="授权链接" :visible.sync="authOpen" width="500px" append-to-body>
+      <a class="a" :href="url" target="_blank">{{url}}</a>
+      <el-tooltip class="item" effect="dark" content="复制链接" placement="top">
+        <i style="margin-left: 10px;cursor: pointer;color: #1890ff" class="el-icon-copy-document" @click="copyUrl"></i>
+      </el-tooltip>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listBdAccount, getBdAccount, delBdAccount, addBdAccount, updateBdAccount, exportBdAccount, authorizationUrl, syncAccount } from "@/api/baidu/BdAccount";
+import Treeselect from "@riophae/vue-treeselect";
+import {treeselect} from "@/api/company/companyDept";
+import {getUserListByDeptId} from "@/api/company/companyUser";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "BdAccount",
+  components: {Treeselect},
+  watch: {
+// 监听deptId
+    'dept.deptId': 'currDeptChange'
+  },
+  data() {
+    return {
+      deptOptions: [],
+      // 遮罩层
+      deptId: null,
+      loading: true,
+      loading2: false,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 百度账号表格数据
+      BdAccountList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        accountId: null,
+        accountName: null,
+        userId: null,
+      },
+      users: [],
+      // 表单参数
+      form: {},
+      authOpen: false,
+      url: {},
+      dept: {
+        deptId: null,
+        userId: null,
+      },
+      // 表单校验
+      rules: {
+        accountName:[
+          { required: true, message: "账户名称不能为空", trigger: "blur" }
+        ],
+        token:[
+          { required: true, message: "账号token不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    syncAccount(row){
+      row.loading = true;
+      syncAccount(row.id).then(res => {
+        row.loading = false;
+      });
+    },
+    sync(){
+      this.loading2 = true;
+      syncAccount().then(res => {
+        this.loading2 = false;
+        this.getList()
+      });
+    },
+    copyUrl(){
+      navigator.clipboard.writeText(this.url)
+        .then(() => {
+          this.msgSuccess("复制成功");
+        }).catch(err => {
+          this.msgError("复制失败");
+        });
+    },
+    auth(){
+      authorizationUrl().then(res => {
+        this.authOpen = true;
+        this.url = res.url;
+      })
+    },
+    currDeptChange(val) {
+      console.info(val)
+      this.dept.deptId = val;
+      this.getUserListByDeptId();
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+        if (response.data != null && response.data.length > 0) {
+          this.dept.deptId = response.data[0].id;
+        }
+      });
+    },
+    /** 查询百度账号列表 */
+    getList() {
+      this.loading = true;
+      listBdAccount(this.queryParams).then(response => {
+        response.rows.forEach(row => {
+          row.loading = row.loading == 1;
+        })
+        this.BdAccountList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.dept = {
+        deptId: null,
+        userId: null,
+      }
+      this.form = {
+        id: null,
+        accountId: null,
+        deptId: null,
+        userId: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    getUserListByDeptId() {
+      this.dept.userId = undefined;
+      var data = {deptId: this.dept.deptId};
+      getUserListByDeptId(data).then(response => {
+        this.users = response.data;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加百度账号";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getBdAccount(id).then(response => {
+        this.form = response.data;
+        console.info(this.form)
+        this.currDeptChange(this.form.deptId);
+        this.dept.userId = response.data.userId;
+        this.open = true;
+        this.title = "修改百度账号";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form = {
+            ...this.form,...this.dept
+          }
+          if (this.form.id != null) {
+            updateBdAccount(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addBdAccount(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除百度账号编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delBdAccount(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有百度账号数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportBdAccount(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    }
+  }
+};
+</script>
+<style>
+.a{
+  text-decoration: underline;
+}
+.a:hover{
+  text-decoration: underline;
+}
+</style>

+ 107 - 1
src/views/company/companySms/index.vue

@@ -27,6 +27,9 @@
           @click="handleExport"
           v-hasPermi="['company:companySms:export']"
         >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" @click="rechargeSmsHandle" size="mini">充值短信</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -70,16 +73,78 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+
+    <!-- 充值短信对话框 -->
+    <el-dialog :title="recharge.title" :visible.sync="recharge.open" width="500px" append-to-body>
+      <el-form ref="buyForm" :model="recharge.form" :rules="recharge.rules" label-width="80px">
+        <el-form-item label="公司名" prop="companyId">
+          <el-select style="width: 320px" v-model="recharge.form.companyId" placeholder="请选择公司" clearable size="small">
+            <el-option
+              v-for="item in companys"
+              :key="item.companyId"
+              :label="item.companyName"
+              :value="item.companyId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="短信套餐" prop="packageId">
+          <el-select style="width: 320px" v-model="recharge.form.packageId" placeholder="请选择公司" clearable size="small">
+            <el-option
+              v-for="item in recharge.allCompanySmsData"
+              :key="item.packageId"
+              :label="item.title"
+              :value="item.packageId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitBuyForm" :disabled="recharge.btnDisable">确 定</el-button>
+        <el-button @click="rechargeCancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listCompanySms, getCompanySms, delCompanySms, addCompanySms, updateCompanySms, exportCompanySms } from "@/api/company/companySms";
+import {
+  listCompanySms,
+  getCompanySms,
+  delCompanySms,
+  addCompanySms,
+  updateCompanySms,
+  exportCompanySms,
+  buySms
+} from "@/api/company/companySms";
 import { getCompanyList } from "@/api/company/company";
+import {listCompanySmsPackageAll} from "@/api/company/companySmsPackage";
 export default {
   name: "CompanySms",
   data() {
     return {
+      recharge: {
+        btnDisable:false,
+        title: '充值短信',
+        open: false,
+        allCompanySmsData:[],
+        form: {
+          companyId: null,
+          packageId: null
+        },
+        rules: {
+          companyId: [{
+            required: true,
+            message: '请选择公司',
+            trigger: 'blur'
+          }],
+          packageId: [{
+            required: true,
+            message: '请选择公司',
+            trigger: 'blur'
+          }]
+        }
+      },
       companys:[],
       // 遮罩层
       loading: true,
@@ -120,8 +185,19 @@ export default {
 
     });
     this.getList();
+    listCompanySmsPackageAll().then(response => {
+      this.recharge.allCompanySmsData = response.data;
+    });
   },
   methods: {
+    rechargeSmsHandle(scope){
+      this.recharge.open = true;
+      this.recharge.form = {
+        companyId: null,
+        packageId: null
+      };
+      this.resetForm("buyForm");
+    },
     /** 查询公司短信列表 */
     getList() {
       this.loading = true;
@@ -136,6 +212,14 @@ export default {
       this.open = false;
       this.reset();
     },
+    rechargeCancel(){
+      this.recharge.open = false;
+      this.recharge.form = {
+        companyId: null,
+        packageId: null
+      };
+      this.resetForm("buyForm");
+    },
     // 表单重置
     reset() {
       this.form = {
@@ -178,6 +262,28 @@ export default {
         this.title = "修改公司短信";
       });
     },
+    submitBuyForm(){
+
+      this.$refs["buyForm"].validate(valid => {
+        if (valid) {
+          this.recharge.btnDisable = true;
+          buySms(this.recharge.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("充值成功!");
+              this.recharge.open = false;
+              this.getList();
+            }
+          }).catch(e=>{
+            this.recharge.open = false;
+          })
+            .finally(() => {
+            setTimeout(()=>{
+              this.recharge.btnDisable = false;
+            },2000)
+          });
+        }
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {

+ 62 - 29
src/views/company/companyVoice/index.vue

@@ -19,6 +19,13 @@
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['company:companyVoice:add']"
+        >充值</el-button>
         <el-button
           type="warning"
           icon="el-icon-download"
@@ -50,18 +57,35 @@
     <!-- 添加或修改企业通话对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="公司ID" prop="companyId">
-          <el-input v-model="form.companyId" placeholder="请输入公司ID" />
-        </el-form-item>
-        <el-form-item label="剩余时长 分" prop="times">
-          <el-input v-model="form.times" placeholder="请输入剩余时长 分" />
+        <el-form-item label="公司" prop="companyId">
+          <el-select style="width: 320px" v-model="form.companyId" placeholder="请选择公司" clearable size="small">
+            <el-option
+              v-for="item in companys"
+              :key="item.companyId"
+              :label="item.companyName"
+              :value="item.companyId"
+            />
+          </el-select>
         </el-form-item>
-        <el-form-item label="累计时长 分" prop="totalTimes">
-          <el-input v-model="form.totalTimes" placeholder="请输入累计时长 分" />
+        <el-form-item label="通话套餐" prop="packageId">
+          <el-select style="width: 320px" v-model="form.packageId" placeholder="请选择套餐" clearable size="small">
+            <el-option
+              v-for="item in allVoicePackageData"
+              :key="item.packageId"
+              :label="item.packageName"
+              :value="item.packageId"
+            />
+          </el-select>
         </el-form-item>
+<!--        <el-form-item label="剩余时长 分" prop="times">-->
+<!--          <el-input v-model="form.times" placeholder="请输入剩余时长 分" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="累计时长 分" prop="totalTimes">-->
+<!--          <el-input v-model="form.totalTimes" placeholder="请输入累计时长 分" />-->
+<!--        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="buyBtnDisable">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -69,7 +93,14 @@
 </template>
 
 <script>
-import { listCompanyVoice, getCompanyVoice, delCompanyVoice, addCompanyVoice, updateCompanyVoice, exportCompanyVoice } from "@/api/company/companyVoice";
+import {
+  listCompanyVoice,
+  getCompanyVoice,
+  updateCompanyVoice,
+  exportCompanyVoice,
+  companyBuyVoice
+} from "@/api/company/companyVoice";
+import {listAllCompanyVoicePackage} from "@/api/company/companyVoicePackage";
 import { getCompanyList } from "@/api/company/company";
 export default {
   name: "CompanyVoice",
@@ -86,10 +117,12 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
+      buyBtnDisable: false,
       // 总条数
       total: 0,
       // 企业通话表格数据
       companyVoiceList: [],
+      allVoicePackageData: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -115,6 +148,9 @@ export default {
       this.companys = response.data;
 
     });
+    listAllCompanyVoicePackage({status:1}).then(response => {
+      this.allVoicePackageData = response.data;
+    });
   },
   methods: {
     /** 查询企业通话列表 */
@@ -134,10 +170,8 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        voiceId: null,
         companyId: null,
-        times: null,
-        totalTimes: null
+        packageId: null
       };
       this.resetForm("form");
     },
@@ -177,23 +211,22 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.voiceId != null) {
-            updateCompanyVoice(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addCompanyVoice(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          }
+          this.buyBtnDisable = true
+          companyBuyVoice(this.form).then(response=>{
+            if (response.code === 200) {
+              this.msgSuccess("充值成功");
+              this.open = false;
+              this.getList();
+            }
+          }).catch(err=>{
+            this.msgError(err.message)
+            this.open = false
+          }).finally(()=>{
+            this.reset();
+            setTimeout(()=>{
+              this.buyBtnDisable = false
+            },1000)
+          })
         }
       });
     },

+ 304 - 0
src/views/qw/workLink/index.vue

@@ -0,0 +1,304 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="获客链接名称" prop="linkName">
+        <el-input
+          v-model="queryParams.linkName"
+          placeholder="请输入名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['qw:workLink:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['qw:workLink:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['qw:workLink:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['qw:workLink:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="workLinkList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="链接名称" align="center" prop="linkName" />
+      <el-table-column label="链接地址" align="center" prop="url" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['qw:workLink:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['qw:workLink:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改企微获客链接管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+<!--        <el-form-item label="企微用户" prop="userIds">-->
+<!--          <el-select v-model="form.userIds" style="width: 100%" multiple>-->
+<!--            <el-option v-for="item in qwUserList" :label="item.dictLabel" :value="Number(item.dictValue)" />-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+        <el-form-item label="名称" prop="linkName">
+          <el-input v-model="form.linkName" placeholder="请输入获客链接名称" />
+        </el-form-item>
+        <el-form-item label="获客链接" prop="url">
+          <el-input v-model="form.url" placeholder="请输入获客链接" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" :row="2" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listWorkLink, getWorkLink, delWorkLink, addWorkLink, updateWorkLink, exportWorkLink } from "@/api/qw/workLink";
+import { getQwUserAll } from "@/api/qw/qwUser";
+import qwUserSelect from "@/views/components/QwUserSelect.vue";
+
+export default {
+  name: "WorkLink",
+  computed: {
+    qwUserSelect() {
+      return qwUserSelect
+    }
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      qwUserList: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 企微获客链接管理表格数据
+      workLinkList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        linkName: null,
+        linkId: null,
+        url: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        // userIds:[
+        //   { required: true, message: "企微用户不能为空", trigger: "blur" }
+        // ],
+        url:[
+          { required: true, message: "获客链接不能为空", trigger: "blur" }
+        ],
+        linkName:[
+          { required: true, message: "名称不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    getQwUserAll().then(e => {
+      this.qwUserList = e.data;
+    })
+  },
+  methods: {
+    /** 查询企微获客链接管理列表 */
+    getList() {
+      this.loading = true;
+      listWorkLink(this.queryParams).then(response => {
+        this.workLinkList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        linkName: null,
+        linkId: null,
+        url: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加企微获客链接管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getWorkLink(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改企微获客链接管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateWorkLink(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addWorkLink(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除企微获客链接管理编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delWorkLink(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有企微获客链接管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportWorkLink(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 301 - 0
src/views/qw/workLinkUser/index.vue

@@ -0,0 +1,301 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="链接ID" prop="linkId">
+        <el-input
+          v-model="queryParams.linkId"
+          placeholder="请输入链接ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="企微表ID" prop="qwUserId">
+        <el-input
+          v-model="queryParams.qwUserId"
+          placeholder="请输入企微表ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="企微微信用户ID" prop="qwUserWxId">
+        <el-input
+          v-model="queryParams.qwUserWxId"
+          placeholder="请输入企微微信用户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['qw:workLinkUser:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['qw:workLinkUser:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['qw:workLinkUser:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['qw:workLinkUser:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="workLinkUserList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="链接ID" align="center" prop="linkId" />
+      <el-table-column label="企微表ID" align="center" prop="qwUserId" />
+      <el-table-column label="企微微信用户ID" align="center" prop="qwUserWxId" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['qw:workLinkUser:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['qw:workLinkUser:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改企微获客链接用户关联对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="链接ID" prop="linkId">
+          <el-input v-model="form.linkId" placeholder="请输入链接ID" />
+        </el-form-item>
+        <el-form-item label="企微表ID" prop="qwUserId">
+          <el-input v-model="form.qwUserId" placeholder="请输入企微表ID" />
+        </el-form-item>
+        <el-form-item label="企微微信用户ID" prop="qwUserWxId">
+          <el-input v-model="form.qwUserWxId" placeholder="请输入企微微信用户ID" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listWorkLinkUser, getWorkLinkUser, delWorkLinkUser, addWorkLinkUser, updateWorkLinkUser, exportWorkLinkUser } from "@/api/qw/workLinkUser";
+
+export default {
+  name: "WorkLinkUser",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 企微获客链接用户关联表格数据
+      workLinkUserList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        linkId: null,
+        qwUserId: null,
+        qwUserWxId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询企微获客链接用户关联列表 */
+    getList() {
+      this.loading = true;
+      listWorkLinkUser(this.queryParams).then(response => {
+        this.workLinkUserList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        linkId: null,
+        qwUserId: null,
+        qwUserWxId: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加企微获客链接用户关联";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getWorkLinkUser(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改企微获客链接用户关联";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateWorkLinkUser(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addWorkLinkUser(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除企微获客链接用户关联编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delWorkLinkUser(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有企微获客链接用户关联数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportWorkLinkUser(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 329 - 0
src/views/qw/workUser/index.vue

@@ -0,0 +1,329 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="链接ID" prop="linkId">
+        <el-input
+          v-model="queryParams.linkId"
+          placeholder="请输入链接ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户external_userid" prop="externalUserid">
+        <el-input
+          v-model="queryParams.externalUserid"
+          placeholder="请输入客户external_userid"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="跟进人userid" prop="userid">
+        <el-input
+          v-model="queryParams.userid"
+          placeholder="请输入跟进人userid"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="会话状态,0-客户未发消息 1-客户已发送消息 2-客户发送消息状态未知" prop="chatStatus">
+        <el-select v-model="queryParams.chatStatus" placeholder="请选择会话状态,0-客户未发消息 1-客户已发送消息 2-客户发送消息状态未知" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="额外参数" prop="state">
+        <el-input
+          v-model="queryParams.state"
+          placeholder="请输入额外参数"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['qw:workUser:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['qw:workUser:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['qw:workUser:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['qw:workUser:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="workUserList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="链接ID" align="center" prop="linkId" />
+      <el-table-column label="客户external_userid" align="center" prop="externalUserid" />
+      <el-table-column label="跟进人userid" align="center" prop="userid" />
+      <el-table-column label="会话状态,0-客户未发消息 1-客户已发送消息 2-客户发送消息状态未知" align="center" prop="chatStatus" />
+      <el-table-column label="额外参数" align="center" prop="state" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['qw:workUser:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['qw:workUser:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改企微获客添加的用户对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="链接ID" prop="linkId">
+          <el-input v-model="form.linkId" placeholder="请输入链接ID" />
+        </el-form-item>
+        <el-form-item label="客户external_userid" prop="externalUserid">
+          <el-input v-model="form.externalUserid" placeholder="请输入客户external_userid" />
+        </el-form-item>
+        <el-form-item label="跟进人userid" prop="userid">
+          <el-input v-model="form.userid" placeholder="请输入跟进人userid" />
+        </el-form-item>
+        <el-form-item label="会话状态,0-客户未发消息 1-客户已发送消息 2-客户发送消息状态未知">
+          <el-radio-group v-model="form.chatStatus">
+            <el-radio label="1">请选择字典生成</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="额外参数" prop="state">
+          <el-input v-model="form.state" placeholder="请输入额外参数" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listWorkUser, getWorkUser, delWorkUser, addWorkUser, updateWorkUser, exportWorkUser } from "@/api/qw/workUser";
+
+export default {
+  name: "WorkUser",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 企微获客添加的用户表格数据
+      workUserList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        linkId: null,
+        externalUserid: null,
+        userid: null,
+        chatStatus: null,
+        state: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询企微获客添加的用户列表 */
+    getList() {
+      this.loading = true;
+      listWorkUser(this.queryParams).then(response => {
+        this.workUserList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        linkId: null,
+        externalUserid: null,
+        userid: null,
+        chatStatus: "0",
+        state: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加企微获客添加的用户";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getWorkUser(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改企微获客添加的用户";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateWorkUser(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addWorkUser(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除企微获客添加的用户编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delWorkUser(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有企微获客添加的用户数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportWorkUser(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>