Commit b06d1958 by 张立顺

项目初始化

1 parent 1c002907
Showing 189 changed files with 4751 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 \ 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"
}
}
node_modules
{
"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": "salepre",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"core-js": "^3.4.4",
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^2.1.0",
"glsx-components": "^1.5.7",
"lodash": "^4.17.21",
"rfdc": "^1.4.1",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"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",
"number-precision": "^1.6.0",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"snabbdom": "^3.5.1",
"vue-cli-plugin-element": "^1.0.1",
"vue-quill-editor": "^3.0.6",
"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 \ 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 \ 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 } from '@/main'
const defaultPath = 'scrm.api.equity.service.'
const url = 'rop-scrm-equity/router'
const getcodeList = params => {
params.method = `${defaultPath}claims.code.list`
return http({
url,
method: 'POST',
data: params
})
}
const uploadCodeFile = params => {
params.method = `${defaultPath}claims.code.batchGenerateCodeByExcel`
return http({
url,
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const exportInvalidClaimsCodeApi = params => {
params.method =`${defaultPath}claims.code.exportInvalidClaimsCode`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const createCode = params => {
params.method =`${defaultPath}claims.code.batchGenerateCodeByHand`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getcodeList,
uploadCodeFile,
exportInvalidClaimsCodeApi,
createCode
}
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.'
const getWorryBatcnList = params => {
params.method = `${defaultPath}service.cfcb.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
const addCards = params => {
params.method = `${defaultPath}service.cfcb.create`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
const downLoads = params => {
params.method = `${defaultPath}service.cfcb.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
const getTypelistApi = params => {
params.method =`${defaultPath}service.package.select.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getWorryBatcnList,
addCards,
downLoads,
getTypelistApi
}
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.'
const getAppointmentList = params => {
params.method = `${defaultPath}service.spa.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
})
}
const modifyAppointment = params => {
params.method = `${defaultPath}service.spa.insert.or.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll:true
})
}
const delAppointment = params => {
params.method = `${defaultPath}service.spa.delete`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
})
}
const exportAppointment = params => {
params.method = `${defaultPath}service.spa.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
})
}
export default {
getAppointmentList,
modifyAppointment,
delAppointment,
exportAppointment
}
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getWarehousListApi = params => {
params.method = `${defaultPath}goods.list`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
const auditGoodApi = params => {
params.method = `${defaultPath}audit.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getGoodInfoApi = params => {
params.method = `${defaultPath}get.good.by.id`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getGoodGroupInfoApi = params => {
params.method = `${defaultPath}get.good.group.by.id`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const insertGoodApi = params => {
params.method = `${defaultPath}insert.good`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const insertGoodGroupApi = params => {
params.method = `${defaultPath}insert.good.group`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const deleteGoodApi = params => {
params.method = `${defaultPath}delete.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getWarehousListApi, auditGoodApi, getGoodInfoApi, getGoodGroupInfoApi, insertGoodApi, insertGoodGroupApi, deleteGoodApi }
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 } from '@/main'
const CUR_BASE_URL = 'rop-scrm-equity/router'
const getBaseContractListApi = params => {
params.method = `scrm.api.equity.service.contract.base.template.list.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
//获取产品合同更换模板列表
const getContractListApi = params => {
params.method = `scrm.api.equity.service.contract.template.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
//获取产品模板列表
const getBaseTempListApi = params => {
params.method = `scrm.api.equity.service.contract.base.template.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const saveContractTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.template.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getContractDetailApi = params => {
params.method = `scrm.api.equity.service.contract.template.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const printContractApi = params => {
params.method = `scrm.api.equity.service.contract.template.printTest`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const copyTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.template.copyTemplate`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//更换产品合同模板
const copyBaseTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.base.template.replace`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//批量变更合同模板
const babchCopyTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.template.batch.copyTemplate`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//批量初始化合同模板
const babchInitTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.template.batch.initTemplate`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const exportContractApi = params => {
params.method = `scrm.api.equity.service.contract.template.list.export`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getProdContractListApi = params => {
params.method = `scrm.api.equity.service.base.package.list.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
//产品列表导出
const exportProdContractApi = params => {
params.method = `scrm.api.equity.service.base.package.export`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
//查询产品分类
const getProdCategoryListApi = params => {
params.method = `scrm.api.equity.service.base.package.category.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 编辑或者新增分类
const addCategoryApi = params => {
params.method = `scrm.api.equity.service.base.package.update.category`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 查询套餐合同模板列表
const getProdPackageListApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 套餐合同导出
const exportProdPackageApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.export`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 初始化套餐合同模板
const initProdPackageApi = params => {
params.method = `scrm.api.equity.service.contract.template.initParentTemplate`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取套餐详情
const getProdPackageDetailApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取商品部位映射数据
const getProdPartListApi = params => {
params.method = `scrm.api.equity.service.contract.parent.goodsPosition.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取产品SKU类别
const getSkuCategoryListApi = params => {
params.method = `scrm.api.equity.service.base.package.sku.category.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getContractListApi,
getBaseTempListApi,
getBaseContractListApi,
saveContractTemplateApi,
getContractDetailApi,
printContractApi,
copyTemplateApi,
copyBaseTemplateApi,
babchCopyTemplateApi,
babchInitTemplateApi,
exportContractApi,
getProdContractListApi,
exportProdContractApi,
getProdCategoryListApi,
addCategoryApi,
getProdPackageListApi,
exportProdPackageApi,
initProdPackageApi,
getProdPackageDetailApi,
getProdPartListApi,
getSkuCategoryListApi
}
import { http } from '@/main'
const converterApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'GET',
data: params,
sign: true
})
}
export { converterApi }
\ No newline at end of file \ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const GETLISTDEVICEFILEUNSTOCK = params => {
return http({
url: 'base/apps',
method: 'GET',
data: params,
sign: true
})
}
const GETLISTDEVICEFILEUNSTOCK1 = params => {
return http({
url: 'base/apps',
method: 'POST',
data: params,
sign: true
})
}
export default {
GETLISTDEVICEFILEUNSTOCK,
GETLISTDEVICEFILEUNSTOCK1
}
import { http } 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 = `${defaultPath}order.export.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
// 打印合同
const getPriteApi = params => {
params.method = `${defaultPath}order.prite`
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({
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({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http({
url: 'rop-scrm-carlife/router',
method: 'GET',
data: params,
sign: true
})
}
const getHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.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 = `${defaultPath}list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getEquityApi = params => {
params.method = `${orderPath}detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquityApi = params => {
params.method = `${orderPath}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, callback) => {
params.method = 'scrm.api.equity.common.upload.image'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
onUploadProgress: res => {
callback(res)
}
})
}
// 退保
const backOrderApi = params => {
params.method = `${orderPath}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
})
}
export default { 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 }
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getMerberList = params => {
params.method = `${defaultPath}get.member.list`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
export { getMerberList }
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.'
const getConfigList = params => {
params.method = `${defaultPath}service.merchant.config.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
const openConfigs = params => {
params.method = `${defaultPath}service.merchant.config.batch.open`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
const closeConfigs = params => {
params.method = `${defaultPath}service.merchant.config.batch.close`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
// 跳转后获取配置
const getConfig = params => {
params.method = `${defaultPath}service.merchant.config.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
// 配置导出
const exportConfig = params => {
params.method = `${defaultPath}service.merchant.config.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
//修改配置
const modifyConfig = params => {
params.method = `${defaultPath}service.merchant.config.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
//创建配置
const addConfig = params => {
params.method = `${defaultPath}service.merchant.config.create`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
//分页获取商户配置
const getStoreConfig = params => {
params.method = `${defaultPath}service.merchant.config.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
//查询商户配置
const selStoreConfig = params => {
params.method = `scrm.api.equity.service.merchant.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
//批量开通销售模式
const batchOpenSaleModeApi = params => {
params.method = `${defaultPath}service.merchant.config.batch.open`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params
})
}
export default {
getConfigList,
openConfigs,
closeConfigs,
getConfig,
exportConfig,
modifyConfig,
getStoreConfig,
addConfig,
selStoreConfig,
batchOpenSaleModeApi
}
import { http } from '@/main'
const getRulesData = () => {
let method = 'dj.api.smartcarlife.merchantDivisionRule.getAllRule'
return method
}
const getRulesListData = () => {
let method = 'dj.api.smartcarlife.merchantDivisionRule.pageChangeRecord'
return method
}
// 客户评价
const guestComTotal = () => {
let method = 'dj.api.smartcarlife.orderCommentReport.total'
return method
}
// 是否开通精品升级
const isOpenUpgrade = () => {
let method = 'dj.api.serviceMerchant.isOpenSmartcarlife'
return method
}
// 订单统计
const orderTotal = () => {
let method = 'dj.api.smartcarlife.orderReport.total'
return method
}
// 券统计
const couponsTotal = () => {
let method = 'dj.api.smartcarlife.couponReport.total'
return method
}
// 按天统计券
const couponsTotalByDay = () => {
let method = 'dj.api.smartcarlife.couponReport.countByDate'
return method
}
// 按天统计金额
const moneyTotal = () => {
let method = 'dj.api.smartcarlife.orderReport.totalByDay'
return method
}
// 精品礼券订单查询
const findCoupons = () => {
let method = 'dj.api.life.customer.coupon.listFor4S'
return method
}
// 精品礼券升级订单查询
const findupGradeOrder = () => {
let method = 'dj.api.smartcarlife.goodsOrderProfitAllocation.shop.merchant.page'
return method
}
// 查看礼券
const checkCoupons = () => {
let method = 'dj.api.smartcarlife.merchant.coupon.page'
return method
}
// 我的分账
const mydivision = () => {
let method = 'dj.smartcarlife.api.shop.order.division.page'
return method
}
// 精品礼券导出
const exportCoupons = () => {
let method = 'dj.api.life.customer.coupon.exportExcelListFor4S'
return method
}
// 精品礼券升级订单导出
const exportUpgrade = () => {
let method = 'dj.api.smartcarlife.goodsOrderProfitAllocation.shop.merchant.export'
return method
}
// 我的分账导出
const exportMydivision = () => {
let method = 'dj.smartcarlife.api.shop.order.division.export'
return method
}
// 获取发券人/转化人列表
const getEmployName = () => {
let method = 'dj.api.life.customer.coupon.distinctColum'
return method
}
// 查看明细
const checkDetail = () => {
let method = 'dj.api.smartcarlife.goodsOrder.detail'
return method
}
// 集团--订单统计
const orderTotalOfJT = () => {
let method = 'dj.api.smartcarlife.orderReport.totalByMerchant'
return method
}
// 集团--精品升级订单统计数
const orderTotalNumOfJT = () => {
let method = 'dj.api.smartcarlife.goodsOrderProfitAllocation.shop.merchant.count'
return method
}
// 集团--我的分账统计数
const myAccountTotalNumOfJT = () => {
let method = 'dj.smartcarlife.api.shop.order.division.page.count'
return method
}
// 获取4s店列表
const get4SList = params => {
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
// 服务介绍
const introConpute = params => {
params.method = `scrm.api.boutiquecoupon.config.getModelParams`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取商户列表
const getMerchantList = params => {
params.method = `entmicro.api.common.findMerchantTreeByMerchantNo.list`
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export {
getRulesData,
getRulesListData,
guestComTotal,
isOpenUpgrade,
orderTotal,
couponsTotal,
couponsTotalByDay,
moneyTotal,
findCoupons,
findupGradeOrder,
checkCoupons,
mydivision,
exportMydivision,
exportUpgrade,
exportCoupons,
getEmployName,
checkDetail,
orderTotalOfJT,
orderTotalNumOfJT,
myAccountTotalNumOfJT,
get4SList,
introConpute,
getMerchantList
}
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
const CUR_BASE_URL = 'rop-scrm-equity/router'
const get4SList = params => {
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取权益列表
const getEquityList = params => {
params.method = 'scrm.api.equity.serviceterms.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const exportEquityApi = params => {
params.method = `scrm.api.equity.serviceterms.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getServiceList = params => {
params.method = `scrm.api.equity.serviceterms.itemslist`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const craeteEquity = params => {
params.method = `scrm.api.equity.serviceterms.insert`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquity = params => {
params.method = `scrm.api.equity.serviceterms.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getEquityDetail = params => {
params.method = `scrm.api.equity.serviceterms.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getServicesItemsList = params => {
params.method = `scrm.api.equity.service.items.pages`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const exportServicesItemsApi = params => {
params.method = `scrm.api.equity.service.items.pages.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const createCommonConfig = params => {
params.method = `scrm.api.equity.service.items.common.config.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getCommonConfig = params => {
params.method = `scrm.api.equity.service.items.common.config.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const addServicesProject = params => {
params.method = `scrm.api.equity.service.items.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getServiceDetailApi = params => {
params.method = `scrm.api.equity.service.items.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getSpecificaListApi = params => {
params.method = `scrm.api.equity.service.items.grade.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const addGradeApi = params => {
params.method = `scrm.api.equity.service.items.grade.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保权益部件列表数据
const getScreeningDataApi = params => {
params.method = `scrm.api.equity.service.items.extend.unit.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保权益列表数据
const getExtendedWarrantyListApi = params => {
params.method = `scrm.api.equity.service.items.extend.pages`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 导出延保权益项目列表
const exportExtendedWarrantyApi = params => {
params.method = `scrm.api.equity.service.items.extend.pages.export`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 新增编辑延保权益服务项目
const addExtendedWarrantyApi = params => {
params.method = `scrm.api.equity.service.items.extend.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保权益服务项目详情
const getExtendedWarrantyDetailApi = params => {
params.method = `scrm.api.equity.service.items.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保合同列表
const getExtendedWarrantyContractListApi = params => {
params.method = `scrm.api.equity.service.contract.base.extend.template.list.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取服务项目修改记录
const getServiceRecordApi = params => {
params.method = `scrm.api.equity.service.items.modify.detail.record.pages`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 分页查询车系
const carSeriesPage = params => {
params.method = `scrm.api.equity.common.car.series.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 查询延保服务项目详情修改记录列表
const modifyDetailRecord = params => {
params.method = `scrm.api.equity.service.extend.items.modify.detail.record`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
get4SList,
getEquityList,
exportEquityApi,
getServiceList,
craeteEquity,
updateEquity,
getEquityDetail,
getServicesItemsList,
exportServicesItemsApi,
createCommonConfig,
getCommonConfig,
addServicesProject,
getServiceDetailApi,
getSpecificaListApi,
addGradeApi,
getScreeningDataApi,
getExtendedWarrantyListApi,
exportExtendedWarrantyApi,
addExtendedWarrantyApi,
getExtendedWarrantyDetailApi,
getExtendedWarrantyContractListApi,
getServiceRecordApi,
carSeriesPage,
modifyDetailRecord
}
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.order.config.'
const url = 'rop-scrm-equity/router'
const getListApi = params => {
params.method = `${defaultPath}page`
return http({
url,
method: 'POST',
data: params
})
}
const importDateApi = params => {
params.method = `${defaultPath}import`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
const getDetailApi = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const exportDataApi = params => {
params.method = `${defaultPath}fail.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getListApi,
importDateApi,
getDetailApi,
exportDataApi
}
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.'
const getWorryDetailList = params => {
params.method = `${defaultPath}service.cfc.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
})
}
const getdetailTotal = params => {
params.method = `${defaultPath}service.cfc.statistics.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
})
}
const selWorryDetailList = params => {
params.method = `${defaultPath}service.cfc.get.by.seqno`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
})
}
const modWorryDetailList = params => {
params.method = `${defaultPath}service.cfc.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll:true
})
}
//清空无忧卡使用状态
const clearWorryStatus = params => {
params.method = `${defaultPath}service.cfc.clear`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll:true
})
}
export default {
getWorryDetailList,
getdetailTotal,
selWorryDetailList,
modWorryDetailList,
clearWorryStatus
}
$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;
}
}
}
// 核赔订单详情样式
.order-container-page {
.widget {
background: white;
.title {
padding: 0 20px;
height: 57px;
line-height: 57px;
border-bottom: 1px solid #e5e5e5;
}
.content {
.code {
padding: 8px 20px;
background: #f9f9f9;
}
.pannel {
.line {
margin-top: 20px;
.label {
width: 154px;
text-align: right;
}
.value {
width: 432px;
}
}
}
.element_wrap {
display: flex;
.label {
width: 154px;
text-align: right;
font-size: 16px;
font-weight: 400;
color: #333333;
}
.pannel {
.wrapper {
margin-bottom: 16px;
.name {
font-size: 16px;
font-weight: 400;
color: #333333;
margin-bottom: 8px;
}
.messag {
width: 686px;
// height: 60px;
background: #f9f9f9;
box-sizing: border-box;
padding: 0 20px;
.ms {
font-size: 14px;
font-weight: 400;
color: #666666;
}
.price {
color: #333333;
}
}
.pannel_box {
width: 686px;
background: #f9f9f9;
box-sizing: border-box;
padding: 20px;
display: flex;
flex-wrap: wrap;
.line {
margin-bottom: 20px;
.lab {
font-size: 14px;
font-weight: 400;
color: #666666;
text-align: right;
width: 154px;
}
.tip {
font-size: 14px;
font-weight: 400;
color: #333333;
}
}
}
}
}
.total {
padding: 12px 20px;
background: #f9f9f9;
font-size: 14px;
font-weight: 400;
color: #333333;
}
}
}
.pad20 {
padding: 20px;
}
}
.flex_wrap {
display: flex;
flex-wrap: wrap;
}
.text_14_4_333 {
font-size: 14px;
font-weight: 400;
color: #333333;
}
.text_14_4_666 {
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
// .equity-wrap table {
// width: 98%;
// color: #666666;
// border: 1px solid #e5e6e7;
// border-width: 1px 0 0 1px;
// }
// .equity-wrap table tr {
// height: 30px;
// // line-height: 30px;
// }
// .equity-wrap table th,
// .equity-wrap table td {
// font-size: 12px;
// font-weight: normal;
// padding: 0px 10px;
// border: 1px solid #e5e6e7;
// border-width: 0px 1px 1px 0px;
// border-spacing: 0;
// text-align: center;
// vertical-align: middle;
// }
// .equity-wrap table td {
// min-width: 50px;
// }
.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 {
padding: 0 20px;
font-size: 20px;
font-weight: 600;
height: 60px;
line-height: 60px;
border-bottom: 1px solid #d8d8d8;
color: #333;
}
.required-field::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
.el-dialog {
// margin-top: 6vh !important;
margin-top: 6vh;
&__body {
padding: 20px;
.el-form-item {
margin-bottom: 16px;
}
}
&__footer {
.el-button {
width: 150px;
}
}
}
\ No newline at end of file \ 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
This diff could not be displayed because it is too large.
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
/* eslint-disable */
var reg = {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\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
}
return newValue
} else {
return newValue ? oldValue : ''
}
}
const liveStatusList = [
{
confId: '101',
confName: '直播中'
},
{
confId: '102',
confName: '未开始'
},
{
confId: '103',
confName: '已结束'
},
{
confId: '104',
confName: '禁播'
},
{
confId: '105',
confName: '暂停'
},
{
confId: '106',
confName: '异常'
},
{
confId: '107',
confName: '已过期'
}
]
// /**
// * 深克隆 所有原型链上的对象和属性
// * 例: const bar=deepClone(foo)
// * console.log(bar===foo) false
// * @param {*} obj
// */
function deepClone(obj) {
const clone = require('rfdc')({ proto: false, circles: false })
return clone(obj)
}
const auditStatusList = [
{
confId: 0,
confName: '未审核'
},
{
confId: 1,
confName: '审核中'
},
{
confId: 2,
confName: '审核通过'
},
{
confId: 3,
confName: '审核失败'
}
]
// 太阳膜升级产品供货模式
const upgradeSupplyModeList = [
{
confId: 1,
confName: '嘀加'
},
{
confId: 3,
confName: '门店套码+嘀加'
},
{
confId: 4,
confName: '门店回收原厂+嘀加'
},
{
confId: 5,
confName: '服务商自采+嘀加'
}
]
// 1.3场景 升级产品供货模式
const crowdUpgradeSupplyModeList = [
{
confId: 1,
confName: '嘀加'
},
{
confId: 2,
confName: '门店'
}
]
export { limitPrice, deepClone, liveStatusList, auditStatusList, upgradeSupplyModeList, crowdUpgradeSupplyModeList }
export function attachmentToHtml(elem, childrenHtml) {
// JS 语法
// 获取附件元素的数据
const { key = '', name = '' } = elem
// 生成 HTML 代码
const html = `<span data-w-e-type="text" data-key="${key}" data-name="${name}">${name}</span>`
return html
}
<template>
<div class="editor-ctnr">
<!-- <div class="extend-bar" v-if="operateList && operateList.length">
<el-button v-for="item in operateList" :key="item.key" class="el-icon-circle-plus extend-icon" @click="insertNodeFn(item)">{{ item.name }}</el-button>
</div> -->
<label v-if="label" for="" :class="['content-label', { 'required-field': required }]">{{ label }}</label>
<div>
<div class="editor" style="border: 1px solid #ccc;">
<Toolbar v-if="hasTool" style="border-bottom: 1px solid #ccc" :editor="editor" :defaultConfig="toolbarConfig" :mode="mode" />
<Editor style="min-height: 52px; overflow-y: hidden;" @onChange="onChange" @customPaste="customPaste" v-model="value" :defaultConfig="editorConfig" :mode="mode" @onCreated="onCreated" />
</div>
<div class="extend-bar" v-if="operateList && operateList.length">
<el-button v-for="item in operateList" :key="item.key" class="el-icon-circle-plus extend-icon" @click="insertNodeFn(item)">{{ item.name }}</el-button>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { Boot, DomEditor } from '@wangeditor/editor'
import { withBreakAndDelete } from './withimage'
Boot.registerPlugin(withBreakAndDelete)
import { attachmentToHtml } from './attachmentToHtml'
const elemToHtmlConf = {
type: 'text', // 新元素的 type ,重要!!!
elemToHtml: attachmentToHtml
}
Boot.registerElemToHtml(elemToHtmlConf)
import { renderAttachment } from './renderAttachment'
const renderElemConf = {
type: 'text', // 新元素 type ,重要!!!
renderElem: renderAttachment
}
Boot.registerRenderElem(renderElemConf)
import { parseAttachmentHtml } from './parseAttachmentHtml'
const parseHtmlConf = {
selector: 'span[data-w-e-type="text"]', // CSS 选择器,匹配特定的 HTML 标签
parseElemHtml: parseAttachmentHtml
}
Boot.registerParseElemHtml(parseHtmlConf)
export default Vue.extend({
components: { Editor, Toolbar },
model: {
prop: 'value',
event: 'change'
},
props: {
required: {
type: Boolean,
default: false
},
hasTool: {
type: Boolean,
default: true
},
value: {
type: Object
},
label: {
type: String,
default: ''
},
operateList: {
type: Array,
default: () => {
return []
}
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
editor: null,
html: '',
toolbarConfig: {
toolbarKeys: ['fontSize', 'lineHeight', 'bold', 'justifyLeft', 'justifyRight', 'justifyCenter', 'underline', 'through', 'color', 'bgColor', 'insertTable', 'undo', 'redo', 'clearStyle']
// toolbarKeys: ['fontSize', 'lineHeight', "justifyLeft","justifyRight", "justifyCenter","justifyJustify", 'underline', 'through', 'color', 'bgColor', 'insertTable', 'undo', 'redo', 'clearStyle']
},
editorConfig: {
placeholder: '请输入内容...'
},
mode: 'simple' // 设置simple,选中文字不会出现hoverBar
}
},
methods: {
onChange(editer) {
this.$emit('change', this.editor.getHtml())
},
// 复制粘贴内容时,自动清除格式
customPaste(editor, event) {
editor.insertText(event.clipboardData.getData('text/plain'))
event.preventDefault()
return false
},
onCreated(editor) {
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
},
insertNodeFn(item) {
// event.preventDefault()
const resume = {
// JS 语法
type: 'text',
name: item.name,
key: item.key,
children: [{ text: '' }]
}
this.editor.insertNode(resume)
setTimeout(() => {
this.editor.focus()
this.editor.move(1)
}, 300)
}
},
mounted() {},
beforeDestroy() {
const editor = this.editor
if (editor == null) return
editor.destroy() // 组件销毁时,及时销毁编辑器
}
})
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>
<style scoped lang="scss">
.editor-ctnr {
& > div {
width: 100%;
}
width: 100%;
height: 100%;
display: flex;
.editor {
background: #fff;
// /deep/ .w-e-text-container {
// .w-e-hover-bar {
// display: none;
// }
// }
}
.content-label {
flex-shrink: 0;
width: 154px;
display: inline-block;
vertical-align: top;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
}
/deep/ .w-e-text-container {
padding: 10px 5px;
p {
margin: 0;
}
.w-e-text-placeholder {
top: 5px;
left: 14px;
height: 32px;
line-height: 32px;
}
}
}
.extend-bar {
width: 937px;
padding: 0 20px;
line-height: 40px;
background: #fafbfe;
border: 1px solid #ccc;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
border-top: none;
/deep/ .el-button {
border: none;
padding: 0;
margin: 0 16px;
background-color: transparent;
&:hover {
background-color: unset;
}
}
.extend-icon {
cursor: pointer;
&::before {
// font-size: 16px;
margin-right: 4px;
}
font-size: 14px;
color: #3f3b3b;
}
}
</style>
export function parseAttachmentHtml(domElem, children, editor) {
const key = domElem.getAttribute('data-key') || ''
const name = domElem.getAttribute('data-name') || ''
// 生成“附件”元素(按照此前约定的数据结构)
const myResume = {
type: 'text',
name,
key,
children: [{ text: '' }]
}
return myResume
}
import { h } from 'snabbdom'
/**
* 渲染“附件”元素到编辑器
* @param elem 附件元素,即上文的 myResume
* @param children 元素子节点,void 元素可忽略
* @param editor 编辑器实例
* @returns vnode 节点(通过 snabbdom.js 的 h 函数生成)
*/
export function renderAttachment(elem, children, editor) {
const { name = '' } = elem
const Vnode = h(
'span',
{
props: { contentEditable: false },
style: { color: '#5f5efb' }
},
// 子节点
[name]
)
return Vnode
}
import { DomEditor } from '@wangeditor/editor'
export function withBreakAndDelete(editor) {
const { isInline, isVoid } = editor
const newEditor = editor
newEditor.isInline = elem => {
const type = DomEditor.getNodeType(elem)
if (type === 'text') return true
return isInline(elem)
}
newEditor.isVoid = elem => {
const type = DomEditor.getNodeType(elem)
if (type === 'text') return true
return isVoid(elem)
}
return newEditor // 返回 newEditor ,重要!!!
}
<template>
<el-input :value="value" v-bind="$attrs" v-on="{...$listeners}" @blur="blurFn"></el-input>
</template>
<script>
export default {
name: 'FormatInput',
props: ['value','precise','intDigit','maxVal','minVal'],
data() {
return {
}
},
watch:{
value:{
handler(nVal, oVal){
this.inputFn(nVal)
},
deep: true
}
},
mounted(){
},
methods:{
inputFn(e){
e = e ? String(e) : ''
this.intDigit = this.intDigit || 6
this.precise = this.precise || 2
let value = e
if(this.maxVal){
if(+this.maxVal<= +e) value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点
}else{
const intDigitReg = this.intDigit == -1 ? `(^\\d+)(\\.\\d+)?` : `(^\\d{${this.intDigit}})\\d+(\\.\\d+)?`
value = e.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(new RegExp(intDigitReg,'g'), '$1').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(new RegExp(`^(-)*(\\d+)\\.(\\d{${this.precise}}).*$`), this.intDigit == -1 ? '$1$2' : '$1$2.$3')
}
this.$emit('input', value)
},
blurFn(e){
let value = e.target.value
if(this.minVal && +this.minVal>=value) value = this.minVal+''
if(value && value.charAt(value.length-1)=='.') value = value.substr(0 ,value.length-1)
this.$emit('input', value)
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="upload-ctnr">
<label v-if="name" :class="['label',{'required-field': required}]" for="">{{name}}</label>
<div class="upload-wrap" :style="defaultStyle">
<img v-if="url" class="image" :src="url" alt="" />
<div v-else class="add-img">
<input type="file" class="file" id="file" ref="input" @change="upload" accept="image/png, image/jpeg, image/gif, image/jpg" />
<i class="el-icon-plus add"></i>
<p>上传照片</p>
</div>
<div class="operate" v-if="url">
<div class="btn-wrap">
<i class="el-icon-view" @click="handleLook"></i>
<i v-if="!disabled" class="el-icon-delete del-icon" @click="del"></i>
</div>
</div>
</div>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="url" dialogType="img"></big-view>
</el-dialog>
</div>
</template>
<script>
import bigView from '@/components/big-view'
export default {
name: 'Upload',
components: {
bigView
},
props: {
required: {
type: Boolean,
default: false
},
name: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
},
url: {
type: String,
default: ''
},
attr: {
type: String,
default: ''
},
defaultStyle: {
type: Object,
default: ()=>{
return {}
}
},
checkObj: { // 校验规则
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
dialogVisibleImg: false
}
},
methods: {
handleLook() {
this.dialogVisibleImg = true
},
upload(e) {
const file = e.target.files[0]
if (this.checkObj && Object.keys(this.checkObj).length) {
const AllImgExt = this.checkObj.fileTypes
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
return this.$message.error('上传格式不正确')
}
const size = file.size / 1024 / 1024
const maxSize = this.checkObj.maxSize
if (size > maxSize) {
return this.$message.error(`上传文件不可超过${maxSize}M`)
}
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const base64 = file.name.split('.').pop() + '@' + arrBase64[1]
this.$apis.claims.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.$emit('uploadSuccess', { attr: this.attr, url: res })
})
}
},
del() {
this.$emit('delImage', { attr: this.attr })
}
}
}
</script>
<style lang="scss" scoped>
.upload-ctnr {
display: flex;
.label {
display: inline-block;
vertical-align: top;
width: 154px;
height: 20px;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
box-sizing: border-box;
}
.upload-wrap {
display: inline-flex;
border: 1px dashed #00000026;
box-sizing: border-box;
width: 104px;
height: 104px;
background: #0000000a;
border-radius: 4px;
position: relative;
&:hover {
.operate {
display: block;
}
}
.image {
width: 100%;
height: 100%;
z-index: 2;
position: relative;
}
.add-img {
width: 100%;
height: 100%;
cursor: pointer;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
position: relative;
.file {
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
position: absolute;
opacity: 0;
}
.add {
font-size: 18px;
}
p {
height: 32px;
line-height: 32px;
}
}
.operate {
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 4px;
z-index: 5;
.btn-wrap {
color: #fff;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
.del-icon {
margin-left: 12px;
}
i {
font-size: 16px;
cursor: pointer;
}
}
}
}
}
</style>
<!--
* @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>
<!-- 弹窗 -->
<template>
<div>
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :width="width" :append-to-body="appendToBody" :fullscreen="fullscreen">
<span slot="title">
{{ title }}
<span class="dialog-sub-title">
<slot name="sub-title" />
</span>
</span>
<slot />
<div slot="footer">
<slot name="btn-start" />
<el-button type="primary" v-if="isShowFooter" @click="handleConfirm">
{{ btnOkLabel }}
</el-button>
<el-button v-if="!noCancel" @click="handleClose">取消</el-button>
<slot name="btn-middle" />
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'D2Dialog',
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'
},
isShowFooter: {
type: Boolean,
default: true
},
appendToBody: {
// 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
type: Boolean,
default: true
},
fullscreen: Boolean
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
::v-deep .el-dialog__header {
font-size: 16px;
font-weight: 600;
}
.dialog-sub-title {
font-size: 20px;
font-weight: 600;
color: #666666;
}
</style>
/**
* 时间控件-限制月份
*/
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 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 \ 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>
/*
* @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(common) {
// console.log(common);
// console.log(utils);
// let params = { moduleName: 'presale', mockUrl: 'https://oss-config.dev.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config',env:'test', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
// return utils.getConfig(params)
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get(' https://oss-config.dev.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config')
return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=services')
//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 common.utils.getConfig(params)
}
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: 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'
// 针对template模板中使用可选链操作符
import chaining from '@/plugins/chaining'
import { start } from '@/setup'
Vue.use(chaining)
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.directive('preventReClick', {
bind: (el, binding) => {
let time = binding.value // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000
}
let fun
el.addEventListener(
'click',
event => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null
}, time)
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation()
}
},
true
)
}
})
function adjustColumnWidth(table) {
const colgroup = table.querySelector('colgroup')
const colDefs = [...colgroup.querySelectorAll('col')]
colDefs.forEach(col => {
const clsName = col.getAttribute('name')
const cells = [...table.querySelectorAll(`td.${clsName}`), ...table.querySelectorAll(`th.${clsName}`)]
// 忽略加了"leave-alone"类的列
if (cells[0]?.classList?.contains?.('leave-alone')) {
return
}
const widthList = cells.map(el => {
return el.querySelector('.cell')?.scrollWidth || 0
})
const max = Math.max(...widthList)
const padding = 32
table.querySelectorAll(`col[name=${clsName}]`).forEach(el => {
el.setAttribute('width', max + padding)
})
})
}
Vue.directive('fit-columns', {
update() {},
bind() {},
inserted(el) {
setTimeout(() => {
adjustColumnWidth(el)
}, 300)
},
componentUpdated(el) {
el.classList.add('r-table')
setTimeout(() => {
adjustColumnWidth(el)
}, 300)
},
unbind() {}
})
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_brand = params => Vue.prototype.$http_brand(params)
export const http_common = params => Vue.prototype.$http_common(params)
File mode changed
// 针对template模板中使用可选链操作符
const chaining = {
install(vue) {
const optionalChaining = (obj, ...rest) => {
console.log('Vue.use', obj, rest)
let tmp = obj
for (const key in rest) {
const name = rest[key]
tmp = tmp?.[name]
}
console.log(tmp)
return tmp || ''
}
// const test = (obj, ...rest) => {
// let tmp = obj
// for (const key in rest) {
// const name = rest[key]
// tmp = tmp?.[name]
// }
// return tmp || ''
// }
// 添加实例方法
vue.prototype.$$ = optionalChaining
// vue.prototype.$sy = test
}
}
export default chaining
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 \ 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([
{
name: 'beforeSale',
path: '/beforeSale/index',
component: resolve => require([`@/views/beforeSale/index.vue`], resolve),
meta: {}
},
{
name: 'editEquity',
path: '/beforeSale/editEquity/:addOrEdit/:contractNo',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
},
{
name: 'worryFree',
path: '/worryFree/index',
component: resolve => require([`@/views/worryFree/index.vue`], resolve),
meta: {}
},
{
name: 'addCards',
path: '/addCards/index',
component: resolve => require([`@/views/addCards/index.vue`], resolve),
meta: {}
},
{
name: 'appointment',
path: '/appointment/index',
component: resolve => require([`@/views/appointment/index.vue`], resolve),
meta: {}
},
{
name: 'config',
path: '/config/index',
component: resolve => require([`@/views/config/index.vue`], resolve),
meta: {}
},
{
name: 'addConfig',
path: '/config/addConfig',
component: resolve => require([`@/views/config/addConfig.vue`], resolve),
meta: {}
},
{
name: 'editEquity',
path: '/beforeSale/editEquity',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
},
{
name: 'equitySummary',
path: '/beforeSale/equitySummary',
component: resolve => require([`@/views/beforeSale/equitySummary.vue`], resolve),
meta: {}
},
{
name: 'equityList',
path: '/beforeSale/equityList',
component: resolve => require([`@/views/beforeSale/equityList.vue`], resolve),
meta: {}
},
{
name: 'pdfDialog',
path: '/beforeSale/pdfDialog',
component: resolve => require([`@/views/beforeSale/pdfDialog.vue`], resolve),
meta: {}
},
{
name: 'addConfig',
path: '/beforeSale/serviceSet',
component: resolve => require([`@/views/beforeSale/serviceSet.vue`], resolve),
meta: {}
},
{
name: 'editEquity',
path: '/beforeSale/editEquity',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
},
{
name: 'checkSet',
path: '/beforeSale/introduct',
component: resolve => require([`@/views/beforeSale/introduct.vue`], resolve),
meta: {}
},
{
name: 'claims',
path: '/claims/index',
component: resolve => require([`@/views/claims/index.vue`], resolve),
meta: {}
},
{
name: 'order',
path: '/claims/order/:id',
component: resolve => require([`@/views/claims/order.vue`], resolve),
meta: {}
},
{
name: 'ghIndex',
path: '/claims/ghIndex',
component: resolve => require([`@/views/claims/ghIndex.vue`], resolve),
meta: {}
},
{
name: 'ghOrder',
path: '/claims/ghOrder/:id',
component: resolve => require([`@/views/claims/ghOrder.vue`], resolve),
meta: {}
},
{
name: 'addCode',
path: '/addCode/index',
component: resolve => require([`@/views/addCode/index.vue`], resolve),
meta: {}
},
{
name: 'renew',
path: '/GH/Renew/renew',
component: resolve => require([`@/views/GH/Renew/renew.vue`], resolve),
meta: {}
},
{
name: 'detail',
path: '/GH/Renew/detail/:id',
component: resolve => require([`@/views/GH/Renew/detail.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 }
import Vue from 'vue'
import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton, GLTable, GLCombiForm, GLTableButton, GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
import 'glsx-components/dist/glsx-components.css'
// import 'glsx-components/src/theme/theme.scss'
let routes = []
let router = null
let instance = null
Vue.use(GLTable)
.use(GLCombiForm)
.use(GLTableButton)
.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
let { response, request, request_common, request_brand, sign, sign_common, secret, constantData } = await fetchConfig(common)
// request.baseURL = 'https://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
// globalState.session.token = 'scrm-base-6358b874-c112-4753-ac00-ec0cce769751-rop'
// request.baseURL = 'http://192.168.1.53:7226'
// request_brand.baseURL = 'http://192.168.1.53:7226'
Vue.prototype.$constantData = constantData
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.$defaultStartDate = '2021-07-01'
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, 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, headers: { TGT: globalState.session.token } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'scrm-base-811305a2-49a3-4e8a-b6dc-fb925c65c95c-rop' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: 'scrm-base-811305a2-49a3-4e8a-b6dc-fb925c65c95c-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '781f08c5-c443-46fd-80e1-f98d94673a73' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase })
}
export async function mount({ routerBase }) {
const insts = render(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: {}
}
export default {
namespaced: true,
state: {
// 商品数据
goodsInfoData: {
id: '',
baseGoodsId: '',
sapCode: '',
supplierCode: '',
supplierName: '',
sceneName: '',
sceneType: '',
goodsName: '',
baseGoodsName: '',
goodsCode: '',
brandMerchantName: '',
specificationType: '1',
thumbUrl: [],
goodsTypeName: '',
goodsImgList: [],
goodsId: [],
specificationDetailList: [],
upgradeGoodsList: [],
distributionType: '0',
goodsSpecificationNameList: [],
status: '',
goodsSpecificationList: [],
goodsPositionList: [],
applicableModelNames: '',
positionNames: '',
shoppingMallFlag: '0',
goodsSpecificationSingleList: [],
specificationSingleDetailList: [],
selectedSceneCode: '',
goodsType: ''
}
},
mutations: {
/**
* @description 数据改变
* @param {Object} state state
*/
setUpdateGoodsInfo(state, data) {
state.goodsInfoData = Object.assign(state.goodsInfoData, data)
}
},
actions: {
},
getters: {
getGoodsInfoData(state) {
return state.goodsInfoData
}
}
}
import NP from 'number-precision'
const gradeObj = {
gradeConfigList: [
{
servicePeriod: '',
maxPrice: '15',
minPrice: '0',
computeFlag: 0,
priceCoefficient: '',
standardShelfCost: '',
standardSalesCost: '',
shelfCost: '',
salesCost: '',
childSalePeriodData: []
},
{
servicePeriod: '',
maxPrice: '30',
minPrice: '15',
computeFlag: 0,
priceCoefficient: '',
standardShelfCost: '',
standardSalesCost: '',
shelfCost: '',
salesCost: '',
childSalePeriodData: []
},
{
servicePeriod: '',
maxPrice: '200',
minPrice: '30',
computeFlag: 0,
priceCoefficient: '',
standardShelfCost: '',
standardSalesCost: '',
shelfCost: '',
salesCost: '',
childSalePeriodData: []
}
],
salePeriodData: [],
serviceGrade: 'A',
serviceOverview: '',
serviceDetail: ''
}
const deepClone = obj => {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
}
export const addGradeItem = (grade = 'A', salePeriodList = []) => {
let _gradeObj = deepClone(gradeObj)
_gradeObj.serviceGrade = grade
salePeriodList = salePeriodList.sort(function(a, b) {
return a - b
})
_gradeObj.salePeriodData = salePeriodList.map(item => {
return { servicePeriod: item, standardShelfCost: '', standardSalesCost: '', shelfCost: '', salesCost: '' }
})
_gradeObj.gradeConfigList?.forEach(item => {
item.childSalePeriodData = deepClone(_gradeObj.salePeriodData)
})
console.log(_gradeObj)
return _gradeObj
}
export const handleGradeData = (dataFromApi, salePeriodList = []) => {
console.log(dataFromApi)
const data = deepClone(dataFromApi)
let arr = []
data.forEach(element => {
const { serviceOverview, serviceDetail, serviceGrade, gradeConfigList, id } = element
let _gradeObj = {
id,
serviceOverview,
serviceDetail,
serviceGrade,
gradeConfigList: []
}
// 根据区间去重
let intervalArr = gradeConfigList?.reduce((acc, current) => {
const exists = acc.some(
item => item.maxPrice === current.maxPrice && item.minPrice === current.minPrice
)
if (!exists) {
acc.push(current)
}
return acc
}, [])
intervalArr.forEach((item, index) => {
let { maxPrice, minPrice, priceCoefficient, computeFlag, id } = item || {}
_gradeObj.gradeConfigList.push({
maxPrice: NP.divide(maxPrice || 0, 1000000),
minPrice: NP.divide(minPrice || 0, 1000000),
priceCoefficient: priceCoefficient,
computeFlag,
id
})
})
salePeriodList = salePeriodList.sort(function(a, b) {
return a - b
})
_gradeObj.salePeriodData = salePeriodList.map(item => {
const _target = element.gradeConfigList.find(o => o.servicePeriod == item)
return { servicePeriod: item, standardShelfCost: NP.divide(_target?.standardShelfCost || 0, 100), standardSalesCost: NP.divide(_target?.standardSalesCost || 0, 100) }
})
_gradeObj.gradeConfigList?.forEach(item => {
let arr = []
salePeriodList?.forEach(it => {
let _obj = gradeConfigList.find(o => o.servicePeriod == it && NP.divide(o.minPrice || 0, 1000000) == item.minPrice && NP.divide(o.maxPrice || 0, 1000000) == item.maxPrice)
arr.push({ id: _obj?.id, servicePeriod: it, shelfCost: _obj?.shelfCost, salesCost: _obj?.salesCost })
})
item.childSalePeriodData = arr
})
arr.push(_gradeObj)
})
return arr
}
import { Quill } from 'vue-quill-editor'
const Parchment = Quill.imports.parchment;
const Delta = Quill.imports.delta;
class Label extends Parchment.Embed {
static create(value) {
const node = super.create(value.name);
node.setAttribute('keyName', value.key)
node.innerText = value.name;
node.contentEditable = 'false';
// this._addRemovalButton(node, value.key); //创建额外的标签,比如删除键
return node;
}
static value(node) {
return node.childNodes[0].textContent;
}
static _addRemovalButton(node, key) {
// const button = document.createElement('button');
// button.innerText = 'x';
// button.onclick = () => node.remove();
// button.contentEditable = 'false';
// node.appendChild(button);
// Extra span forces the cursor to the end of the label, otherwise it appears inside the removal button
const span = document.createElement('span');
span.setAttribute('keyName', key)
span.innerText = '';
node.appendChild(span);
}
}
Label.blotName = 'label';
Label.tagName = 'SPAN';
Label.className = 'ql-label';
export default Label
// Quill.register(Label);
\ No newline at end of file \ No newline at end of file
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 \ No newline at end of file
<template>
<div>
<div class="bar-title" @click="changeStatus()">
<i class="el-icon-caret-right btn" v-if="!isExpansion"></i>
<i class="el-icon-caret-bottom btn" v-else></i>
<span class="title">{{name}}</span>
</div>
<slot v-if="isExpansion"></slot>
</div>
</template>
<script>
export default {
name: 'FoldFrame',
props: {
name: {
type: String,
default: ''
}
},
data() {
return {
isExpansion: true
}
},
methods: {
changeStatus(){
this.isExpansion = !this.isExpansion
}
}
}
</script>
<style lang="scss" scoped>
.bar-title{
font-weight: 600;
font-size: 14px;
color: #000000d9;
height: 40px;
line-height: 40px;
padding: 0 20px;
cursor: pointer;
.btn{
margin-right: 9px;
font-size: 16px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!