18 changed files with 742 additions and 1006 deletions
@ -1,5 +1,5 @@ |
|||
NODE_ENV=development |
|||
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://192.168.1.130:8080/api |
|||
VUE_APP_API_SERVER = http://10.10.10.207:8080/api |
|||
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api |
|||
VUE_APP_NODE_ENV=dev |
|||
@ -0,0 +1,255 @@ |
|||
<template> |
|||
<div style=" position: relative;"> |
|||
|
|||
<el-button type="default" |
|||
@click="diaCancel">取消返回</el-button> |
|||
<el-button type="primary" |
|||
@click="submitCode">提交</el-button> |
|||
|
|||
<el-form :inline="true" |
|||
:model="dataForm" |
|||
class="form"> |
|||
|
|||
<el-form-item label="反馈内容" |
|||
prop="feedbackInfo" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input type="textarea" |
|||
:autosize="{ minRows: 5, maxRows: 8}" |
|||
:rows="5" |
|||
resize="none" |
|||
style="width:600px" |
|||
placeholder='请输入反馈内容' |
|||
v-model="dataForm.feedbackInfo"> |
|||
</el-input> |
|||
<div slot="tip" |
|||
class="el-upload__tip">反馈内容,至多200字,只有上个版本被驳回才可填写</div> |
|||
</el-form-item> |
|||
<el-form-item label="反馈图片" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-upload class="avatar-uploader" |
|||
ref="uploadFeedbackPic" |
|||
:action="upload_url" |
|||
list-type="picture-card" |
|||
:name="upload_name" |
|||
:on-exceed="exceedFeedbackPic" |
|||
:on-remove="removeFeedbackPic" |
|||
:file-list="feedbackPicList" |
|||
:limit="5" |
|||
:http-request="uploadFeedbackPic"> |
|||
<span class="font-14">选择图片</span> |
|||
<div slot="tip" |
|||
class="el-upload__tip">反馈图片,最多5张,大小2M以内</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CDialog from '@c/CDialog' |
|||
import CommitForm from './CommitForm' |
|||
import SubmitItem from './SubmitItem' |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
codeId: '', // 上传代码id,父组件传 |
|||
|
|||
dataForm: { |
|||
feedbackInfo: '', // 反馈内容 |
|||
feedbackStuff: '' // 反馈素材 |
|||
}, |
|||
|
|||
// 上传素材 |
|||
dialogImageUrl: 'https://epmet-cloud.elinkservice.cn/api/third/code/mediaupload', |
|||
upload_url: '', // 上传URL |
|||
upload_name: '', // 图片或视频名称 |
|||
feedbackPicList: [], // 预览列表 |
|||
|
|||
// 弹出框相关 |
|||
dialog: { |
|||
title: '', |
|||
visible: false |
|||
} |
|||
} |
|||
}, |
|||
components: { |
|||
CDialog, CommitForm, SubmitItem |
|||
}, |
|||
mounted () { |
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
return this.clientHeight * 0.56 - 100 |
|||
}, |
|||
...mapGetters(['clientHeight']) |
|||
}, |
|||
methods: { |
|||
initData (codeId) { |
|||
this.codeId = codeId |
|||
}, |
|||
reseatDataForm () { |
|||
this.dataForm = { |
|||
feedbackInfo: '', // 反馈内容 |
|||
feedbackStuff: '' // 反馈素材 |
|||
} |
|||
}, |
|||
|
|||
removeFeedbackPic (file) { |
|||
this.feedbackPicList.splice(this.feedbackPicList.findIndex(item => item.uid === file.uid), 1) |
|||
// console.log(this.feedbackPicList) |
|||
}, |
|||
exceedFeedbackPic: () => { |
|||
this.$message({ |
|||
message: '最多上传5张反馈图片', |
|||
type: 'warning' |
|||
}) |
|||
}, |
|||
// 上传反馈图片 |
|||
uploadFeedbackPic: (params) => { |
|||
let file = params.file |
|||
let fileType = file.type |
|||
let isImage = fileType.indexOf('image') !== -1 |
|||
let fileUrl = this.$refs.uploadFeedbackPic.uploadFiles[this.feedbackPicList.length].url |
|||
file.url = fileUrl |
|||
this.feedbackPicList.push(file) |
|||
|
|||
let isLt2M = file.size / 1024 / 1024 < 2 |
|||
if (!isLt2M) { |
|||
this.$message({ |
|||
message: '上传图片大小不能超过 2MB!', |
|||
type: 'warning' |
|||
}) |
|||
this.feedbackPicList.pop() |
|||
return |
|||
} |
|||
if (!isImage) { |
|||
this.$message({ |
|||
message: '请选择图片!', |
|||
type: 'warning' |
|||
}) |
|||
this.feedbackPicList.pop() |
|||
return |
|||
} |
|||
|
|||
this.upload_name = 'file_img[]' |
|||
let formData = new FormData() |
|||
|
|||
formData.append('type', fileType) |
|||
formData.append('media', file) |
|||
formData.append('codeId', this.codeId) |
|||
this.startLoading() |
|||
window.app.ajax.post2(this.dialogImageUrl, formData, |
|||
(data, rspMsg) => { |
|||
this.endLoading() |
|||
if (data.code === 0) { |
|||
this.feedbackPicList[this.feedbackPicList.length - 1].mediaid = data.data |
|||
} else { |
|||
this.feedbackPicList.pop() |
|||
this.$message.error(rspMsg) |
|||
} |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.feedbackPicList.pop() |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}, { headers: { 'Content-Type': 'multipart/form-data' } }) |
|||
}, |
|||
|
|||
submitCode () { |
|||
let params = { |
|||
codeId: this.codeId, |
|||
isSpeed: false |
|||
} |
|||
|
|||
// 反馈说明 |
|||
if (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 !== '') { |
|||
this.dataForm.feedbackStuff = this.dataForm.feedbackStuff.slice(0, this.dataForm.feedbackStuff.length - 1) |
|||
params.feedbackStuff = this.dataForm.feedbackStuff |
|||
} |
|||
|
|||
console.log(params) |
|||
|
|||
// console.log('反馈图片:') |
|||
// console.log(params.feedbackStuff) |
|||
|
|||
// const url = 'https://epmet-cloud.elinkservice.cn/api/third/code/audit' |
|||
const url = '/third/code/audit' |
|||
this.startLoading() |
|||
window.app.ajax.post(url, params, |
|||
(data, rspMsg) => { |
|||
this.endLoading() |
|||
this.$message.success('提交审核成功,请等待审核结果') |
|||
this.resetData() |
|||
this.$emit('okSubmit') |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
}, |
|||
// 取消 |
|||
diaCancel () { |
|||
this.resetData() |
|||
this.$emit('cancleSubmit') |
|||
}, |
|||
resetData () { |
|||
this.reseatDataForm() |
|||
|
|||
// 反馈说明 |
|||
this.feedbackPicList = [] |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
props: { |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped > |
|||
.el-tabs { |
|||
margin: 0 20px; |
|||
} |
|||
.el-upload__tip { |
|||
color: rgb(155, 155, 155); |
|||
margin: 0; |
|||
} |
|||
.form { |
|||
margin-top: 30px; |
|||
} |
|||
.div_btn { |
|||
z-index: 10; |
|||
position: absolute; |
|||
top: 5px; |
|||
right: 30px; |
|||
} |
|||
</style> |
|||
@ -1,346 +0,0 @@ |
|||
|
|||
<!--审核项--> |
|||
<template> |
|||
<div> |
|||
|
|||
<el-form :inline="true" |
|||
:model="dataForm" |
|||
style="width:1300px"> |
|||
<el-form-item label="页面列表" |
|||
prop="versionDesc" |
|||
label-width="100px"> |
|||
<el-select v-model="dataForm.address" |
|||
placeholder="页面列表" |
|||
style="width:300px" |
|||
filterable> |
|||
<el-option v-for="item in addressList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
<div class="el-upload__tip">小程序版本说明和功能解释</div> |
|||
</el-form-item> |
|||
<el-form-item label="标签" |
|||
prop="tag" |
|||
label-width="80px"> |
|||
<el-input placeholder='请输入标签' |
|||
style="width:300px" |
|||
type="textarea" |
|||
:autosize="{ minRows: 2, maxRows: 4}" |
|||
:rows="3" |
|||
maxlength="20" |
|||
show-word-limit |
|||
v-model="dataForm.tag"> |
|||
</el-input> |
|||
<div class="el-upload__tip">小程序的标签,用空格分隔,标签至多10个,标签长度至多20</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="标题" |
|||
prop="title" |
|||
label-width="80px"> |
|||
<el-input placeholder='请输入标题' |
|||
style="width:300px" |
|||
type="textarea" |
|||
:autosize="{ minRows: 2, maxRows: 4}" |
|||
:rows="3" |
|||
maxlength="32" |
|||
show-word-limit |
|||
v-model="dataForm.title"> |
|||
</el-input> |
|||
<div class="el-upload__tip">小程序页面的标题,标题长度至多32</div> |
|||
</el-form-item> |
|||
<el-form-item label="可选类目" |
|||
prop="title" |
|||
label-width="100px"> |
|||
<el-table id="out-table" |
|||
ref="table_category" |
|||
:header-cell-style="{color:'#000'}" |
|||
:data="categoryList" |
|||
style="width: 1000px" |
|||
border> |
|||
<el-table-column label="" |
|||
width="35" |
|||
center> |
|||
<template slot-scope="scope"> |
|||
<el-radio :label="scope.row.id" |
|||
v-model="templateRadio" |
|||
@change.native="getRadioRow(scope.$index,scope.row)"> </el-radio> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column prop="firstClass" |
|||
label="一级名称" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="firstId" |
|||
label="一级ID" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="secondClass" |
|||
label="二级名称" |
|||
min-width="70" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="secondId" |
|||
label="二级ID" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="thirdClass" |
|||
label="三级名称" |
|||
min-width="70" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="thirdId" |
|||
label="三级ID" |
|||
header-align="center" |
|||
min-width="100" |
|||
align="center"></el-table-column> |
|||
</el-table> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<div style="margin-top:10px"> |
|||
<el-button type="primary" |
|||
style="margin:0 10px 10px 10px" |
|||
@click="addItem()">增加</el-button> |
|||
</div> |
|||
<el-table id="out-table" |
|||
ref="table" |
|||
:header-cell-style="{color:'#000'}" |
|||
:data="itemTableData" |
|||
:style="{width: '100%'}" |
|||
border> |
|||
|
|||
<el-table-column prop="address" |
|||
label="页面" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="tag" |
|||
label="标签" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="title" |
|||
label="标题" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
|
|||
<el-table-column prop="firstClass" |
|||
label="一级名称" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="firstId" |
|||
label="一级ID" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="secondClass" |
|||
label="二级名称" |
|||
min-width="70" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="secondId" |
|||
label="二级ID" |
|||
min-width="100" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="thirdClass" |
|||
label="三级名称" |
|||
min-width="70" |
|||
header-align="center" |
|||
align="center"></el-table-column> |
|||
<el-table-column prop="thirdId" |
|||
label="三级ID" |
|||
header-align="center" |
|||
min-width="100" |
|||
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> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CTable from '@c/CTableNoPage' |
|||
import CForm from '@c/CForm' |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
codeId: '', |
|||
addressUrl: 'https://epmet-cloud.elinkservice.cn/api/third/code/getpage', |
|||
categoryUrl: 'https://epmet-cloud.elinkservice.cn/api/third/code/getcategory', |
|||
addressList: [], // 页面列表 |
|||
categoryList: [], // 类目列表 |
|||
templateRadio: '', |
|||
selCategory: {}, |
|||
dataForm: { |
|||
address: '', |
|||
tag: '', |
|||
title: '' |
|||
}, |
|||
// 类目查询相关 |
|||
tableParams: {}, |
|||
operations: [], |
|||
|
|||
// 最终的审核列表数据 |
|||
itemTableData: [] |
|||
} |
|||
}, |
|||
components: { |
|||
CTable, CForm |
|||
}, |
|||
mounted () { |
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
return this.clientHeight - 60 - 80 - 80 - 50 - 400 |
|||
}, |
|||
...mapGetters(['clientHeight']) |
|||
}, |
|||
props: { |
|||
optionData: { |
|||
type: Object, |
|||
default () { |
|||
return {} |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
initData (codeId) { |
|||
this.reseatData() |
|||
this.codeId = codeId |
|||
const params = { |
|||
codeId: this.codeId |
|||
} |
|||
window.app.ajax.post(this.addressUrl, params, |
|||
(data, rspMsg) => { |
|||
data.forEach(item => { |
|||
let obj = {} |
|||
obj.label = item |
|||
obj.value = item |
|||
this.addressList.push(obj) |
|||
}) |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
|
|||
window.app.ajax.post(this.categoryUrl, params, |
|||
(data, rspMsg) => { |
|||
// data = [ |
|||
// { |
|||
// 'first_class': '社交', |
|||
// 'second_class': '社区/论坛', |
|||
// 'first_id': 684, |
|||
// 'second_id': 794 |
|||
// }, |
|||
// { |
|||
// 'first_class': '社交1', |
|||
// 'second_class': '社区/论坛1', |
|||
// 'first_id': 685, |
|||
// 'second_id': 796 |
|||
// } |
|||
// ] |
|||
data.forEach((item, index) => { |
|||
item.id = index |
|||
}) |
|||
this.categoryList = data |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
}, |
|||
getRadioRow (index, row) { |
|||
this.selCategory = row |
|||
}, |
|||
// 增加一条审核项 |
|||
addItem () { |
|||
if (this.itemTableData.length === 5) { |
|||
this.$message.warning('最多填写5项审核项') |
|||
return false |
|||
} |
|||
// eslint-disable-next-line |
|||
// debugger |
|||
|
|||
// 判断是否重复添加页面 |
|||
const that = this |
|||
let result = this.itemTableData.some((value) => { |
|||
return value.address === that.dataForm.address |
|||
}) |
|||
|
|||
if (result) { |
|||
this.$message.warning('当前页面已添加,请更换页面后重新添加') |
|||
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) |
|||
}, |
|||
deleteItem (index) { |
|||
this.itemTableData.splice(index, 1) |
|||
}, |
|||
getItemList () { |
|||
return this.itemTableData |
|||
}, |
|||
reseatData () { |
|||
this.dataForm = { |
|||
address: '', |
|||
tag: '', |
|||
title: '' |
|||
} |
|||
this.templateRadio = '' |
|||
this.addressList = [] |
|||
this.categoryList = [] |
|||
this.itemTableData = [] |
|||
this.selCategory = {} |
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
Loading…
Reference in new issue