Browse Source

添加功能

zhaoke 2 years ago
parent
commit
23c11c59d4

+ 7 - 2
src/layout/components/EchartsNum/index.vue

@@ -8,11 +8,11 @@
 -->
 <template>
   <div :class="type?'flex':'r3'" class="account-number">
-    <div v-for="(item,index) in arrs" :key="index" :class="!type?'t21':''" class="account-number-list">
+    <div v-for="(item,index) in arrs" :key="index" :class="!type?'t21':''" @click="sendLog(item)" class="account-number-list">
       <div class="number">{{item.number}}</div>
       <div class="text">
         <span :style="{'background':item.color}" class="icon"></span>
-        <span class="txt">{{item.txt}}</span>
+        <span class="txt">{{item.name}}</span>
       </div>
     </div>
   </div>
@@ -30,6 +30,11 @@ export default {
       type: Boolean,
       default: false
     }
+  },
+  methods: {
+    sendLog (item) {
+      this.$emit('handleLog', item)
+    }
   }
 }
 </script>

+ 18 - 22
src/layout/components/Search/index.vue

@@ -13,28 +13,13 @@
         {{ title }}
       </div>
       <div v-if="isOnly" class="content flex-wrap">
-        <div
-          v-if="isSearch"
-          :class="isChild ? 'childSearch' : ''"
-          class="search"
-        >
-          <el-input
-            :size="isChild ? 'medium' : ''"
-            :placeholder="placeholder"
-            @clear="clearSearch"
-            clearable
-            v-model="input"
-            @keyup.enter.native="checkSearch"
-          >
+        <div v-if="isSearch" :class="isChild ? 'childSearch' : ''" class="search">
+          <el-input :size="isChild ? 'medium' : ''" :placeholder="placeholder" @clear="clearSearch" clearable v-model="input" @keyup.enter.native="checkSearch">
             <el-button slot="prepend" icon="el-icon-search"></el-button>
           </el-input>
         </div>
         <div v-if="isSearch" class="btn">
-          <button
-            :class="isChild ? 'childBtnAn' : ''"
-            @click="checkSearch"
-            class="btnAn"
-          >
+          <button :class="isChild ? 'childBtnAn' : ''" @click="checkSearch" class="btnAn">
             搜索
           </button>
         </div>
@@ -86,22 +71,33 @@ export default {
       default: false,
     },
   },
