Browse Source

优化:
1.ota选择产品取消下拉,增加表格选择携带分页
2.升级包模块新增后可回显
3.ota传参字段typo更改为types
4.日志列表按钮颜色区分
5.运行日志增加实时加载显示

Xiahai 1 year ago
parent
commit
ec17275e7b

+ 2 - 2
src/views/iot/ota-update/module/component/edit.vue

@@ -111,15 +111,15 @@ export default defineComponent({
             //修改
             api.module.edit(state.ruleForm).then(() => {
               ElMessage.success('模块修改成功');
-              closeDialog(); // 关闭弹窗
               emit('getList');
+              closeDialog(); // 关闭弹窗
             });
           } else {
             //添加
             api.module.add(state.ruleForm).then(() => {
               ElMessage.success('模块添加成功');
-              closeDialog(); // 关闭弹窗
               emit('getList');
+              closeDialog(); // 关闭弹窗
             });
           }
         }

+ 2 - 2
src/views/iot/ota-update/update/component/batch.vue

@@ -34,9 +34,9 @@
         <el-table-column prop="id" label="ID" width="100" />
         <el-table-column prop="name" label="名称" />
 <!--        <el-table-column prop="waitVersion" label="待升级版本号" width="120" />-->
-        <el-table-column label="类型" prop="typo" width="120" align="center">
+        <el-table-column label="类型" prop="types" width="120" align="center">
           <template #default="scope">
-            <el-tag type="success" size="small" v-if="scope.row.typo == 0">验证</el-tag>
+            <el-tag type="success" size="small" v-if="scope.row.types == 0">验证</el-tag>
             <el-tag type="info" size="small" v-else>升级</el-tag>
           </template>
         </el-table-column>

+ 7 - 7
src/views/iot/ota-update/update/component/check.vue

@@ -11,7 +11,7 @@
     <el-dialog :title="'操作升级包'" v-model="isShowDialog" width="769px">
       <el-form :model="ruleForm" ref="formRef" :rules="rules" size="default" label-width="160px">
         <el-form-item label="类型" prop="formType" @change="getFormType">
-          <el-radio-group v-model="ruleForm.typo">
+          <el-radio-group v-model="ruleForm.types">
             <el-radio label="1">验证</el-radio>
             <el-radio label="2">升级</el-radio>
           </el-radio-group>
@@ -91,7 +91,7 @@ interface RuleFormState {
   devOtaFirmwareId: number;
   push: string;
   pushDisabled: boolean,
-  typo: string;
+  types: string;
   productId: string;
 }
 interface UpdateState {
@@ -127,7 +127,7 @@ export default defineComponent({
         devOtaFirmwareId: 0,
         push: '2',
         pushDisabled: true,
-        typo: '1',
+        types: '1',
         productId: '',
       },
       productData: [],
@@ -136,7 +136,7 @@ export default defineComponent({
         method: [{ required: true, message: '协议方式不能为空', trigger: 'blur' }],
         stratege: [{ required: true, message: '升级方式不能为空', trigger: 'blur' }],
         push: [{ required: true, message: '推送方式不能为空', trigger: 'blur' }],
-        typo: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
+        types: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
       },
       deviceShow: false, // 所属设备是否显示
       deviceNameShow: false, // 回显设备名称状态
@@ -150,7 +150,7 @@ export default defineComponent({
     // 获取操作升级包类型
     const getFormType = () => {
       // 如果是验证类型,设备信息必填项
-      if (state.ruleForm.typo === '1') {
+      if (state.ruleForm.types === '1') {
         state.deviceShow = true;
         state.rules.devices = [{
           required: true,
@@ -194,7 +194,7 @@ export default defineComponent({
       }
       state.isShowDialog = true;
 
-      if (state.ruleForm.typo == '1') {
+      if (state.ruleForm.types == '1') {
         state.deviceShow = true;
       }
     };
@@ -209,7 +209,7 @@ export default defineComponent({
         devOtaFirmwareId: 0,
         push: '2',
         pushDisabled: true,
-        typo: '1',
+        types: '1',
         productId: '',
       };
     };

+ 1 - 1
src/views/iot/ota-update/update/component/device.vue

@@ -71,7 +71,7 @@ import BatchList from "/@/views/iot/ota-update/update/component/batch.vue";
 interface TableDataRow {
   id: number;
   name: string;
-  typo: string;
+  types: string;
   productName: number;
   moduleName: string;
   checkres: string;

+ 1 - 1
src/views/iot/ota-update/update/component/deviceList.vue

@@ -60,7 +60,7 @@ import {defineComponent, reactive, toRefs} from 'vue';
 interface TableDataRow {
   id: number;
   name: string;
-  typo: string;
+  types: string;
   productName: number;
   moduleName: string;
   checkres: string;

+ 60 - 21
src/views/iot/ota-update/update/component/edit.vue

@@ -2,8 +2,8 @@
   <div class="ota-edit-module-container">
     <el-dialog :title="(ruleForm.id !== 0 ? '修改' : '添加') + '升级包'" v-model="isShowDialog" width="769px">
       <el-form :model="ruleForm" ref="formRef" :rules="rules" size="default" v-if="isShowDialog" label-width="160px">
-        <el-form-item label="升级包类型" prop="typo">
-          <el-radio-group v-model="ruleForm.typo">
+        <el-form-item label="升级包类型" prop="types">
+          <el-radio-group v-model="ruleForm.types">
             <el-radio label="1">整包</el-radio>
             <el-radio label="2" disabled>差分</el-radio>
           </el-radio-group>
@@ -14,9 +14,16 @@
         </el-form-item>
 
         <el-form-item label="所属产品" prop="productId">
-          <el-select v-model="ruleForm.productId" placeholder="请选择产品" @change="seletChange">
-            <el-option v-for="item in productData" :key="item.id" :label="item.name" :value="item.id.toString()" />
-          </el-select>
+          <!--          <el-select v-model="ruleForm.productId" placeholder="请选择产品" @change="selectChange">-->
+          <!--            <el-option v-for="item in productData" :key="item.id" :label="item.name" :value="item.id.toString()" />-->
+          <!--          </el-select>-->
+
+          <!-- 回显已选产品 -->
+          <template v-if="productNameShow">
+            <el-tag style="margin-right: 10px;">{{ productName }}</el-tag>
+          </template>
+
+          <el-button type="primary" @click="onOpenProduct()">选择产品</el-button>
         </el-form-item>
 
         <el-form-item label="升级包模块" prop="module">
@@ -28,15 +35,15 @@
           <el-button type="success" @click="onOpenAddDic()" style="margin-left: 5px;">添加升级包模块</el-button>
         </el-form-item>
 
-        <el-form-item label="升级包版本号" prop="version" v-if="ruleForm.typo == '1'">
+        <el-form-item label="升级包版本号" prop="version" v-if="ruleForm.types == '1'">
           <el-input v-model="ruleForm.version" placeholder="请输入待升级包版本号" />
         </el-form-item>
 
-        <el-form-item label="待升级版本号" prop="waitVersion" v-if="ruleForm.typo == '2'">
+        <el-form-item label="待升级版本号" prop="waitVersion" v-if="ruleForm.types == '2'">
           <el-input v-model="ruleForm.waitVersion" placeholder="请输入待升级版本号" />
         </el-form-item>
 
-        <el-form-item label="升级后版本号" prop="afterVersion" v-if="ruleForm.typo == '2'">
+        <el-form-item label="升级后版本号" prop="afterVersion" v-if="ruleForm.types == '2'">
           <el-input v-model="ruleForm.afterVersion" placeholder="请输入升级后版本号" />
         </el-form-item>
 
@@ -78,7 +85,10 @@
     </el-dialog>
 
     <!-- 添加模块 -->
-    <EditConfig ref="editDicRef" />
+    <EditConfig ref="editDicRef" @getList="getList" />
+
+    <!-- 产品绑定弹窗 -->
+    <ProductBind ref="productRef" @bindSuccess="getProductTableData" />
   </div>
 </template>
 
@@ -90,10 +100,11 @@ import getOrigin from '/@/utils/origin';
 import { checkVersion } from '/@/utils/validator';
 import apiSystem from "/@/api/system";
 import EditConfig from "/@/views/iot/ota-update/module/component/edit.vue";
+import ProductBind from "/@/views/iot/ota-update/update/component/productBind.vue";
 
 interface RuleFormState {
   id: number;
-  typo: string;
+  types: string;
   name: string;
   productId: '';
   module: string;
@@ -118,6 +129,8 @@ interface UpdateState {
   rules: {};
   uploadFileWay: number;
   fileAccept: [];
+  productNameShow: boolean;
+  productName: string;
 }
 
 export default defineComponent({
@@ -125,8 +138,11 @@ export default defineComponent({
   setup(prop, { emit }) {
     const formRef = ref<HTMLElement | null>(null);
     const headers = { Authorization: 'Bearer ' + localStorage.token, };
-    const source = localStorage.uploadFileWay
+    const source = JSON.parse(localStorage.sysinfo || '{"uploadFileWay": 0}').uploadFileWay;
+    const productRef = ref();
     const editDicRef = ref();
+    const fileList = ref([]);
+    const urlName = ref();
     const areType = ref([
       {
         label: 'MD5',
@@ -137,14 +153,12 @@ export default defineComponent({
         value: 'SHA256',
       },
     ]);
-    const fileList = ref([]);
-    const urlName = ref();
     const state = reactive<UpdateState>({
       uploadUrl: getOrigin(import.meta.env.VITE_API_URL + '/common/singleFile'), // 上传地址
       isShowDialog: false,
       ruleForm: {
         id: 0,
-        typo: '1',
+        types: '1',
         name: '',
         productId: '',
         module: '',
@@ -162,7 +176,7 @@ export default defineComponent({
       productData: [],
       moduleData: [],
       rules: {
-        typo: [{ required: true, message: '升级包类型不能为空', trigger: 'change' }],
+        types: [{ required: true, message: '升级包类型不能为空', trigger: 'change' }],
         name: [{ required: true, message: '升级包名称不能为空', trigger: 'change' }],
         productId: [{ required: true, message: '所属产品不能为空', trigger: 'change' }],
         module: [{ required: true, message: '升级包模块不能为空', trigger: 'change' }],
@@ -177,6 +191,8 @@ export default defineComponent({
       },
       uploadFileWay: 0,// 上传方式
       fileAccept: [], // 上传格式
+      productNameShow: false, // 回显产品名称状态
+      productName: '', // 回显产品名称
     });
     // 打开弹窗
     const openDialog = (row: RuleFormState | null) => {
@@ -186,7 +202,7 @@ export default defineComponent({
           const data: RuleFormState = res;
           state.ruleForm = data;
         });
-        seletChange(row.productId);
+        selectChange(row.productId);
         state.ruleForm = row;
       }
 
@@ -196,9 +212,10 @@ export default defineComponent({
       });
 
       state.isShowDialog = true;
+      state.productNameShow = false;
 
       // 获取上传格式
-      apiSystem.getInfoByKey('sys.uploadFile.fileType').then((res: any) => {
+      apiSystem.getInfoByKey({ ConfigKey: 'sys.uploadFile.fileType' }).then((res: any) => {
         let fileType = res.data.configValue.split(",");
         for (let i = 0; i < fileType.length; i++) {
           fileType[i] = '.' + fileType[i];
@@ -209,7 +226,7 @@ export default defineComponent({
     const resetForm = () => {
       state.ruleForm = {
         id: 0,
-        typo: '1',
+        types: '1',
         name: '',
         productId: '',
         module: '',
@@ -236,11 +253,14 @@ export default defineComponent({
         ElMessage.error(res.message);
       }
     };
-    const seletChange = (val: Number) => {
+    const selectChange = (val: Number) => {
       getModuleList(val);
     };
     const getModuleList = (productID: Number) => {
       state.ruleForm.module = '';
+      if (!productID) {
+        productID = Number(state.ruleForm.productId)
+      }
       api.module.getList({ productID: productID }).then((res: any) => {
         state.moduleData = res.Data;
       });
@@ -248,6 +268,7 @@ export default defineComponent({
     // 关闭弹窗
     const closeDialog = () => {
       state.isShowDialog = false;
+      state.productNameShow = false;
     };
     // 取消
     const onCancel = () => {
@@ -282,13 +303,27 @@ export default defineComponent({
     const onOpenAddDic = () => {
       editDicRef.value.openDialog();
     };
+    // 添加升级包模块后回调方法
+    const getList = () => {
+      getModuleList()
+    }
+    const onOpenProduct = () => {
+      productRef.value.openDialog();
+    }
+    // 获取产品回显数据
+    const getProductTableData = (deviceIdList: any, deviceNameList: any) => {
+      state.ruleForm.productId = deviceIdList[0];
+      state.productName = deviceNameList[0];
+      state.productNameShow = true;
+    }
     return {
       editDicRef,
       openDialog,
       closeDialog,
-      seletChange,
+      selectChange,
       onCancel,
       onSubmit,
+      productRef,
       formRef,
       areType,
       source,
@@ -297,9 +332,13 @@ export default defineComponent({
       urlName,
       updateImg,
       onOpenAddDic,
+      getList,
+      onOpenProduct,
+      getModuleList,
+      getProductTableData,
       ...toRefs(state),
     };
   },
-  components: { EditConfig },
+  components: {ProductBind, EditConfig },
 });
 </script>

+ 161 - 0
src/views/iot/ota-update/update/component/productBind.vue

@@ -0,0 +1,161 @@
+<template>
+  <div class="mutiple-bind-dialog-wrap">
+    <el-dialog title="选择产品" v-model="isShowDialog" width="90%">
+      <el-form ref="formRef" size="small" label-width="110px">
+        <el-form-item label="设备名称" prop="name">
+          <el-input v-model="tableData.param.name" placeholder="请输入产品名称" clearable size="default" style="width: 240px" @keyup.enter.native="getProductList" />
+          <el-button style="margin-left: 20px;" type="primary" @click="getProductList()">查询</el-button>
+
+          <el-button style="margin-left: 20px;" :disabled="!deviceKeyList.length" type="danger" @click="confirmBind()">确定选择</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table ref="productTable" :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" @select-all="selectAll" v-loading="tableData.loading">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="标识" prop="key" :show-overflow-tooltip="true" v-col="'key'" />
+        <el-table-column label="名称" prop="name" :show-overflow-tooltip="true" v-col="'name'" />
+        <el-table-column label="分类" prop="categoryName" :show-overflow-tooltip="true" v-col="'categoryName'" />
+        <el-table-column label="消息协议" prop="messageProtocol" :show-overflow-tooltip="true" v-col="'messageProtocol'" />
+        <el-table-column label="接入方式" prop="transportProtocol" :show-overflow-tooltip="true" v-col="'transportProtocol'" />
+        <el-table-column label="类型" prop="deviceType" :show-overflow-tooltip="true" v-col="'deviceType'" />
+
+        <el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
+          <template #default="scope">
+            <el-tag type="success" size="small" v-if="scope.row.status">已发布</el-tag>
+            <el-tag type="info" size="small" v-else>未发布</el-tag>
+          </template>
+        </el-table-column>
+
+      </el-table>
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="getProductList" />
+
+    </el-dialog>
+  </div>
+</template>
+<script lang="ts">
+import { toRefs, reactive, defineComponent, nextTick, getCurrentInstance, ref } from 'vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
+import 'vue3-json-viewer/dist/index.css'
+import api from '/@/api/device'
+
+interface TableDataState {
+  isShowDialog: boolean,
+  productData: object[],
+  deviceKeyList: string[];
+  deviceIdList: string[];
+  deviceNameList: string[];
+  checkIdList: string[];
+  tableData: {
+    data: []
+    total: number
+    loading: boolean
+    param: {
+      pageNum: number
+      pageSize: number
+      name: string
+    }
+  },
+}
+export default defineComponent({
+  name: 'DeviceBindDialog',
+
+  setup(prop, { emit }) {
+    const { proxy } = getCurrentInstance() as any;
+    const productTable = ref();
+    const state = reactive<TableDataState>({
+      deviceKeyList: [],
+      deviceIdList: [],
+      deviceNameList: [],
+      isShowDialog: false,
+      productData: [],
+      checkIdList: [],
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          pageNum: 1,
+          pageSize: 10,
+          name: '',
+        },
+      },
+    })
+
+    const getProductList = () => {
+      state.isShowDialog = true;
+      state.tableData.loading = true;
+      api.product.getList(state.tableData.param).then((res: any) => {
+        state.tableData.data = res.product;
+        state.tableData.total = res.total;
+
+        changeSelect();
+      }).finally(() => (state.tableData.loading = false));
+    };
+
+    const openDialog = (checkIdData: any) => {
+      state.checkIdList = checkIdData;
+      getProductList()
+    };
+
+    // 多选框选中数据
+    const handleSelectionChange = (selection: any[]) => {
+      state.deviceKeyList = selection.map((item) => item.key);
+      state.deviceIdList = selection.map((item) => item.id);
+      state.deviceNameList = selection.map((item) => item.name);
+
+      if (selection.length > 1) {
+        const del_row = selection.shift();
+        productTable.value.toggleRowSelection(del_row, false)
+      }
+    };
+
+    const confirmBind = () => {
+      let msg = '是否确定选择产品?';
+      if (state.deviceKeyList.length === 0) {
+        ElMessage.error('请选择要确定绑定的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(() => {
+        emit('bindSuccess', state.deviceIdList, state.deviceNameList)
+        state.isShowDialog = false;
+      })
+    };
+
+    const handleChange = () => {
+      getProductList()
+    }
+
+    const changeSelect = () => {
+      nextTick(() => {
+        state.tableData.data.forEach((item) => {
+          if (state.checkIdList.includes(item.id)) {
+            proxy.$refs.multipleTable.toggleRowSelection(item, true);
+          }
+        })
+      });
+    };
+
+    const selectAll = (selection: any[]) => {
+      ElMessage.error('只可单选');
+      productTable.value.clearSelection()
+      return
+    }
+
+    return {
+      openDialog,
+      confirmBind,
+      getProductList,
+      handleSelectionChange,
+      handleChange,
+      selectAll,
+      productTable,
+      ...toRefs(state),
+    }
+  },
+})
+</script>
+
+

+ 2 - 2
src/views/iot/ota-update/update/detail.vue

@@ -8,7 +8,7 @@
         </div>
         <div class="mt20"></div>
         <div class="container">
-          <div class="item">升级包类型:{{detail.typo==1?'整包':'差分'}}</div>
+          <div class="item">升级包类型:{{detail.types==1?'整包':'差分'}}</div>
           <div class="item">升级包签名:d52b637c5eaf2bc9c24008bc4b723600</div>
         </div>
         <div class="container">
@@ -88,7 +88,7 @@ export default defineComponent({
       detail: {
         id: '',
         name: '',
-        typo: 1,
+        types: 1,
         are: '',
         moduleName: '',
         checkres: 0,

+ 4 - 4
src/views/iot/ota-update/update/index.vue

@@ -38,10 +38,10 @@
       <el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading">
         <el-table-column label="ID" v-col="'id'" align="center" prop="id" width="100" />
         <el-table-column label="升级包名称" v-col="'name'" prop="name" :show-overflow-tooltip="true" />
-        <el-table-column prop="typo" label="类型" show-overflow-tooltip v-col="'typo'">
+        <el-table-column prop="types" label="类型" show-overflow-tooltip v-col="'types'">
           <template #default="scope">
-            <el-tag  size="small" v-if="scope.row.typo == 1">整包</el-tag>
-            <el-tag  type="info" size="small" v-if="scope.row.typo == 2">差分</el-tag>
+            <el-tag  size="small" v-if="scope.row.types == 1">整包</el-tag>
+            <el-tag  type="info" size="small" v-if="scope.row.types == 2">差分</el-tag>
           </template>
         </el-table-column>
         <el-table-column label="所属产品" v-col="'productName'" prop="productName" :show-overflow-tooltip="true" />
@@ -83,7 +83,7 @@ import { useRouter } from 'vue-router';
 interface TableDataRow {
   id: number;
   name: string;
-  typo: string;
+  types: string;
   productName: number;
   moduleName: string;
   checkres: string;

+ 27 - 22
src/views/system/monitor/lastLinesLog/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="content-box chatdoom">
+    <div class="content-box chatdoom page">
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
 
         <!-- 日志列表 -->
@@ -15,14 +15,14 @@
                   <el-button size="small" text type="primary" v-if="!scope.row.folderName"
                              @click="view(scope.row)">详情
                   </el-button>
-                  <el-button size="small" text type="info" v-auth="'download'" @click="down(scope.row)">下载</el-button>
-                  <el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row)">删除</el-button>
+                  <el-button size="small" text type="warning" v-auth="'download'" @click="down(scope.row)">下载</el-button>
+                  <el-button size="small" text type="info" v-auth="'del'" @click="onRowDel(scope.row)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
           </el-card>
 
-          <el-dialog v-model="dialogVisible" title="查看详情">
+          <el-dialog header="123" v-model="dialogVisible" title="查看详情">
             <div v-for="line in topMsg" :key="line" class="error-line">{{ line }}</div>
             <div v-for="line in errorMessage" :key="line" class="error-line">{{ line }}</div>
           </el-dialog>
@@ -40,8 +40,8 @@
                   <el-button size="small" text type="primary" v-if="!scope.row.folderName"
                              @click="view(scope.row)">详情
                   </el-button>
-                  <el-button size="small" text type="info" v-auth="'download'" @click="down(scope.row)">下载</el-button>
-                  <el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row)">删除</el-button>
+                  <el-button size="small" text type="warning" v-auth="'download'" @click="down(scope.row)">下载</el-button>
+                  <el-button size="small" text type="info" v-auth="'del'" @click="onRowDel(scope.row)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -57,11 +57,12 @@
         <!-- 运行日志 -->
         <el-tab-pane label="运行日志" name="3" class="runMessage">
           <!-- 运行日志 -->
+          <div v-for="line in topMsg" :key="line" class="error-line">{{ line }}</div>
           <div v-if="runButtonShow" v-loading="runLoading" v-for="line in runMessage" :key="line" class="error-line">{{ line }}</div>
           <div v-else class="error-line">暂无数据</div>
 
           <div class="run-button" v-if="runButtonShow">
-            <el-button size="small" text type="info" v-auth="'download'" @click="down">下载</el-button>
+            <el-button size="small" text type="warning" v-auth="'download'" @click="down">下载</el-button>
             <el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel">删除</el-button>
           </div>
         </el-tab-pane>
@@ -89,6 +90,7 @@ const { proxy } = getCurrentInstance() as any;
 const isScrolling = ref(false);
 const chatContent: any = ref(null);
 const runButtonShow = ref(false);
+const runLogName = ref('');
 
 const {params, tableData, getList, loading} = useSearch<any[]>(api.lastLinesLog.getList, 'list', {types: types.value});
 
@@ -111,25 +113,34 @@ const scrollBottom = () => {
 }
 
 const view = (row: any) => {
+  if (types.value == 'run') {
+    row.name = row.value;
+  }
   const es = new EventSource(getOrigin(import.meta.env.VITE_SERVER_URL + "/subscribe/logInfo?name=" + row.name + '&types=' + types.value));
   es.addEventListener('log', ({data}) => {
     topMsg.value.unshift(data);
   });
   api.lastLinesLog.detail({name: row.name, types: types.value}).then((res: any) => {
-    errorMessage.value = res.list;
-    dialogVisible.value = true;
+    if (types.value == 'run') {
+        runButtonShow.value = true;
+        runMessage.value = res.list;
+        runLoading.value = false;
+    } else {
+      errorMessage.value = res.list;
+      dialogVisible.value = true;
+    }
   });
 };
 const down = (row: any) => {
   if (types.value == 'run') {
-    row.name = 'sagoo-admin.log'
+    row.name = runLogName.value
   }
   api.lastLinesLog.down({name: row.name, types: types.value}).then((res: any) => downloadFile(res, types.value +"-"+ row.name))
 };
 
 const onRowDel = (row: any) => {
   if (types.value == 'run') {
-    row.name = 'sagoo-admin.log'
+    row.name = runLogName.value
   }
   let msg = '你确定要删除所选数据?';
   ElMessageBox.confirm(msg, '提示', {
@@ -163,28 +174,22 @@ const handleClick = (tab: any, event: Event) => {
   } else if (tab.props.name == 3) {
     runLoading.value = true;
     types.value = 'run'
+    runLogName.value = 'sagoo-admin.log'
     params.type = types.value
-    api.lastLinesLog.detail({name: 'sagoo-admin.log', types: types.value}).then((res: any) => {
-      if (res.list.length > 0) {
-        runButtonShow.value = true;
-        runMessage.value = res.list;
-      }
-      runLoading.value = false;
-    });
+    view(runLogName)
   }
 }
 </script>
 <style scoped>
 .run-button {
   position: fixed;
-  bottom: 150px;
-  right: 60px;
+  bottom: 50px;
+  right: 80px;
 }
 .runMessage {
   height: 500px;
 }
 .content-box {
-  background: #fff;
   width: 100%;
   padding: 5px 20px 20px 20px;
 }
@@ -197,7 +202,7 @@ const handleClick = (tab: any, event: Event) => {
 }
 .el-tab-pane {
   position: relative;
-  //height: calc(100vh - 110px);
+  height: calc(100vh - 110px);
   overflow-y: auto;
 }
 </style>