zhuxinbo пре 5 година
родитељ
комит
61ce468114

+ 19 - 0
src/api/appium.js

@@ -0,0 +1,19 @@
+import {axios} from '@/utils/request'
+
+// 群控管理,任务列表
+export function appiumTaskList(parameter) {
+    return axios({
+      url: "/appium/appiumTask/list",
+      method: 'get',
+      data: parameter
+    })
+}
+
+// 群控管理,任务项列表
+export function appiumTaskItemList(parameter) {
+    return axios({
+      url: "/appium/appiumTaskItem/list",
+      method: 'get',
+      data: parameter
+    })
+}

+ 10 - 1
src/api/statistics.js

@@ -54,7 +54,7 @@ export function getKuaiShouChainRatio(parameter) {
 
 // /materialReport/getMaterialAccount
 // userId:
-// 分账户
+// 查看当前账户下绑定账号
 export function getMaterialAccount(parameter) {
     return axios({
       url: "/materialReport/getMaterialAccount",
@@ -73,4 +73,13 @@ export function getMaterialReportByAccount(parameter) {
       method: 'post',
       data: parameter
     })
+}
+
+//  /MaterialRefuse/getRefuseCreative
+export function getRefuseCreative(parameter) {
+    return axios({
+      url: "/MaterialRefuse/getRefuseCreative",
+      method: 'post',
+      data: parameter
+    })
 }

+ 372 - 295
src/mixins/JeecgListMixin.js

@@ -1,296 +1,373 @@
-/**
- * 新增修改完成调用 modalFormOk方法 编辑弹框组件ref定义为modalForm
- * 高级查询按钮调用 superQuery方法  高级查询组件ref定义为superQueryModal
- * data中url定义 list为查询列表  delete为删除单条记录  deleteBatch为批量删除
- */
-import {filterObj} from '@/utils/util';
-import {deleteAction, getAction, downFile} from '@/api/manage'
-import Vue from 'vue'
-import {ACCESS_TOKEN} from "@/store/mutation-types"
-
-export const JeecgListMixin = {
-  data() {
-    return {
-      //token header
-      tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
-      /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
-      queryParam: {},
-      /* 数据源 */
-      dataSource: [],
-      /* 分页参数 */
-      ipagination: {
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '20', '30'],
-        showTotal: (total, range) => {
-          return range[0] + "-" + range[1] + " 共" + total + "条"
-        },
-        showQuickJumper: true,
-        showSizeChanger: true,
-        total: 0
-      },
-      /* 排序参数 */
-      isorter: {
-        column: 'createTime',
-        order: 'desc',
-      },
-      /* 筛选参数 */
-      filters: {},
-      /* table加载状态 */
-      loading: false,
-      /* table选中keys*/
-      selectedRowKeys: [],
-      /* table选中records*/
-      selectionRows: [],
-      /* 查询折叠 */
-      toggleSearchStatus: false,
-      /* 高级查询条件生效状态 */
-      superQueryFlag: false,
-      /* 高级查询条件 */
-      superQueryParams: ""
-    }
-  },
-  created() {
-    this.loadData();
-    //初始化字典配置 在自己页面定义
-    this.initDictConfig();
-  },
-  methods: {
-    loadData(arg) {
-      if (!this.url.list) {
-        this.$message.error("请设置url.list属性!")
-        return
-      }
-      //加载数据 若传入参数1则加载第一页的内容
-      if (arg === 1) {
-        this.ipagination.current = 1;
-      }
-      var params = this.getQueryParams();//查询条件
-      this.loading = true;
-      getAction(this.url.list, params).then((res) => {
-        if (res.success) {
-          this.dataSource = res.result.records;
-          this.ipagination.total = res.result.total;
-        }
-        if (res.code === 510) {
-          this.$message.warning(res.message)
-        }
-        this.loading = false;
-      })
-    },
-    initDictConfig() {
-      console.log("--这是一个假的方法!")
-    },
-    handleSuperQuery(arg) {
-      //高级查询方法
-      if (!arg) {
-        this.superQueryParams = ''
-        this.superQueryFlag = false
-      } else {
-        this.superQueryFlag = true
-        this.superQueryParams = JSON.stringify(arg)
-      }
-      this.loadData()
-    },
-    getQueryParams() {
-      //获取查询条件
-      let sqp = {}
-      if (this.superQueryParams) {
-        sqp['superQueryParams'] = encodeURI(this.superQueryParams)
-      }
-      var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
-      param.field = this.getQueryField();
-      param.pageNo = this.ipagination.current;
-      param.pageSize = this.ipagination.pageSize;
-      return filterObj(param);
-    },
-    getQueryField() {
-      //TODO 字段权限控制
-      var str = "id,";
-      this.columns.forEach(function (value) {
-        str += "," + value.dataIndex;
-      });
-      return str;
-    },
-
-    onSelectChange(selectedRowKeys, selectionRows) {
-      this.selectedRowKeys = selectedRowKeys;
-      this.selectionRows = selectionRows;
-    },
-    onClearSelected() {
-      this.selectedRowKeys = [];
-      this.selectionRows = [];
-    },
-    searchQuery() {
-      this.loadData(1);
-    },
-    superQuery() {
-      this.$refs.superQueryModal.show();
-    },
-    searchReset() {
-      this.queryParam = {}
-      this.loadData(1);
-    },
-    batchDel: function () {
-      if (!this.url.deleteBatch) {
-        this.$message.error("请设置url.deleteBatch属性!")
-        return
-      }
-      if (this.selectedRowKeys.length <= 0) {
-        this.$message.warning('请选择一条记录!');
-        return;
-      } else {
-        var ids = "";
-        for (var a = 0; a < this.selectedRowKeys.length; a++) {
-          ids += this.selectedRowKeys[a] + ",";
-        }
-        var that = this;
-        this.$confirm({
-          title: "确认删除",
-          content: "是否删除选中数据?",
-          onOk: function () {
-            deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
-              if (res.success) {
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              } else {
-                that.$message.warning(res.message);
-              }
-            });
-          }
-        });
-      }
-    },
-    handleDelete: function (id) {
-      if (!this.url.delete) {
-        this.$message.error("请设置url.delete属性!")
-        return
-      }
-      var that = this;
-      deleteAction(that.url.delete, {id: id}).then((res) => {
-        if (res.success) {
-          that.$message.success(res.message);
-          that.loadData();
-        } else {
-          that.$message.warning(res.message);
-        }
-      });
-    },
-    handleEdit: function (record,sign) {
-      this.$refs.modalForm.edit(record,sign);
-      this.$refs.modalForm.title = "编辑";
-      this.$refs.modalForm.disableSubmit = false;
-      if(sign == 'preview'){
-        this.$refs.modalForm.title = "预览";
-      }
-    },
-    handleImagePreview: function (record) {
-        this.$refs.modalForm.imagePreview(record);
-        this.$refs.modalForm.title = "预览";
-        this.$refs.modalForm.disableSubmit = false;
-    },
-    handleAdd: function (sign) {
-      this.$refs.modalForm.add(sign);
-      this.$refs.modalForm.title = "新增";
-      this.$refs.modalForm.disableSubmit = false;
-    },
-    handleOpen: function () {
-      this.$refs.userForm.open();
-      this.$refs.userForm.title = "选择";
-      this.$refs.userForm.disableSubmit = false;
-    },
-    handleTableChange(pagination, filters, sorter) {
-      //分页、排序、筛选变化时触发
-      //TODO 筛选
-      if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
-      }
-      this.ipagination = pagination;
-      this.loadData();
-    },
-    handleToggleSearch() {
-      this.toggleSearchStatus = !this.toggleSearchStatus;
-    },
-    modalFormOk() {
-      // 新增/修改 成功时,重载列表
-      this.loadData();
-    },
-    handleDetail: function (record) {
-      this.$refs.modalForm.edit(record);
-      this.$refs.modalForm.title = "详情";
-      this.$refs.modalForm.disableSubmit = true;
-    },
-    /* 导出 */
-    handleExportXls2() {
-      let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
-      let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
-      window.location.href = url;
-    },
-    handleExportXls(fileName) {
-      if (!fileName || typeof fileName != "string") {
-        fileName = "导出文件"
-      }
-      let param = {...this.queryParam};
-      if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
-        param['selections'] = this.selectedRowKeys.join(",")
-      }
-      console.log("导出参数", param)
-      downFile(this.url.exportXlsUrl, param).then((data) => {
-        if (!data) {
-          this.$message.warning("文件下载失败")
-          return
-        }
-        if (typeof window.navigator.msSaveBlob !== 'undefined') {
-          window.navigator.msSaveBlob(new Blob([data]), fileName + '.xls')
-        } else {
-          let url = window.URL.createObjectURL(new Blob([data]))
-          let link = document.createElement('a')
-          link.style.display = 'none'
-          link.href = url
-          link.setAttribute('download', fileName + '.xls')
-          document.body.appendChild(link)
-          link.click()
-          document.body.removeChild(link); //下载完成移除元素
-          window.URL.revokeObjectURL(url); //释放掉blob对象
-        }
-      })
-    },
-    /* 导入 */
-    handleImportExcel(info) {
-      if (info.file.status !== 'uploading') {
-        console.log(info.file, info.fileList);
-      }
-      if (info.file.status === 'done') {
-        if (info.file.response.success) {
-          this.$message.success(`${info.file.name} 文件上传成功`);
-          this.loadData();
-        } else {
-          this.$message.error(`${info.file.name} ${info.file.response.message}.`);
-        }
-      } else if (info.file.status === 'error') {
-        this.$message.error(`文件上传失败: ${info.file.msg} `);
-      }
-    },
-    /* 图片预览 */
-    getImgView(text) {
-      if (text && text.indexOf(",") > 0) {
-        text = text.substring(0, text.indexOf(","))
-      }
-      return window._CONFIG['imgDomainURL'] + "/" + text
-    },
-    /* 文件下载 */
-    uploadFile(text) {
-      if (!text) {
-        this.$message.warning("未知的文件")
-        return;
-      }
-      if (text.indexOf(",") > 0) {
-        text = text.substring(0, text.indexOf(","))
-      }
-      window.open(window._CONFIG['domianURL'] + "/sys/common/download/" + text);
-    },
-  }
-
+/**
+ * 新增修改完成调用 modalFormOk方法 编辑弹框组件ref定义为modalForm
+ * 高级查询按钮调用 superQuery方法  高级查询组件ref定义为superQueryModal
+ * data中url定义 list为查询列表  delete为删除单条记录  deleteBatch为批量删除
+ */
+import {filterObj} from '@/utils/util';
+import {deleteAction, getAction, downFile} from '@/api/manage'
+import Vue from 'vue'
+import {ACCESS_TOKEN} from "@/store/mutation-types"
+import { transformTozTreeFormat } from '@/utils/util.js'
+export const JeecgListMixin = {
+  data() {
+    return {
+      //token header
+      tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
+      /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
+      queryParam: {},
+      /* 数据源 */
+      dataSource: [],
+      innerData:[],
+      /* 分页参数 */
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 共" + total + "条"
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      /* 排序参数 */
+      isorter: {
+        column: 'createTime',
+        order: 'desc',
+      },
+      /* 筛选参数 */
+      filters: {},
+      /* table加载状态 */
+      loading: false,
+      /* table选中keys*/
+      selectedRowKeys: [],
+      /* table选中records*/
+      selectionRows: [],
+      /* 查询折叠 */
+      toggleSearchStatus: false,
+      /* 高级查询条件生效状态 */
+      superQueryFlag: false,
+      /* 高级查询条件 */
+      superQueryParams: ""
+    }
+  },
+  created() {
+    this.loadData();
+    //初始化字典配置 在自己页面定义
+    this.initDictConfig();
+  },
+  methods: {
+    expand(expanded,record){
+        console.log(expanded,record)
+        // if(this.url.listTwo){
+        //     var param = {}
+        //     param.field = this.getQueryField();
+        //     param.pageNo = this.ipagination.current;
+        //     param.pageSize = this.ipagination.pageSize;
+        //     param.parentId = record.id
+        //     if(expanded){
+        //         getAction(this.url.listTwo, filterObj(param)).then((res) => {
+        //             if (res.success) {
+        //                 record.innerData.push(...res.result.records)
+        //                 console.log(record.innerData)
+        //                 this.$forceUpdate();
+        //             }
+        //             if (res.code === 510) {
+        //               this.$message.warning(res.message)
+        //             }
+        //             this.loading = false;
+        //         })
+        //     }else{
+        //         record.innerData = []
+        //     }
+            
+        // }
+    },
+    async getCdata(id){
+        var param = {}
+        param.field = this.getQueryField();
+        param.pageNo = this.ipagination.current;
+        param.pageSize = this.ipagination.pageSize;
+        param.parentId = id
+        let data = await getAction(this.url.listTwo, filterObj(param)).then((res) => {
+            if (res.success) {
+                return res.result.records
+            }
+            if (res.code === 510) {
+             return []
+            }
+        })
+        console.log(data,"ceshi")
+        return data
+    },
+    async loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error("请设置url.list属性!")
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1;
+      }
+      var params = this.getQueryParams();//查询条件
+      this.loading = true;
+      await getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+            if(this.url.listTwo){
+                var param = {}
+                param.field = this.getQueryField();
+                param.pageNo = this.ipagination.current;
+                param.pageSize = this.ipagination.pageSize;
+                // param.parentId = res.id
+                getAction(this.url.listTwo, params).then((item) => {
+                    if (item.success) {
+                        var data = item.result.records.map((s,index)=>{
+                            return {
+                                ...s,
+                                key:index
+                            }
+                        })
+                        var newData = res.result.records.concat(data)
+                        newData = transformTozTreeFormat(newData)
+                        console.log(newData)
+                        this.dataSource = newData.filter(v=>{
+                            return v.childrens
+                        })
+                    }else{
+                        this.dataSource = res.result.records
+                        this.ipagination.total = res.result.total;
+                    }
+                    
+                })
+                
+            }else{
+                this.dataSource = res.result.records
+                this.ipagination.total = res.result.total;
+            }
+            
+            
+          console.log(this.dataSource,12312321312)
+        }
+        if (res.code === 510) {
+          this.$message.warning(res.message)
+        }
+        this.loading = false;
+      })
+    },
+    initDictConfig() {
+      console.log("--这是一个假的方法!")
+    },
+    handleSuperQuery(arg) {
+      //高级查询方法
+      if (!arg) {
+        this.superQueryParams = ''
+        this.superQueryFlag = false
+      } else {
+        this.superQueryFlag = true
+        this.superQueryParams = JSON.stringify(arg)
+      }
+      this.loadData()
+    },
+    getQueryParams() {
+      //获取查询条件
+      let sqp = {}
+      if (this.superQueryParams) {
+        sqp['superQueryParams'] = encodeURI(this.superQueryParams)
+      }
+      var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
+      param.field = this.getQueryField();
+      param.pageNo = this.ipagination.current;
+      param.pageSize = this.ipagination.pageSize;
+      return filterObj(param);
+    },
+    getQueryField() {
+      //TODO 字段权限控制
+      var str = "id,";
+      this.columns.forEach(function (value) {
+        str += "," + value.dataIndex;
+      });
+      return str;
+    },
+
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys;
+      this.selectionRows = selectionRows;
+    },
+    onClearSelected() {
+      this.selectedRowKeys = [];
+      this.selectionRows = [];
+    },
+    searchQuery() {
+      this.loadData(1);
+    },
+    superQuery() {
+      this.$refs.superQueryModal.show();
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1);
+    },
+    batchDel: function () {
+      if (!this.url.deleteBatch) {
+        this.$message.error("请设置url.deleteBatch属性!")
+        return
+      }
+      if (this.selectedRowKeys.length <= 0) {
+        this.$message.warning('请选择一条记录!');
+        return;
+      } else {
+        var ids = "";
+        for (var a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ",";
+        }
+        var that = this;
+        this.$confirm({
+          title: "确认删除",
+          content: "是否删除选中数据?",
+          onOk: function () {
+            deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.loadData();
+                that.onClearSelected();
+              } else {
+                that.$message.warning(res.message);
+              }
+            });
+          }
+        });
+      }
+    },
+    handleDelete: function (id) {
+      if (!this.url.delete) {
+        this.$message.error("请设置url.delete属性!")
+        return
+      }
+      var that = this;
+      deleteAction(that.url.delete, {id: id}).then((res) => {
+        if (res.success) {
+          that.$message.success(res.message);
+          that.loadData();
+        } else {
+          that.$message.warning(res.message);
+        }
+      });
+    },
+    handleEdit: function (record,sign) {
+        console.log(record,sign)
+      this.$refs.modalForm.edit(record,sign);
+      this.$refs.modalForm.title = "编辑";
+      this.$refs.modalForm.disableSubmit = false;
+      if(sign == 'preview'){
+        this.$refs.modalForm.title = "预览";
+      }
+    },
+    handleImagePreview: function (record) {
+        this.$refs.modalForm.imagePreview(record);
+        this.$refs.modalForm.title = "预览";
+        this.$refs.modalForm.disableSubmit = false;
+    },
+    handleAdd: function (sign) {
+      this.$refs.modalForm.add(sign);
+      this.$refs.modalForm.title = "新增";
+      this.$refs.modalForm.disableSubmit = false;
+    },
+    handleOpen: function () {
+      this.$refs.userForm.open();
+      this.$refs.userForm.title = "选择";
+      this.$refs.userForm.disableSubmit = false;
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //分页、排序、筛选变化时触发
+      //TODO 筛选
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field;
+        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+      }
+      this.ipagination = pagination;
+      this.loadData();
+    },
+    handleToggleSearch() {
+      this.toggleSearchStatus = !this.toggleSearchStatus;
+    },
+    modalFormOk() {
+      // 新增/修改 成功时,重载列表
+      this.loadData();
+    },
+    handleDetail: function (record) {
+      this.$refs.modalForm.edit(record);
+      this.$refs.modalForm.title = "详情";
+      this.$refs.modalForm.disableSubmit = true;
+    },
+    /* 导出 */
+    handleExportXls2() {
+      let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
+      let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
+      window.location.href = url;
+    },
+    handleExportXls(fileName) {
+      if (!fileName || typeof fileName != "string") {
+        fileName = "导出文件"
+      }
+      let param = {...this.queryParam};
+      if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
+        param['selections'] = this.selectedRowKeys.join(",")
+      }
+      console.log("导出参数", param)
+      downFile(this.url.exportXlsUrl, param).then((data) => {
+        if (!data) {
+          this.$message.warning("文件下载失败")
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data]), fileName + '.xls')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data]))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName + '.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link); //下载完成移除元素
+          window.URL.revokeObjectURL(url); //释放掉blob对象
+        }
+      })
+    },
+    /* 导入 */
+    handleImportExcel(info) {
+      if (info.file.status !== 'uploading') {
+        console.log(info.file, info.fileList);
+      }
+      if (info.file.status === 'done') {
+        if (info.file.response.success) {
+          this.$message.success(`${info.file.name} 文件上传成功`);
+          this.loadData();
+        } else {
+          this.$message.error(`${info.file.name} ${info.file.response.message}.`);
+        }
+      } else if (info.file.status === 'error') {
+        this.$message.error(`文件上传失败: ${info.file.msg} `);
+      }
+    },
+    /* 图片预览 */
+    getImgView(text) {
+      if (text && text.indexOf(",") > 0) {
+        text = text.substring(0, text.indexOf(","))
+      }
+      return window._CONFIG['imgDomainURL'] + "/" + text
+    },
+    /* 文件下载 */
+    uploadFile(text) {
+      if (!text) {
+        this.$message.warning("未知的文件")
+        return;
+      }
+      if (text.indexOf(",") > 0) {
+        text = text.substring(0, text.indexOf(","))
+      }
+      window.open(window._CONFIG['domianURL'] + "/sys/common/download/" + text);
+    },
+  }
+
 }

