Browse Source

上传代码完善

master
jiangyy 5 years ago
parent
commit
1ead51066b
  1. 4
      epmet-oper-web/.env.development
  2. 15
      epmet-oper-web/src/App.vue
  3. 12
      epmet-oper-web/src/js/store/modules/app.js
  4. 3
      epmet-oper-web/src/js/store/type.js
  5. 1
      epmet-oper-web/src/views/components/CTable.vue
  6. 24
      epmet-oper-web/src/views/modules/code/CommitList.vue
  7. 29
      epmet-oper-web/src/views/modules/code/SubmitFailReason.vue
  8. 257
      epmet-oper-web/src/views/modules/code/SubmitForm.vue
  9. 128
      epmet-oper-web/src/views/modules/code/SubmitItem.vue
  10. 19
      epmet-oper-web/src/views/modules/customer-manage/RegisterList.vue

4
epmet-oper-web/.env.development

@ -1,5 +1,5 @@
NODE_ENV=development NODE_ENV=development
# VUE_APP_API_SERVER = http://192.168.1.130:8080/api VUE_APP_API_SERVER = http://192.168.1.130:8080/api
# VUE_APP_API_SERVER = http://10.10.10.98:8080/api # VUE_APP_API_SERVER = http://10.10.10.98:8080/api
VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev

15
epmet-oper-web/src/App.vue

