فهرست منبع

完成数据查询新版的发布,修改组件选择数据项,移除报错问题

zhoupeng 1 سال پیش
والد
کامیت
dd9753b7e9

+ 1 - 2
industry-admin/src/views/source/dataQuery/chooseItem.vue

@@ -144,7 +144,7 @@ export default {
         },
         /** 是否全部选中,已经选择的数据项监听 */
         checkChangeAllSelectedItem(flag) {
-            this.selectAllSelectedItem = flag
+            this.isSelectAllSelectedItem = flag
         },
         /** 选中已经选择的数据项的数据 */
         checkChangeSelectedItem(datas) {
@@ -223,7 +223,6 @@ export default {
             }
             // 重置选择
             this.isSelectAllSelectedItem = false;
-            this.selectAllSelectedItem(false);
         },
         /** 移除右侧全部数据 */
         removeAllBtnEvent() {

+ 30 - 17
industry-admin/src/views/source/dataQuery/index.vue

@@ -73,7 +73,6 @@
                         <el-form-item>
                             <el-button type="primary" plain icon="el-icon-search" size="mini"
                                 @click="queryData">查询</el-button>
-                            <el-button ref="btn" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                             <el-button type="primary" plain icon="el-icon-folder-opened" size="mini"
                                 @click="exportData">导出</el-button>
                         </el-form-item>
@@ -86,7 +85,7 @@
         <ChooseItem ref="chooseItem" @receiveCheckedData="receiveCheckedData"></ChooseItem>
         <!-- 统计图 -->
         <div class="lineChartContant" v-on:mouseover="mouseOver()" v-on:mouseout="mouseOut()">
-            <div id="lineChart" class="lineChart" />
+            <div ref="chart" class="lineChart" />
         </div>
     </div>
 </template>
@@ -136,6 +135,8 @@ export default {
                 startTime: null,
                 endTime: null
             },
+            chooseStartTime: null,
+            chooseEndTime: null,
             chartFormRules: {
 
                 frequencyValue: [
@@ -163,9 +164,8 @@ export default {
 
                 ],
             },
-            chooseStartTime: null,
-            chooseEndTime: null,
             //charts
+            chart: null,
             //背景颜色
             backgroundColor: '#394056',
             //统计图标题
@@ -285,9 +285,8 @@ export default {
         /** 查询数据 */
         queryData() {
             //每次查询的时候,将统计图初清空,定时器清空
-            clearInterval(this.timer)
-            this.timer = null
-            this.chart = null
+            this.stopTimer()
+            this.destroyChart()
             if (this.chartForm.idList.length == 0) {
                 this.$message({
                     message: '请选择数据项',
@@ -343,14 +342,6 @@ export default {
                 this.initChart()
             }
         },
-        /** 重置 */
-        resetQuery() {
-            this.$refs['chartForm'].resetFields();
-            this.state = false
-            clearInterval(this.timer)
-            this.timer = null
-            this.chart = null
-        },
         /** 通过数据项id,开始结束时间获取相应的数据 */
         getItemListValue(callback) {
             if (this.chooseStartTime == this.chooseEndTime) {
@@ -372,7 +363,7 @@ export default {
             const loading = showLoading(this, "加载中,请稍候···")
             this.getItemListValue((res) => {
                 let data = res.data
-                this.chart = echarts.init(document.getElementById('lineChart'))
+                this.chart = echarts.init(this.$refs.chart)
                 let legendData = []
                 let seriesData = []
                 for (let a of data) {
@@ -385,6 +376,9 @@ export default {
                         symbol: 'circle',
                         symbolSize: 5,
                         showSymbol: false,
+                        itemStyle: {
+                            color: this.getColor()
+                        },
                         lineStyle: {
                             normal: {
                                 width: 1
@@ -399,7 +393,7 @@ export default {
                     let b = '<div style="display:inline;">'
                     for (let a of params) {
                         b += '<div><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + a.color + ';"></span><span style="color:' + a.color + '">'
-                            + a.seriesName + ': ' + a.data + '</span></div>'
+                            + a.name + '    ' + a.seriesName + ': ' + a.data + '</span></div>'
                     }
                     b += '</div>'
                     return b
@@ -425,6 +419,17 @@ export default {
                 loading.close()
             })
         },
+        /** 生成颜色方法 */
+        getColor() {
+            const r = this.colorRandom(128, 255)
+            const g = this.colorRandom(0, 63)
+            const b = this.colorRandom(128, 255)
+            return "rgb(" + r + ", " + g + ", " + b + ")"
+        },
+        /** 颜色数字随机方法 */
+        colorRandom(minValue, maxValue) {
+            return Math.floor((Math.random() * (maxValue - minValue)) + minValue)
+        },
         /** 鼠标移入事件 */
         mouseOver() {
             if (this.state) {
@@ -437,6 +442,14 @@ export default {
                 this.startTimer()
             }
         },
+        /** 清除统计图 */
+        destroyChart() {
+            if (!this.chart) {
+                return
+            }
+            this.chart.dispose()
+            this.chart = null
+        },
         /** 清除定时器 */
         stopTimer() {
             clearInterval(this.timer)

+ 2 - 2
industry-system/industry-da/src/main/resources/application-prod.yml

@@ -1,8 +1,8 @@
 server:
   port: 8081
 file:
-  path: F:/upload/chuanyi/
-  commonPath: F:/upload/file/
+  path: D:/upload/chuanyi/
+  commonPath: D:/upload/file/
 
 spring:
   servlet:

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
industry-system/industry-da/src/main/resources/static/page/index.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/app.becfcc35.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/chunk-02461e1e.d080c417.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/chunk-6ac09a79.88fcf46c.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است