Commit 0ff15fd0 by 前端

Merge branch 'v3.20.0' into 'master'

V3.20.0

See merge request !1
2 parents 4842baf4 81d2e265
Showing 64 changed files with 3928 additions and 0 deletions
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
VUE_APP_PORT = 6658
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file
{
"root": true,
"env": {
"node": 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": "mallconfig",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.2",
"lodash": "^4.17.21",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
"wangeditor": "^4.7.12"
},
"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">
<meta name="referrer" content="no-referrer">
<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}`)
\ No newline at end of file
<template>
<div id="app">
<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 {
// background: #f4f5fa;
// padding: 0px 20px 20px 20px !important;
// position: absolute;
// box-sizing: border-box;
// width: 100%;
// top: 0px;
// left: 0px;
// overflow-y: auto;
// height: 100%;
// }
// 分页全局
.pagination_box {
display:flex;
justify-content: flex-end;
}
</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
import { http, http_brand } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.'
const getUserInfoApi = params => {
params.method = 'scrm.api.equity.common.merchant.current.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getCountNoDataApi = params => {
params.method = `${defaultPath}count.unDataEffective`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getListApi = params => {
params.method = `${defaultPath}order.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取门店
const getMerchantApi = params => {
params.method = 'scrm.api.equity.common.under.merchant.list.det'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getExportApi = params => {
params.method = `scrm.api.equity.service.package.dj.order.export.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 打印合同
const getPriteApi = params => {
params.method = `scrm.api.equity.service.package.dj.order.print`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarBrandListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getCarBrandList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarChildListApi = params => {
// params.method = 'dj.api.car.series.list'
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http_brand({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getHotlineApi = params => {
// params.method = `${defaultPath}merchant.hotline.get`
params.method = `scrm.api.equity.service.package.merchant.config.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getDefaultCarbrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.detail'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateCarBrandApi = params => {
params.method = 'scrm.api.equity.service.merchant.vehicle.default.insert.or.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取产品名称(套餐名称)
const getProListApi = params => {
params.method = `${defaultPath}select.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取无忧卡套餐列表
const getPackageListApi = params => {
params.method = `scrm.api.equity.service.package.dj.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getEquityApi = params => {
params.method = `scrm.api.equity.service.channel.order.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquityApi = params => {
params.method = `scrm.api.equity.service.channel.order.insert.or.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取合同号
const createCodeApi = params => {
params.method = `${orderPath}code.create`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取套菜附件属性
const getOrderAttrApi = params => {
params.method = `${defaultPath}order.attachment.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取套菜附件属性
// const getOrderValueApi = params => {
// params.method = `${defaultPath}order.attachment.value.get`
// return http({
// url: 'rop-scrm-equity/router',
// method: 'GET',
// data: params,
// sign: true
// })
// }
const getAllOrderValueApi = params => {
params.method = `${defaultPath}order.attachments.value.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 校验
const verifyOrderApi = params => {
params.method = 'scrm.api.equity.service.order.verify'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 车架号
const checkOrderApi = params => {
params.method = 'scrm.api.equity.service.order.check'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新套菜附件属性
const updateOrderApi = params => {
params.method = `${orderPath}attachment.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const uploadImgApi = params => {
params.method = 'scrm.api.equity.common.upload.image'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
// 退保
const backOrderApi = params => {
params.method = `scrm.api.equity.service.channel.order.charge.back`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 审核
const aduitOrderApi = params => {
params.method = `${orderPath}aduit`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 是否开通配置
const judgeSetting = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取特别约定
const spaAgressData = params => {
params.method = 'scrm.api.equity.service.spa.list.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 店铺信息
const merchantInfo = params => {
params.method = 'scrm.api.equity.common.merchant.detail.det'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 卡号---获取期限
const dateBycarNo = params => {
params.method = 'scrm.api.equity.service.cfc.get.by.seqno'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取活码列表-
const activeCodeList = params => {
params.method = 'entmicro.api.code.getFreeChannelCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新活码
const updateActiveCode = params => {
params.method = 'scrm.api.equity.service.merchant.qrcode.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取汇总订单列表
const getOrdersummary = params => {
params.method = 'scrm.api.equity.service.order.summary.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取汇总产品列表
const getSummaryPackage = params => {
params.method = 'scrm.api.equity.service.summary.package'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getSummaryExportApi = params => {
params.method = `scrm.api.equity.service.order.summary.export`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getOrdersummary, getSummaryPackage, getSummaryExportApi, getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo, activeCodeList, updateActiveCode }
import { http, http_common } from '@/main'
const defaultPath = 'scrm.api.live.'
const getGoodsList = params => {
params.method = 'scrm.api.shopmall.goods.page.curMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const uploadImg = params => {
params.method = `${defaultPath}wechat.upload.image`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getMerchantList = params => {
params.method = `${defaultPath}get.merchant.list`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getZoneList = params => {
params.method = `${defaultPath}get.zone.list`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
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 uploadFileApi = (params, callback) => {
params.method = 'scrm.api.equity.common.upload.common.multiple'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true,
onUploadProgress: res => {
callback(res)
}
})
}
export default { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload, uploadFileApi }
import { http, http_brand, request_merchant } from '@/main'
const getExpertList = params => {
params.method = 'entmicro.api.operation.page'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getDepartment = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const saveExpert = params => {
params.method = 'entmicro.api.operation.save'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const delExpert = params => {
params.method = 'entmicro.api.operation.delete'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const editExpert = params => {
params.method = 'entmicro.api.operation.update'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const expertDetail = params => {
params.method = 'entmicro.api.operation.detail'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getMenberType = params => {
params.method = 'merchants.api.menu.findAllDictData'
return request_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getOtherNumber = params => {
params.method = 'entmicro.api.code.getCodeStaffList'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getExpertList, getDepartment, saveExpert, delExpert, editExpert, expertDetail, getMenberType, getOtherNumber }
import { other_http } from '@/main'
const url = 'rop-scrm-coupon/router'
const defaultPath = 'scrm.api.coupon.'
/**商品分页查询*/
const getCouponsList = params => {
params.method = `${defaultPath}equity.list.merchant`
return other_http({
url,
data: params
})
}
const createCoupons = params => {
params.method = `${defaultPath}equity.batch.create`
return other_http({
url,
data: params
})
}
const getExportApi = params => {
params.method = `${defaultPath}equity.list.merchant.export`
return other_http({
url,
data: params,
sign: true
})
}
//领取记录列表
const getListReceiveRecordApi = params => {
params.method = `${defaultPath}listReceiveRecordByCouponId`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
//查看优惠券
const getCouponDetailApi = params => {
params.method = `${defaultPath}detail`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
//删除
const deleteCouponApi = params => {
params.method = `${defaultPath}delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 优惠券-作废
const couponUserCancelApi = params => {
params.method = `${defaultPath}user.cancel`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const detailExportApi = params => {
params.method = `${defaultPath}equity.exportReceiveRecord`
return other_http({
url,
data: params,
sign: true
})
}
//生效/失效
const effectiveCouponApi = params => {
params.method = `${defaultPath}effective`
return other_http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取模板配置
const getTemplateList = params => {
params.method = `${defaultPath}template.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板配置
const saveTemplate = params => {
params.method = `${defaultPath}template.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 保存模板下的优惠券
const saveCouponInfo = params => {
params.method = `${defaultPath}template.details.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板下的优惠券列表
const getCouponById = params => {
if(!params.templateId) {
return new Promise((resolve, reject)=>{
reject()
})
};
params.method = `${defaultPath}template.details.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delCouponById = params => {
params.method = `${defaultPath}template.details.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delTemplateById = params => {
params.method = `${defaultPath}template.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCouponsList,
createCoupons,
getExportApi,
getListReceiveRecordApi,
getCouponDetailApi,
deleteCouponApi,
couponUserCancelApi,
detailExportApi,
effectiveCouponApi,
getTemplateList,
saveTemplate,
saveCouponInfo,
getCouponById,
delCouponById,
delTemplateById
}
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.platform.goods.'
const url = 'rop-scrm-shopmall/router'
// 获取平台商品分类
const getCategoryListApi = params => {
params.method = `${defaultPath}category.list`
return http({
url,
data: params,
sign: true
})
}
// 分页查询选品库商品
const getGoodsListApi = params => {
params.method = `${defaultPath}list`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量入库
const addWarehouseApi = params => {
params.method = `${defaultPath}batch.add`
return http({
url,
data: params,
sign: true
})
}
// 分页查询仓库/销售中商品
const getListApi = params => {
params.method = `${defaultPath}stockroom.page`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量移出仓库
const batchRemoveApi = params => {
params.method = `${defaultPath}stockroom.batch.remove`
return http({
url,
data: params,
sign: true
})
}
// 平台商品批量上架销售
const batchSaleApi = params => {
params.method = `${defaultPath}stockroom.batch.sale`
return http({
url,
data: params,
sign: true
})
}
// 商品详情
const goodsDetailApi = params => {
params.method = `scrm.api.shopmall.stockroom.goods.detail`
return http({
url,
data: params,
sign: true
})
}
export default {
getCategoryListApi,
getGoodsListApi,
addWarehouseApi,
getListApi,
batchRemoveApi,
batchSaleApi,
goodsDetailApi
}
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
const defaultPath = 'scrm.api.shopmall.strategy.'
// 分页攻略列表
const getListApi = params => {
params.method = `${defaultPath}list`
return http({
url,
data: params,
sign: true
})
}
// 修改是否在首页展示flag
const updateMainFlagApi = params => {
params.method = `${defaultPath}main.flag.update`
return http({
url,
data: params,
sign: true
})
}
// 分页攻略埋点列表
const getburialPointListApi = params => {
params.method = `${defaultPath}records`
return http({
url,
data: params,
sign: true
})
}
// 删除攻略
const delStrategyApi = params => {
params.method = `${defaultPath}delete`
return http({
url,
data: params,
sign: true
})
}
// 置顶攻略
const topStrategyApi = params => {
params.method = `${defaultPath}top.set`
return http({
url,
data: params,
sign: true
})
}
// 导出埋点数据
const exportListApi = params => {
params.method = `${defaultPath}records.export`
return http({
url,
data: params,
sign: true,
returnAll: true
})
}
// 新增攻略
const addStrategyApi = params => {
params.method = `${defaultPath}insert.or.update`
return http({
url,
data: params,
sign: true
})
}
// 攻略详情
const getStrategyDetailApi = params => {
params.method = `${defaultPath}detail`
return http({
url,
data: params,
sign: true
})
}
export default {
getListApi,
updateMainFlagApi,
getburialPointListApi,
delStrategyApi,
topStrategyApi,
exportListApi,
addStrategyApi,
getStrategyDetailApi
}
\ No newline at end of file
$theme_color: #5850ff;
$theme_bg_color: #5850ff;
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
.left{float:left}.right{float:right}.align-right{text-align:right}
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 4px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
.h1_title {
font-size: 42px;
font-weight: 500;
color: #000000;
}
.h2_title {
font-size: 24px;
font-weight: 500;
color: #000000;
}
.h3_title {
font-size: 18px;
font-weight: 600;
color: #333333;
height: 18px;
}
.h4_title {
font-size: 16px;
font-weight: 400;
color: #666666;
}
.h5_title {
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
}
.h6_title {
font-size: 16px;
font-weight: 500;
color: #3a3a3a;
}
.h7_title {
font-size: 14px;
font-weight: 500;
color: #333333;
}
.h8_title {
font-size: 24px;
font-weight: 600;
color: #3a3a3a;
}
.h9_title {
font-size: 14px;
font-weight: 400;
color: #666666;
}
.h10_title {
font-size: 12px;
font-weight: 400;
color: #3a3a3a;
}
.h11_title {
font-size: 14px;
font-weight: 500;
color: #000000;
}
.h12_title {
font-size: 14px;
font-weight: 400;
color: #888888;
}
.h13_title {
font-size: 14px;
font-weight: 400;
color: #333333;
}
.h14_title {
font-size: 14px;
font-weight: 400;
color: #37383a;
}
.h15_title {
font-size: 14px;
font-weight: 500;
color: #5850ff;
}
.h16_title {
font-size: 12px;
font-weight: 500;
color: #5850ff;
}
.h17_title {
font-size: 12px;
font-weight: 400;
color: #333333;
}
.h18_title {
font-size: 14px;
font-weight: 500;
color: #333333;
}
.h19_title {
font-size: 14px;
font-weight: 500;
color: #666666;
}
.h20_title {
font-size: 12px;
font-weight: 400;
color: #666666;
}
.h21_title {
font-size: 16px;
font-weight: 600;
color: #333333;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_sc {
display: flex;
align-items: center;
}
.flex_ccc {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.equity-wrap .contain {
background: #ffffff;
margin: 0 0 20px 0;
padding: 20px;
// box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
}
.equity-wrap .contain .el-table__empty-text {
display: inline-block;
width: 64px;
height: 41px;
}
.fr-mr0 {
float: right;
margin-right: 0px !important;
}
// 单行省略
.ellipsis-1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* for Opera */
}
.mb10 {
margin-bottom: 10px;
}
// 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。
.ellipsis-2 {
overflow: hidden;
height: 40px;
line-height: 20px;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*显示的行数*/
}
.ellipsis-2-text:after {
content: '...';
position: absolute;
bottom: 0;
right: 15px;
padding-left: 20px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
/*我在Safari上测试时发现透明到白色中间会有一个黑色的过渡后来我就写成-webkit-linear-gradient(left,rgba(255,255,255,0),rgba(255,255,255,1) 55%)*/
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
.el-scrollbar__bar.is-horizontal {
height: 10px !important;
left: 10px;
}
.base-container-right .el-main-scroll .el-scrollbar__thumb {
background-color: rgba(144, 147, 153, 0.5) !important;
}
.equity-wrap .el-table .cell {
line-height: 16px;
}
.equity-wrap .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
.equity-wrap .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
.equity-wrap .img-60 {
width: 60px;
height: 60px;
}
.equity-wrap .edit-container {
margin: 20px 40px 84px;
}
.equity-wrap .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.equity-wrap .flex {
display: flex;
justify-content: space-between;
}
.equity-wrap .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
// color: #0947C6;
border-bottom: 1px solid #e7eaec;
// padding-left: 20px;
margin: 0 0;
}
.equity-wrap .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947c6;
}
.equity-wrap .edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
}
// .app {
// background: #f4f5fa;
// padding: 0px 0 20px 0;
// position: absolute;
// box-sizing: border-box;
// width: 100%;
// top: 0px;
// left: 0px;
// overflow-y: auto;
// height: 100%;
// }
.el-cascader-menu {
max-height: 250px;
}
.primary_plain_btn {
.el-button--primary.is-plain {
color: #5850ff;
background-color: #fff;
border-color: #5850ff;
}
.el-button--primary.is-plain:hover {
color: #7973ff;
background-color: #fff;
border-color: #7973ff;
}
.el-button--primary.is-plain:active {
color: #3a32e1;
background-color: #fff;
border-color: #3a32e1;
}
}
.el-loading-mask {
.el-loading-spinner {
.el-icon-loading,
.el-loading-text {
color: #5850ff;
}
}
}
.page-btm-btn {
display: flex;
justify-content: center;
margin-top: 16px;
}
.el-message.msgHierarchy {
z-index: 5000 !important;
}
.el-popover.imgPopper {
.el-form-item {
margin: 0 !important;
}
}
.operate-wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table-title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate-btn {
.export-btn {
margin-left: 8px;
}
}
}
.global-title-wrap {
height: 48px;
background: #fff;
border-bottom: 1px solid #EEEDFF;
border-radius: 4px 4px 0 0;
.title {
&:first-child {
border-left: unset !important;
}
display: inline-block;
box-sizing: border-box;
height: 48px;
line-height: 48px;
padding: 0 32px;
font-weight: 400;
font-size: 16px;
color: #37383A;
border-radius: 4px 4px 0 0;
margin-right: 2px;
border-top: 1px;
border-left: 1px;
border-right: 1px;
border-style: solid;
border-color: #EEEDFF;
background: #FAFAFA;
text-align: center;
cursor: pointer;
}
.curTitleCla {
font-weight: 600;
height: 49px;
color: #5850FF;
background-color: #fff;
border-bottom: 1px solid #fff;
}
}
.global-title {
height: 56px;
line-height: 56px;
border-bottom: 1px solid #e5e5e5;
padding-left: 20px;
box-sizing: border-box;
font-size: 16px;
color: #333333;
font-weight: 600;
background-color: #fff;
}
\ No newline at end of file
/**
* 根据路由匹配地址
* @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
File mode changed
/**
* 时间控件-限制月份
*/
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>
<GLDialog :bigTitle="bigTitle" :title="title" :mode="mode" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :width="width">
<span slot="title">
{{ title }}
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button type="primary" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button>
<el-button v-if="!noCancel" :size="btnSize" @click="handleClose">取消</el-button>
<slot name="btn-middle"></slot>
</div>
</GLDialog>
</div>
</template>
<script>
export default {
name: 'glsx-dialog',
data() {
return {}
},
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: true
},
btnOkLabel: {
type: String,
default: '确定'
},
noCancel: {
type: Boolean,
default: false
},
width: {
type: String,
default: '580px'
},
btnSize: {
type: String,
default: 'small'
},
mode:{
type: String,
default: 'mid'
},
bigTitle:{
type: String,
default: ''
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
<template>
<div>
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input
ref="input_from"
v-model="formData[keyObj.from]"
:disabled="disabled"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
placeholder=""
@input="handleInputChangeFrom"
></el-input>
</div>
<div class="center">
<span>至</span>
</div>
<div class="to">
<el-input
ref="input_to"
v-model="formData[keyObj.to]"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
:disabled="disabled"
placeholder=""
@input="handleInputChangeTo"
></el-input>
</div>
<div class="unit">
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InputNumberRange',
props: {
// 是否禁用
disabled: {
type: Boolean,
default: false
},
formData:{
type: Object,
default: ()=>{
return {}
}
},
keyObj:{
type: Object,
default: ()=>{
return {
from: 'a',
to: 'b'
}
}
},
},
data() {
return {
}
},
methods: {
// from输入框change事件
handleInputChangeFrom(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
// to输入框change事件
handleInputChangeTo(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
}
}
</script>
<style lang="scss" scoped>
.input-number-range {
background-color: #fff;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.flex {
display: flex;
flex-direction: row;
width: 100%;
justify-content: center;
align-items: center;
/deep/ .el-input .el-input__inner {
border: 0px;
margin: 0;
padding: 0 10px;
background-color: transparent;
}
.center {
margin-top: 1px;
}
.unit{
margin-right: 10px;
}
}
.is-disabled {
background-color: #eef0f6;
border-color: #e4e7ed;
color: #c0c4cc;
cursor: not-allowed;
}
</style>
\ No newline at end of file
<template>
<div class="activity-img-box">
<template v-if="imageUrlArr && imageUrlArr.length > 0">
<div v-for="(item, index) in imageUrlArr" :key="index">
<div class="pic-box" :style="{ width: picOptions.width, height: picOptions.height }">
<img class="photo-activity" :src="item" alt="" />
<div class="mask" :style="{ width: picOptions.width, height: picOptions.height }">
<div class="pic-pane-close" @click="handleEnlarge(item)">
<img src="../../assets/images/view.png" alt="" />
</div>
<template v-if="picOptions.isClose">
<div class="pic-pane-close" @click="close('img', index)">
<img src="../../assets/images/dele.png" alt="" />
</div>
</template>
</div>
</div>
</div>
</template>
<template v-if="(imageUrlArr && imageUrlArr.length < 9 && limit > 1) || (imageUrlArr&&imageUrlArr.length == 0 && limit == 1)">
<div class="upload-img">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" ref="uploadImg" class="upload-img" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div>
</template>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog>
</div>
</template>
<script>
export default {
props: {
picOptions: {
type: Object,
default: () => {
return {
width: '104px',
height: '104px',
isClose: true
}
}
},
imageUrlArr: {
type: Array,
default: () => []
},
limit: {
type: String,
default: '1'
},
index: {
type: Number,
default: -1
}
},
data() {
return {
dialogVisibleImg: false
}
},
methods: {
// 上传图片
handleImgChange(e) {
this.$notify({
title: '提示',
message: '图片上传中,请稍后'
})
var file = e.srcElement.files[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
}
if (this.imageUrlArr.length > 9) {
this.$message.error('最多上传9张图片')
return
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 }).then(res => {
if (res) {
this.$notify({
title: '提示',
message: '图片上传成功',
type: 'success'
})
this.imageUrlArr.push(res)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, index: this.index })
}
e.target.value = ''
this.$refs.uploadImg.value = ''
})
}
},
// 预览图文
handleEnlarge(src, type) {
this.dialogVisibleImg = true
this.dialogSrc = src
this.dialogType = type ? type : 'img'
},
// 删除图片/视频
close(type, index) {
switch (type) {
case 'radio':
this.videoUrl = ''
this.videoImage = ''
break
case 'img':
this.imageUrlArr.splice(index, 1)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, id: 1, index: this.index })
break
default:
this.videoUrl = ''
}
}
}
}
</script>
<style scoped lang="scss">
.activity-img-box {
display: flex;
flex-wrap: wrap;
max-width: 600px;
.pic-box {
position: relative;
width: 104px;
height: 104px;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 5px;
&:hover .mask {
opacity: 1;
}
.pic {
position: absolute;
object-fit: fill;
}
.photo-activity {
position: absolute;
width: 100%;
height: 100%;
}
.mask {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
opacity: 0;
top: 0;
right: 0;
width: 104px;
height: 104px;
z-index: 999;
.pic-pane-close {
width: 16px;
height: 16px;
cursor: pointer;
margin-left: 24px;
&:first-child{
margin-left: 0;
}
img{
width:100%;
display: block;
}
}
}
}
.upload-img {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 104px;
height: 104px;
background: rgba(0, 0, 0, 0.04);
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
input {
position: absolute;
// top: 0;
// left: 0;
width: 104px;
height: 104px;
}
}
.avatar-uploader-desc-word {
font-weight: 400;
font-size: 28rpx;
color: #666666;
}
.image-dialog {
/deep/ {
.el-dialog__header {
border-bottom: 0px;
padding: 0px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="qr-code-components">
<div :style="[{ bottom: bottom + 'px' }]" @mousedown="move" @mouseup="moveEnd" ref="callCenter" @mouseenter="show = true" @mouseleave="show = false" class="right_btn flex_ccc">
<img src="../../assets/contact_icon.png" />
<div class="contact_text">联系我们</div>
<div v-if="show" class="left_code flex_ccc">
<img :src="codeUrl" />
<div style="height: 16px"></div>
<span class="h18_title">{{phoneTitle}}</span>
<span class="h18_title">{{ phone }}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
props: {
bottom: {
type: Number,
default: 64
},
codeUrl: {
type: String,
default: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/qrcode2.jpg'
},
phone: {
type: String,
default: '189 0000 1234'
},
phoneTitle:{
type:String,
default:'服务热线'
}
},
data() {
return {
show: false
}
},
methods: {
// 拖动窗口,鼠标按下
move(event) {
// 给对应div添加拖拽属性
let callCenter = this.$refs.callCenter
callCenter.style.cursor = 'move'
var distanceX = event.clientX - callCenter.offsetLeft
var distanceY = event.clientY - callCenter.offsetTop
// 获取按下时对应的坐标
this.startX = event.pageX
this.startY = event.pageY
document.onmousemove = function (ev) {
var oevent = ev || event
// 加入判断,让浮窗在限定的页面内可拖动
if (ev.clientX < 40 || ev.clientX > document.body.clientWidth - 30) {
return
}
if (ev.clientY < 40 || ev.clientY > document.body.clientHeight - 30) {
return
}
callCenter.style.left = oevent.clientX - distanceX + 'px'
callCenter.style.top = oevent.clientY - distanceY + 'px'
}
document.onmouseup = function () {
document.onmousemove = null
document.onmouseup = null
callCenter.style.cursor = 'default'
}
},
// 鼠标抬起触发
moveEnd(event) {
// 获取鼠标抬起时的坐标
this.endX = event.pageX
this.endY = event.pageY
// 计算按下与抬起位置差值
var d = Math.sqrt((this.startX - this.endX) * (this.startX - this.endX) + (this.startY - this.endY) * (this.startY - this.endY))
if (d === 0 || d < 7) {
// console.log('执行了点击事件')
} else {
// console.log('执行了拖拽事件')
}
}
}
}
</script>
<style lang="scss" scoped>
.qr-code-components {
.left_code {
position: absolute;
right: 57px;
bottom: 0px;
width: 144px;
height: 201px;
background: #ffffff;
z-index: 88;
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 8px rgba(0, 0, 0, 0.05);
> img {
width: 124px;
height: 124px;
}
> span {
line-height: 20px;
}
}
.right_btn {
position: fixed;
right: 20px;
bottom: 64px;
cursor: pointer;
width: 52px;
height: 201px;
background: #5850ff;
border-radius: 4px;
z-index: 88;
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 8px rgba(0, 0, 0, 0.05);
> img {
width: 20px;
height: 20px;
margin-bottom: 7px;
}
.contact_text {
width: 14px;
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #ffffff;
}
}
}
</style>
<template>
<glsx-dialog bigTitle="选择商户" mode="big" :isVisible.sync="relateStoreVisible" width="70%" btnOkLabel="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="12">
<el-table ref="seletingTable" class="table hightline" :data="selectingData" height="464px" @select="handleChange" @select-all="handleAll">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
</el-table>
<el-pagination small background @current-change="handleCurrentChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-col>
<el-col :span="12">
<el-table :data="selectedData" class="table hightline" height="464px">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
<el-table-column align="center" width="100">
<template slot="header">
<el-link :underline="false" icon="el-icon-delete" @click="batchDelete">批量删除</el-link>
</template>
<template slot-scope="scope">
<el-button style="padding: 0" class="el-icon-delete" @click="handleDelete(scope.row)" type="text"></el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'relateStoreDialog',
data() {
return {
merchantIds: [],
selectedData: [],
selectingData: [],
// needTip: ['editProduct'],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components: {
glsxDialog
},
mounted() {
this.selectedData = this.storeSelected
this.selectedData.forEach(item => {
item.merchantNo = item.merchantId ? item.merchantId + '' : item.merchantNo
})
this.getSelectingList()
},
methods: {
batchDelete() {
console.log('1')
this.selectedData = []
this.recoverySelection()
},
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantNo + '')
console.log(this.selectingData)
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantNo + '')) {
this.$refs.seletingTable.toggleRowSelection(item, true)
} else {
this.$refs.seletingTable.toggleRowSelection(item, false)
}
})
},
getSelectingList() {
var params = JSON.parse(JSON.stringify(this.storeSearchForm))
if (this.storeSearchForm.select == 1) {
params.merchantName = this.storeSearchForm.selectInput
params.merchantId = ''
} else {
params.merchantId = this.storeSearchForm.selectInput
params.merchantName = ''
}
this.storeApi({
...params,
pageNum: this.pageNum,
currentPage: this.pageNum,
pageSize: this.pageSize
}).then(res => {
console.log(res)
if (res.code == '33') {
this.$message.error('请正确输入商户号')
}
this.selectingData = res.data.list
for (var a = 0; a < this.selectingData.length; a++) {
this.selectingData[a].merchantNo = this.selectingData[a].merchantId + ''
}
this.total = res.data.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
},
handleAll(selection) {
console.log(selection, '112112')
// this.selectedData=[]
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1) {
console.log(item)
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
this.recoverySelection()
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true,
customClass: 'message-Z-zinde'
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style>
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
/* .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
} */
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
\ No newline at end of file
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="getList(true)">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="mutiProRef" :tableData="productList" :searchForm="searchForm" :tableParams="tableParams" @refreshTable="getList">
<span slot="coverImgUrl" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.coverImgUrl" />
</span>
</GLTable>
</glsx-dialog>
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
size: 'small',
// 表格组件
// getListApi: getGoodsList,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'name'
},
{
label: '缩略图',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price1',
formatter: cellValue => {
return cellValue.price2 && cellValue.price1 != cellValue.price2 ? (cellValue.price1 / 100).toFixed(2) + '-' + (cellValue.price2 / 100).toFixed(2) : (cellValue.price1 / 100).toFixed(2)
}
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
},
getListApi: {
type: Function,
default: () => {}
},
searchForm: {
type: Object,
default: () => {}
}
},
components: {
glsxDialog
},
mounted() {
this.getList(true)
},
methods: {
getList(isMounted = false) {
var params = {
// goodsStatus: 1,
// goodsSource: 1,
...this.searchForm,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
this.getListApi(params).then(res => {
// console.log(res)
this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total
this.recoverySelected()
})
},
handleReset() {
this.searchForm.name = ''
this.getList()
},
recoverySelected() {
if (this.selectedProList.length) {
this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
<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','video']
},
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.pasteIgnoreImg = true
// this.editor.config.uploadImgHooks = {
// before: (xhr, editer, files) => {
// if(files[0].name === 'image.png') {
// return {
// prevent: true,
// msg: '请您将截图以上传图片的方式显示在文本框中!'
// }
// }
// }
// }
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>
\ No newline at end of file
/*
* @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-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
// baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/',
// baseURL: 'http://scrm.test.glsx.com.cn/',
baseURL: 'http://192.168.2.60:7226/rop-scrm-equity/router',
// 设置超时时间
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-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
app_key: '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: limin
* @LastEditTime: 2021-09-07 14:38:52
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
let timeout = 30000 //超时时间
import { Http } from 'glsx-common'
export const fetchConfig = function(isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/63b39b3e606e962c5e174afb/discover/config')
return new Http().get('https://oss-config.glsx.com.cn/mock/63c12a6b28a427953783403e/discover/config')
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:31
* @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 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const other_http = params => Vue.prototype.$other_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, Progress, Timeline, TimelineItem, Dropdown, DropdownMenu, Rate, Image, Drawer, Popover, Row } 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)
Vue.use(Progress)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(Rate)
Vue.use(Image)
Vue.use(Drawer)
Vue.use(Popover)
Vue.use(Row)
export const message = Message
export const messageBox = MessageBox
\ No newline at end of file
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 }
const staticRoutes = Object.freeze([
])
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 }
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: 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.$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, request_brand, sign, secret } = await fetchConfig()
var urlParams = {}
window.location.href.split('?').length > 1
? window.location.href
.split('?')[1]
.split('&')
.forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1]
})
: ''
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$http_brand = new Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$common = {
utils: utils
}
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: {}
}
let util = {}
util.dateFormat = function(dateTime, format = 'YYYY-MM-DD') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: appendZero(date.getMonth() + 1), //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: appendZero(date.getDate()),
HH: appendZero(date.getHours()),
mm: appendZero(date.getMinutes()),
ss: appendZero(date.getSeconds())
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
function appendZero(int) {
if (int < 10) {
return '0' + `${int}`
} else {
return int
}
}
util.decimal = function(num, fixed) {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
util.getLastDay = function(date) {
let current = new Date(date)
let currentMonth = current.getMonth()
let nextMoth = ++currentMonth
let nextMonthDayOne = new Date(current.getFullYear(), nextMoth, 1)
let minusDate = 1000 * 60 * 60 * 24
return new Date(nextMonthDayOne.getTime() - minusDate)
}
util.getDateStr = function(num) {
let now = new Date()
now.setDate(now.getDate() + num)
util.dateFormat(now)
// let y = now.getFullYear()
// let m = (now.getMonth() + 1) < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1)
// let d = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
// return y + "-" + m + "-" + d
return util.dateFormat(now)
}
util.getExplorer = function() {
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
}
export default util
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="global-title">基础信息</div>
<div class="main">
<glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px"
defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="coverSlot">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverArr"
@change="changeChannelImg"></glsx-preview>
</div>
<div slot="richTextSlot">
<textBox @change="writeChange" ref="textBox" @forbid="forbidEdit"></textBox>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import glsxCombiForm from '@/components/glsx-combi-form'
import textBox from '@/components/text-box'
import preview from '@/components/preview'
export default {
name: 'add',
data() {
return {
myRule: {
strategyName: [{required: true, message: '请输入攻略名称', trigger: 'change'}],
strategyImg: [{
required: true, validator: (rule, value, callback) => {
if (this.formObj.coverArr?.length != 1) {
callback(new Error(`请上传分类图标`))
} else {
callback()
}
}, trigger: 'change'
}],
content: [{required: true, message: '请输入攻略内容', trigger: 'change'}],
},
formObj: {
id: '',
coverArr: [],
strategyImg: '',
strategyName: '',
content: ''
},
formData: [
{
label: '攻略名称',
name: 'strategyName',
maxlength: 20,
showLimit: true,
type: 'input',
isDisabled: false
},
{
label: '攻略宣传图',
name: 'strategyImg',
addHtml: 'coverSlot'
},
{
label: '攻略内容',
addHtml: 'richTextSlot'
}
],
}
},
components: {
glsxCombiForm,
glsxPreview: preview,
textBox
},
created() {
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
console.log(this.routeInfo)
if(this.routeInfo.id) {
this.getDetail()
}
},
mounted() {
},
methods: {
writeChange(val) {
this.formObj.content = val
},
getDetail(){
this.$apis.strategy.getStrategyDetailApi({id: this.routeInfo.id}).then(res => {
if(res) {
console.log(res)
for(const key in this.formObj) {
if(key!='coverArr'){
this.formObj[key] = res[key]
}
}
this.$refs.textBox.setEdit(res.content)
this.formObj.coverArr = res.strategyImg ? [res.strategyImg] : []
}
})
},
handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if (valid) {
let params = utils.deepClone(this.formObj)
params.strategyImg = params.coverArr[0]
params.mainFlag = 1
if(!params.id) delete params.id
delete params.coverArr
this.$apis.strategy.addStrategyApi(params).then(res => {
console.log(res)
if(res) {
this.$message.success('操作成功')
this.handleCancel()
}
})
}
})
},
handleCancel() {
this.$router.back()
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
.main{
background-color: #fff;
padding: 32px 20px;
margin-bottom: 16px;
}
}
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div>
<div class="big-title">
攻略名称:{{strategyName || '--'}}
</div>
<div class="ctnr">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchFormObj" :formData="searchFormData">
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">已累计{{searchFormObj.recordType==1 ? '浏览' : searchFormObj.recordType==2 ? '分享' : ''}}<span style="color: #5850FF;">{{total}}</span>{{searchFormObj.recordType==3 ? '位访客' : '次'}}</span>
<div class="operate-btn">
<el-button :size="size" type="primary" plain @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerSlot" class="goodsNameSlot" slot-scope="scope">
<img v-if="scope.scope.customerAvatar" :src="scope.scope.customerAvatar" alt="">{{ scope.scope.customerName }}
</div>
<div slot="shareSlot" class="goodsNameSlot" slot-scope="scope">
<img v-if="scope.scope.shareAvatar" :src="scope.scope.shareAvatar" alt="">{{ scope.scope.shareName }}
</div>
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">{{ scope.scope.goodsSkuName }}
</div>
<div class="setPriceSlot" slot="setPriceSlot" slot-scope="scope">
<el-input v-if="curEditId==scope.scope.id" :value="scope.scope.salePrice" type="text" clearable @blur="setPriceFn(scope.scope)"></el-input>
<span class="unedited" v-else>
{{scope.scope.salePrice}}
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice(scope.scope)">
</span>
</div>
</GLTable>
</div>
</div>
</template>
<script>
const baseColumn = [
{
label: '微信昵称',
addHtml: 'customerSlot'
},
{
label: '手机号',
prop: 'mobile'
},
{
label: '分享人',
addHtml: 'shareSlot'
}
]
const otherColumn = {
1: [
{
label: '浏览时长',
prop: 'browserTime'
},
{
label: '进入页面时间',
prop: 'operationDate'
},
{
label: '离开页面时间',
prop: 'leaveDate'
},
],
2: [
{
label: '分享时间',
prop: 'operationDate'
},
{
label: '浏览时长',
prop: 'browserTime',
formatter: cell =>{
return '--'
}
},
{
label: '进入页面时间',
prop: 'operationDate',
formatter: cell =>{
return '--'
}
},
{
label: '离开页面时间',
prop: 'leaveDate',
formatter: cell =>{
return '--'
}
},
],
3: [
{
label: '浏览次数',
prop: 'browseCount'
},
{
label: '最后浏览时间',
prop: 'lastBrowseDate'
},
]
}
import { utils } from 'glsx-common'
export default {
name: 'browse',
data() {
return {
size: 'small',
searchFormObj: {
recordType: 1,
strategyId: '',
customerName: '',
mobile: '',
shareName: ''
},
strategyName: '',
total: 0,
searchFormData: [
{
label: '微信昵称',
name: 'customerName',
type: 'input',
isClear: true
},
{
label: '手机号',
name: 'mobile',
type: 'input',
isClear: true
},
{
label: '分享人',
name: 'shareName',
type: 'input',
isClear: true
}
],
getListApi: this.$apis.strategy.getburialPointListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: null,
tableColumns: []
},
}
},
components: {
},
created() {
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
console.log(this.routeInfo)
const {id, recordType, strategyName} = this.routeInfo
this.strategyName = strategyName
this.searchFormObj.strategyId = id
this.searchFormObj.recordType = recordType
this.tableParams.tableColumns = [...baseColumn,...otherColumn[recordType]]
},
mounted() {
},
methods: {
handleReset(){
this.searchFormObj = {
strategyId: this.routeInfo.id,
recordType: 1,
customerName: '',
mobile: '',
shareName: ''
}
this.handleSearch()
},
setTableFinishFun(){
this.total = this.$refs.tableRef.total
},
handleExport() {
const parmas = { ...this.searchFormObj }
this.$apis.strategy.exportListApi(parmas).then(({ code, data, message }) => {
if (code == '0') {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', data)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
} else {
this.$message.error(message)
}
})
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = utils.deepClone(this.searchFormObj)
const { categoryCode } = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve()
})
},
goDetaillPage(item){
this.$router.push({ path: `/goodsWarehouse/detail/${item.id}`})
}
}
}
</script>
<style scoped lang="scss">
.big-title{
height: 52px;
background: #FFFFFF;
margin-bottom: 16px;
padding: 0 20px;
line-height: 52px;
font-weight: 600;
font-size: 14px;
color: #333333;
font-family: PingFangSC-Medium;
}
.ctnr{
background-color: #fff;
padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.setPriceSlot{
.unedited{
display: flex;
align-items: center;
}
img{
width: 16px;
height: 16px;
vertical-align: middle;
margin-left: 8px;
cursor: pointer;
}
}
}
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="operate-wrap">
<span class="table-title">管理列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary" plain @click="addStrategy(1)">新增</el-button>
</div>
</div>
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="imgSlot" class="imgSlot" slot-scope="scope">
<img :src="scope.scope.strategyImg" alt="">
</div>
<div slot="linkText" slot-scope="scope">
<p
class="link-text"
@click="goBurialPointPage(scope)"
>{{ scope.scope[scope.prop] || 0 }}</p>
</div>
<div class="showSlot" slot="showSlot" slot-scope="scope">
<el-switch :value="scope.scope.mainFlag" @change="updateFlagFn($event, scope.scope)" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</template>
<script>
import { utils } from 'glsx-common'
export default {
name: 'strategyIndex',
data() {
return {
size: 'small',
curEditId: '',
searchFormObj: {},
getListApi: this.$apis.strategy.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '攻略名称',
prop: 'strategyName'
},
{
label: '攻略宣传图',
addHtml: 'imgSlot',
},
{
label: '浏览量/次',
prop: 'viewAmount',
addHtml: 'linkText'
},
{
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '首页展示',
addHtml: 'showSlot'
},
{
label: '创建日期',
prop: 'createdDate',
width: 220
},
{
label: '更新日期',
prop: 'updatedDate',
width: 220
},
{
label: '操作人',
prop: 'updatedBy'
}
]
},
buttonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.addStrategy(2, row.scope)
}
},
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.delStrategy(row.scope)
}
},
{
type: 'el-button',
name: '置顶',
attrs: {
type: 'text',
fn: '置顶'
},
listeners: {
click: row => this.topStrategy(row.scope)
}
}
],
}
},
components: {
},
mounted() {
},
methods: {
updateFlagFn(e, {id}){
this.$apis.strategy.updateMainFlagApi({id, mainFlag : e}).then(res => {
if(res){
this.$message.success('操作成功')
this.handleSearch()
}
})
},
addStrategy(type, row) {
const params = {
type
}
if(type==2) params.id = row.id
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({
path: `/strategy/add/`+queryStr
})
},
topStrategy({id}){
this.$apis.strategy.topStrategyApi({id, topFlag: 1}).then(res => {
if(res){
this.$message.success('操作成功')
this.handleSearch()
}
})
},
delStrategy({id}){
this.$confirm('是否删除该攻略', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.strategy.delStrategyApi({id}).then(res => {
if(res){
this.$message.success('操作成功')
this.handleSearch()
}
})
}
}
})
},
goBurialPointPage(scope){
const recordType = {
viewAmount: {
id: 1,
name: '浏览明细'
},
fansAmount: {
id: 3,
name: '访客明细'
},
shareAmount: {
id: 2,
name: '分享明细'
}
}[scope.prop]
console.log(recordType.id)
const params = {
recordType : recordType.id,
strategyName: scope.scope.strategyName,
id: scope.scope.id
}
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({
path: `/strategy/burialPointList/`+queryStr,
query: { $title: recordType.name }
})
},
handleReset(){
this.searchFormObj = {}
this.handleSearch()
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = utils.deepClone(this.searchFormObj)
const { categoryCode } = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve()
})
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
background-color: #fff;
padding: 20px;
.imgSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
}
}
.link-text{
color: #5850FF;
cursor: pointer;
}
}
</style>
\ No newline at end of file
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
// const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
//css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
}
module.exports = {
outputDir: `dist`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components')
}
},
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
vue: 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts'
}
},
devServer: {
hot: true,
disableHostCheck: true,
host: process.env.VUE_APP_HOST,
port: process.env.VUE_APP_PORT,
headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!