@ -39,10 +39,23 @@ export default {
}) })
}) })
}, },
...mapActions(['setClientHeight', 'setSize', 'setResolution']) ...mapActions(['setClientHeight', 'setSize', 'setResolution', 'setEnv'])
}, },
mounted () { mounted () {
const that = this const that = this
let envShow = process.env.VUE_APP_NODE_ENV
let env = 'dev'
if (envShow === 'dev' || envShow === 'prod:sit') { //
env = 'dev'
} else if (envShow === 'prod:uat') { //
env = 'test'
} else if (envShow === 'prod') { //
env = 'prod'
}
// eslint-disable-next-line
// debugger
that.setEnv(env)
// size // size
if (document.documentElement.clientHeight < 800) { if (document.documentElement.clientHeight < 800) {
// medium // medium

12
epmet-oper-web/src/js/store/modules/app.js

@ -4,12 +4,14 @@ export default {
state: { state: {
clientHeight: document.documentElement.clientHeight, clientHeight: document.documentElement.clientHeight,
size: 'medium', size: 'medium',
resolution: 'medium' resolution: 'medium',
env: 'dev'
}, },
getters: { getters: {
clientHeight: state => state.clientHeight, clientHeight: state => state.clientHeight,
size: state => state.size, size: state => state.size,
resolution: state => state.resolution resolution: state => state.resolution,
env: state => state.env
}, },
mutations: { mutations: {
[type.client_height] (state, payload) { [type.client_height] (state, payload) {
@ -20,6 +22,9 @@ export default {
}, },
[type.resolution] (state, payload) { [type.resolution] (state, payload) {
state.resolution = payload state.resolution = payload
},
[type.env] (state, payload) {
state.env = payload
} }
}, },
actions: { actions: {
@ -31,6 +36,9 @@ export default {
}, },
setResolution ({ commit }, payload) { setResolution ({ commit }, payload) {
commit(type.resolution, payload) commit(type.resolution, payload)
},
setEnv ({ commit }, payload) {
commit(type.env, payload)
} }
} }
} }

3
epmet-oper-web/src/js/store/type.js

@ -1,5 +1,6 @@
export default { export default {
client_height: 'CLIENT_HEIGHT', client_height: 'CLIENT_HEIGHT',
size: 'SIZE', size: 'SIZE',
resolution: 'RESOLUTION' resolution: 'RESOLUTION',
env: 'ENV'
} }

1
epmet-oper-web/src/views/components/CTable.vue

@ -214,6 +214,7 @@ export default {
this.loadData() this.loadData()
}, },
loadData () { loadData () {
// eslint-disable-next-line
this.loading = true this.loading = true
Object.keys(this.params).forEach(key => { Object.keys(this.params).forEach(key => {
if (this.params[key] instanceof Array) { if (this.params[key] instanceof Array) {

24
epmet-oper-web/src/views/modules/code/CommitList.vue

@ -5,8 +5,7 @@
<div class="mod-demo__demo}"> <div class="mod-demo__demo}">
<el-form :inline="true" <el-form :inline="true"
:model="tableParams" :model="tableParams">
@keyup.enter.native="loadTableData()">
<el-form-item> <el-form-item>
<el-select v-model="tableParams.customerId" <el-select v-model="tableParams.customerId"
placeholder="客户" placeholder="客户"
@ -135,11 +134,11 @@ export default {
clientType: '', // clientType: '', //
state: '', // state: '', //
commitDate: '', // commitDate: '', //
submitDate: '' // submitDate: '', //
source: this.env
}, },
// //
tableUrl: '/third/code/uploadlist', tableUrl: '/third/code/uploadlist',
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/uploadlist',
// //
operations: [ operations: [
{ {
@ -317,7 +316,7 @@ export default {
tableHeight () { tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 90 return this.clientHeight - 60 - 80 - 80 - 90
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight', 'env'])
}, },
methods: { methods: {
// //
@ -326,6 +325,7 @@ export default {
}, },
// //
loadTableData () { loadTableData () {
this.tableParams.source = this.env
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.table.loadData() // this.$refs.table.loadData() //
}) })
@ -344,9 +344,9 @@ export default {
// //
submitCodeDiaShow (row) { submitCodeDiaShow (row) {
let feedbackShow = false let feedbackShow = false
// if (row.status === 'audit_failed') { if (row.status === 'audit_failed') {
feedbackShow = true feedbackShow = true
// } }
this.$refs['ref_submit_form'].initData(row.id, feedbackShow) this.$refs['ref_submit_form'].initData(row.id, feedbackShow)
}, },
@ -418,12 +418,12 @@ export default {
this.qrCodeDia.visible = false this.qrCodeDia.visible = false
}, },
async renderSelData () { // // async renderSelData () { // //
const customerUrl = '/third/pacustomer/registerbyauth' const customerUrl = ' https://epmet-cloud.elinkservice.cn/api/third/pacustomer/registerbyauth'
// const customerUrl = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/pacustomer/registerbyauth'
const param = { const param = {
// initState: 1, // workAuth: 1,
// resiAuth: 1, // resiAuth: 1,
workAuth: 1 source: this.env,
initState: 1
} }
this.startLoading() this.startLoading()
await window.app.ajax.post(customerUrl, param, await window.app.ajax.post(customerUrl, param,

29
epmet-oper-web/src/views/modules/code/SubmitFailReason.vue

@ -65,20 +65,21 @@ export default {
this.codeId = codeId this.codeId = codeId
this.diaVisible = true this.diaVisible = true
this.dataForm.reason = '没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败,没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败' // this.dataForm.reason = ','
// this.dataForm.screenshotUrl = ['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg']
this.dataForm.screenshotUrl = ['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'] const url = '/third/code/reason'
// const url = '/third/code/reason' const param = {
// const param = { codeId: codeId
// codeId: row.id }
// } window.app.ajax.post(url, param,
// window.app.ajax.post(url, param, (data, rspMsg) => {
// (data, rspMsg) => { this.dataForm.reason = data.reason
// this.$message.success(rspMsg) this.dataForm.screenshotUrl = data.screenshotUrl
// }, // this.$message.success(rspMsg)
// (rspMsg, data) => { },
// this.$message.error(rspMsg) (rspMsg, data) => {
// }) this.$message.error(rspMsg)
})
}, },
getSrcList (index) { getSrcList (index) {
return this.dataForm.screenshotUrl.slice(index).concat(this.dataForm.screenshotUrl.slice(0, index)) return this.dataForm.screenshotUrl.slice(index).concat(this.dataForm.screenshotUrl.slice(0, index))

257
epmet-oper-web/src/views/modules/code/SubmitForm.vue

@ -37,13 +37,14 @@
:action="upload_url" :action="upload_url"
list-type="picture-card" list-type="picture-card"
:name="upload_name" :name="upload_name"
:on-exceed="handleExceed" :on-exceed="exceedPic"
:on-remove="removePic"
:file-list="picList" :file-list="picList"
:limit="3" :limit="5"
:http-request="uploadPic"> :http-request="uploadPic">
<span class="font-14">选择图片</span> <span class="font-14">选择图片</span>
<div slot="tip" <div slot="tip"
class="el-upload__tip">小程序页面截图最多3每张大小2M以内</div> class="el-upload__tip">小程序页面截图最多5每张大小2M以内</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -54,9 +55,10 @@
ref="uploadVedio" ref="uploadVedio"
:action="upload_url" :action="upload_url"
:name="upload_name" :name="upload_name"
:on-exceed="handleExceed" :on-exceed="exceedVedio"
:file-list="vedioList" :on-remove="removeVedio"
:limit="1" :file-list="videoList"
:limit="2"
:http-request="uploadVedio"> :http-request="uploadVedio">
<el-button size="small" <el-button size="small"
type="primary">选择视频</el-button> type="primary">选择视频</el-button>
@ -103,13 +105,14 @@
:action="upload_url" :action="upload_url"
list-type="picture-card" list-type="picture-card"
:name="upload_name" :name="upload_name"
:on-exceed="handleExceed" :on-exceed="exceedFeedbackPic"
:on-remove="removeFeedbackPic"
:file-list="feedbackPicList" :file-list="feedbackPicList"
:limit="3" :limit="5"
:http-request="uploadFeedbackPic"> :http-request="uploadFeedbackPic">
<span class="font-14">选择图片</span> <span class="font-14">选择图片</span>
<div slot="tip" <div slot="tip"
class="el-upload__tip">大小2M以内</div> class="el-upload__tip">反馈图片最多5张大小2M以内</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -223,10 +226,6 @@ export default {
sceneOtherDisabled: true, // sceneOtherDisabled: true, //
dataForm: { dataForm: {
versionDesc: '', // versionDesc: '', //
previewInfo: { //
videoIdList: [],
picIdList: []
},
feedbackInfo: '', // feedbackInfo: '', //
feedbackStuff: '', // feedbackStuff: '', //
ugcDeclare: { // UGC ugcDeclare: { // UGC
@ -237,16 +236,13 @@ export default {
auditDesc: '' // UGC,256 auditDesc: '' // UGC,256
} }
}, },
previewPicArray: [],
previewVedioArray: [],
feedbackPicArray: [],
// //
dialogImageUrl: '/third/code/mediaupload', dialogImageUrl: '/third/code/mediaupload',
upload_url: '', // URL upload_url: '', // URL
upload_name: '', // upload_name: '', //
picList: [], // picList: [], //
vedioList: [], // videoList: [], //
feedbackPicList: [], // feedbackPicList: [], //
// //
@ -276,10 +272,6 @@ export default {
reseatDataForm () { reseatDataForm () {
this.dataForm = { this.dataForm = {
versionDesc: '', // versionDesc: '', //
previewInfo: { //
videoIdList: [],
picIdList: []
},
feedbackInfo: '', // feedbackInfo: '', //
feedbackStuff: '', // feedbackStuff: '', //
ugcDeclare: { // UGC ugcDeclare: { // UGC
@ -296,77 +288,83 @@ export default {
this.$refs['ref_submit_item'].initData(this.codeId) this.$refs['ref_submit_item'].initData(this.codeId)
} }
}, },
handleExceed: function () { removeVedio (file) {
this.videoList.splice(this.videoList.findIndex(item => item.uid === file.uid), 1)
// console.log(this.videoList)
},
removePic (file) {
this.picList.splice(this.picList.findIndex(item => item.uid === file.uid), 1)
// console.log(this.picList)
},
removeFeedbackPic (file) {
this.feedbackPicList.splice(this.feedbackPicList.findIndex(item => item.uid === file.uid), 1)
// console.log(this.feedbackPicList)
},
exceedPic: function () {
this.$message({
message: '最多上传5张预览图片',
type: 'warning'
})
},
exceedVedio: function () {
this.$message({
message: '最多上传2个预览视频',
type: 'warning'
})
},
exceedFeedbackPic: function () {
this.$message({ this.$message({
message: '请先删除选择的图片或视频,再上传', message: '最多上传5张反馈图片',
type: 'warning' type: 'warning'
}) })
}, },
// //
uploadVedio: function (params) { uploadVedio: function (params) {
// eslint-disable-next-line
debugger
let file = params.file let file = params.file
let fileType = file.type let fileType = file.type
let isVideo = fileType.indexOf('video') !== -1 let isVideo = fileType.indexOf('video') !== -1
let fileUrl = this.$refs.uploadVedio.uploadFiles[this.vedioList.length].url let fileUrl = this.$refs.uploadVedio.uploadFiles[this.videoList.length].url
file.url = fileUrl file.url = fileUrl
this.vedioList.push(file) this.videoList.push(file)
let isLt2M = file.size / 1024 / 1024 < 2 let isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) { if (!isLt2M) {
this.$message({ this.$message({
message: '上传视频大小不能超过 2MB!', message: '上传视频大小不能超过 2MB!',
type: 'error' type: 'warning'
})
this.$refs.upload.uploadFiles = []
return
}
if (!isVideo) {
this.$message({
message: '请选择视频!',
type: 'error'
}) })
this.$refs.upload.uploadFiles = [] this.videoList.pop()
return return
} }
let isMP4 = file.type === 'video/mp4' let isMP4 = file.type === 'video/mp4'
if (!isMP4) { if (!isVideo || !isMP4) {
this.$message({ this.$message({
message: '上传视频只支持 mp4 格式!', message: '请选择mp4格式的视频!',
type: 'error' type: 'warning'
}) })
this.$refs.upload.uploadFiles = [] this.videoList.pop()
return return
} }
this.startLoading()
this.upload_name = 'file_video[]' this.upload_name = 'file_video[]'
let formData = new FormData() let formData = new FormData()
// // eslint-disable-next-line
// debugger
formData.append('type', fileType) formData.append('type', fileType)
formData.append('media', file) formData.append('media', file)
formData.append('codeId', this.codeId) formData.append('codeId', this.codeId)
window.app.ajax.post2(this.dialogImageUrl, formData, window.app.ajax.post2(this.dialogImageUrl, formData,
(data, rspMsg) => { (data, rspMsg) => {
// eslint-disable-next-line this.endLoading()
debugger
if (data.code === 0) { if (data.code === 0) {
console.log('成功') this.videoList[this.videoList.length - 1].mediaid = data.data
let obj = {
mediaid: data,
uid: file.uid
}
this.previewVedioArray.push(obj)
this.$message.success(rspMsg)
} else { } else {
console.log('失败') this.videoList.pop()
this.vedioList.pop()
this.$message.error(rspMsg) this.$message.error(rspMsg)
} }
}, },
(rspMsg, data) => { (rspMsg, data) => {
this.vedioList.pop() this.videoList.pop()
this.endLoading()
this.$message.error(rspMsg) this.$message.error(rspMsg)
}) })
}, },
@ -379,51 +377,44 @@ export default {
file.url = fileUrl file.url = fileUrl
this.picList.push(file) this.picList.push(file)
// let isLt2M = file.size / 1024 / 1024 < 2 let isLt2M = file.size / 1024 / 1024 < 2
// if (!isLt2M) { if (!isLt2M) {
// this.$message({ this.$message({
// message: ' 2MB!', message: '上传图片大小不能超过 2MB!',
// type: 'error' type: 'warning'
// }) })
// this.$refs.upload.uploadFiles = [] this.picList.pop()
// // return return
// } }
if (!isImage) { if (!isImage) {
this.$message({ this.$message({
message: '请选择图片!', message: '请选择图片!',
type: 'error' type: 'warning'
}) })
this.$refs.uploadPic.uploadFiles = [] this.picList.pop()
return return
} }
// console.log(this.picList) // console.log(this.picList)
this.upload_name = 'file_img[]' this.upload_name = 'file_img[]'
let formData = new FormData() let formData = new FormData()
this.startLoading()
formData.append('type', fileType) formData.append('type', fileType)
formData.append('media', file) formData.append('media', file)
formData.append('codeId', this.codeId) formData.append('codeId', this.codeId)
window.app.ajax.post2(this.dialogImageUrl, formData, window.app.ajax.post2(this.dialogImageUrl, formData,
(data, rspMsg) => { (data, rspMsg) => {
// eslint-disable-next-line this.endLoading()
debugger
if (data.code === 0) { if (data.code === 0) {
console.log('成功') this.picList[this.picList.length - 1].mediaid = data.data
let obj = {
mediaid: data,
uid: file.uid
}
this.previewPicArray.push(obj)
this.$message.success(rspMsg)
} else { } else {
console.log('失败')
this.picList.pop() this.picList.pop()
this.$message.error(rspMsg) this.$message.error(rspMsg)
} }
}, },
(rspMsg, data) => { (rspMsg, data) => {
this.picList.pop() this.picList.pop()
this.endLoading()
this.$message.error(rspMsg) this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } }) }, { headers: { 'Content-Type': 'multipart/form-data' } })
}, },
@ -436,24 +427,23 @@ export default {
file.url = fileUrl file.url = fileUrl
this.feedbackPicList.push(file) this.feedbackPicList.push(file)
// let isLt2M = file.size / 1024 / 1024 < 2 let isLt2M = file.size / 1024 / 1024 < 2
// if (!isLt2M) { if (!isLt2M) {
// this.$message({ this.$message({
// message: ' 2MB!', message: '上传图片大小不能超过 2MB!',
// type: 'error' type: 'warning'
// }) })
// this.$refs.upload.uploadFiles = [] this.feedbackPicList.pop()
// // return return
// } }
if (!isImage) { if (!isImage) {
this.$message({ this.$message({
message: '请选择图片!', message: '请选择图片!',
type: 'error' type: 'warning'
}) })
this.$refs.uploadPic.uploadFiles = [] this.feedbackPicList.pop()
return return
} }
// console.log(this.picList)
this.upload_name = 'file_img[]' this.upload_name = 'file_img[]'
let formData = new FormData() let formData = new FormData()
@ -461,26 +451,20 @@ export default {
formData.append('type', fileType) formData.append('type', fileType)
formData.append('media', file) formData.append('media', file)
formData.append('codeId', this.codeId) formData.append('codeId', this.codeId)
this.startLoading()
window.app.ajax.post2(this.dialogImageUrl, formData, window.app.ajax.post2(this.dialogImageUrl, formData,
(data, rspMsg) => { (data, rspMsg) => {
// eslint-disable-next-line this.endLoading()
debugger
if (data.code === 0) { if (data.code === 0) {
console.log('成功') this.feedbackPicList[this.feedbackPicList.length - 1].mediaid = data.data
let obj = {
mediaid: data,
uid: file.uid
}
this.feedbackPicArray.push(obj)
this.$message.success(rspMsg)
} else { } else {
console.log('失败')
this.feedbackPicList.pop() this.feedbackPicList.pop()
this.$message.error(rspMsg) this.$message.error(rspMsg)
} }
}, },
(rspMsg, data) => { (rspMsg, data) => {
this.feedbackPicList.pop() this.feedbackPicList.pop()
this.endLoading()
this.$message.error(rspMsg) this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } }) }, { headers: { 'Content-Type': 'multipart/form-data' } })
}, },
@ -511,32 +495,36 @@ export default {
this.dataForm.ugcDeclare.auditDesc = '' this.dataForm.ugcDeclare.auditDesc = ''
}, },
submitCode () { submitCode () {
// const url = '/third/code/audit'
let params = { let params = {
codeId: this.codeId, codeId: this.codeId,
ugcDeclare: this.dataForm.ugcDeclare // ugcDeclare: this.dataForm.ugcDeclare //
} }
// //
// //
this.dataForm.previewInfo.picIdList = [] let picIdList = []
this.dataForm.previewInfo.videoIdList = [] let videoIdList = []
this.previewPicArray.forEach(element => { this.picList.forEach(element => {
this.dataForm.previewInfo.picIdList.push(element.mediaid) picIdList.push(element.mediaid)
}) })
// // eslint-disable-next-line
this.previewVedioArray.forEach(element => { // debugger
this.dataForm.previewInfo.videoIdList.push(element.mediaid) this.videoList.forEach(element => {
videoIdList.push(element.mediaid)
}) })
// //
if (this.dataForm.previewInfo.picIdList.length > 0 || this.dataForm.previewInfo.videoIdList.length > 0) { if (picIdList.length > 0 || videoIdList.length > 0) {
params.previewInfo = Object params.previewInfo = {}
if (this.dataForm.previewInfo.picIdList.length > 0) { if (picIdList.length > 0) {
params.previewInfo.picIdList = this.dataForm.previewInfo.picIdList params.previewInfo.picIdList = picIdList
} }
if (this.dataForm.previewInfo.videoIdList.length > 0) { if (videoIdList.length > 0) {
params.previewInfo.videoIdList = this.dataForm.previewInfo.videoIdList params.previewInfo.videoIdList = videoIdList
} }
// console.log('')
// console.log(params.previewInfo.picIdList)
// console.log('')
// console.log(params.previewInfo.videoIdList)
} }
// //
@ -554,42 +542,51 @@ export default {
if (this.dataForm.feedbackInfo !== '') { if (this.dataForm.feedbackInfo !== '') {
params.feedbackInfo = this.dataForm.feedbackInfo params.feedbackInfo = this.dataForm.feedbackInfo
} }
this.dataForm.feedbackStuff = ''
this.feedbackPicList.forEach(element => {
this.dataForm.feedbackStuff = this.dataForm.feedbackStuff + element.mediaid + '|'
})
if (this.dataForm.feedbackStuff !== '') { if (this.dataForm.feedbackStuff !== '') {
this.dataForm.feedbackStuff = this.dataForm.feedbackStuff.slice(0, this.dataForm.feedbackStuff.length - 1)
params.feedbackStuff = this.dataForm.feedbackStuff params.feedbackStuff = this.dataForm.feedbackStuff
} }
console.log(params) console.log(params)
// this.startLoading()
// window.app.ajax.post(url, params, // console.log('')
// (data, rspMsg) => { // console.log(params.feedbackStuff)
// this.endLoading()
// this.$message.success('') const url = '/third/code/audit'
// this.diaCancel() this.startLoading()
// this.$emit('refresh') window.app.ajax.post(url, params,
// }, (data, rspMsg) => {
// (rspMsg, data) => { this.endLoading()
// this.endLoading() this.$message.success('提交审核成功,请等待审核结果')
// this.$message.error(rspMsg) this.diaCancel()
// }) this.$emit('refresh')
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
}, },
// //
diaCancel () { diaCancel () {
this.resetData() this.resetData()
this.activeName = 'desc'
this.diaVisible = false this.diaVisible = false
}, },
resetData () { resetData () {
this.reseatDataForm() this.reseatDataForm()
// //
this.picList = [] this.picList = []
this.previewPicArray = [] this.videoList = []
this.vedioList = []
this.previewVedioArray = []
// //
this.$refs['ref_submit_item'].reseatData() this.$refs['ref_submit_item'].reseatData()
// //
this.feedbackPicList = [] this.feedbackPicList = []
this.feedbackPicArray = []
// //
}, },
// //

128
epmet-oper-web/src/views/modules/code/SubmitItem.vue

@ -10,7 +10,7 @@
label-width="150px"> label-width="150px">
<el-select v-model="dataForm.address" <el-select v-model="dataForm.address"
placeholder="页面列表" placeholder="页面列表"
style="width:300px" style="width:600px"
filterable> filterable>
<el-option v-for="item in addressList" <el-option v-for="item in addressList"
:key="item.value" :key="item.value"
@ -25,6 +25,8 @@
label-width="150px"> label-width="150px">
<el-input placeholder='请输入标签' <el-input placeholder='请输入标签'
style="width:300px" style="width:300px"
maxlength="20"
show-word-limit
v-model="dataForm.tag"> v-model="dataForm.tag">
</el-input> </el-input>
<div class="el-upload__tip">小程序的标签用空格分隔标签至多10个标签长度至多20</div> <div class="el-upload__tip">小程序的标签用空格分隔标签至多10个标签长度至多20</div>
@ -32,11 +34,9 @@
<el-form-item label="标题" <el-form-item label="标题"
prop="title" prop="title"
label-width="150px" label-width="150px">
style="display:block">
<el-input placeholder='请输入标题' <el-input placeholder='请输入标题'
style="width:500px" style="width:600px"
type="textarea"
maxlength="32" maxlength="32"
show-word-limit show-word-limit
v-model="dataForm.title"> v-model="dataForm.title">
@ -61,32 +61,32 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="first_class" <el-table-column prop="firstClass"
label="一级名称" label="一级名称"
min-width="100" min-width="100"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="first_id" <el-table-column prop="firstId"
label="一级ID" label="一级ID"
min-width="100" min-width="100"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="second_class" <el-table-column prop="secondClass"
label="二级名称" label="二级名称"
min-width="70" min-width="70"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="second_id" <el-table-column prop="secondId"
label="二级ID" label="二级ID"
min-width="100" min-width="100"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="third_class" <el-table-column prop="thirdClass"
label="三级名称" label="三级名称"
min-width="70" min-width="70"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="third_id" <el-table-column prop="thirdId"
label="三级ID" label="三级ID"
header-align="center" header-align="center"
min-width="100" min-width="100"
@ -120,36 +120,49 @@
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="first_class" <el-table-column prop="firstClass"
label="一级名称" label="一级名称"
min-width="100" min-width="100"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="first_id" <el-table-column prop="firstId"
label="一级ID" label="一级ID"
min-width="100" min-width="100"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="second_class" <el-table-column prop="secondClass"
label="二级名称" label="二级名称"
min-width="70" min-width="70"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="second_id" <el-table-column prop="secondId"
label="二级ID" label="二级ID"
min-width="100" min-width="100"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="third_class" <el-table-column prop="thirdClass"
label="三级名称" label="三级名称"
min-width="70" min-width="70"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="third_id" <el-table-column prop="thirdId"
label="三级ID" label="三级ID"
header-align="center" header-align="center"
min-width="100" min-width="100"
align="center"></el-table-column> align="center"></el-table-column>
<!--操作列-->
<el-table-column label="操作"
fixed="right"
:min-width="80"
header-align="center"
class="operate">
<template slot-scope="scope">
<el-button size="mini"
type="text"
@click.stop="deleteItem(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
@ -184,19 +197,7 @@ export default {
operations: [], operations: [],
// //
itemTableData: [ itemTableData: []
// {
// address: 'index',
// tag: ' ',
// title: '',
// firstClass: '',
// firstId: 1,
// secondClass: '',
// secondId: 2,
// thirdClass: '',
// thirdId: null
// }
]
} }
}, },
components: { components: {
@ -220,6 +221,7 @@ export default {
}, },
methods: { methods: {
initData (codeId) { initData (codeId) {
this.reseatData()
this.codeId = codeId this.codeId = codeId
const params = { const params = {
codeId: this.codeId codeId: this.codeId
@ -239,20 +241,20 @@ export default {
window.app.ajax.post(this.categoryUrl, params, window.app.ajax.post(this.categoryUrl, params,
(data, rspMsg) => { (data, rspMsg) => {
data = [ // data = [
{ // {
'first_class': '社交', // 'first_class': '',
'second_class': '社区/论坛', // 'second_class': '/',
'first_id': 684, // 'first_id': 684,
'second_id': 794 // 'second_id': 794
}, // },
{ // {
'first_class': '社交1', // 'first_class': '1',
'second_class': '社区/论坛1', // 'second_class': '/1',
'first_id': 685, // 'first_id': 685,
'second_id': 796 // 'second_id': 796
} // }
] // ]
data.forEach((item, index) => { data.forEach((item, index) => {
item.id = index item.id = index
}) })
@ -263,30 +265,43 @@ export default {
}) })
}, },
getRadioRow (index, row) { getRadioRow (index, row) {
console.log(row)
this.selCategory = row this.selCategory = row
}, },
// //
addItem () { addItem () {
let oneObj = this.selCategory if (this.itemTableData.length === 5) {
oneObj.address = this.dataForm.address this.$message.warning('最多填写5项审核项')
oneObj.title = this.dataForm.title return false
oneObj.tag = this.dataForm.tag }
// eslint-disable-next-line
// debugger
// //
let repeatAdress = this.itemTableData.filter(item => item.address === oneObj.address) const that = this
// let result = this.itemTableData.fliter(function (value) { let result = this.itemTableData.some(function (value) {
// console.log(value) return value.address === that.dataForm.address
// return value.address === oneObj.address })
// })
if (repeatAdress.length > 0) { if (result) {
this.$message.warning('当前页面已添加,请更换页面后重新添加') this.$message.warning('当前页面已添加,请更换页面后重新添加')
return false return false
} }
let oneObj = {}
oneObj.address = this.dataForm.address
oneObj.title = this.dataForm.title
oneObj.tag = this.dataForm.tag
oneObj.firstClass = this.selCategory.firstClass
oneObj.firstId = this.selCategory.firstId
oneObj.secondClass = this.selCategory.secondClass
oneObj.secondId = this.selCategory.secondId
oneObj.thirdClass = this.selCategory.thirdClass
oneObj.thirdId = this.selCategory.thirdId
this.itemTableData.push(oneObj) this.itemTableData.push(oneObj)
}, },
deleteItem (index) {
this.itemTableData.splice(index, 1)
},
getItemList () { getItemList () {
return this.itemTableData return this.itemTableData
}, },
@ -296,6 +311,9 @@ export default {
tag: '', tag: '',
title: '' title: ''
} }
this.templateRadio = ''
this.addressList = []
this.categoryList = []
this.itemTableData = [] this.itemTableData = []
this.selCategory = {} this.selCategory = {}
}, },

19
epmet-oper-web/src/views/modules/customer-manage/RegisterList.vue

@ -48,13 +48,10 @@ export default {
name: '' // name: '' //
}, },
// //
tableUrl: '/third/pacustomer/registerinfo', tableUrl: 'https://epmet-cloud.elinkservice.cn/api/third/pacustomer/registerinfo',
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/pacustomer/registerinfo', // tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/pacustomer/registerinfo',
tableParams: { tableParams: {
type: Object, // table source: this.env
default () {
return {}
}
}, },
// //
operations: [ operations: [
@ -155,13 +152,15 @@ export default {
}) })
}, },
mounted () { mounted () {
this.tableParams.source = this.env
// eslint-disable-next-line
this.loadData() this.loadData()
}, },
computed: { computed: {
tableHeight () { tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 50 return this.clientHeight - 60 - 80 - 80 - 50
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight', 'env'])
}, },
methods: { methods: {
// //
@ -188,12 +187,12 @@ export default {
}, },
// //
commitCode (row) { commitCode (row) {
const customerUrl = '/third/pacustomer/registerbyauth' const customerUrl = 'https://epmet-cloud.elinkservice.cn/api/third/pacustomer/registerbyauth'
// const customerUrl = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/pacustomer/registerbyauth'
const param = { const param = {
// initState: 1, // workAuth: 1,
// resiAuth: 1, // resiAuth: 1,
workAuth: 1 source: this.env,
initState: 1
} }
this.startLoading() this.startLoading()
window.app.ajax.post(customerUrl, param, window.app.ajax.post(customerUrl, param,

Loading…
Cancel
Save