Commit 3efa4a69 by wangql

init

0 parents
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": "blog",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.3.2",
"glsx-components": "^1.0.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",
"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">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<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 -->
</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
/**
* 新增参数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
}
.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;
}
/**
* 根据路由匹配地址
* @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
/*
* @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',
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'
}
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
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-22 10:07:44
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
import App from './App.vue'
import apis from './api'
import store from './store'
import { message } from './plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import { VueRouter, routes as staticRoutes, getRoutes } from './router'
import 'glsx-components/dist/glsx-components.css'
import './public-path'
Vue.config.productionTip = false
let instance = null
let router = null
export async function bootstrap({ history, common, messenger, globalState }) {
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
}
async function singleRender() {
const { response, request, sign, secret } = await fetchConfig()
const http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } })
await _render(http, staticRoutes, '/')
}
async function qiankunRender(props = {}) {
const { response, request, sign, secret } = await fetchConfig()
const { name, id, globalState, routerBase, common } = props
const routes = getRoutes({ name, id, routesData: common.utils.deepClone(globalState.routers) })
const http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
await _render(http, routes, routerBase, globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'])
}
async function _render(http, routes, base, permissions) {
Vue.prototype.$http = http
Vue.prototype.$apis = apis
Vue.use(GLButton, { permissions })
router = new VueRouter({
base,
routes,
mode: 'history'
})
instance = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
}
// 独立运行时
if (!window.__POWERED_BY_QIANKUN__) {
singleRender()
}
export async function mount(props = {}) {
await qiankunRender(props)
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
export const http = params => instance.$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 } 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)
export const message = Message
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({ name, id, routesData }) {
const routes = []
if (routesData && name && id) {
for (let i = 0, length = routesData.length; i < length; i += 1) {
const element = routesData[i]
if (element && element.path && element.path.includes(name) && element.meta && element.meta.id && element.meta.id.startsWith(id)) {
const path = element.path.slice(name.length + 1)
element.path = path
element.component = () => import('@/views' + path + '.vue')
routes.push(element)
}
}
}
return routes
}
export { VueRouter, routes, getRoutes }
const staticRoutes = Object.freeze([
{
name: 'MemberList',
path: '/liveMember/memberList',
component: resolve => require([`@/views/liveMember/memberList.vue`], resolve),
meta: {}
}
])
export default staticRoutes
/*
* @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>
<d2-container>
<el-card shadow="never" slot="header">
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form-item label="商品搜索:">
<el-input v-model="formInline.userName" placeholder="请输入商品名称" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button :loading="tableLoading" @click="reset()">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
<el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" />
<el-table-column prop="pic" label="基本信息" >
<template slot-scope="scope">
<img @src="scope.row.pic" style="width: 50px;height:50px;"/>
</template>
</el-table-column>
<el-table-column prop="userName" label="价格(元)" />
<el-table-column prop="userCode" label="来源门店" />
</el-table>
<div class="pagination_list">
<el-pagination
background
layout="sizes, total,prev, pager, next, jumper"
:total="pageTotal"
:page-size="pageSize"
:page-sizes="pageSizes"
@current-change="getList"
@size-change="changePageSize"
/>
</div>
</div>
<!-- 表格区域 end -->
</d2-container>
</template>
<script>
// import {
// GETLISTUSERINFO,
// UPDATEPASSWORD
// } from '@/http/interface'
export default {
name: 'memberList',
components: {
// 'glsx-dialog': GlsxDialog,
// 'add-cus': AddCus,
},
data() {
return {
formInline: {},
tableData: [],
tableLoading: false,
pageTotal: 0,
userInfo: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
tdWidth: 170,
DATEFORMATE: (str, type) => { return this.$Util.dateFormate(str, type) },
showAddDialog: false,
showPassDialog: false,
form_pass : {},
}
},
created() {
},
mounted: function() {
this.getList()
},
methods: {
/**
* 查询列表
*/
getList: function(current) {
const _this = this
const oParams = _this.getParams()
// oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
let list = [{
id :1,
pic : 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName : 'userName',
userCode : 'userCode',
roleName : 'roleName'
}]
// GETLISTUSERINFO(oParams).then(res => {
// console.log(res)
_this.tableLoading = false
// if (res.returnCode == 0) {
// const { data } = res
// const { total, list } = data
_this.tableData = list || []
// _this.pageTotal = total
// }
// })
},
/**
* 获取查询参数
*/
getParams: function() {
const oParams = this.formInline
oParams.pageSize = this.pageSize
return oParams
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
},
}
}
</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>
<el-card shadow="never" slot="header">
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form-item label="成员搜索:">
<el-input v-model="formInline.userName" placeholder="请输入微信号或者昵称" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button :loading="tableLoading" @click="reset()">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
<el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" />
<el-table-column prop="pic" label="头像" >
<template slot-scope="scope">
<img @src="scope.row.pic" style="width: 50px;height:50px;"/>
</template>
</el-table-column>
<el-table-column prop="userName" label="昵称" />
<el-table-column prop="userCode" label="微信号" />
<el-table-column prop="roleName" label="所属角色" />
</el-table>
<div class="pagination_list">
<el-pagination
background
layout="sizes, total,prev, pager, next, jumper"
:total="pageTotal"
:page-size="pageSize"
:page-sizes="pageSizes"
@current-change="getList"
@size-change="changePageSize"
/>
</div>
</div>
<!-- 表格区域 end -->
</div>
</template>
<script>
// import {
// GETLISTUSERINFO,
// UPDATEPASSWORD
// } from '@/http/interface'
export default {
name: 'memberList',
components: {
// 'glsx-dialog': GlsxDialog,
// 'add-cus': AddCus,
},
data() {
return {
formInline: {},
tableData: [],
tableLoading: false,
pageTotal: 0,
userInfo: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
tdWidth: 170,
DATEFORMATE: (str, type) => { return this.$Util.dateFormate(str, type) },
showAddDialog: false,
showPassDialog: false,
form_pass : {},
}
},
created() {
},
mounted: function() {
this.getList()
},
methods: {
/**
* 查询列表
*/
getList: function(current) {
const _this = this
const oParams = _this.getParams()
// oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
let list = [{
id :1,
pic : 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName : 'userName',
userCode : 'userCode',
roleName : 'roleName'
}]
// GETLISTUSERINFO(oParams).then(res => {
// console.log(res)
_this.tableLoading = false
// if (res.returnCode == 0) {
// const { data } = res
// const { total, list } = data
_this.tableData = list || []
// _this.pageTotal = total
// }
// })
},
/**
* 获取查询参数
*/
getParams: function() {
const oParams = this.formInline
oParams.pageSize = this.pageSize
return oParams
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
},
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
// const baseUrl = process.env.VUE_APP_BASE_URL;
const baseUrl = '/'
const resolve = dir => path.join(__dirname, dir)
module.exports = {
outputDir: `dist`,
publicPath: node_env ? baseUrl : '/',
assetsDir: 'static',
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}`
}
},
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.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!