Commit 753e134d authored by suntao's avatar suntao

单选框

parent 0cd2d05a
......@@ -95,7 +95,7 @@
</el-form-item>
<el-form-item class="base_block" label="渠道号" prop="channelId" label-width="40%">
<el-input type='number' class="el_input_box" v-model.number="channel.baseConfDetail.channelId"
:disabled="!isEdit"/>
:disabled="!isCreate"/>
</el-form-item>
<el-form-item class="base_block" label="channel_code" prop="channelCode" label-width="40%">
<el-input class="el_input_box" v-model="channel.baseConfDetail.channelCode"
......@@ -105,15 +105,18 @@
<el-input class="el_input_box" v-model="channel.baseConfDetail.productId"
:disabled="!isEdit"/>
</el-form-item>
<el-form-item class="base_block" label="aesKey" prop="aesKey" label-width="40%">
<el-form-item class="base_block" label="aesKey" label-width="40%">
<el-input v-model="channel.baseConfDetail.aesKey" :disabled="!isEdit"/>
</el-form-item>
<el-form-item class="base_block" label="md5Key" prop="md5Key" label-width="40%">
<el-form-item class="base_block" label="md5Key" label-width="40%">
<el-input v-model="channel.baseConfDetail.md5Key" :disabled="!isEdit"/>
</el-form-item>
<el-form-item class="base_block" label="是否标准API渠道" prop="isStandardChannel"
label-width="40%">
<el-input v-model="channel.baseConfDetail.isStandardChannel" :disabled="!isEdit"/>
<el-radio-group v-model="channel.baseConfDetail.isStandardChannel" :disabled="!isEdit">
<el-radio :label=true></el-radio>
<el-radio :label=false></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<el-button v-show="isEdit" class="filter-item" style="margin-left: 80%;" type="primary"
......@@ -299,9 +302,7 @@
channelName: [{required: true, message: '请输入渠道名称', trigger: 'blur'}],
channelId: [{type:'number', required: true, message: '请输入渠道号', trigger: 'blur'}],
channelCode: [{required: true, message: '请输入渠道code', trigger: 'blur'}],
aesKey: [{required: true, message: '请输入aesKey', trigger: 'blur'}],
md5Key: [{required: true, message: '请输入md5Key', trigger: 'blur'}],
isStandardChannel: [{required: true, message: '请输入是否标准API', trigger: 'blur'}],
isStandardChannel: [{type:'boolean', required: true, message: '请选择是否标准API', trigger: 'change'}],
},
checkedItemsRules: {
point: [{type:'number', required: true, message: '请选择节点', trigger: 'change'}],
......@@ -348,6 +349,20 @@
})
},
methods: {
init(_this) {
_this.channel = {
baseConfDetail: {},
importCheckInfo: {
channelId:'',
checkedItemsResult: [],//UI选择后的结果,或者编辑页面加载时 用户的数据
},
applyPrivilege: {
privilege: []
},
callbackInfo: {},
rsa: {}
}
},
handleGetStaticElement() {
getStaticElement().then(res => {
if (res.data) {
......@@ -375,7 +390,6 @@
if (res.data) {
this.channels = res.data.content
this.count = res.data.totalElements
// this.$refs.myTable.setCurrentRow(this.channels[0])
}
}).catch(() => {
})
......@@ -399,12 +413,14 @@
this.checkedItemsResultVO.value = []
},
handleUpdate(data) {
this.$options.methods.init(this)
this.isCreate = false
this.isEdit = true
this.$options.methods.showTabAll(this, "")
this.$options.methods.getChannelDetail(this, data)
},
handleQuery(data) {
this.$options.methods.init(this)
this.isCreate = false
this.isEdit = false
this.$options.methods.showTabAll(this, "刷新缓存")
......@@ -433,7 +449,29 @@
getChannelDetail(_this, data) {
getChannelDetail(data).then(rep => {
if (rep.data) {
_this.channel = rep.data
if (rep.data.baseConfDetail) {
_this.channel.baseConfDetail = rep.data.baseConfDetail
} else {
_this.channel.baseConfDetail = {}
}
if (rep.data.callbackInfo) {
_this.channel.callbackInfo = rep.data.callbackInfo
} else {
_this.channel.callbackInfo = {}
}
if (rep.data.rsa) {
_this.channel.rsa = rep.data.rsa
} else {
_this.channel.rsa = {}
}
if (rep.data.applyPrivilege) {
_this.channel.applyPrivilege = rep.data.applyPrivilege
} else {
_this.channel.applyPrivilege = {
privilege: []
}
}
if (rep.data && rep.data.importCheckInfo && rep.data.importCheckInfo.checkedItemsResult.length > 0) {
_this.channel.importCheckInfo.checkedItemsResult = rep.data.importCheckInfo.checkedItemsResult;
// 说明有数据
......@@ -610,6 +648,19 @@
// 如果点击查询页 那么隐藏tab
if ('queryPage' === tab.name) {
this.$options.methods.hiddenTabAll(this)
for (const prop in this.listQuery) {
if (this.listQuery[prop] === '') {
delete this.listQuery[prop]
}
}
this.listQuery.pageNumber = this.page - 1
getChannels(this.listQuery).then(res => {
if (res.data) {
this.channels = res.data.content
this.count = res.data.totalElements
}
}).catch(() => {
})
}
},
showTabAll(_this, excludeTab) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment