Commit 5e6d9870 by 王志慧

Merge branch 'v3.18.0' of http://192.168.3.233:8090/saas/scrm-micro-tools into v3.18.0

2 parents 82358dd9 5847ea53
<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
......@@ -8,4 +8,29 @@
*/
import Vue from '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-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,10 +19,12 @@ Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
Vue.prototype.setMinHeight = setMinHeight
Vue.prototype.defaultLabelWidth = '154px'
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const http_tag = params => Vue.prototype.$http_tag(params)
export const http_merchant = params => Vue.prototype.$http_merchant(params)
......@@ -19,8 +19,8 @@ let router = null
let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState ,routerBase}) {
const { response, request, sign, secret, sign_common, request_common, request_merchant ,merchantId} = await fetchConfig(common)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, merchantId } = await fetchConfig(common)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......@@ -28,14 +28,23 @@ export async function bootstrap({ history, common, messenger, globalState ,route
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$hmdMerchantId = merchantId
// 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$tracker = common.tracker
// 集团版集团账号
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_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_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
Vue.prototype.$http2 = new common.Http({
response,
request: request2,
sign,
secret,
alert: message.error,
headers: { token: globalState.session.token }
})
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
......
......@@ -390,9 +390,9 @@ export default {
},
mounted() {
// this.handleRefresh()
// this.getListData()
// this.getOptionsList('searchFormData')
this.handleRefresh()
this.getListData()
this.getOptionsList('searchFormData')
},
methods: {
......
......@@ -10,114 +10,84 @@
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton> -->
<el-button
:size="size"
type="default"
class="default-blue-btn"
@click="handleJump"
>订单管理</el-button>
<el-button :size="size"
type="default"
class="default-blue-btn"
@click="handleJump">订单管理</el-button>
</div>
<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>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
v-if="configShow"
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
<el-button v-if="configShow"
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<single-gltable
ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
: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"
/>
<single-gltable ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
: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>
</div>
<div
slot="linkText"
slot-scope="scope"
>
<div slot="linkText"
slot-scope="scope">
<template v-if="scope.scope.incrementFlag == 'Y' || !configShow">
{{scope.scope[scope.prop] || 0 }}
</template>
<template v-else>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{ scope.scope[scope.prop] || 0 }}</p>
<p class="cursor-pointer"
@click="handleDetail(scope)">{{ scope.scope[scope.prop] || 0 }}</p>
</template>
</div>
<div
slot="joinText"
slot-scope="scope"
>
<el-tooltip
effect="dark"
:content="formatterNumber(scope.scope,scope.prop)"
placement="top"
>
<div slot="joinText"
slot-scope="scope">
<el-tooltip effect="dark"
:content="formatterNumber(scope.scope,scope.prop)"
placement="top">
<div class="line-ellipsis">{{formatterNumber(scope.scope,scope.prop)}}</div>
</el-tooltip>
</div>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<GLTableButton :buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"></GLTableButton>
</div>
</single-gltable>
<!-- 表格区域 end -->
</div>
<!-- 众筹分享 -->
<crowdFundingShare
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
:hideStatus="!configShow"
></crowdFundingShare>
<crowdFundingShare :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
:hideStatus="!configShow"></crowdFundingShare>
</div>
</template>
......@@ -129,7 +99,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'crowdFundList',
data () {
data() {
return {
size: 'small',
url: url,
......@@ -280,7 +250,7 @@ export default {
fn: '数据看板'
},
condition: row => {
return this.configShow
return this.configShow
},
listeners: {
click: row => {
......@@ -327,13 +297,13 @@ export default {
singleGltable: GLTable
},
mounted () {
mounted() {
this.getCrowdfundingOrderConfig()
this.getOptionsList('searchFormData')
},
methods: {
async getCrowdfundingOrderConfig () {
async getCrowdfundingOrderConfig() {
let tableColumns = [
// {
// label: '序号',
......@@ -475,11 +445,11 @@ export default {
this.channelType = channelType
this.tableParams.tableColumns = tableColumns
},
getParams () {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn () {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
......@@ -487,13 +457,11 @@ export default {
})
},
handleJump (path, row = {}) {
this.$router.push({
path: '/orderManage/index'
})
handleJump(path, row = {}) {
this.$history.push('/store/orderManage/index')
},
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -519,16 +487,16 @@ export default {
},
//开始
start (item) {
start(item) {
this.startOrEndConfirm('开始', item)
},
//结束
end (item) {
end(item) {
this.startOrEndConfirm('结束', item)
},
startOrEndConfirm (txt, row) {
startOrEndConfirm(txt, row) {
var title = txt
var params = {}
params.id = row.id
......@@ -541,26 +509,26 @@ export default {
},
//置顶
topping (row) {
topping(row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del (row) {
del(row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
},
// 1-新增;2-编辑
handleEdit (addOrEdit, row) {
handleEdit(addOrEdit, row) {
var txtObj = {
add: '新建',
edit: '编辑',
copy: '复制',
detail: '编辑'
detail: '查看'
}[addOrEdit]
var params = {
addOrEdit: addOrEdit,
......@@ -579,7 +547,7 @@ export default {
// console.log(JSON.parse(JSON.stringify(option)))
// },
// 明细
handleDetail ({ prop, scope }) {
handleDetail({ prop, scope }) {
let data = {
viewAmount: {
type: 1,
......@@ -605,25 +573,25 @@ export default {
})
},
handleExport () {
handleExport() {
var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res)
})
},
handleShare (row) {
handleShare(row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose () {
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList (formName, hasAll = true, refreshSigle) {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
......@@ -649,11 +617,11 @@ export default {
}
},
handleSearch () {
handleSearch() {
this.$refs.activity.refreshTable()
},
handleReset () {
handleReset() {
this.searchForm = {
activityName: '',
activityStatus: ''
......@@ -661,12 +629,12 @@ export default {
this.handleSearch()
},
setTableFinishFun () {
setTableFinishFun() {
//接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
},
formatterNumber (cell, key) {
formatterNumber(cell, key) {
const str = []
cell?.goodsList?.map(e => {
str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key])
......
......@@ -2,27 +2,58 @@
<template>
<div class="marketing">
<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 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">
<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" />
<GLTable ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
: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>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<GLTableButton :buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
<share-dialog :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
......@@ -320,7 +351,11 @@ export default {
// addOrEdit:1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
this.$router.push('/seckillActivity/editActivity/' + addOrEdit + '/' + row.id)
var html = ''
if (addOrEdit == 3) {
html += '?$title=查看秒杀活动'
}
this.$router.push('/seckillActivity/editActivity/' + addOrEdit + '/' + row.id + html)
},
handleShare(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!