Commit aaa38028 by wangql

a

1 parent e08b7190
......@@ -2,7 +2,7 @@ import {
GlAxios
} from 'glsx-vue-common'
const path = 'admin-ddh-aimanager/ip/expression'
const __brandList = `${path}/brandList`
const __expressionList = `${path}/search`
const __grayscaleuser = `${path}/download/grayscaleuser`
const __addExp = `${path}/add`
const __getExp = `${path}/get`
......@@ -10,9 +10,9 @@ const __mergeExp = `${path}/merge`
const __addBg = `${path}/background/add`
const __mergeBg = `${path}/background/merge`
const getBrandList = {
p: [__brandList],
req: params => GlAxios.get(__brandList, { params })
const getExpList = {
p: [__expressionList],
req: params => GlAxios.post(__expressionList, params)
}
const grayscaleuser = {
......@@ -45,7 +45,7 @@ const mergeBg = {
req: params => GlAxios.post(__mergeBg, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }, requestType: 'jsonString' })
}
export {
getBrandList,
getExpList,
grayscaleuser,
addExp,
getExp,
......
import {
getBrandList,
getExpList,
grayscaleuser,
addExp,
getExp,
......@@ -18,7 +18,7 @@ export {
voiceList,
manufacturers,
merchants,
getBrandList,
getExpList,
grayscaleuser,
addExp,
getExp,
......
......@@ -13,19 +13,12 @@
clearable
/>
</gl-form-item>
<gl-form-item>
<gl-select
v-model="searchCondition.manufacturer"
placeholder="请选择品牌厂商"
>
<gl-option
v-for="item in manufacturers"
:key="item.value"
:label="item.label"
:value="item.value"
<Manufacturers
width="200px"
:eventBus="idPassvalue"
:value.sync="manufacturer"
:manufactureOnly="true"
/>
</gl-select>
</gl-form-item>
<gl-form-item>
<gl-button
type="primary"
......@@ -36,14 +29,13 @@
<gl-button
class="newButton"
type="primary"
@click="dialog"
@click="dialog(null)"
>添加品牌IP</gl-button>
</gl-form-item>
</gl-form>
</div>
<edit
:updateVisible="updateVisible"
:allModulelist="allModulelist"
:updateLoading="updateLoading"
:idPassvalue="idPassvalue"
@updateClose="updateDialogClose"
......@@ -54,7 +46,7 @@
>
<gl-table-column align="center" v-for="(i, index) in tableData.column" :key="index" :label='i.label' :prop='i.prop' :width='i.width' >
<template slot-scope="scope">
<template v-if='i.prop === "ipbg"'>
<template v-if='i.prop === "ipBackgroundList"'>
<img class="tableImg" :src="tableData.data[scope.scope.$index][i.prop]">
</template>
<template v-else>
......@@ -80,42 +72,31 @@
<script>
import Edit from './Edit'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
import { getBrandList, manufacturers } from '@/api'
import { getExpList, mergeExp } from '@/api'
import { NoticeMixin } from '@/mixins'
import { Manufacturers } from '../components'
import Vue from 'vue'
export default {
name: 'channel',
components: {
Edit
Edit,
Manufacturers
},
watch: {
'searchCondition.content'(val) {
!val && this.loadingGetList()
}
},
mixins: [NoticeMixin],
data() {
return {
searchCondition: {
manufacturer: '',
content: ''
},
searchCondition: {},
manufacturer: null,
pageNum: 1,
pageSize: 10,
total: 10,
/* 组件params-start */
updateVisible: false,
// updateParams: this.$deep_clone(channelStructrue),
allModulelist: [],
recordVisible: false,
/* 组件params-end */
/* loadingParams-start */
tableLoading: false,
updateLoading: false,
recordLoading: false,
idPassvalue: null,
// expressionId: 6,
manufacturers: [],
/* loadingParams-end */
tableData: {
border: true,
......@@ -125,32 +106,44 @@ export default {
column: [
{
label: '品牌厂商',
prop: 'brand'
prop: 'manufacturerName'
},
{
label: '渠道商',
prop: 'channel'
prop: 'merchantName'
},
{
label: '默认IP表情',
prop: 'ipbq'
prop: 'packagePath'
},
{
label: '默认IP背景',
prop: 'ipbg'
prop: 'ipBackgroundList',
formatter: (cellValue) => {
if (cellValue.ipBackgroundList) {
var imgUrl = ''
cellValue.ipBackgroundList.forEach((item, index) => {
if (item.backgroundType === 'DEFAULT') {
imgUrl = item.backgroundPath
return false
}
})
return imgUrl
}
}
},
{
label: '变更时间',
prop: 'changeTime',
prop: 'updatedDate',
formatter: cellValue => {
if (cellValue.changeTime) {
return new Date(cellValue.changeTime).format('yyyy-MM-dd')
if (cellValue.updatedDate) {
return new Date(cellValue.updatedDate).format('yyyy-MM-dd')
}
}
},
{
label: '操作人',
prop: 'createdBy'
prop: 'updatedBy'
}
],
number: {
......@@ -169,7 +162,7 @@ export default {
{
type: 'primary',
icon: 'el-icon-edit',
callback: (index, rows) => this.dialog(index)
callback: (index, rows) => this.dialog(rows[index].id)
},
{
type: 'primary',
......@@ -180,7 +173,7 @@ export default {
})
.then(() => {
this.tableLoading = true
this.deleteChannel(rows[index].id)
this.deleteExp(rows[index].id)
})
.catch(err => this.error(err))
}
......@@ -192,7 +185,6 @@ export default {
},
mounted() {
this.getList()
this.getManufacturer()
this.idPassvalue = new Vue()
},
methods: {
......@@ -212,8 +204,7 @@ export default {
},
getList() {
const params = this.getParams()
// params = deleteEmptyAttribute(params)
getBrandList
getExpList
.req(params)
.then(res => {
this.total = res.total
......@@ -225,56 +216,6 @@ export default {
this.error(err)
})
},
updateChannel(params) {
// updateChannel
// .req(params)
// .then(res => {
// notice.okTips()
// this.loadingGetList()
// this.updateVisibleChange()
// })
// .catch(err => {
// this.updateLoading = false
// notice.errorTips(err)
// })
},
deleteChannel(params) {
// deleteChannel
// .req({ id: params })
// .then(res => {
// notice.okTips(res)
// this.loadingGetList()
// })
// .catch(err => {
// notice.errorTips(err)
// })
},
channelLog(params) {
// this.recordVisibleChange()
// channelLog
// .req({ channelId: params })
// .then(res => {
// // notice.okTips(res)
// this.recordTable.list = res.list
// this.recordTable.total = res.total
// this.recordLoading = false
// // console.log(this.recordTable)
// // this.recordVisibleChange()
// })
// .catch(err => {
// notice.errorTips(err)
// })
},
getManufacturer() {
manufacturers
.req({})
.then(res => (this.manufacturers = res.list))
.catch(err => this.error(err))
},
/* 接口请求-end */
handleSearch() {
this.loadingGetList()
},
handleSizeChange(val) {
this.pageSize = val
this.loadingGetList()
......@@ -283,25 +224,24 @@ export default {
this.pageNum = val
this.loadingGetList()
},
updateVisibleChange() {
dialog(objId) {
this.updateVisible = !this.updateVisible
this.updateLoading = false
// if(!this.updateVisible) {
// this.allModulelist = []
// this.updateParams = this.$deep_clone(channelStructrue)
// }
this.idPassvalue.$emit('expressionId', objId)
},
dialog(index) {
this.updateVisible = !this.updateVisible
// this.idPassvalue.$emit('expressionId', 6)
},
updateDialogClose(updateData) {
// this.updateLoading = true
// updateData ? this.updateChannel(updateData) : this.updateVisibleChange()
updateDialogClose() {
console.log('关闭')
this.updateVisible = !this.updateVisible
this.loadingGetList()
},
recordVisibleChange() {
this.recordVisible = !this.recordVisible
deleteExp(objId) {
if (objId) {
mergeExp
.req({ id: objId, deletedFlag: 'D' })
.then(res => {
this.loadingGetList()
})
.catch(err => console.log(err))
}
}
}
}
......
......@@ -157,7 +157,7 @@ export default {
})
},
immediate: true
//this.eventBus.$emit('manufacturerChanged', val)
// this.eventBus.$emit('manufacturerChanged', val)
},
uploadAction: {
handler(__sAction) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!