Commit 5ebffb4e by ym

test

1 parent 229777a0
{ {
"name": "home",
"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",
"glsx-common": "^1.4.4",
"glsx-components": "^1.0.4",
"glsx-table": "^1.0.9"
},
"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",
"element-theme-chalk": "^2.15.6",
"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 newline at end of file \ No newline at end of file
"name": "home",
"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",
"glsx-common": "^1.4.6",
"glsx-components": "^1.0.8",
"glsx-table": "^1.0.9"
},
"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",
"element-theme-chalk": "^2.15.6",
"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"
]
}
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 --> <!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
......
...@@ -106,12 +106,12 @@ img { ...@@ -106,12 +106,12 @@ img {
::-webkit-scrollbar { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 8px; width: 6px;
height: 1px; height: 1px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius: 7px; border-radius: 4px;
background-color: #E9E8FF; background-color: rgba(144, 147, 153, .3);
} }
\ No newline at end of file \ No newline at end of file

27.9 KB | W: | H:

23.8 KB | W: | H:

src/assets/img/home/guide2.png
src/assets/img/home/guide2.png
src/assets/img/home/guide2.png
src/assets/img/home/guide2.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<div class="glsx-table" :class="{ hasTableContent: showClass }"> <div class="glsx-table">
<el-table <el-table style="width: 100%" id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle">
id="initTable" <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
:ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" <el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
:data="getListApi ? data : tableData" <el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :align="item.align || 'center'" :sortable="item.sortable">
:row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading"
:border="border"
:highlight-current-row="true"
:stripe="true"
@sort-change="sortChange"
@selection-change="handleSelect"
:size="size"
:header-cell-style="headerStyle"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection"
width="55"
:selectable="checkSelectable"
:reserve-selection="true"
></el-table-column>
<el-table-column
v-if="hasNum"
align="center"
width="60px"
label="序号"
type="index"
:index="
(index) =>
index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
"
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align || 'center'"
:sortable="item.sortable"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:width="item.width"
></slot>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span <span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="item.formatter(scope.row)" v-text="item.formatter(scope.row)"></span>
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }"
:title="item.formatter(scope.row)"
v-text="item.formatter(scope.row)"
></span>
</template> </template>
<template v-else-if="getListApi"> <template v-else-if="getListApi">
<span <span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="scope.row[item.prop]" v-text="scope.row[item.prop]"></span>
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }"
:title="scope.row[item.prop]"
v-text="scope.row[item.prop]"
></span>
</template> </template>
<template v-else> <template v-else>
<span <span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="tableData[scope.$index][item.prop]" v-text="tableData[scope.$index][item.prop]"></span>
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }"
:title="tableData[scope.$index][item.prop]"
v-text="tableData[scope.$index][item.prop]"
></span>
</template> </template>
<template v-if="item.addSymbol"> <template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span> <span v-text="item.addSymbol"></span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-if="tableParams.tableOption" label="操作" :align="tableParams.tableOption.align || 'center'" :width="tableParams.tableOption.width || '200'" fixed="right">
v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align || 'center'"
:width="tableParams.tableOption.width || '200'"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="auth-button" :scope="scope.row"></slot> <slot name="auth-button" :scope="scope.row"></slot>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty" class="emptyBg"> <template slot="empty" class="emptyBg">
<img class="noDataImg" :src="noDataImg" v-if="noDataImg" alt="" /> <img class="noDataImg" :src="noDataImg" v-if="noDataImg" alt="" />
<div>{{ noDataText }}</div> <div>{{ noDataText }}</div>
<slot name="additionalContent"></slot> <slot name="additionalContent"></slot>
</div> </template>
</el-table> </el-table>
<el-pagination <el-pagination v-if="hasPage" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page[this.pageConf.pageNum]" :page-sizes="[10, 20, 30, 40]" :page-size="page[this.pageConf.pageSize]" :total="getListApi ? total : tableTotal" :layout="layout"></el-pagination>
v-if="hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page[this.pageConf.pageNum]"
:page-sizes="[10, 20, 30, 40]"
:page-size="page[this.pageConf.pageSize]"
:total="getListApi ? total : tableTotal"
:layout="layout"
></el-pagination>
</div> </div>
</template> </template>
<script> <script>
import { Table, TableColumn, Pagination } from "element-ui"; import { Table, TableColumn, Pagination } from 'element-ui'
export default { export default {
name: "GLTable", name: 'GLTable',
components: { components: {
[Table.name]: Table, [Table.name]: Table,
[TableColumn.name]: TableColumn, [TableColumn.name]: TableColumn,
[Pagination.name]: Pagination, [Pagination.name]: Pagination
}, },
props: { props: {
size: { size: {
type: String, type: String,
default: "medium", default: 'medium'
}, },
height: { height: {
type: String, type: String,
default: "", default: ''
}, },
// maxHeight:{ // maxHeight:{
// type:String, // type:String,
...@@ -136,80 +61,85 @@ export default { ...@@ -136,80 +61,85 @@ export default {
// }, // },
noDataImg: { noDataImg: {
type: String, type: String,
default: "", default: ''
}, },
noDataText: { noDataText: {
type: String, type: String,
default: "暂无数据", default: '暂无数据'
}, },
border: { border: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
headerStyle: { headerStyle: {
type: Object, type: Object,
default: () => {}, default: () => {}
},
//表格需要多传入一个id的情况
tableId: {
type: String,
default: ''
}, },
// 搜索条件 // 搜索条件
searchForm: { searchForm: {
type: Object, type: Object,
default: () => {}, default: () => {}
}, },
// 是否定制表头 // 是否定制表头
isCustomHead: { isCustomHead: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// 表头展示 // 表头展示
customHeadShowList: { customHeadShowList: {
type: Array, type: Array,
default: () => [], default: () => []
}, },
// 表格数据-外部传入 // 表格数据-外部传入
tableData: { tableData: {
type: Array, type: Array,
default: () => [], default: () => []
}, },
tableTotal: { tableTotal: {
type: Number, type: Number,
default: 0, default: 0
}, },
// 获取列表接口 // 获取列表接口
getListApi: { getListApi: {
type: Function, type: Function,
default: null, default: null
}, },
// 搜索前操作 // 搜索前操作
beforeSearchFn: { beforeSearchFn: {
type: Function, type: Function,
default: () => { default: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(); resolve()
}); })
}, }
}, },
// 分页,默认有 // 分页,默认有
hasPage: { hasPage: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
pageConf: { pageConf: {
type: Object, type: Object,
default: () => ({ default: () => ({
pageSize: "pageSize", pageSize: 'pageSize',
pageNum: "pageNum", pageNum: 'pageNum',
totalCount: "totalCount", totalCount: 'totalCount'
}), })
}, },
// 分页组件配置 // 分页组件配置
layout: { layout: {
type: String, type: String,
default: "sizes,total,->,prev,pager,next,jumper", default: 'sizes,total,->,prev,pager,next,jumper'
}, },
// 序号,默认有 // 序号,默认有
hasNum: { hasNum: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
tableParams: { tableParams: {
type: Object, type: Object,
...@@ -228,17 +158,17 @@ export default { ...@@ -228,17 +158,17 @@ export default {
// 设置禁止选中的行数据 // 设置禁止选中的行数据
checkSelectKey: { checkSelectKey: {
type: String, type: String,
default: "", default: ''
}, },
// 设置禁止选中的值 // 设置禁止选中的值
checkSelectVal: { checkSelectVal: {
type: Array, type: Array,
default: () => [], default: () => []
}, },
// 后端返回列表参数名 // 后端返回列表参数名
listName: { listName: {
type: String, type: String,
default: "", default: ''
}, },
// 表格操作,默认没有 // 表格操作,默认没有
// tableOption: { // tableOption: {
...@@ -248,11 +178,11 @@ export default { ...@@ -248,11 +178,11 @@ export default {
// 表格栏 // 表格栏
tableColumns: { tableColumns: {
type: Array, type: Array,
default: () => [], default: () => []
}, }
}; }
}, }
}, }
}, },
data() { data() {
...@@ -267,151 +197,143 @@ export default { ...@@ -267,151 +197,143 @@ export default {
tableColumns: [], tableColumns: [],
showClass: false, showClass: false,
}; tableHeightValues: null
}
}, },
watch: { watch: {
customHeadShowList(val) { customHeadShowList(val) {
this.isCustomHead && this.findShowHeadCol(); this.isCustomHead && this.findShowHeadCol()
}, }
data: { // data: {
immediate: true, // immediate: true,
handler(val) { // handler(val) {
this.showClass = val.length > 0 ? true : false; // this.showClass = val.length > 0 ? true : false
}, // },
deep: true, // deep: true
}, // }
}, },
methods: { methods: {
findShowHeadCol() { findShowHeadCol() {
this.tableColumns = []; this.tableColumns = []
this.tableParams.tableColumns.forEach((item) => { this.tableParams.tableColumns.forEach(item => {
let isCustomCol = item.hasOwnProperty("isCustomCol"); let isCustomCol = item.hasOwnProperty('isCustomCol')
if ( if (!isCustomCol || (isCustomCol && this.customHeadShowList.includes(item.label))) {
!isCustomCol || this.tableColumns.push(item)
(isCustomCol && this.customHeadShowList.includes(item.label))
) {
this.tableColumns.push(item);
} }
}); })
}, },
// 设置禁止选中的行数据 // 设置禁止选中的行数据
checkSelectable(row) { checkSelectable(row) {
if (this.tableParams.checkSelectKey && this.tableParams.checkSelectVal.length > 0) { if (this.tableParams.checkSelectKey && this.tableParams.checkSelectVal.length > 0) {
return ( return this.tableParams.checkSelectVal.indexOf(row[this.tableParams.checkSelectKey]) == -1
this.tableParams.checkSelectVal.indexOf(row[this.tableParams.checkSelectKey]) ==
-1
);
} else { } else {
return true; return true
} }
}, },
// 排序 // 排序
sortChange({ column, prop, order }) { sortChange({ column, prop, order }) {
this.$emit("sortChange", { column, prop, order }); this.$emit('sortChange', { column, prop, order })
}, },
// 多选 // 多选
handleSelect(val) { handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val; this.mutiSelectArr[this.tableParams.mutiSelectName] = val
}, },
// 清空多选 // 清空多选
clearMutiSelect() { clearMutiSelect() {
this.mutiSelectArr[this.tableParams.mutiSelectName] = []; this.mutiSelectArr[this.tableParams.mutiSelectName] = []
this.$refs[this.tableParams.mutiSelectName + "MutiTable"].clearSelection(); this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].clearSelection()
}, },
//设置表格高度 //设置表格高度
setTableHeightFun(navHeight = 0) { setTableHeightFun(navHeight = 0) {
//navHeight 传值底部高度 //navHeight 传值底部高度
let paginationHeight; var baseNavEle = document.querySelector('.scrm-base-nav')
if(document.querySelector(".el-pagination")) { var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
paginationHeight = document.querySelector(".el-pagination").clientHeight + 20; var baseNavEleHeight = 0
}else { var baseSubNavEleHeight = 0
paginationHeight = 0; if (baseNavEle && baseNavEle) {
baseNavEleHeight = baseNavEle.clientHeight //60
baseSubNavEleHeight = baseSubNavEle.clientHeight //14
}
let paginationHeight
if (document.querySelector('.el-pagination')) {
paginationHeight = document.querySelector('.el-pagination').clientHeight + 20
} else {
paginationHeight = 0
} }
let offsettop = document.getElementById("initTable").offsetTop; let offsettop = document.getElementById('initTable').offsetTop
let clientHeight = document.documentElement.clientHeight; let clientHeight = document.documentElement.clientHeight
document.getElementById("initTable").style.height = // document.getElementById('initTable').style.height = clientHeight - offsettop - paginationHeight - navHeight + 'px'
clientHeight - offsettop - paginationHeight - navHeight + "px"; // document.querySelector('.el-table__empty-block').style.height=(clientHeight - offsettop - paginationHeight - navHeight)+'px';
this.tableHeightValues = clientHeight - offsettop - paginationHeight - baseNavEleHeight - baseSubNavEleHeight - 10 - 30 - 20 + 'px'
}, },
refreshTable(isResetPageNum = true, isClearMuti = true) { refreshTable(isResetPageNum = true, isClearMuti = true) {
this.beforeSearchFn().then((res) => { this.beforeSearchFn().then(res => {
// 清空多选 // 清空多选
isClearMuti && this.clearMutiSelect(); isClearMuti && this.clearMutiSelect()
this.loading = true; this.loading = true
isResetPageNum && (this.page[this.pageConf.pageNum] = 1); isResetPageNum && (this.page[this.pageConf.pageNum] = 1)
var params = { var params = {
...this.page, ...this.page,
...this.searchForm, ...this.searchForm
}; }
if (this.tableId) {
params.id = this.tableId
}
this.getListApi(params) this.getListApi(params)
.then((res) => { .then(res => {
console.log(res); console.log(res)
this.data = this.findVal(res, this.tableParams.listName); this.data = this.findVal(res, this.tableParams.listName)
this.total = this.findVal(res, this.pageConf.totalCount); this.total = this.findVal(res, this.pageConf.totalCount)
this.loading = false; this.loading = false
if (this.data.length) {
this.$emit('setTableFinishFun', this.data) //表格请求到数据
}
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}); })
}, },
// 找返回值 // 找返回值
findVal(res, rankStr) { findVal(res, rankStr) {
var rankList = rankStr.split("."); var rankList = rankStr.split('.')
if (!rankStr) { if (!rankStr) {
return res; return res
} }
return this.findVal(res[rankList[0]], rankList.splice(1).join(".")); return this.findVal(res[rankList[0]], rankList.splice(1).join('.'))
}, },
// 每页条数 // 每页条数
handleSizeChange(value) { handleSizeChange(value) {
let offsettop = document.getElementById("initTable").offsetTop; let offsettop = document.getElementById('initTable').offsetTop
console.log("表格距离顶部1", offsettop); console.log('表格距离顶部1', offsettop)
this.page[this.pageConf.pageSize] = value; this.page[this.pageConf.pageSize] = value
this.getListApi this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
? this.refreshTable(false, false)
: this.$emit("refreshTable", this.page);
}, },
// 页码 // 页码
handleCurrentChange(value) { handleCurrentChange(value) {
this.page[this.pageConf.pageNum] = value; this.page[this.pageConf.pageNum] = value
this.getListApi this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
? this.refreshTable(false, false) }
: this.$emit("refreshTable", this.page);
},
}, },
mounted() { mounted() {
this.isCustomHead this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns)
? this.findShowHeadCol() this.page = {}
: (this.tableColumns = this.tableParams.tableColumns); this.page[this.pageConf.pageSize] = 10
this.page = {}; this.page[this.pageConf.pageNum] = 1
this.page[this.pageConf.pageSize] = 10; this.getListApi && this.refreshTable()
this.page[this.pageConf.pageNum] = 1; }
this.getListApi && this.refreshTable(); }
// this.$nextTick(() => {
// var _this=this
// setTimeout(() => {
// // 使用getListApi获取和返回数组为空时算高度 !(_this.getListApi && _this.data.length==0)
// if(_this.getListApi ){
// }
// }, 200)
// })
},
};
</script> </script>
<style> <style>
...@@ -437,14 +359,61 @@ export default { ...@@ -437,14 +359,61 @@ export default {
padding-right: 14px !important; padding-right: 14px !important;
} }
.glsx-table .emptyBg { .glsx-table .emptyBg {
display: inline-block; display: flex;
/* margin-top: 150px; */ flex-direction: column;
justify-content: center;
align-items: center;
height: 100%; height: 100%;
} }
.glsx-table .emptyBg div { .el-table__body-wrapper::-webkit-scrollbar {
margin: -20px 0 10px; width: 10px;
height: 100%; height: 10px;
/* display: none; */
}
/*正常情况下滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb {
/* background-color: rgba(0, 0, 0, 0.2); */
background: #e9e8ff;
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在滑块上时滑块的样式*/
/* &::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
} */
/*正常时候的主干部分*/
.el-table__body-wrapper::-webkit-scrollbar-track {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
} }
/*鼠标悬浮在滚动条上的主干部分*/
/* .el-table__body-wrapper::-webkit-scrollbar-track:hover {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.01);
} */
/* .hasTableContent .el-table__body{ /* .hasTableContent .el-table__body{
height: 100%; height: 100%;
} */ } */
......
...@@ -17,7 +17,7 @@ module.exports = { ...@@ -17,7 +17,7 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'https://scrm.test.glsx.com.cn', baseURL: 'http://192.168.1.254',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -11,8 +11,14 @@ VueRouter.prototype.push = function push(location) { ...@@ -11,8 +11,14 @@ VueRouter.prototype.push = function push(location) {
function getRoutes(routesData) { function getRoutes(routesData) {
return routesData.reduce((routes, route) => { return routesData.reduce((routes, route) => {
routes.push({...route, routes.push({...route,
component: () => component: () => {
import ('@/views' + route.path + '.vue') if (route.path == '/home/index' && Vue.prototype.$globalState.session.accountLevel != 4) {
return import ('@/views/ehome/index.vue')
} else {
return import ('@/views' + route.path + '.vue')
}
}
}) })
return routes return routes
}, []) }, [])
......
...@@ -5,12 +5,6 @@ const staticRoutes = Object.freeze([{ ...@@ -5,12 +5,6 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/home/index.vue`], resolve) component: resolve => require([`@/views/home/index.vue`], resolve)
}, },
{ {
name: 'Ehome',
path: '/ehome/index',
meta: {},
component: resolve => require([`@/views/ehome/index.vue`], resolve)
},
{
name: 'EnterpriseWechat', name: 'EnterpriseWechat',
path: '/enterpriseWechat/index', path: '/enterpriseWechat/index',
component: resolve => require([`@/views/enterpriseWechat/index.vue`], resolve), component: resolve => require([`@/views/enterpriseWechat/index.vue`], resolve),
......
...@@ -8,6 +8,8 @@ import { getRoutes } from '@/router' ...@@ -8,6 +8,8 @@ import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/src/theme/theme.scss' import 'glsx-components/src/theme/theme.scss'
import '@/assets/css/common.scss' import '@/assets/css/common.scss'
let routes = [] let routes = []
......
...@@ -18,14 +18,20 @@ const render = (base, routes) => { ...@@ -18,14 +18,20 @@ const render = (base, routes) => {
mode: 'history' mode: 'history'
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (from.path == '/' && (to.path == '/home/index' || to.path == '/ehome/index')) { let modelStatus = false;
next(); if (Vue.prototype.$globalState.session.merchantModel == 1 && Vue.prototype.$globalState.session.accountLevel == 1) {
modelStatus = true;
}
if (Vue.prototype.$globalState.session.merchantModel == 2 && Vue.prototype.$globalState.session.accountLevel == 4) {
modelStatus = true;
}
if (from.path == '/' && (to.path == '/home/index' || to.path == '/ehome/index') && modelStatus) {
Vue.prototype.$apis.ww.getStatus({}).then((res) => { Vue.prototype.$apis.ww.getStatus({}).then((res) => {
// if (res.status != 'SUCCESS') { if (res.status != 'SUCCESS') {
// next('/enterpriseWechat/index') next('/enterpriseWechat/index')
// } else { } else {
// next() next()
// } }
}) })
} else { } else {
next(); next();
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
</el-radio-group> </el-radio-group>
</div> </div>
<div class="summary-ranking-th"> <div class="summary-ranking-th">
<div class="summary-ranking-sno">序号</div> <div class="summary-ranking-sno">排名</div>
<div class="summary-ranking-name">名店名称</div> <div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div> <div class="summary-ranking-value">加企微客户数</div>
</div> </div>
<div class="chart-empty" v-if="custSortList.length == 0"> <div class="chart-empty" v-if="custSortList.length == 0">
<img src="@/assets/img/empty.png" /> <img src="@/assets/img/empty.png" />
...@@ -40,10 +40,11 @@ ...@@ -40,10 +40,11 @@
<div class="summary-progress-barout"></div> <div class="summary-progress-barout"></div>
<div <div
class="summary-progress-barin" class="summary-progress-barin"
:style="{ width: (100 * item.addEntmicroCount) / custSortMax + '%' }" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"
></div> ></div>
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</div> </div>
<div class="summary-progress-value">{{ item.addEntmicroCount }}</div> <div class="summary-progress-value">{{ item.custCount }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -61,8 +62,8 @@ ...@@ -61,8 +62,8 @@
</el-radio-group> </el-radio-group>
</div> </div>
<div class="summary-ranking-th"> <div class="summary-ranking-th">
<div class="summary-ranking-sno">序号</div> <div class="summary-ranking-sno">排名</div>
<div class="summary-ranking-name">名店名称</div> <div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div> <div class="summary-ranking-value">总产值</div>
</div> </div>
<div class="chart-empty" v-if="summaryArr.length == 0"> <div class="chart-empty" v-if="summaryArr.length == 0">
...@@ -110,6 +111,7 @@ export default { ...@@ -110,6 +111,7 @@ export default {
dialogVisible: false, dialogVisible: false,
rankHeight: 0, rankHeight: 0,
custSortMax: 0, custSortMax: 0,
custAvergCount: 0,
chartStatus: false, chartStatus: false,
radioStore: "1", radioStore: "1",
radioOutput: "1", radioOutput: "1",
...@@ -134,6 +136,7 @@ export default { ...@@ -134,6 +136,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.custSortList = res.custSortList; this.custSortList = res.custSortList;
this.custAvergCount = res.custAvergCount;
if (this.custSortList.length == 0) { if (this.custSortList.length == 0) {
this.dialogVisible = true; this.dialogVisible = true;
return; return;
...@@ -164,8 +167,10 @@ export default { ...@@ -164,8 +167,10 @@ export default {
display: flex; display: flex;
.summary-ranking-box { .summary-ranking-box {
width: 50%; width: 50%;
margin-right: 20px; min-height: 220px;
min-height: 100px; &:first-child {
margin-right: 20px;
}
} }
.summary-ranking-title { .summary-ranking-title {
height: 64px; height: 64px;
...@@ -254,13 +259,19 @@ export default { ...@@ -254,13 +259,19 @@ export default {
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
width: 50%;
height: 100%; height: 100%;
background-color: #5850ff; background-color: #5850ff;
} }
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #FE9C1C;
}
} }
.summary-progress-value { .summary-progress-value {
width: 80px; width: 64px;
margin-left: 20px; margin-left: 20px;
} }
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
:clearable="false" :clearable="false"
:picker-options="pickerOptions"
> >
</el-date-picker> </el-date-picker>
</div> </div>
...@@ -139,6 +140,11 @@ export default { ...@@ -139,6 +140,11 @@ export default {
packmenberCount: 0, packmenberCount: 0,
todayAddPackmenberCount: 0, todayAddPackmenberCount: 0,
summaryTime: util.getBeforeDate(), summaryTime: util.getBeforeDate(),
pickerOptions: {
disabledDate:(time)=>{
return time.getTime() > Date.now();
}
},
expandStatus: true, expandStatus: true,
chartStatus: false, chartStatus: false,
echartId1: "customerEchartId1", echartId1: "customerEchartId1",
...@@ -258,21 +264,18 @@ export default { ...@@ -258,21 +264,18 @@ export default {
{ {
name: "每日新增企微用户", name: "每日新增企微用户",
type: "line", type: "line",
stack: "总量",
lineStyle: { color: "#5850FF " }, lineStyle: { color: "#5850FF " },
data: custEntmicroAdds, data: custEntmicroAdds,
}, },
{ {
name: "每日新增产值", name: "每日新增产值",
type: "line", type: "line",
stack: "总量",
lineStyle: { color: "#2CCA74 " }, lineStyle: { color: "#2CCA74 " },
data: [], data: [],
}, },
{ {
name: "每日企微消失用户", name: "每日企微消失用户",
type: "line", type: "line",
stack: "总量",
lineStyle: { color: "#FF6D00 " }, lineStyle: { color: "#FF6D00 " },
data: custLoseList, data: custLoseList,
}, },
...@@ -284,6 +287,8 @@ export default { ...@@ -284,6 +287,8 @@ export default {
}, },
mounted() { mounted() {
console.log(document.URL)
this.getViewData(); this.getViewData();
this.getChart(); this.getChart();
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
......
...@@ -303,7 +303,8 @@ export default { ...@@ -303,7 +303,8 @@ export default {
timer: null, timer: null,
timerQrcode: null, timerQrcode: null,
statusQrcode: "", statusQrcode: "",
URL: "wwww.baidu.com", URL: "",
nextStatus: false,
Token: "", Token: "",
Secret_1: "", Secret_1: "",
Secret_2: "", Secret_2: "",
...@@ -324,7 +325,7 @@ export default { ...@@ -324,7 +325,7 @@ export default {
window.open(url); window.open(url);
}, },
jumpHome() { jumpHome() {
this.$router.push("/home/index"); this.$router.push("/home/index?id=2");
}, },
jumpStore() { jumpStore() {
this.$history.push("/settings/account/index"); this.$history.push("/settings/account/index");
...@@ -363,12 +364,14 @@ export default { ...@@ -363,12 +364,14 @@ export default {
type: "success", type: "success",
}); });
}, },
jumpConfig() {
window.open("https://www.baidu.com");
},
handleNext() { handleNext() {
if (this.active == 1) { if (this.active == 1) {
this.statusQrcode == "SUCCESS"?this.active = 3 : this.handleGetSecret(); if(this.statusQrcode == "SUCCESS") {
this.nextStatus?this.active = 2 : this.active = 3;
}else {
this.handleGetSecret();
}
return
} }
if (this.active == 2) { if (this.active == 2) {
if (this.statusQrcode == "SUCCESS") { if (this.statusQrcode == "SUCCESS") {
...@@ -389,6 +392,9 @@ export default { ...@@ -389,6 +392,9 @@ export default {
} }
}, },
handlePrev() { handlePrev() {
if(this.active == 3) {
this.nextStatus = true;
}
this.active--; this.active--;
}, },
closeDalog() { closeDalog() {
......
...@@ -103,7 +103,8 @@ export default { ...@@ -103,7 +103,8 @@ export default {
methods: { methods: {
init() { init() {
(this.newTag = ""), (this.innerTags = []); this.newTag = "";
this.innerTags = [];
this.empTypeValue = ""; this.empTypeValue = "";
}, },
listEntFollowerType() { listEntFollowerType() {
...@@ -272,8 +273,8 @@ export default { ...@@ -272,8 +273,8 @@ export default {
display: inline-block; display: inline-block;
outline: none; outline: none;
padding: 0 10px 0 5px; padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px; line-height: 32px;
height: 35px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -284,6 +285,9 @@ export default { ...@@ -284,6 +285,9 @@ export default {
outline: none !important; outline: none !important;
border: none !important; border: none !important;
} }
/deep/ .el-input {
width: 150px;
}
} }
.el-tag { .el-tag {
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
}, },
{ {
label: "职务", label: "职务",
prop: "departmentName", prop: "staffTitle",
}, },
], ],
}, },
...@@ -78,6 +78,10 @@ export default { ...@@ -78,6 +78,10 @@ export default {
listDepartmentTree() { listDepartmentTree() {
this.$apis.emp.listDepartmentTree({ id: 1 }).then((res) => { this.$apis.emp.listDepartmentTree({ id: 1 }).then((res) => {
this.listTree = res; this.listTree = res;
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click();
document.getElementsByClassName('el-tree-node__content')[0].click();
});
}); });
}, },
clearSelect(arr) { clearSelect(arr) {
...@@ -104,7 +108,6 @@ export default { ...@@ -104,7 +108,6 @@ export default {
let clientHeight = document.documentElement.clientHeight; let clientHeight = document.documentElement.clientHeight;
this.treeHeight = clientHeight - 450; this.treeHeight = clientHeight - 450;
this.listDepartmentTree(); this.listDepartmentTree();
this.listEntmicroStaff();
}, },
}; };
</script> </script>
......
...@@ -118,23 +118,23 @@ export default { ...@@ -118,23 +118,23 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: "姓名", label: "姓名",
prop: "staffName", prop: "staffName"
}, },
{ {
label: "部门", label: "部门",
prop: "departmentName", prop: "departmentName"
}, },
{ {
label: "跟进专员类型", label: "跟进专员类型",
prop: "followerTypeName", prop: "followerTypeName"
}, },
{ {
label: "手机号", label: "手机号",
prop: "staffPhone", prop: "staffPhone"
}, },
{ {
label: "首次开通时间", label: "首次开通时间",
prop: "followerCreatedTime", prop: "followerCreatedTime"
}, },
{ {
label: "是否有外部联系人权限", label: "是否有外部联系人权限",
...@@ -163,7 +163,9 @@ export default { ...@@ -163,7 +163,9 @@ export default {
methods: { methods: {
openDrawer() { openDrawer() {
this.drawer = true; this.drawer = true;
this.$refs.drawerForm.init(); this.$nextTick(() => {
this.$refs.drawerForm.init();
})
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
:clearable="false" :clearable="false"
:picker-options="pickerOptions"
> >
</el-date-picker> </el-date-picker>
</div> </div>
...@@ -63,7 +64,7 @@ ...@@ -63,7 +64,7 @@
class="guide-btn" class="guide-btn"
:style="{ :style="{
left: guideLeft - imgWidth / 2 - borderLeft + 'px', left: guideLeft - imgWidth / 2 - borderLeft + 'px',
top: guideTop + 30 + 'px', top: guideTop + imgHeight/2 + 'px',
}" }"
> >
我知道了 我知道了
...@@ -101,7 +102,7 @@ ...@@ -101,7 +102,7 @@
width: imgWidth + 'px', width: imgWidth + 'px',
height: imgHeight + 'px', height: imgHeight + 'px',
left: guideLeft - imgWidth - borderLeft + 'px', left: guideLeft - imgWidth - borderLeft + 'px',
top: guideTop - borderTop + 'px', top: guideTop - borderTop - 40 + 'px',
}" }"
/> />
<img <img
...@@ -175,6 +176,11 @@ export default { ...@@ -175,6 +176,11 @@ export default {
data() { data() {
return { return {
summaryTime: util.getBeforeDate(), summaryTime: util.getBeforeDate(),
pickerOptions: {
disabledDate:(time)=>{
return time.getTime() > Date.now();
}
},
guideStatus: false, guideStatus: false,
step: 1, step: 1,
headHeight: 0, headHeight: 0,
...@@ -210,14 +216,14 @@ export default { ...@@ -210,14 +216,14 @@ export default {
this.imgHeight = (this.imgWidth * 246) / 541; this.imgHeight = (this.imgWidth * 246) / 541;
this.guideLeft = this.borderLeft; this.guideLeft = this.borderLeft;
this.guideTop = this.guideTop =
document.querySelector(".header-panel").offsetTop + this.borderTop; document.querySelector(".header-panel").offsetTop + this.borderTop - 2;
} else if (this.step == 2) { } else if (this.step == 2) {
this.guideWidth = document.querySelector(".consult-box").offsetWidth; this.guideWidth = document.querySelector(".consult-box").offsetWidth;
this.guideHeight = document.querySelector(".consult-box").offsetHeight; this.guideHeight = document.querySelector(".consult-box").offsetHeight;
this.imgHeight = this.guideHeight; this.imgHeight = this.guideHeight/2;
this.imgWidth = (this.imgHeight * 614) / 222; this.imgWidth = (this.imgHeight * 759) / 128;
this.guideLeft = this.guideLeft =
document.querySelector(".consult-box").offsetLeft + this.borderLeft - 44; document.querySelector(".consult-box").offsetLeft + this.borderLeft - 42;
this.guideTop = document.querySelector(".consult-box").offsetTop + this.borderTop; this.guideTop = document.querySelector(".consult-box").offsetTop + this.borderTop;
} else { } else {
let top = document.querySelector(".accurate-sercives").offsetTop + 150; let top = document.querySelector(".accurate-sercives").offsetTop + 150;
...@@ -277,17 +283,18 @@ export default { ...@@ -277,17 +283,18 @@ export default {
position: absolute; position: absolute;
background: #f4c647; background: #f4c647;
border-radius: 4px; border-radius: 4px;
padding: 0.6em 0.9em; padding: 6px 9px;
font-size: 10px; font-size: 10px;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
line-height: 12px; line-height: 12px;
cursor: pointer; cursor: pointer;
bottom: 7px; bottom: 8px;
left: 73.5%!important;
} }
> img { > img {
width: 100%; width: 100%;
height: auto; height: 100%;
} }
} }
.main-isScroll { .main-isScroll {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!