Commit b62e1368 by 王志慧

fixed

1 parent f2a7fc48
Showing 84 changed files with 243 additions and 534 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.
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}`)
...@@ -93,10 +93,17 @@ const conversationDetailPage=(params)=>{ ...@@ -93,10 +93,17 @@ const conversationDetailPage=(params)=>{
// } // }
// // 同步数据 // // 同步数据
// const syncBadge(data = {}) ={ const syncBadge(params = {}) =>{
// data.method = `${path}badge.syncBadge` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// return request(data, "post") params.routerMethod = `dj.api.mindworkplate.badge.syncBadge`
// } return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
...@@ -107,5 +114,6 @@ export default { ...@@ -107,5 +114,6 @@ export default {
listShop4sByRef, listShop4sByRef,
getPointCategory, getPointCategory,
conversationCheckList, conversationCheckList,
conversationDetailPage conversationDetailPage,
syncBadge
} }
<!-- 工牌管理 -->
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
>
<div slot="firstClassify">
<el-select
v-model="searchForm.firstClassify"
clearable
placeholder="请选择"
@change="changeClassify"
>
<el-option
v-for="item in baseData.firstClassifyList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</div>
<div slot="secondClassify">
<el-select
v-model="searchForm.secondClassify"
clearable
placeholder="请选择"
>
<el-option
v-for="item in baseData.secondClassifyList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</div>
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="theader">
<h2>质检点管理</h2>
</div>
<d2-table
ref="pointTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
/>
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
// import { conversationPointPage, getPointCategory } from "@api/resident"
export default {
name: "inspectionPoint",
data() {
return {
searchForm: {
firstClassify: "",
secondClassify: "",
content: ""
},
searchFormSearch: {},
showFormData: [
{
label: "话术内容",
name: "content",
type: "input",
isClear: true
},
{
label: "一级分类",
name: "firstClassify",
addHtml: "firstClassify"
},
{
label: "二级分类",
name: "secondClassify",
addHtml: "secondClassify"
}
],
getListApi: this.$apis.equality.conversationPointPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "话术内容",
prop: "content",
width: "550px"
},
{
label: "一级分类",
prop: "firstClassify"
},
{
label: "一级权重",
prop: "firstWeight"
},
{
label: "二级分类",
prop: "secondClassify"
},
{
label: "二级权重",
prop: "secondWeight"
},
{
label: "更新时间",
prop: "updatedDate",
formatter: (cellValue) => {
return cellValue.updatedDate
? Util.dateFormate(cellValue.updatedDate, "YYYY-MM-DD HH:mm:ss")
: ""
}
}
]
},
baseData: {
firstClassifyList: [],
secondClassifyList: []
}
}
},
mounted() {
// this.getPointCategory()
},
methods: {
getPointCategory() {
this.classifyMap = new Map()
this.$apis.equality.getPointCategory().then((res) => {
this.baseData.firstClassifyList = Object.keys(res)
for (let item in res) {
this.classifyMap.set(item, res[item])
}
})
},
changeClassify() {
this.searchForm.secondClassify = ""
this.baseData.secondClassifyList = this.classifyMap.get(
this.searchForm.firstClassify
)
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
handleSearch() {
this.$refs.pointTable.refreshTable(true, true)
},
handleReset() {
this.searchForm = {
firstClassify: "", //质检日期
secondClassify: "",
content: ""
}
this.baseData.secondClassifyList = []
this.$refs.pointTable.refreshTable()
}
}
}
</script>
<style scoped lang="scss">
.theader {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
h2 {
font-weight: 600;
font-size: 16px;
color: #333333;
}
span {
font-size: 14px;
color: #999999;
margin-right: 10px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 工牌管理 -->
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
>
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="theader">
<h2>工牌管理</h2>
<div>
<span>最近同步:{{ currentTime }}</span>
<el-button @click="handleUpdate" size="small" plain type="primary">
数据同步
</el-button>
</div>
</div>
<d2-table
ref="cardTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot="store" slot-scope="scope">
<template
v-if="scope.scope.storeList && scope.scope.storeList.length > 1"
>
<span>{{ scope.scope.storeList.slice(0, 1).join("") }}</span>
<el-popover placement="top" width="fit-content" trigger="hover">
<div
v-for="(item, index) in scope.scope.storeList"
:key="index"
>
{{ item }}
</div>
<span class="more-info" slot="reference"
>...({{ scope.scope.storeList.length }})</span
>
</el-popover>
</template>
<template v-else>
<span
v-if="!scope.scope.storeList || !scope.scope.storeList.length"
>--</span
>
<span v-else>{{ scope.scope.storeList.join("") }}</span>
</template>
</div>
<div slot="service" slot-scope="scope">
<template
v-if="
scope.scope.serviceList && scope.scope.serviceList.length > 1
"
>
<span>{{ scope.scope.serviceList.slice(0, 1).join("") }}</span>
<el-popover placement="top" width="fit-content" trigger="hover">
<div
v-for="(item, index) in scope.scope.serviceList"
:key="index"
>
{{ item }}
</div>
<span class="more-info" slot="reference"
>...({{ scope.scope.serviceList.length }})</span
>
</el-popover>
</template>
<template v-else>
<span
v-if="
!scope.scope.serviceList || !scope.scope.serviceList.length
"
>--</span
>
<span v-else>{{ scope.scope.serviceList.join("") }}</span>
</template>
</div>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
/>
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
// import { employeeBadgelistWithPage, syncBadge } from "@api/resident"
export default {
name: "workCard",
components: {},
data() {
return {
searchForm: {
phoneNumber: "",
employeeName: "",
badgeManufacturerId: "",
badgeId: ""
},
isQuery: true,
currentTime: "",
searchFormSearch: {},
showFormData: [
{
label: "工牌编号",
name: "badgeId",
type: "input",
maxlength: "20",
isClear: true
},
{
label: "工牌厂商",
name: "badgeManufacturerId",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "badgeManufacturerList"
},
{
label: "员工姓名",
name: "employeeName",
type: "input",
maxlength: "20",
isClear: true
},
{
label: "手机号",
name: "phoneNumber",
type: "input",
maxlength: "40",
isClear: true
}
],
getListApi: employeeBadgelistWithPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "工牌编号",
prop: "badgeId",
width: "160px"
},
{
label: "工牌厂商",
prop: "badgeManufacturerId",
width: "160px"
},
{
label: "员工",
prop: "employeeName",
width: "250px"
},
{
label: "手机号",
prop: "phoneNumber",
width: "250px"
},
{
label: "归属门店",
prop: "storeMerchantNo",
addHtml: "store",
width: "180px"
},
{
label: "归属服务商",
addHtml: "service",
width: "180px",
prop: "serviceMerchantNo"
},
{
label: "设备绑定时间",
prop: "searchdate",
width: "150px",
formatter: (cellValue) => {
return cellValue.searchdate
? Util.dateFormate(cellValue.searchdate, "YYYY-MM-DD HH:mm:ss")
: ""
}
}
]
},
baseData: {
badgeManufacturerList: [
{
confId: "1",
confLabel: "嘟嘟"
}
]
}
}
},
mounted() {
this.currentTime = Util.dateFormate(
new Date().getTime(),
"YYYY-MM-DD HH:mm:ss"
)
this.getOptionsList()
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
handleUpdate() {
if (this.isQuery) {
this.syncBadge()
setTimeout(() => {
this.isQuery = true
}, 10000)
}
},
syncBadge() {
syncBadge()
this.currentTime = Util.dateFormate(
new Date().getTime(),
"YYYY-MM-DD HH:mm:ss"
)
this.$refs.cardTable.refreshTable(true, true)
this.isQuery = false
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
handleSearch() {
this.$refs.cardTable.refreshTable(true, true)
},
handleReset() {
this.searchForm = {
phoneNumber: "",
employeeName: "",
badgeManufacturerId: "",
badgeId: ""
}
this.$refs.cardTable.refreshTable()
}
}
}
</script>
<style scoped lang="scss">
.theader {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
h2 {
font-weight: 600;
font-size: 16px;
color: #333333;
}
span {
font-size: 14px;
color: #999999;
margin-right: 10px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
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`, 'https://webapi.amap.com/loader.js']
}
module.exports = {
outputDir: `dist`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components')
}
},
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
vue: 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts',
AMap: 'AMap'
}
},
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!