Commit 676318dd 676318ddd5e7a745768bf538f73b9a1c0a13e53a by zhanghao

commit

1 parent b7aab805
...@@ -325,72 +325,103 @@ ...@@ -325,72 +325,103 @@
325 </el-form> 325 </el-form>
326 </el-col> 326 </el-col>
327 <el-col :span="8"> 327 <el-col :span="8">
328 <el-form ref="apiTest" :model="apiTest" label-width="0px"> 328 <el-form ref="createTjAccount" :model="createTjAccount" label-width="0px">
329 <el-card class="darkred" shadow="always"> 329 <el-card class="darkred" shadow="always">
330 <div slot="header" class="clearfix"> 330 <div slot="header" class="clearfix">
331 <span>接口访问测试</span> 331 <span>创建统计平台账号(测试环境)</span>
332 </div> 332 </div>
333 <div class="text item"> 333 <div class="text item">
334 <el-form-item> 334 <el-form-item>
335 <el-select v-model="apiTest.path" placeholder="请选择接口服务"> 335 <el-input placeholder="请输入账号登录名称" v-model="createTjAccount.account" clearable></el-input>
336 </el-form-item>
337 <div style="margin: 15px 0;"></div>
338 <el-form-item>
339 <el-select @change="tjchangeProvince" v-model="createTjAccount.provinceCode" filterable placeholder="请选择一级机构">
336 <el-option 340 <el-option
337 v-for="item in apiTestPathoptions" 341 v-for="item in tjprovinceOptions"
338 :key="item.value" 342 :key="item.province_code"
339 :label="item.label" 343 :label="item.province_name"
340 :value="item.value"> 344 :value="item.province_code">
341 </el-option> 345 </el-option>
342 </el-select> 346 </el-select>
343 </el-form-item> 347 </el-form-item>
344 <el-form-item> 348 <el-form-item>
345 <el-input placeholder="请输入method" v-model="apiTest.method" clearable></el-input> 349 <el-select @change="tjchangeCity" v-model="createTjAccount.cityCode" filterable placeholder="请选择二级机构">
350 <el-option
351 v-for="item in tjcityOptions"
352 :key="item.city_code"
353 :label="item.city_name"
354 :value="item.city_code">
355 </el-option>
356 </el-select>
346 </el-form-item> 357 </el-form-item>
347 <el-form-item> 358 <el-form-item>
348 <el-input placeholder="请输入biz_data" v-model="apiTest.biz_data" clearable></el-input> 359 <el-select @change="tjchangeTeam" v-model="createTjAccount.teamCode" filterable placeholder="请选择三级机构">
360 <el-option
361 v-for="item in tjteamOptions"
362 :key="item.team_code"
363 :label="item.team_name"
364 :value="item.team_code">
365 </el-option>
366 </el-select>
349 </el-form-item> 367 </el-form-item>
350 <el-form-item> 368 <el-form-item>
351 <el-input placeholder="请输入手机号,如果token已失效,请在app进行登录" v-model="apiTest.phone" clearable></el-input> 369 <el-select @change="tjchangeFour" v-model="createTjAccount.fourCode" filterable placeholder="请选择四级机构">
370 <el-option
371 v-for="item in tjfourOptions"
372 :key="item.four_level_code"
373 :label="item.four_level_name"
374 :value="item.four_level_code">
375 </el-option>
376 </el-select>
352 </el-form-item> 377 </el-form-item>
353 <el-form-item> 378 <el-form-item>
354 <el-select v-model="apiTest.huanjing" placeholder="请选择执行环境"> 379 <el-select v-model="createTjAccount.fiveCode" filterable placeholder="请选择五级机构">
355 <el-option 380 <el-option
356 v-for="item in apiTestoptions" 381 v-for="item in tjfiveOptions"
357 :key="item.value" 382 :key="item.five_level_code"
358 :label="item.label" 383 :label="item.five_level_name"
359 :value="item.value"> 384 :value="item.five_level_code">
360 </el-option> 385 </el-option>
361 </el-select> 386 </el-select>
362 </el-form-item> 387 </el-form-item>
363 <div style="margin: 15px 0;"></div>
364 <el-form-item> 388 <el-form-item>
365 <el-button round @click="apiTestSubmit">调用接口</el-button> 389 <el-button round @click="tjchangeOrgAllSubmit">创建账号</el-button>
366 </el-form-item> 390 </el-form-item>
367 </div> 391 </div>
368 </el-card> 392 </el-card>
369 </el-form> 393 </el-form>
370 </el-col> 394 </el-col>
371 <el-col :span="8"> 395 <el-col :span="8">
372 <el-form ref="createAPI" :model="createAPI" label-width="0px"> 396 <el-form ref="apiTest" :model="apiTest" label-width="0px">
373 <el-card class="darkred" shadow="always"> 397 <el-card class="darkred" shadow="always">
374 <div slot="header" class="clearfix"> 398 <div slot="header" class="clearfix">
375 <span>生成接口请求参数</span> 399 <span>接口访问测试</span>
376 </div> 400 </div>
377 <div class="text item"> 401 <div class="text item">
378 <el-form-item> 402 <el-form-item>
379 <el-input placeholder="请输入method" v-model="createAPI.method" clearable></el-input> 403 <el-select v-model="apiTest.path" placeholder="请选择接口服务">
404 <el-option
405 v-for="item in apiTestPathoptions"
406 :key="item.value"
407 :label="item.label"
408 :value="item.value">
409 </el-option>
410 </el-select>
380 </el-form-item> 411 </el-form-item>
381 <el-form-item> 412 <el-form-item>
382 <el-input placeholder="请输入biz_data" v-model="createAPI.biz_data" clearable></el-input> 413 <el-input placeholder="请输入method" v-model="apiTest.method" clearable></el-input>
383 </el-form-item> 414 </el-form-item>
384 <el-form-item> 415 <el-form-item>
385 <el-input placeholder="请输入uid" v-model="createAPI.uid" clearable></el-input> 416 <el-input placeholder="请输入biz_data" v-model="apiTest.biz_data" clearable></el-input>
386 </el-form-item> 417 </el-form-item>
387 <el-form-item> 418 <el-form-item>
388 <el-input placeholder="请输入token" v-model="createAPI.token" clearable></el-input> 419 <el-input placeholder="请输入手机号,如果token已失效,请在app进行登录" v-model="apiTest.phone" clearable></el-input>
389 </el-form-item> 420 </el-form-item>
390 <el-form-item> 421 <el-form-item>
391 <el-select v-model="createAPI.huanjing" placeholder="请选择执行环境"> 422 <el-select v-model="apiTest.huanjing" placeholder="请选择执行环境">
392 <el-option 423 <el-option
393 v-for="item in createAPIoptions" 424 v-for="item in apiTestoptions"
394 :key="item.value" 425 :key="item.value"
395 :label="item.label" 426 :label="item.label"
396 :value="item.value"> 427 :value="item.value">
...@@ -399,20 +430,11 @@ ...@@ -399,20 +430,11 @@
399 </el-form-item> 430 </el-form-item>
400 <div style="margin: 15px 0;"></div> 431 <div style="margin: 15px 0;"></div>
401 <el-form-item> 432 <el-form-item>
402 <el-button round @click="createApi">生成参数</el-button> 433 <el-button round @click="apiTestSubmit">调用接口</el-button>
403 </el-form-item> 434 </el-form-item>
404 </div> 435 </div>
405 </el-card> 436 </el-card>
406 </el-form> 437 </el-form>
407 <el-dialog
408 title="接口请求参数:"
409 :visible.sync="dialogCreateApi"
410 width="30%">
411 <span>{{myApi}}</span>
412 <span slot="footer" class="dialog-footer">
413 <el-button type="primary" v-clipboard:copy="JSON.stringify(myApi)" v-clipboard:success="onCopy" @click="dialogCreateApi = false">点击复制</el-button>
414 </span>
415 </el-dialog>
416 </el-col> 438 </el-col>
417 </el-row> 439 </el-row>
418 <el-row style="margin-bottom: 15px;"> 440 <el-row style="margin-bottom: 15px;">
...@@ -583,6 +605,54 @@ ...@@ -583,6 +605,54 @@
583 </el-form> 605 </el-form>
584 </el-col> 606 </el-col>
585 </el-row> 607 </el-row>
608 <el-row style="margin-bottom: 15px;">
609 <el-col :span="8">
610 <el-form ref="createAPI" :model="createAPI" label-width="0px">
611 <el-card class="darkred" shadow="always">
612 <div slot="header" class="clearfix">
613 <span>生成接口请求参数</span>
614 </div>
615 <div class="text item">
616 <el-form-item>
617 <el-input placeholder="请输入method" v-model="createAPI.method" clearable></el-input>
618 </el-form-item>
619 <el-form-item>
620 <el-input placeholder="请输入biz_data" v-model="createAPI.biz_data" clearable></el-input>
621 </el-form-item>
622 <el-form-item>
623 <el-input placeholder="请输入uid" v-model="createAPI.uid" clearable></el-input>
624 </el-form-item>
625 <el-form-item>
626 <el-input placeholder="请输入token" v-model="createAPI.token" clearable></el-input>
627 </el-form-item>
628 <el-form-item>
629 <el-select v-model="createAPI.huanjing" placeholder="请选择执行环境">
630 <el-option
631 v-for="item in createAPIoptions"
632 :key="item.value"
633 :label="item.label"
634 :value="item.value">
635 </el-option>
636 </el-select>
637 </el-form-item>
638 <div style="margin: 15px 0;"></div>
639 <el-form-item>
640 <el-button round @click="createApi">生成参数</el-button>
641 </el-form-item>
642 </div>
643 </el-card>
644 </el-form>
645 <el-dialog
646 title="接口请求参数:"
647 :visible.sync="dialogCreateApi"
648 width="30%">
649 <span>{{myApi}}</span>
650 <span slot="footer" class="dialog-footer">
651 <el-button type="primary" v-clipboard:copy="JSON.stringify(myApi)" v-clipboard:success="onCopy" @click="dialogCreateApi = false">点击复制</el-button>
652 </span>
653 </el-dialog>
654 </el-col>
655 </el-row>
586 </div> 656 </div>
587 </template> 657 </template>
588 658
...@@ -851,6 +921,34 @@ ...@@ -851,6 +921,34 @@
851 teamOptions: [], 921 teamOptions: [],
852 fourOptions: [], 922 fourOptions: [],
853 fiveOptions: [], 923 fiveOptions: [],
924 createTjAccount: {
925 account: '',
926 provinceCode: [{
927 province_code: '',
928 province_name: ''
929 }],
930 cityCode: [{
931 city_code: '',
932 city_name: ''
933 }],
934 teamCode: [{
935 team_code: '',
936 team_name: ''
937 }],
938 fourCode: [{
939 four_level_code: '',
940 four_level_name: ''
941 }],
942 fiveCode: [{
943 five_level_code: '',
944 five_level_name: ''
945 }]
946 },
947 tjprovinceOptions: [],
948 tjcityOptions: [],
949 tjteamOptions: [],
950 tjfourOptions: [],
951 tjfiveOptions: [],
854 nlpApi: { 952 nlpApi: {
855 keyword: '', 953 keyword: '',
856 huanjing: [] 954 huanjing: []
...@@ -872,6 +970,7 @@ ...@@ -872,6 +970,7 @@
872 mounted() { 970 mounted() {
873 this.openToolPage(); 971 this.openToolPage();
874 this.loadProvince(); 972 this.loadProvince();
973 this.tjloadProvince();
875 this.loadQueryProvince(); 974 this.loadQueryProvince();
876 }, 975 },
877 methods: { 976 methods: {
...@@ -913,6 +1012,19 @@ ...@@ -913,6 +1012,19 @@
913 console.log(error); 1012 console.log(error);
914 }) 1013 })
915 }, 1014 },
1015 tjloadProvince() {
1016 let config = {
1017 headers: {
1018 'Content-Type': 'application/x-www-form-urlencoded'
1019 }
1020 }
1021 this.$http.get('/tool/loadProvince',config).then((res)=>{
1022 console.log(res);
1023 this.tjprovinceOptions=res.data;
1024 }).catch(error=>{
1025 console.log(error);
1026 })
1027 },
916 changeProvince(value) { 1028 changeProvince(value) {
917 this.cityOptions = []; 1029 this.cityOptions = [];
918 this.teamOptions = []; 1030 this.teamOptions = [];
...@@ -936,6 +1048,29 @@ ...@@ -936,6 +1048,29 @@
936 console.log(error); 1048 console.log(error);
937 }) 1049 })
938 }, 1050 },
1051 tjchangeProvince(value) {
1052 this.tjcityOptions = [];
1053 this.tjteamOptions = [];
1054 this.tjfourOptions = [];
1055 this.tjfiveOptions = [];
1056 this.createTjAccount.cityCode = '';
1057 this.createTjAccount.teamCode = '';
1058 this.createTjAccount.fourCode = '';
1059 this.createTjAccount.fiveCode = '';
1060 let config = {
1061 headers: {
1062 'Content-Type': 'application/x-www-form-urlencoded'
1063 }
1064 }
1065 this.$http.get('/tool/loadCity?'+this.$qs.stringify({
1066 code: value
1067 }),config).then((res)=>{
1068 console.log(res);
1069 this.tjcityOptions=res.data;
1070 }).catch(error=>{
1071 console.log(error);
1072 })
1073 },
939 changeCity(value) { 1074 changeCity(value) {
940 this.teamOptions = []; 1075 this.teamOptions = [];
941 this.fourOptions = []; 1076 this.fourOptions = [];
...@@ -957,6 +1092,27 @@ ...@@ -957,6 +1092,27 @@
957 console.log(error); 1092 console.log(error);
958 }) 1093 })
959 }, 1094 },
1095 tjchangeCity(value) {
1096 this.tjteamOptions = [];
1097 this.tjfourOptions = [];
1098 this.tjfiveOptions = [];
1099 this.createTjAccount.teamCode = '';
1100 this.createTjAccount.fourCode = '';
1101 this.createTjAccount.fiveCode = '';
1102 let config = {
1103 headers: {
1104 'Content-Type': 'application/x-www-form-urlencoded'
1105 }
1106 }
1107 this.$http.get('/tool/loadTeam?'+this.$qs.stringify({
1108 code: value
1109 }),config).then((res)=>{
1110 console.log(res);
1111 this.tjteamOptions=res.data;
1112 }).catch(error=>{
1113 console.log(error);
1114 })
1115 },
960 changeTeam(value) { 1116 changeTeam(value) {
961 this.fourOptions = []; 1117 this.fourOptions = [];
962 this.fiveOptions = []; 1118 this.fiveOptions = [];
...@@ -976,6 +1132,25 @@ ...@@ -976,6 +1132,25 @@
976 console.log(error); 1132 console.log(error);
977 }) 1133 })
978 }, 1134 },
1135 tjchangeTeam(value) {
1136 this.tjfourOptions = [];
1137 this.tjfiveOptions = [];
1138 this.createTjAccount.fourCode = '';
1139 this.createTjAccount.fiveCode = '';
1140 let config = {
1141 headers: {
1142 'Content-Type': 'application/x-www-form-urlencoded'
1143 }
1144 }
1145 this.$http.get('/tool/loadFour?'+this.$qs.stringify({
1146 code: value
1147 }),config).then((res)=>{
1148 console.log(res);
1149 this.tjfourOptions=res.data;
1150 }).catch(error=>{
1151 console.log(error);
1152 })
1153 },
979 changeFour(value) { 1154 changeFour(value) {
980 this.fiveOptions = []; 1155 this.fiveOptions = [];
981 this.changeOrgAll.fiveCode = ''; 1156 this.changeOrgAll.fiveCode = '';
...@@ -993,6 +1168,23 @@ ...@@ -993,6 +1168,23 @@
993 console.log(error); 1168 console.log(error);
994 }) 1169 })
995 }, 1170 },
1171 tjchangeFour(value) {
1172 this.tjfiveOptions = [];
1173 this.createTjAccount.fiveCode = '';
1174 let config = {
1175 headers: {
1176 'Content-Type': 'application/x-www-form-urlencoded'
1177 }
1178 }
1179 this.$http.get('/tool/loadFive?'+this.$qs.stringify({
1180 code: value
1181 }),config).then((res)=>{
1182 console.log(res);
1183 this.tjfiveOptions=res.data;
1184 }).catch(error=>{
1185 console.log(error);
1186 })
1187 },
996 onCopy (e) { 1188 onCopy (e) {
997 this.$message({ 1189 this.$message({
998 showClose: true, 1190 showClose: true,
...@@ -1390,6 +1582,50 @@ ...@@ -1390,6 +1582,50 @@
1390 console.log(error); 1582 console.log(error);
1391 }) 1583 })
1392 }, 1584 },
1585 tjchangeOrgAllSubmit() {
1586 let config = {
1587 headers: {
1588 'Content-Type': 'application/x-www-form-urlencoded'
1589 }
1590 }
1591 this.$http.get('/tool/createTjAccount?'+this.$qs.stringify({
1592 login_name: this.createTjAccount.account,
1593 province_code: this.createTjAccount.provinceCode.toString(),
1594 city_code: this.createTjAccount.cityCode.toString(),
1595 team_code: this.createTjAccount.teamCode.toString(),
1596 location_code: this.createTjAccount.fourCode.toString(),
1597 five_code: this.createTjAccount.fiveCode.toString()
1598 }),config).then((res)=>{
1599 console.log(res);
1600 if(res.data=='exists') {
1601 this.$message({
1602 showClose: true,
1603 message: '该账号已存在,请更换账号名称',
1604 type: 'error'
1605 });
1606 } else if(res.data=='notnull') {
1607 this.$message({
1608 showClose: true,
1609 message: '账号或一级机构不能为空',
1610 type: 'error'
1611 });
1612 } else if(res.data=='success') {
1613 this.$message({
1614 showClose: true,
1615 message: '创建账号成功',
1616 type: 'success'
1617 });
1618 } else {
1619 this.$message({
1620 showClose: true,
1621 message: '创建账号失败',
1622 type: 'error'
1623 });
1624 }
1625 }).catch(error=>{
1626 console.log(error);
1627 })
1628 },
1393 nlpApiSubmit() { 1629 nlpApiSubmit() {
1394 const {href} = this.$router.resolve({ name:'nlpApi', query: 1630 const {href} = this.$router.resolve({ name:'nlpApi', query:
1395 {keyword: this.nlpApi.keyword, runtime: this.nlpApi.huanjing.toString(), platform: "0"}}) 1631 {keyword: this.nlpApi.keyword, runtime: this.nlpApi.huanjing.toString(), platform: "0"}})
......