Commit 9c91a878 by cwq0219

create

0 parents
Showing 66 changed files with 3867 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"
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
{
"printWidth": 800,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 820,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"useTabs": false,
"eslintIntegration": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
# subapp-blog
微前端博客子应用
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "theme-chalk"
}
]
]
};
This diff could not be displayed because it is too large.
{
"name": "services",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.1.0",
"lodash": "^4.17.21",
"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",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="never">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<title>微前端子应用:博客</title>
</head>
<body>
<noscript>
<strong>We're sorry but module-report doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>
\ No newline at end of file \ No newline at end of file
var express = require('express')
// var history = require('connect-history-api-fallback')
var cors = require('cors')
var app = express()
// app.use(history())
app.use(cors())
app.use(express.static('./dist'))
app.get('/', function(req, res) {
res.send('Hello jq')
})
const port = 6652
app.listen(port)
console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
<template>
<div id="app">
<!-- <h2>
报表子应用
<span class="right">{{ gs }}</span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport('3-1')">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:{{ myMsg }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:{{ myMessage }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div> -->
<router-view />
</div>
</template>
<script>
export default {
name: 'report-app',
props: {
msg: String,
message: String
},
data() {
return {
myMsg: '',
gs: ''
}
},
created() {
this.myMsg = this.msg
this.myMessage = this.message
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</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.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 } 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
})
}
export { getGoodsList, uploadImg, getMerchantList, getZoneList }
/**
* 新增参数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.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 }
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getLiveRoomListApi = params => {
params.method = `${defaultPath}live.room.list`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
const getLiveShareApi = params => {
params.method = `${defaultPath}get.shared.code`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
const insertLiveRoomApi = params => {
params.method = `${defaultPath}insert.live.room`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const deleteLiveRoomApi = params => {
params.method = `${defaultPath}delete.live.room`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getLiveRoomInfoApi = params => {
params.method = `${defaultPath}get.live.room.by.id`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getControlInfoApi = params => {
params.method = `${defaultPath}get.control`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getControlImportListApi = params => {
params.method = `${defaultPath}get.import.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getWaitImportListApi = params => {
params.method = `${defaultPath}get.wait.import.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const importGoodsApi = params => {
params.method = `${defaultPath}import.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateCommentApi = params => {
params.method = `${defaultPath}update.comment`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateReplayApi = params => {
params.method = `${defaultPath}update.replay`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const controlUpOrDownApi = params => {
params.method = `${defaultPath}toggle.status`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const controlDeleteApi = params => {
params.method = `${defaultPath}delete.room.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getLiveRoomListApi, getLiveShareApi, insertLiveRoomApi, deleteLiveRoomApi, getLiveRoomInfoApi, getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi, controlUpOrDownApi, controlDeleteApi }
.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;
}
.live-room .container {
background: #FFFFFF;
margin: 20px 40px;
padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
}
.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;
}
.live-room .el-table .cell {
line-height: 16px;
}
.live-room .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #DCDFE6;
border-radius: 0;
}
.live-room .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
.live-room .img-60 {
width: 60px;
height: 60px;
}
.live-room .edit-container {
margin: 20px 40px 84px;
}
.live-room .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #FFFFFF;
z-index: 999;
}
.live-room .flex {
display: flex;
justify-content: space-between;
}
.live-room .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;
}
.live-room .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
}
.live-room .edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
}
// .live-room table {
// width: 98%;
// color: #666666;
// border: 1px solid #e5e6e7;
// border-width: 1px 0 0 1px;
// }
// .live-room table tr {
// height: 30px;
// // line-height: 30px;
// }
// .live-room table th,
// .live-room 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;
// }
// .live-room table td {
// min-width: 50px;
// }
\ 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
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
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 auditStatusList = [{
confId: 0,
confName: '未审核'
},
{
confId: 1,
confName: '审核中'
},
{
confId: 2,
confName: '审核通过'
},
{
confId: 3,
confName: '审核失败'
}
]
export { limitPrice, liveStatusList, auditStatusList }
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
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>
<el-dialog :title="title" :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>
</el-dialog>
</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: 'mini'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
<!-- 选择商品弹窗 -->
<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]
console.log(selectedData)
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.94:8115/rop-scrm-live/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 //超时时间
export const fetchConfig = function(isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
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'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
File mode changed
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container } from 'element-ui'
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(TimePicker)
Vue.use(Col)
Vue.use(DatePicker)
Vue.use(Tree)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Tooltip)
Vue.use(Tabs)
Vue.use(TabPane)
export const message = Message
export const messageBox = MessageBox
if (window.__POWERED_BY_QIANKUN__) {
// eslint-disable-next-line no-undef
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)
// 处理重复点击同一个路由报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export { VueRouter, routes, getRoutes }
const staticRoutes = Object.freeze([
{
name: 'default',
path: '/',
redirect: { name: 'liveRoom' }
},
{
name: 'MemberList',
path: '/liveMember/memberList',
component: resolve => require([`@/views/liveMember/memberList.vue`], resolve),
meta: {}
},
{
name: 'commodityList',
path: '/cmmodityLibrary/commodityList',
component: resolve => require([`@/views/cmmodityLibrary/commodityList.vue`], resolve),
meta: {}
},
// {
// name: 'WarehousingList',
// path: '/cmmodityLibrary/warehousingList',
// component: resolve => require([`@/views/cmmodityLibrary/warehousingList.vue`], resolve),
// meta: {}
// },
{
name: 'editProduct',
path: '/cmmodityLibrary/editProduct',
component: resolve => require([`@/views/cmmodityLibrary/editProduct.vue`], resolve),
meta: {}
},
{
name: 'editProductGroup',
path: '/cmmodityLibrary/editProductGroup',
component: resolve => require([`@/views/cmmodityLibrary/editProductGroup.vue`], resolve),
meta: {}
},
{
name: 'liveRoom',
path: '/liveRoom/liveRoomList',
component: resolve => require([`@/views/liveRoom/liveRoomList.vue`], resolve),
meta: {}
},
{
name: 'editLiveRoom',
path: '/liveRoom/editLiveRoom/:addOrEdit/:id',
// component: () => import('@/views/liveRoom/editLiveRoom.vue'),
component: resolve => require([`@/views/liveRoom/editLiveRoom.vue`], resolve),
meta: {}
},
{
name: 'liveControl',
path: '/liveRoom/liveControl/:id',
component: resolve => require([`@/views/liveRoom/liveControl.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 } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
import 'glsx-components/dist/glsx-components.css'
let routes = []
let router = null
let instance = null
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState }) {
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
}
export async function mount(props) {
const insts = render(props.routerBase, routes)
router = insts.router
instance = insts.vm
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:04:32
* @LastEditors: limin
* @LastEditTime: 2021-10-14 16:30:47
* @FilePath: \scrm\scrm-sub-blog\src\setup\render.js
*/
import App from '../App.vue'
import Vue from 'vue'
import store from '@/store'
import { VueRouter } from '@/router'
const render = (base, routes) => {
const router = new VueRouter({
base,
routes,
mode: 'history'
})
const vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
return { router, vm }
}
export default render
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:02:23
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:17
* @FilePath: \scrm\scrm-sub-blog\src\setup\single.js
*/
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } })
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: {}
}
<template>
<div class="report-home">
HOME
<GLButton type="danger" @click="test()" class="test555" id="1-1-1-1" mode="link">权限按钮测试</GLButton>
<GLButton type="success" size="small" @click="test()" id="1-1-1-1" class="test">权限按钮测试2</GLButton>
<el-button class="test" @click="test()">东方网分</el-button>
</div>
</template>
<script>
export default {
name: 'home',
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
<template>
<div class="report-about">
<h4>穿梭框1</h4>
<h4 class="align-center">
<label>请打开f12查看移动数据</label>
<el-button size="medium" type="info" @click="changeMode">当前模式:{{ mode }}</el-button>
<el-button size="medium" @click="clearChecked()">清除选中</el-button>
<el-button size="medium" @click="toHidden()">去=隐藏的路由</el-button>
</h4>
<div class="box">
<!-- lazy -->
<!-- :lazyFn="lazyFn" -->
<tree-transfer ref="wl-tree-transfer" filter high-light default-transfer :mode="mode" :title="title" :to_data="toData" :from_data="fromData" :filterNode="filterNode" :defaultProps="defaultProps" :defaultCheckedKeys="defaultCheckedKeys" :defaultExpandedKeys="[2, 3]" @right-check-change="rightCheckChange" @left-check-change="leftCheckChange" @removeBtn="remove" @addBtn="add" height="540px" node_key="id">
<span slot="title-right" class="my-title-right" @click="handleTitleRight">自定义内容</span>
</tree-transfer>
</div>
</div>
</template>
<script>
import treeTransfer from 'el-tree-transfer'
export default {
name: 'App',
components: { treeTransfer },
data() {
return {
mode: 'transfer', // transfer addressList
defaultProps: { label: 'name', children: 'children' },
fromData: [
{
id: 1,
pid: 0,
name: '测试左侧',
children: [
{
id: 2,
pid: 1,
name: '水电费是打发斯蒂芬斯蒂芬gas噶水电费噶地方死光光',
disabled: true,
children: []
},
{
id: 3,
pid: 1,
name: '11-3',
children: []
},
{
id: 4,
pid: 1,
name: '11-4',
children: [
{
id: 5,
pid: 4,
name: '11-5',
children: [
{
id: 111,
pid: 5,
name: '11-111'
}
]
},
{
id: 6,
pid: 4,
name: '11-6',
children: []
}
]
}
]
},
{
id: 7127,
pid: 0,
name: 'debug',
children: [
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
]
}
], // 穿梭框 - 源数据 - 树形
toData: [],
fromArray: [
{
id: '1',
name: '1',
pid: '0'
},
{
id: '2',
name: '2',
pid: '0'
},
{
id: '1-1',
name: '1-1',
pid: '1'
},
{
id: '1-2',
name: '1-2',
pid: '1'
},
{
id: '1-1-1',
name: '1-1-1',
pid: '1-1'
},
{
id: '1-1-1-1',
name: '1-1-1-1',
pid: '1-1-1'
},
{
id: '2-1',
name: '2-1',
pid: '2'
},
{
id: '2-2',
name: '2-2',
pid: '2'
}
],
toArray: [],
defaultCheckedKeys: [] // 左侧默认选中数据
}
},
created() {},
mounted() {
this.$apis.demo.GETLISTDEVICEFILEUNSTOCK({ k: 2, kdj: 5 }).then(res => {})
// 测试延迟默认选中
setTimeout(() => {
this.defaultCheckedKeys = [1]
}, 1000)
},
methods: {
toHidden() {
this.$router.push('/about/hidden')
},
// 清除选中
clearChecked() {
this.$refs['wl-tree-transfer'].clearChecked()
},
// 自定义筛选函数
filterNode(value, data, where) {
console.log(value, data, where)
if (!value) return true
return data[this.defaultProps.label].indexOf(value) !== -1
},
// 懒加载回调
lazyFn(node, resolve) {
setTimeout(() => {
resolve([
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
])
}, 500)
},
// 切换模式 现有树形穿梭框模式transfer 和通讯录模式addressList
changeMode() {
if (this.mode == 'transfer') {
this.mode = 'addressList'
} else {
this.mode = 'transfer'
}
},
// 添加按钮
add(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 移除按钮
remove(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 左侧源数据选中事件
leftCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 右侧目标数据选中事件
rightCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 自定义节点 仅树形结构支持
renderContent(h, { node, data }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={() => this.append(data)}>
Append
</el-button>
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>
Delete
</el-button>
</span>
</span>
)
},
// 标题自定义区点击事件
handleTitleRight() {
alert('标题自定义区点击事件')
}
},
computed: {
title() {
if (this.mode == 'transfer') {
return ['源列表', '目标列表']
} else {
return ['通讯录', '收件人', '抄送人', '密送人']
}
}
}
}
</script>
<style>
.align-center {
text-align: center;
}
.box {
width: 600px;
margin: 0 auto;
text-align: left;
}
.btn {
border: 1px solid #ebeef5;
padding: 5px 10px;
background-color: #f5f7fa;
outline: none;
}
.my-title-right {
float: right;
font-size: 12px;
cursor: pointer;
}
</style>
<!-- 商品库 -->
<template>
<div class="live-room">
<div class="container">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="未入库" name="noWarehous">
<warehous-list></warehous-list>
</el-tab-pane>
<el-tab-pane label="已入库" name="warehousing">
<warehousing-list></warehousing-list>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import warehousingList from './warehousingList'
import warehousList from './warehousList'
export default {
name: 'commodityList',
data() {
return {
activeName: 'noWarehous'
}
},
components: {
warehousingList,
warehousList
},
computed: {},
mounted() {},
methods: {
handleTabClick() {}
}
}
</script>
<style scoped></style>
<!-- 添加商品 -->
<template>
<div class="edit-pro live-room">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectSinglePro" slot-scope="item" class="select-pro">
<el-button v-show="routeInfo.addOrEdit != 3" type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button>
</div>
<div slot="proTable" class="select-pro">
<GLTable v-show="selectedProInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="selectedProInfoList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
<span slot="price">
<el-input :disabled="routeInfo.addOrEdit == 3" placeholder="请输入" v-model="editForm.price"><template slot="append">元</template></el-input>
</span>
<span slot="auth-button">
<el-button type="text" @click="handleProDelete()">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form>
<p>直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价</p>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog>
</div>
<div class="footer">
<el-button v-show="routeInfo.addOrEdit != 3" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import glsxCombiForm from '@/components/glsx-combi-form'
import selectSingleProDialog from './selectSingleProDialog'
import { uploadImg } from '@/api/modules/common'
import { getGoodInfoApi, insertGoodApi } from '@/api/modules/cmmodityLibrary'
export default {
name: 'editProduct',
data() {
return {
title: '添加商品',
titleObj: {
1: '新增商品',
2: '编辑商品',
3: '查看商品'
},
isBlock: true,
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
editForm: {
name: '',
price: '',
coverImgUrl: ''
},
selectedProInfoList: [],
editRule: {
coverImgUrl: [{ required: true, message: '请上传商品缩略图', trigger: 'change' }],
name: [{ required: true, message: '请输入商品名称', trigger: 'change' }]
// price: [{ required: true, message: '请输入直播价', trigger: 'change' }]
},
// 商品选择
isSingleSelectVisible: false,
selectedProInfo: {},
editFormData: [
{
label: '商品缩略图',
name: 'coverImgUrl',
type: 'upload',
// limitSize: 1,
isDisabled: false,
maxPhotoNum: 1,
tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '商品名称',
name: 'name',
width: '480px',
type: 'input',
isDisabled: false,
maxlength: 20
},
{
label: '商品选择',
name: '',
addHtml: 'selectSinglePro'
},
{
// label: '商品选择',
name: '',
addHtml: 'proTable'
}
// {
// label: '设置直播价',
// name: 'price',
// width: '480px',
// type: 'input',
// tips: '直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价'
// }
],
// 表格
hasPage: false,
tableParams: {
tableOption: true,
tableColumns: [
{
label: '商品图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '商品价格',
prop: 'retailPrice'
},
{
label: '设置直播价格(元)',
prop: '',
width: '180px',
addHtml: 'price'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
components: {
glsxCombiForm,
selectSingleProDialog
},
computed: {},
mounted() {
this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
this.editFormData[1].isDisabled = this.routeInfo.addOrEdit == 3
this.tableParams.tableOption = this.routeInfo.addOrEdit != 3
},
methods: {
getInfo() {
getGoodInfoApi({ id: this.routeInfo.id }).then(res => {
console.log(res)
this.editForm = res
this.editForm.price = res.price ? (res.price / 100).toFixed(2) : ''
if (res.goodsInfo) {
this.selectedProInfo = {
id: res.goodsInfo.goodsId,
retailPrice: res.goodsInfo.price2 && res.goodsInfo.price1 != res.goodsInfo.price2 ? (res.goodsInfo.price1 / 100).toFixed(2) + '-' + (res.goodsInfo.price2 / 100).toFixed(2) : (res.goodsInfo.price1 / 100).toFixed(2),
goodsName: res.goodsInfo.name,
merchantId: res.goodsInfo.merchantId,
merchantName: res.goodsInfo.merchantName,
goodsImage: res.goodsInfo.selfGoodsImageUrl
}
this.selectedProInfoList = [this.selectedProInfo]
}
})
},
handleProDelete() {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
this.selectedProInfo = {}
this.selectedProInfoList = []
}
}
})
},
handleSinglePro(targetItem) {
this.isSingleSelectVisible = !this.isSingleSelectVisible
},
handleSingleSelectConfirm(selectedProInfo) {
this.selectedProInfo = selectedProInfo
this.selectedProInfoList = [selectedProInfo]
this.handleSinglePro()
},
handleSingleSelectClose() {
this.handleSinglePro()
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = JSON.parse(JSON.stringify(this.editForm))
params.price = this.editForm.price * 100
params.shopMallGoodsInfo = {
goodsId: this.selectedProInfo.id,
// name: this.selectedProInfo.goodsName,
merchantId: this.selectedProInfo.merchantId,
merchantName: this.selectedProInfo.merchantName,
// selfGoodsImageUrl: this.selectedProInfo.goodsImage
}
insertGoodApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
}
}
</script>
<style>
.edit-pro .select-pro {
/* width: calc(98% - 140px); */
width: 98%;
}
.edit-pro .m-t-10 {
margin-top: 10px;
}
</style>
<!-- 添加商品组 -->
<template>
<div class="edit-pro-group live-room">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form ref="editFormRef" labelWidth="150px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectMutiPro" slot-scope="item" class="select-pro">
<el-button v-show="routeInfo.addOrEdit != 3" type="text" @click="handleMutiPro(item)">{{ editForm.shopMallGoodsInfoList.length ? '更换' : '请选择' }}</el-button>
</div>
<div slot="proTable" class="select-pro">
<GLTable v-show="editForm.shopMallGoodsInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="editForm.shopMallGoodsInfoList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
<span slot="price" slot-scope="scope">
<el-input :disabled="routeInfo.addOrEdit == 3" placeholder="请输入" v-model="scope.scope.livePrice"><template slot="append">元</template></el-input>
</span>
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleProDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form>
<select-muti-pro-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :selectedProList="editForm.shopMallGoodsInfoList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-dialog>
</div>
<div class="footer">
<el-button v-show="routeInfo.addOrEdit != 3" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import '@/assets/css/public.scss'
import glsxCombiForm from '@/components/glsx-combi-form'
import { uploadImg } from '@/api/modules/common'
import { getGoodInfoApi, getGoodGroupInfoApi, insertGoodGroupApi } from '@/api/modules/cmmodityLibrary'
import selectMutiProDialog from './selectMutiProDialog'
export default {
name: 'editProductGroup',
data() {
return {
title: '添加商品组',
titleObj: {
1: '新增商品组',
2: '编辑商品组',
3: '查看商品组'
},
isBlock: true,
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑
addOrEdit: 1,
id: ''
},
editForm: {
coverImgUrl: '',
shopMallGoodsInfoList: []
},
editRule: {
coverImgUrl: [{ required: true, message: '请上传商品缩略图', trigger: 'change' }],
name: [{ required: true, message: '请输入商品名称', trigger: 'change' }]
},
// 商品选择
isMutiSelectVisible: false,
editFormData: [
{
label: '商品组缩略图',
name: 'coverImgUrl',
type: 'upload',
isDisabled: false,
maxPhotoNum: 1,
tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '商品组名称',
name: 'name',
width: '480px',
type: 'input',
isDisabled: false,
maxlength: 20
},
{
label: '商品选择',
name: '',
addHtml: 'selectMutiPro'
},
{
name: '',
addHtml: 'proTable'
}
],
// 表格
hasPage: false,
tableParams: {
tableOption: true,
tableColumns: [
{
label: '商品图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '商品价格',
prop: 'retailPrice'
},
{
label: '设置直播价格(元)',
prop: '',
width: '180px',
addHtml: 'price'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
components: {
glsxCombiForm,
selectMutiProDialog
},
computed: {},
mounted() {
this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
this.editFormData[1].isDisabled = this.routeInfo.addOrEdit == 3
this.tableParams.tableOption = this.routeInfo.addOrEdit != 3
},
methods: {
getInfo() {
getGoodGroupInfoApi({ id: this.routeInfo.id }).then(res => {
console.log(res)
this.editForm = res
this.editForm.shopMallGoodsInfoList = []
if (res.goodsInfoList.length) {
res.goodsInfoList.forEach(item => {
this.editForm.shopMallGoodsInfoList.push({
id: item.goodsId,
retailPrice: item.price2 && item.price1 != item.price2 ? (item.price1 / 100).toFixed(2) + '-' + (item.price2 / 100).toFixed(2) : (item.price1 / 100).toFixed(2),
livePrice: (item.livePrice / 100).toFixed(2),
goodsName: item.name,
merchantId: item.merchantId,
merchantName: item.merchantName,
goodsImage: item.selfGoodsImageUrl
})
})
}
delete this.editForm.goodsInfoList
})
},
handleMutiPro(targetItem) {
this.isMutiSelectVisible = !this.isMutiSelectVisible
},
handleProDelete(obj) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
var idx = this.editForm.shopMallGoodsInfoList.findIndex(item => item.id == obj.id)
this.editForm.shopMallGoodsInfoList.splice(idx, 1)
}
}
})
},
handleMutiSelectConfirm(selectedProInfo) {
console.log(selectedProInfo)
var idExitList = this.editForm.shopMallGoodsInfoList.map(item => item.id)
var tempList = []
selectedProInfo.forEach(item => {
if (idExitList.includes(item.id)) {
tempList.push(this.editForm.shopMallGoodsInfoList.find(k => k.id == item.id))
} else {
tempList.push({
...item,
livePrice: ''
})
}
})
this.editForm.shopMallGoodsInfoList = tempList
this.handleMutiPro()
},
handleMutiSelectClose() {
this.handleMutiPro()
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = JSON.parse(JSON.stringify(this.editForm))
params.shopMallGoodsInfoList = []
this.editForm.shopMallGoodsInfoList.forEach(item => {
params.shopMallGoodsInfoList.push({
goodsId: item.id,
merchantId: item.merchantId,
merchantName: item.merchantName,
livePrice: (item.livePrice * 100).toFixed(0)
})
})
console.log(params)
insertGoodGroupApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
}
}
</script>
<style>
.edit-pro-group .select-pro {
width: 98%;
}
.edit-pro-group .m-t-10 {
margin-top: 10px;
}
.edit-pro-group .border-red {
border: 1px solid red;
}
</style>
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :tableData="productList" :tableParams="tableParams" @refreshTable="getList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
</glsx-dialog>
</template>
<script>
import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
// 表格组件
getListApi: getGoodsList,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '价格(元)',
prop: 'retailPrice'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
}
},
components: {
glsxDialog
},
mounted() {
this.getList(true)
},
methods: {
getList(isMounted = false) {
var params = {
goodsStatus: 1,
goodsSource: 1,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
getGoodsList(params).then(res => {
// console.log(res)
this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
this.recoverySelected()
})
},
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]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
<!-- 选择商品 - 单选 -->
<template>
<glsx-dialog class="single-pro" title="选择商品" :isVisible.sync="isSingleSelectVisible" width="900px" @confirmDialog="handleSingleSelectConfirm" @closeDialog="handleSingleSelectClose">
<el-radio-group v-model="infoId">
<el-radio class="pro-box" v-for="item in productList" :key="item.id" :label="item.id">
<img :src="item.goodsImage" />
<div class="txt-box">
<p :title="item.goodsName" class="ellipsis">{{ item.goodsName }}</p>
<p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p :title="item.merchantName" class="ellipsis f-s-12">门店名称:{{ item.merchantName }}</p>
</div>
</el-radio>
</el-radio-group>
</glsx-dialog>
</template>
<script>
import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectSingleProDialog',
data() {
return {
infoId: '',
minRatilPrice: '',
productList: []
}
},
props: {
isSingleSelectVisible: {
type: Boolean,
default: false
},
selectedProInfo: {
type: Object,
default: () => {}
}
},
components: {
glsxDialog
},
computed: {},
mounted() {
this.infoId = this.selectedProInfo.id
this.getList()
},
methods: {
getList() {
var params = {
goodsStatus: 1,
goodsSource: 1,
pageNum: 1,
pageSize: 100000
}
var that = this
getGoodsList(params).then(res => {
// console.log(res)
this.productList = res.list
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
})
},
handleSingleSelectConfirm() {
if (!this.infoId) {
this.$message.error('请选择商品')
return true
}
var selectInfo = this.productList.find(item => item.id === this.infoId)
this.$emit('handleSingleSelectConfirm', selectInfo)
},
handleSingleSelectClose() {
this.$emit('handleSingleSelectClose')
}
}
}
</script>
<style>
.single-pro .pro-box {
width: 202px;
border: 1px solid #cccccc;
margin: 0 10px 10px 0;
}
.single-pro p {
margin: 0 0 8px 0;
}
.single-pro .f-s-12 {
font-size: 12px;
}
.single-pro .pro-box img {
width: 202px;
height: 202px;
}
.single-pro .el-radio__input {
position: absolute;
top: 8px;
left: 8px;
}
.single-pro .el-radio__label {
padding: 0;
}
.single-pro .txt-box {
padding: 10px 10px 0;
color: #666666;
}
.single-pro .ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 未入库 -->
<template>
<div class="warehous-list">
<div class="flex">
<el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">添加商品</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEditGroup(1)">添加商品组</el-button>
</el-form-item>
</el-form>
<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="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="warehousListRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="coverImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<span v-show="scope.scope.auditStatus != 1" >
<el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button>
<el-button type="text" @click="scope.scope.goodsGroupFlag == 'N' ? handleEdit(2, scope.scope) : handleEditGroup(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
<el-button v-show="scope.scope.auditStatus == 1" type="text" @click="scope.scope.goodsGroupFlag == 'N' ? handleEdit(3, scope.scope) : handleEditGroup(3, scope.scope)">查看</el-button>
</span>
</GLTable>
</div>
</template>
<script>
import { getWarehousListApi, auditGoodApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
import { auditStatusList } from '@/common/constant'
export default {
name: 'warehousList',
data() {
return {
size: 'small',
searchForm: {
name: '',
status: '-1'
},
// 表格组件
getListApi: getWarehousListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品标题',
prop: 'name',
line: 2
},
{
label: '直播间图片',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price',
line: 1,
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: 'auditStatus',
width: '80',
formatter: cellValue => {
return this.baseDataList.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName
}
},
{
label: '来源门店',
prop: 'merchantName',
line: 2
}
]
},
baseDataList: {
auditStatusList: auditStatusList
}
}
},
components: {},
computed: {},
mounted() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
// 1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
this.$router.push({
// name: 'editProduct',
// path: '/cmmodityLibrary/editProduct',
name: 'ServicesCmmodityLibraryEditProduct',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : -1
}
})
},
// 1-新增;2-编辑;3-查看;4-修改价格
handleEditGroup(addOrEdit, row) {
this.$router.push({
// name: 'editProductGroup',
// path: '/cmmodityLibrary/editProductGroup',
name: 'ServicesCmmodityLibraryEditProductGroup',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : -1
}
})
},
handleExamine(row) {
this.$messageBox.confirm('审核大概需要1-7天', '提交审核', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
auditGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
handleReset() {
this.searchForm = {
name: '',
status: '-1'
}
this.handleSearch()
},
handleSearch() {
this.$refs.warehousListRef.refreshTable()
}
}
}
</script>
<style scoped></style>
<template>
<div>
<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="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf">
<span slot="coverImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleEdit(scope.scope)">修改价格</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<!-- 表格区域 end -->
<!-- 修改价格弹框 开始 -->
<!-- <glsx-dialog title="修改价格" width="620px" :isVisible="showPriceDialog" @closeDialog="closePriceDialog" @confirmDialog="closePriceDialog">
<el-form ref="priceForm" :rules="formRules" :model="form" label-width="120px">
<el-form-item label="商品价格:" prop="price">
<el-input v-model="form.price" maxlength="8" style="width:400px" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="resetPrice()">提交</el-button>
<el-button @click="showPriceDialog = false">取消</el-button>
</div>
</glsx-dialog> -->
<!-- 修改价格弹框 end -->
</div>
</template>
<script>
import { getWarehousListApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
// import glsxDialog from '@/components/glsx-dialog'
export default {
// components: {
// glsxDialog
// },
data() {
return {
size: 'small',
searchForm: {
name: '',
status: '2'
},
// 表格组件
getListApi: getWarehousListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品标题',
prop: 'name',
line: 2
},
{
label: '直播间图片',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price',
line: 1,
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',
line: 2
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// tableData: [
// {
// id: 1,
// pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
// title: '商品标题',
// price: 999,
// merchant: 'xxx'
// }
// ],
// pageTotal: 0,
// userInfo: {},
// currentPage: 1,
// pageSizes: [10, 20, 30, 40],
// pageSize: 10,
// tdWidth: 170,
// DATEFORMATE: (str, type) => {
// return this.$Util.dateFormate(str, type)
// }
// showPriceDialog: false,
// form: {},
// formRules: {
// price: [{ required: true, message: '请输入价格', trigger: 'blur' }]
// }
}
},
created() {},
mounted: function() {},
methods: {
handleReset() {
this.searchForm = {
name: '',
status: '2'
}
this.handleSearch()
},
handleSearch() {
this.$refs.wareRef.refreshTable()
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑;3-查看;4-修改价格
handleEdit: function(row) {
// this.showPriceDialog = true
this.$router.push({
// name: 'editProductGroup',
// path: '/cmmodityLibrary/editProductGroup',
name: 'ServicesCmmodityLibraryEditProductGroup',
params: {
addOrEdit: 4,
id: row ? row.id : -1
}
})
},
// closePriceDialog: function() {
// this.showPriceDialog = false
// }
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>
<template>
<div class="report-home">
HOME
<GLButton type="danger" @click="test()" class="test555" id="1-1-1-1" mode="link">权限按钮测试</GLButton>
<GLButton type="success" size="small" @click="test()" id="1-1-1-1" class="test">权限按钮测试2</GLButton>
<el-button class="test" @click="test()">东方网分</el-button>
</div>
</template>
<script>
export default {
name: 'home',
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
<template>
<div class="report-home">
<h2>
子应用2
</h2>
<div id="nav">
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/about/index')">应用内跳转</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1-1')">子应用1-ui测试-组件测试</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">子应用1-关于子应用</el-button>
<el-button type="primary" size="medium" @click="toAppReport({ path: 'sub01/changeData' })">不存在的路由</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<el-button class="right" type="primary" size="medium" @click="callParentChange()">给登录用户改个名</el-button>
</div>
<img src="../assets/logo.png" alt="" srcset="" />
</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
<div>31</div>
<div>32</div>
<div>33</div>
<div>34</div>
<div>35</div>
<div>36</div>
<div>37</div>
<div>38</div>
<div>39</div>
<div>40</div>
<div>41</div>
<div>42</div>
<div>43</div>
<div>44</div>
<div>45</div>
<div>46</div>
<div>47</div>
<div>48</div>
<div>49</div>
<div>50</div>
<div>51</div>
<div>52</div>
<div>53</div>
<div>54</div>
<div>55</div>
<div>56</div>
<div>57</div>
<div>58</div>
<div>59</div>
<div>60</div>
<div>61</div>
<div>62</div>
<div>63</div>
<div>64</div>
<div>65</div>
<div>66</div>
<div>67</div>
<div>68</div>
<div>69</div>
<div>70</div>
<div>71</div>
<div>72</div>
<div>73</div>
<div>74</div>
<div>75</div>
<div>76</div>
<div>77</div>
<div>78</div>
<div>79</div>
<div>80</div>
<div>81</div>
<div>82</div>
<div>83</div>
<div>84</div>
<div>85</div>
<div>86</div>
<div>87</div>
<div>88</div>
<div>89</div>
<div>90</div>
<div>91</div>
<div>92</div>
<div>93</div>
<div>94</div>
<div>95</div>
<div>96</div>
<div>97</div>
<div>98</div>
<div>99</div>
<div>100</div>
</div>
</template>
<script>
export default {
name: 'report-home',
data() {
return {}
},
methods: {
/**
* 路由切换
* url 路由地址
*/
routerChange(url) {
this.$router.push(url).catch(err => {
console.log(err)
})
},
/**
* 外部路由跳转
* this.$history.push(menu)
* menu 支持:1.string 视为id (每一个路由都有一个唯一id)
* 2.对象 {path:'sub1/home',id:'1-1-1'} 以id为准 跳转对应模块
* 3.对象 {path:'sub1/home'} 以path为准 跳转对应模块
* 以上三种情况都跳转到对应的模块
*/
toAppReport(menu) {
this.$history.push(menu)
},
callParentChange() {
this.$messenger.send({
userInfo: { name: '张三,来自子系统2' }
})
}
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</style>
<template>
<div class="live-room">
<div class="container">
<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="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="memberRef" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="headingImg" slot-scope="scope">
<img class="img-60" :src="scope.scope.headingImg" />
</span>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import { getMerberList } from '@/api/modules/liveMember'
export default {
name: 'memberList',
data() {
return {
size: 'small',
searchForm: {
name: ''
},
getListApi: getMerberList,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '头像',
prop: 'headingImg',
addHtml: 'headingImg'
},
{
label: '昵称',
prop: 'nickName',
line: 2
},
{
label: '微信号',
prop: 'userName',
line: 2
},
{
label: '所属角色',
prop: 'roleList',
line: 2,
formatter: cellValue => {
var txt = ''
cellValue.roleList.forEach((item, index) => {
let tempTxt = this.baseDataList.roleList.find(k => k.confId == item).confName
txt = index ? (txt + ',' + tempTxt) : tempTxt
})
return txt
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseDataList: {
roleList: [{
confId: 0,
confName: '超级管理员'
}, {
confId: 1,
confName: '管理员'
}, {
confId: 2,
confName: '主播'
}, {
confId: 3,
confName: '运营者'
}]
}
}
},
created() {},
mounted: function() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleReset() {
this.searchForm = {
name: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs.memberRef.refreshTable()
}
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>
<!-- 直播间列表 -->
<template>
<div class="live-room">
<div class="container live-room">
<div class="flex">
<el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增直播</el-button>
</el-form-item>
</el-form>
<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="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="shareImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.shareImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
<el-button v-if="scope.scope.liveStatus == '102'" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<glsx-dialog title="分享" width="730px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p class="share-txt">海报</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary">保存图片</el-button>
</div>
<img :src="shareForm.posterUrl" />
</div>
<div class="flex box poster">
<div>
<p class="share-txt">小程序码</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary">保存图片</el-button>
</div>
<img :src="shareForm.cdnUrl" />
</div>
</div>
<div class="box page-route">
<div>
<p class="route-txt">短链</p>
<div class="flex">
<p style="width: 426px;">{{shareForm.pagePath}}</p>
<el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.pagePath)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div>
</div>
</div>
</glsx-dialog>
</div>
</div>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
// import glsxTable from '@/components/glsx-table'
import { getLiveRoomListApi, getLiveShareApi, deleteLiveRoomApi } from '@/api/modules/liveRoom'
import { liveStatusList } from '@/common/constant'
export default {
name: 'liveRoom',
data() {
return {
size: 'small',
searchForm: {
name: ''
},
// 分享 - 弹窗
shareForm: {},
isShareVisible: false,
noCancel: true,
// 表格组件
getListApi: getLiveRoomListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '最近开播',
prop: 'time',
width: '180',
formatter: cellValue => {
return cellValue.startTime + '-' + cellValue.endTime
}
},
{
label: '直播间名称',
prop: 'name',
line: 1
},
{
label: '房间号',
prop: 'roomId'
},
{
label: '主播',
prop: 'anchorName',
line: 1
},
{
label: '直播间图片',
prop: 'shareImgUrl',
line: 1,
addHtml: 'shareImgUrl'
},
{
label: '直播状态',
prop: 'liveStatus',
width: '80',
formatter: cellValue => {
return this.baseDataList.liveStatusList.find(item => item.confId == cellValue.liveStatus).confName
}
}
]
},
baseDataList: {
liveStatusList: liveStatusList
}
}
},
components: {
glsxDialog
// glsxTable
},
mounted() {
console.log(this.$common.utils)
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleShare(row) {
getLiveShareApi({ id: row.id }).then(res => {
console.log(res)
this.isShareVisible = !this.isShareVisible
this.shareForm = res
})
},
handleShareClose() {
// this.handleShare()
this.isShareVisible = !this.isShareVisible
},
handleSaveTxt(txt) {
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
this.$message({
message: '复制成功',
type: 'success'
})
},
handleDetail(row) {
this.$router.push({
// name: 'liveControl',
// path: '/liveRoom/liveControl',
name: 'ServicesLiveRoomLiveControl',
params: {
id: row.id
}
})
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该直播间?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteLiveRoomApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
// console.log(row)
// this.$history.push('services/liveRoom/editLiveRoom', { addOrEdit: addOrEdit, row: row || {} })
// this.eventBus.$emit('editRoom', {
// addOrEdit: addOrEdit,
// id: row ? row.id : ''
// })
this.$router.push({
name: 'ServicesLiveRoomEditLiveRoom',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : '-1'
}
// name: 'editLiveRoom',
// path: '/liveRoom/editLiveRoom'
})
},
handleSearch() {
this.$refs.liveRoomRef.refreshTable()
}
}
}
</script>
<style>
.live-room .flex {
display: flex;
justify-content: space-between;
}
.live-room .share-dialog .box {
background: #f7f7f7;
border-radius: 6px;
padding: 30px;
}
.live-room .share-dialog .poster img {
width: 150px;
height: 240px;
margin-left: 45px;
}
.live-room .share-dialog .page-route {
margin-top: 16px;
}
.live-room .share-dialog .page-route .route-txt {
font-weight: bold;
padding-bottom: 10px;
}
.live-room .share-dialog .share-txt {
font-weight: bold;
margin-bottom: 50px;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<glsx-dialog title="关联门店" :isVisible.sync="relateStoreVisible" width="70%" btnOkLabel="关联" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="12">
<el-table ref="seletingTable" :data="selectingData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center">
<!-- <template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.yqMerchantName }}</span>
</template> -->
</el-table-column>
<!-- <el-table-column prop="merchantName" label="4S店名称" align="center">
<template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
</template>
</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" border height="464px">
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
<!-- <el-table-column prop="merchantName" label="4S店名称" align="center"></el-table-column> -->
<el-table-column label="删除" align="center" width="50">
<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 {
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.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
// if (this.sourcePage === 'editProduct') {
// isSelect = row.isSetUpgradeSettleRule
// }
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantNo + '')
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantNo)) {
this.$refs.seletingTable.toggleRowSelection(item, true)
}
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
pageNum: this.pageNum,
pageSize: this.pageSize
}).then(res => {
this.selectingData = res.list
this.total = res.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) {
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 && !isServed) {
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.$refs.seletingTable.toggleRowSelection(row)
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true
})
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>
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
// 表格组件
getListApi: '',
tableData: [
{
id: 1,
name: '商品名称1'
},
{
id: 2,
name: '商品名称2'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'name'
},
{
label: '缩略图',
prop: 'title'
},
{
label: '价格(元)',
prop: 'status'
},
{
label: '来源门店',
prop: ''
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
}
},
components: {
glsxDialog
},
mounted() {},
methods: {
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style></style>
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
}
module.exports = {
outputDir: `../dist/${packageName}`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components')
}
},
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
vue: 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts'
}
},
devServer: {
hot: true,
disableHostCheck: true,
host: process.env.VUE_APP_HOST,
port: process.env.VUE_APP_PORT,
headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!