diff --git a/src/components/PicLib/index.vue b/src/components/PicLib/index.vue index 17c8de5..6fdf161 100644 --- a/src/components/PicLib/index.vue +++ b/src/components/PicLib/index.vue @@ -176,6 +176,7 @@ export default { // other exportData() { this.$emit('selectMaterial', this.selectedData) + console.log(this.selectedData) }, beforeUpload(file) { const isLt600k = file.size / 1024 / 1024 < 0.6 @@ -191,7 +192,15 @@ export default { user: this.username, }) this.$message.success('图片上传成功!') - this.getData({user: this.username}) + if(this.useAsCom) { + this.imgList.unshift({url: res.message.url}) + this.selectedData.imgs = [{url: res.message.url}] + this.imgsSelected = [0] + } else { + this.getData({user: this.username}) + } + + }, uploadErr() { this.$message.error('图片上传失败!') diff --git a/src/router/index.js b/src/router/index.js index 8a53c30..28c0441 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -61,17 +61,6 @@ export const constantRoutes = [ // comRouter, // adminRouter, errRouter, - // TODO: 添加granfa 外链 - // { - // path: 'external-link', - // component: Layout, - // children: [ - // { - // path: 'https://github.com/PanJiaChen/vue-element-admin', - // meta: {title: 'externalLink', icon: 'link'}, - // }, - // ], - // }, userRouter, ] diff --git a/src/views/ad/edit.vue b/src/views/ad/edit.vue index 60c43e6..363a608 100644 --- a/src/views/ad/edit.vue +++ b/src/views/ad/edit.vue @@ -66,6 +66,7 @@ placeholder="请选择要投放的广告位置" class="w100" :disabled="!writeable" + multiple > 选择图片 + + + { - this.areaList[item.area_id] = item.name - }) - // 获取所有可投放游戏 const allGame = await this.getGameList() this.allGame = allGame.gameList @@ -493,9 +499,12 @@ export default { is_recommend: 0, appid: '', jump_param: '', + played: 0, } } + this.adForm.locationid = JSON.parse(this.adForm.locationid) + // 兼容跳转参数显示 if (!this.adForm.ad_property.jump_param) { this.adForm.ad_property.jump_param = this.adForm.jump_param @@ -651,9 +660,7 @@ export default { const area = item.area.split(',') return { id: item.id, - label: `${this.areaList[area[0]]}-(${area[1]},${area[2]})-${ - this.modeList[item.mode] - }`, + label: `${JSON.parse(item.ld_property).title}`, } }) }, @@ -681,6 +688,7 @@ export default { } this.adForm.ad_property = JSON.stringify(this.adForm.ad_property) + this.adForm.locationid = JSON.stringify(this.adForm.locationid) this.adForm.begin_time = this.adForm.dateRange[0] this.adForm.end_time = this.adForm.dateRange[1] diff --git a/src/views/ad/list.vue b/src/views/ad/list.vue index 9e1cbb5..a03a34f 100644 --- a/src/views/ad/list.vue +++ b/src/views/ad/list.vue @@ -104,12 +104,6 @@ :formatter="formPlatform" show-overflow-tooltip /> - { - this.areaList[item.area_id] = item.name - }) const gameListRes = await this.getGameList() const gameList = gameListRes.gameList @@ -294,19 +283,6 @@ export default { }) }) }, - getAdAreaList(params) { - return new Promise((resolve, reject) => { - getAdAreaList(params) - .then(res => { - const data = res.data - resolve(data) - }) - .catch(err => { - reject(err) - console.log(err) - }) - }) - }, getAdPos(params) { return new Promise((resolve, reject) => { getAdPos(params) @@ -420,13 +396,6 @@ export default { formPlatform(row, column, cellValue, index) { return `${this.platformList[cellValue]}` }, - formLocation(row, column, cellValue, index) { - const area = cellValue.split(',') - - return `${this.areaList[area[0]]}-(${area[1]},${area[2]})-${ - this.modeList[row.mode] - }` - }, formJump(row, column, cellValue, index) { return cellValue === 1 ? '是' : '否' }, diff --git a/src/views/admin/ad-list.vue b/src/views/admin/ad-list.vue index 8f6c31c..37b8c0b 100644 --- a/src/views/admin/ad-list.vue +++ b/src/views/admin/ad-list.vue @@ -115,12 +115,6 @@ :formatter="formGame" show-overflow-tooltip /> - import { getAd, updateAd, delAd, getAdPos, getAdAreaList } from '@/api/ad' import { getGameList } from '@/api/game' -import { areaList, typeList, modeList } from '@/utils/ad-data' +import { typeList, modeList } from '@/utils/ad-data' import { Promise, reject } from 'q' import moment from 'moment' @@ -243,7 +237,6 @@ export default { gameList: {}, platformList: {}, locationList: {}, - areaList: {}, typeList: {}, modeList: {}, sortList: { @@ -277,11 +270,6 @@ export default { this.modeList = modeList this.typeList = typeList - const areaListRes = await this.getAdAreaList() - areaListRes.adAreaList.map(item => { - this.areaList[item.area_id] = item.name - }) - const gameListRes = await this.getGameList() const gameList = gameListRes.gameList @@ -529,12 +517,6 @@ export default { formSort(row, column, cellValue, index) { return `${this.sortList[cellValue]}` }, - formLocation(row, column, cellValue, index) { - const area = cellValue.split(',') - return `${this.areaList[area[0]]}-(${area[1]},${area[2]})-${ - this.modeList[row.mode] - }` - }, formJump(row, column, cellValue, index) { return cellValue === 1 ? '是' : '否' }, diff --git a/vue.config.js b/vue.config.js index ad561e1..e6b48e1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -40,7 +40,7 @@ module.exports = { // change xxx-api/login => mock/login // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://154.8.214.202:5015/interface`, + target: `http://154.8.214.202:6015/interface`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '',