소스 검색

修改展示页面

syh 5 년 전
부모
커밋
11919f22ee

+ 1 - 1
src/utils/request.js

@@ -12,7 +12,7 @@ const service = axios.create({
 })
 
 const err = (error) => {
-  if (error.response) {
+  if (error.esponse) {
     let data = error.response.data
     const token = Vue.ls.get(ACCESS_TOKEN)
     console.log("------异常响应------", token)

+ 31 - 4
src/views/modules/bytedance/model/InternalModel.vue

@@ -42,6 +42,22 @@
           <a-radio-button value="2">原生</a-radio-button>
         </a-radio-group>
       </a-form-item>
+      <a-form-item
+        label="用户定向模板"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol">
+        <a-select
+          v-model="userOrientationId"
+          showSearch
+          placeholder="选择用户定向模板"
+          optionFilterProp="children"
+          style="width: 200px"
+        >
+          <a-select-option v-for="userOrientation in userOrientationList" :key="userOrientation.id" :value="userOrientation.id">{{userOrientation.name}}</a-select-option>
+        </a-select>
+      </a-form-item>
+
+
       <!--<a-form-item
         label="广告类别"
         :labelCol="labelCol"
@@ -112,7 +128,7 @@
           @change="changeConvertType"
         >
           <a-select-option v-if="showSimple"value="SIMPLE">普通应用下载</a-select-option>
-          <!--<a-select-option value="API">应用下载API</a-select-option>-->
+          <a-select-option value="API">应用下载API</a-select-option>
         </a-select>
       </a-form-item>
 
@@ -305,6 +321,8 @@
     components: {AFormItem},
     data() {
       return {
+        userOrientationId:null,
+        userOrientationList:[],
         loading:false,
         templateName:'',
         title: "操作",
@@ -376,14 +394,15 @@
           userAllocationList:'/template/bind/login/list',
           dictListUrl: 'toutiao/dictitem/list',
           insertUrl: 'test/create',
-          convertList:'template/convert/list/url'
+          convertList:'template/convert/list/url/ng',
+          userOrentationList:'ctop/byteDanceUserOrientationTemplate/list'
         }
       }
     },
     methods: {
       refreshConvertApiId(){
         let params = {};
-        getAction(this.url.convertList+'?accountId='+this.accountId+'&urlId='+this.urlId ,params).then((res)=>{
+        getAction(this.url.convertList+'?bindAccountId='+this.accountId+'&urlId='+this.urlId ,params).then((res)=>{
           console.log(res);
           if(res.code == 0){
             this.activeConvertList = res.data.active_convert_list;
@@ -554,7 +573,7 @@
         }
         console.log("付费方式:" + this.priceType);
         console.log("目标转化出价:" + this.convertPrice);
-
+        params.userOrientationId = this.userOrientationId;
         params.templateName = this.templateName;
         params.accountId = this.accountId;
         params.deliveryRange = this.deliveryRange;
@@ -576,6 +595,7 @@
         params.convertPrice = this.convertPrice;
         params.itratorNum = this.itratorNum;
         params.templateName = this.templateName;
+        params.convertId = this.convertId;
         if (this.time != [] && this.time.length == 2) {
           params.startDate = moment(this.time[0]).format('YYYY-MM-DD HH:mm')
           params.endDate = moment(this.time[1]).format('YYYY-MM-DD HH:mm')
@@ -657,6 +677,13 @@
           this.userList = res.result.records
         }
       });
+      params = {};
+      params.pageSize = '1000';
+      postAction(this.url.userOrentationList, params).then((res) => {
+        if (res.success) {
+          this.userOrientationList = res.result.records
+        }
+      });
     }
   }
 

+ 120 - 106
src/views/template/userorientation/modules/ByteDanceUserOrientationTemplateModal.vue

@@ -9,114 +9,80 @@
     :width="800"
     :visible="visible"
     :confirmLoading="confirmLoading"
-    @ok="handleOk"
+    @ok="handleSubmit"
     @cancel="handleCancel"
     cancelText="关闭"
   >
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-form-item label="地域" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group v-model="area" :defaultValue="0">
-            <a-radio-button value="0">不限</a-radio-button>
-            <a-radio-button value="按省市">按省市</a-radio-button>
-            <a-radio-button value="按区县">按区县</a-radio-button>
-          </a-radio-group>
-        </a-form-item>
-        <a-form-item
-          label=" "
-          :colon="false"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          class="else-width"
-          v-if="area!='0'"
-        >
-          <transfer v-if="area == '按区县'" :checkData.sync="dataBox"></transfer>
-          <transfer-city v-if="area == '按省市'" :checkData.sync="dataBox"></transfer-city>
+        <a-form-item label="定向模板名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
+
+            <a-input v-model="name"></a-input>
+
         </a-form-item>
+<!--        <a-form-item label="地域" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
+<!--          <a-radio-group v-model="area" :defaultValue="0">-->
+<!--            <a-radio-button value="0">不限</a-radio-button>-->
+<!--            <a-radio-button value="按省市">按省市</a-radio-button>-->
+<!--            <a-radio-button value="按区县">按区县</a-radio-button>-->
+<!--          </a-radio-group>-->
+<!--        </a-form-item>-->
+<!--        <a-form-item-->
+<!--          label=" "-->
+<!--          :colon="false"-->
+<!--          :labelCol="labelCol"-->
+<!--          :wrapperCol="wrapperCol"-->
+<!--          class="else-width"-->
+<!--          v-if="area!='0'"-->
+<!--        >-->
+<!--          <transfer v-if="area == '按区县'" :checkData.sync="dataBox"></transfer>-->
+<!--          <transfer-city v-if="area == '按省市'" :checkData.sync="dataBox"></transfer-city>-->
+<!--        </a-form-item>-->
 
         <a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
           <a-radio-group v-model="gender">
-            <a-radio-button
-              v-for="sex in toutiaoSex"
-              :key="sex.itemValue"
-              :value="sex.itemValue"
-            >{{sex.description}}</a-radio-button>
+            <a-radio-button v-for="sex in toutiaoSex" :key="sex.itemValue" :value="sex.itemValue">{{sex.description}}</a-radio-button>
           </a-radio-group>
         </a-form-item>
 
         <a-form-item label="年龄" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-checkbox value>不限</a-checkbox>
           <a-checkbox-group v-model="ageRange">
-            <a-checkbox
-              v-for="age in toutiaoAgeRange"
-              :key="age.itemValue"
-              :value="age.itemValue"
-            >{{age.description}}</a-checkbox>
+            <a-checkbox v-for="age in toutiaoAgeRange" :key="age.itemValue" :value="age.itemValue">{{age.description}}</a-checkbox>
           </a-checkbox-group>
         </a-form-item>
 
-        <a-form-item label="自定义人群" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group v-model="zdyrq">
-            <a-radio-button value="as">不限</a-radio-button>
-            <a-radio-button value="sd">自定义人群</a-radio-button>
-          </a-radio-group>
-        </a-form-item>
-
-        <a-form-item label="兴趣定向" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group>
-            <a-radio-button value="as">不限</a-radio-button>
-            <a-radio-button value="sd">系统推荐</a-radio-button>
-            <a-radio-button value="zdy">自定义</a-radio-button>
-          </a-radio-group>
-        </a-form-item>
-
-        <a-form-item label="兴趣分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-tree-select
-            showSearch
-            style="width: 300px"
-            :value="value"
-            :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
-            placeholder="Please select"
-            allowClear
-            multiple
-            treeDefaultExpandAll
-            @change="onChange"
-            @search="onSearch"
-            @select="onSelect"
-          >
-            <a-tree-select-node value="parent 1" title="parent 1" key="0-1">
-              <a-tree-select-node value="parent 1-0" title="parent 1-0" key="0-1-1">
-                <a-tree-select-node value="leaf1" title="my leaf" key="random" />
-                <a-tree-select-node value="leaf2" title="your leaf" key="random1" />
-              </a-tree-select-node>
-              <a-tree-select-node value="parent 1-1" title="parent 1-1" key="random2">
-                <a-tree-select-node value="sss" key="random3">
-                  <b style="color: #08c" slot="title">sss</b>
-                </a-tree-select-node>
-              </a-tree-select-node>
-            </a-tree-select-node>
-          </a-tree-select>
-        </a-form-item>
-
-        <a-form-item label="精选流量包" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group>
-            <a-radio-button value="llb_bx">不限</a-radio-button>
-            <a-radio-button value="rjjx">应用软件精选</a-radio-button>
-            <a-radio-button value="yxjx">游戏精选</a-radio-button>
+        <a-form-item
+          label="兴趣定向"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol">
+          <a-radio-group v-model="intrestType">
+            <a-radio-button value="NONE">不限</a-radio-button>
+            <a-radio-button value="SYSTEM_TJ">系统推荐</a-radio-button>
+            <!--<a-radio-button value="ZDY">自定义</a-radio-button>-->
           </a-radio-group>
         </a-form-item>
 
+        <!--<a-form-item
+          label=" "
+          :colon="false"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          class="else-width"
+          v-if="intrestType=='ZDY'"
+        >
+          <intrest-category v-if="intrestType == 'ZDY'" :checkData.sync="intrestCategoryList"></intrest-category>
+        </a-form-item>-->
         <a-form-item label="平台" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group>
-            <a-radio-button value="as">不限</a-radio-button>
-            <a-radio-button value="sd">IOS</a-radio-button>
-            <a-radio-button value="sd">Android</a-radio-button>
+          <a-radio-group v-model="platformType">
+            <a-radio-button value="NONE">不限</a-radio-button>
+            <a-radio-button value="IOS">IOS</a-radio-button>
+            <a-radio-button value="ANDROID">Android</a-radio-button>
+            <a-radio-button value="PC">PC</a-radio-button>
           </a-radio-group>
         </a-form-item>
 
         <a-form-item label="网络" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-checkbox-group v-model="ageRange">
-            <a-checkbox value>不限</a-checkbox>
+          <a-checkbox-group v-model="netType">
             <a-checkbox
               v-for="netType in toutiaoNetType"
               :key="netType.itemValue"
@@ -125,48 +91,46 @@
           </a-checkbox-group>
         </a-form-item>
 
-        <a-form-item label="app行为" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group>
-            <a-radio-button value="as">不限</a-radio-button>
-            <a-radio-button value="sd">按分类</a-radio-button>
-            <a-radio-button value="sd">按app</a-radio-button>
+        <a-form-item label="智能放量" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-radio-group v-model="smartFl">
+            <a-radio-button value="0">不启用</a-radio-button>
+            <a-radio-button value="1">启用</a-radio-button>
           </a-radio-group>
         </a-form-item>
 
         <a-form-item label="文章分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
           <a-radio-group v-model="isArticleCategory" @change="changeArticleCategoryType">
-            <a-radio-button value="unlimit_category">不限</a-radio-button>
-            <a-radio-button value="category">文章分类</a-radio-button>
+            <a-radio-button value="NONE">不限</a-radio-button>
+            <a-radio-button value="CATEGORY">文章分类</a-radio-button>
           </a-radio-group>
           <br />
           <a-select
             mode="tags"
+            v-model="tags"
             placeholder="选择文章分类"
             style="width: 600px"
             @change="onChange"
-            v-if="showArticleCategory"
-          >
+            v-if="showArticleCategory">
             <a-select-option
               v-for="articleCategory in articleCategoryList"
               :key="articleCategory.itemValue"
-              :value="articleCategory.itemValue"
-            >{{articleCategory.itemText}}</a-select-option>
+              :value="articleCategory.itemValue">{{articleCategory.itemText}}</a-select-option>
           </a-select>
         </a-form-item>
 
         <a-form-item label="手机品牌" :labelCol="labelCol" :wrapperCol="wrapperCol">
           <a-radio-group @change="changeMobileBrandType" v-model="isMobileBrand">
-            <a-radio-button value="unlimit_brand">不限</a-radio-button>
-            <a-radio-button value="brand">按品牌</a-radio-button>
+            <a-radio-button value="NONE">不限</a-radio-button>
+            <a-radio-button value="BRAND">按品牌</a-radio-button>
           </a-radio-group>
           <br />
           <a-select
             mode="tags"
+            v-model="mobileType"
             placeholder="选择手机品牌"
             style="width: 600px"
             @change="onChange"
-            v-if="showMobileBrand"
-          >
+            v-if="showMobileBrand">
             <a-select-option
               v-for="mobileBrand in mobileBrandList"
               :key="mobileBrand.itemValue"
@@ -183,15 +147,27 @@
 import { deleteAction, postAction, getAction } from '@/api/manage'
 import transfer from './transfer'
 import transferCity from './transferCity'
+import intrestCategory from './IntrestCategory'
+import ARadioGroup from "ant-design-vue/es/radio/Group";
 export default {
   name: 'ByteDanceUserOrientationTemplateModal',
   components: {
+    ARadioGroup,
     transfer,
-    transferCity
+    transferCity,
+    intrestCategory
   },
   data() {
     return {
+      name:"",
+      netType:[],
+      platformType:"NONE",
+      mobileType:[],
+      intrestCategoryList:[],
+      smartFl:"0",
+      intrestType:"NONE",
       title: '操作',
+      intrestCategory:'',
       dataBox:[],
       visible: false,
       model: {},
@@ -205,17 +181,18 @@ export default {
       },
       confirmLoading: false,
       form: this.$form.createForm(this),
-      gender: {},
+      tags:[],
+      gender: "NONE",
       toutiaoSex: {},
       ageRange: [],
       toutiaoAgeRange: {},
       toutiaoNetType: {},
-      isMobileBrand: '',
+      isMobileBrand: "NONE",
       showMobileBrand: false,
       mobileBrandList: {},
       showArticleCategory: false,
       articleCategoryList: [],
-      isArticleCategory: {},
+      isArticleCategory: "NONE",
       zdyrq: [],
       area: "0",
       value: undefined,
@@ -285,7 +262,8 @@ export default {
         }
       ],
       url: {
-        dictListUrl: 'toutiao/dictitem/list'
+        dictListUrl: 'toutiao/dictitem/list',
+        insertUrl:'template/userorentation/insert'
       }
     }
   },
@@ -298,7 +276,7 @@ export default {
       this.edit({})
     },
     edit(record) {
-      this.form.resetFields()
+      // this.form.resetFields()
       this.model = Object.assign({}, record)
       this.visible = true
     },
@@ -320,7 +298,7 @@ export default {
     },
     changeMobileBrandType(value) {
       console.log(this.isMobileBrand)
-      if (this.isMobileBrand == 'brand') {
+      if (this.isMobileBrand == 'BRAND') {
         this.showMobileBrand = true
       } else {
         this.showMobileBrand = false
@@ -328,7 +306,7 @@ export default {
     },
     changeArticleCategoryType(value) {
       console.log(this.isMobileBrand)
-      if (this.isArticleCategory == 'category') {
+      if (this.isArticleCategory == 'CATEGORY') {
         this.showArticleCategory = true
       } else {
         this.showArticleCategory = false
@@ -340,6 +318,42 @@ export default {
     onSelect() {
       console.log(...arguments)
     },
+    handleSubmit(e) {
+      e.preventDefault()
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log('Received values of form: ', values);
+          let params = {};
+          params.gender = this.gender;
+          params.ageRange = this.ageRange;
+          params.intrestType = this.intrestType;
+          params.platformType = this.platformType;
+          params.netType = this.netType;
+          params.smartFl = this.smartFl;
+          params.isArticleCategory = this.isArticleCategory;
+          params.tags = this.tags;
+          params.isMobileBrand = this.isMobileBrand;
+          params.mobileType = this.mobileType;
+          params.name = this.name;
+
+          console.log(params);
+          postAction(this.url.insertUrl,params).then((res)=>{
+            console.log(res);
+            if(res.success){
+              if(null == this.id){
+                this.$message.success("投放目标模板创建成功");
+              }else {
+                this.$message.success("投放目标模板修改成功");
+              }
+              this.$emit('ok');
+              this.close();
+            }else{
+              this.$message.error(res.message);
+            }
+          });
+        }
+      })
+    },
     loadData2(arg) {
       if (!this.url.list2) {
         this.$message.error('请设置url.list2属性!')

+ 347 - 0
src/views/template/userorientation/modules/IntrestCategory.vue

@@ -0,0 +1,347 @@
+<style scoped>
+.transfer {
+  display: flex;
+}
+.transfer .transfer-box {
+  width: 350px;
+  height: 250px;
+  border: 1px solid #dadfe3;
+  display: flex;
+  overflow-x: auto;
+  overflow-y: hidden;
+  box-sizing: border-box;
+  margin-right: 25px;
+}
+.content-box {
+  min-width: 174px;
+  width: 100%;
+  height: 100%;
+  border-right: 1px solid #dadfe3;
+}
+.content-box .content-title {
+  width: 100%;
+  background: #f8f9fa;
+  border-bottom: 1px solid #dadfe3;
+  padding: 5px 15px;
+  font-size: 16px;
+  font-weight: 700;
+  line-height: 30px;
+}
+.content-box .content {
+  width: 100%;
+  height: 85%;
+  overflow: auto;
+}
+.content-box .content p:hover {
+  background: #edf1f5;
+  cursor: pointer;
+}
+.content-box .content p:hover span {
+  display: inline-block;
+}
+.content-box .content p span {
+  display: none;
+}
+p {
+  padding: 5px;
+  margin-bottom: 0;
+  border-bottom: 1px solid #f2f2f2;
+}
+.backgroundOnly {
+  background: #edf1f5;
+}
+</style>
+<style>
+.transfer .ant-checkbox-group {
+  width: 100px;
+  overflow-x: hidden;
+}
+.transfer .ant-checkbox-group-item {
+  display: inline-block;
+  margin-right: 8px;
+  width: 100%;
+}
+</style>
+
+<template>
+  <div class="transfer">
+    <div class="transfer-box">
+      <div class="content-box">
+        <p class="content-title">兴趣分类</p>
+        <div class="content">
+          <p>
+            <input type="checkbox" class="select_all" @change="checkAllBox" v-model="checkAll" /> 全选
+          </p>
+
+          <p
+            v-for="(item,index) of province"
+            :key="item.value"
+            :class="{backgroundOnly:provinceIndex == index}"
+          >
+            <input
+              class="checkItem"
+              type="checkbox"
+              :value="item.value"
+              :id="item.value"
+              v-model="checkMatched"
+              @change="checkOne(item,index)"
+            />
+            <span
+              @click="showCity(item,index)"
+              style="color:black;display:inline-block;margin-left:5px;width:80%"
+            >{{item.label}}</span>
+          </p>
+        </div>
+      </div>
+      <div
+        class="content-box"
+        :style="{borderRight:!showClass?'0px':'1px solid #dadfe3'}"
+        v-show="showCityData"
+      >
+        <p class="content-title">二级分类</p>
+        <div class="content">
+          <!-- <p>
+            <input
+              type="checkbox"
+              class="select_all"
+              @change="checkAllBoxCity"
+              v-model="checkAllCity"
+            /> 全选
+          </p>-->
+          <p
+            v-for="(item,index) of city"
+            :key="item.id"
+            :class="{backgroundOnly:cityIndex == index}"
+          >
+            <input
+              class="checkItem"
+              type="checkbox"
+              :value="item.value"
+              :id="item.value"
+              v-model="checkMatchedCity"
+              @change="checkOneCity(item,index)"
+            />
+            {{item.label}}
+          </p>
+        </div>
+      </div>
+    </div>
+    <div class="transfer-box" style="width:176px">
+      <div class="content-box">
+        <p class="content-title">
+          已选
+          <span
+            style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
+            @click="clear">清空</span>
+        </p>
+        <div class="content">
+          <p v-for="(item,index) of checkData" :key="index">
+            {{item.label}}
+            <!-- <span
+              style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
+              @click="detele(item,index)"
+            >删除</span>-->
+          </p>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getProvince } from '@/api/manage'
+import $ from 'jquery'
+export default {
+  name: 'ByteDanceIntrestCategoryList',
+  components: {},
+  data() {
+    return {
+      showClass: false,
+      showCityData: false,
+      checkData: [],
+      checkMatched: [],
+      province: [],
+      city: [],
+      area: [],
+      CityData: '/ctop/bytedanceInterestCategory/listbycode',
+      provinceIndex: null,
+      cityIndex: null,
+      checkAll: false,
+      checkMatchedCity: [],
+      checkAllCity: false,
+      nowProvince: null
+    }
+  },
+  computed: {},
+  mounted() {
+    this.$nextTick(() => {
+      this.getData()
+    })
+  },
+  methods: {
+    getData() {
+      getProvince(this.CityData, { parentCode: '' }).then(res => {
+        console.log(res)
+        if (res.code == '0') {
+          //   this.province.push(...res.result.records)
+          this.province = res.result.records.map(item => {
+            return {
+              label: item.name,
+              value: item.id
+            }
+          })
+        }
+      })
+    },
+    showCity(item, index) {
+      this.city = []
+      this.showCityData = false
+      this.showClass = false
+      this.provinceIndex = index
+      this.cityIndex = null
+      this.nowProvince = item
+      this.checkMatchedCity = []
+      getProvince(this.CityData, { parentCode: item.value }).then(res => {
+        if (res.code == '0') {
+          this.city = res.result.records.map(item => {
+            return {
+              label: item.name,
+              value: item.id
+            }
+          })
+          if (this.checkMatched.indexOf(item.value) != -1) {
+            this.checkAllCity = true
+            this.checkMatchedCity = this.city.map(item => {
+              return item.value
+            })
+          } else {
+            this.checkMatchedCity = this.checkData.map(item => {
+              return item.value
+            })
+          }
+          //   this.city.push(...res.result.records)
+          this.showCityData = true
+        }
+      })
+    },
+    checkAllBox() {
+      this.checkMatched = []
+      this.checkData = []
+      if (this.checkAll) {
+        this.checkMatched = this.province.map(item => {
+          return item.value
+        })
+        this.checkData.push(...this.province)
+      } else {
+        this.checkMatched = []
+        this.checkData = []
+        this.checkMatchedCity = []
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkOne(item, index) {
+      if (this.checkMatched.indexOf(item.value) == -1) {
+        var index = this.checkData.findIndex(v => v.value === item.value)
+        this.checkData.splice(index, 1)
+        if (this.nowProvince) {
+          if (this.nowProvince.value == item.value) {
+            this.checkMatchedCity = []
+          }
+        }
+        this.checkAll = false
+      } else {
+        this.checkData.push(item)
+        if (this.nowProvince) {
+          if (item.value == this.nowProvince.value) {
+            this.checkMatchedCity = this.city.map(item => {
+              return item.value
+            })
+          }
+        }
+      }
+      if (this.checkData.length == this.province.length) {
+        this.checkAll = true
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkAllBoxCity() {
+      this.checkMatchedCity = []
+      if (this.checkAllCity) {
+        this.checkMatchedCity = this.city.map(item => {
+          return item.value
+        })
+        this.checkMatched.push(this.nowProvince.value)
+        this.checkData.push(this.nowProvince)
+      } else {
+        this.checkMatchedCity = []
+        var index = this.checkData.findIndex(v => v.value === this.nowProvince.value)
+        var index1 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
+        this.checkData.splice(index, 1)
+        this.checkMatched.splice(index1, 1)
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkOneCity(item, index) {
+      var allCity = this.checkMatchedCity.filter(v => {
+        return v.toString().slice(0, 2) == this.nowProvince.value
+      })
+
+      if (allCity.length == this.city.length) {
+        this.checkMatched.push(this.nowProvince.value)
+        this.checkData.push(this.nowProvince)
+        for (var i = 0; i < this.checkMatchedCity.length; i++) {
+          for (var j = 0; j < this.checkData.length; j++) {
+            if (
+              this.checkMatchedCity[i] == this.checkData[j].value &&
+              this.checkMatchedCity[i].toString().slice(0, 2) == this.nowProvince.value
+            ) {
+              this.checkData.splice(j, 1)
+              j--
+            }
+          }
+        }
+      }
+      if (this.checkMatchedCity.indexOf(item.value) != -1) {
+        if (allCity.length != this.city.length) {
+          this.checkData.push(item)
+        }
+      } else {
+        if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
+          var index1 = this.checkData.findIndex(v => v.value === this.nowProvince.value)
+          var index2 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
+          this.checkData.splice(index1, 1)
+          this.checkMatched.splice(index2, 1)
+          var data = this.city.filter(v => {
+            return v.value != item.value
+          })
+          this.checkData.push(...data)
+        } else {
+          var index1 = this.checkData.findIndex(v => v.value === item.value)
+          this.checkData.splice(index1, 1)
+        }
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    clear() {
+      this.checkData = []
+      this.checkMatched = []
+      this.checkMatchedCity = []
+      this.checkAll = false
+      this.$emit('update:checkData', this.checkData)
+    },
+    detele(item, index) {
+      //   if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
+      var index1 = this.checkMatched.findIndex(v => v === item.value)
+      var index2 = this.checkData.findIndex(v => v.value === item.value)
+      this.checkData.splice(index2, 1)
+      this.checkMatched.splice(index1, 1)
+      this.checkAll = false
+      //   } else {
+      //   }
+
+      this.$emit('update:checkData', this.checkData)
+    }
+  }
+}
+</script>

+ 1 - 1
vue.config.js

@@ -63,7 +63,7 @@ module.exports = {
          }
        },*/
       '/jeecg-boot': {
-        target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
+        target: 'http://localhost:8080', //请求本地 需要jeecg-boot后台项目
         ws: false,
         changeOrigin: true
       },