Browse Source

5.31提交

chen 2 years ago
parent
commit
fcef397975

+ 10 - 0
admin/src/utils/getTime.js

@@ -0,0 +1,10 @@
+export default function getTime(time) { //年月日时分秒
+  var now = new Date(time)
+  var nian = now.getFullYear()
+  var yue = (now.getMonth() + 1).toString().padStart(2, '0')
+  var ri = now.getDate().toString().padStart(2, '0')
+  var shi = now.getHours().toString().padStart(2, '0')
+  var fen = now.getMinutes().toString().padStart(2, '0')
+  var miao = now.getSeconds().toString().padStart(2, '0')
+  return `${nian}-${yue}-${ri} ${shi}:${fen}:${miao}`
+}

+ 117 - 111
admin/src/views/ABtest/edit.vue

@@ -113,7 +113,7 @@
                   />
                   />
                 </el-form-item>
                 </el-form-item>
 
 
-                <el-form-item label="选择策略">
+                <!-- <el-form-item label="选择策略">
                   <el-select
                   <el-select
                     v-model="item.strategyId"
                     v-model="item.strategyId"
                     style="width: 40%"
                     style="width: 40%"
@@ -153,7 +153,7 @@
                       content="编辑"
                       content="编辑"
                     ></vxe-button>
                     ></vxe-button>
                   </span>
                   </span>
-                </el-form-item>
+                </el-form-item> -->
 
 
                 <el-form-item label="分流占比" prop="flowPercent">
                 <el-form-item label="分流占比" prop="flowPercent">
                   <el-input
                   <el-input
@@ -210,8 +210,6 @@ export default {
       form: {
       form: {
         state: 1,
         state: 1,
         typeDictId: 2,
         typeDictId: 2,
-        endTime: null,
-        begintime: null,
         groupData: [
         groupData: [
           {
           {
             content: "",
             content: "",
@@ -256,11 +254,11 @@ export default {
   },
   },
   created() {
   created() {
     document.title = "编辑测试";
     document.title = "编辑测试";
-    put("/abtest/test-info/update", { pageNum: 1, pageSize: 100 }).then(
-      (res) => {
-        this.typeList = res.data.list;
-      }
-    );
+    // get("/abtest/typedict/list", { pageNum: 1, pageSize: 99999 }).then(
+    //   (res) => {
+    //     this.typeList = res.data.list;
+    //   }
+    // );
     get("/channel/info/page", { pageSize: 100, pageNum: 1 }).then((res) => {
     get("/channel/info/page", { pageSize: 100, pageNum: 1 }).then((res) => {
       this.channelList = res.data.list;
       this.channelList = res.data.list;
     });
     });
@@ -273,35 +271,49 @@ export default {
     });
     });
   },
   },
   mounted() {
   mounted() {
-    if (this.$route.query.id) {
-      get("/abtest/info/list", { id: this.$route.query.id }).then((res) => {
-        let nres = JSON.parse(JSON.stringify(res.data.list[0]));
-        this.timeBox = [nres.begintime, nres.endtime];
-        this.channelBox = nres.channelKey.split(",");
-        let now = Date.parse(new Date());
-        let begintime = Date.parse(nres.begintime);
-        let endtime = Date.parse(nres.endtime);
-        this.form = nres;
-        if (now > endtime) {
-          this.form.state = 0;
-          post("/abtest/info/update/" + this.$route.query.id, this.form);
-        }
-        if (now > begintime) {
-          this.isEdit = false;
+    if (this.$route.query.ids) {
+      get("/abtest/test-info/list", { ids: this.$route.query.ids }).then(
+        (res) => {
+          console.log(res, 111111111111);
+          let nres = JSON.parse(JSON.stringify(res.data[0]));
+          this.timeBox = [nres.beginTime, nres.endTime];
+          this.channelBox = nres.channelKey.split(",");
+          let now = Date.parse(new Date());
+          let begintime = nres.beginTime;
+          let endtime = nres.endTime;
+          this.form = nres;
+          if (now > endtime) {
+            //不在活动期
+            // 165  164
+            this.form.state = 0;
+            console.log(res, 222222);
+            put("/abtest/test-info/update", this.form);
+          } else {
+            // console.log("不在活动期",true);
+          }
+          if (now > begintime) {
+            //不在活动期
+            this.isEdit = false;
+          } else {
+            // console.log("不在活动期",true);
+          }
         }
         }
-      });
+      );
       this.btn = "编辑保存";
       this.btn = "编辑保存";
     }
     }
 
 
     if (this.$route.query.copyId) {
     if (this.$route.query.copyId) {
-      get("/abtest/info/list", { id: this.$route.query.copyId }).then((res) => {
-        let nres = JSON.parse(JSON.stringify(res.data.list[0]));
-        this.timeBox = [nres.begintime, nres.endtime];
-        this.channelBox = nres.channelKey.split(",");
-        this.form = nres;
-        this.form.name = nres.name + " 副本";
-        console.log(this.form);
-      });
+      get("/abtest/test-info/list", { ids: this.$route.query.copyId }).then(
+        (res) => {
+          let nres = JSON.parse(JSON.stringify(res.data[0]));
+          this.timeBox = [nres.beginTime, nres.endTime];
+    
+          this.channelBox = nres.channelKey.split(",");
+          this.form = nres;
+          this.form.name = nres.name + " 副本";
+          console.log(this.form);
+        }
+      );
     }
     }
   },
   },
   methods: {
   methods: {
@@ -311,94 +323,88 @@ export default {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning",
         type: "warning",
-      })
-        .then(() => {
-          //   this.form.begintime = date.getTime();
-          //   this.form.endTime = date.getTime();
-          console.log(this.timeBox, 11);
-          this.$refs[formName].validate((valid) => {
+      }).then(() => {
+        this.$refs[formName].validate((valid) => {
+          console.log(valid);
+          if (valid) {
+            console.log(this.form);
             console.log(valid);
             console.log(valid);
-            if (valid) {
-              if (this.form.groupData.length < 2) {
+
+            // if (this.form.groupData.length < 2) {
+            //   this.$message({
+            //     message: "至少保留一组控制组",
+            //     type: "warning",
+            //     duration: 3000,
+            //     offset: 360,
+            //   });
+            //   return false;
+            // }
+
+            // let sum = 0;
+            // let havestag = true;
+            // this.form.groupData.forEach((item, index) => {
+            //   sum = item.flowPercent * 1 + sum;
+            //   if (!item.strategyId) {
+            //     this.$message({
+            //       message: "请选择策略",
+            //       type: "warning",
+            //       duration: 3000,
+            //       offset: 360,
+            //     });
+            //     havestag = false;
+            //   }
+            // });
+
+            //   if (sum !== 1) {
+            //     this.$message({
+            //       message: "分流之和需要等于1",
+            //       type: "warning",
+            //       duration: 3000,
+            //       offset: 360,
+            //     });
+            //     return false;
+            //   }
+            // if (havestag === false) return faslse;
+
+            if (this.$route.query.ids) {
+              console.log("编辑");
+              console.log(this.form);
+
+              put("/abtest/test-info/update", this.form).then((res) => {
                 this.$message({
                 this.$message({
-                  message: "至少保留一组控制组",
-                  type: "warning",
+                  message: "编辑成功",
+                  type: "success",
                   duration: 3000,
                   duration: 3000,
                   offset: 360,
                   offset: 360,
                 });
                 });
-                return false;
-              }
-              let sum = 0;
-              let havestag = true;
-              this.form.groupData.forEach((item, index) => {
-                sum = item.flowPercent * 1 + sum;
-                if (!item.strategyId) {
-                  this.$message({
-                    message: "请选择策略",
-                    type: "warning",
-                    duration: 3000,
-                    offset: 360,
-                  });
-                  havestag = false;
-                }
-              });
 
 
-              //   if (sum !== 1) {
-              //     this.$message({
-              //       message: "分流之和需要等于1",
-              //       type: "warning",
-              //       duration: 3000,
-              //       offset: 360,
-              //     });
-              //     return false;
-              //   }
-              if (havestag === false) return false;
-
-              if (this.$route.query.id) {
+                //   setTimeout(() => {
+                //     window.close();
+                //   }, 1500);
+              });
+            } else {
+              this.form.beginTime = this.timeBox[0];
+              this.form.endTime = this.timeBox[1];
+              post("/abtest/test-info/create", this.form).then((res) => {
+                console.log("新建");
                 console.log(this.form);
                 console.log(this.form);
-                post(
-                  "/abtest/info/update/" + this.$route.query.id,
-                  this.form
-                ).then((res) => {
-                  this.$message({
-                    message: res.message,
-                    type: "success",
-                    duration: 3000,
-                    offset: 360,
-                  });
-
-                  //   setTimeout(() => {
-                  //     window.close();
-                  //   }, 1500);
-                });
-              } else {
-                this.form.begintime = this.timeBox[0];
-                this.form.endTime = this.timeBox[1];
-                post("/abtest/test-info/create", this.form).then((res) => {
-                  console.log(this.form);
-                  this.$message({
-                    message: res.message,
-                    type: "success",
-                    duration: 3000,
-                    offset: 360,
-                  });
-                  setTimeout(() => {
-                    window.close();
-                  }, 1500);
+                this.$message({
+                  message: "创建成功",
+                  type: "warning",
+                  duration: 3000,
+                  offset: 360,
                 });
                 });
-              }
-            } else {
-              console.log("error submit!!");
-              return false;
+                setTimeout(() => {
+                  this.$router.back();
+                }, 1500);
+              });
             }
             }
-          });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "已取消",
-          });
+          } else {
+            console.log("error submit!!");
+            return false;
+          }
         });
         });
+      });
     },
     },
 
 
     // 取消按钮
     // 取消按钮

+ 47 - 31
admin/src/views/ABtest/index.vue

