Commit 19da8a13 by chenwq

复制

1 parent 2cd79f24
...@@ -2,103 +2,36 @@ ...@@ -2,103 +2,36 @@
<template> <template>
<div class="marketing"> <div class="marketing">
<div class="m-b-20"> <div class="m-b-20">
<GLButton <GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹" mode="el-button">新建众筹</GLButton>
:size="size" <el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button>
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
<el-button
:size="size"
type="default"
class="default-blue-btn"
@click="handleJump"
>订单管理</el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button <el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable <GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
ref="activity" <div slot="activityImg" class="table-image" slot-scope="scope">
:getListApi="getListApi" <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
:noDataImg="url" <img class="table-popover-img" :src="scope.scope.activityImg" />
:searchForm="tableSearchForm" <img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" />
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="activityImg"
class="table-image"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover> </el-popover>
</div> </div>
<div <div slot="linkText" slot-scope="scope">
slot="linkText" <p class="cursor-pointer" @click="handleDetail(scope)">{{scope.scope[scope.prop] || 0}}</p>
slot-scope="scope"
>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{scope.scope[scope.prop] || 0}}</p>
</div> </div>
<div <div class="table-btns" slot="auth-button" slot-scope="scope">
class="table-btns" <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 分享 --> <!-- 分享 -->
<share-dialog <share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
></share-dialog>
</div> </div>
</template> </template>
...@@ -109,7 +42,7 @@ import url from '@/assets/empty.png' ...@@ -109,7 +42,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'crowdFundList', name: 'crowdFundList',
data () { data() {
return { return {
size: 'small', size: 'small',
url: url, url: url,
...@@ -237,7 +170,9 @@ export default { ...@@ -237,7 +170,9 @@ export default {
type: 'text' type: 'text'
}, },
listeners: { listeners: {
// click: click: row => {
this.handleEdit('copy', row)
}
} }
}, },
{ {
...@@ -371,16 +306,16 @@ export default { ...@@ -371,16 +306,16 @@ export default {
shareDialog shareDialog
}, },
mounted () { mounted() {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams () { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
return params return params
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate // delete this.tableSearchForm.createDate
...@@ -388,13 +323,13 @@ export default { ...@@ -388,13 +323,13 @@ export default {
}) })
}, },
handleJump (path, row = {}) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
path: path || '/orderManage/index' path: path || '/orderManage/index'
}) })
}, },
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -417,16 +352,16 @@ export default { ...@@ -417,16 +352,16 @@ export default {
}, },
//开始 //开始
start (item) { start(item) {
this.startOrEndConfirm('开始', item) this.startOrEndConfirm('开始', item)
}, },
//结束 //结束
end (item) { end(item) {
this.startOrEndConfirm('结束', item) this.startOrEndConfirm('结束', item)
}, },
startOrEndConfirm (txt, row) { startOrEndConfirm(txt, row) {
var title = txt var title = txt
var params = {} var params = {}
params.id = row.id params.id = row.id
...@@ -439,24 +374,29 @@ export default { ...@@ -439,24 +374,29 @@ export default {
}, },
//置顶 //置顶
topping (row) { topping(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params) this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
}, },
//删除 //删除
del (row) { del(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit (addOrEdit, row) { handleEdit(addOrEdit, row) {
var txtObj = {
add: '新建',
edit: '编辑',
copy: '复制'
}[addOrEdit]
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动') $title: encodeURI(txtObj + '众筹活动')
} }
if (addOrEdit != 'add') { if (addOrEdit != 'add') {
params.id = row.id params.id = row.id
...@@ -467,12 +407,12 @@ export default { ...@@ -467,12 +407,12 @@ export default {
query: params query: params
}) })
}, },
test (option) { test(option) {
console.log(JSON.parse(JSON.stringify(option))) console.log(JSON.parse(JSON.stringify(option)))
}, },
// 明细 // 明细
handleDetail ({ prop, scope }) { handleDetail({ prop, scope }) {
let data = { let data = {
viewAmount: { viewAmount: {
type: 1, type: 1,
...@@ -498,25 +438,25 @@ export default { ...@@ -498,25 +438,25 @@ export default {
}) })
}, },
handleExport () { handleExport() {
var params = this.getParams() var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => { this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleShare (row) { handleShare(row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => { this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res this.shareForm = res
this.handleShareClose() this.handleShareClose()
}) })
}, },
handleShareClose () { handleShareClose() {
this.isShareVisible = !this.isShareVisible this.isShareVisible = !this.isShareVisible
}, },
getOptionsList (formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -542,11 +482,11 @@ export default { ...@@ -542,11 +482,11 @@ export default {
} }
}, },
handleSearch () { handleSearch() {
this.$refs.activity.refreshTable() this.$refs.activity.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
activityName: '', activityName: '',
activityStatus: '' activityStatus: ''
...@@ -554,7 +494,7 @@ export default { ...@@ -554,7 +494,7 @@ export default {
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun() this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!