Browse Source

业务域名配置修改

master
jiangyy 5 years ago
parent
commit
1458b7536f
  1. 9
      epmet-oper-web/src/views/modules/customer/customize/ConfigEdit.vue
  2. 2
      epmet-oper-web/src/views/modules/productConfig/customizeFunction/CustomFun.vue
  3. 85
      epmet-oper-web/src/views/modules/productConfig/customizeFunction/Edit.vue
  4. 412
      epmet-oper-web/src/views/modules/productConfig/customizeFunction/EditDomainNameList.vue

9
epmet-oper-web/src/views/modules/customer/customize/ConfigEdit.vue

@ -52,10 +52,14 @@
<div>
<el-input style="width:400px;display:block;margin-bottom:10px; float:left"
<el-input v-if="dataForm.isDomainName==='1'"
style="width:400px;display:block;margin-bottom:10px; float:left"
placeholder='请输入业务域名'
v-model="dataForm.domainName"> </el-input>
<span style="width:400px;display:block;margin-bottom:10px; float:left"
v-else></span>
</div>
</el-form-item>
@ -152,7 +156,8 @@ export default {
defaultSmallImg: '', //
iconSmallImg: '',//
domainName: '',//
targetLink: ''//
targetLink: '',//
isDomainName: ''//
},
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload'

2
epmet-oper-web/src/views/modules/productConfig/customizeFunction/CustomFun.vue

@ -187,7 +187,7 @@ export default {
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('删除成功' + rspMsg)
this.$message.success('删除成功')
this.refresh()
},
(rspMsg, data) => {

85
epmet-oper-web/src/views/modules/productConfig/customizeFunction/Edit.vue

@ -10,7 +10,7 @@
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:label-width="'120px'">
:label-width="'140px'">
<el-form-item label="功能名称"
prop="functionName">
<el-tooltip class="item"
@ -97,42 +97,22 @@
</el-upload>
</el-form-item>
<el-form-item prop="domainNameList"
<el-form-item prop="isDomainName"
class="block"
label="业务域名">
<div v-if="type==='A'||isApply===0">
<div v-for="(item, index) in domainNameList"
:key="index">
<el-input :disabled="isApply===1"
style="width:300px;display:block;margin-bottom:10px; float:left"
placeholder='请输入业务域名'
v-model="domainNameList[index]"> </el-input>
label="是否需要业务域名">
<el-button v-if="index===0"
size="mini"
class="btn_serve"
type="primary"
icon="el-icon-plus"
@click="addRequest()"
circle></el-button>
<el-button v-if="index!==0"
size="mini"
type="danger"
class="btn_serve"
icon="el-icon-minus"
@click="delRequest(index)"
circle></el-button>
</div>
</div>
<div v-else>
<div v-for="(item, index) in domainNameList"
:key="index">
<span style="width:300px;display:block;margin-bottom:10px; float:left">{{domainNameList[index]}} </span>
</div>
</div>
<el-checkbox v-model="isDomainNameCheck"></el-checkbox>
</el-form-item>
<el-form-item v-if="isDomainNameCheck"
label="业务域名"
prop="domainName">
<el-input v-if="isApply===0"
class="item_width_1"
v-model="dataForm.domainName"
placeholder="业务域名"></el-input>
<span v-else
style="width:300px;display:block;margin-bottom:10px; float:left">{{dataForm.domainName}} </span>
</el-form-item>
<el-form-item class="block"
@ -174,9 +154,11 @@ export default {
functionExplain: '',
targetLink: '',
domainName: '',
fromApp: 'resi'
fromApp: 'resi',
isDomainName: ''
},
domainNameList: [],
isDomainNameCheck: true,
isApply: 0,//
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload',
fromAppList: [
@ -209,9 +191,10 @@ export default {
{ required: true, message: '功能名称不能为空', trigger: 'blur' },
{ min: 2, max: 5, message: '功能名称长度在 2 到 5 个字符', trigger: 'blur' }
],
// domainNameList: [
// { required: true, message: '', trigger: 'blur' }
// ],
domainName: [
{ required: true, message: '业务域名不能为空', trigger: 'blur' }
],
iconLargeImg: [
{ required: true, message: '大图标不能为空', trigger: 'blur' }
],
@ -252,21 +235,12 @@ export default {
domainName: '',
fromApp: 'resi'
}
this.domainNameList = ['']
this.isApply = 0
} else {
this.diaTitle = '修改定制功能'
this.loadFormData()
}
},
addRequest () {
// eslint-disable-next-line
// debugger
this.domainNameList.push('')
},
delRequest (index) {
this.domainNameList.splice(index, 1)
},
loadFormData () {
// const url='https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/functioncustomized/getfunctioncustomized'
@ -277,8 +251,8 @@ export default {
window.app.ajax.post(url, _data,
(data, rspMsg) => {
this.dataForm = data
// this.dataForm.domainNameList = this.dataForm.domainName.split(';')
this.domainNameList = this.dataForm.domainName.split(';')
this.isDomainNameCheck = data.isDomainName === '1'
this.isApply = data.isApply
},
(rspMsg, data) => {
@ -321,16 +295,7 @@ export default {
app.util.validateRule(messageObj)
} else {
// eslint-disable-next-line
// debugger
let domainName = ''
for (let i = 0; i < this.domainNameList.length; i++) {
if (this.domainNameList[i] !== '') {
domainName = domainName + this.domainNameList[i] + ';'
}
}
domainName = domainName.substring(0, domainName.length - 1)
this.dataForm.domainName = domainName
this.dataForm.isDomainName = this.isDomainNameCheck ? '1' : '0'
let url = ''
if (this.type === 'U') {

412
epmet-oper-web/src/views/modules/productConfig/customizeFunction/EditDomainNameList.vue

@ -0,0 +1,412 @@
<template>
<el-dialog :visible.sync="visible"
:title="diaTitle"
:close-on-click-modal="false"
:before-close="handleClose"
:close-on-press-escape="false"
:width="60+'%'"
:top="'20px'">
<el-form :inline="true"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:label-width="'140px'">
<el-form-item label="功能名称"
prop="functionName">
<el-tooltip class="item"
effect="dark"
content="请输入2-5个字"
placement="bottom-start">
<el-input class="item_width_1"
:maxlength="5"
:minlength="2"
v-model="dataForm.functionName"
placeholder="功能名称"></el-input>
</el-tooltip>
<div slot="tip"
class="el-upload__tip">2-5个字</div>
</el-form-item>
<el-form-item label="来源"
prop="fromApp">
<el-select :disabled="isApply===1"
class="item_width_1"
v-model="dataForm.fromApp"
placeholder="请选择"
clearable>
<el-option v-for="item in fromAppList"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="上架状态"
prop="shoppingStatus">
<el-select class="item_width_1"
:disabled="isApply===1"
v-model="dataForm.shoppingStatus"
placeholder="请选择"
clearable>
<el-option v-for="item in shoppingStatusList"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="外链地址"
prop="targetLink">
<el-input v-if="isApply===0"
class="item_width_1"
v-model="dataForm.targetLink"
placeholder="外链地址"></el-input>
<span v-else
style="width:300px;display:block;margin-bottom:10px; float:left">{{dataForm.targetLink}} </span>
</el-form-item>
<el-form-item prop="iconLargeImg"
label="大图标">
<el-upload class="item_width_1 avatar-uploader"
:action="uploadUlr"
:show-file-list="false"
:on-success="function (res, file) { return handleImgSuccess(res, file, 'large')}"
:before-upload="beforeImgUpload">
<img v-if="dataForm.iconLargeImg"
:src="dataForm.iconLargeImg"
style="width:70px;height:70px"
class="function-icon">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item prop="iconSmallImg"
label="小图标">
<el-upload class="item_width_1 avatar-uploader"
:action="uploadUlr"
:show-file-list="false"
:on-success="function (res, file) { return handleImgSuccess(res, file, 'small')}"
:before-upload="beforeImgUpload">
<img v-if="dataForm.iconSmallImg"
:src="dataForm.iconSmallImg"
style="width:50px;height:50px"
class="function-icon">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item prop="domainNameList"
class="block"
label="是否需要业务域名">
<el-checkbox v-model="isDomainNameCheck"></el-checkbox>
</el-form-item>
<el-form-item v-if="isDomainNameCheck"
prop="domainNameList"
class="block"
label="业务域名">
<div v-if="type==='A'||isApply===0">
<div v-for="(item, index) in domainNameList"
:key="index">
<el-input :disabled="isApply===1"
style="width:300px;display:block;margin-bottom:10px; float:left"
placeholder='请输入业务域名'
v-model="domainNameList[index]"> </el-input>
<el-button v-if="index===0"
size="mini"
class="btn_serve"
type="primary"
icon="el-icon-plus"
@click="addRequest()"
circle></el-button>
<el-button v-if="index!==0"
size="mini"
type="danger"
class="btn_serve"
icon="el-icon-minus"
@click="delRequest(index)"
circle></el-button>
</div>
</div>
<div v-else>
<div v-for="(item, index) in domainNameList"
:key="index">
<span style="width:300px;display:block;margin-bottom:10px; float:left">{{domainNameList[index]}} </span>
</div>
</div>
</el-form-item>
<el-form-item class="block"
label="功能说明"
prop="functionExplain">
<el-input class="item_width_2"
v-model="dataForm.functionExplain"
placeholder="功能说明"
type="textarea"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary"
@click="saveForm()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import { Loading } from 'element-ui' // Loading
let loading//
export default {
data () {
return {
visible: false,
diaTitle: '修改定制功能',
type: '', // A/U
functionId: '', // id
dataForm: {
functionId: '',
functionName: '',
customizedName: '',
iconLargeImg: '',
iconSmallImg: '',
shoppingStatus: 1,
functionExplain: '',
targetLink: '',
domainName: '',
fromApp: 'resi',
isDomainName: ''
},
isDomainNameCheck: true,
domainNameList: [],
isApply: 0,//
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload',
fromAppList: [
{
'dictName': '工作端',
'dictValue': 'gov'
}, {
'dictName': '居民端',
'dictValue': 'resi'
}
],
shoppingStatusList: [
{
'dictName': '下架',
'dictValue': '0'
}, {
'dictName': '上架',
'dictValue': '1'
}
]
}
},
created () {
// this.queryFunctionList()
},
computed: {
dataRule () {
return {
functionName: [
{ required: true, message: '功能名称不能为空', trigger: 'blur' },
{ min: 2, max: 5, message: '功能名称长度在 2 到 5 个字符', trigger: 'blur' }
],
// domainNameList: [
// { required: true, message: '', trigger: 'blur' }
// ],
iconLargeImg: [
{ required: true, message: '大图标不能为空', trigger: 'blur' }
],
iconSmallImg: [
{ required: true, message: '小图标不能为空', trigger: 'blur' }
],
fromApp: [
{ required: true, message: '来源不能为空', trigger: 'blur' }
],
shoppingStatus: [
{ required: true, message: '上架状态不能为空', trigger: 'blur' }
],
functionExplain: [
{ required: true, message: '功能描述不能为空', trigger: 'blur' }
],
targetLink: [
{ required: true, message: '外链地址不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (functionId, type) {
this.type = type
this.visible = true
this.functionId = functionId
if (type === 'A') {
this.diaTitle = '新增定制功能'
this.dataForm = {
functionId: '',
functionName: '',
customizedName: '',
iconLargeImg: '',
iconSmallImg: '',
shoppingStatus: '1',
functionExplain: '',
targetLink: '',
domainName: '',
fromApp: 'resi'
}
this.domainNameList = ['']
this.isApply = 0
} else {
this.diaTitle = '修改定制功能'
this.loadFormData()
}
},
addRequest () {
// eslint-disable-next-line
// debugger
this.domainNameList.push('')
},
delRequest (index) {
this.domainNameList.splice(index, 1)
},
loadFormData () {
// const url='https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/functioncustomized/getfunctioncustomized'
const url = '/oper/customize/functioncustomized/getfunctioncustomized'
let _data = {
functionId: this.functionId
}
window.app.ajax.post(url, _data,
(data, rspMsg) => {
this.dataForm = data
this.isDomainNameCheck = data.isDomainName === '1'
this.domainNameList = this.dataForm.domainName.split(';')
this.isApply = data.isApply
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
},
//
handleImgSuccess (res, file, type) {
if (res.code === 0 && res.msg === 'success') {
if (type === 'large') {
this.dataForm.iconLargeImg = res.data.url
} else if (type === 'small') {
this.dataForm.iconSmallImg = res.data.url
}
} else {
this.$message.error(res.msg)
}
},
beforeImgUpload (file) {
// const isPNG = file.type === 'image/png'
const isLt1M = file.size / 1024 / 1024 < 1
// if (!isPNG) {
// this.$message.error(' PNG !')
// }
if (!isLt1M) {
this.$message.error('上传图片大小不能超过 1MB!')
}
// return isPNG && isLt1M
return isLt1M
},
saveForm () {
this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
} else {
let domainName = ''
for (let i = 0; i < this.domainNameList.length; i++) {
if (this.domainNameList[i] !== '') {
domainName = domainName + this.domainNameList[i] + ';'
}
}
domainName = domainName.substring(0, domainName.length - 1)
this.dataForm.domainName = domainName
this.dataForm.isDomainName = this.isDomainNameCheck ? '1' : '0'
let url = ''
if (this.type === 'U') {
url = '/oper/customize/functioncustomized/updatecustomized'
} else {
url = '/oper/customize/functioncustomized/savefunctioncustomized'
this.dataForm.functionId = ''
}
this.dataForm.functionGroup = '1'
window.app.ajax.post(url, this.dataForm,
(data, rspMsg) => {
this.$message({
type: 'success',
message: '保存成功'
})
this.$emit('editDiaOK')
this.visible = false
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
}
})
},
handleClose () {
this.visible = false
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
}
}
</script>
<style scoped>
.function-icon {
width: 28px;
}
.item_width_1 {
width: 300px;
}
.item_width_2 {
width: 500px;
}
.block {
display: block;
}
.btn_serve {
float: left;
margin-top: 4px;
margin-left: 10px;
vertical-align: bottom;
}
</style>
Loading…
Cancel
Save