Browse Source

添加审核项

dev
jiangyuying 5 years ago
parent
commit
38507be576
  1. 4
      epmet-oper-web/.env.development
  2. 4
      epmet-oper-web/public/index.html
  3. 96
      epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss
  4. 53
      epmet-oper-web/src/js/columns/code/category.js
  5. 28
      epmet-oper-web/src/js/columns/code/operHistory.js
  6. 2
      epmet-oper-web/src/js/columns/columns.js
  7. 20
      epmet-oper-web/src/views/modules/code/CommitList.vue
  8. 27
      epmet-oper-web/src/views/modules/code/OperHistory.vue
  9. 110
      epmet-oper-web/src/views/modules/code/SubmitFailReason.vue
  10. 322
      epmet-oper-web/src/views/modules/code/SubmitForm.vue
  11. 319
      epmet-oper-web/src/views/modules/code/SubmitItem.vue

4
epmet-oper-web/.env.development

@ -1,5 +1,5 @@
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 = https://epmet-dev.elinkservice.cn/api
VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev

4
epmet-oper-web/public/index.html

@ -34,9 +34,9 @@
<!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.98:8080/api';</script> -->
<script>window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api';</script>
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api';</script> -->
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> -->
<!-- <script>window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api';</script> -->
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api';</script>
<% } %>
<!-- 集成测试环境 dev -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>

96
epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss

@ -798,102 +798,6 @@
}
}
}
.item2 {
position: relative;
padding: 10px 0;
border-bottom: 1px solid #eee;
&:last-child {
border-bottom: none;
}
.d-news-title {
@include toe;
font-size: 17px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 24px;
}
.d-news-content {
@include toe;
padding: 3px 0;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 20px;
}
.d-news-info {
margin-top: 5px;
padding: 0 1px;
font-size: 13px;
line-height: 26px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
overflow: hidden;
> img {
display: inline-block;
margin-right: 5px;
width: 26px;
vertical-align: bottom;
}
> span {
@include toe;
display: inline-block;
max-width: 70%;
vertical-align: bottom;
}
}
}
.item3 {
position: relative;
padding: 10px 0;
border-bottom: 1px solid #eee;
&:last-child {
border-bottom: none;
}
.d-news-title {
@include toe;
font-size: 17px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 24px;
}
.d-news-content {
@include toe;
padding: 3px 0;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 20px;
}
.d-news-info {
margin-top: 5px;
padding: 0 1px;
font-size: 13px;
line-height: 13px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
overflow: hidden;
> img {
display: inline-block;
margin-right: 5px;
width: 13px;
vertical-align: bottom;
}
> span {
@include toe;
display: inline-block;
max-width: 70%;
vertical-align: bottom;
}
}
}
}
}
}

53
epmet-oper-web/src/js/columns/code/category.js

@ -0,0 +1,53 @@
export default [
{
key: 'first_class',
title: '一级类目名称',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
},
{
key: 'first_id',
title: '一级类目ID',
type: 'input',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
},
{
key: 'second_class',
title: '二级类目名称',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
},
{
key: 'second_id',
title: '二级类目ID',
type: 'input',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
},
{
key: 'third_class',
title: '三级类目名称',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
},
{
key: 'third_id',
title: '三级类目ID',
type: 'input',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 120
}
]

28
epmet-oper-web/src/js/columns/code/operHistory.js