+ 276 - 235
src/utils/util.js

@@ -1,235 +1,276 @@
-import {isURL} from '@/utils/validate'
-
-export function timeFix() {
-  const time = new Date()
-  const hour = time.getHours()
-  return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好')))
-}
-
-export function welcome() {
-  const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
-  let index = Math.floor((Math.random() * arr.length))
-  return arr[index]
-}
-
-/**
- * 触发 window.resize
- */
-export function triggerWindowResizeEvent() {
-  let event = document.createEvent('HTMLEvents')
-  event.initEvent('resize', true, true)
-  event.eventType = 'message'
-  window.dispatchEvent(event)
-}
-
-/**
- * 过滤对象中为空的属性
- * @param obj
- * @returns {*}
- */
-export function filterObj(obj) {
-  if (!(typeof obj == 'object')) {
-    return;
-  }
-
-  for (var key in obj) {
-    if (obj.hasOwnProperty(key)
-      && (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
-      delete obj[key];
-    }
-  }
-  return obj;
-}
-
-/**
- * 时间格式化
- * @param value
- * @param fmt
- * @returns {*}
- */
-export function formatDate(value, fmt) {
-  var regPos = /^\d+(\.\d+)?$/;
-  if (regPos.test(value)) {
-    //如果是数字
-    let getDate = new Date(value);
-    let o = {
-      'M+': getDate.getMonth() + 1,
-      'd+': getDate.getDate(),
-      'h+': getDate.getHours(),
-      'm+': getDate.getMinutes(),
-      's+': getDate.getSeconds(),
-      'q+': Math.floor((getDate.getMonth() + 3) / 3),
-      'S': getDate.getMilliseconds()
-    };
-    if (/(y+)/.test(fmt)) {
-      fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length))
-    }
-    for (let k in o) {
-      if (new RegExp('(' + k + ')').test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-      }
-    }
-    return fmt;
-  } else {
-    //TODO
-    value = value.trim();
-    return value.substr(0, fmt.length);
-  }
-}
-
-// 生成首页路由
-export function generateIndexRouter(data) {
-  let indexRouter = [{
-    path: '/',
-    name: 'dashboard',
-    //component: () => import('@/components/layouts/BasicLayout'),
-    component: resolve => require(['@/components/layouts/TabLayout'], resolve),
-    meta: {title: '首页'},
-    redirect: '/dashboard/analysis',
-    children: [
-      ...generateChildRouters(data)
-    ]
-  }, {
-    "path": "*", "redirect": "/404", "hidden": true
-  }]
-  return indexRouter;
-}
-
-// 生成嵌套路由(子路由)
-
-function generateChildRouters(data) {
-  const routers = [];
-  for (var item of data) {
-    let component = "";
-    if (item.component.indexOf("layouts") >= 0) {
-      component = "components/" + item.component;
-    } else {
-      component = "views/" + item.component;
-    }
-
-    // eslint-disable-next-line
-    let URL = (item.meta.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
-    if (isURL(URL)) {
-      item.meta.url = URL;
-    }
-
-    let menu = {
-      path: item.path,
-      name: item.name,
-      redirect: item.redirect,
-      component: resolve => require(['@/' + component + '.vue'], resolve),
-      hidden: item.hidden,
-      //component:()=> import(`@/views/${item.component}.vue`),
-      meta: {
-        title: item.meta.title,
-        icon: item.meta.icon,
-        url: item.meta.url,
-        permissionList: item.meta.permissionList,
-        keepAlive: item.meta.keepAlive
-      }
-    }
-    if (item.alwaysShow) {
-      menu.alwaysShow = true;
-      menu.redirect = menu.path;
-    }
-    if (item.children && item.children.length > 0) {
-      menu.children = [...generateChildRouters(item.children)];
-    }
-    //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
-    //判断是否生成路由
-    if (item.route && item.route === '0') {
-      //console.log(' 不生成路由 item.route:  '+item.route);
-      //console.log(' 不生成路由 item.path:  '+item.path);
-    } else {
-      routers.push(menu);
-    }
-    //--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
-  }
-  return routers
-}
-
-/**
- * 深度克隆对象、数组
- * @param obj 被克隆的对象
- * @return 克隆后的对象
- */
-export function cloneObject(obj) {
-  return JSON.parse(JSON.stringify(obj))
-}
-
-/**
- * 随机生成数字
- *
- * 示例:生成长度为 12 的随机数:randomNumber(12)
- * 示例:生成 3~23 之间的随机数:randomNumber(3, 23)
- *
- * @param1 最小值 | 长度
- * @param2 最大值
- * @return int 生成后的数字
- */
-export function randomNumber() {
-  // 生成 最小值 到 最大值 区间的随机数
-  const random = (min, max) => {
-    return Math.floor(Math.random() * (max - min + 1) + min)
-  }
-  if (arguments.length === 1) {
-    let [length] = arguments
-    // 生成指定长度的随机数字,首位一定不是 0
-    let nums = [...Array(length).keys()].map((i) => (i > 0 ? random(0, 9) : random(1, 9)))
-    return parseInt(nums.join(''))
-  } else if (arguments.length >= 2) {
-    let [min, max] = arguments
-    return random(min, max)
-  } else {
-    return Number.NaN
-  }
-}
-
-/**
- * 随机生成字符串
- * @param length 字符串的长度
- * @param chats 可选字符串区间(只会生成传入的字符串中的字符)
- * @return string 生成的字符串
- */
-export function randomString(length, chats) {
-  if (!length) length = 1
-  if (!chats) chats = '0123456789qwertyuioplkjhgfdsazxcvbnm'
-  let str = ''
-  for (let i = 0; i < length; i++) {
-    let num = randomNumber(0, chats.length - 1)
-    str += chats[num]
-  }
-  return str
-}
-
-/**
- * 随机生成uuid
- * @return string 生成的uuid
- */
-export function randomUUID() {
-  let chats = '0123456789abcdef'
-  return randomString(32, chats)
-}
-
-/**
- * 下划线转驼峰
- * @param string
- * @returns {*}
- */
-export function underLine2CamelCase(string) {
-  return string.replace(/_([a-z])/g, function (all, letter) {
-    return letter.toUpperCase();
-  });
-}
-
-/**
- * 判断是否显示办理按钮
- * @param bpmStatus
- * @returns {*}
- */
-export function showDealBtn(bpmStatus) {
-  if (bpmStatus != "1" && bpmStatus != "3" && bpmStatus != "4") {
-    return true;
-  }
-  return false;
-}
+import {isURL} from '@/utils/validate'
+
+export function timeFix() {
+  const time = new Date()
+  const hour = time.getHours()
+  return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好')))
+}
+
+export function welcome() {
+  const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
+  let index = Math.floor((Math.random() * arr.length))
+  return arr[index]
+}
+
+/**
+ * 触发 window.resize
+ */
+export function triggerWindowResizeEvent() {
+  let event = document.createEvent('HTMLEvents')
+  event.initEvent('resize', true, true)
+  event.eventType = 'message'
+  window.dispatchEvent(event)
+}
+
+/**
+ * 过滤对象中为空的属性
+ * @param obj
+ * @returns {*}
+ */
+export function filterObj(obj) {
+  if (!(typeof obj == 'object')) {
+    return;
+  }
+
+  for (var key in obj) {
+    if (obj.hasOwnProperty(key)
+      && (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
+      delete obj[key];
+    }
+  }
+  return obj;
+}
+
+/**
+ * 时间格式化
+ * @param value
+ * @param fmt
+ * @returns {*}
+ */
+export function formatDate(value, fmt) {
+  var regPos = /^\d+(\.\d+)?$/;
+  if (regPos.test(value)) {
+    //如果是数字
+    let getDate = new Date(value);
+    let o = {
+      'M+': getDate.getMonth() + 1,
+      'd+': getDate.getDate(),
+      'h+': getDate.getHours(),
+      'm+': getDate.getMinutes(),
+      's+': getDate.getSeconds(),
+      'q+': Math.floor((getDate.getMonth() + 3) / 3),
+      'S': getDate.getMilliseconds()
+    };
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length))
+    }
+    for (let k in o) {
+      if (new RegExp('(' + k + ')').test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+      }
+    }
+    return fmt;
+  } else {
+    //TODO
+    value = value.trim();
+    return value.substr(0, fmt.length);
+  }
+}
+
+// 生成首页路由
+export function generateIndexRouter(data) {
+  let indexRouter = [{
+    path: '/',
+    name: 'dashboard',
+    //component: () => import('@/components/layouts/BasicLayout'),
+    component: resolve => require(['@/components/layouts/TabLayout'], resolve),
+    meta: {title: '首页'},
+    redirect: '/dashboard/analysis',
+    children: [
+      ...generateChildRouters(data)
+    ]
+  }, {
+    "path": "*", "redirect": "/404", "hidden": true
+  }]
+  return indexRouter;
+}
+
+// 生成嵌套路由(子路由)
+
+function generateChildRouters(data) {
+  const routers = [];
+  for (var item of data) {
+    let component = "";
+    if (item.component.indexOf("layouts") >= 0) {
+      component = "components/" + item.component;
+    } else {
+      component = "views/" + item.component;
+    }
+
+    // eslint-disable-next-line
+    let URL = (item.meta.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
+    if (isURL(URL)) {
+      item.meta.url = URL;
+    }
+
+    let menu = {
+      path: item.path,
+      name: item.name,
+      redirect: item.redirect,
+      component: resolve => require(['@/' + component + '.vue'], resolve),
+      hidden: item.hidden,
+      //component:()=> import(`@/views/${item.component}.vue`),
+      meta: {
+        title: item.meta.title,
+        icon: item.meta.icon,
+        url: item.meta.url,
+        permissionList: item.meta.permissionList,
+        keepAlive: item.meta.keepAlive
+      }
+    }
+    if (item.alwaysShow) {
+      menu.alwaysShow = true;
+      menu.redirect = menu.path;
+    }
+    if (item.children && item.children.length > 0) {
+      menu.children = [...generateChildRouters(item.children)];
+    }
+    //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+    //判断是否生成路由
+    if (item.route && item.route === '0') {
+      //console.log(' 不生成路由 item.route:  '+item.route);
+      //console.log(' 不生成路由 item.path:  '+item.path);
+    } else {
+      routers.push(menu);
+    }
+    //--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+  }
+  return routers
+}
+
+/**
+ * 深度克隆对象、数组
+ * @param obj 被克隆的对象
+ * @return 克隆后的对象
+ */
+export function cloneObject(obj) {
+  return JSON.parse(JSON.stringify(obj))
+}
+
+/**
+ * 随机生成数字
+ *
+ * 示例:生成长度为 12 的随机数:randomNumber(12)
+ * 示例:生成 3~23 之间的随机数:randomNumber(3, 23)
+ *
+ * @param1 最小值 | 长度
+ * @param2 最大值
+ * @return int 生成后的数字
+ */
+export function randomNumber() {
+  // 生成 最小值 到 最大值 区间的随机数
+  const random = (min, max) => {
+    return Math.floor(Math.random() * (max - min + 1) + min)
+  }
+  if (arguments.length === 1) {
+    let [length] = arguments
+    // 生成指定长度的随机数字,首位一定不是 0
+    let nums = [...Array(length).keys()].map((i) => (i > 0 ? random(0, 9) : random(1, 9)))
+    return parseInt(nums.join(''))
+  } else if (arguments.length >= 2) {
+    let [min, max] = arguments
+    return random(min, max)
+  } else {
+    return Number.NaN
+  }
+}
+
+/**
+ * 随机生成字符串
+ * @param length 字符串的长度
+ * @param chats 可选字符串区间(只会生成传入的字符串中的字符)
+ * @return string 生成的字符串
+ */
+export function randomString(length, chats) {
+  if (!length) length = 1
+  if (!chats) chats = '0123456789qwertyuioplkjhgfdsazxcvbnm'
+  let str = ''
+  for (let i = 0; i < length; i++) {
+    let num = randomNumber(0, chats.length - 1)
+    str += chats[num]
+  }
+  return str
+}
+
+/**
+ * 随机生成uuid
+ * @return string 生成的uuid
+ */
+export function randomUUID() {
+  let chats = '0123456789abcdef'
+  return randomString(32, chats)
+}
+
+/**
+ * 下划线转驼峰
+ * @param string
+ * @returns {*}
+ */
+export function underLine2CamelCase(string) {
+  return string.replace(/_([a-z])/g, function (all, letter) {
+    return letter.toUpperCase();
+  });
+}
+
+/**
+ * 判断是否显示办理按钮
+ * @param bpmStatus
+ * @returns {*}
+ */
+export function showDealBtn(bpmStatus) {
+  if (bpmStatus != "1" && bpmStatus != "3" && bpmStatus != "4") {
+    return true;
+  }
+  return false;
+}
+
+/**
+ * 判断是否是数组
+ * @param {Array} arr 
+ */
+export const isArray = (arr) => {
+    return Object.prototype.toString.call(arr) == '[object Array]'
+}
+
+/**
+ * 将简单数据格式转换成嵌套的数据格式
+ * @param {Object} setting 
+ * @param {Array} sNodes 
+ */
+export const transformTozTreeFormat = (sNodes, setting={}) => { 
+    var i, l,
+        key = setting.idKey || 'id',
+        parentKey = setting.parentKey || 'parentId',
+        childKey = setting.childKey || 'childrens';
+    if (!key || key == "" || !sNodes) return [];
+
+    if (isArray(sNodes)) {
+        var r = [];
+        var tmpMap = {};
+        for (i = 0, l = sNodes.length; i < l; i++) {
+            tmpMap[sNodes[i][key]] = sNodes[i];
+        }
+        for (i = 0, l = sNodes.length; i < l; i++) {
+            if (tmpMap[sNodes[i][parentKey]] && sNodes[i][key] != sNodes[i][parentKey]) {
+                if (!tmpMap[sNodes[i][parentKey]][childKey])
+                    tmpMap[sNodes[i][parentKey]][childKey] = [];
+                tmpMap[sNodes[i][parentKey]][childKey].push(sNodes[i]);
+            } else {
+                r.push(sNodes[i]);
+            }
+        }
+        return r;
+    } else {
+        return [sNodes];
+    }
+}

+ 107 - 104
src/views/modules/Statistics/dataDisplayStatistics.vue

@@ -112,7 +112,7 @@ th div {
       <a-row>
         <a-col :span="24">
           <a-card :bordered="false" class="search-box">
-            <time-check @getAdd="getAdd" :startValue.sync="startValue"></time-check>
+            <time-check @getAdd="getAdd" :startValue.sync="startValue" ref="timeCheck"></time-check>
           </a-card>
         </a-col>
       </a-row>
@@ -502,6 +502,7 @@ export default {
     getDataReset() {
       this.active = 1
       this.allValue = []
+      this.$refs.timeCheck.active = 1
       this.addUser()
     },
     addUser() {
@@ -547,113 +548,115 @@ export default {
       this.data = []
       getStatistics(params).then(res => {
         console.log(res)
-        this.data = res.accountDetail.map((item, index) => {
-          return {
-            key: index,
-            ...item,
-            photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
-            cpm: item.cpm ? item.cpm.toFixed(2) : 0,
-            cost: item.cost.toFixed(2),
-            cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
-            costY: (item.cost / this.discount).toFixed(2),
-            beforeFormPrice: item.formPrice
-              ? item.formPrice.toFixed(2)
-              : item.activationPrice
-              ? item.activationPrice.toFixed(2)
-              : 0,
-            afterFormPrice: item.formPrice
-              ? (item.formPrice / this.discount).toFixed(2)
-              : item.activationPrice
-              ? (item.activationPrice / this.discount).toFixed(2)
-              : 0,
-            date: this.statHour ? this.getDate() + '  ' + this.statHour : this.getDate(),
-            formCount: item.formCount > 0 ? item.formCount : item.activationCount
-          }
-        })
-        var index = this.data.length
-        if (this.active == 1) {
-          var allNow = {
-            key: index + 1,
-            ...res.now,
-            photoClickRatio: res.now.photoClickRatio ? (res.now.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
-            cpm: res.now.cpm ? res.now.cpm.toFixed(2) : 0,
-            cost: res.now.cost.toFixed(2),
-            cvr: res.now.cvr ? (res.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
-            costY: (res.now.cost / this.discount).toFixed(2),
-            accountId: '总计',
-            beforeFormPrice: res.now.formPrice
-              ? res.now.formPrice.toFixed(2)
-              : res.now.activationPrice
-              ? res.now.activationPrice.toFixed(2)
-              : 0,
-            afterFormPrice: res.now.formPrice
-              ? (res.now.formPrice / this.discount).toFixed(2)
-              : res.now.activationPrice
-              ? (res.now.activationPrice / this.discount).toFixed(2)
-              : 0,
-            formCount: res.now.formCount > 0 ? res.now.formCount : res.now.activationCount
-          }
-          var allYesterday = {
-            key: index + 2,
-            ...res.yesterday,
-            photoClickRatio: res.yesterday.photoClickRatio
-              ? (res.yesterday.photoClickRatio * 100).toFixed(2) + '%'
-              : 0 + '%',
-            cpm: res.yesterday.cpm ? res.yesterday.cpm.toFixed(2) : 0,
-            cost: res.yesterday.cost.toFixed(2),
-            cvr: res.yesterday.cvr ? (res.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
-            costY: (res.yesterday.cost / this.discount).toFixed(2),
-            accountId: '昨日总计',
-            beforeFormPrice: res.yesterday.formPrice
-              ? res.yesterday.formPrice.toFixed(2)
-              : res.yesterday.activationPrice
-              ? res.yesterday.activationPrice.toFixed(2)
-              : 0,
-            afterFormPrice: res.yesterday.formPrice
-              ? (res.yesterday.formPrice / this.discount).toFixed(2)
-              : res.yesterday.activationPrice
-              ? (res.yesterday.activationPrice / this.discount).toFixed(2)
-              : 0,
-            formCount: res.yesterday.formCount > 0 ? res.yesterday.formCount : res.yesterday.activationCount
-          }
-          var chainRatio = {
-            key: index + 3,
-            cost: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-            photoShow: (res.chainRatio.showProportion * 100).toFixed(2) + '%',
-            photoClick: (res.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
-            aclick: (res.chainRatio.aClickProportion * 100).toFixed(2) + '%',
-            photoClickRatio: res.chainRatio.photoClickRatioProportion
-              ? (res.chainRatio.photoClickRatioProportion * 100).toFixed(2) + '%'
-              : 0.0 + '%',
-            cvr: (res.chainRatio.cvrProportion * 100).toFixed(2) + '%',
-            cpm: (res.chainRatio.cpmProportion * 100).toFixed(2) + '%',
-            bClick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
-            formCount: res.chainRatio.formCountProportion
-              ? (res.chainRatio.formCountProportion * 100).toFixed(2) + '%'
-              : res.chainRatio.activationCountProportion
-              ? (res.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
-              : 0.0 + '%',
-            beforeFormPrice: res.chainRatio.beforeFormPriceProportion
-              ? (res.chainRatio.beforeFormPriceProportion * 100).toFixed(2) + '%'
-              : res.chainRatio.beforeActivationPriceProportion
-              ? (res.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
-              : 0.0 + '%',
+        if (res.accountDetail) {
+          this.data = res.accountDetail.map((item, index) => {
+            return {
+              key: index,
+              ...item,
+              photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
+              cpm: item.cpm ? item.cpm.toFixed(2) : 0,
+              cost: item.cost.toFixed(2),
+              cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
+              costY: (item.cost / this.discount).toFixed(2),
+              beforeFormPrice: item.formPrice
+                ? item.formPrice.toFixed(2)
+                : item.activationPrice
+                ? item.activationPrice.toFixed(2)
+                : 0,
+              afterFormPrice: item.formPrice
+                ? (item.formPrice / this.discount).toFixed(2)
+                : item.activationPrice
+                ? (item.activationPrice / this.discount).toFixed(2)
+                : 0,
+              date: this.statHour ? this.getDate() + '  ' + this.statHour : this.getDate(),
+              formCount: item.formCount > 0 ? item.formCount : item.activationCount
+            }
+          })
+          var index = this.data.length
+          if (this.active == 1) {
+            var allNow = {
+              key: index + 1,
+              ...res.now,
+              photoClickRatio: res.now.photoClickRatio ? (res.now.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
+              cpm: res.now.cpm ? res.now.cpm.toFixed(2) : 0,
+              cost: res.now.cost.toFixed(2),
+              cvr: res.now.cvr ? (res.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
+              costY: (res.now.cost / this.discount).toFixed(2),
+              accountId: '总计',
+              beforeFormPrice: res.now.formPrice
+                ? res.now.formPrice.toFixed(2)
+                : res.now.activationPrice
+                ? res.now.activationPrice.toFixed(2)
+                : 0,
+              afterFormPrice: res.now.formPrice
+                ? (res.now.formPrice / this.discount).toFixed(2)
+                : res.now.activationPrice
+                ? (res.now.activationPrice / this.discount).toFixed(2)
+                : 0,
+              formCount: res.now.formCount > 0 ? res.now.formCount : res.now.activationCount
+            }
+            var allYesterday = {
+              key: index + 2,
+              ...res.yesterday,
+              photoClickRatio: res.yesterday.photoClickRatio
+                ? (res.yesterday.photoClickRatio * 100).toFixed(2) + '%'
+                : 0 + '%',
+              cpm: res.yesterday.cpm ? res.yesterday.cpm.toFixed(2) : 0,
+              cost: res.yesterday.cost.toFixed(2),
+              cvr: res.yesterday.cvr ? (res.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
+              costY: (res.yesterday.cost / this.discount).toFixed(2),
+              accountId: '昨日总计',
+              beforeFormPrice: res.yesterday.formPrice
+                ? res.yesterday.formPrice.toFixed(2)
+                : res.yesterday.activationPrice
+                ? res.yesterday.activationPrice.toFixed(2)
+                : 0,
+              afterFormPrice: res.yesterday.formPrice
+                ? (res.yesterday.formPrice / this.discount).toFixed(2)
+                : res.yesterday.activationPrice
+                ? (res.yesterday.activationPrice / this.discount).toFixed(2)
+                : 0,
+              formCount: res.yesterday.formCount > 0 ? res.yesterday.formCount : res.yesterday.activationCount
+            }
+            var chainRatio = {
+              key: index + 3,
+              cost: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
+              photoShow: (res.chainRatio.showProportion * 100).toFixed(2) + '%',
+              photoClick: (res.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
+              aclick: (res.chainRatio.aClickProportion * 100).toFixed(2) + '%',
+              photoClickRatio: res.chainRatio.photoClickRatioProportion
+                ? (res.chainRatio.photoClickRatioProportion * 100).toFixed(2) + '%'
+                : 0.0 + '%',
+              cvr: (res.chainRatio.cvrProportion * 100).toFixed(2) + '%',
+              cpm: (res.chainRatio.cpmProportion * 100).toFixed(2) + '%',
+              bClick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
+              formCount: res.chainRatio.formCountProportion
+                ? (res.chainRatio.formCountProportion * 100).toFixed(2) + '%'
+                : res.chainRatio.activationCountProportion
+                ? (res.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
+                : 0.0 + '%',
+              beforeFormPrice: res.chainRatio.beforeFormPriceProportion
+                ? (res.chainRatio.beforeFormPriceProportion * 100).toFixed(2) + '%'
+                : res.chainRatio.beforeActivationPriceProportion
+                ? (res.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
+                : 0.0 + '%',
 
-            afterFormPrice: res.chainRatio.afterFormPriceProportion
-              ? (res.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
-              : res.chainRatio.afterActivationPriceProportion
-              ? (res.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
-              : 0 + '%',
+              afterFormPrice: res.chainRatio.afterFormPriceProportion
+                ? (res.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
+                : res.chainRatio.afterActivationPriceProportion
+                ? (res.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
+                : 0 + '%',
 
-            costY: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-            accountId: '环比'
+              costY: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
+              accountId: '环比'
+            }
+            this.data.push(allNow)
+            this.data.push(allYesterday)
+            this.data.push(chainRatio)
           }
-          this.data.push(allNow)
-          this.data.push(allYesterday)
-          this.data.push(chainRatio)
-        }
 
-        length = this.data.length
+          length = this.data.length
+        }
       })
     },
     getAdd(checked) {

+ 1 - 40
src/views/modules/Statistics/materialStatistics.vue

@@ -114,46 +114,7 @@
         </a-card>
       </a-col>
     </a-row>
-    <!-- <a-modal title="环比展示" v-model="visible" @ok="handleOk" width="90%">
-      <div v-if="detail">
-        <video
-          class="video"
-          :src="detail.url"
-          controls="controls"
-          style="height:200px;"
-          v-show="showVideo"
-        >您的浏览器不支持 video 标签。</video>
-      </div>
-      <a-button type="primary" @click="showVideo = !showVideo">{{!showVideo?"点击查看视频":"点击收起视频"}}</a-button>
-      <a-card style="width:100%;">
-        <a-table
-          :columns="columnsDetail"
-          :dataSource="dataDetail"
-          bordered
-          id="outTable"
-          :pagination="false"
-        >
-          <span slot="photoClickRatio" slot-scope="photoClickRatio">{{photoClickRatio|getBo}}</span>
-          <span slot="actionRatio" slot-scope="actionRatio">{{actionRatio|getBo}}</span>
-          <span slot="impression1kCost" slot-scope="impression1kCost,record">
-            <span v-if="record.statDate=='环比'">{{impression1kCost|getBo}}</span>
-            <span v-else>{{impression1kCost|toFixtwo}}</span>
-          </span>
-          <span slot="photoClickCost" slot-scope="photoClickCost,record">
-            <span v-if="record.statDate=='环比'">{{photoClickCost|getBo}}</span>
-            <span v-else>{{photoClickCost|toFixtwo}}</span>
-          </span>
-          <span slot="actionCost" slot-scope="actionCost,record">
-            <span v-if="record.statDate=='环比'">{{actionCost|getBo}}</span>
-            <span v-else>{{actionCost|toFixtwo}}</span>
-          </span>
-          <span slot="conversionPrice" slot-scope="conversionPrice,record">
-            <span v-if="record.statDate=='环比'">{{conversionPrice|getBo}}</span>
-            <span v-else>{{conversionPrice|toFixtwo}}</span>
-          </span>
-        </a-table>
-      </a-card>
-    </a-modal>-->
+
     <ratio-modal ref="ratio" />
   </div>
 </template>

+ 249 - 0
src/views/modules/Statistics/refuseData.vue

@@ -0,0 +1,249 @@
+
+<style>
+.data-display-statistics .ant-col-6 {
+  margin: 10px 0;
+}
+.data-display-statistics .ant-col-6 .ant-card-body {
+  display: flex;
+  justify-content: center;
+}
+.data-display-statistics .ant-col-6 p,
+.data-display-statistics .ant-col-6 span {
+  text-align: center;
+  line-height: 40px;
+  font-size: 30px;
+  font-weight: 600;
+  color: red;
+  margin: 0;
+}
+.search-box .ant-card-body {
+  padding: 5px 15px;
+}
+.data-display-statistics .ant-col-6 .ant-card-body .styleElse {
+  line-height: 60px;
+  height: 40px;
+  font-size: 16px;
+  font-weight: 400;
+  margin-left: 10px;
+}
+.ant-modal-wrap .yincang .ant-modal-content .ant-modal-footer {
+  display: none !important;
+}
+.yincang .ant-col-6 p {
+  text-align: left;
+  color: red;
+  font-size: 16px;
+  font-weight: 500;
+}
+.ant-table-thead div {
+  font-weight: 700;
+}
+.tool-tip {
+  position: absolute;
+  top: 65px;
+  right: 10px;
+}
+th div {
+  white-space: nowrap;
+}
+.data-display-statistics th {
+  text-align: center !important;
+}
+</style>
+<template>
+  <div class="data-display-statistics">
+    <a-row class="image-list-heading vm-panel">
+      <div class="panel-heading" style="display:flex;justify-content: space-between;">{{ title }}</div>
+      <a-row type="flex" align="middle" justify="space-between" class="panel-body">
+        <div class="search-bar" style="width:100%">
+          <span>账户选择:</span>
+          <a-select
+            v-model="appId"
+            showSearch
+            allowClear
+            placeholder="请选择账户"
+            optionFilterProp="children"
+            style="width:600px"
+          >
+            <a-select-option
+              v-for="appModel in options"
+              :key="appModel.id+new Date().getTime()"
+              :value="appModel.accountId"
+            >{{appModel.advertiserName}}&#12288;&#12288;{{appModel.accountId}}&#12288;&nbsp;&#12288;{{appModel.authName}}&#12288;&#12288;{{appModel.operationName}}</a-select-option>
+          </a-select>
+          <a-button type="primary" style="margin:10px" @click="addUser">搜索</a-button>
+        </div>
+      </a-row>
+    </a-row>
+    <a-row :gutter="10" style="margin-top:10px">
+      <a-col :span="24">
+        <a-card style="width:100%;">
+          <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading">
+            <div slot="videoUrl" slot-scope="videoUrl">
+              <video
+                class="video"
+                :src="videoUrl"
+                controls="controls"
+                style="height:200px;width:112.5px"
+              >您的浏览器不支持 video 标签。</video>
+            </div>
+            <div slot="coverUrl" slot-scope="coverUrl">
+              <img :src="coverUrl" controls="controls" style="height:200px;width:112.5px" />
+            </div>
+          </a-table>
+        </a-card>
+      </a-col>
+    </a-row>
+  </div>
+</template>
+
+<script>
+import moment from 'moment'
+import { getMaterialAccount, getRefuseCreative } from '@api/statistics'
+import axios from 'axios'
+import { mapGetters } from 'vuex'
+import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
+const columns = [
+  {
+    title: '账号Id',
+    dataIndex: 'accountId',
+    key: 'accountId',
+    align: 'center'
+  },
+  {
+    title: '计划Id',
+    dataIndex: 'campaignId',
+    key: 'campaignId',
+    align: 'center'
+  },
+  {
+    title: '广告组id',
+    dataIndex: 'unitId',
+    key: 'unitId',
+    align: 'center'
+  },
+  {
+    title: '创意id',
+    dataIndex: 'creativeId',
+    key: 'photoClick',
+    align: 'center'
+  },
+  {
+    title: '创意名称',
+    dataIndex: 'creativeName',
+    key: 'creativeName',
+    align: 'left'
+  },
+  {
+    title: '视频',
+    dataIndex: 'videoUrl',
+    key: 'videoUrl',
+    align: 'center',
+    scopedSlots: { customRender: 'videoUrl' }
+  },
+  {
+    title: '封面',
+    dataIndex: 'coverUrl',
+    key: 'coverUrl',
+    align: 'center',
+    scopedSlots: { customRender: 'coverUrl' }
+  },
+  {
+    title: '拒绝原因',
+    dataIndex: 'reviewDetail',
+    key: 'reviewDetail',
+    align: 'left'
+  },
+
+  {
+    title: '广告语',
+    dataIndex: 'description',
+    key: 'description',
+    align: 'left'
+  }
+]
+
+export default {
+  name: 'refuse-data',
+  components: {},
+
+  data: function() {
+    return {
+      title: '被拒创意列表',
+      appId: null,
+      options: [],
+      loading: false,
+      columns,
+      dataList: []
+    }
+  },
+  filters: {
+    formatDate: function(value) {
+      let date = new Date(value)
+      let y = date.getFullYear()
+      let MM = date.getMonth() + 1
+      MM = MM < 10 ? '0' + MM : MM
+      let d = date.getDate()
+      d = d < 10 ? '0' + d : d
+      let h = date.getHours()
+      h = h < 10 ? '0' + h : h
+      let m = date.getMinutes()
+      m = m < 10 ? '0' + m : m
+      let s = date.getSeconds()
+      s = s < 10 ? '0' + s : s
+      return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
+    },
+    toFixtwo: function(value) {
+      if (value) {
+        return value.toFixed(2)
+      } else {
+        return 0.0
+      }
+    },
+    getBo: function(value) {
+      if (value) {
+        return (value * 100).toFixed(2) + '%'
+      } else {
+        return '0.00%'
+      }
+    }
+  },
+  methods: {
+    moment,
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    addUser() {
+      this.loading = true
+      var params = {}
+      params.accountId = this.appId + ''
+      if (this.appId) {
+        getRefuseCreative(params).then(res => {
+          if (res.code == 0) {
+            this.dataList = res.data.map((v, index) => {
+              return {
+                ...v,
+                key: index
+              }
+            })
+            this.loading = false
+          }
+        })
+      } else {
+        this.$message.error('请选择账户')
+      }
+    }
+  },
+  watch: {},
+  distoryed() {},
+  updated() {
+    stopOtherVideo()
+  },
+  mounted: function() {
+    this.$nextTick(() => {
+      getMaterialAccount({ userId: this.userInfo().id }).then(res => {
+        this.list = res
+        this.options = res
+      })
+    })
+  }
+}
+</script>

+ 109 - 77
src/views/modules/appium/AppiumDeviceList.vue

@@ -1,11 +1,9 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :md="6" :sm="8">
             <a-form-item label="IP">
               <a-input placeholder="请输入IP" v-model="queryParam.ip"></a-input>
@@ -16,24 +14,33 @@
               <a-input placeholder="请输入端口号" v-model="queryParam.port"></a-input>
             </a-form-item>
           </a-col>
-        <template v-if="toggleSearchStatus">
-        <a-col :md="6" :sm="8">
-            <a-form-item label="状态">
-              <a-input placeholder="请输入状态" v-model="queryParam.status"></a-input>
-            </a-form-item>
-          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :md="6" :sm="8">
+              <a-form-item label="状态">
+                <!-- <a-input placeholder="请输入状态" v-model="queryParam.status"></a-input> -->
+                <a-select v-model="queryParam.status" allowClear>
+                  <a-select-option value="1">可用</a-select-option>
+                  <a-select-option value="2">任务中</a-select-option>
+                  <a-select-option value="3">不可用</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
           </template>
-          <a-col :md="6" :sm="8" >
+          <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+              >重置</a-button>
               <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
               </a>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -42,21 +49,34 @@
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('手机设备表')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-upload
+        name="file"
+        :showUploadList="false"
+        :multiple="false"
+        :headers="tokenHeader"
+        :action="importExcelUrl"
+        @change="handleImportExcel"
+      >
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />删除
+          </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+        <a-button style="margin-left: 8px">
+          批量操作
+          <a-icon type="down" />
+        </a-button>
       </a-dropdown>
     </div>
 
     <!-- table区域-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -70,14 +90,18 @@
         :pagination="ipagination"
         :loading="loading"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
-
+        @change="handleTableChange"
+      >
+        <span slot="status" slot-scope="status">{{status|showStatus}}</span>
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
           <a-divider type="vertical" />
           <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a class="ant-dropdown-link">
+              更多
+              <a-icon type="down" />
+            </a>
             <a-menu slot="overlay">
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -87,7 +111,6 @@
             </a-menu>
           </a-dropdown>
         </span>
-
       </a-table>
     </div>
     <!-- table区域-end -->
@@ -98,71 +121,80 @@
 </template>
 
 <script>
-  import AppiumDeviceModal from './modules/AppiumDeviceModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import AppiumDeviceModal from './modules/AppiumDeviceModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: "AppiumDeviceList",
-    mixins:[JeecgListMixin],
-    components: {
-      AppiumDeviceModal
-    },
-    data () {
-      return {
-        description: '手机设备表管理页面',
-        // 表头
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
-            }
-           },
-		   {
-            title: 'IP',
-            align:"center",
-            dataIndex: 'ip'
-           },
-		   {
-            title: '端口号',
-            align:"center",
-            dataIndex: 'port'
-           },
-		   {
-            title: '状态',
-            align:"center",
-            dataIndex: 'status'
-           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
+export default {
+  name: 'AppiumDeviceList',
+  mixins: [JeecgListMixin],
+  components: {
+    AppiumDeviceModal
+  },
+  data() {
+    return {
+      description: '手机设备表管理页面',
+      // 表头
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
           }
-        ],
-		url: {
-          list: "/appium/appiumDevice/list",
-          delete: "/appium/appiumDevice/delete",
-          deleteBatch: "/appium/appiumDevice/deleteBatch",
-          exportXlsUrl: "appium/appiumDevice/exportXls",
-          importExcelUrl: "appium/appiumDevice/importExcel",
-       },
+        },
+        {
+          title: 'IP',
+          align: 'center',
+          dataIndex: 'ip'
+        },
+        {
+          title: '端口号',
+          align: 'center',
+          dataIndex: 'port'
+        },
+        {
+          title: '状态',
+          align: 'center',
+          dataIndex: 'status',
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/appium/appiumDevice/list',
+        delete: '/appium/appiumDevice/delete',
+        deleteBatch: '/appium/appiumDevice/deleteBatch',
+        exportXlsUrl: 'appium/appiumDevice/exportXls',
+        importExcelUrl: 'appium/appiumDevice/importExcel'
+      }
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-    methods: {
-     
+  filters: {
+    showStatus: function(value) {
+      var status = {
+        1: '可用',
+        2: '任务中',
+        3: '不可用'
+      }
+      return status[value]
     }
-  }
+  },
+  methods: {}
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less'
+@import '~@assets/less/common.less';
 </style>

+ 5 - 0
src/views/modules/appium/AppiumTaskItemList.vue

@@ -142,6 +142,11 @@
             align:"center",
             dataIndex: 'parentId'
            },
+           {
+            title: '名称',
+            align:"center",
+            dataIndex: 'name'
+           },
 		   {
             title: '顺序',
             align:"center",

+ 252 - 78
src/views/modules/appium/AppiumTaskList.vue

@@ -1,11 +1,9 @@
 <template>
-  <a-card :bordered="false">
-
+  <a-card :bordered="false" class="task-list">
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :md="6" :sm="8">
             <a-form-item label="任务名称">
               <a-input placeholder="请输入任务名称" v-model="queryParam.taskName"></a-input>
@@ -16,24 +14,28 @@
               <a-input placeholder="请输入APP包名" v-model="queryParam.appPackage"></a-input>
             </a-form-item>
           </a-col>
-        <template v-if="toggleSearchStatus">
-        <a-col :md="6" :sm="8">
-            <a-form-item label="APP界面名">
-              <a-input placeholder="请输入APP界面名" v-model="queryParam.appActivity"></a-input>
-            </a-form-item>
-          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :md="6" :sm="8">
+              <a-form-item label="APP界面名">
+                <a-input placeholder="请输入APP界面名" v-model="queryParam.appActivity"></a-input>
+              </a-form-item>
+            </a-col>
           </template>
-          <a-col :md="6" :sm="8" >
+          <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+              >重置</a-button>
               <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
               </a>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -42,21 +44,34 @@
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('任务表')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-upload
+        name="file"
+        :showUploadList="false"
+        :multiple="false"
+        :headers="tokenHeader"
+        :action="importExcelUrl"
+        @change="handleImportExcel"
+      >
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />删除
+          </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+        <a-button style="margin-left: 8px">
+          批量操作
+          <a-icon type="down" />
+        </a-button>
       </a-dropdown>
     </div>
 
     <!-- table区域-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -70,14 +85,18 @@
         :pagination="ipagination"
         :loading="loading"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
-
+        @change="handleTableChange"
+        @expand="expand"
+      >
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
           <a-divider type="vertical" />
           <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a class="ant-dropdown-link">
+              更多
+              <a-icon type="down" />
+            </a>
             <a-menu slot="overlay">
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -87,82 +106,237 @@
             </a-menu>
           </a-dropdown>
         </span>
-
+        <a-table
+          slot="expandedRowRender"
+          slot-scope="text"
+          :columns="innerColumns"
+          :dataSource="text.childrens"
+          :pagination="false"
+        >
+          <span slot="action" slot-scope="text,record" class="table-operation">
+            <a href="javascript:;" @click="lookDetail(record)">查看详情</a>
+            <a-dropdown>
+              <a-menu slot="overlay">
+                <a-menu-item>查看 1</a-menu-item>
+                <a-menu-item>查看 2</a-menu-item>
+              </a-menu>
+              <a href="javascript:;">
+                查看
+                <a-icon type="down" />
+              </a>
+            </a-dropdown>
+          </span>
+        </a-table>
       </a-table>
     </div>
     <!-- table区域-end -->
 
     <!-- 表单区域 -->
     <appiumTask-modal ref="modalForm" @ok="modalFormOk"></appiumTask-modal>
+    <appiumTask-item-modal ref="modalItemForm"></appiumTask-item-modal>
   </a-card>
 </template>
 
 <script>
-  import AppiumTaskModal from './modules/AppiumTaskModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-
-  export default {
-    name: "AppiumTaskList",
-    mixins:[JeecgListMixin],
-    components: {
-      AppiumTaskModal
-    },
-    data () {
-      return {
-        description: '任务表管理页面',
-        // 表头
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
-            }
-           },
-		   {
-            title: '任务名称',
-            align:"center",
-            dataIndex: 'taskName'
-           },
-		   {
-            title: 'APP包名',
-            align:"center",
-            dataIndex: 'appPackage'
-           },
-		   {
-            title: 'APP界面名',
-            align:"center",
-            dataIndex: 'appActivity'
-           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
+import AppiumTaskModal from './modules/AppiumTaskModal'
+import AppiumTaskItemModal from './modules/AppiumTaskItemModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { appiumTaskList, appiumTaskItemList } from '@api/appium.js'
+import { transformTozTreeFormat } from '@/utils/util.js'
+const innerColumns = [
+  //   {
+  //     title: '任务ID',
+  //     align: 'center',
+  //     dataIndex: 'taskId'
+  //   },
+  //   {
+  //     title: '父ID',
+  //     align: 'center',
+  //     dataIndex: 'parentId'
+  //   },
+  {
+    title: '顺序',
+    align: 'center',
+    dataIndex: 'seq'
+  },
+  {
+    title: '名称',
+    align: 'center',
+    dataIndex: 'name'
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    align: 'center',
+    scopedSlots: { customRender: 'action' },
+    width: '210px'
+  }
+  //   {
+  //     title: '查找类型',
+  //     align: 'center',
+  //     dataIndex: 'findType'
+  //   },
+  //   {
+  //     title: '查找关键字',
+  //     align: 'center',
+  //     dataIndex: 'findKey'
+  //   },
+  //   {
+  //     title: '点击类型',
+  //     align: 'center',
+  //     dataIndex: 'clickType'
+  //   },
+  //   {
+  //     title: '偏移量X',
+  //     align: 'center',
+  //     dataIndex: 'offsiteX'
+  //   },
+  //   {
+  //     title: '偏移量Y',
+  //     align: 'center',
+  //     dataIndex: 'offsiteY'
+  //   },
+  //   {
+  //     title: '循环间隔',
+  //     align: 'center',
+  //     dataIndex: 'loopRate'
+  //   },
+  //   {
+  //     title: '循环类型',
+  //     align: 'center',
+  //     dataIndex: 'loopType'
+  //   },
+  //   {
+  //     title: '是否必经执行',
+  //     align: 'center',
+  //     dataIndex: 'isMust'
+  //   },
+  //   {
+  //     title: '文本查找类型',
+  //     align: 'center',
+  //     dataIndex: 'textEqualType'
+  //   },
+  //   {
+  //     title: '文本查找关键字',
+  //     align: 'center',
+  //     dataIndex: 'textEqualKey'
+  //   },
+  //   {
+  //     title: '滑动类型',
+  //     align: 'center',
+  //     dataIndex: 'swapType'
+  //   },
+  //   {
+  //     title: '延迟时长',
+  //     align: 'center',
+  //     dataIndex: 'waitTime'
+  //   },
+  //   {
+  //     title: '是否执行完关闭',
+  //     align: 'center',
+  //     dataIndex: 'isClose'
+  //   },
+]
+export default {
+  name: 'AppiumTaskList',
+  mixins: [JeecgListMixin],
+  components: {
+    AppiumTaskModal,
+    AppiumTaskItemModal
+  },
+  data() {
+    return {
+      description: '任务表管理页面',
+      // 表头
+      innerColumns,
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
           }
-        ],
-		url: {
-          list: "/appium/appiumTask/list",
-          delete: "/appium/appiumTask/delete",
-          deleteBatch: "/appium/appiumTask/deleteBatch",
-          exportXlsUrl: "appium/appiumTask/exportXls",
-          importExcelUrl: "appium/appiumTask/importExcel",
-       },
+        },
+        {
+          title: '任务名称',
+          align: 'center',
+          dataIndex: 'taskName'
+        },
+        {
+          title: 'APP包名',
+          align: 'center',
+          dataIndex: 'appPackage'
+        },
+        {
+          title: 'APP界面名',
+          align: 'center',
+          dataIndex: 'appActivity'
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/appium/appiumTask/list',
+        listTwo: '/appium/appiumTaskItem/list',
+        delete: '/appium/appiumTask/delete',
+        deleteBatch: '/appium/appiumTask/deleteBatch',
+        exportXlsUrl: 'appium/appiumTask/exportXls',
+        importExcelUrl: 'appium/appiumTask/importExcel'
+      }
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-    methods: {
-     
+  methods: {
+    lookDetail(item) {
+        console.log(item)
+    //   this.$refs.modalItemForm.edit(item)
+    //   this.$refs.modalItemForm.title = '编辑'
+    //   this.$refs.modalItemForm.disableSubmit = false
     }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      var params = {
+        _t: 1573006568,
+        column: 'createTime',
+        order: 'desc',
+        field: 'id,,,taskName,appPackage,appActivity,action',
+        pageNo: 1,
+        pageSize: 20
+      }
+      var data = []
+      appiumTaskList(params).then(res => {
+        data.push(...res.result.records)
+        appiumTaskItemList(params).then(res => {
+          console.log(res, 12321312)
+          data.push(...res.result.records)
+          var dataElse = transformTozTreeFormat(data)
+          console.log(dataElse)
+        })
+      })
+    })
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less'
+@import '~@assets/less/common.less';
+</style>
+<style>
+.task-list .ant-table-middle tr.ant-table-expanded-row td > .ant-table-wrapper {
+  margin: 0;
+}
+.task-list tr.ant-table-expanded-row td > .ant-table-wrapper {
+  margin: 0;
+}
 </style>

+ 99 - 12
src/views/modules/appium/modules/AppiumTaskItemModal.vue

@@ -16,12 +16,31 @@
           :wrapperCol="wrapperCol"
           label="任务ID">
           <a-input placeholder="请输入任务ID" v-decorator="['taskId', validatorRules.taskId ]" />
+          <!-- <a-select
+             v-decorator="['taskId', validatorRules.taskId ]"
+            placeholder="请选择任务ID"
+          >
+          </a-select> -->
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="父ID">
-          <a-input placeholder="请输入父ID" v-decorator="['parentId', {}]" />
+          <!-- <a-input placeholder="请输入父ID" v-decorator="['parentId', {}]" /> -->
+          <a-tree-select
+            style="width:100%"
+            :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
+            :treeData="treeData"
+            v-decorator="['parentId', {}]"
+            placeholder="请选择父级菜单"
+          >
+          </a-tree-select>
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="名字">
+          <a-input placeholder="请输入名称" v-decorator="['name', {}]" />
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
@@ -33,7 +52,17 @@
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="查找类型">
-          <a-input placeholder="请输入查找类型" v-decorator="['findType', validatorRules.findType ]" />
+          <!-- <a-input placeholder="请输入查找类型" v-decorator="['findType', validatorRules.findType ]" /> -->
+          <a-select
+            v-decorator="['findType', validatorRules.findType ]"
+            placeholder="请选择查找类型"
+          >
+            <a-select-option value="id">id</a-select-option>
+            <a-select-option value="no">no</a-select-option>
+            <a-select-option value="class">class</a-select-option>
+            <a-select-option value="xpath">xpath</a-select-option>
+            <a-select-option value="loop">loop</a-select-option>
+          </a-select>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
@@ -45,7 +74,15 @@
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="点击类型">
-          <a-input placeholder="请输入点击类型" v-decorator="['clickType', {}]" />
+          <!-- <a-input placeholder="请输入点击类型" v-decorator="['clickType', {}]" /> -->
+          <a-select
+            v-decorator="['clickType', {} ]"
+            placeholder="请选择点击类型"
+          >
+            <a-select-option value="element">element</a-select-option>
+            <a-select-option value="point">point</a-select-option>
+            <a-select-option value="no">no</a-select-option>
+          </a-select>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
@@ -63,25 +100,39 @@
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="循环间隔">
-          <a-input placeholder="请输入循环间隔" v-decorator="['loopRate', {}]" />
+          <!-- <a-input placeholder="请输入循环间隔" v-decorator="['loopRate', {}]" /> -->
+          <a-input  v-decorator="['loopRate',{}]" placeholder="请输入循环间隔">
+            <span slot="addonAfter">ms</span>
+          </a-input>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="循环类型">
-          <a-input placeholder="请输入循环类型" v-decorator="['loopType', {}]" />
+          <!-- <a-input placeholder="请输入循环类型" v-decorator="['loopType', {}]" /> -->
+          {{model.isMust}}
+          <a-switch checkedChildren="loop" unCheckedChildren="noloop" @change="switchShow"/>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="是否必经执行">
-          <a-input placeholder="请输入是否必经执行" v-decorator="['isMust', validatorRules.isMust ]" />
+          <!-- <a-input placeholder="请输入是否必经执行" v-decorator="['isMust', validatorRules.isMust ]" /> -->
+          <a-switch checkedChildren="是" unCheckedChildren="否"  @change="switchShowTwo"/>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="文本查找类型">
-          <a-input placeholder="请输入文本查找类型" v-decorator="['textEqualType', {}]" />
+          <!-- <a-input placeholder="请输入文本查找类型" v-decorator="['textEqualType', {}]" /> -->
+          <a-select
+            v-decorator="['textEqualType', {} ]"
+            placeholder="请选择文本查找类型"
+          >
+            <a-select-option value="eq">eq</a-select-option>
+            <a-select-option value="start">start</a-select-option>
+            <a-select-option value="contain">contain</a-select-option>
+          </a-select>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
@@ -93,19 +144,32 @@
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="滑动类型">
-          <a-input placeholder="请输入滑动类型" v-decorator="['swapType', {}]" />
+          <!-- <a-input placeholder="请输入滑动类型" v-decorator="['swapType', {}]" /> -->
+          <a-select
+            v-decorator="['swapType', {} ]"
+            placeholder="请选择滑动类型"
+          >
+            <a-select-option value="up">up</a-select-option>
+            <a-select-option value="down">down</a-select-option>
+            <a-select-option value="left">left</a-select-option>
+            <a-select-option value="right">right</a-select-option>
+          </a-select>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="延迟时长">
-          <a-input placeholder="请输入延迟时长" v-decorator="['waitTime', {}]" />
+          <!-- <a-input placeholder="请输入延迟时长" v-decorator="['waitTime', {}]" /> -->
+          <a-input  v-decorator="['waitTime',{}]" placeholder="请输入延迟时长">
+            <span slot="addonAfter">ms</span>
+          </a-input>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="是否执行完关闭">
-          <a-input placeholder="请输入是否执行完关闭" v-decorator="['isClose', {}]" />
+          <!-- <a-input placeholder="请输入是否执行完关闭" v-decorator="['isClose', {}]" /> -->
+          <a-switch checkedChildren="是" unCheckedChildren="否"  @change="switchShowClose"/>
         </a-form-item>
 		
       </a-form>
@@ -136,6 +200,7 @@
 
         confirmLoading: false,
         form: this.$form.createForm(this),
+        treeData:[],
         validatorRules:{
         taskId:{rules: [{ required: true, message: '请输入任务ID!' }]},
         seq:{rules: [{ required: true, message: '请输入顺序!' }]},
@@ -151,15 +216,37 @@
     created () {
     },
     methods: {
+    switchShow(check){
+        if(check){
+            this.model.loopType = "loop"
+        }else{
+            this.model.loopType = "noloop"
+        }
+    },
+    switchShowTwo(check){
+        if(check){
+            this.model.isMust = 0
+        }else{
+            this.model.isMust = 1
+        }
+    },
+    switchShowClose(check){
+        if(check){
+            this.model.isClose = 0
+        }else{
+            this.model.isClose = 1
+        }
+    },
       add () {
-        this.edit({});
+        this.edit({findType:"id",clickType:"element",offsiteX:0,offsiteY:0,loopRate:1000,loopType:"noloop",isMust:0,waitTime:1000});
       },
       edit (record) {
+          console.log(record)
         this.form.resetFields();
         this.model = Object.assign({}, record);
         this.visible = true;
         this.$nextTick(() => {
-          this.form.setFieldsValue(pick(this.model,'taskId','parentId','seq','findType','findKey','clickType','offsiteX','offsiteY','loopRate','loopType','isMust','textEqualType','textEqualKey','swapType','waitTime','isClose'))
+          this.form.setFieldsValue(pick(this.model,'taskId','parentId','name','seq','findType','findKey','clickType','offsiteX','offsiteY','loopRate','loopType','isMust','textEqualType','textEqualKey','swapType','waitTime','isClose'))
 		  //时间格式化
         });