Commit 414ed1b7 by 前端

init

1 parent b435076a
Showing 102 changed files with 3740 additions and 0 deletions
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
VUE_APP_PORT = 6652
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file
{
"root": true,
"env": {
"node": true
},
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": {
"no-console": "off",
"no-unused-vars": "off",
"prettier.endOfLine": "crlf",
"endOfLine": "auto"
},
"parserOptions": {
"parser": "babel-eslint"
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
{
"printWidth": 800,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 820,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"useTabs": false,
"eslintIntegration": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
# subapp-blog
微前端博客子应用
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "theme-chalk"
}
]
]
};
This diff could not be displayed because it is too large.
{
"name": "link",
"version": "1.0.0",
"description": "A Vue.js project",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.18.0",
"core-js": "^3.4.4",
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^2.0.4",
"glsx-components": "^1.2.5",
"vod-js-sdk-v6": "^1.5.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
"wangeditor": "^4.7.15"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="never">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<title>微前端子应用:博客</title>
</head>
<body>
<noscript>
<strong>We're sorry but module-report doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>
\ No newline at end of file
var express = require('express')
// var history = require('connect-history-api-fallback')
var cors = require('cors')
var app = express()
// app.use(history())
app.use(cors())
app.use(express.static('./dist'))
app.get('/', function(req, res) {
res.send('Hello jq')
})
const port = 6652
app.listen(port)
console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
<template>
<div id="app">
<!-- <h2>
报表子应用
<span class="right"></span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport('3-1')">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div>-->
<router-view />
</div>
</template>
<script>
export default {
name: 'report-app',
props: {
msg: String,
message: String
},
data() {
return {
myMsg: '',
gs: ''
}
},
created() {
this.myMsg = this.msg
this.myMessage = this.message
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
#app {
padding: 0px 20px 20px 40px;
// overflow-y: auto;
height: 100%;
}
</style>
>
/*
所有模块都定义在 modules
|-modules
|----demo.js
|----demo1.js
|----...
|-index.js ---动态对外暴露所有模块 无须手动添加
参考demo.js 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
*/
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default modules
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:56
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-16 10:24:46
* @FilePath: \scrm-micro-link\src\api\modules\activity.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.activity.'
//分页查询媒体文件列表
const dropdownList = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.dropdown.list`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//删除媒体文件
const tencentcloudmediaDelete = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//新增或编辑媒体文件
const tencentcloudmediaUpdate = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.add.or.update`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//媒体文件详情
const tencentcloudmediaDetail = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//分页查询媒体文件列表
const tencentcloudmediaPage = params => {
params.method = `scrm.api.coupon.saas.directional.gift.list`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//活动详情
const getActivityDetailApi = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//活动详情
const toggleStatus = params => {
params.method = `${defaultPath}toggle.status`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//活动详情
const deleteApi = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//膨胀金列表
const pageApi = params => {
params.method = `scrm.api.shopmall.all.bulge.activity.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const updateApi = params => {
params.method = `${defaultPath}bulge.add.or.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
dropdownList,
tencentcloudmediaPage,
tencentcloudmediaDetail,
tencentcloudmediaUpdate,
tencentcloudmediaDelete,
getActivityDetailApi,
deleteApi,
pageApi,
updateApi
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 14:46:30
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-15 17:48:25
* @FilePath: \live\src\api\modules\common.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http_common, http } from '@/main'
const defaultPath = 'scrm.api.carlife.'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
// 根据门店号获取员工列表
const getMerchantStaff = params => {
params.method = 'scrm.api.shopmall.crowd.funding.staff.get'
return http({
url: '/rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchantList = params => {
params.method = `${defaultPath}merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
const uploadImgApi = params => {
params.method = `${defaultPath}common.uploadImg`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadMusicApi = params => {
params.method = 'scrm.api.carlife.common.uploadMusic'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadVideoApi = params => {
params.method = `${defaultPath}common.uploadVideo`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default {
pictureUpload,
getMerchantStaff,
getMerchantList,
uploadImgApi,
uploadMusicApi,
uploadVideoApi
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 16:38:54
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-13 17:29:52
* @FilePath: \scrm-micro-link\src\api\modules\giftBag.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http } from '@/main'
const getghDirectionalGiftListApi = params => {
// params.method = 'scrm.api.coupon.directional.gift.coupon.list'
params.method = 'scrm.api.coupon.directional.gift.coupon.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getghDirectionalGiftListApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getListApi = params => {
params.method = `${defaultPath}order.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const getCountApi = params => {
params.method = `${defaultPath}order.count`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const getOrderDetailApi = params => {
params.method = `${defaultPath}order.detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const orderExportApi = params => {
params.method = `${defaultPath}order.export`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 订单核销
const writeOffApi = params => {
params.method = `${defaultPath}order.verfication`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 众筹-订单核销
const crowdFundWriteOffApi = params => {
params.method = 'scrm.api.shopmall.crowd.funding.order.verfication'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 众筹-退款
const crowdFundRefundApi = params => {
params.method = 'scrm.api.shopmall.crowd.funding.order.refund'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 快递信息
const addDeliveryApi = params => {
params.method = `${defaultPath}order.addDelivery`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 退款审核 - 详情
const examineDetailApi = params => {
params.method = `${defaultPath}orderRefund.detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 退款审核 - 提交
const examineAllowApi = params => {
params.method = `${defaultPath}orderRefund.allow`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 确认收货
const confirmReceiptGoodsApi = params => {
params.method = `${defaultPath}order.refund.confirmReceiptGoods`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 审计-特殊账号
const checkMerchartApi = params => {
params.method = 'scrm.api.shopmall.import.merchant.check'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//设置活动(通用)的指派人
const orderAppointer = params => {
params.method = 'scrm.api.shopmall.order.appointer.update'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//膨胀金订单详情
const orderDetail = params => {
params.method = 'scrm.api.shopmall.order.detail'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//膨胀金订单列表
const orderPage = params => {
params.method = 'scrm.api.shopmall.order.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//膨胀金订单退款
const goldRefund = params => {
params.method = 'scrm.api.shopmall.expanded.gold.refund'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const orderUpdate = params => {
params.method = 'scrm.api.shopmall.order.type.update'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const orderExport = params => {
params.method = 'scrm.api.shopmall.order.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { orderExport, orderUpdate, orderAppointer, goldRefund, orderPage, orderDetail, getListApi, getCountApi, getOrderDetailApi, orderExportApi, writeOffApi, crowdFundWriteOffApi, crowdFundRefundApi, addDeliveryApi, examineDetailApi, examineAllowApi, confirmReceiptGoodsApi, checkMerchartApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.activity.'
//分页查询活动
const getActivityPageApi = params => {
params.method = `${defaultPath}page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//分页众筹活动
const getCrowdfundListApi = params => {
params.method = 'scrm.api.shopmall.all.crowdfunding.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 众筹-导出
const exportCrowdfundApi = params => {
params.method = 'scrm.api.shopmall.all.crowdfunding.activity.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//分页浏览明细
const getBrowseListApi = params => {
params.method = 'scrm.api.shopmall.customer.browse.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//众筹活动访客明细
const getVisitorListApi = params => {
params.method = 'scrm.api.shopmall.customer.visitor.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 众筹活动分享明细
const getSharedListApi = params => {
params.method = 'scrm.api.shopmall.customer.shared.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 分页浏览-导出
const exportBrowseApi = (params, TYPE = 1) => {
//TYPE 1 浏览 2 访客 3 分享
params.method = {
1: 'scrm.api.shopmall.customer.browse.records.export',
2: 'scrm.api.shopmall.customer.visitor.records.export',
3: 'scrm.api.shopmall.customer.shared.records.export'
}[TYPE]
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//创建/编辑活动
const addOrUpdateActivityApi = params => {
params.method = `${defaultPath}add.or.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//活动详情
const getActivityDetailApi = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//开始/结束活动
const toggleStatusApi = params => {
params.method = `${defaultPath}toggle.status`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//删除活动
const deleteActivityApi = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//置顶活动
const topActivityApi = params => {
params.method = `${defaultPath}top`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//分享
const getSharedApi = params => {
params.method = `${defaultPath}get.shared`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 众筹-分享
const getCrowdSharedApi = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.get.shared'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
/**直播间下拉列表 */
const getLiveListApi = params => {
params.method = 'scrm.api.shopmall.livebroadcast.dropdown.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
/**定金收款账户下拉列表 */
const getPayListApi = params => {
params.method = 'scrm.api.shopmall.activity.payment.account.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
/**数据看板员工排名 */
const getRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 数据看板员工-导出
const exportRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**数据看板 */
const getDataBoardApi = params => {
params.method = 'scrm.api.shopmall.activity.statdata'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
/**每日订单量统计 */
const getDailyOrderQuantityStatistics = params => {
params.method = 'scrm.api.shopmall.activity.daily.order.quantity'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**导出每日订单量统计 */
const exportDailyOrderQuantityStatistics = params => {
params.method = 'scrm.api.shopmall.activity.daily.order.quantity.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**活动直播间数据统计-详情导出 */
const liveroomDetailexport = params => {
params.method = 'scrm.api.shopmall.activity.liveroom.detailexport'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**活动直播间数据统计-分页详情 */
const liveroomDetailpage = params => {
params.method = 'scrm.api.shopmall.activity.liveroom.detailpage'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**活动直播间数据统计-概览 */
const liveroomOverview = params => {
params.method = 'scrm.api.shopmall.activity.liveroom.overview'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getPayListApi, liveroomDetailexport, liveroomDetailpage, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi, getDailyOrderQuantityStatistics, exportDailyOrderQuantityStatistics }
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
.left{float:left}.right{float:right}.align-right{text-align:right}
body,
html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f4f5fa;
}
.link-main {
.container {
background: #ffffff;
padding: 20px;
}
.m-b-20 {
margin-bottom: 20px;
}
.p-t-20 {
padding-top: 20px;
}
.table-circle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 4px;
vertical-align: middle;
}
.back-orange {
background-color: #fdb757;
}
.back-blue {
background-color: #5850ff;
}
.back-grey {
background-color: #999999;
}
.back-green {
background-color: #2cca74;
}
.back-red {
background-color: #eb4e4e;
}
.m-r-8 {
margin-right: 8px;
}
.message-Z-zinde,
.message-Z-zinde {
z-index: 9999 !important;
}
.flex {
display: flex;
}
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.flex-row-center {
display: flex;
justify-content: center;
}
.flex-col-center {
display: flex;
align-items: center;
}
.flex-space-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.flex-wrap {
display: flex;
flex-wrap: wrap;
}
.tips-icon {
display: inline-block;
width: 14px;
height: 14px;
margin-right: 12px;
vertical-align: middle;
cursor: pointer;
}
.el-tabs__item {
width: 120px;
padding: 0 20px;
text-align: center;
}
.p-t-10 {
padding-top: 20px;
}
.p-t-20 {
padding-top: 20px;
}
.p-20 {
padding: 20px;
}
.img-36 {
width: 36px;
height: 36px;
}
.pointer {
cursor: pointer;
}
.m-l-10 {
margin-left: 10px;
}
.m-l-20 {
margin-left: 20px;
}
.m-t-10 {
margin-top: 10px;
}
.m-t-20 {
margin-top: 20px;
}
.m-b-10 {
margin-bottom: 10px;
}
.m-b-20 {
margin-bottom: 2px;
}
.flex-align {
display: flex;
align-items: center;
}
.flex-top {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
}
.edit-title {
font-size: 16px;
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
padding: 0 0 0 20px;
}
.edit-form-container {
margin-top: 20px;
}
.assignLabel {
color: #5850ff;
}
}
/**
* 根据路由匹配地址
* @param {*} data 路由数据
* @param {*} base 路由前缀
* @param {*} options 粗略的配置项
*/
function routeMatch(data, base, options = { url: 'url', name: 'name', id: 'id', permissions: 'permissions' }) {
if (!Array.isArray(data)) return []
// 主视图路由 正式项目需要区分登陆注册等
/* let userRouter = {
path: "/layout",
name: "layout",
component: () => import('@/views/layout/index.vue'),
redirect: '/index',
children: []
}; */
// 创建路由盒子
let routerBox = []
// 将菜单数据处理为一维函数 如果有多级菜单
// let menu = flattenDeep(data, 'children');
let menu = data
// 遍历处理路由
menu.forEach(item => {
if (!item[options.url]) return
let _url = item[options.url].replace(base, '')
try {
let routerItem = {
path: _url, // 路由路径名
name: item[options.name] || item[options.id], // 命名路由 用于配合菜单简洁跳转
meta: {
purview: item[options.permissions]
}, // 路由元信息 定义路由时即可携带的参数,可用来管理每个路由的按钮操作权限
component: () => import(`@/views${_url}/index.vue`) // 路由映射真实视图路径
}
routerBox.push(routerItem)
} catch (err) {
item[options.url] = '/err-404'
}
})
// 推入需要授权后等异步加载的,非服务端获取的功能性页面
// routerBox.push(...nextRouter);
let errorBox = {
path: '*',
redirect: '/err-404'
}
routerBox.push(errorBox)
return routerBox
}
export default routeMatch
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
/* eslint-disable */
var reg = {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/,
zNumReg: /^\d*$/
}
/* eslint-enable */
regRule = regRule || 'priceReg'
if (newValue && ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))) {
return oldValue || ''
}
if (newValue && reg[regRule].test(newValue + '')) {
if (/\./.test(newValue)) {
newValue = newValue + ''
var interger = newValue.split('.')[0]
var point = newValue.split('.')[1]
var intergerNum = interger.length > intergerDigit ? oldValue.split('.')[0] : interger
var pointNum = point.length > pointDigit ? point.slice(0, pointDigit) : point
newValue = pointDigit ? intergerNum + '.' + pointNum : newValue.split('.')[0]
} else {
newValue = newValue.length > intergerDigit ? oldValue.slice(0, intergerDigit) : newValue
if (regRule == 'zNumReg') {
newValue = newValue.split('')[0] == '0' ? '0' : newValue
}
}
return newValue
} else {
return newValue ? oldValue : ''
}
}
function downloadIamge(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
function exportFn(url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url.replace(/(http|https):/, '')
document.body.appendChild(iframe)
}
function aToExport(url) {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
}
const orderManageStatusList = [
{ confId: '1', confName: '待付款' },
{ confId: '2', confName: '已支付' },
{ confId: '3', confName: '已失效' },
// { confId: '21', confName: '待收货(待核销)' },
{ confId: '21', confName: '待核销' },
{ confId: '22', confName: '已核销' },
// { confId: '22', confName: '已收货(已核销)' },
{ confId: '6', confName: '待发货' },
// { confId: '7', confName: '待核销' },
// { confId: '8', confName: '已核销' },
{ confId: '9', confName: '售后中' },
{ confId: '10', confName: '售后完成' },
{ confId: '11', confName: '待审批' }
]
const afterSaleStatusList = [
{ confId: '1', confName: '待审核' },
{ confId: '2', confName: '审核成功' },
{ confId: '3', confName: '审核失败' },
{ confId: '4', confName: '待确认' },
{ confId: '5', confName: '退款中' },
{ confId: '6', confName: '已退款' },
{ confId: '7', confName: '退款失败' }
]
const orderSourceList = [
{ confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' },
{ confId: '3', confName: '秒杀订单' },
{ confId: '4', confName: '众筹订单' }
]
const deliveryTypeList = [
{ confId: '1', confName: '到店核销' },
{ confId: '2', confName: '快递到家' }
]
//会员中心得状态list
const statusList = [
// {
// confId: '',
// confName: '全部'
// },
{
confId: 1,
confName: '生效中'
},
{
confId: 2,
confName: '已失效'
}
]
//会员订单类型字典
const orderTypesList = [
{
confId: 1,
confName: '套餐'
},
{
confId: 2,
confName: '权益卡'
}
]
const orderStatus = [
{
confId: 1,
confName: '未开始'
},
{
confId: 2,
confName: '进行中'
},
{
confId: 3,
confName: '已结束'
}
]
const orderStatusList = [
// 2: '待收货',
// 3: '已完成',
// 4: '售后中',
// 5: '退款失败',
// 6: '已经退款',
{
confId: 2,
confName: '待收货'
},
{
confId: 3,
confName: '已完成'
},
{
confId: 4,
confName: '售后中'
},
{
confId: 5,
confName: '退款失败'
},
{
confId: 6,
confName: '已退款'
}
]
const serviceStatusList = [
{
confId: 1,
confName: '未生效'
},
{
confId: 2,
confName: '生效中'
},
{
confId: 3,
confName: '已失效'
}
]
const memberTypeList = [
{
confId: 1,
confName: '正式会员'
},
{
confId: 2,
confName: '试用会员'
}
]
const stateList = [
{
confId: 0,
confName: '待上架'
},
{
confId: 1,
confName: '在售中'
},
{
confId: 2,
confName: '已下架'
}
]
const businessType = [
{
optionId: 1,
optionLabel: '1.2'
},
{
optionId: 3,
optionLabel: '2.0'
}
]
function setMinHeight(calssName = '.edit-container') {
let height = document.querySelector('.header-wrap').clientHeight + 110 + 'px'
let minHeight = 'calc(100vh - ' + height + ')'
document.querySelector(calssName).style.minHeight = minHeight
}
function isShowBtn(value) {
let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menuLevel(menu)
function menuLevel(item) {
item.forEach(itm => {
if (itm.path == value) {
isShowStatus = true
}
if (itm.children) {
menuLevel(itm.children)
}
})
}
return isShowStatus
}
export { isShowBtn, limitPrice, getExplorer, exportFn, aToExport, downloadIamge, businessType, orderStatus, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight }
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-28 10:12:36
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-28 10:25:09
* @FilePath: \live\src\components\big-view\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<template>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
},
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
_this.adrList = result.poiList.pois
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let position
if (e.type == 'click') {
position = e.lnglat
} else {
let { lng, lat } = e
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
}
}
</script>
<style scoped lang="scss">
.map-box {
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province" style="padding-left: 0;">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
export default {
name: 'GLProvince',
props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: {
type: Number,
default: 2
},
// 省市下拉组件宽度
defaultWidth: {
type: String,
default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// 所有数据
AllData: [],
// 城市列表
cityList: [],
// 地区列表
townList: [],
provinceForm: {
// 省份名称
provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '',
// 省份代码
provinceCode: '',
// 城市代码
cityCode: '',
// 地区代码
townCode: ''
}
}
},
mounted() {
this.provinceList()
},
methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显
init(province, city, town) {
this.provinceForm = {
provinceName: province,
cityName: city,
townName: town
}
if (province) {
this.AllData.map(item => {
if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name
this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode
if (city) {
this.cityList.map(itm => {
if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityCode = itm.adcode
this.provinceForm.cityName = itm.name
this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
}
})
}
},
// 选择省
selectProvince(val) {
this.provinceForm.cityName = ''
this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', { provinceName: val.name, provinceCode: val.adcode })
},
// 选择市
selectCity(val) {
this.provinceForm.townName = ''
this.townList = val.districts
this.$emit('selectCity', { cityName: val.name, cityCode: val.adcode })
},
// 选择区
selectTown(val) {
this.$emit('selectTown', { townName: val.name, townCode: val.adcode })
}
}
}
</script>
<style lang="scss">
.province {
display: inline-flex;
.el-select .el-input {
width: auto !important;
}
}
.select-padding {
margin-right: 10px;
}
</style>
<!-- 弹窗 -->
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:show-close="showClose"
:before-close="handleClose"
:close-on-click-modal="false"
:modal-append-to-body="false"
:width="width"
class="app-dialog"
>
<el-scrollbar v-if="hasScroll">
<span slot="title">
<span class="main-title"></span>
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
</el-scrollbar>
<template v-if="!hasScroll">
<span slot="title">
<span class="main-title"></span>
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
</template>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button
:type="typeName"
v-if="!noClose"
:size="btnSize"
@click="handleClose"
></el-button>
<el-button
type="default"
v-if="!noCancel"
:size="btnSize"
@click="handleClose"
></el-button>
<el-button
type="primary"
v-if="!noBtnOk"
:size="btnSize"
@click="handleConfirm"
></el-button>
<slot name="btn-middle"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'glsx-dialog',
data() {
return {}
},
props: {
hasScroll: {
type: Boolean,
default: true
},
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: false
},
btnCloseLabel: {
type: String,
default: '关闭'
},
btnOkLabel: {
type: String,
default: '确定'
},
btnCancelLabel: {
type: String,
default: '取消'
},
noBtnOk: {
type: Boolean,
default: false
},
noCancel: {
type: Boolean,
default: false
},
noClose: {
type: Boolean,
default: true
},
typeName: {
type: String,
default: 'default'
},
width: {
type: String,
default: '580px'
},
btnSize: {
type: String,
default: 'small'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style lang="scss">
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-06 10:10:44
* @LastEditors: limin
* @LastEditTime: 2021-09-06 10:11:49
* @FilePath: \scrm\scrm-sub-blog\src\components\index.js
*/
import Vue from 'vue'
import glsxDialog from '@/components/glsx-dialog/index.vue'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
\ No newline at end of file
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.NODE_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-18 11:51:29
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-marketing',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
// baseURL: 'http://scrm.test.glsx.com.cn/',
baseURL: 'http://192.168.2.42:8064/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
module.exports = {
title: 'scrm-sub-marketing',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
baseURL: 'http://scrm.test.glsx.com.cn/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-23 17:38:30
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
// console.log(1111111)
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/6351298f6a118b4ff787ef2b/live/config')
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6324135a4edfe442ee0530ae/live/config')
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-13 15:29:54
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
import apis from './api'
import './public-path'
import '@/assets/css/public.scss'
import '@/components'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
Vue.prototype.defaultLabelWidth = '154px'
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
File mode changed
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container } from 'element-ui'
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(TimePicker)
Vue.use(Col)
Vue.use(DatePicker)
Vue.use(Tree)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Tooltip)
Vue.use(Tabs)
Vue.use(TabPane)
export const message = Message
export const messageBox = MessageBox
if (window.__POWERED_BY_QIANKUN__) {
// eslint-disable-next-line no-undef
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)
// 处理重复点击同一个路由报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export { VueRouter, routes, getRoutes }
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:57
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-13 09:42:39
* @FilePath: \scrm-micro-link\src\router\routes.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const staticRoutes = Object.freeze([
{
name: 'activityLink',
path: '/activityLink/index',
component: resolve => require([`@/views/activityLink/index.vue`], resolve),
meta: {}
}
])
export default staticRoutes
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:31:52
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:09
* @FilePath: \scrm\scrm-sub-blog\src\setup\index.js
*/
import { bootstrap, mount, unmount } from './qiankun'
import { start } from './single'
export { bootstrap, mount, unmount, start }
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:57
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-16 09:25:41
* @FilePath: \scrm-micro-link\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from 'vue'
import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import ElementUI from 'element-ui'
import render from './render'
import 'glsx-components/dist/glsx-components.css'
let routes = []
let router = null
let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'scrm-base-09cf702c-321e-4f06-948e-c5907fb20b92-rop' } })
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.$setGlobalState = globalState.actions.setGlobalState
Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
}
export async function mount(props) {
const insts = render(props.routerBase, routes)
router = insts.router
instance = insts.vm
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:04:32
* @LastEditors: limin
* @LastEditTime: 2021-10-14 16:30:47
* @FilePath: \scrm\scrm-sub-blog\src\setup\render.js
*/
import App from '../App.vue'
import Vue from 'vue'
import store from '@/store'
import { VueRouter } from '@/router'
const render = (base, routes) => {
const router = new VueRouter({
base,
routes,
mode: 'history'
})
const vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
return { router, vm }
}
export default render
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:02:23
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:17
* @FilePath: \scrm\scrm-sub-blog\src\setup\single.js
*/
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
var urlParams = {}
// window.location.href
// .split('?')[1]
// .split('&')
// .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1]
// })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-53e870b5-80d5-483e-8277-cdc4dec0ad80-rop'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-08-25 14:14:44
* @FilePath: \scrm\scrm-base\src\store\index.js
*/
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce(
(result, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
result.getters[moduleName] = state => state[moduleName]
result.modules[moduleName] = value.default
return result
},
{ modules: {}, getters: {} }
)
const store = new Vuex.Store(modules)
export default store
export default {
namespaced: true,
state: {
size: 10, // 分页 页大小
token: ''
},
mutations: {
// 设置分页大小
SET_PAGE_SIZE(state, data) {
state.size = data
},
// 设置token
SET_TOKEN(state, data) {
state.token = data
}
},
actions: {
// 设置分页大小
setPageSize({ commit }, data) {
commit('SET_PAGE_SIZE', data)
},
// 设置token
setToken({ commit }, data) {
commit('SET_TOKEN', data)
}
}
}
export default {
namespaced: true,
state: {},
mutations: {},
actions: {}
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 11:06:49
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-12-01 10:06:04
* @FilePath: \live\src\utils\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export function debounce(func, wait = 200) {
let timeout
return function(event) {
clearTimeout(timeout)
timeout = setTimeout(() => {
func.call(this, event)
}, wait)
}
}
export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
export function downloadUrl(url) {
const link = document.createElement('a')
link.href = url.replace(/(http|https):/, '')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
export function GetDateDiff(time1, time2 = new Date()) {
let startTime = new Date(time1) //开始时间
let endTime = new Date(time2) //结束时间
let date = endTime.getTime() - startTime.getTime() //时间差秒
//计算出相差天数
let days = Math.floor(date / (24 * 3600 * 1000))
//计算出小时数
let leave1 = date % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
let hours = Math.floor(leave1 / (3600 * 1000))
//计算相差分钟数
let leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数
let minutes = Math.floor(leave2 / (60 * 1000)) //计算相差秒数
let leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数
let seconds = Math.round(leave3 / 1000)
return days + '天' + hours + '时' + minutes + '分' + seconds + '秒'
}
<!-- 明细 -->
<template>
<div class="edit-share edit-box">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex-space-between m-b-10 w-100-percent">
<div class="table-title">
已累计
<template v-if="routeInfo.type != 2">{{ decodeURI(routeInfo.name) }}</template>
<span>{{ routeInfo.count || 0 }}</span>
{{ routeInfo.type == 2 ? '位访客' : '次' }}
</div>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerName" class="flex-align" slot-scope="scope">
<template v-if="scope.scope.customerAvatar">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.customerAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.customerAvatar" />
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div slot="shareName" class="flex-align" slot-scope="scope">
<template v-if="scope.scope.shareAvatar">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.shareAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" />
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone }}</span>
</div>
<div slot="isBuy" slot-scope="scope">
<span :class="['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ? 'back-green' : 'back-grey']"></span>
<span>
{{
{
Y: '已付款',
N: '未付款'
}[scope.scope.isBuy] || '--'
}}
</span>
</div>
</GLTable>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
return {
size: 'small',
url: url,
footerLeft: '0',
footerWidth: '0',
routeInfo: {
id: '',
activityName: ''
},
searchForm: {
customerName: '',
mobile: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 搜索
searchFormData: [
{
label: '微信昵称',
name: 'customerName',
type: 'input',
maxlength: 50
},
{
label: '手机号',
name: 'mobile',
type: 'input',
maxlength: 11
},
{
label: '分享人',
name: 'shareName',
type: 'input',
maxlength: 50
}
],
// 表格
getListApi: null,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '微信昵称',
prop: 'customerName',
addHtml: 'customerName'
},
{
label: '手机号',
prop: 'mobile'
},
{
label: '分享人',
prop: 'shareName',
addHtml: 'shareName',
width: 230
}
]
}
}
},
created() {
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browserTime'
},
{
label: '进入页面时间',
prop: 'operationDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
}
],
{ query } = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享'
}[query.type],
[url] = window.location.href.split('%24title')
query.name = name
this.routeInfo = query
this.getListApi = this.$apis.seckillActivity[
{
1: 'getBrowseListApi',
2: 'getVisitorListApi',
3: 'getSharedListApi'
}[query.type]
]
history.replaceState(null, null, `${url}&$title=${name}明细`)
// listName:
//1 浏览 2 访客 3 分享
// if (query.type != 2) {
// this.searchFormData.push({
// label: '订单状态',
// name: 'isBuy',
// type: 'select',
// width: '215px',
// optionList: [
// {
// confId: '',
// confName: '全部'
// },
// {
// confId: 'Y',
// confName: '已付款'
// },
// {
// confId: 'N',
// confName: '未付款'
// }
// ],
// optionId: 'confId',
// optionLabel: 'confName'
// })
// if (query.type == 3)
// this.tableParams.tableColumns.push({
// label: '分享时间',
// prop: 'sharedTime'
// })
// this.tableParams.tableColumns = [...this.tableParams.tableColumns, ...lastTableColumns]
// } else
// this.tableParams.tableColumns = [
// ...this.tableParams.tableColumns,
// {
// label: '浏览次数',
// prop: 'browseCount'
// },
// {
// label: '最后浏览时间',
// prop: 'lastBrowseDate'
// }
// ]
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1
params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params, type).then(res => {
exportFn(res)
})
},
handleJump(path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
this.$refs.browserRef.refreshTable()
},
handleReset() {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
mobile: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped lang="scss">
.edit-container {
.table-title {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
align-items: center;
span {
color: #5850ff;
}
}
}
.edit-share {
/deep/ {
.gl-operate {
margin-left: 50px;
}
}
}
</style>
<template>
<div class="select-store">
<!-- width="600px" -->
<GLDialog bigTitle="选择门店"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
<span slot="footer">
<el-button :size="size"
type="primary"
@click="resetTable">查询</el-button>
</span>
</glsx-combi-form>
<!-- : :hasPage="false"
:getListApi="getListApi"
:tableData="storeList" -->
<GLTable ref="storeRef"
:noDataImg="url"
:tableTotal="total"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun">
<div slot="radioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="merchantId"
:label="scope.scope.merchantNo"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
</GLTable>
<!-- <span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span> -->
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectStore',
data() {
return {
url: url,
searchForm: {
merchantId: '',
merchantName: ''
},
// getListApi: this.$apis.common.getMerchantList,
total: 0,
storeList: [],
heightBox: 200,
merchantId: '',
merchantName: '',
// 搜索
searchFormData: [
{
label: '商户名称',
name: 'merchantName',
type: 'input',
placeholder: '请输入商户名称',
width: '300px',
labelWidth: '10px'
},
{
label: '商户ID',
name: 'merchantId',
type: 'input',
inputType: 'number',
placeholder: '请输入商户ID',
width: '300px',
labelWidth: '10px'
}
],
pageConfig: {
pageSize: 10,
currentPage: 1
},
tableParams: {
listName: 'list',
// tableOption: true,
// 行数据的key
// mutiSelectUniqueKey: 'staffId',
// checkSelectKey: 'staffId',
// checkSelectVal: [],
// 多选ref的名称
// mutiSelectName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '序号',
prop: 'idx',
width: 80
},
{
label: '商户名称',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '商户id',
prop: 'merchantNo',
formatter: cellValue => {
return cellValue.merchantNo || '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
storeSearchForm: {
type: Object
},
merchantInfo: {
required: true
}
// merchantId: {
// type: String,
//
// }
// orderCode: {
// type: String,
// required: true
// }
},
mounted() {
// this.userInfo = this.$globalState.session
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.merchantId = this.merchantInfo
this.getList()
},
methods: {
getList(pageCon) {
console.log(pageCon, 'pageCon')
pageCon && (this.pageConfig = pageCon)
var params = {
merchantId: this.merchantId,
...this.searchForm,
...this.pageConfig
// merchantId: '44209390',
}
console.log(params)
this.$apis.common.getMerchantList(params).then(res => {
console.log(res)
this.storeList = res.list
this.total = res.total
// // this.storeList = res.staffUnitList
// // var page = this.$refs.staffRef.page
// // // 添加序号
// pageConfig
let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
console.log(nowIndex)
this.storeList.forEach((item, index) => {
item.idx = index + 1 + nowIndex
})
console.log(this.storeList)
// this.$refs.staffRef.tableHeightValues = '460px'
// })
})
},
resetTable() {
this.$refs.storeRef.page.currentPage = 1
this.getList()
},
setTableFinishFun() {
// console.log(this.$refs.staffRef.data)
// this.storeList = this.$refs.staffRef.data
//接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px'
},
handleClick(val) {
console.log(val)
// let { merchantId, merchantName } =val
this.merchantId = val.merchantNo
this.merchantName = val.merchantName
// let temp = JSON.parse(JSON.stringify(val))
// delete temp.idx
// this.staffUuid = val.uuid
// this.store = val
},
handleClose() {
this.$emit('handleRelateStoreClose')
},
handleConfirm() {
// if (!this.staffUuid)
// return this.$message({
// message: '请先选择员工',
// type: 'error'
// })
// let parmas = {
// subOrderCode: this.orderCode,
// staffUuid: this.staffUuid
// }
// this.$apis.orderManage.signerOrder(parmas).then(res => {
// console.log(res)
// })
// this.staffUuid
this.$emit('handleRelateStoreConfirm', {
merchantId: this.merchantId,
merchantName: this.merchantName
})
}
}
}
</script>
<style lang="scss">
.select-store {
.storeDailog {
width: 500px;
}
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.store-table .el-radio__label {
display: none;
}
}
</style>
<template>
<div class="wechat-box marketing">
<img class="w-100-percent" src="@/assets/seckillActivity/phone.png" />
<div class="wechat-back">
<p class="wechat-name one-line-ellipsis">{{ editForm.activityName }}</p>
<img class="wechat-head" src="@/assets/seckillActivity/crowd-head.png" />
<img class="icon-server" src="@/assets/seckillActivity/icon-server.png" />
<div class="wechat-inner-box">
<div class="wechat-banner-img">
<img class="icon-music" src="@/assets/seckillActivity/icon-music.png" />
<img :src="editForm.activityBigImg || require('@/assets/seckillActivity/icon-default.png')" />
<img class="wechat-customer" src="@/assets/seckillActivity/crowd-customer.png" />
<div class="w-100-percent txt-center">
<video v-if="editForm.activityVideoList.length" class="wechat-video" controls>
<source :src="editForm.activityVideoList[0]" type="video/mp4" />
</video>
</div>
<div class="wechat-block">
<p class="wechat-block-title">活动举办方</p>
<div class="flex-center">
<div>
<p class="m-b-10">{{ editForm.sponsorName }}</p>
<p class="m-b-10 wechat-sub-addr">{{ editForm.activityAddressDetailName }}</p>
<p class="wechat-time" v-if="editForm.activityTime && editForm.activityTime.length">活动时间:{{ editForm.activityTime[0].split(' ')[0] }}-{{ editForm.activityTime[1].split(' ')[0] }}</p>
</div>
<img class="icon-addr" src="@/assets/seckillActivity/icon-addr.png" />
</div>
</div>
<div class="wechat-block">
<p class="wechat-block-title">{{ countDownObj.typeTxt }}</p>
<p v-if="countDownObj.activityStatus != 3" class="wechat-count-down">
<span v-if="editForm.activityTime && editForm.activityTime.length">{{ editForm.activityTime[0].split(' ')[0].split('-')[2] }}</span>
日开始活动,还差
<span class="wechat-txt">{{ countDownObj.d }}</span>天
<span class="wechat-txt">{{ countDownObj.h }}</span>时
<span class="wechat-txt">{{ countDownObj.m }}</span>分
<span class="wechat-txt">{{ countDownObj.s }}</span>秒
</p>
<img v-else class="count-down-img" src="@/assets/seckillActivity/count-down.png" />
</div>
<div class="w-100-percent txt-center">
<img class="crowd-jdt" src="@/assets/seckillActivity/crowd-jdt.png" />
</div>
<div class="wechat-block service">
<div class="serve" v-if="editForm.activityServices.length">
<div class="box flex">
<div style="width: 26px;">服务</div>
<div class="serve-text flex-center">
<template v-for="(i, index) in editForm.activityServices">
<div :key="index" class="flex-default">
{{ i.title }}
<span v-if="index != editForm.activityServices.length - 1">·</span>
</div>
</template>
</div>
<div class="sprite-icon icon-arrow"></div>
</div>
</div>
</div>
<div class="wechat-block">
<div>
<div class="flex">
<div>玩家心得({{ editForm.activityExperienceDTOs.length }})</div>
<div class="sprite-icon icon-arrow"></div>
</div>
<div v-if="editForm.activityExperienceDTOs.length">
<div class="head-box">
<img class="icon-head" src="@/assets/seckillActivity/icon-default-head.png" />
<span>虚拟人物1</span>
</div>
<div class="m-t-10">{{ editForm.activityExperienceDTOs[0].experience }}</div>
<div v-if="editForm.activityExperienceDTOs[0].activityExperienceImgs.length">
<img class="img-w-h m-t-10" v-for="(item, index) in editForm.activityExperienceDTOs[0].activityExperienceImgs" :key="index" :src="item" />
</div>
</div>
</div>
<div class="line"></div>
<div v-if="editForm.activityCommoditys.length">
<div class="flex m-b-10">
<div>商品答疑({{ editForm.activityCommoditys.length }})</div>
<div class="sprite-icon icon-arrow"></div>
</div>
<div class="m-b-10">
<span class="icon-question">问</span>
<span>{{ editForm.activityCommoditys[0].question }}</span>
</div>
<div>
<span class="icon-answer">答</span>
<span>{{ editForm.activityCommoditys[0].answer }}</span>
</div>
</div>
</div>
<div class="p-b-6"></div>
<div v-html="editForm.activityDetail"></div>
</div>
</div>
<div>
<img class="wechat-footer" src="@/assets/seckillActivity/crowd-footer.png" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'crowdEditWechat',
data() {
return {}
},
props: {
editForm: {
type: Object,
default: () => { }
},
countDownObj: {
type: Object,
default: () => { }
}
},
mounted() { },
methods: {}
}
</script>
<style lang="scss" scoped>
.wechat-box {
width: 276px;
box-sizing: border-box;
position: relative;
margin: 0 auto;
}
.wechat-box .wechat-inner-box {
position: absolute;
top: 73px;
left: 20px;
width: 236px;
height: 424px;
background-color: #f7f8fa;
overflow-y: scroll;
overflow-x: hidden;
}
.wechat-box .wechat-footer {
position: absolute;
width: 236px;
height: 35px;
bottom: 20px;
left: 20px;
}
.wechat-box .wechat-head {
position: absolute;
width: 236px;
height: 53px;
top: 20px;
left: 20px;
}
.wechat-box .wechat-banner-img {
width: 100%;
height: 552px;
}
.wechat-box .icon-server {
position: absolute;
width: 34px;
height: 42px;
top: 320px;
right: 30px;
z-index: 999;
}
.wechat-box .wechat-banner-img img {
width: 100%;
height: 385px;
}
.wechat-box .wechat-video {
width: 160px;
height: 90px;
margin: 10px auto;
}
.wechat-box .wechat-banner-img .icon-music {
position: absolute;
width: 20px;
height: 20px;
top: 20px;
right: 10px;
}
.wechat-box .wechat-banner-img .wechat-customer {
position: absolute;
width: 100px;
height: 137px;
top: 240px;
left: 10px;
}
.wechat-box .wechat-banner-img {
.wechat-block-title {
text-align: center;
color: #fc5b32;
}
.wechat-block {
box-sizing: border-box;
background-color: #fff;
width: 205px;
font-size: 14px;
padding: 10px;
margin: 10px 12px;
.wechat-sub-addr {
font-size: 12px;
color: #656566;
}
.wechat-time {
font-size: 12px;
color: #fc5b32;
}
.icon-addr {
width: 34px;
height: 34px;
}
.wechat-count-down {
line-height: 22px;
padding: 15px;
border: 1px dotted #e3e3e3;
margin-top: 10px;
}
.wechat-txt {
color: #f13c3d;
background-color: #fff4f4;
padding: 4px;
margin: 0 4px;
}
.count-down-img {
margin-top: 10px;
width: 180px;
height: 188px;
}
}
}
.wechat-box .wechat-banner-img .crowd-jdt {
width: 205px;
height: 80px;
}
.box {
color: #999999;
font-size: 12px;
font-weight: 400;
border-radius: 4px;
line-height: 17px;
.serve-text {
width: 130px;
color: #2c2c2c;
margin-left: 6px;
overflow: hidden;
white-space: nowrap;
span {
margin: 0 4px;
}
}
.sprite-icon {
margin-left: auto;
}
}
.icon-arrow {
width: 6px;
height: 6px;
border: 1px solid #fc5b32;
border-width: 1px 1px 0 0;
opacity: 0.7;
transform: rotate(45deg);
margin: 6px 0 0 5px;
}
.head-box {
display: flex;
align-items: center;
padding: 20px 0 0 0;
color: #282829;
.icon-head {
width: 26px !important;
height: 26px !important;
margin-right: 4px;
}
}
.img-w-h {
width: 30px !important;
height: 30px !important;
margin-right: 2px;
border-radius: 4px;
}
.line {
border: 1px solid #e3e3e6;
margin: 6px 0;
}
.icon-question {
width: 14px;
height: 14px;
font-size: 12px;
background: linear-gradient(108deg, #ffbe68 0%, #ff5446 60%, #f45454 100%);
border-radius: 2px;
color: #ffffff;
padding: 1px 2px;
margin-right: 4px;
}
.icon-answer {
width: 14px;
height: 14px;
font-size: 12px;
background: linear-gradient(108deg, #4f7bf6 0%, #3d6ced 60%, #3162e6 100%);
border-radius: 2px;
color: #ffffff;
padding: 1px 2px;
margin-right: 4px;
}
.p-b-6 {
padding-bottom: 6px;
}
.wechat-box .wechat-name {
position: absolute;
top: 50px;
left: 58px;
width: 138px;
color: #282829;
z-index: 99;
text-align: center;
}
</style>
<template>
<div class="select-staff">
<!-- class="staffDailog" -->
<GLDialog bigTitle="选择员工"
mode="big"
width="600px"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
<span slot="footer">
<el-button :size="size"
type="primary"
@click="getList">查询</el-button>
</span>
</glsx-combi-form>
<!-- :pageConf="pageConf" -->
<GLTable ref="staffRef"
:hasPage="false"
:hasNum="false"
:noDataImg="url"
:tableData="staffList"
:tableTotal="total"
:tableParams="tableParams"
@refreshTable="getList"
:setTableFinishFun="setTableFinishFun">
<div slot="radioHtml"
class="staff-table"
slot-scope="scope">
<el-radio v-model="staffUuid"
:label="scope.scope.uuid"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
</GLTable>
<!-- <span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span> -->
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectStaff',
data() {
return {
url: url,
searchForm: {
name: ''
},
total: 0,
staffList: [],
heightBox: 200,
staffUuid: '',
// 搜索
searchFormData: [
{
label: '员工',
name: 'name',
type: 'input',
placeholder: '请输入员工名称',
width: '300px',
labelWidth: '10px'
}
],
// 表格
// getListApi: this.$apis.common.getstaffTreeListApi,
tableParams: {
listName: 'staffUnitList',
// 行数据的key
// mutiSelectUniqueKey: 'staffId',
// checkSelectKey: 'staffId',
// checkSelectVal: [],
// 多选ref的名称
// mutiSelectName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '序号',
prop: 'idx',
width: 80
},
{
label: '员工姓名',
prop: 'staffName',
formatter: cellValue => {
return cellValue.staffName || '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
selectedstaffUuid: {
type: String
},
merchantId: {
type: String,
required: true
},
orderCode: {
type: String,
required: true
}
},
mounted() {
// this.userInfo = this.$globalState.session
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.staffUuid = this.selectedstaffUuid
this.getList()
},
methods: {
getList() {
var params = {
merchantId: this.merchantId,
// merchantId: '44209390',
...this.searchForm
}
this.$apis.common.getMerchantStaff(params).then(res => {
console.log(res)
this.staffList = res
// this.staffList = res.staffUnitList
// this.total = res.total
// var page = this.$refs.staffRef.page
// // 添加序号
this.staffList.forEach((item, index) => {
item.idx = index + 1
})
this.$refs.staffRef.tableHeightValues = '460px'
})
},
setTableFinishFun() {
this.staffList = this.$refs.staffRef.data
//接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px'
},
handleClick(val) {
console.log(val)
// let temp = JSON.parse(JSON.stringify(val))
// delete temp.idx
// this.staffUuid = val.uuid
},
handleClose() {
// console.log('handleStoreClose')
this.$emit('handleStaffClose')
},
handleConfirm() {
if (!this.staffUuid)
return this.$message({
message: '请先选择员工',
type: 'error'
})
let parmas = {
subOrderCode: this.orderCode,
staffUuid: this.staffUuid
}
this.$apis.orderManage.signerOrder(parmas).then(res => {
console.log(res)
this.$emit('handleStaffConfirm', this.staffUuid)
})
}
}
}
</script>
<style lang="scss">
.select-staff {
.staffDailog {
width: 500px;
}
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.staff-table .el-radio__label {
display: none;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!