From 6b5341ec52f99b9380e2812fab9d4325485bd4a8 Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Wed, 23 Oct 2024 16:07:59 +0800
Subject: [PATCH] id
---
src/components/myecharts/index.vue | 198 +++++++++
src/components/myecharts/mixins/resize.js | 55 +++
src/views/catalog/index.vue | 43 +-
src/views/dashboard/components/PanelGroup.vue | 70 ++-
src/views/dashboard/index.vue | 403 +++++-------------
src/views/record/index.vue | 115 ++---
src/views/system/menu.vue | 3 +-
vue.config.js | 2 +-
8 files changed, 472 insertions(+), 417 deletions(-)
create mode 100644 src/components/myecharts/index.vue
create mode 100644 src/components/myecharts/mixins/resize.js
diff --git a/src/components/myecharts/index.vue b/src/components/myecharts/index.vue
new file mode 100644
index 0000000..c91843d
--- /dev/null
+++ b/src/components/myecharts/index.vue
@@ -0,0 +1,198 @@
+
+
+
+
+
+
diff --git a/src/components/myecharts/mixins/resize.js b/src/components/myecharts/mixins/resize.js
new file mode 100644
index 0000000..234953b
--- /dev/null
+++ b/src/components/myecharts/mixins/resize.js
@@ -0,0 +1,55 @@
+import { debounce } from '@/utils'
+
+export default {
+ data() {
+ return {
+ $_sidebarElm: null,
+ $_resizeHandler: null
+ }
+ },
+ mounted() {
+ this.$_resizeHandler = debounce(() => {
+ if (this.chart) {
+ this.chart.resize()
+ }
+ }, 100)
+ this.$_initResizeEvent()
+ this.$_initSidebarResizeEvent()
+ },
+ beforeDestroy() {
+ this.$_destroyResizeEvent()
+ this.$_destroySidebarResizeEvent()
+ },
+ // to fixed bug when cached by keep-alive
+ // https://github.com/PanJiaChen/vue-element-admin/issues/2116
+ activated() {
+ this.$_initResizeEvent()
+ this.$_initSidebarResizeEvent()
+ },
+ deactivated() {
+ this.$_destroyResizeEvent()
+ this.$_destroySidebarResizeEvent()
+ },
+ methods: {
+ // use $_ for mixins properties
+ // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
+ $_initResizeEvent() {
+ window.addEventListener('resize', this.$_resizeHandler)
+ },
+ $_destroyResizeEvent() {
+ window.removeEventListener('resize', this.$_resizeHandler)
+ },
+ $_sidebarResizeHandler(e) {
+ if (e.propertyName === 'width') {
+ this.$_resizeHandler()
+ }
+ },
+ $_initSidebarResizeEvent() {
+ this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
+ this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
+ },
+ $_destroySidebarResizeEvent() {
+ this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
+ }
+ }
+}
diff --git a/src/views/catalog/index.vue b/src/views/catalog/index.vue
index 91f1dfd..d6a9a0f 100644
--- a/src/views/catalog/index.vue
+++ b/src/views/catalog/index.vue
@@ -23,13 +23,13 @@
-
+
-
- 子目录
- 编辑
+
+ 子目录
+ 编辑
删除
@@ -63,14 +63,19 @@
},
list: [],
table_item: [{
+ prop: 'id',
+ label: 'id',
+ align: 'center',
+ width: 100
+ }, {
prop: 'name',
label: '目录名称',
align: 'left',
- },{
+ }, {
prop: 'sort',
label: '排序',
- align: 'center',
- width:50
+ align: 'center',
+ width: 50
}]
}
@@ -79,12 +84,12 @@
this.getList()
},
methods: {
- editCatalog(type, id,pName) {
+ editCatalog(type, id, pName) {
if (type == 'editor') {
this.$refs.addCatalog.id = id
- }
- if(type=='child'){
- this.$refs.addCatalog.setPid(id,pName)
+ }
+ if (type == 'child') {
+ this.$refs.addCatalog.setPid(id, pName)
}
this.$refs.addCatalog.type = type
this.$refs.addCatalog.isShow = true
@@ -92,19 +97,19 @@
async getList() {
const res = await index({
page_size: this.select.page_size,
- page: this.select.page,
- sort_type:'ASC',
- sort_name:'sort',
+ page: this.select.page,
+ sort_type: 'ASC',
+ sort_name: 'sort',
table_name: this.select.table_name,
filter: [{
"key": "name",
"op": "like",
"value": this.select.name
}],
- })
- if(res.data.length>0){
- this.list = this.base.buildTree(res.data)
-
+ })
+ if (res.data.length > 0) {
+ this.list = this.base.buildTree(res.data)
+
}
},
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index ffc9509..2adbc2a 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -3,17 +3,17 @@
- 营业统计
+ 档案统计
-
服务金额
+
总数
- {{totaldata.business.server_money_total}}
+ {{totaldata.record_total?totaldata.record_total:0}}
-
+
@@ -30,18 +30,17 @@
- 人效统计
+ 组织统计
-
总服务时长
+
总数
- {{totaldata.person_efficiency.server_time_total}}
- 分钟
+ {{totaldata.originze_total?totaldata.originze_total:0}}
-
+
- 客户统计
+ 区域统计
-
活跃客户
+
总数
- {{totaldata.customer.active}}人
+ {{totaldata.area_total?totaldata.area_total:0}}
-
+
-
+
@@ -122,27 +121,9 @@
totaldata: {
type: Object,
default: {
-
- "business": {
- "server_money_total": 0,
- "nurse_money_total": 0,
- "remain_money_total": 0
- },
- "person_efficiency": {
- "server_time_total": "0",
- "expect": 0,
- "act": 0
- },
- "customer": {
- "active": 0,
- "add": 0,
- "wash": 0
- },
- "order": {
- "server_total": 0,
- "cycle_total": 0,
- "unit_total": 0
- },
+ record_total:0,
+ originze_total:0,
+ area_total:0
}
}
},
@@ -162,7 +143,8 @@
diff --git a/src/views/record/index.vue b/src/views/record/index.vue
index 2d744b1..4a83e12 100644
--- a/src/views/record/index.vue
+++ b/src/views/record/index.vue
@@ -11,9 +11,9 @@
查询
-
-
- 重置
+
+
+ 重置
新增
@@ -26,24 +26,24 @@
-
+
-
-
-
-
-
-
- {{item.name}}
-
-
-
+
+
+
+
+
+
+ {{item.name}}
+
+
+
@@ -72,8 +72,10 @@
查看
- 编辑
-
+ 编辑
+
删除
@@ -110,9 +112,9 @@
page: 1,
page_size: 10,
catalog_id: ''
- },
- myHeight:0,
- stateObj:{},
+ },
+ myHeight: 0,
+ stateObj: {},
total: 0,
list: [],
defaultProps: {
@@ -122,8 +124,8 @@
catalogList: [],
table_item: [{
type: 'index',
- width: 50,
- fixed:'left'
+ width: 50,
+ fixed: 'left'
}, {
prop: 'title',
label: '标题',
@@ -159,17 +161,20 @@
}
},
created() {
- //
- this.stateObj = state.state
- console.log("this.stateObj",this.stateObj)
- this.getCatalogList()
+ //
+ this.stateObj = state.state
+ console.log("this.stateObj", this.stateObj)
+ // this.getCatalogList()
+ if (this.$route.path) {
+ let path = this.$route.path.split("_")
+ this.select.catalog_id = path[1]
+ }
this.getList()
},
- methods: {
- initHeight(e){
- console.log("e",e)
-
- this.myHeight = e + 37
+ methods: {
+ initHeight(e) {
+ console.log("e", e)
+ this.myHeight = e + 37
},
async getCatalogList() {
const res = await index({
@@ -196,8 +201,8 @@
editIndex(type, id) {
if (type == 'editor') {
this.$refs.addRecord.id = id
- }else{
- this.$refs.addRecord.setCheck(this.select.catalog_id)
+ } else {
+ this.$refs.addRecord.setCheck(this.select.catalog_id)
}
// if(this.select.catalog_id){
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
@@ -219,22 +224,22 @@
this.select.page_size = e
this.select.page = 1
this.getList()
- },
- resetSearch(){
- this.select.page = 1
- this.select.title = ''
- this.select.catalog_id = ''
- this.getList()
+ },
+ resetSearch() {
+ this.select.page = 1
+ this.select.title = ''
+ // this.select.catalog_id = ''
+ this.getList()
},
async getList() {
const res = await index({
page_size: this.select.page_size,
page: this.select.page,
table_name: this.select.table_name,
- json_data_fields: ['files', 'area_ids', 'tag_ids', 'catalog_id'],
- is_auth: 1,
- sort_type:'DESC',
- sort_name:'date',
+ json_data_fields: ['files', 'area_ids', 'tag_ids', 'catalog_id'],
+ is_auth: 1,
+ sort_type: 'DESC',
+ sort_name: 'date',
filter: [{
"key": "title",
"op": "like",
@@ -282,18 +287,18 @@
}
.catalog {
- display: flex;
- // align-items: center;
- justify-content: space-between;
+ // display: flex;
+ // // align-items: center;
+ // justify-content: space-between;
- &_left {
- width: 20%;
- background: #fff;
- padding: 10px;
- }
+ // &_left {
+ // width: 20%;
+ // background: #fff;
+ // padding: 10px;
+ // }
- &_right {
- width: 79%
- }
+ // &_right {
+ // width: 79%
+ // }
}
diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue
index 221b580..33792fc 100644
--- a/src/views/system/menu.vue
+++ b/src/views/system/menu.vue
@@ -34,9 +34,10 @@
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
- default-expand-all
+
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
+
diff --git a/vue.config.js b/vue.config.js
index c82404e..5201527 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
- outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin_test',
+ outputDir: '/Users/mac/Documents/朗业/2024/s-四世同堂-档案/sstt_dangan/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项