@ -37,20 +37,20 @@ export default [
trigger: 'blur'
}],
display: ['formA', 'formU', 'table', 'model'],
block: true,
format: function (cellValue, index) {
if (cellValue === 'upload') {
return '上传'
} else if (cellValue === 'audit') {
return '审核'
} else if (cellValue === 'undo') {
return '撤回'
} else if (cellValue === 'release') {
return '发布'
} else {
return '未知'
}
}
block: true
// format: function (cellValue, index) {
// if (cellValue === 'upload') {
// return '上传'
// } else if (cellValue === 'audit') {
// return '审核'
// } else if (cellValue === 'undo') {
// return '撤回'
// } else if (cellValue === 'release') {
// return '发布'
// } else {
// return '未知'
// }
// }
},
{
key: 'describe',

2
epmet-oper-web/src/js/columns/columns.js

@ -1,6 +1,7 @@
import Temp from './code/temp'
import CommitCode from './code/commitCode'
import OperHistory from './code/operHistory'
import Category from './code/category'
import RegisterInfo from './customer/customer'
export default {
@ -8,6 +9,7 @@ export default {
CommitCodeList: CommitCode['list'], // 代码上传——已上传的代码列表
CommitCodeForm: CommitCode['form'], // 代码上传——代码form
OperHistory: OperHistory, // 代码上传——操作历史
Category: Category, // 代码上传——审核项——类目
RegisterInfo: RegisterInfo // 客户管理——客户注册信息

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

@ -97,6 +97,8 @@
<oper-history ref="ref_oper_history"></oper-history>
<submit-fail-reason ref="ref_submit_fail_reason"></submit-fail-reason>
<c-dialog :showFooter="false"
:title="'二维码'"
:width="40"
@ -117,6 +119,7 @@ import CTable from '@c/CTable'
import SubmitForm from './SubmitForm'
import CommitForm from './CommitForm'
import OperHistory from './OperHistory'
import SubmitFailReason from './SubmitFailReason'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
@ -292,7 +295,7 @@ export default {
}
},
components: {
CDialog, SubmitForm, CommitForm, OperHistory, CTable
CDialog, SubmitForm, CommitForm, OperHistory, CTable, SubmitFailReason
},
activated () {
let params = this.$route.params
@ -355,7 +358,8 @@ export default {
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success(rspMsg)
this.$message.success('撤回成功' + rspMsg)
this.refresh()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
@ -400,17 +404,7 @@ export default {
},
//
submitFailReason (row) {
const url = '/third/code/reason'
const param = {
codeId: row.id
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success(rspMsg)
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
this.$refs['ref_submit_fail_reason'].initData(row.id)
},
//
operHistory (row) {

27
epmet-oper-web/src/views/modules/code/OperHistory.vue

@ -4,21 +4,20 @@
:title="'操作历史'"
:visible="diaVisible"
@cancel="diaCancel">
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-demo__demo}">
<c-table column-type="index"
:pageVisible="true"
ref="table"
:url="tableUrl"
:params="tableParams"
keyword="OperHistory"
:operations="operations"
:tableHeight="tableHeight">
</c-table>
</div>
</el-card>
<div class="mod-demo__demo}">
<c-table column-type="index"
:pageVisible="true"
ref="table"
:url="tableUrl"
:params="tableParams"
keyword="OperHistory"
:operations="operations"
:tableHeight="tableHeight">
</c-table>
</div>
</c-dialog>
</div>

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

@ -0,0 +1,110 @@
<template>
<div>
<c-dialog :showFooter="false"
:title="'操作失败原因'"
:visible="diaVisible"
@cancel="diaCancel">
<div class="mod-demo__demo}">
<el-form :inline="true"
:model="dataForm"
class="form">
<el-form-item label="失败原因"
prop="reason"
label-width="150px"
style="display:block">
<span>{{dataForm.reason}}</span>
</el-form-item>
<el-form-item label="素材图片"
label-width="150px"
style="display:block">
<el-image class="img"
v-for="(oneImg,index) in dataForm.screenshotUrl"
:key="index"
style="width: 100px; height: 100px"
:preview-src-list="getSrcList(index)"
:src="oneImg"></el-image>
</el-form-item>
</el-form>
</div>
</c-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import CDialog from '@c/CDialog'
export default {
data () {
return {
loading: false,
diaVisible: false,
codeId: '',
dataForm: {
reason: '',
screenshotUrl: []
}
}
},
components: {
CDialog
},
mounted () {
},
methods: {
initData (codeId) {
this.codeId = codeId
this.diaVisible = true
this.dataForm.reason = '没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败,没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败没有提供用户名密码失败失败'
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 param = {
// codeId: row.id
// }
// window.app.ajax.post(url, param,
// (data, rspMsg) => {
// this.$message.success(rspMsg)
// },
// (rspMsg, data) => {
// this.$message.error(rspMsg)
// })
},
getSrcList (index) {
return this.dataForm.screenshotUrl.slice(index).concat(this.dataForm.screenshotUrl.slice(0, index))
},
diaCancel () {
this.diaVisible = false
}
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 50 - 400
},
...mapGetters(['clientHeight'])
}
}
</script>
<style>
.d_reason {
margin: 10px;
font-size: 1px;
font-family: PingFang SC;
}
.d_pic {
margin: 10px;
}
.img {
margin: 0 10px;
}
</style>

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

@ -7,6 +7,7 @@
@ok="submitCode">
<el-tabs v-model="activeName"
@tab-click="tabClick"
class="el-tabs">
<el-tab-pane label="功能说明"
name="desc">
@ -36,7 +37,6 @@
:action="upload_url"
list-type="picture-card"
:name="upload_name"
:on-remove="handleRemovePic"
:on-exceed="handleExceed"
:file-list="picList"
:limit="3"
@ -54,7 +54,6 @@
ref="uploadVedio"
:action="upload_url"
:name="upload_name"
:on-remove="handleRemoveVedio"
:on-exceed="handleExceed"
:file-list="vedioList"
:limit="1"
@ -71,70 +70,7 @@
<el-tab-pane label="审核项"
name="item">
<div style="margin-top:10px">
<el-button type="primary"
style="margin-bottom:10px"
@click="commitCode()">增加审核项</el-button>
</div>
<el-table id="out-table"
ref="table"
:header-cell-style="{color:'#000'}"
:data="tableData"
:style="{width: '100%'}"
border
v-loading="loading"
element-loading-text="正在加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.8)">
<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="first_id"
label="一级类目ID"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="second_class"
label="二级类目名称"
min-width="70"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="second_id"
label="二级类目ID"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="third_class"
label="三级类目名称"
min-width="70"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="third_id"
label="三级类目ID"
header-align="center"
min-width="100"
align="center"></el-table-column>
</el-table>
<submit-item ref="ref_submit_item"></submit-item>
</el-tab-pane>
<el-tab-pane v-if="feedbackShow"
@ -167,12 +103,10 @@
:action="upload_url"
list-type="picture-card"
:name="upload_name"
:on-remove="handleRemoveFeedback"
:on-error="handleError"
:on-exceed="handleExceed"
:file-list="feedbackPicList"
:limit="3"
:http-request="uploadPic">
:http-request="uploadFeedbackPic">
<span class="font-14">选择图片</span>
<div slot="tip"
class="el-upload__tip">大小2M以内</div>
@ -262,18 +196,14 @@
</el-tabs>
</c-dialog>
<c-dialog :title="dialog.title"
:visible="dialog.visible"
:showConfirm="false"
@cancel="handleCancel">
<commit-form ref="ref_commit_form"></commit-form>
</c-dialog>
</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
@ -309,6 +239,7 @@ export default {
},
previewPicArray: [],
previewVedioArray: [],
feedbackPicArray: [],
//
dialogImageUrl: '/third/code/mediaupload',
@ -322,38 +253,11 @@ export default {
dialog: {
title: '',
visible: false
},
//
tableData: [
{
address: 'index',
tag: '学习 生活',
title: '首页',
firstClass: '文娱',
firstId: 1,
secondClass: '资讯',
secondId: 2,
thirdClass: '',
thirdId: null
},
{
address: 'page/logs/logs',
tag: '学习 工作',
title: '日志',
firstClass: '教育',
firstId: 3,
secondClass: '学历教育',
secondId: 4,
thirdClass: '高等',
thirdId: 5
}
]
}
}
},
components: {
CDialog, CommitForm
CDialog, CommitForm, SubmitItem
},
mounted () {
},
@ -369,43 +273,45 @@ export default {
this.feedbackShow = feedbackShow
this.diaVisible = true
},
reseatDataForm () {
this.dataForm = {
versionDesc: '', //
previewInfo: { //
videoIdList: [],
picIdList: []
},
feedbackInfo: '', //
feedbackStuff: '', //
ugcDeclare: { // UGC
scene: [0], // UGC 0,, 1.,2.,3.,4.,5, ,scene0
otherSceneDesc: '', // scene,256
method: [1], // 1.使API,2.使,3.,4.
hasAuditTeam: 0, // , 0.,1.,0
auditDesc: '' // UGC,256
}
}
},
tabClick (tab) {
if (tab.name === 'item') {
this.$refs['ref_submit_item'].initData(this.codeId)
}
},
handleExceed: function () {
this.$message({
message: '请先删除选择的图片或视频,再上传',
type: 'warning'
})
},
handleRemovePic: function (res, file) {
this.previewPicArray.filter(item => item.uid !== file.uid)
console.log(this.previewPicArray)
},
handleRemoveVedio: function (res, file) {
// this.previewPicArray.forEach(element => {
// if()
// });
// eslint-disable-next-line
debugger
},
handleRemoveFeedback: function (res, file) {
// this.previewPicArray.forEach(element => {
// if()
// });
// eslint-disable-next-line
debugger
},
handleError (err, file, fileList) {
// eslint-disable-next-line
debugger
console.log(err)
},
//
uploadVedio: function (params) {
// eslint-disable-next-line
debugger
let file = params.file
let fileType = file.type
let isVideo = fileType.indexOf('video') !== -1
// let fileUrl = this.$refs.upload.uploadFiles[0].url
let fileUrl = this.$refs.uploadVedio.uploadFiles[this.vedioList.length].url
file.url = fileUrl
this.vedioList.push(file)
let isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
@ -441,14 +347,28 @@ export default {
formData.append('type', fileType)
formData.append('media', file)
formData.append('codeId', this.codeId)
window.app.ajax.post(this.dialogImageUrl, formData,
window.app.ajax.post2(this.dialogImageUrl, formData,
(data, rspMsg) => {
this.previewInfo.videoIdList.push(data)
this.$message.success(rspMsg)
// eslint-disable-next-line
debugger
if (data.code === 0) {
console.log('成功')
let obj = {
mediaid: data,
uid: file.uid
}
this.previewVedioArray.push(obj)
this.$message.success(rspMsg)
} else {
console.log('失败')
this.vedioList.pop()
this.$message.error(rspMsg)
}
},
(rspMsg, data) => {
this.vedioList.pop()
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
})
},
//
uploadPic: function (params) {
@ -507,7 +427,63 @@ export default {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
},
//
uploadFeedbackPic: function (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: 'error'
// })
// this.$refs.upload.uploadFiles = []
// // return
// }
if (!isImage) {
this.$message({
message: '请选择图片!',
type: 'error'
})
this.$refs.uploadPic.uploadFiles = []
return
}
// console.log(this.picList)
this.upload_name = 'file_img[]'
let formData = new FormData()
formData.append('type', fileType)
formData.append('media', file)
formData.append('codeId', this.codeId)
window.app.ajax.post2(this.dialogImageUrl, formData,
(data, rspMsg) => {
// eslint-disable-next-line
debugger
if (data.code === 0) {
console.log('成功')
let obj = {
mediaid: data,
uid: file.uid
}
this.feedbackPicArray.push(obj)
this.$message.success(rspMsg)
} else {
console.log('失败')
this.feedbackPicList.pop()
this.$message.error(rspMsg)
}
},
(rspMsg, data) => {
this.feedbackPicList.pop()
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
},
// UGC0
scene0 (value) {
if (value) { //
@ -535,8 +511,12 @@ export default {
this.dataForm.ugcDeclare.auditDesc = ''
},
submitCode () {
// eslint-disable-next-line
// debugger
// const url = '/third/code/audit'
let params = {
codeId: this.codeId,
ugcDeclare: this.dataForm.ugcDeclare //
}
//
//
this.dataForm.previewInfo.picIdList = []
this.dataForm.previewInfo.videoIdList = []
@ -548,12 +528,6 @@ export default {
this.dataForm.previewInfo.videoIdList.push(element.mediaid)
})
const url = '/third/code/audit'
let params = {
codeId: this.codeId,
ugcDeclare: this.dataForm.ugcDeclare
}
//
if (this.dataForm.previewInfo.picIdList.length > 0 || this.dataForm.previewInfo.videoIdList.length > 0) {
params.previewInfo = Object
@ -569,19 +543,34 @@ export default {
if (this.dataForm.versionDesc !== '') {
params.versionDesc = this.dataForm.versionDesc
}
//
const itemList = this.$refs['ref_submit_item'].getItemList()
if (itemList.length > 0) {
params.itemList = itemList
}
//
if (this.dataForm.feedbackInfo !== '') {
params.feedbackInfo = this.dataForm.feedbackInfo
}
if (this.dataForm.feedbackStuff !== '') {
params.feedbackStuff = this.dataForm.feedbackStuff
}
console.log(params)
this.startLoading()
window.app.ajax.post(url, params,
(data, rspMsg) => {
this.endLoading()
this.$message.success('提交审核成功,请等待审核结果')
this.diaCancel()
this.$emit('refresh')
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
// this.startLoading()
// window.app.ajax.post(url, params,
// (data, rspMsg) => {
// this.endLoading()
// this.$message.success('')
// this.diaCancel()
// this.$emit('refresh')
// },
// (rspMsg, data) => {
// this.endLoading()
// this.$message.error(rspMsg)
// })
},
//
diaCancel () {
@ -589,18 +578,19 @@ export default {
this.diaVisible = false
},
resetData () {
},
//
commitCode (id) {
this.dialog.title = '上传代码'
this.dialog.visible = true
},
handleCancel () {
this.dialog.title = ''
this.dialog.visible = false
this.reseatDataForm()
//
this.picList = []
this.previewPicArray = []
this.vedioList = []
this.previewVedioArray = []
//
this.$refs['ref_submit_item'].reseatData()
//
this.feedbackPicList = []
this.feedbackPicArray = []
//
},
//
startLoading () {

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

@ -0,0 +1,319 @@
<!--审核项-->
<template>
<div>
<el-form :inline="true"
:model="dataForm">
<el-form-item label="页面列表"
prop="versionDesc"
label-width="150px">
<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="150px">
<el-input placeholder='请输入标签'
style="width:300px"
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="150px"
style="display:block">
<el-input placeholder='请输入标题'
style="width:500px"
type="textarea"
maxlength="32"
show-word-limit
v-model="dataForm.title">
</el-input>
<div class="el-upload__tip">小程序页面的标题标题长度至多32</div>
</el-form-item>
</el-form>
<el-table id="out-table"
ref="table_category"
:header-cell-style="{color:'#000'}"
:data="categoryList"
:style="{width: '100%'}"
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)">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="first_class"
label="一级名称"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="first_id"
label="一级ID"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="second_class"
label="二级名称"
min-width="70"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="second_id"
label="二级ID"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="third_class"
label="三级名称"
min-width="70"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="third_id"
label="三级ID"
header-align="center"
min-width="100"
align="center"></el-table-column>
</el-table>
<div style="margin-top:10px">
<el-button type="primary"
style="margin-bottom: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="first_class"
label="一级名称"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="first_id"
label="一级ID"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="second_class"
label="二级名称"
min-width="70"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="second_id"
label="二级ID"
min-width="100"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="third_class"
label="三级名称"
min-width="70"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="third_id"
label="三级ID"
header-align="center"
min-width="100"
align="center"></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://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/getpage',
addressUrl: '/third/code/getpage',
categoryUrl: '/third/code/getcategory',
// categoryUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/getcategory',
addressList: [], //
categoryList: [], //
templateRadio: '',
selCategory: {},
dataForm: {
address: '',
tag: '',
title: ''
},
//
tableParams: {},
operations: [],
//
itemTableData: [
// {
// address: 'index',
// tag: ' ',
// title: '',
// firstClass: '',
// firstId: 1,
// secondClass: '',
// secondId: 2,
// thirdClass: '',
// thirdId: null
// }
]
}
},
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.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) {
console.log(row)
this.selCategory = row
},
//
addItem () {
let oneObj = this.selCategory
oneObj.address = this.dataForm.address
oneObj.title = this.dataForm.title
oneObj.tag = this.dataForm.tag
//
let repeatAdress = this.itemTableData.filter(item => item.address === oneObj.address)
// let result = this.itemTableData.fliter(function (value) {
// console.log(value)
// return value.address === oneObj.address
// })
if (repeatAdress.length > 0) {
this.$message.warning('当前页面已添加,请更换页面后重新添加')
return false
}
this.itemTableData.push(oneObj)
},
getItemList () {
return this.itemTableData
},
reseatData () {
this.dataForm = {
address: '',
tag: '',
title: ''
}
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…
Cancel
Save