소스 검색

工作完成积分排名优化

GaoYuPeng 5 년 전
부모
커밋
2d5ab7dfb0
1개의 변경된 파일125개의 추가작업 그리고 13개의 파일을 삭제
  1. 125 13
      shanXiPlatform/src/views/home/branchOffice.vue

+ 125 - 13
shanXiPlatform/src/views/home/branchOffice.vue

@@ -294,6 +294,7 @@ export default {
294 294
             floatTop: 170,
295 295
             mapAll: {},
296 296
             mapList: [],
297
+            autoHeight:'',
297 298
             areacodearr: [
298 299
                 { id: "140100", name: "太原市" },
299 300
                 { id: "140108", name: "尖草坪区" },
@@ -1071,7 +1072,8 @@ export default {
1071 1072
                         axisLine: {
1072 1073
                             lineStyle: {
1073 1074
                                 color: "#ccc"
1074
-                            }
1075
+                            },
1076
+
1075 1077
                         },
1076 1078
                         show: false,
1077 1079
                         splitLine: {
@@ -1205,28 +1207,112 @@ export default {
1205 1207
         },
1206 1208
         drawtrb() {
1207 1209
             getjfqk(this.midprovinceid, this.homeType).then(res => {
1210
+              console.log(res,'图表数据')
1211
+
1212
+              var chartDataone = [
1213
+                    100,
1214
+                    100,
1215
+                    100,
1216
+                    100,
1217
+                    100,
1218
+                    100,
1219
+                    100,
1220
+                    100,
1221
+                    100,
1222
+                    100,
1223
+                    100,
1224
+                    100,
1225
+                    100,
1226
+                    100,
1227
+                    100,
1228
+                    100,
1229
+                    100,
1230
+                    100,
1231
+                    100,
1232
+                    100,
1233
+                    100,
1234
+                    100,
1235
+                    100,
1236
+                    100,
1237
+                    100,
1238
+                    100,
1239
+                    100,
1240
+                    100,
1241
+                    100,
1242
+                    100,
1243
+                    100,
1244
+                    100,
1245
+                    100,
1246
+                    100,
1247
+                    100,
1248
+                    100,
1249
+                    100,
1250
+                    100,
1251
+                    100,
1252
+                    100,
1253
+                    100,
1254
+                    100,
1255
+                    100,
1256
+                    100,
1257
+                    100,
1258
+                    100
1259
+                ] // 数据
1260
+                var chartName = res.data.depotName
1261
+                var chartData = res.data.series
1262
+                var length = res.data.series.length
1263
+
1264
+                console.log(length)
1208 1265
                 const myChartrb = this.$echarts.init(
1209 1266
                     document.getElementById("myChartrb")
1210 1267
                 )
1268
+                if(length<10){
1269
+
1270
+                  this.autoHeight = length * 20 +30
1271
+                  myChartrb.resize({height:this.autoHeight})
1272
+                }else if(length>=10){
1273
+                  // this.autoHeight = auto
1274
+                  // res.data.series.length = 10
1275
+                  this.autoHeight = length * 15 + 30
1276
+                  myChartrb.resize({height:this.autoHeight})
1277
+
1278
+                }
1279
+
1280
+
1211 1281
                 myChartrb.setOption({
1212 1282
                     title: {},
1213 1283
                     color: "#88C06A",
1214
-                    xAxis: {
1215
-                        type: "value",
1216
-                        data: [],
1217
-                        name: "",
1218
-                        axisLabel: {
1219
-                            interval: 0
1220
-                            // rotate: 45 //代表x轴逆时针度数
1221
-                        }
1222
-                    },
1223 1284
                     grid: {
1224 1285
                         top: "3%",
1225
-                        left: "18%",
1286
+                        left: "3%",
1226 1287
                         bottom: "3%",
1227 1288
                         right: "7%",
1228 1289
                         containLabel: true
1229 1290
                     },
1291
+                    xAxis: {
1292
+                        type: "value",
1293
+                        // data: [],
1294
+                        /* axisLine: { //坐标轴线
1295
+                            lineStyle: {
1296
+                                color: "#ccc"
1297
+                            },
1298
+                            // show:false,//坐标轴
1299
+
1300
+                        }, */
1301
+                        /* axisTick:[{ //刻度线
1302
+                            show:false
1303
+                        }], */
1304
+                        // show: false,
1305
+                        /* splitLine: { //网格线
1306
+                            show: false
1307
+                        }, */
1308
+                        /* name: "",
1309
+                        // show: false,
1310
+                        axisLabel: {
1311
+                            interval: 0
1312
+                            // rotate: 45 //代表x轴逆时针度数
1313
+                        } */
1314
+                    },
1315
+
1230 1316
                     tooltip: {
1231 1317
                         trigger: "axis",
1232 1318
                         axisPointer: {
@@ -1235,20 +1321,46 @@ export default {
1235 1321
                     },
1236 1322
                     yAxis: {
1237 1323
                         type: "category",
1238
-                        name: "",
1324
+                        // name: "",
1325
+                        data:chartName,
1326
+
1327
+                        splitLine:{
1328
+                          show: false,
1329
+                        },
1330
+                        max: function (data) {
1331
+                          if(data.length>10){
1332
+                            return data.length = 9;
1333
+                          }
1334
+
1335
+                          },
1336
+                        axisLine:{
1337
+                          // show:false,
1338
+                          /* lineStyle:{
1339
+                            color:'#8CC4A1'
1340
+                          } */
1341
+                        },
1342
+                        /* axisTick:[{
1343
+                          show:false
1344
+                        }], */
1239 1345
                         axisLabel: {
1240 1346
                             interval: 0
1241 1347
                         },
1242 1348
                         data: res.data.depotName
1349
+                        // data: ["山西分公司","中央储备粮太原直属库有限公司","山西分公司","中央储备粮太原直属库有限公司", "山西分公司","中央储备粮太原直属库有限公司", "山西分公司","中央储备粮太原直属库有限公司", "山西分公司","中央储备粮太原直属库有限公司", "山西分公司"]
1243 1350
                     },
1244 1351
                     series: [
1245 1352
                         {
1246 1353
                             data: res.data.series,
1354
+                            // data: [15,25,76,100,21,54,23,54,21,54,68],
1247 1355
                             type: "bar",
1248 1356
                             // barWidth: res.data.series.length>3?10:35,
1249
-
1357
+                            barWidth: 20,
1358
+                            labelLine:{
1359
+                              show:true
1360
+                            },
1250 1361
                             itemStyle: {
1251 1362
                                 normal: {
1363
+                                    color:'#88C06A',
1252 1364
                                     label: {
1253 1365
                                         show: true, // 开启显示
1254 1366
                                         position: "right", // 在上方显示