-  data() {
+  data () {
     return {
       input: "",
     };
   },
-  created() {
+  created () {
     const { keyWords } = this.$route.query;
     if (keyWords) {
       this.input = keyWords;
     }
   },
+  watch: {
+    $route: {
+      handler (val) {
+        const { keyWords } = val.query;
+        if (keyWords) {
+          this.input = keyWords;
+        }
+      },
+      deep: true
+    }
+  },
   methods: {
-    checkSearch() {
+    checkSearch () {
       this.$emit("getSearchData", this.input);
     },
-    clearSearch() {
+    clearSearch () {
       this.$emit("clearSearchData", this.input);
     },
   },

+ 210 - 0
src/utils/request-gat.js

@@ -0,0 +1,210 @@
+/*
+ * @Author: your name
+ * @Date: 2022-01-06 09:45:17
+ * @LastEditTime: 2022-04-21 17:36:42
+ * @LastEditors: your name
+ * @Description: axios封装
+ */
+import axios from 'axios'
+import { MessageBox, Message } from 'element-ui'
+import store from '@/store'
+import { getToken, getUserId, getCodeToken, getLogId, getUserName } from '@/utils/auth'
+import { parseTime } from '@/utils'
+import { Loading } from 'element-ui'
+// create an axios instance
+const service = axios.create({
+  //baseURL: baseURL, // url = base url + request url
+  baseURL: 'http://106.14.243.117:8089',
+  // withCredentials: true, // send cookies when cross-domain requests
+  timeout: 30000, // request timeout
+  headers: {
+    'Content-Type': 'application/json'
+  }
+})
+let loadingInstance,
+  flag = false
+// request interceptor
+service.interceptors.request.use(
+  config => {
+    if (config.istoken) {
+      config.headers['appSecret'] = PLATFROM_CONFIG.appSecret
+    } else if (getCodeToken() && !config.istoken && config.islogin) {
+      config.headers['token'] = getCodeToken()
+    } else if (store.getters.token) {
+      // let each request carry token
+      // ['X-Token'] is a custom headers key
+      // please modify it according to the actual situation
+      config.headers['Token'] = getToken()
+    }
+    if (config.data && !config.url.includes('/api/fs4a/sendLog')) {
+      config.data['OperatorId'] = getUserId()
+    }
+    flag = true
+    if (flag) {
+      loadingInstance = Loading.service({
+        text: '数据加载中'
+      })
+    }
+    if (config.url.includes('/api/fs4a/sendLog') && config.data.Data[0]?.OperateResult?.Token) {
+      config.headers['token'] = config.data.Data[0].OperateResult.Token
+    }
+    config.metaData = {
+      BeginTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
+    }
+    return config
+  },
+  error => {
+    // do something with request error
+    console.log(error) // for debug
+    return Promise.reject(error)
+  }
+)
+
+// response interceptor
+service.interceptors.response.use(
+  /**
+   * If you want to get http information such as headers or status
+   * Please return  response => response
+   */
+
+  /**
+   * Determine the request status by custom code
+   * Here is just an example
+   * You can also judge the status by HTTP Status Code
+   */
+  response => {
+    const res = response.data
+    // 特定请求完成后发送日志
+    const { metaData, url, Ident, data, msg, islogin } = response.config
+    if (!url.includes('/api/fs4a/sendLog') && (Ident || msg)) {
+      Object.assign(metaData, {
+        LogInfo: typeof data === 'string' ? JSON.parse(data) : data,
+        EndTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+        LogType: msg ?? '未定义操作',
+        OperateResult: res.message,
+        Ident: Ident ?? ''
+      })
+      const { BeginTime, EndTime, OperateResult } = metaData
+      const config = {
+        url: '/api/fs4a/sendLog',
+        method: 'post',
+        data: {
+          Data: [metaData],
+          BrowserTag: navigator.userAgent,
+          OperateIP: returnCitySN.cip,
+          Msg: msg ?? '未定义操作',
+          Type: '2',
+          BeginTime,
+          BeginTime2: BeginTime,
+          EndTime,
+          OperateResult,
+          Ident: Ident ?? '',
+          AppId: '9'
+        }
+      }
+      if (islogin) {
+        if (res.code === 0) {
+          config.data.OperatorId = (res.returnData.UserId ?? '').toString()
+          config.data.LogId = (res.returnData.LogId ?? '').toString()
+          config.data.UserName = (res.returnData.UserName ?? '').toString()
+        } else {
+          const loginData = typeof data === 'string' ? JSON.parse(data) : data
+          config.data.UserName = loginData.LoginName.toString()
+        }
+      } else {
+        config.data.OperatorId = getUserId()
+        config.data.LogId = getLogId()
+        config.data.UserName = getUserName()
+      }
+      service(config)
+    }
+    if (res.code == 0 || res.code == -1) {
+      flag = false
+      loadingInstance.close()
+      return res
+    } else {
+      if (res.code == 500) {
+        Message({
+          message: '身份令牌过期或失效,即将重新登录',
+          type: 'error',
+          duration: 5 * 1000,
+          onClose: () => {
+            store.dispatch('tagsView/delAllViews').then(() => { })
+            store.dispatch('user/resetToken').then(() => {
+              location.reload()
+            })
+          }
+        })
+      }
+      flag = false
+      loadingInstance.close()
+    }
+    // if the custom code is not 20000, it is judged as an error.
+    // if (res.code != 0 || res.code == -1) {
+    //   Message({
+    //     message: res.message || 'Error',
+    //     type: 'error',
+    //     duration: 5 * 1000
+    //   })
+
+    //   // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
+    //   if (res.code == 500) {
+    //     // to re-login
+    //     Message({
+    //       message: '身份令牌过期或失效,即将重新登录',
+    //       type: 'error',
+    //       duration: 5 * 1000,
+    //       onClose: () => {
+    //         store.dispatch('tagsView/delAllViews').then(() => { })
+    //         store.dispatch('user/resetToken').then(() => {
+    //           location.reload()
+    //         })
+    //       }
+    //     })
+    //   }
+    //   // loadingInstance.close()
+    //   return Promise.reject(new Error(res.message || 'Error'))
+    // } else {
+    //   // loadingInstance.close()
+    //   return res
+    // }
+  },
+  error => {
+    // console.log('err', error) // for debug
+    const des = `${error}`.split(' ').includes('500')
+    if (des) {
+      Message({
+        message: '身份令牌过期或失效,即将重新登录',
+        type: 'error',
+        duration: 5 * 1000,
+        onClose: () => {
+          store.dispatch('app/toggleDialog', false)
+          store.dispatch('tagsView/delAllViews').then(() => { })
+          store.dispatch('user/resetToken').then(() => {
+            location.reload()
+          })
+        }
+      })
+      // MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
+      //   confirmButtonText: 'Re-Login',
+      //   cancelButtonText: 'Cancel',
+      //   type: 'warning'
+      // }).then(() => {
+      //   store.dispatch('user/resetToken').then(() => {
+      //     location.reload()
+      //   })
+      // })
+    } else {
+      Message({
+        message: error.message,
+        type: 'error',
+        duration: 5 * 1000
+      })
+    }
+    flag = false
+    loadingInstance.close()
+    return Promise.reject(error)
+  }
+)
+
+export default service

+ 78 - 229
src/views/authorityManagement/components/authorityAppAdd.vue

@@ -13,258 +13,107 @@
       <div class="addApp-form-title flex">
         <div class="title">新增应用</div>
         <div class="btn">
-          <el-button
-            type="primary"
-            @click="onSubmit"
-          >保存</el-button>
+          <el-button type="primary" @click="onSubmit">保存</el-button>
         </div>
       </div>
       <div class="addApp-form-content dialog-public-background">
-        <el-form
-          ref="form"
-          class="form"
-          :rules="rules"
-          :model="form"
-          label-position="right"
-          label-width="80px"
-        >
+        <el-form ref="form" class="form" :rules="rules" :model="form" label-position="right" label-width="80px">
           <div class="flex">
-            <el-form-item
-              label="应用名称"
-              prop="name"
-            >
-              <el-input
-                v-model.trim="form.name"
-                placeholder="请输入应用名称"
-              />
+            <el-form-item label="应用名称" prop="name">
+              <el-input v-model.trim="form.name" placeholder="请输入应用名称" />
             </el-form-item>
-            <el-form-item
-              label="请求类型"
-              prop="type"
-              :rules="{ required: domains.length, message: '选择请求类型', trigger: ['change', 'blur'] }"
-            >
-              <el-select
-                v-model="form.type"
-                placeholder="请求类型"
-                @change="typeChange"
-              >
-                <el-option
-                  label="get"
-                  :value="1"
-                />
-                <el-option
-                  label="post"
-                  :value="2"
-                />
+            <el-form-item label="请求类型" prop="type" :rules="{ required: domains.length, message: '选择请求类型', trigger: ['change', 'blur'] }">
+              <el-select v-model="form.type" placeholder="请求类型" @change="typeChange">
+                <el-option label="get" :value="1" />
+                <el-option label="post" :value="2" />
               </el-select>
             </el-form-item>
-            <el-form-item
-              label="参数类型"
-              prop="app"
-              :rules="{ required: form.type === 2 && domains.length, message: '请选择参数类型', trigger: ['change', 'blur'] }"
-            >
-              <el-select
-                v-model="form.app"
-                :disabled="typeFlag"
-                placeholder="参数类型"
-              >
-                <el-option
-                  label="application/json"
-                  value="application/json"
-                />
-                <el-option
-                  label="application/text"
-                  value="application/text"
-                />
+            <el-form-item label="参数类型" prop="app" :rules="{ required: form.type === 2 && domains.length, message: '请选择参数类型', trigger: ['change', 'blur'] }">
+              <el-select v-model="form.app" :disabled="typeFlag" placeholder="参数类型">
+                <el-option label="application/json" value="application/json" />
+                <el-option label="application/text" value="application/text" />
               </el-select>
             </el-form-item>
           </div>
-          <el-form-item
-            label="应用地址"
-            prop="url"
-            class="url"
-          >
-            <el-input
-              v-model.trim="form.url"
-              placeholder="请输入应用地址"
-            />
+          <el-form-item label="应用地址" prop="url" class="url">
+            <el-input v-model.trim="form.url" placeholder="请输入应用地址" />
           </el-form-item>
-          <el-form-item
-            prop="desc"
-            class="desc"
-            label="描述"
-          >
-            <el-input
-              v-model.trim="form.desc"
-              type="textarea"
-              rows="3"
-              placeholder="请输入描述"
-            />
+          <div class="flex-wrap">
+            <el-form-item label="加密类型" prop="algorithm">
+              <el-select v-model="form.algorithm" placeholder="加密类型">
+                <el-option v-for="(item,index) in algorithmDatas" :key="index" :label="item" :value="item" />
+              </el-select>
+            </el-form-item>
+            <div style="margin-left:50px" class="flex1">
+              <el-form-item label="公匙" prop="publicKey">
+                <el-input v-model.trim="form.publicKey" placeholder="请输入公匙" />
+              </el-form-item>
+            </div>
+          </div>
+          <el-form-item prop="desc" class="desc" label="描述">
+            <el-input v-model.trim="form.desc" type="textarea" rows="3" placeholder="请输入描述" />
           </el-form-item>
         </el-form>
         <div class="addApp-form-title domain-title flex">
           <div class="title">入参管理</div>
           <div class="btn">
-            <el-button
-              type="primary"
-              @click="addDomain"
-            >新增</el-button>
+            <el-button type="primary" @click="addDomain">新增</el-button>
           </div>
         </div>
         <div class="addApp-form-content domain">
-          <el-form
-            ref="dynamicValidateForm"
-            :model="dynamicValidateForm"
-            label-width="80px"
-            class="demo-dynamic"
-          >
-            <el-row
-              v-for="(domain, index) in domains"
-              :key="index"
-            >
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参名称"
-                  :prop="'domains.' + index + '.AppInputName'"
-                  :rules="[
+          <el-form ref="dynamicValidateForm" :model="dynamicValidateForm" label-width="80px" class="demo-dynamic">
+            <el-row v-for="(domain, index) in domains" :key="index">
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参名称" :prop="'domains.' + index + '.AppInputName'" :rules="[
                     { required: true, message: '请输入入参名称', trigger: ['change', 'blur'] },
                     { validator: lengthValidator, max: 64, message: '长度在 1 到 64 个字符', trigger: ['change', 'blur'] }
-                  ]"
-                >
-                  <el-input
-                    v-model.trim="domain.AppInputName"
-                    placeholder="请输入最大64位入参名称"
-                  />
+                  ]">
+                  <el-input v-model.trim="domain.AppInputName" placeholder="请输入最大64位入参名称" />
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参描述"
-                  :prop="'domains.' + index + '.InputComment'"
-                  :rules="[
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参描述" :prop="'domains.' + index + '.InputComment'" :rules="[
                     { required: true, message: '请输入入参描述', trigger: ['change', 'blur'] },
                     { validator: lengthValidator, max: 64, message: '长度在 1 到 64 个字符', trigger: ['change', 'blur'] }
-                  ]"
-                >
-                  <el-input
-                    v-model.trim="domain.InputComment"
-                    placeholder="请输入最大64位入参描述"
-                  />
+                  ]">
+                  <el-input v-model.trim="domain.InputComment" placeholder="请输入最大64位入参描述" />
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参类型"
-                  :prop="'domains.' + index + '.AppInputType'"
-                  :rules="{ required: form.type === 2, message: '请选择入参类型', trigger: ['change', 'blur'] }"
-                >
-                  <el-select
-                    v-model="domain.AppInputType"
-                    :disabled="typeFlag"
-                    placeholder="入参类型"
-                    @change="value => inputTypeChange(value, index)"
-                  >
-                    <el-option
-                      label="string"
-                      value="string"
-                    />
-                    <el-option
-                      label="int"
-                      value="int"
-                    />
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参类型" :prop="'domains.' + index + '.AppInputType'" :rules="{ required: form.type === 2, message: '请选择入参类型', trigger: ['change', 'blur'] }">
+                  <el-select v-model="domain.AppInputType" :disabled="typeFlag" placeholder="入参类型" @change="value => inputTypeChange(value, index)">
+                    <el-option label="string" value="string" />
+                    <el-option label="int" value="int" />
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参位置"
-                  :prop="'domains.' + index + '.AppInputSite'"
-                  :rules="{ required: true, message: '请选择入参位置', trigger: ['change', 'blur'] }"
-                >
-                  <el-select
-                    v-model="domain.AppInputSite"
-                    placeholder="入参位置"
-                  >
-                    <el-option
-                      v-if="form.type === 2"
-                      label="header"
-                      value="header"
-                    />
-                    <el-option
-                      v-if="form.type === 2"
-                      label="url"
-                      value="url"
-                    />
-                    <el-option
-                      label="body"
-                      value="body"
-                    />
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参位置" :prop="'domains.' + index + '.AppInputSite'" :rules="{ required: true, message: '请选择入参位置', trigger: ['change', 'blur'] }">
+                  <el-select v-model="domain.AppInputSite" placeholder="入参位置">
+                    <el-option v-if="form.type === 2" label="header" value="header" />
+                    <el-option v-if="form.type === 2" label="url" value="url" />
+                    <el-option label="body" value="body" />
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参值"
-                  :prop="'domains.' + index + '.InputValue'"
-                  :rules="[
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参值" :prop="'domains.' + index + '.InputValue'" :rules="[
                     { required: true, message: '请输入入参值', trigger: ['change', 'blur'] },
                     { pattern: domain.AppInputType === 'int' ? /^[1-9][0-9]*$/ : /[\S]+/, message: domain.AppInputType === 'int' ? '请输入纯数字' : '请勿输入空格', trigger: ['change', 'blur'] },
                     { validator: lengthValidator, max: 64, message: '长度在 1 到 64 个字符', trigger: ['change', 'blur'] }
-                  ]"
-                >
+                  ]">
                   <template v-if="domain.AppInputType === 'int'">
-                    <el-input
-                      v-model.trim="domain.InputValue"
-                      placeholder="请输入最大64位入参值"
-                    />
+                    <el-input v-model.trim="domain.InputValue" placeholder="请输入最大64位入参值" />
                   </template>
                   <template v-else>
-                    <el-autocomplete
-                      ref="inputValue"
-                      v-model.trim="domain.InputValue"
-                      placeholder="请输入最大64位入参值"
-                      :fetch-suggestions="querySearch"
-                    >
-                      <i
-                        slot="suffix"
-                        class="el-icon-edit el-input__icon"
-                        @click="handleIconClick(index)"
-                      />
+                    <el-autocomplete ref="inputValue" v-model.trim="domain.InputValue" placeholder="请输入最大64位入参值" :fetch-suggestions="querySearch">
+                      <i slot="suffix" class="el-icon-edit el-input__icon" @click="handleIconClick(index)" />
                     </el-autocomplete>
                   </template>
                 </el-form-item>
               </el-col>
-              <el-col
-                class="button-wrap"
-                :lg="{ span: '0-5' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-button
-                  size="small"
-                  type="danger"
-                  @click.prevent="removeDomain(index)"
-                >删除</el-button>
+              <el-col class="button-wrap" :lg="{ span: '0-5' }" :sm="12" :xs="12">
+                <el-button size="small" type="danger" @click.prevent="removeDomain(index)">删除</el-button>
               </el-col>
             </el-row>
           </el-form>
@@ -276,12 +125,7 @@
       <div class="flex-wrap">
         <div class="upload">
           <div class="title">上传Logo</div>
-          <el-upload
-            action="https://jsonplaceholder.typicode.com/posts/"
-            list-type="picture-card"
-            :on-preview="handlePictureCardPreview"
-            :on-remove="handleRemove"
-          >
+          <el-upload action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
             <i class="el-icon-plus" />
           </el-upload>
         </div>
@@ -299,7 +143,7 @@ import { SaveApp } from '@/api/apiAuthority'
 import { lengthValidator, regular } from '@/utils/validate'
 export default {
   name: 'Addapp',
-  data() {
+  data () {
     return {
       form: {
         // 应用表单
@@ -307,8 +151,11 @@ export default {
         type: '',
         app: '',
         url: '',
-        desc: ''
+        desc: '',
+        publicKey: '',
+        algorithm: ''
       },
+      algorithmDatas: ['RS256', 'RS512', 'HS256', 'HS512', 'ES256', 'ES512', 'PS256', 'PS512'],
       rules: {
         // 表单验证
         name: [
@@ -339,7 +186,7 @@ export default {
     }
   },
   computed: {
-    dynamicValidateForm() {
+    dynamicValidateForm () {
       return {
         domains: this.domains
       }
@@ -347,7 +194,7 @@ export default {
   },
   methods: {
     lengthValidator,
-    querySearch(queryString, callback) {
+    querySearch (queryString, callback) {
       const AppValues = this.AppValues
       const results = queryString
         ? AppValues.filter(AppValue => AppValue.value.toLowerCase().includes(queryString.toLowerCase()))
@@ -355,18 +202,18 @@ export default {
       // 调用 callback 返回建议列表的数据
       callback(results)
     },
-    handleIconClick(index) {
+    handleIconClick (index) {
       this.$refs['inputValue'][index].focus()
     },
-    handleRemove(file, fileList) {
+    handleRemove (file, fileList) {
       console.log(file, fileList)
     },
-    handlePictureCardPreview(file) {
+    handlePictureCardPreview (file) {
       this.dialogImageUrl = file.url
       this.dialogVisible = true
     },
     // 新增应用
-    async saveApp() {
+    async saveApp () {
       try {
         const res = await SaveApp({
           AppName: this.form.name,
@@ -374,7 +221,9 @@ export default {
           AppUrl: this.form.url,
           RequestType: this.form.type,
           BodyType: this.form.app,
-          Inputs: this.domains
+          Inputs: this.domains,
+          publicKey: this.form.publicKey,
+          algorithm: this.form.algorithm
         })
         if (res.code === 0) {
           this.$message.success(res.message)
@@ -392,7 +241,7 @@ export default {
      * @param {*}
      * @return {*}
      */
-    onSubmit() {
+    onSubmit () {
       let submitEnable = true
       this.$refs['form'].validate(valid => {
         if (!valid) {
@@ -408,10 +257,10 @@ export default {
       })
       submitEnable && this.saveApp()
     },
-    removeDomain(index) {
+    removeDomain (index) {
       this.domains.splice(index, 1)
     },
-    addDomain() {
+    addDomain () {
       const { type } = this.form
       if (type === 1) {
         this.domains.push({
@@ -439,7 +288,7 @@ export default {
         })
       }
     },
-    typeChange(val) {
+    typeChange (val) {
       const datas = this.domains
       if (val === 1) {
         this.typeFlag = true
@@ -457,7 +306,7 @@ export default {
         })
       }
     },
-    inputTypeChange(value, index) {
+    inputTypeChange (value, index) {
       this.$refs['dynamicValidateForm'].validateField('domains.' + index + '.InputValue')
     }
   }

+ 83 - 232
src/views/authorityManagement/components/authorityAppEdit.vue

@@ -23,258 +23,107 @@
         </div>
         <div class="btn">
           <!-- <el-button @click="deleteApp" class="r24" type="danger">删除</el-button> -->
-          <el-button
-            type="primary"
-            @click="onSubmit"
-          >保存</el-button>
+          <el-button type="primary" @click="onSubmit">保存</el-button>
         </div>
       </div>
       <div class="addApp-form-content dialog-public-background">
-        <el-form
-          ref="form"
-          class="form"
-          :rules="rules"
-          :model="form"
-          label-position="right"
-          label-width="80px"
-        >
+        <el-form ref="form" class="form" :rules="rules" :model="form" label-position="right" label-width="80px">
           <div class="flex">
-            <el-form-item
-              label="应用名称"
-              prop="name"
-            >
-              <el-input
-                v-model.trim="form.name"
-                placeholder="请输入应用名称"
-              />
+            <el-form-item label="应用名称" prop="name">
+              <el-input v-model.trim="form.name" placeholder="请输入应用名称" />
             </el-form-item>
-            <el-form-item
-              label="请求类型"
-              prop="type"
-              :rules="{ required: domains.length, message: '选择请求类型', trigger: ['change', 'blur'] }"
-            >
-              <el-select
-                v-model="form.type"
-                placeholder="请求类型"
-                @change="typeChange"
-              >
-                <el-option
-                  label="get"
-                  :value="1"
-                />
-                <el-option
-                  label="post"
-                  :value="2"
-                />
+            <el-form-item label="请求类型" prop="type" :rules="{ required: domains.length, message: '选择请求类型', trigger: ['change', 'blur'] }">
+              <el-select v-model="form.type" placeholder="请求类型" @change="typeChange">
+                <el-option label="get" :value="1" />
+                <el-option label="post" :value="2" />
               </el-select>
             </el-form-item>
-            <el-form-item
-              label="参数类型"
-              prop="app"
-              :rules="{ required: form.type === 2 && domains.length, message: '请选择参数类型', trigger: ['change', 'blur'] }"
-            >
-              <el-select
-                v-model="form.app"
-                :disabled="typeFlag"
-                placeholder="参数类型"
-              >
-                <el-option
-                  label="application/json"
-                  value="application/json"
-                />
-                <el-option
-                  label="application/text"
-                  value="application/text"
-                />
+            <el-form-item label="参数类型" prop="app" :rules="{ required: form.type === 2 && domains.length, message: '请选择参数类型', trigger: ['change', 'blur'] }">
+              <el-select v-model="form.app" :disabled="typeFlag" placeholder="参数类型">
+                <el-option label="application/json" value="application/json" />
+                <el-option label="application/text" value="application/text" />
               </el-select>
             </el-form-item>
           </div>
-          <el-form-item
-            label="应用地址"
-            prop="url"
-            class="url"
-          >
-            <el-input
-              v-model.trim="form.url"
-              placeholder="请输入应用地址"
-            />
+          <el-form-item label="应用地址" prop="url" class="url">
+            <el-input v-model.trim="form.url" placeholder="请输入应用地址" />
           </el-form-item>
-          <el-form-item
-            prop="desc"
-            class="desc"
-            label="描述"
-          >
-            <el-input
-              v-model.trim="form.desc"
-              type="textarea"
-              rows="3"
-              placeholder="请输入描述"
-            />
+          <div class="flex-wrap">
+            <el-form-item label="加密类型" prop="algorithm">
+              <el-select v-model="form.algorithm" placeholder="加密类型">
+                <el-option v-for="(item,index) in algorithmDatas" :key="index" :label="item" :value="item" />
+              </el-select>
+            </el-form-item>
+            <div style="margin-left:50px" class="flex1">
+              <el-form-item label="公匙" prop="publicKey">
+                <el-input v-model.trim="form.publicKey" placeholder="请输入公匙" />
+              </el-form-item>
+            </div>
+          </div>
+          <el-form-item prop="desc" class="desc" label="描述">
+            <el-input v-model.trim="form.desc" type="textarea" rows="3" placeholder="请输入描述" />
           </el-form-item>
         </el-form>
         <div class="addApp-form-title domain-title flex">
           <div class="title">入参管理</div>
           <div class="btn">
-            <el-button
-              type="primary"
-              @click="addDomain"
-            >新增</el-button>
+            <el-button type="primary" @click="addDomain">新增</el-button>
           </div>
         </div>
         <div class="addApp-form-content domain">
-          <el-form
-            ref="dynamicValidateForm"
-            :model="dynamicValidateForm"
-            label-width="80px"
-            class="demo-dynamic"
-          >
-            <el-row
-              v-for="(domain, index) in domains"
-              :key="index"
-            >
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参名称"
-                  :prop="'domains.' + index + '.AppInputName'"
-                  :rules="[
+          <el-form ref="dynamicValidateForm" :model="dynamicValidateForm" label-width="80px" class="demo-dynamic">
+            <el-row v-for="(domain, index) in domains" :key="index">
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参名称" :prop="'domains.' + index + '.AppInputName'" :rules="[
                     { required: true, message: '请输入入参名称', trigger: ['change', 'blur'] },
                     { validator: lengthValidator, max: 64, message: '长度在 1 到 64 个字符', trigger: ['change', 'blur'] }
-                  ]"
-                >
-                  <el-input
-                    v-model.trim="domain.AppInputName"
-                    placeholder="请输入最大64位入参名称"
-                  />
+                  ]">
+                  <el-input v-model.trim="domain.AppInputName" placeholder="请输入最大64位入参名称" />
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参描述"
-                  :prop="'domains.' + index + '.InputComment'"
-                  :rules="[
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参描述" :prop="'domains.' + index + '.InputComment'" :rules="[
                     { required: true, message: '请输入入参描述', trigger: ['change', 'blur'] },
                     { validator: lengthValidator, max: 64, message: '长度在 1 到 64 个字符', trigger: ['change', 'blur'] }
-                  ]"
-                >
-                  <el-input
-                    v-model.trim="domain.InputComment"
-                    placeholder="请输入最大64位入参描述"
-                  />
+                  ]">
+                  <el-input v-model.trim="domain.InputComment" placeholder="请输入最大64位入参描述" />
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参类型"
-                  :prop="'domains.' + index + '.AppInputType'"
-                  :rules="{ required: form.type === 2, message: '请选择入参类型', trigger: ['change', 'blur'] }"
-                >
-                  <el-select
-                    v-model="domain.AppInputType"
-                    :disabled="typeFlag"
-                    placeholder="入参类型"
-                    @change="value => inputTypeChange(value, index)"
-                  >
-                    <el-option
-                      label="string"
-                      value="string"
-                    />
-                    <el-option
-                      label="int"
-                      value="int"
-                    />
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参类型" :prop="'domains.' + index + '.AppInputType'" :rules="{ required: form.type === 2, message: '请选择入参类型', trigger: ['change', 'blur'] }">
+                  <el-select v-model="domain.AppInputType" :disabled="typeFlag" placeholder="入参类型" @change="value => inputTypeChange(value, index)">
+                    <el-option label="string" value="string" />
+                    <el-option label="int" value="int" />
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参位置"
-                  :prop="'domains.' + index + '.AppInputSite'"
-                  :rules="{ required: true, message: '请选择入参位置', trigger: ['change', 'blur'] }"
-                >
-                  <el-select
-                    v-model="domain.AppInputSite"
-                    placeholder="入参位置"
-                  >
-                    <el-option
-                      v-if="form.type === 2"
-                      label="header"
-                      value="header"
-                    />
-                    <el-option
-                      v-if="form.type === 2"
-                      label="url"
-                      value="url"
-                    />
-                    <el-option
-                      label="body"
-                      value="body"
-                    />
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参位置" :prop="'domains.' + index + '.AppInputSite'" :rules="{ required: true, message: '请选择入参位置', trigger: ['change', 'blur'] }">
+                  <el-select v-model="domain.AppInputSite" placeholder="入参位置">
+                    <el-option v-if="form.type === 2" label="header" value="header" />
+                    <el-option v-if="form.type === 2" label="url" value="url" />
+                    <el-option label="body" value="body" />
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col
-                :lg="{ span: '1-9' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-form-item
-                  label="入参值"
-                  :prop="'domains.' + index + '.InputValue'"
-                  :rules="[
+              <el-col :lg="{ span: '1-9' }" :sm="12" :xs="12">
+                <el-form-item label="入参值" :prop="'domains.' + index + '.InputValue'" :rules="[
                     { required: true, message: '请输入入参值', trigger: ['change', 'blur'] },
                     { pattern: domain.AppInputType === 'int' ? /^[1-9][0-9]*$/ : /[\S]+/, message: domain.AppInputType === 'int' ? '请输入纯数字' : '请勿输入空格', trigger: ['change', 'blur'] },
                     { validator: lengthValidator, max: 64, message: '长度在 1 到 64 个字符', trigger: ['change', 'blur'] }
-                  ]"
-                >
+                  ]">
                   <template v-if="domain.AppInputType === 'int'">
-                    <el-input
-                      v-model.trim="domain.InputValue"
-                      placeholder="请输入最大64位入参值"
-                    />
+                    <el-input v-model.trim="domain.InputValue" placeholder="请输入最大64位入参值" />
                   </template>
                   <template v-else>
-                    <el-autocomplete
-                      ref="inputValue"
-                      v-model.trim="domain.InputValue"
-                      placeholder="请输入最大64位入参值"
-                      :fetch-suggestions="querySearch"
-                    >
-                      <i
-                        slot="suffix"
-                        class="el-icon-edit el-input__icon"
-                        @click="handleIconClick(index)"
-                      />
+                    <el-autocomplete ref="inputValue" v-model.trim="domain.InputValue" placeholder="请输入最大64位入参值" :fetch-suggestions="querySearch">
+                      <i slot="suffix" class="el-icon-edit el-input__icon" @click="handleIconClick(index)" />
                     </el-autocomplete>
                   </template>
                 </el-form-item>
               </el-col>
-              <el-col
-                class="button-wrap"
-                :lg="{ span: '0-5' }"
-                :sm="12"
-                :xs="12"
-              >
-                <el-button
-                  size="small"
-                  type="danger"
-                  @click.prevent="removeDomain(index)"
-                >删除</el-button>
+              <el-col class="button-wrap" :lg="{ span: '0-5' }" :sm="12" :xs="12">
+                <el-button size="small" type="danger" @click.prevent="removeDomain(index)">删除</el-button>
               </el-col>
             </el-row>
           </el-form>
@@ -286,12 +135,7 @@
       <div class="flex-wrap">
         <div class="upload">
           <div class="title">上传Logo</div>
-          <el-upload
-            action="https://jsonplaceholder.typicode.com/posts/"
-            list-type="picture-card"
-            :on-preview="handlePictureCardPreview"
-            :on-remove="handleRemove"
-          >
+          <el-upload action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
             <i class="el-icon-plus" />
           </el-upload>
         </div>
@@ -309,7 +153,7 @@ import { GetAppDetails, EditApp, DeleteApp } from '@/api/apiAuthority'
 import { lengthValidator, regular } from '@/utils/validate'
 export default {
   name: 'Addapp',
-  data() {
+  data () {
     return {
       form: {
         // 应用表单
@@ -317,7 +161,9 @@ export default {
         type: '',
         app: '',
         url: '',
-        desc: ''
+        desc: '',
+        algorithm: '',
+        publicKey: ''
       },
       rules: {
         // 表单验证
@@ -339,6 +185,7 @@ export default {
       dialogImageUrl: '',
       dialogVisible: false,
       domains: [],
+      algorithmDatas: ['RS256', 'RS512', 'HS256', 'HS512', 'ES256', 'ES512', 'PS256', 'PS512'],
       AppValues: [
         {
           value: 'token'
@@ -352,13 +199,13 @@ export default {
     }
   },
   computed: {
-    dynamicValidateForm() {
+    dynamicValidateForm () {
       return {
         domains: this.domains
       }
     }
   },
-  created() {
+  created () {
     const { AuthId, Status } = this.$route.query
     this.radio = Status
     this.AppId = AuthId
@@ -366,7 +213,7 @@ export default {
   },
   methods: {
     lengthValidator,
-    querySearch(queryString, callback) {
+    querySearch (queryString, callback) {
       const AppValues = this.AppValues
       const results = queryString
         ? AppValues.filter(AppValue => AppValue.value.toLowerCase().includes(queryString.toLowerCase()))
@@ -374,30 +221,32 @@ export default {
       // 调用 callback 返回建议列表的数据
       callback(results)
     },
-    handleIconClick(index) {
+    handleIconClick (index) {
       this.$refs['inputValue'][index].focus()
     },
-    handleRemove(file, fileList) {
+    handleRemove (file, fileList) {
       console.log(file, fileList)
     },
-    handlePictureCardPreview(file) {
+    handlePictureCardPreview (file) {
       this.dialogImageUrl = file.url
       this.dialogVisible = true
     },
     // 获取应用详情
-    async getAppDetails(id) {
+    async getAppDetails (id) {
       try {
         const res = await GetAppDetails({
           AppId: id
         })
         if (res.code === 0) {
-          const { AppName, AppDesc, AppUrl, Inputs, RequestType, BodyType } = res.returnData
+          const { AppName, AppDesc, AppUrl, Inputs, RequestType, BodyType, PublicKey, Algorithm } = res.returnData
           this.form.name = AppName
           this.form.type = Number(RequestType) || ''
           this.form.app = BodyType
           this.form.desc = AppDesc
           this.form.url = AppUrl
           this.domains = Inputs
+          this.form.publicKey = PublicKey
+          this.form.algorithm = Algorithm
           this.typeFlag = this.form.type === 1
         } else {
           this.$message.error(res.message)
@@ -422,7 +271,7 @@ export default {
     //     console.log('出错了', error)
     //   }
     // },
-    onSubmit() {
+    onSubmit () {
       let submitEnable = true
       this.$refs['form'].validate(valid => {
         if (!valid) {
@@ -439,7 +288,7 @@ export default {
       submitEnable && this.editApp()
     },
     // 应用状态变更
-    async editApp() {
+    async editApp () {
       try {
         const res = await EditApp({
           AppId: this.AppId,
@@ -449,7 +298,9 @@ export default {
           RequestType: this.form.type,
           BodyType: this.form.app,
           Inputs: this.domains,
-          DeleteInputs: this.deleteInputs
+          DeleteInputs: this.deleteInputs,
+          publicKey: this.form.publicKey,
+          algorithm: this.form.algorithm
         })
         if (res.code === 0) {
           this.$message.success(res.message)
@@ -480,12 +331,12 @@ export default {
     //     console.log('出错了', error)
     //   }
     // },
-    removeDomain(index) {
+    removeDomain (index) {
       const deleteInputs = this.domains.splice(index, 1)
       const appInputId = deleteInputs[0].AppInputId
       !this.deleteInputs.includes(appInputId) && this.deleteInputs.push(appInputId)
     },
-    addDomain() {
+    addDomain () {
       const { type } = this.form
       if (type === 1) {
         this.domains.push({
@@ -516,7 +367,7 @@ export default {
         })
       }
     },
-    typeChange(val) {
+    typeChange (val) {
       const datas = this.domains
       if (val === 1) {
         this.typeFlag = true
@@ -534,7 +385,7 @@ export default {
         })
       }
     },
-    inputTypeChange(value, index) {
+    inputTypeChange (value, index) {
       this.$refs['dynamicValidateForm'].validateField('domains.' + index + '.InputValue')
     }
   }

+ 56 - 29
src/views/dashboard/components/analysis.vue

@@ -47,7 +47,7 @@
             <commonChartsPie :option="unusualOption" id="tu-unusual-content" />
           </div>
           <div class="tu-unusual-content-right">
-            <commonChartsNum style="margin-top: 0" :arrs="unusualTeams" />
+            <commonChartsNum @handleLog="handleLog" style="margin-top: 0" :arrs="unusualTeams" />
           </div>
         </div>
       </div>
@@ -58,7 +58,7 @@
             <commonChartsPie :option="loginOption" id="tu-login-content" />
           </div>
           <div class="tu-login-content-right">
-            <commonChartsNum :arrs="loginTeams" />
+            <commonChartsNum @handleLog="handleLog" :arrs="loginTeams" />
           </div>
         </div>
       </div>
@@ -69,7 +69,7 @@
             <commonChartsPie :option="authorizeOption" id="tu-authorize-content" />
           </div>
           <div class="tu-authorize-content-right">
-            <div v-for="(item, index) in authorizeArr" :key="index" class="behavior-list">
+            <div v-for="(item, index) in authorizeArr" @click="handleLog(item)" :key="index" class="behavior-list">
               <span :style="{ background: item.color }" class="icon"></span>
               <span class="name">{{ item.name }}:</span>
               <span class="num">{{ item.num }}</span>
@@ -84,7 +84,7 @@
             <commonChartsPie :option="behaviorOption" id="tu-behavior-content" />
           </div>
           <div class="tu-behavior-content-right">
-            <div v-for="(item, index) in behaviorArr" :key="index" class="behavior-list">
+            <div v-for="(item, index) in behaviorArr" @click="handleLog(item)" :key="index" class="behavior-list">
               <span :style="{ background: item.color }" class="icon"></span>
               <span class="name">{{ item.name }}:</span>
               <span class="num">{{ item.num }}</span>
@@ -495,19 +495,19 @@ export default {
       userTeams: [
         {
           number: 2780,
-          txt: "角色总数",
+          name: "角色总数",
           color: "#8969BE",
           key: "roleCount",
         },
         {
           number: 2136,
-          txt: "互斥角色数",
+          name: "互斥角色数",
           color: "#F4C23A",
           key: "defRoleCunt",
         },
         {
           number: 1355,
-          txt: "未使用角色数",
+          name: "未使用角色数",
           color: "#E752A3",
           key: "unuseRole",
         },
@@ -516,19 +516,19 @@ export default {
       loginTeams: [
         {
           number: 2780,
-          txt: "正常登录",
+          name: "正常登录",
           color: "#8969BE",
           key: "normalLogin",
         },
         {
           number: 735,
-          txt: "异常登录",
+          name: "异常登录",
           color: "#F4C23A",
           key: "abnormalLogin",
         },
         {
           number: 165,
-          txt: "非系统异常",
+          name: "非系统异常",
           color: "#E752A3",
           key: "nosystemLogin",
         },
@@ -606,18 +606,18 @@ export default {
             radius: ["40%", "100%"],
             data: [
               { value: 1275, name: "4A平台", key: "sys4a" },
+              { value: 2210, name: "企业微信", key: "sysWechat" },
               { value: 2210, name: "OA系统", key: "sysOA" },
               {
                 value: 2220,
-                name: "项目建设",
+                name: "项目管理",
                 key: "sysProjectManagementPlatform",
               },
               {
                 value: 2230,
-                name: "勘察设计",
+                name: "勘察平台",
                 key: "sysSurveyAndDesignManagementPlatform",
               },
-              { value: 2210, name: "企业微信", key: "sysWechat" },
               {
                 value: 2250,
                 name: "智慧工程",
@@ -635,6 +635,12 @@ export default {
           num: "1275",
           key: "sys4a",
         },
+        {
+          color: "#94C6E0",
+          name: "企业微信",
+          num: "2210",
+          key: "sysWechat",
+        },
         {
           color: "#F25555",
           name: "OA系统",
@@ -643,27 +649,33 @@ export default {
         },
         {
           color: "#F4C23A",
-          name: "项目建设",
+          name: "项目管理",
           num: "2220",
           key: "sysProjectManagementPlatform",
         },
+        {
+          color: "#85EAC8",
+          name: "智慧工地",
+          num: "2250",
+          key: "sysSmartConstructionSite",
+        },
+        {
+          color: "#46A3FF",
+          name: "电子签章",
+          num: "0",
+          key: "sysElectronicSignature",
+        },
         {
           color: "#E752A3",
-          name: "勘察设计",
+          name: "勘察平台",
           num: "2230",
           key: "sysSurveyAndDesignManagementPlatform",
         },
         {
-          color: "#94C6E0",
-          name: "企业微信",
-          num: "2210",
-          key: "sysWechat",
-        },
-        {
-          color: "#85EAC8",
-          name: "智慧工地",
-          num: "2250",
-          key: "sysSmartConstructionSite",
+          color: "#CA8EFF",
+          name: "BIM平台",
+          num: "0",
+          key: "sysBimPlatform",
         },
       ],
       // 数据概况
@@ -709,25 +721,25 @@ export default {
       unusualTeams: [
         {
           number: 1275,
-          txt: "下发有效",
+          name: "下发有效",
           color: "#8969BE",
           key: "pushSuccess",
         },
         {
           number: 220,
-          txt: "下发无效",
+          name: "下发无效",
           color: "#E752A3",
           key: "pushFailed",
         },
         {
           number: 220,
-          txt: "接收有效",
+          name: "接收有效",
           color: "#F4C23A",
           key: "receiveSuccess",
         },
         {
           number: 220,
-          txt: "接收无效",
+          name: "接收无效",
           color: "#F56C6C",
           key: "receiveFailed",
         },
@@ -757,6 +769,13 @@ export default {
     this.pageInit();
   },
   methods: {
+    //查询日志
+    handleLog (item) {
+      this.$emit('sendLog', item);
+    },
+    msgHandleLog (item) {
+      console.log('xx')
+    },
     //账号信息切换
     checkAccountType (params) {
       if (params.value === 1 && params.name === "账号") {
@@ -1024,6 +1043,7 @@ export default {
     }
     .behavior-list {
       margin-top: 16px;
+      cursor: pointer;
       .icon {
         display: inline-block;
         width: 3px;
@@ -1047,6 +1067,13 @@ export default {
         margin-top: 59px;
       }
     }
+    .tu-behavior {
+      .behavior-list {
+        &:first-child {
+          margin-top: 0px;
+        }
+      }
+    }
   }
 }
 </style>

+ 12 - 0
src/views/dashboard/components/journal.vue

@@ -72,6 +72,12 @@ import { GetLogList } from "@/api/apiLog";
 import { parseTime } from "@/utils/index";
 export default {
   name: "Journal",
+  props: {
+    logObj: {
+      type: Object,
+      default: () => { }
+    }
+  },
   components: { Search },
   data () {
     return {
@@ -100,6 +106,12 @@ export default {
       },
       deep: true,
     },
+    logObj: {
+      handler (obj) {
+        this.getSearchData(obj.name)
+      },
+      deep: true
+    }
   },
   created () {
     this.BeginTime = this.value1[0];

+ 32 - 74
src/views/dashboard/index.vue

@@ -10,41 +10,22 @@
   <div class="dashboard">
     <!--分类信息-->
     <div class="flex-wrap tu-fl">
-      <div
-        v-for="item in flList"
-        :key="item.appId"
-        class="fl-list"
-      >
+      <div v-for="item in flList" :key="item.appId" class="fl-list">
         <template v-if="item.params.length > 1">
-          <el-dropdown
-            placement="bottom"
-            trigger="click"
-            class="fl-list-button"
-            @command="handleCommand"
-          >
+          <el-dropdown placement="bottom" trigger="click" class="fl-list-button" @command="handleCommand">
             <div class="flex">
               <div class="fl-list-img">
                 <template v-if="item.logo">
-                  <img
-                    :alt="item.appName"
-                    :src="item.logo"
-                  >
+                  <img :alt="item.appName" :src="item.logo">
                 </template>
                 <template v-else>
-                  <img
-                    src="../../assets/index/log_default.png"
-                    :alt="item.appName"
-                  >
+                  <img src="../../assets/index/log_default.png" :alt="item.appName">
                 </template>
               </div>
               <div class="fl-list-title flex1">{{ item.appName }}</div>
             </div>
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item
-                v-for="(p, i) in item.params"
-                :key="i"
-                :command="{ item, index: i}"
-              >
+              <el-dropdown-item v-for="(p, i) in item.params" :key="i" :command="{ item, index: i}">
                 <!-- {{ Object.entries(p).filter(arr => arr[1].repeat).map(arr => arr[1].comment).join(' ') }} -->
                 {{ Object.values(p).reduce((pre, cur) => cur.repeat ? pre.concat(cur.comment) : pre, []).join(' ') }}
               </el-dropdown-item>
@@ -52,22 +33,13 @@
           </el-dropdown>
         </template>
         <template v-else>
-          <div
-            class="flex fl-list-button"
-            @click="toApp(item)"
-          >
+          <div class="flex fl-list-button" @click="toApp(item)">
             <div class="fl-list-img">
               <template v-if="item.logo">
-                <img
-                  :alt="item.appName"
-                  :src="item.logo"
-                >
+                <img :alt="item.appName" :src="item.logo">
               </template>
               <template v-else>
-                <img
-                  src="../../assets/index/log_default.png"
-                  :alt="item.appName"
-                >
+                <img src="../../assets/index/log_default.png" :alt="item.appName">
               </template>
             </div>
             <div class="fl-list-title flex1">{{ item.appName }}</div>
@@ -85,44 +57,23 @@
       </div>
       <div class="search flex-wrap">
         <div class="search-input flex-wrap r24">
-          <el-select
-            v-model="select"
-            :style="inputFlag ? 'width:150px;' : 'width:200px;'"
-            placeholder="功能菜单"
-            @change="handleChange"
-          >
-            <el-option
-              v-for="item in routes"
-              :key="item.path"
-              :label="item.meta.title"
-              :value="item.path"
-            />
+          <el-select v-model="select" :style="inputFlag ? 'width:150px;' : 'width:200px;'" placeholder="功能菜单" @change="handleChange">
+            <el-option v-for="item in routes" :key="item.path" :label="item.meta.title" :value="item.path" />
           </el-select>
-          <el-input
-            v-show="inputFlag"
-            v-model.trim="input"
-            :style="inputFlag ? 'width:330px;' : 'width:280px;'"
-            placeholder="如需搜索,请输入"
-            class="input-with-select"
-            @keyup.enter.native="searchByLink"
-          />
+          <el-input v-show="inputFlag" v-model.trim="input" :style="inputFlag ? 'width:330px;' : 'width:280px;'" placeholder="如需搜索,请输入" class="input-with-select" @keyup.enter.native="searchByLink" />
           <!-- <el-select v-model="select" slot="prepend" placeholder="功能菜单">
             <el-option v-for="(item,index) in selectArr" :key="index" :label="item.name" :value="item.value"></el-option>
           </el-select> -->
         </div>
         <div class="search-btn">
-          <el-button
-            class="btn"
-            type="primary"
-            @click="searchByLink"
-          >进入</el-button>
+          <el-button class="btn" type="primary" @click="searchByLink">进入</el-button>
         </div>
       </div>
     </div>
     <!--数据分析-->
-    <Analysis v-show="radio == 1" />
+    <Analysis @sendLog="sendLog" v-show="radio == 1" />
     <!--个人日志-->
-    <Journal v-show="radio == 2" />
+    <Journal :logObj="logObj" v-show="radio == 2" />
   </div>
 </template>
 
@@ -140,7 +91,7 @@ import { getLogId, getUserId, getUserName } from '@/utils/auth'
 export default {
   name: 'Dashboard',
   components: { Analysis, Journal },
-  data() {
+  data () {
     return {
       roleFlag: true,
       inputFlag: false,
@@ -199,29 +150,36 @@ export default {
       radio: '1',
       flIndex: 0,
       input: '',
-      select: ''
+      select: '',
+      logObj: {}
     }
   },
   computed: {
     ...mapGetters(['systemSet', 'UserType', 'UserId']),
-    routes() {
+    routes () {
       const arrs = this.$store.getters.permission_routes
       const datas = arrs.filter(item => item.meta && item.meta.title !== '首页')
       return datas
     }
   },
-  mounted() {
+  mounted () {
     this.isPower()
     this.getOthSystem()
   },
   methods: {
+    //获取日志信息
+    sendLog (item) {
+      this.radio = '2'
+      this.logObj = item
+      this.$router.push({ path: '/dashboard', query: { keyWords: item.name } })
+    },
     // 搜索-跳转
-    searchByLink() {
+    searchByLink () {
       const url = this.select
       this.input ? this.$router.push({ path: url, query: { keyWords: this.input } }) : this.$router.push(url)
     },
     // 获取接入系统信息
-    async getOthSystem() {
+    async getOthSystem () {
       try {
         const result = await GetOthSystem({
           userId: Number(this.UserId),
@@ -290,7 +248,7 @@ export default {
       }
     },
     // 判断页面展示权限
-    isPower() {
+    isPower () {
       const obj = typeof this.systemSet === 'string' ? JSON.parse(this.systemSet) : this.systemSet
       const { OpenGroup, OpenRole, UserOfficerMulti } = obj
       if (!OpenGroup) {
@@ -315,14 +273,14 @@ export default {
         })
       }
     },
-    handleChange(val) {
+    handleChange (val) {
       if (val !== '/systemManagement') {
         this.inputFlag = true
       } else {
         this.inputFlag = false
       }
     },
-    paramsType(t, num, url, name) {
+    paramsType (t, num, url, name) {
       let type = 'application/json'
       let result = ''
       if (t == 'json') {
@@ -364,10 +322,10 @@ export default {
         })
     },
     // 应用跳转
-    handleCommand({ item, index }) {
+    handleCommand ({ item, index }) {
       this.toApp(item, index)
     },
-    async toApp(item, index = 0) {
+    async toApp (item, index = 0) {
       if (Number(item.status) === 1) {
         if (item.appUrl) {
           let method