From 774fcb60353630456f851f45bb33f7e0592e376e Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 18 十月 2023 17:12:07 +0800
Subject: [PATCH] 整合代码
---
Source/UBCS-WEB/src/views/wel/Statistic.vue | 174 +++++++++++++++++++++++++++++----------------------------
1 files changed, 88 insertions(+), 86 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/wel/Statistic.vue b/Source/UBCS-WEB/src/views/wel/Statistic.vue
index dbac618..33a7d3a 100644
--- a/Source/UBCS-WEB/src/views/wel/Statistic.vue
+++ b/Source/UBCS-WEB/src/views/wel/Statistic.vue
@@ -1,22 +1,20 @@
<template>
<div>
- <div style="display: flex; justify-content: flex-end;margin-bottom: 10px">
- <el-button icon="el-icon-more" type="primary" plain size="small" @click="MoreHandler">鏇村</el-button>
+ <div style="display: flex; justify-content: flex-end;margin-bottom: 10px">
+ <el-button icon="el-icon-more" plain size="small" type="primary" @click="MoreHandler">鏇村</el-button>
</div>
- <avue-data-box :option="option" :animation="true">
- <template>
- <el-switch></el-switch>
- </template>
- </avue-data-box>
- <el-dialog title="涓绘暟鎹厤缃�" :visible.sync="dialogTableVisible" append-to-body class="avue-dialog avue-dialog--top" top="0">
+ <avue-data-box :animation="true" :option="option"></avue-data-box>
+<!-- <avue-data-panel :animation="true":option="option"></avue-data-panel>-->
+ <el-dialog :visible.sync="dialogTableVisible" append-to-body class="avue-dialog avue-dialog--top" title="涓绘暟鎹厤缃�"
+ top="0">
<avue-crud ref="crud"
v-model="Crud.form"
:data="Crud.data"
- @selection-change="selectionChange"
- :option="Crud.option">
+ :option="Crud.option"
+ @selection-change="selectionChange">
</avue-crud>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" plain @click="SaveHandler">淇濆瓨</el-button>
+ <el-button plain type="primary" @click="SaveHandler">淇濆瓨</el-button>
</div>
</el-dialog>
</div>
@@ -24,98 +22,101 @@
<script>
import {validatenull} from "@/util/validate";
-import {getList,save} from "@/api/system/statistic";
+import {getList, save} from "@/api/system/statistic";
import {flowRoute} from "@/util/flow";
export default {
-name: "Statistic",
- data(){
- return {
- Crud:{
- form:'',
- data:[],
- option:{
- calcHeight: 80,
- tip: false,
- searchShow: false,
- addBtn:false,
- columnBtn:false,
- header:false,
- menu:false,
- border: true,
- index: true,
- selection: true,
- column:[
- {
- label: "涓绘暟鎹悕绉�",
- prop: "menuName",
- },
- {
- label: "寰呭姙鏁版嵁",
- prop: "mdmCount",
- },
- {
- label: "icon鍥炬爣",
- prop: "icon",
- overHidden:true,
- },
- {
- label: "璺敱鍦板潃",
- prop: "menuRoute",
- overHidden:true,
- },
- {
- label: "code",
- prop: "code",
- overHidden:true,
- },
- ]
- }
- },
- userId:'',
- hexColor:'',
- newData:[],
- SelectRow:[],
- countByServer:true,
- dialogTableVisible:false,
- // listMyTask:[]
- option: {
- span:6,
- data: []
- },
- }
+ name: "Statistic",
+ data() {
+ return {
+ Crud: {
+ form: '',
+ data: [],
+ option: {
+ calcHeight: 80,
+ tip: false,
+ searchShow: false,
+ addBtn: false,
+ columnBtn: false,
+ header: false,
+ menu: false,
+ border: true,
+ index: true,
+ selection: true,
+ column: [
+ {
+ label: "涓绘暟鎹悕绉�",
+ prop: "menuName",
+ },
+ {
+ label: "寰呭姙鏁版嵁",
+ prop: "mdmCount",
+ },
+ {
+ label: "icon鍥炬爣",
+ prop: "icon",
+ overHidden: true,
+ },
+ {
+ label: "璺敱鍦板潃",
+ prop: "menuRoute",
+ overHidden: true,
+ },
+ {
+ label: "code",
+ prop: "code",
+ overHidden: true,
+ },
+ ]
+ }
+ },
+ userId: '',
+ hexColor: '',
+ newData: [],
+ SelectRow: [],
+ countByServer: true,
+ dialogTableVisible: false,
+ // listMyTask:[]
+ option: {
+ span: 6,
+ data: []
+ },
+ }
},
created() {
this.MasterGetList()
},
- computed(){
+ computed() {
},
methods: {
- selectionChange(row){
+ selectionChange(row) {
// console.log(row)
- this.SelectRow=row;
+ this.SelectRow = row;
},
- SaveHandler(){
- if(this.SelectRow.length <= 0){
+ SaveHandler() {
+ if (this.SelectRow.length <= 0) {
this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹紒')
return
}
- let mdmNameList=[];
- mdmNameList=this.SelectRow.map(item=>{return item.code})
- console.log(mdmNameList)
- save(this.userId,mdmNameList).then(res=>{
+ let mdmNameList = [];
+ mdmNameList = this.SelectRow.map(item => {
+ return item.code
+ })
+ console.log(mdmNameList)
+ save(this.userId, mdmNameList).then(res => {
console.log(res)
- if(res.data.code === 200){
+ if (res.data.code === 200) {
this.$message.success('淇濆瓨鎴愬姛锛�')
- this.option.data=[];
+ this.option.data = [];
+ this.newData=[];
this.MasterGetList()
- this.dialogTableVisible=false;
+ this.dialogTableVisible = false;
}
})
},
- MoreHandler(){
- this.dialogTableVisible=true
+ MoreHandler() {
+ this.dialogTableVisible = true;
},
// 闅忔満鑹�
randomColor() {
@@ -128,25 +129,26 @@
},
MasterGetList() {
this.userId = localStorage.getItem('userId');
- getList({ userId: this.userId }).then(res => {
+ getList({userId: this.userId}).then(res => {
res.data.data.filter(item => {
+ // console.log(item.icon)
if (item.isDefault === 1) {
this.hexColor = this.randomColor();
this.option.data.push({
click: (item) => {
- this.$router.push({ path: item.uiUrl });
+ this.$router.push({path: item.uiUrl});
},
title: item.menuName,
count: parseInt(item.mdmCount),
icon: item.icon,
code: item.code,
isDefault: item.isDefault,
- color:this.hexColor,
+ color: this.hexColor,
uiUrl: item.menuRoute,
});
} else if (item.isDefault === 0) {
this.newData.push(item);
- this.Crud.data=this.newData;
+ this.Crud.data = this.newData;
}
});
// console.log(this.option.data);
--
Gitblit v1.9.3