@@ -63,8 +63,8 @@
             :edit-render="{ name: '$select', options: strategyStatus }"
             :edit-render="{ name: '$select', options: strategyStatus }"
             width="80"
             width="80"
           />
           />
-          <vxe-table-column field="begintime" title="开始时间" />
-          <vxe-table-column field="endtime" title="结束时间" />
+          <vxe-table-column field="beginTime" title="开始时间" />
+          <vxe-table-column field="endTime" title="结束时间" />
           <vxe-table-column title="操作" width="220">
           <vxe-table-column title="操作" width="220">
             <template #default="{ row }">
             <template #default="{ row }">
               <template v-if="$refs.xTable.isActiveByRow(row)">
               <template v-if="$refs.xTable.isActiveByRow(row)">
@@ -73,7 +73,7 @@
               </template>
               </template>
               <template v-else>
               <template v-else>
                 <vxe-button @click="toEdit(row.id)">编辑</vxe-button>
                 <vxe-button @click="toEdit(row.id)">编辑</vxe-button>
-                <vxe-button @click="toCopy(row)">复制</vxe-button>
+                <vxe-button @click="toCopy(row.id)">复制</vxe-button>
                 <vxe-button @click="del(row.id)">删除</vxe-button>
                 <vxe-button @click="del(row.id)">删除</vxe-button>
               </template>
               </template>
             </template>
             </template>
@@ -100,15 +100,15 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { post, get,del } from "@/api/common";
-
+import { post, get, del } from "@/api/common";
+import getTime from "@/utils/getTime.js";
 export default {
 export default {
   name: "Index",
   name: "Index",
   data() {
   data() {
     return {
     return {
       //  搜索相关内容
       //  搜索相关内容
       searchForm: {
       searchForm: {
-        name: "",
+        strategyName: null,
         state: 1,
         state: 1,
         pageNo: 1,
         pageNo: 1,
         pageSize: 10,
         pageSize: 10,
@@ -127,13 +127,28 @@ export default {
     this.init();
     this.init();
   },
   },
   methods: {
   methods: {
+    getTimeStr(timeStamp) {
+      var now = new Date(timeStamp),
+        y = now.getFullYear(),
+        m = ("0" + (now.getMonth() + 1)).slice(-2),
+        d = ("0" + now.getDate()).slice(-2);
+      return y + "-" + m + "-" + d + " " + now.toTimeString().substr(0, 8);
+    },
+
     init() {
     init() {
       get("/abtest/test-info/page", this.searchForm).then((res) => {
       get("/abtest/test-info/page", this.searchForm).then((res) => {
         this.tableData = res.data.list;
         this.tableData = res.data.list;
         console.log(this.tableData);
         console.log(this.tableData);
+        this.tableData.forEach((item) => {
+          item.beginTime = getTime(item.beginTime);
+          item.endTime = getTime(item.endTime);
+        });
+        console.log(this.tableData[0].beginTime, 11111111111111);
+
         this.searchForm.totalResult = res.data.total;
         this.searchForm.totalResult = res.data.total;
       });
       });
     },
     },
+
     editClosedEvent({ row, column }) {
     editClosedEvent({ row, column }) {
       const $table = this.$refs.xTable;
       const $table = this.$refs.xTable;
       const field = column.property;
       const field = column.property;
@@ -171,35 +186,36 @@ export default {
       this.$router.push("/ABtest/edit");
       this.$router.push("/ABtest/edit");
     },
     },
     toEdit(id) {
     toEdit(id) {
-      this.$router.push("/ABtest/edit?ids="+id);
+      this.$router.push("/ABtest/edit?ids=" + id);
     },
     },
-    toCopy(e) {
-      const routeUrl = this.$router.resolve({
-        path: "/ABtest/edit",
-        query: { copyId: e.id },
-      });
-      window.open(routeUrl.href, "_blank");
+    toCopy(id) {
+      // const routeUrl = this.$router.resolve({
+      //   path: "/ABtest/edit",
+      //   query: { copyId: e.id },
+      // });
+      // window.open(routeUrl.href, "_blank");
+      this.$router.push("/ABtest/edit?copyId=" + id);
     },
     },
     del(id) {
     del(id) {
-      // this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(() => {
-      //     const $table = this.$refs.xTable;
-      //     $table.remove(row);
-          
-      //   })
-      //   .catch(() => {
-      //     this.$message({
-      //       type: "info",
-      //       message: "已取消删除",
-      //     });
-        // });
-        del("/abtest/test-info/delete", { id }).then((res) => {
-            console.log(res);
+      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          // const $table = this.$refs.xTable;
+          // $table.remove(row);
+          del("/abtest/test-info/delete", { id }).then((res) => {
+            // console.log(res);
+            this.init();
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
           });
           });
+        });
     },
     },
     handlePageChange({ currentPage, pageSize }) {
     handlePageChange({ currentPage, pageSize }) {
       this.searchForm.pageNum = currentPage;
       this.searchForm.pageNum = currentPage;

+ 155 - 162
admin/src/views/ABtest/testData.vue

@@ -1,179 +1,172 @@
 <template>
 <template>
-    <div>
-        <el-container>
-            <!--搜索-->
-            <el-header class="searchBox">
-                <el-form :inline="true" :model="searchForm" ref="searchForm" class="demo-form-inline">
-                    <el-form-item label="测试名称">
-                        <el-input v-model="searchForm.name" name="searchForm.name" placeholder="请输入关键字"/>
-                    </el-form-item>
+  <div>
+    <el-container>
+      <!--搜索-->
+      <el-header class="searchBox">
+        <el-form
+          :inline="true"
+          :model="searchForm"
+          ref="searchForm"
+          class="demo-form-inline"
+        >
+          <el-form-item label="测试名称">
+            <el-input
+              v-model="searchForm.name"
+              name="searchForm.name"
+              placeholder="请输入关键字"
+            />
+          </el-form-item>
 
 
-                    <el-form-item style="float: right">
-                        <el-button type="primary" @click="init">搜索</el-button>
-                        <el-button @click="reset">重置</el-button>
-                    </el-form-item>
-                </el-form>
-            </el-header>
-            <!--表格-->
-            <el-main class="tableBox">
-                <vxe-toolbar>
-                    <template #buttons>
-                        <vxe-button @click="init()">刷新</vxe-button>
-                    </template>
-                </vxe-toolbar>
-                <vxe-table
-                        border
-                        resizable
-                        keep-source
-                        show-overflow
-                        highlight-hover-row
-                        stripe
-                        ref="xTable"
-                        :data="tableData"
-                        :span-method="mergeRowMethod"
-                >
-                    <vxe-table-column
-                            field="infoName"
-                            title="测试名称"
-                            width="180"
-                    />
-                    <vxe-table-column
-                            field="orderInfo"
-                            title="测试订购"
-                            width="100"
-                    />
-                    <vxe-table-column
-                            field="name"
-                            title="分组名称"
-                            width="180"
-                    />
-                    <vxe-table-column
-                            field="content"
-                            title="分组描述"
-                    />
-                    <vxe-table-column
-                            field="flowPercent"
-                            title="分流比例"
-                            width="100"
-                    />
-                    <vxe-table-column
-                            field="orderGroup"
-                            title="分组订购"
-                            width="100"
-                    />
-                </vxe-table>
-                <vxe-pager
-                        :loading="loading"
-                        :current-page="searchForm.pageNum"
-                        :page-size="searchForm.pageSize"
-                        :total="searchForm.totalResult"
-                        :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-                        @page-change="handlePageChange"
-                />
-            </el-main>
-        </el-container>
-    </div>
+          <el-form-item style="float: right">
+            <el-button type="primary" @click="init">搜索</el-button>
+            <el-button @click="reset">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </el-header>
+      <!--表格-->
+      <el-main class="tableBox">
+        <vxe-toolbar>
+          <template #buttons>
+            <vxe-button @click="init()">刷新</vxe-button>
+          </template>
+        </vxe-toolbar>
+        <vxe-table
+          border
+          resizable
+          keep-source
+          show-overflow
+          highlight-hover-row
+          stripe
+          ref="xTable"
+          :data="tableData"
+          :span-method="mergeRowMethod"
+        >
+          <vxe-table-column field="infoName" title="测试名称" width="180" />
+          <vxe-table-column field="orderInfo" title="测试订购" width="100" />
+          <vxe-table-column field="name" title="分组名称" width="180" />
+          <vxe-table-column field="content" title="分组描述" />
+          <vxe-table-column field="flowPercent" title="分流比例" width="100" />
+          <vxe-table-column field="orderGroup" title="分组订购" width="100" />
+        </vxe-table>
+        <vxe-pager
+          :loading="loading"
+          :current-page="searchForm.pageNum"
+          :page-size="searchForm.pageSize"
+          :total="searchForm.totalResult"
+          :layouts="[
+            'PrevPage',
+            'JumpNumber',
+            'NextPage',
+            'FullJump',
+            'Sizes',
+            'Total',
+          ]"
+          @page-change="handlePageChange"
+        />
+      </el-main>
+    </el-container>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
-    import {post, get} from '@/api/common'
+import { post, get } from "@/api/common";
 
 
-    export default {
-        name: 'Index',
-        data() {
-            return {
-                //  搜索相关内容
-                searchForm: {
-                    name: '',
-                    // id: '1463041030558453760',
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                },
-                // 表格数据
-                loading: false,
-                tableData: [],
-            }
-        },
-        mounted() {
-            this.init()
-        },
-        methods: {
-            init() {
-                get('/abtest/info/orderdata', this.searchForm).then(res => {
-                    this.tableData = res.data.list
-                    this.searchForm.totalResult = res.data.total
-                })
-            },
-            // 重置
-            reset() {
-                this.searchForm = {
-                    name: '',
-                    state: 1,
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                }
-                this.init()
-            },
-            // 翻页
-            handlePageChange({currentPage, pageSize}) {
-                this.searchForm.pageNum = currentPage
-                this.searchForm.pageSize = pageSize
-                this.init()
-            },
-            // 合并函数
-            mergeRowMethod({row, _rowIndex, column, visibleData}) {
-                const fields = ['infoName', 'orderInfo']
-                const cellValue = row[column.property]
-                if (cellValue && fields.includes(column.property)) {
-                    const prevRow = visibleData[_rowIndex - 1]
-                    let nextRow = visibleData[_rowIndex + 1]
-                    if (prevRow && prevRow[column.property] === cellValue) {
-                        return {rowspan: 0, colspan: 0}
-                    } else {
-                        let countRowspan = 1
-                        while (nextRow && nextRow[column.property] === cellValue) {
-                            nextRow = visibleData[++countRowspan + _rowIndex]
-                        }
-                        if (countRowspan > 1) {
-                            return {rowspan: countRowspan, colspan: 1}
-                        }
-                    }
-                }
-            }
+export default {
+  name: "Index",
+  data() {
+    return {
+      //  搜索相关内容
+      searchForm: {
+        name: "",
+        // id: '1463041030558453760',
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0,
+      },
+      // 表格数据
+      loading: false,
+      tableData: [],
+    };
+  },
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      get("/abtest/info/orderdata", this.searchForm).then((res) => {
+        this.tableData = res.data.list;
+        this.searchForm.totalResult = res.data.total;
+      });
+    },
+    // 重置
+    reset() {
+      this.searchForm = {
+        name: "",
+        state: 1,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0,
+      };
+      this.init();
+    },
+    // 翻页
+    handlePageChange({ currentPage, pageSize }) {
+      this.searchForm.pageNum = currentPage;
+      this.searchForm.pageSize = pageSize;
+      this.init();
+    },
+    // 合并函数
+    mergeRowMethod({ row, _rowIndex, column, visibleData }) {
+      const fields = ["infoName", "orderInfo"];
+      const cellValue = row[column.property];
+      if (cellValue && fields.includes(column.property)) {
+        const prevRow = visibleData[_rowIndex - 1];
+        let nextRow = visibleData[_rowIndex + 1];
+        if (prevRow && prevRow[column.property] === cellValue) {
+          return { rowspan: 0, colspan: 0 };
+        } else {
+          let countRowspan = 1;
+          while (nextRow && nextRow[column.property] === cellValue) {
+            nextRow = visibleData[++countRowspan + _rowIndex];
+          }
+          if (countRowspan > 1) {
+            return { rowspan: countRowspan, colspan: 1 };
+          }
         }
         }
-    }
+      }
+    },
+  },
+};
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-    .searchBox {
-        background-color: #fff;
-        border-radius: 4px;
-        box-shadow: #bfbfbf 0 0 2px;
-        height: unset !important;
-        padding: 10px 10px;
+.searchBox {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
+  height: unset !important;
+  padding: 10px 10px;
 
 
-        form {
-            margin: auto;
+  form {
+    margin: auto;
 
 
-            .el-form-item {
-                margin: 5px 5px;
-            }
-        }
+    .el-form-item {
+      margin: 5px 5px;
     }
     }
+  }
+}
 
 
-    .tableBox {
-        margin-top: 10px;
-        background-color: #fff;
-        border-radius: 4px;
-        box-shadow: #bfbfbf 0 0 2px;
+.tableBox {
+  margin-top: 10px;
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
 
 
-        .block {
-            .el-pagination {
-                margin-top: 30px;
-                float: right;
-            }
-        }
+  .block {
+    .el-pagination {
+      margin-top: 30px;
+      float: right;
     }
     }
+  }
+}
 </style>
 </style>

+ 1 - 1
admin/src/views/channel/allSecondChannel.vue

@@ -50,7 +50,7 @@
         <el-table-column prop="address" label="渠道类别"> </el-table-column>
         <el-table-column prop="address" label="渠道类别"> </el-table-column>
         <el-table-column prop="channelStatus" label="渠道形态">
         <el-table-column prop="channelStatus" label="渠道形态">
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="channelCode" label="生效时间"> </el-table-column>
+        <el-table-column prop="onlineTime" label="生效时间"> </el-table-column>
         <el-table-column
         <el-table-column
           label="操作"
           label="操作"
           align="center"
           align="center"

+ 2 - 1
admin/src/views/channel/secondChannelList.vue

@@ -394,8 +394,9 @@ export default {
       this.getSecondList();
       this.getSecondList();
     },
     },
     search() {
     search() {
-      get("/channel/info/page", thissearchForm).then((res) => {
+      get("/channel/info/listChannels", this.searchForm).then((res) => {
         console.log(res);
         console.log(res);
+        this.tableData=res.data.list
       });
       });
     },
     },
 
 

+ 14 - 1
admin/src/views/produce/produceClass/index.vue

@@ -154,6 +154,7 @@
 
 
 <script>
 <script>
 import { post, get, del, put } from "@/api/common";
 import { post, get, del, put } from "@/api/common";
+import getTime from "@/utils/getTime.js";
 export default {
 export default {
   name: "ProduceClass",
   name: "ProduceClass",
   data() {
   data() {
@@ -190,14 +191,26 @@ export default {
     that.search();
     that.search();
   },
   },
   methods: {
   methods: {
+    getTimeStr(timeStamp) {
+      var now = new Date(timeStamp),
+        y = now.getFullYear(),
+        m = ("0" + (now.getMonth() + 1)).slice(-2),
+        d = ("0" + now.getDate()).slice(-2);
+      return y + "-" + m + "-" + d + " " + now.toTimeString().substr(0, 8);
+    },
+
     async search() {
     async search() {
       // 同步搜索
       // 同步搜索
 
 
       await get("/product/cpid-info/page", this.searchForm)
       await get("/product/cpid-info/page", this.searchForm)
         .then((res) => {
         .then((res) => {
           this.tableData = res.data.list;
           this.tableData = res.data.list;
+          console.log(this.tableData, "商品分类");
+          this.tableData.forEach((item) => {
+            item.createTime = getTime(item.createTime);
+          });
+
           this.total = res.data.total;
           this.total = res.data.total;
-          console.log(res.data.list, "商品分类");
         })
         })
         .catch((err) => {
         .catch((err) => {
           console.log(err);
           console.log(err);

+ 16 - 3
admin/src/views/produce/productV2/productManagement.vue

@@ -75,6 +75,7 @@
 <script>
 <script>
 import { post, get, del, put } from "@/api/common";
 import { post, get, del, put } from "@/api/common";
 import { quillEditor } from "vue-quill-editor";
 import { quillEditor } from "vue-quill-editor";
+import getTime from "@/utils/getTime.js";
 export default {
 export default {
   components: {
   components: {
     quillEditor,
     quillEditor,
@@ -95,12 +96,24 @@ export default {
     this.getProductv2List();
     this.getProductv2List();
   },
   },
   methods: {
   methods: {
+    getTimeStr(timeStamp) {
+      var now = new Date(timeStamp),
+        y = now.getFullYear(),
+        m = ("0" + (now.getMonth() + 1)).slice(-2),
+        d = ("0" + now.getDate()).slice(-2);
+      return y + "-" + m + "-" + d + " " + now.toTimeString().substr(0, 8);
+    },
+
     getProductv2List() {
     getProductv2List() {
       get("product/info/page").then((res) => {
       get("product/info/page").then((res) => {
         this.productFrom.productData = res.data.list;
         this.productFrom.productData = res.data.list;
         this.productFrom.total = res.data.total;
         this.productFrom.total = res.data.total;
         this.productFrom.pageSize = res.data.pageSize;
         this.productFrom.pageSize = res.data.pageSize;
         this.productFrom.currenttPage = res.data.pageNum;
         this.productFrom.currenttPage = res.data.pageNum;
+
+          this.productFrom.productData.forEach((item) => {
+          item.createTime = getTime(item.createTime);
+        });
       });
       });
     },
     },
     // 编辑
     // 编辑
@@ -135,11 +148,11 @@ export default {
       let data = {
       let data = {
         pageNo: 1,
         pageNo: 1,
         pageSize: 100,
         pageSize: 100,
-        // productName: "",
-        // spid: "",
+        productName: this.productName,
+        spid: this.spid,
       };
       };
       get("/product/info/page", data).then((res) => {
       get("/product/info/page", data).then((res) => {
-        // console.log(res,"搜索");
+        console.log(res, "搜索");
         // this.productFrom=res.data.list
         // this.productFrom=res.data.list
         // console.log(this.form,"搜索");
         // console.log(this.form,"搜索");
         this.productFrom.productData = res.data.list;
         this.productFrom.productData = res.data.list;

+ 323 - 0
admin/src/views/schemeGlobal/index.vue

@@ -0,0 +1,323 @@
+<template>
+    <div>
+        <!--开关盒子-->
+        <div class="topBox">
+            <el-row :gutter="20">
+                <el-col class="itemList" v-for="item in itemList" :span="6">
+                    <div>
+                        <span>{{item.name}}:</span>
+                        <el-button v-if="item.status === 0" size="mini" type="primary" plain @click="open(item)">申请开启
+                        </el-button>
+                        <el-button v-else size="mini" type="warning" plain @click="close(item)">申请关闭</el-button>
+                    </div>
+                </el-col>
+            </el-row>
+        </div>
+        <!--表格-->
+        <div class="tableBox">
+            <vxe-toolbar>
+                <template #buttons>
+                    <vxe-button @click="init()">刷新</vxe-button>
+                </template>
+            </vxe-toolbar>
+            <vxe-table
+                    border
+                    resizable
+                    keep-source
+                    show-overflow
+                    highlight-hover-row
+                    ref="xTable"
+                    :data="tableData"
+                    :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }"
+                    :row-class-name="rowClassName"
+            >
+                <vxe-table-column
+                        field="name"
+                        title="名称"
+                        width="160"
+                />
+                <vxe-table-column
+                        field="operDetail"
+                        title="操作"
+                        width="100"
+                >
+                    <template #default="{ row }">
+                        {{ strStatus[row.operDetail] }}
+                    </template>
+                </vxe-table-column>
+                <vxe-table-column
+                        field="applicant"
+                        title="申请人"
+                        width="100"
+                />
+                <vxe-table-column
+                        field="status"
+                        title="状态"
+                        width="100"
+                >
+                    <template #default="{ row }">
+                        {{ strategyStatus[row.status] }}
+                    </template>
+                </vxe-table-column>
+                <vxe-table-column
+                        field="applyReason"
+                        title="申请原因"
+                />
+                <vxe-table-column
+                        field="createTime"
+                        title="申请时间"
+                        width="200"
+                />
+                <vxe-table-column
+                        field="modifyTime"
+                        title="审核时间"
+                        width="200"
+                />
+
+                <vxe-table-column title="操作" width="220">
+                    <template #default="{ row }">
+
+                        <template v-if="userName === '系统管理员' || userName === '张凯'">
+                            <vxe-button v-show="row.status === 1" @click="audit({row, status:3})">通过</vxe-button>
+                            <vxe-button v-show="row.status === 1" @click="audit({row, status:4})">驳回</vxe-button>
+                        </template>
+                        <template v-if="userName === row.applicant && row.status === 1">
+                            <vxe-button @click="audit({row, status:2})">撤回</vxe-button>
+                        </template>
+                    </template>
+                </vxe-table-column>
+            </vxe-table>
+            <vxe-pager
+                    :loading="loading"
+                    :current-page="searchForm.pageNum"
+                    :page-size="searchForm.pageSize"
+                    :total="searchForm.totalResult"
+                    :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+                    @page-change="handlePageChange"
+            />
+        </div>
+
+        <!--申请原因-->
+        <vxe-modal v-model="value5" width="60%" :title='this.strStatus[form.operDetail]+form.name'>
+            <el-input
+                    type="textarea"
+                    :autosize="{ minRows: 2, maxRows: 4}"
+                    placeholder="请输入申请原因"
+                    v-model="form.applyReason">
+            </el-input>
+            <el-row style="margin-top: 30px;display: flex;justify-content: flex-end">
+                <el-button @click="value5 = false">取消</el-button>
+                <el-button type="primary" @click="onSubmit">提交</el-button>
+            </el-row>
+        </vxe-modal>
+
+    </div>
+
+</template>
+
+<script>
+    import {post, get} from '@/api/common'
+
+    export default {
+        name: 'Index',
+        data() {
+            return {
+                //搜索相关
+                searchForm: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    totalResult: 0
+                },
+                // 表格数据
+                loading: false,
+                tableData: [],
+                itemList: [],
+                strategyStatus: ['--', '待审核', '撤回', '通过', '驳回'],
+                strStatus: ['申请关闭', '申请开启'],
+                userName: '',
+                form: {
+                    applicant: "",
+                    applyReason: "",
+                    infoId: "",
+                    name: "",
+                    operDetail: 1,
+                    status: 1,
+                    applyReason: '',
+                    tag: ""
+                },
+                value5: false
+            }
+        },
+        created() {
+            console.log('用户:', this.$store.state.user.name)
+            this.userName = this.$store.state.user.name
+        },
+        mounted() {
+            this.init()
+            this.getItemList()
+        },
+        methods: {
+            // 提交申请
+            onSubmit() {
+                this.$confirm('确定提交申请么, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    post('/strategyglobalrecord/create', this.form).then(res => {
+                        this.$message({
+                            message: res.message,
+                            type: 'success',
+                            duration: 3000,
+                            offset: 360
+                        })
+                        this.value5 = false
+                        this.init()
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });
+                });
+            },
+            // 控制项列表
+            getItemList() {
+                var that = this
+                get('/strategyglobalinfo/page', {pageNum: 1, pageSize: 9999,}).then(res => {
+                    that.itemList = res.data.list
+                })
+            },
+            // 订单列表
+            init() {
+                get('/strategyglobalrecord/page', this.searchForm).then(res => {
+                    this.tableData = res.data.list
+                    this.total = res.data.total
+                    this.searchForm.totalResult = res.data.total
+                })
+            },
+            // 新增打开申请
+            open(row) {
+                this.form = {
+                    applicant: this.userName,
+                    applyReason: "",
+                    infoId: row.id,
+                    name: row.name,
+                    operDetail: 1,
+                    status: 1,
+                    tag: row.tag
+                }
+                this.value5 = true
+            },
+            // 新增关闭申请
+            close(row) {
+                this.form = {
+                    applicant: this.userName,
+                    applyReason: "",
+                    infoId: row.id,
+                    name: row.name,
+                    operDetail: 0,
+                    status: 0,
+                    tag: row.tag
+                }
+                this.value5 = true
+            },
+
+
+            // 新增关闭申请
+            audit({row,status}) {
+                this.$confirm(`确定${this.strategyStatus[status]}该申请么, 是否继续?`, '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let update = {
+                        applicant: row.applicant,
+                        applyReason: row.applyReason,
+                        infoId: row.infoId,
+                        name: row.name,
+                        operDetail: row.operDetail,
+                        status: status,
+                        tag: row.tag
+                    }
+                    post('/strategyglobalrecord/update/'+row.id, update).then(res => {
+                        this.$message({
+                            message: res.message,
+                            type: 'success',
+                            duration: 3000,
+                            offset: 360
+                        })
+                        this.init()
+                        this.getItemList()
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消'
+                    });
+                });
+            },
+
+            // 翻页
+            handlePageChange({currentPage, pageSize}) {
+                this.searchForm.pageNum = currentPage
+                this.searchForm.pageSize = pageSize
+                this.init()
+            },
+
+            // 行颜色
+            rowClassName({ row, rowIndex }) {
+                console.log(row)
+                if (row.status === 1) {
+                    return 'row-green'
+                }
+            }
+
+        }
+    }
+</script>
+
+<style lang="scss">
+    .searchBox {
+        background-color: #fff;
+        border-radius: 4px;
+        box-shadow: #bfbfbf 0 0 2px;
+        height: unset !important;
+        padding: 10px 10px;
+
+        form {
+            margin: auto;
+
+            .el-form-item {
+                margin: 5px 5px;
+            }
+        }
+    }
+
+    .topBox {
+        padding: 20px;
+
+        .itemList {
+            padding: 10px 0
+        }
+    }
+
+    .tableBox {
+        padding: 20px;
+        margin-top: 10px;
+        background-color: #fff;
+        box-shadow: #bfbfbf 0 0 1px;
+
+        .row-green {
+            color: #e07010;
+            font-weight: 600;
+        }
+
+        .block {
+            .el-pagination {
+                margin-top: 30px;
+                float: right;
+            }
+        }
+    }
+</style>

+ 143 - 0
admin/src/views/schemeGlobal/itemEdit.vue

@@ -0,0 +1,143 @@
+<template>
+    <div>
+        <el-container>
+            <el-main>
+                <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px">
+                    <el-form-item label="名称" prop="name">
+                        <el-input style="width: 300px" v-model="form.name"/>
+                    </el-form-item>
+                    <el-form-item label="标识" prop="tag">
+                        <el-input style="width: 300px" v-model="form.tag"/>
+                    </el-form-item>
+                </el-form>
+            </el-main>
+            <el-footer>
+                <div class="bodyBox">
+                    <div style="display: flex;">
+                        <el-button type="primary" @click="onSubmit('ruleForm')">
+                            {{btn}}
+                        </el-button>
+                        <el-button @click="close">
+                            取消
+                        </el-button>
+                    </div>
+                </div>
+            </el-footer>
+        </el-container>
+    </div>
+</template>
+
+<script>
+    import {post, get} from '@/api/common'
+    export default {
+        name: "itemEdit",
+        data() {
+            return {
+                form: {
+                    name: '',
+                    tag: '',
+                    status: 0
+                },
+                rules: {
+                    name: [
+                        {required: true, message: '请输入名称', trigger: 'blur'},
+                    ],
+                    tag: [
+                        {required: true, message: '请输入标签', trigger: 'blur'},
+                    ]
+                },
+                btn: '新建',
+            }
+        },
+        created() {
+            document.title = '管理项登记'
+            if (this.$route.query.id) {
+                get('/strategyglobalinfo/page', {'id': this.$route.query.id}).then(res => {
+                    res = res.data.list[0];
+                    this.form = res;
+                    console.log(this.form)
+
+                });
+                this.btn = '修改'
+            }
+        },
+        methods: {
+            // 提交按钮
+            onSubmit: function (formName) {
+                this.$confirm('您确定编辑该项?当前操作会影响所有相关测试', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.$refs[formName].validate((valid) => {
+                        if (valid) {
+                            if (this.$route.query.id) {
+                                post('/strategyglobalinfo/update/'+this.$route.query.id, this.form).then(res => {
+                                    this.$message({
+                                        message: res.message,
+                                        type: 'success',
+                                        duration: 3000,
+                                        offset: 360
+                                    })
+                                    setTimeout(() => {window.close()}, 1200)
+                                }).catch(error => {
+                                    console.log(error)
+                                })
+                            } else {
+                                let updata = {
+                                    name : this.form.name,
+                                    tag : this.form.tag,
+                                    status : 0,
+                                };
+                                post('/strategyglobalinfo/create', updata).then(res => {
+                                    console.log(res)
+                                    this.$message({
+                                        message: res.message,
+                                        type: 'success',
+                                        duration: 3000,
+                                        offset: 360
+                                    })
+                                    setTimeout(() => {window.close()}, 1200)
+                                }).catch(error => {
+                                    console.log(error)
+                                })
+                            }
+                        } else {
+                            console.log('error submit!!');
+                            return false;
+                        }
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消'
+                    });
+                });
+            },
+
+            // 取消按钮
+            close() {
+                this.$confirm('此操作不会保存已编辑数据, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    window.location.href = 'about:blank'
+                    window.close()
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消'
+                    });
+                });
+            }
+        }
+    }
+</script>
+
+<style lang="scss">
+    .avatar {
+        width: 100%;
+        max-width: 500px;
+    }
+</style>

+ 190 - 0
admin/src/views/schemeGlobal/itemGlobal.vue

@@ -0,0 +1,190 @@
+<template>
+  <!-- <div
+    v-if="userName !== '系统管理员' && userName !== '张凯'"
+    style="margin: 50px 30px; text-align: center"
+  >
+    您没有当前页面操作权限
+  </div> -->
+  <!-- <div v-else> -->
+  <div>
+    <el-container>
+      <!--表格-->
+      <el-main class="tableBox">
+        <vxe-toolbar>
+          <template #buttons>
+            <vxe-button icon="fa fa-plus" @click="toAdd">新增</vxe-button>
+            <vxe-button @click="init()">刷新</vxe-button>
+          </template>
+        </vxe-toolbar>
+        <vxe-table
+          border
+          resizable
+          keep-source
+          show-overflow
+          highlight-hover-row
+          ref="xTable"
+          :data="tableData"
+          :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }"
+          @edit-closed="editClosedEvent"
+        >
+          <vxe-table-column field="name" title="名称" />
+          <vxe-table-column field="tag" title="标识" />
+          <vxe-table-column field="createtime" title="创建时间" width="200" />
+          <vxe-table-column title="操作" width="200">
+            <template #default="{ row }">
+              <template v-if="$refs.xTable.isActiveByRow(row)">
+                <vxe-button @click="saveRowEvent(row)">保存</vxe-button>
+                <vxe-button @click="cancelRowEvent(row)">取消</vxe-button>
+              </template>
+              <template v-else>
+                <vxe-button @click="toAdd(row)">编辑</vxe-button>
+                <vxe-button @click="del(row)">删除</vxe-button>
+              </template>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+        <vxe-pager
+          :loading="loading"
+          :current-page="searchForm.pageNum"
+          :page-size="searchForm.pageSize"
+          :total="searchForm.totalResult"
+          :layouts="[
+            'PrevPage',
+            'JumpNumber',
+            'NextPage',
+            'FullJump',
+            'Sizes',
+            'Total',
+          ]"
+          @page-change="handlePageChange"
+        />
+      </el-main>
+    </el-container>
+  </div>
+</template>
+
+<script>
+import { post, get } from "@/api/common";
+export default {
+  name: "Index",
+  data() {
+    return {
+      //搜索相关
+      searchForm: {
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0,
+      },
+      // 表格数据
+      loading: false,
+      tableData: [],
+      strategyStatus: [
+        { label: "生效", value: 1 },
+        { label: "无效", value: 0 },
+      ],
+      userName: "",
+    };
+  },
+  created() {
+    console.log("用户:", this.$store.state.user.name);
+    this.userName = this.$store.state.user.name;
+  },
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      get("/strategyglobalinfo/page", this.searchForm).then((res) => {
+        this.tableData = res.data.list;
+        this.total = res.data.total;
+        this.searchForm.totalResult = res.data.total;
+      });
+    },
+    editClosedEvent({ row, column }) {
+      const $table = this.$refs.xTable;
+      const field = column.property;
+      const cellValue = row[field];
+      // 判断单元格值是否被修改
+      if ($table.isUpdateByRow(row, field)) {
+        setTimeout(() => {
+          let param = {};
+          param[field] = cellValue;
+          post("/abtest/typedict/update/" + row.id, row).then((res) => {
+            this.$message({
+              message: res.message,
+              type: "success",
+            });
+          });
+          // 局部更新单元格为已保存状态
+          $table.reloadRow(row, null, field);
+        }, 300);
+      }
+    },
+    toAdd(e) {
+      //   const routeUrl = this.$router.resolve({
+      //     path: "/schemeGlobal/itemEdit",
+      //     query: { id: e.id },
+      //   });
+      //   window.open(routeUrl.href, "_blank");
+      this.$router.push("/schemeGlobal/itemEdit");
+    },
+    del(row) {
+      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          const $table = this.$refs.xTable;
+          $table.remove(row);
+          post("/strategyglobalinfo/delete", { ids: [row.id] }).then(
+            (res) => {}
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
+    handlePageChange({ currentPage, pageSize }) {
+      this.searchForm.pageNum = currentPage;
+      this.searchForm.pageSize = pageSize;
+      this.init();
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.searchBox {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
+  height: unset !important;
+  padding: 10px 10px;
+
+  form {
+    margin: auto;
+
+    .el-form-item {
+      margin: 5px 5px;
+    }
+  }
+}
+
+.tableBox {
+  margin-top: 10px;
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
+
+  .block {
+    .el-pagination {
+      margin-top: 30px;
+      float: right;
+    }
+  }
+}
+</style>

+ 675 - 0
admin/src/views/schemeProinfo/ProinfoEdit.vue

@@ -0,0 +1,675 @@
+<template>
+  <div>
+    <el-container>
+      <el-main>
+        <el-form
+          :model="form"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="100px"
+        >
+          <el-form-item label="策略名称" prop="name">
+            <el-input style="width: 300px" v-model="form.name" />
+          </el-form-item>
+          <el-form-item label="策略备注" prop="describeContent">
+            <el-input
+              type="textarea"
+              :autosize="{ minRows: 1, maxRows: 4 }"
+              style="width: 60%"
+              v-model="form.describeContent"
+            />
+          </el-form-item>
+          <el-form-item label="使用模板">
+            <el-select
+              v-model="form.templateName"
+              style="width: 300px"
+              clearable
+              placeholder="请选择模板"
+            >
+              <el-option
+                v-for="item in templateList"
+                :key="item.templateCode"
+                :label="item.templateName"
+                :value="item.templateCode"
+              >
+                <span style="float: left; margin-right: 10px">{{
+                  item.templateName
+                }}</span>
+                <el-popover placement="right" trigger="hover">
+                  <img :src="item.templatePhoto" width="400" />
+                  <img
+                    slot="reference"
+                    :src="item.templatePhoto"
+                    width="30"
+                    height="30"
+                    style="float: right"
+                  />
+                </el-popover>
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="启用遮罩">
+            <el-switch
+              style="width: 300px"
+              v-model="form.enableMask"
+              active-text="启用"
+              inactive-text="不启用"
+              :active-value="1"
+              :inactive-value="null"
+            />
+          </el-form-item>
+          <el-form-item label="遮罩文本">
+            <el-input
+              type="textarea"
+              :autosize="{ minRows: 1, maxRows: 4 }"
+              style="width: 60%"
+              v-model="form.maskText"
+            />
+          </el-form-item>
+          <el-form-item label="订购拦截">
+            <el-switch
+              style="width: 300px"
+              v-model="form.interceptRule"
+              active-text="启用"
+              inactive-text="不启用"
+              active-value="1"
+              :inactive-value="null"
+            />
+          </el-form-item>
+          <el-form-item label="推荐策略">
+            <el-select
+              v-model="recommendStrategy"
+              multiple
+              filterable
+              placeholder="请选择"
+              @change="recommendChange"
+            >
+              <el-option
+                v-for="(item, index) in strategyInfoNewList"
+                :key="index"
+                :label="item.strategyName"
+                :value="item.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="退订引流">
+            <el-select
+              clearable
+              v-model="form.cancelRule"
+              filterable
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="(item, index) in strategyInfoNewList"
+                :key="index"
+                :label="item.strategyName"
+                :value="item.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="状态">
+            <el-switch
+              style="width: 300px"
+              v-model="form.status"
+              active-text="生效中"
+              inactive-text="未生效"
+              :active-value="1"
+              :inactive-value="0"
+            />
+          </el-form-item>
+
+          <el-divider content-position="left">策略匹配</el-divider>
+
+          <el-form-item label="渠道选择">
+            <el-cascader
+              v-model="checkedchannel"
+              :options="options"
+              :props="props"
+              show-all-levels
+              clearable
+              @change="handleChange"
+              filterable
+            >
+            </el-cascader>
+          </el-form-item>
+          <el-form-item label="产品选择">
+            <el-select
+              v-model="spids"
+              multiple
+              filterable
+              placeholder="请选择"
+              @change="spidChange"
+            >
+              <el-option
+                v-for="(item, index) in productInfoList"
+                :key="index"
+                :label="item.productName+'/'+item.remark+'/'+item.spid"
+                :value="item.spid"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地区选择">
+            <el-select
+              v-model="locations"
+              multiple
+              filterable
+              placeholder="请选择"
+              @change="locationChange"
+            >
+              <el-option
+                v-for="item in locationlist"
+                :key="item"
+                :label="item"
+                :value="item"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="日期选择">
+            <el-date-picker
+              type="datetimerange"
+              clearable
+              v-model="datetimerange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              range-separator="至"
+              value-format="yyyy-MM-dd HH:mm:ss"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="星期选择">
+            <el-checkbox
+              :indeterminate="isIndeterminate"
+              v-model="checkAll"
+              @change="handleCheckAllChange"
+            >
+              全选
+            </el-checkbox>
+            <div style="margin: 15px 0"></div>
+            <el-checkbox-group
+              v-model="checkedWeeks"
+              @change="handleCheckedCitiesChange"
+            >
+              <el-checkbox
+                v-for="item in weeksList"
+                :label="item"
+                :key="item"
+                >{{ item }}</el-checkbox
+              >
+            </el-checkbox-group>
+          </el-form-item>
+          <el-form-item label="时间选择">
+            <el-time-picker
+              v-model="form.beginTime"
+              :picker-options="{ start: '00:00', end: '18:30' }"
+              format="HH:mm:ss"
+              value-format="HH:mm:ss"
+              placeholder="开始时间"
+            >
+            </el-time-picker>
+            -
+            <el-time-picker
+              v-model="form.endTime"
+              format="HH:mm:ss"
+              value-format="HH:mm:ss"
+              placeholder="结束时间"
+            >
+            </el-time-picker>
+          </el-form-item>
+        </el-form>
+      </el-main>
+      <el-footer>
+        <div class="bodyBox">
+          <div style="display: flex; justify-content: flex-end">
+            <el-button type="primary" @click="onSubmit('ruleForm')">
+              {{ btn }}
+            </el-button>
+            <el-button @click="close"> 取消 </el-button>
+          </div>
+        </div>
+      </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+function getArrayClassification(params) {
+  var options = {
+    data: params.data,
+    parent: params.parent,
+    id: params.id,
+    child: params.child,
+  };
+  let tree = options.data.filter(function (parent) {
+    let item = options.data.filter(function (child) {
+      return parent[options.id] == child[options.parent];
+    });
+    if (item.length > 0) {
+      parent[options.child] = item;
+    }
+    return parent[options.parent] == 0;
+  });
+  return tree;
+}
+
+import { post, get } from "@/api/common";
+
+const XEUtils = require("xe-utils");
+const weekOptions = ["周日", "周一", "周二 ", "周三", "周四", "周五", "周六"];
+export default {
+  name: "SchemeAdd",
+  data() {
+    return {
+      // 图片上传api
+      imgapi: process.env.VUE_APP_BASE_IMG_API,
+      //模版列表
+      templateList: [],
+      //产品列表
+      productInfoList: [],
+      //策略列表
+      strategyInfoNewList: [],
+      //地区列表
+      locationlist: [
+        "北京",
+        "上海",
+        "天津",
+        "重庆",
+        "黑龙江",
+        "吉林",
+        "辽宁",
+        "内蒙古",
+        "河北",
+        "新疆",
+        "甘肃",
+        "青海",
+        "陕西",
+        "宁夏",
+        "河南",
+        "山东",
+        "山西",
+        "安徽",
+        "湖北",
+        "湖南",
+        "江苏",
+        "四川",
+        "贵州",
+        "云南",
+        "广西",
+        "西藏",
+        "浙江",
+        "江西",
+        "广东",
+        "福建",
+        "台湾",
+        "海南",
+        "香港",
+        "澳门",
+      ],
+
+      //策略匹配
+      activeNames: ["1"],
+      datetimerange: [],
+      timerange: [],
+      recommendStrategy: [],
+      checkAll: true,
+      weeksList: weekOptions,
+      isIndeterminate: true,
+      checkedWeeks: [],
+      //渠道选择
+      props: {
+        multiple: true,
+      },
+      options: [],
+      checkedchannel: [],
+      spids: [],
+      locations: [], //策略表单
+      form: {
+        beginDateTime: "",
+        beginTime: "00:00:00",
+        cancelRule: "",
+        describeContent: "",
+        enableMask: 0,
+        endDateTime: "",
+        endTime: "23:59:59",
+        firstChannel: "",
+        id: 0,
+        interceptRule: "",
+        maskText: "",
+        name: "",
+        recommendStrategy: "",
+        secondChannel: "",
+        status: null,
+        templateName: "",
+        week: "0,1,2,3,4,5,6",
+      },
+      btn: "立即创建",
+
+      rules: {
+        name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
+      },
+    };
+  },
+  watch: {
+    datetimerange(val) {
+      if (val) {
+        this.form.beginDateTime = val[0];
+        this.form.endDateTime = val[1];
+      } else {
+        this.form.beginDateTime = "";
+        this.form.endDateTime = "";
+      }
+    },
+    timerange(val) {
+      this.form.beginTime = val[0];
+      this.form.endTime = val[1];
+    },
+    checkedWeeks(val) {
+      this.form.week = val
+        .map((i) => weekOptions.findIndex((j) => j == i))
+        .sort()
+        .toString();
+      // console.log(this.form.week)
+    },
+  },
+  created() {
+    document.title = "编辑策略";
+  },
+  mounted() {
+    if (this.$route.query.id) {
+      get("/strategyproinfo/page", { id: this.$route.query.id }).then((res) => {
+        res = res.data.list[0];
+        this.form = {
+          spids: res.spids,
+          beginDateTime: res.beginDateTime,
+          beginTime: res.beginTime,
+          cancelRule: res.cancelRule,
+          describeContent: res.describeContent,
+          enableMask: res.enableMask,
+          endDateTime: res.endDateTime,
+          endTime: res.endTime,
+          firstChannel: res.firstChannel,
+          interceptRule: res.interceptRule,
+          maskText: res.maskText,
+          name: res.name,
+          recommendStrategy: res.recommendStrategy,
+          secondChannel: res.secondChannel,
+          status: res.status,
+          templateName: res.templateName,
+          week: res.week,
+          location: res.location,
+        };
+        if (res.cancelRule) {
+          this.form.cancelRule = res.cancelRule * 1;
+        }
+        if (res.recommendStrategy) {
+          let list = res.recommendStrategy.split(",");
+          list.forEach((item) => {
+            this.recommendStrategy.push(item * 1);
+          });
+        }
+        if (res.spids) {
+          this.spids = res.spids.split(",");
+        }
+        if (res.location) {
+          this.locations = res.location.split(",");
+        }
+        if (res.beginDateTime) {
+          this.datetimerange = [res.beginDateTime, res.endDateTime];
+        }
+        let checkedWeeks = res.week.split(",");
+        checkedWeeks.forEach((item) => {
+          this.checkedWeeks.push(weekOptions[item]);
+        });
+        let checkedchannel = [];
+        let firstChannel = res.firstChannel.split(",");
+        let secondChannel = res.secondChannel.split(",");
+        secondChannel.forEach((item, key) => {
+          checkedchannel.push([firstChannel[key], item]);
+        });
+        this.checkedchannel = checkedchannel;
+      });
+      this.btn = "编辑保存";
+    }
+
+    if (this.$route.query.copyId) {
+      get("/strategyproinfo/page", { id: this.$route.query.copyId }).then(
+        (res) => {
+          console.log(res);
+          res = res.data.list[0];
+          this.form = {
+            spids: res.spids,
+            beginDateTime: res.beginDateTime,
+            beginTime: res.beginTime,
+            cancelRule: res.cancelRule,
+            describeContent: res.describeContent,
+            enableMask: res.enableMask,
+            endDateTime: res.endDateTime,
+            endTime: res.endTime,
+            firstChannel: res.firstChannel,
+            interceptRule: res.interceptRule,
+            maskText: res.maskText,
+            name: res.name + " 副本",
+            recommendStrategy: res.recommendStrategy,
+            secondChannel: res.secondChannel,
+            status: res.status,
+            templateName: res.templateName,
+            week: res.week,
+            location: res.location,
+          };
+          console.log(this.form);
+          if (res.cancelRule) {
+            this.form.cancelRule = res.cancelRule * 1;
+          }
+          if (res.recommendStrategy) {
+            let list = res.recommendStrategy.split(",");
+            list.forEach((item) => {
+              this.recommendStrategy.push(item * 1);
+            });
+          }
+          if (res.spids) {
+            this.spids = res.spids.split(",");
+          }
+          if (res.location) {
+            this.locations = res.location.split(",");
+          }
+          if (res.activeStartDate) {
+            this.datetimerange = [res.beginDateTime, res.endDateTime];
+          }
+          let checkedWeeks = res.week.split(",");
+          checkedWeeks.forEach((item) => {
+            this.checkedWeeks.push(weekOptions[item]);
+          });
+          let checkedchannel = [];
+          let firstChannel = res.firstChannel.split(",");
+          let secondChannel = res.secondChannel.split(",");
+          secondChannel.forEach((item, key) => {
+            checkedchannel.push([firstChannel[key], item]);
+          });
+          this.checkedchannel = checkedchannel;
+        }
+      );
+    }
+
+    get("/productInfo/list", { pageSize: 9999, pageNum: 1 }).then((res) => {
+      this.productInfoList = res.data.list;
+    });
+    get("/templateInfo/page", { pageSize: 9999, pageNum: 1 }).then((res) => {
+      res.data.list.map((res) => {
+        res.templatePhoto =
+          process.env.VUE_APP_BASE_IMG_URL + res.templatePhoto;
+      });
+      this.templateList = res.data.list;
+    });
+    get("/strategyInfoNew/page", { pageSize: 9999, pageNum: 1 }).then((res) => {
+      this.strategyInfoNewList = res.data.list;
+    });
+    get("/channelInfo/page", { pageSize: 9999, pageNum: 1 }).then((res) => {
+      this.options = getArrayClassification({
+        data: res.data.list,
+        parent: "parentId",
+        id: "id",
+        child: "children",
+      });
+      this.props = {
+        multiple: true,
+        label: "channelName",
+        value: "channelKey",
+      };
+    });
+  },
+  methods: {
+    // 提交表单
+    onSubmit: function (formName) {
+      this.$confirm(
+        "您确定编辑该策略?当前操作会影响所有上线该策略的渠道",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(() => {
+          this.$refs[formName].validate((valid) => {
+            if (valid) {
+              this.form.week = this.checkedWeeks
+                .map((i) => weekOptions.findIndex((j) => j == i))
+                .sort()
+                .toString();
+              console.log(this.form);
+              if (this.$route.query.id) {
+                post(
+                  "/strategyproinfo/update/" + this.$route.query.id,
+                  this.form
+                ).then((res) => {
+                  this.$message({
+                    message: res.message,
+                    type: "success",
+                    duration: 3000,
+                    offset: 360,
+                  });
+                  setTimeout(() => {
+                      window.close()
+                  }, 1200)
+                });
+              } else {
+                post("/strategyproinfo/create", this.form).then((res) => {
+                  this.$message({
+                    message: res.message,
+                    type: "success",
+                    duration: 3000,
+                    offset: 360,
+                  });
+                  setTimeout(() => {
+                      window.close()
+                  }, 1200)
+                });
+              }
+            } else {
+              console.log("error submit!!");
+              return false;
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消",
+          });
+        });
+    },
+    // 星期全选
+    handleCheckAllChange(val) {
+      this.checkedWeeks = val ? weekOptions : [];
+      this.isIndeterminate = false;
+    },
+    // 星期选择
+    handleCheckedCitiesChange(value) {
+      let checkedCount = value.length;
+      this.checkAll = checkedCount === this.weeksList.length;
+      this.isIndeterminate =
+        checkedCount > 0 && checkedCount < this.weeksList.length;
+    },
+    // 渠道选择
+    handleChange(value) {
+      console.log(value);
+      let firstChannel = "";
+      let secondChannel = "";
+      value.forEach((val) => {
+        firstChannel = firstChannel + val[0] + ",";
+        secondChannel = secondChannel + val[1] + ",";
+      });
+      this.form.firstChannel = firstChannel.substring(
+        0,
+        firstChannel.length - 1
+      );
+      this.form.secondChannel = secondChannel.substring(
+        0,
+        secondChannel.length - 1
+      );
+      this.checkedchannel = value;
+    },
+    // 推荐策略切换
+    recommendChange(value) {
+      let ids = "";
+      value.forEach((item) => {
+        ids = ids + item + ",";
+      });
+      this.form.recommendStrategy = ids.substring(0, ids.length - 1);
+    },
+    // 产品切换
+    spidChange(value) {
+      let ids = "";
+      value.forEach((item) => {
+        ids = ids + item + ",";
+      });
+      this.form.spids = ids.substring(0, ids.length - 1);
+      console.log(this.form.spids);
+    },
+    // 地区切换
+    locationChange(value) {
+      let ids = "";
+      value.forEach((item) => {
+        ids = ids + item + ",";
+      });
+      this.form.location = ids.substring(0, ids.length - 1);
+      console.log(this.form.location);
+    },
+    // 关闭页面
+    close() {
+      this.$confirm("此操作不会保存已编辑数据, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          window.location.href = "about:blank";
+          window.close();
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消",
+          });
+        });
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.el-main {
+  height: 93vh;
+  padding-bottom: 100px;
+  .el-form {
+    margin-bottom: 50px;
+  }
+  .el-divider--horizontal {
+    margin: 70px 0 30px 0;
+  }
+}
+
+.avatar {
+  width: 100%;
+  max-width: 500px;
+}
+</style>

+ 233 - 0
admin/src/views/schemeProinfo/index.vue

@@ -0,0 +1,233 @@
+<template>
+    <div>
+        <el-container>
+            <!--搜索-->
+            <el-header class="searchBox">
+                <el-form :inline="true" :model="searchForm" ref="searchForm" class="demo-form-inline">
+                    <el-form-item label="策略名称">
+                        <el-input v-model="searchForm.name" placeholder="策略名称"/>
+                    </el-form-item>
+                    <el-form-item label="生效状态">
+                        <el-select v-model="searchForm.status" filterable placeholder="请选择">
+                            <el-option label="全部" :value="null"/>
+                            <el-option label="生效中" :value="1"/>
+                            <el-option label="未生效" :value="0"/>
+                        </el-select>
+                    </el-form-item>
+
+                    <el-form-item style="float: right">
+                        <el-button type="primary" @click="init()">搜索</el-button>
+                        <el-button @click="reset('searchForm')">重置</el-button>
+                    </el-form-item>
+                </el-form>
+            </el-header>
+            <!--表格-->
+            <el-main class="tableBox">
+                <vxe-toolbar>
+                    <template #buttons>
+                        <vxe-button icon="fa fa-plus" @click="toAdd">新增</vxe-button>
+                        <vxe-button @click="init()">刷新</vxe-button>
+                    </template>
+                </vxe-toolbar>
+                <vxe-table
+                        border
+                        resizable
+                        keep-source
+                        show-overflow
+                        highlight-hover-row
+                        ref="xTable"
+                        :data="tableData"
+                        :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }"
+                        @edit-closed="editClosedEvent"
+                >
+                    <vxe-table-column
+                            field="name"
+                            title="策略名称"
+                    />
+                    <vxe-table-column
+                            field="describeContent"
+                            title="策略备注"
+                            width="300"
+                    />
+                    <vxe-table-column
+                            field="status"
+                            title="状态"
+                            :edit-render="{name: '$select', options: strategyStatus}"
+                            width="100"
+                    />
+                    <vxe-table-column
+                            field="createTime"
+                            title="创建时间"
+                    />
+                    <vxe-table-column title="操作" width="220">
+                        <template #default="{ row }">
+                            <template v-if="$refs.xTable.isActiveByRow(row)">
+                                <vxe-button @click="saveRowEvent(row)">保存</vxe-button>
+                                <vxe-button @click="cancelRowEvent(row)">取消</vxe-button>
+                            </template>
+                            <template v-else>
+                                <vxe-button @click="toAdd(row)">编辑</vxe-button>
+                                <vxe-button @click="toCopy(row)">复制</vxe-button>
+                                <vxe-button @click="del(row)">删除</vxe-button>
+                            </template>
+                        </template>
+                    </vxe-table-column>
+                </vxe-table>
+                <vxe-pager
+                        :loading="loading"
+                        :current-page="searchForm.pageNum"
+                        :page-size="searchForm.pageSize"
+                        :total="searchForm.totalResult"
+                        :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+                        @page-change="handlePageChange"
+                />
+            </el-main>
+        </el-container>
+    </div>
+</template>
+
+<script>
+    import {post, get} from '@/api/common'
+
+    export default {
+        name: 'Index',
+        data() {
+            return {
+                //  搜索相关内容
+                searchForm: {
+                    name: '',
+                    status: null,
+                    pageNum: 1,
+                    pageSize: 10,
+                    totalResult:0
+                },
+                // 表格数据
+                loading: false,
+                tableData: [],
+                templateList: [],
+                strategyStatus: [
+                    {label: '生效中', value: 1},
+                    {label: '未生效', value: 0}
+                ],
+            }
+        },
+        mounted() {
+            get('/templateInfo/page', {'pageSize': 100, 'pageNum': 1}).then(res => {
+                res.data.list.map(res => {
+                    res.templatePhoto = process.env.VUE_APP_BASE_IMG_URL + res.templatePhoto
+                    res.label = res.templateName
+                    res.value = res.id
+                })
+                this.templateList = res.data.list
+            })
+            this.init()
+        },
+        methods: {
+            init() { // 列表搜索
+                // get('/strategyproinfo/page', this.searchForm).then(res => {
+                //     if(res.data) {
+                //         this.tableData = res.data.list
+                //         this.searchForm.totalResult = res.data.total
+                //     }else{
+                //         this.tableData = []
+                //         this.searchForm.totalResult = 0
+                //     }
+
+                // })
+            },
+            editClosedEvent({row, column}) {  // 列表修改
+                const $table = this.$refs.xTable
+                const field = column.property
+                const cellValue = row[field]
+                // 判断单元格值是否被修改
+                if ($table.isUpdateByRow(row, field)) {
+                    setTimeout(() => {
+                        let param = {}
+                        param[field] = cellValue
+                        post('/strategyproinfo/update/' + row.id, row).then(res => {
+                            this.$message({
+                                message: res.message,
+                                type: 'success'
+                            });
+                        })
+                        // 局部更新单元格为已保存状态
+                        $table.reloadRow(row, null, field)
+                    }, 300)
+                }
+            },
+            reset(formName) { // 重置
+                this.searchForm = {
+                    name: '',
+                    status: null,
+                    pageNum: 1,
+                    pageSize: 10,
+                    totalResult:0
+                }
+                this.init()
+            },
+            toAdd(e) {
+                // const routeUrl = this.$router.resolve({path: '/schemeProinfo/ProinfoEdit', query: {id: e.id}})
+                // window.open(routeUrl.href, '_blank')
+                this.$router.push("/schemeProinfo/ProinfoEdit")
+            },
+            toCopy(e) {
+                const routeUrl = this.$router.resolve({path: '/schemeProinfo/ProinfoEdit', query: {copyId: e.id}})
+                window.open(routeUrl.href, '_blank')
+            },
+            del(row) {
+                this.$confirm('此操作将永久删除该策略, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const $table = this.$refs.xTable
+                    $table.remove(row)
+                    post('/strategyproinfo/delete', {'ids': [row.id]}).then(res => {
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });
+                });
+            },
+            handlePageChange({currentPage, pageSize}) {
+                this.searchForm.pageNum = currentPage
+                this.searchForm.pageSize = pageSize
+                this.init()
+            }
+        }
+    }
+</script>
+
+<style lang="scss">
+    .searchBox {
+        background-color: #fff;
+        border-radius: 4px;
+        box-shadow: #bfbfbf 0 0 2px;
+        height: unset !important;
+        padding: 10px 10px;
+
+        form {
+            margin: auto;
+
+            .el-form-item {
+                margin: 5px 5px;
+            }
+        }
+    }
+
+    .tableBox {
+        margin-top: 10px;
+        background-color: #fff;
+        border-radius: 4px;
+        box-shadow: #bfbfbf 0 0 2px;
+
+        .block {
+            .el-pagination {
+                margin-top: 30px;
+                float: right;
+            }
+        }
+    }
+</style>

+ 393 - 0
admin/src/views/schemeProinfo/number.vue

@@ -0,0 +1,393 @@
+<template>
+  <div>
+    <el-container>
+      <!--搜索-->
+      <el-header class="searchBox">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item label="号码/号段">
+            <el-input v-model="number" placeholder="请输入关键字" />
+          </el-form-item>
+          <el-form-item label="类型">
+            <el-select v-model="type" filterable placeholder="请选择" clearable="">
+              <el-option v-for="item in typeList" :key="item.value" :value="item.value" :label="item.label" />
+
+            </el-select>
+          </el-form-item>
+
+          <el-form-item style="float: right">
+            <el-button type="primary" @click="getNumList()">搜索</el-button>
+            <el-button @click="reset()">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </el-header>
+      <!--表格-->
+      <el-main class="tableBox">
+        <vxe-toolbar>
+          <template #buttons>
+            <vxe-button @click="addShow = true" status="primary" content="新建规则" icon="fa fa-plus"></vxe-button>
+            <vxe-button @click="reportShow = true" status="warning" content="批量导入" icon="fa fa-plus"></vxe-button>
+            <vxe-button @click="reset" content="刷新" icon="fa fa-plus"></vxe-button>
+
+          </template>
+        </vxe-toolbar>
+        <vxe-table border resizable keep-source show-overflow highlight-hover-row ref="xTable" :data="tableData"
+          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }">
+          <vxe-table-column field="number" title="号码/号段" />
+          <vxe-table-column title="类型">
+            <template #default="{ row}">
+              <span v-if="row.type === 1">号码</span>
+              <span v-else-if="row.type === 2">号段</span>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column title="状态">
+            <template #default="{ row}">
+              <span v-if="row.state === 0">失效</span>
+              <span v-else-if="row.state === 1">生效</span>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="authType" title="认证方式">
+            <template #default="{ row}">
+              <span v-if="row.authType === '0'">统一认证</span>
+              <span v-else-if="row.authType === '1'">短信认证</span>
+              <span v-else-if="row.authType === '2'">简单认证</span>
+              <span v-else-if="row.authType === '3'">统一认证-升级</span>
+              <span v-else-if="row.authType === '4'">短信认证-升级</span>
+              <span v-else-if="row.authType === '5'">简单认证-升级</span>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="createtime" title="创建时间" />
+          <vxe-table-column title="操作">
+            <template #default="{ row}">
+              <vxe-button @click="editList(row)">编辑</vxe-button>
+              <vxe-button @click="removeList(row)">删除</vxe-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+        <!-- <vxe-pager :loading="loading" :current-page="pageNum" :page-size="pageSize" :total="total"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="handlePageChange" /> -->
+        <el-pagination style="float:right;margin-top:20px" @size-change="handleSizeChange"
+          @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10, 20, 50, 100]"
+          :page-size="pageSize" layout="total, sizes, prev, pager, next" :total="total">
+        </el-pagination>
+      </el-main>
+    </el-container>
+    <!-- 新增弹窗 -->
+    <el-dialog title="新增" :visible.sync="addShow" @close="addForm = {}">
+      <el-form :model="addForm" label-width="100px">
+        <el-form-item label="号码/号段">
+          <el-input v-model="addForm.number" style="width:300px"></el-input>
+        </el-form-item>
+        <el-form-item label="类型">
+          <el-select v-model="addForm.type" placeholder="请选择类型" style="width:300px">
+            <el-option label="号码" :value='1'></el-option>
+            <el-option label="号段" :value="2"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="认证方式">
+          <el-select v-model="addForm.authType" placeholder="请选择认证方式" style="width:300px">
+            <el-option label="统一认证" value='0'></el-option>
+            <el-option label="短信认证" value='1'></el-option>
+            <el-option label="简单认证" value="2"></el-option>
+            <el-option label="统一认证-升级" value="3"></el-option>
+            <el-option label="短信认证-升级" value="4"></el-option>
+            <el-option label="简单认证-升级" value="5"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="addShow = false">取 消</el-button>
+        <el-button type="primary" @click="addList">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!-- 编辑弹窗 -->
+    <el-dialog title="编辑" :visible.sync="editShow">
+      <el-form :model="editForm" label-width="100px">
+        <el-form-item label="号码/号段">
+          <el-input v-model="editForm.number" style="width:300px" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="类型">
+          <el-select disabled v-model="editForm.type" placeholder="请选择类型" style="width:300px">
+            <el-option label="号码" :value='1'></el-option>
+            <el-option label="号段" :value="2"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="认证方式">
+          <el-select v-model="editForm.authType" placeholder="请选择认证方式" style="width:300px">
+            <el-option label="统一认证" value='0'></el-option>
+            <el-option label="短信认证" value='1'></el-option>
+            <el-option label="简单认证" value="2"></el-option>
+            <el-option label="统一认证-升级" value="3"></el-option>
+            <el-option label="短信认证-升级" value="4"></el-option>
+            <el-option label="简单认证-升级" value="5"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="editShow = false">取 消</el-button>
+        <el-button type="primary" @click="editClick">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!-- 导入弹窗 -->
+    <el-dialog title="编辑" :visible.sync="reportShow">
+      <el-upload class="upload-demo" :limit="1" :multiple="false" drag action="#" :on-change="fileChange"
+        :auto-upload="false" show-file-list>
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+      </el-upload>
+      <div style="margin-top:30px">
+        <el-button @click="reportShow = false">取 消</el-button>
+        <el-button type="primary" @click="reportClick">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {
+    post,
+    get
+  } from '@/api/common'
+
+  export default {
+    name: 'Index',
+    data() {
+      return {
+        type: "",
+        typeList: [{
+          label: '号码',
+          value: 1
+        }, {
+          label: "号段",
+          value: 2
+        }, ],
+        loading: false,
+        number: "",
+
+        total: 0,
+        pageNum: 1,
+        pageSize: 10,
+        tableData: [],
+        addShow: false,
+        editShow: false,
+        reportShow: false,
+        addForm: {
+          number: "",
+          authType: "",
+          type: ""
+        },
+        editForm: {},
+        file: null
+      }
+    },
+    mounted() {
+      this.getNumList()
+    },
+    methods: {
+      // 分页查询
+      getNumList() {
+        let form = {
+          number: this.number,
+          pageNum: this.pageNum,
+          pageSize: this.pageSize,
+          type: this.type
+        }
+        // get('/number_segment/list', form).then(res => {
+        //   if (res.code === 10000) {
+        //     this.tableData = res.data.list
+        //     this.total = res.data.total
+        //     this.pageNum = res.data.pageNum
+        //     this.pageSize = res.data.pageSize
+        //   }
+        // })
+      },
+      //   编辑数据
+      editList(item) {
+        this.editShow = true
+        this.editForm = item
+      },
+      editClick() {
+        let {
+          authType,
+          type,
+          number,
+          id
+        } = this.editForm
+        if (number === '') {
+          this.$message.error('请填写手机号')
+          return false
+        }
+        if (type === '') {
+          this.$message.error('请选择类型')
+          return false
+        }
+        if (authType === '') {
+          this.$message.error('请选择认证方式')
+          return false
+        }
+        if (type === 1) {
+          if (!/^1[23456789]\d{9}$/.test(number)) {
+            this.$message.error('手机号格式有误')
+            return false
+          }
+        }
+        if (type === 2) {
+          if (number.length !== 4) {
+            this.$message.error('请输入4位号段')
+            return false
+          }
+        }
+        let params = {
+          authType: authType,
+          type: type,
+          number: number,
+        }
+        post('/number_segment/update/' + id, params).then(res => {
+          if (res.code === 10000) {
+            this.editShow = false
+            this.$message.success(res.data)
+            this.getNumList()
+          }
+        })
+      },
+      // 删除数据
+      removeList(item) {
+        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let {
+            id
+          } = item
+          let ids = []
+          ids.push(id)
+          post('/number_segment/delete', {
+            ids: ids
+          }).then(res => {
+            if (res.code === 10000) {
+              this.$message.success('删除成功')
+              this.getNumList()
+            }
+          })
+        })
+
+
+      },
+      //   新增数据
+      addList() {
+        if (this.addForm.number === '') {
+          this.$message.error('请填写手机号')
+          return false
+        }
+        if (this.addForm.type === '') {
+          this.$message.error('请选择类型')
+          return false
+        }
+        if (this.addForm.authType === '') {
+          this.$message.error('请选择认证方式')
+          return false
+        }
+        if (this.addForm.type === 1) {
+          if (!/^1[23456789]\d{9}$/.test(this.addForm.number)) {
+            this.$message.error('手机号格式有误')
+            return false
+          }
+        }
+        if (this.addForm.type === 2) {
+          if (this.addForm.number.length !== 4) {
+            this.$message.error('请输入4位号段')
+            return false
+          }
+        }
+        post('/number_segment/create', this.addForm).then(res => {
+          if (res.code === 10000) {
+            this.addShow = false
+            this.addForm = {}
+            this.$message.success(res.data)
+            this.getNumList()
+          }
+        })
+      },
+      //   重置
+      reset() {
+        this.number = ""
+        this.type = ""
+        this.authType = ""
+        this.pageNum = 1
+        this.pageSize = 10
+        this.getNumList()
+      },
+      //   上传文件
+      fileChange(file) {
+        this.file = file.raw
+      },
+      //   确认上传
+      reportClick() {
+        this.$confirm('此操作将导入该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let formData = new FormData()
+          formData.append('file', this.file)
+          post('/number_segment/batchImport', formData).then(res => {
+            if (res.code === 10000) {
+              this.$message.success('导入成功')
+              this.file = null
+              this.reportShow = false
+              this.getNumList()
+
+            }
+          })
+        })
+
+      },
+      //   分页切换数量
+      handleSizeChange(val) {
+        this.pageSize = val
+        this.pageNum = 1
+        this.getNumList()
+      },
+      //   分页切换页码
+      handleCurrentChange(val) {
+        this.pageNum = val
+        this.getNumList()
+      },
+    }
+  }
+
+</script>
+
+<style lang="scss">
+  .searchBox {
+    background-color: #fff;
+    border-radius: 4px;
+    box-shadow: #bfbfbf 0 0 2px;
+    height: unset !important;
+    padding: 10px 10px;
+
+    form {
+      margin: auto;
+
+      .el-form-item {
+        margin: 5px 5px;
+      }
+    }
+  }
+
+  .tableBox {
+    margin-top: 10px;
+    background-color: #fff;
+    border-radius: 4px;
+    box-shadow: #bfbfbf 0 0 2px;
+
+    .block {
+      .el-pagination {
+        margin-top: 30px;
+        float: right;
+      }
+    }
+  }
+
+</style>