You need to sign in or sign up before continuing.
Commit 676318dd 676318ddd5e7a745768bf538f73b9a1c0a13e53a by zhanghao

commit

1 parent b7aab805
......@@ -325,72 +325,103 @@
</el-form>
</el-col>
<el-col :span="8">
<el-form ref="apiTest" :model="apiTest" label-width="0px">
<el-form ref="createTjAccount" :model="createTjAccount" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>接口访问测试</span>
<span>创建统计平台账号(测试环境)</span>
</div>
<div class="text item">
<el-form-item>
<el-select v-model="apiTest.path" placeholder="请选择接口服务">
<el-input placeholder="请输入账号登录名称" v-model="createTjAccount.account" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-select @change="tjchangeProvince" v-model="createTjAccount.provinceCode" filterable placeholder="请选择一级机构">
<el-option
v-for="item in apiTestPathoptions"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in tjprovinceOptions"
:key="item.province_code"
:label="item.province_name"
:value="item.province_code">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入method" v-model="apiTest.method" clearable></el-input>
<el-select @change="tjchangeCity" v-model="createTjAccount.cityCode" filterable placeholder="请选择二级机构">
<el-option
v-for="item in tjcityOptions"
:key="item.city_code"
:label="item.city_name"
:value="item.city_code">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入biz_data" v-model="apiTest.biz_data" clearable></el-input>
<el-select @change="tjchangeTeam" v-model="createTjAccount.teamCode" filterable placeholder="请选择三级机构">
<el-option
v-for="item in tjteamOptions"
:key="item.team_code"
:label="item.team_name"
:value="item.team_code">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入手机号,如果token已失效,请在app进行登录" v-model="apiTest.phone" clearable></el-input>
<el-select @change="tjchangeFour" v-model="createTjAccount.fourCode" filterable placeholder="请选择四级机构">
<el-option
v-for="item in tjfourOptions"
:key="item.four_level_code"
:label="item.four_level_name"
:value="item.four_level_code">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="apiTest.huanjing" placeholder="请选择执行环境">
<el-select v-model="createTjAccount.fiveCode" filterable placeholder="请选择五级机构">
<el-option
v-for="item in apiTestoptions"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in tjfiveOptions"
:key="item.five_level_code"
:label="item.five_level_name"
:value="item.five_level_code">
</el-option>
</el-select>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="apiTestSubmit">调用接口</el-button>
<el-button round @click="tjchangeOrgAllSubmit">创建账号</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
<el-col :span="8">
<el-form ref="createAPI" :model="createAPI" label-width="0px">
<el-form ref="apiTest" :model="apiTest" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>生成接口请求参数</span>
<span>接口访问测试</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="请输入method" v-model="createAPI.method" clearable></el-input>
<el-select v-model="apiTest.path" placeholder="请选择接口服务">
<el-option
v-for="item in apiTestPathoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入biz_data" v-model="createAPI.biz_data" clearable></el-input>
<el-input placeholder="请输入method" v-model="apiTest.method" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入uid" v-model="createAPI.uid" clearable></el-input>
<el-input placeholder="请输入biz_data" v-model="apiTest.biz_data" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入token" v-model="createAPI.token" clearable></el-input>
<el-input placeholder="请输入手机号,如果token已失效,请在app进行登录" v-model="apiTest.phone" clearable></el-input>
</el-form-item>
<el-form-item>
<el-select v-model="createAPI.huanjing" placeholder="请选择执行环境">
<el-select v-model="apiTest.huanjing" placeholder="请选择执行环境">
<el-option
v-for="item in createAPIoptions"
v-for="item in apiTestoptions"
:key="item.value"
:label="item.label"
:value="item.value">
......@@ -399,20 +430,11 @@
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="createApi">生成参数</el-button>
<el-button round @click="apiTestSubmit">调用接口</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
<el-dialog
title="接口请求参数:"
:visible.sync="dialogCreateApi"
width="30%">
<span>{{myApi}}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" v-clipboard:copy="JSON.stringify(myApi)" v-clipboard:success="onCopy" @click="dialogCreateApi = false">点击复制</el-button>
</span>
</el-dialog>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px;">
......@@ -583,6 +605,54 @@
</el-form>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px;">
<el-col :span="8">
<el-form ref="createAPI" :model="createAPI" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>生成接口请求参数</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="请输入method" v-model="createAPI.method" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入biz_data" v-model="createAPI.biz_data" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入uid" v-model="createAPI.uid" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入token" v-model="createAPI.token" clearable></el-input>
</el-form-item>
<el-form-item>
<el-select v-model="createAPI.huanjing" placeholder="请选择执行环境">
<el-option
v-for="item in createAPIoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="createApi">生成参数</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
<el-dialog
title="接口请求参数:"
:visible.sync="dialogCreateApi"
width="30%">
<span>{{myApi}}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" v-clipboard:copy="JSON.stringify(myApi)" v-clipboard:success="onCopy" @click="dialogCreateApi = false">点击复制</el-button>
</span>
</el-dialog>
</el-col>
</el-row>
</div>
</template>
......@@ -851,6 +921,34 @@
teamOptions: [],
fourOptions: [],
fiveOptions: [],
createTjAccount: {
account: '',
provinceCode: [{
province_code: '',
province_name: ''
}],
cityCode: [{
city_code: '',
city_name: ''
}],
teamCode: [{
team_code: '',
team_name: ''
}],
fourCode: [{
four_level_code: '',
four_level_name: ''
}],
fiveCode: [{
five_level_code: '',
five_level_name: ''
}]
},
tjprovinceOptions: [],
tjcityOptions: [],
tjteamOptions: [],
tjfourOptions: [],
tjfiveOptions: [],
nlpApi: {
keyword: '',
huanjing: []
......@@ -872,6 +970,7 @@
mounted() {
this.openToolPage();
this.loadProvince();
this.tjloadProvince();
this.loadQueryProvince();
},
methods: {
......@@ -913,6 +1012,19 @@
console.log(error);
})
},
tjloadProvince() {
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/loadProvince',config).then((res)=>{
console.log(res);
this.tjprovinceOptions=res.data;
}).catch(error=>{
console.log(error);
})
},
changeProvince(value) {
this.cityOptions = [];
this.teamOptions = [];
......@@ -936,6 +1048,29 @@
console.log(error);
})
},
tjchangeProvince(value) {
this.tjcityOptions = [];
this.tjteamOptions = [];
this.tjfourOptions = [];
this.tjfiveOptions = [];
this.createTjAccount.cityCode = '';
this.createTjAccount.teamCode = '';
this.createTjAccount.fourCode = '';
this.createTjAccount.fiveCode = '';
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/loadCity?'+this.$qs.stringify({
code: value
}),config).then((res)=>{
console.log(res);
this.tjcityOptions=res.data;
}).catch(error=>{
console.log(error);
})
},
changeCity(value) {
this.teamOptions = [];
this.fourOptions = [];
......@@ -957,6 +1092,27 @@
console.log(error);
})
},
tjchangeCity(value) {
this.tjteamOptions = [];
this.tjfourOptions = [];
this.tjfiveOptions = [];
this.createTjAccount.teamCode = '';
this.createTjAccount.fourCode = '';
this.createTjAccount.fiveCode = '';
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/loadTeam?'+this.$qs.stringify({
code: value
}),config).then((res)=>{
console.log(res);
this.tjteamOptions=res.data;
}).catch(error=>{
console.log(error);
})
},
changeTeam(value) {
this.fourOptions = [];
this.fiveOptions = [];
......@@ -976,6 +1132,25 @@
console.log(error);
})
},
tjchangeTeam(value) {
this.tjfourOptions = [];
this.tjfiveOptions = [];
this.createTjAccount.fourCode = '';
this.createTjAccount.fiveCode = '';
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/loadFour?'+this.$qs.stringify({
code: value
}),config).then((res)=>{
console.log(res);
this.tjfourOptions=res.data;
}).catch(error=>{
console.log(error);
})
},
changeFour(value) {
this.fiveOptions = [];
this.changeOrgAll.fiveCode = '';
......@@ -993,6 +1168,23 @@
console.log(error);
})
},
tjchangeFour(value) {
this.tjfiveOptions = [];
this.createTjAccount.fiveCode = '';
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/loadFive?'+this.$qs.stringify({
code: value
}),config).then((res)=>{
console.log(res);
this.tjfiveOptions=res.data;
}).catch(error=>{
console.log(error);
})
},
onCopy (e) {
this.$message({
showClose: true,
......@@ -1390,6 +1582,50 @@
console.log(error);
})
},
tjchangeOrgAllSubmit() {
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/createTjAccount?'+this.$qs.stringify({
login_name: this.createTjAccount.account,
province_code: this.createTjAccount.provinceCode.toString(),
city_code: this.createTjAccount.cityCode.toString(),
team_code: this.createTjAccount.teamCode.toString(),
location_code: this.createTjAccount.fourCode.toString(),
five_code: this.createTjAccount.fiveCode.toString()
}),config).then((res)=>{
console.log(res);
if(res.data=='exists') {
this.$message({
showClose: true,
message: '该账号已存在,请更换账号名称',
type: 'error'
});
} else if(res.data=='notnull') {
this.$message({
showClose: true,
message: '账号或一级机构不能为空',
type: 'error'
});
} else if(res.data=='success') {
this.$message({
showClose: true,
message: '创建账号成功',
type: 'success'
});
} else {
this.$message({
showClose: true,
message: '创建账号失败',
type: 'error'
});
}
}).catch(error=>{
console.log(error);
})
},
nlpApiSubmit() {
const {href} = this.$router.resolve({ name:'nlpApi', query:
{keyword: this.nlpApi.keyword, runtime: this.nlpApi.huanjing.toString(), platform: "0"}})
......