Commit 7cdac9cd by 前端

第一轮BUG修复

1 parent f2ddd239
<template>
<div class="basic-panel">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="content" v-if="tooltipStatus">
<div class="basic-title" slot="reference">{{ content | ellipsis(this) }}</div>
</el-popover>
<div class="basic-title" v-else>{{ content | ellipsis(this) }}</div>
</div>
</template>
<script>
export default {
name: 'basic-dialog',
props: {
content: {
type: String,
default: ''
},
textLength: {
type: Number,
default: 8
}
},
data() {
return {
tooltipStatus: false
}
},
filters: {
ellipsis(value,that) {
console.log(value,that)
if (value.length > that.textLength) {
that.tooltipStatus = true
return value.slice(0, that.textLength) + '...'
}
return value
}
},
mounted() {
// this.$nextTick(() => {
// const title = document.querySelector('.basic-title-s')
// console.log(title.innerText, this.content)
// if (title.innerText == this.content) {
// this.tooltipStatus = false
// } else {
// this.tooltipStatus = true
// }
// })
}
}
</script>
<style lang="scss">
.basic-panel {
display: inline-block;
}
</style>
const TYPE = Object.freeze({
none: ''
})
// 权限校验
function permission(ctx) {
console.log(ctx)
if (!ctx) return TYPE.none
const {
props: { fn, mode },
parent: {
$GLBUTTION_PERMISSIONS: { routes = [], routerBase }
}
} = ctx
const router = routes.find(route => location.pathname === `${routerBase}${route.path.split(':/')[0]}`)
if (router && router.meta && router.meta.permissions && router.meta.permissions.includes(fn)) {
return mode
}
return TYPE.none
}
export default {
functional: true,
name: 'GLButton',
props: {
fn: {
type: String
},
mode: {
type: String,
default: 'el-button'
}
},
render: function(createElement, context) {
return createElement(permission(context), context.data, context.children)
}
}
\ No newline at end of file \ No newline at end of file
...@@ -8,4 +8,29 @@ ...@@ -8,4 +8,29 @@
*/ */
import Vue from 'vue' import Vue from 'vue'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue' import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
import glsxDialog from '@/components/glsx-dialog/index.vue'
import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog'
import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue'
import tableTooltip from '@/components/table-tooltip/index.vue'
import glsxRows from '@/components/glsx-rows/index.vue'
import glsxDescriptions from '@/components/glsx-descriptions/index.vue'
import selectTag from '@/components/selectTag/index.vue'
import searchForm from '@/components/search-form/index.vue'
import _button from '@/components/glsx-button/index'
import _title from '@/components/basic-title/index'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog)
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip)
Vue.component('glsx-rows', glsxRows)
Vue.component('glsx-descriptions', glsxDescriptions)
Vue.component('select-tag', selectTag)
Vue.component('search-form', searchForm)
Vue.component('GLButton', _button)
Vue.component('GLTitle', _title)
...@@ -19,6 +19,7 @@ Vue.config.productionTip = false ...@@ -19,6 +19,7 @@ Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
Vue.prototype.setMinHeight = setMinHeight Vue.prototype.setMinHeight = setMinHeight
Vue.prototype.defaultLabelWidth = '154px' Vue.prototype.defaultLabelWidth = '154px'
start() start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
......
...@@ -19,8 +19,8 @@ let router = null ...@@ -19,8 +19,8 @@ let router = null
let instance = null let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState ,routerBase}) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common, request_merchant ,merchantId} = await fetchConfig(common) const { response, request, sign, secret, sign_common, request_common, request_merchant, merchantId } = await fetchConfig(common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState ,route ...@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState ,route
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$hmdMerchantId = merchantId Vue.prototype.$hmdMerchantId = merchantId
// 集团版集团账号 Vue.prototype.$tracker = common.tracker
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4 // 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_tag = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_tag = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
......
...@@ -390,9 +390,9 @@ export default { ...@@ -390,9 +390,9 @@ export default {
}, },
mounted() { mounted() {
// this.handleRefresh() this.handleRefresh()
// this.getListData() this.getListData()
// this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
......
...@@ -10,114 +10,84 @@ ...@@ -10,114 +10,84 @@
fn="新增众筹" fn="新增众筹"
mode="el-button" mode="el-button"
>新建众筹</GLButton> --> >新建众筹</GLButton> -->
<el-button <el-button :size="size"
:size="size" type="default"
type="default" class="default-blue-btn"
class="default-blue-btn" @click="handleJump">订单管理</el-button>
@click="handleJump"
>订单管理</el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm <GLCombiForm ref="showSearch"
ref="showSearch" :rowNumber="1"
:rowNumber="1" :formObj="searchForm"
:formObj="searchForm" :formData="searchFormData"
:formData="searchFormData" @handleOk="handleSearch"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
@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 v-if="configShow"
v-if="configShow" :size="size"
:size="size" class="default-blue-btn"
class="default-blue-btn" type="default"
type="default" @click="handleExport">导出</el-button>
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<single-gltable <single-gltable ref="activity"
ref="activity" :getListApi="getListApi"
:getListApi="getListApi" :noDataImg="url"
:noDataImg="url" :searchForm="tableSearchForm"
:searchForm="tableSearchForm" :tableParams="tableParams"
:tableParams="tableParams" :pageConf="pageConf"
:pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
:beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
@setTableFinishFun="setTableFinishFun" <div slot="activityImg"
> class="table-image"
<div slot-scope="scope">
slot="activityImg" <el-popover placement="top"
class="table-image" width="160"
slot-scope="scope" trigger="hover"
> popper-class="table-popover-block">
<el-popover <img class="table-popover-img"
placement="top" :src="scope.scope.activityImg" />
width="160" <img class="img-60 pointer"
trigger="hover" slot="reference"
popper-class="table-popover-block" :src="scope.scope.activityImg" />
>
<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="linkText" slot-scope="scope">
slot-scope="scope"
>
<template v-if="scope.scope.incrementFlag == 'Y' || !configShow"> <template v-if="scope.scope.incrementFlag == 'Y' || !configShow">
{{scope.scope[scope.prop] || 0 }} {{scope.scope[scope.prop] || 0 }}
</template> </template>
<template v-else> <template v-else>
<p <p class="cursor-pointer"
class="cursor-pointer" @click="handleDetail(scope)">{{ scope.scope[scope.prop] || 0 }}</p>
@click="handleDetail(scope)"
>{{ scope.scope[scope.prop] || 0 }}</p>
</template> </template>
</div> </div>
<div <div slot="joinText"
slot="joinText" slot-scope="scope">
slot-scope="scope" <el-tooltip effect="dark"
> :content="formatterNumber(scope.scope,scope.prop)"
<el-tooltip placement="top">
effect="dark"
:content="formatterNumber(scope.scope,scope.prop)"
placement="top"
>
<div class="line-ellipsis">{{formatterNumber(scope.scope,scope.prop)}}</div> <div class="line-ellipsis">{{formatterNumber(scope.scope,scope.prop)}}</div>
</el-tooltip> </el-tooltip>
</div> </div>
<div <div class="table-btns"
class="table-btns" slot="auth-button"
slot="auth-button" slot-scope="scope">
slot-scope="scope" <GLTableButton :buttonList="tableButtonList"
> :buttonItem="scope.scope"
<GLTableButton :buttonNum="3"></GLTableButton>
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</single-gltable> </single-gltable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 众筹分享 --> <!-- 众筹分享 -->
<crowdFundingShare <crowdFundingShare :isShareVisible="isShareVisible"
:isShareVisible="isShareVisible" :shareForm="shareForm"
:shareForm="shareForm" @handleShareClose="handleShareClose"
@handleShareClose="handleShareClose" :hideStatus="!configShow"></crowdFundingShare>
:hideStatus="!configShow"
></crowdFundingShare>
</div> </div>
</template> </template>
...@@ -129,7 +99,7 @@ import url from '@/assets/empty.png' ...@@ -129,7 +99,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,
...@@ -280,7 +250,7 @@ export default { ...@@ -280,7 +250,7 @@ export default {
fn: '数据看板' fn: '数据看板'
}, },
condition: row => { condition: row => {
return this.configShow return this.configShow
}, },
listeners: { listeners: {
click: row => { click: row => {
...@@ -327,13 +297,13 @@ export default { ...@@ -327,13 +297,13 @@ export default {
singleGltable: GLTable singleGltable: GLTable
}, },
mounted () { mounted() {
this.getCrowdfundingOrderConfig() this.getCrowdfundingOrderConfig()
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
async getCrowdfundingOrderConfig () { async getCrowdfundingOrderConfig() {
let tableColumns = [ let tableColumns = [
// { // {
// label: '序号', // label: '序号',
...@@ -475,11 +445,11 @@ export default { ...@@ -475,11 +445,11 @@ export default {
this.channelType = channelType this.channelType = channelType
this.tableParams.tableColumns = tableColumns this.tableParams.tableColumns = tableColumns
}, },
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
...@@ -487,13 +457,15 @@ export default { ...@@ -487,13 +457,15 @@ export default {
}) })
}, },
handleJump (path, row = {}) { handleJump(path, row = {}) {
console.log('111');
this.$router.push({ this.$router.push({
path: '/orderManage/index' 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: '取消',
...@@ -519,16 +491,16 @@ export default { ...@@ -519,16 +491,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
...@@ -541,26 +513,26 @@ export default { ...@@ -541,26 +513,26 @@ 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 = { var txtObj = {
add: '新建', add: '新建',
edit: '编辑', edit: '编辑',
copy: '复制', copy: '复制',
detail: '编辑' detail: '查看'
}[addOrEdit] }[addOrEdit]
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
...@@ -579,7 +551,7 @@ export default { ...@@ -579,7 +551,7 @@ export default {
// 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,
...@@ -605,25 +577,25 @@ export default { ...@@ -605,25 +577,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)
...@@ -649,11 +621,11 @@ export default { ...@@ -649,11 +621,11 @@ export default {
} }
}, },
handleSearch () { handleSearch() {
this.$refs.activity.refreshTable() this.$refs.activity.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
activityName: '', activityName: '',
activityStatus: '' activityStatus: ''
...@@ -661,12 +633,12 @@ export default { ...@@ -661,12 +633,12 @@ 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()
}, },
formatterNumber (cell, key) { formatterNumber(cell, key) {
const str = [] const str = []
cell?.goodsList?.map(e => { cell?.goodsList?.map(e => {
str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key]) str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key])
......
...@@ -2,27 +2,58 @@ ...@@ -2,27 +2,58 @@
<template> <template>
<div class="marketing"> <div class="marketing">
<div class="m-b-20"> <div class="m-b-20">
<GLButton :size="size" class="el-icon-plus" type="primary" @click="addActivity()" fn="新增秒杀活动" mode="el-button">新增秒杀活动</GLButton> <GLButton :size="size"
class="el-icon-plus"
type="primary"
@click="addActivity()"
fn="新增秒杀活动"
mode="el-button">新增秒杀活动</GLButton>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable 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 class="table-btns" slot="auth-button" slot-scope="scope"> <div 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 :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog> <share-dialog :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"></share-dialog>
</div> </div>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!