Browse Source

修改蓝牙界面文件下载

“yueshang” 2 years ago
parent
commit
13b4098d94
2 changed files with 23 additions and 7 deletions
  1. 16 4
      src/views/biz/bluetoothINfo/index.vue
  2. 7 3
      src/views/dashboard/twinChart.vue

+ 16 - 4
src/views/biz/bluetoothINfo/index.vue

@@ -170,8 +170,12 @@
       <el-table-column label="区域ID" align="center" prop="areaId" />
       <el-table-column label="MAC地址" align="center" prop="mac" />
       <el-table-column label="蓝牙名称" align="center" prop="name" />
-      <el-table-column label="文件名" align="center" prop="fileName" />
-      <el-table-column label="文件地址" align="center" prop="filePath" />
+      <el-table-column label="文件名" align="center" prop="fileName">
+        <template slot-scope="scope">
+        <a @click="fujian(scope.row.filePath,scope.row.fileName)" style="color: #204F7F;">{{ scope.row.fileName }}</a>
+      </template>
+      </el-table-column>
+      <!-- <el-table-column label="文件地址" align="center" prop="filePath" /> -->
       <el-table-column label="是否非法" align="center" prop="isIllegal">
         <template slot-scope="scope">
           <dict-tag
@@ -194,7 +198,7 @@
       <el-table-column
         label="操作"
         align="center"
-        class-name="small-padding fixed-width"
+        class-name="small-padding fi下载ed-width"
       >
         <template slot-scope="scope">
           <el-button
@@ -227,7 +231,7 @@
 
     <!-- 添加或修改蓝牙信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="设备ID" prop="deviceId">
           <el-input v-model="form.deviceId" placeholder="请输入设备ID" />
         </el-form-item>
@@ -341,6 +345,14 @@ export default {
   mounted(){
   },
   methods: {
+    fujian(dizhi,name){
+      console.log('dizhi', dizhi)
+      const link = document.createElement('a');
+        link.href =dizhi?dizhi:''
+        link.setAttribute('download',name);
+        document.body.appendChild(link);
+        link.click();
+    },
     /** 查询蓝牙信息列表 */
     getList() {
       this.loading = true;

+ 7 - 3
src/views/dashboard/twinChart.vue

@@ -101,7 +101,7 @@ export default {
         grid: {
           // 图表布局
           top: "10%",
-          left: "3%",
+          left: "1%",
           right: "4%",
           bottom: "3%",
           containLabel: true,
@@ -120,12 +120,16 @@ export default {
             axisTick: {
               show: false, // 隐藏刻度线
             },
+            itemStyle: {
+
+            },
             axisLine: {
               show: false, // 隐藏坐标轴线
             },
-            // axisLabel: {
+            axisLabel: {
             //   show: false, // 隐藏刻度标签
-            // },
+            fontSize:14
+            },
           },
         ],
         series: [