<template>
  <!-- 左边的部分 -->
  <el-space wrap class='left'>
    <el-aside width='200px'>
      <el-affix :offset='1'>
        <Left></Left>
      </el-affix>
    </el-aside>
  </el-space>
  <!-- 右边的盒子 -->
  <div class='common-layout'>
    <el-container>
      <el-header class='head'>
        <div class='icon'></div>
        <div style='margin-top: 10px; margin-left: 15px;width: 400px;'>操作说明</div>
        <div class='waring-icon'>
          <i class='fas fa-exclamation-triangle'></i>
          <span style='font-size: 15px;'>您可通过应用的 API Key和 Secret Key获取Access_token来调用服务;为了您的服务安全,请妥善保存和定期更新Secret
            Key。</span>
        </div>
        <div>
          <el-link type='primary'>查看鉴权认证机制</el-link>
        </div>
      </el-header>
      <!-- 右边下边的部分 -->
      <el-main class='foot'>
        <div class='icon'></div>
        <div style='margin-top: 10px; margin-left: 15px;width: 400px;'>应用信息</div>
<pre><code>    &lt;!-- 创建应用 --&gt;
    &lt;el-button type='primary' @click='createDialogVisible = true'
      style='margin-top: 20px; margin-left: 10px; width: 120px;'&gt;创建应用&lt;/el-button&gt;
    &lt;el-dialog v-model='createDialogVisible' title='创建应用' style='font-weight: bold; width: 650px;'&gt;
      &lt;el-form :model='form'&gt;
        &lt;el-form-item label='应用名称' :label-width='formLabelWidth'&gt;
          &lt;el-input v-model='form.name' autocomplete='off' placeholder='请输入应用名称' /&gt;
        &lt;/el-form-item&gt;
        &lt;el-form-item label='应用log' :label-width='formLabelWidth' style='margin-top:20px'&gt;
          &lt;el-upload class='upload-demo' action='/your-upload-url' :auto-upload='false' multiple :limit='1'
            accept='.png'&gt;
            &lt;el-button slot='trigger' type='primary'&gt;点击上传&lt;/el-button&gt;
          &lt;/el-upload&gt;
        &lt;/el-form-item&gt;
        &lt;div class='logfoot'&gt; 支持文件格式: png,单个文件不能超过500KB推荐分辨率为200px*60px &lt;/div&gt;
      &lt;/el-form&gt;
      &lt;template #footer&gt;
        &lt;span class='dialog-footer'&gt;
          &lt;el-button type='primary' @click='createDialogVisible = false'&gt;
            创建
          &lt;/el-button&gt;
        &lt;/span&gt;
      &lt;/template&gt;
    &lt;/el-dialog&gt;

    &lt;!-- 修改密码 --&gt;
    &lt;el-button type='primary' @click='changePasswordDialogVisible = true'
      style='margin-top: 20px; margin-left: 40px; width: 120px;'&gt;修改密码&lt;/el-button&gt;
    &lt;el-dialog v-model='changePasswordDialogVisible' title='修改密码'
      style='font-weight: bold; width: 550px; height: 300px;'&gt;
      &lt;el-form :model='form'&gt;
        &lt;el-form-item label='输入新密码' :label-width='formLabelWidth'&gt;
          &lt;el-input v-model='form.name' autocomplete='off' placeholder='请输入新密码' /&gt;
        &lt;/el-form-item&gt;
        &lt;el-form-item label='重复输入密码' :label-width='formLabelWidth' style='margin-top:20px'&gt;
          &lt;el-input v-model='form.name' autocomplete='off' placeholder='请确认密码' /&gt;
        &lt;/el-form-item&gt;
        &lt;div class='passfoot'&gt; 由于您的密码被重置,请修改密码后重新登录! &lt;/div&gt; &lt;br&gt; &lt;br&gt;&lt;el-divider /&gt;

      &lt;/el-form&gt;
      &lt;template #footer&gt;
        &lt;span class='dialog-footer'&gt;
          &lt;el-button type='primary' @click='changePasswordDialogVisible = false' style='margin-top: -80px;'&gt;
            确定
          &lt;/el-button&gt;
        &lt;/span&gt;
      &lt;/template&gt;
    &lt;/el-dialog&gt;

    &lt;!-- 日志查询 --&gt;

    &lt;el-dialog v-model='getdDialogVisible' title='日志查询' style='font-weight: bold; width: 1050px;'&gt;
      &lt;hr style='margin-top: -15px;'&gt;
      &lt;div style='float: left;'&gt;
        &lt;el-input v-model='form.name' autocomplete='off' placeholder='请选择接口'
          style='margin-left: 20px; width: 180px; height: 30px; margin-top:25px;' /&gt;
        &lt;el-input v-model='form.name' autocomplete='off' placeholder='请选择状态'
          style='margin-left: 20px; width: 180px; height: 30px; margin-top: 25px;' /&gt;
      &lt;/div&gt;

      &lt;div class='block'&gt;
        &lt;span class='demonstration'&gt;&lt;/span&gt;
        &lt;el-date-picker v-model='value1' type='datetimerange' range-separator='To' start-placeholder='请输入起始日期和时间'
          end-placeholder='请输入结束日期和时间' /&gt;
        &lt;el-button type='primary' style='width: 100px; margin-top: -50px; margin-left: 450px;'&gt;查询&lt;/el-button&gt;
      &lt;/div&gt;
      &lt;div class='interface_document' v-for='i in LoginterfaceDocument'&gt;
        &lt;div class='item' v-for='detail in i.interfaces'&gt;
          &lt;div v-for='tableData in detail.contains'&gt;
            &lt;div class='item_table'&gt;
              &lt;el-table :data='tableData.Header' border style='width: 860px;  margin-left: 20px;margin-top: 30px;'&gt;
                &lt;el-table-column prop='number' label='编号' width='90' /&gt;
                &lt;el-table-column prop='infernce' label='接口' width='170' /&gt;
                &lt;el-table-column prop='update' label='调用是否成功' width='190' /&gt;
                &lt;el-table-column prop='date' label='调用时间' width='200' /&gt;
                &lt;el-table-column prop='upaction' label='操作'&gt;
                  &lt;a href='' class='custom-link'&gt; 查看详情&lt;/a&gt;
                &lt;/el-table-column&gt;
              &lt;/el-table&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;el-pagination background :total='50' :show-total='false' class='page' /&gt;
    &lt;/el-dialog&gt;

    &lt;!-- 查看应用详情页面--&gt;
    &lt;el-dialog v-model='ViewDetailsdDialogVisible' title='应用信息'
      style='font-weight: bold; width: 550px; height: 580px;'&gt;
      &lt;el-form :model='form' label-position='left' style='margin-left: 20px;'&gt;
        &lt;el-form-item label='应用名称' :label-width='formLabelWidth'&gt;
          &lt;el-input v-model='input' disabled placeholder='123' /&gt;
        &lt;/el-form-item&gt;
        &lt;el-form-item label='APPID' :label-width='formLabelWidth' style='margin-top:20px'&gt;
          &lt;el-input v-model='input' disabled placeholder='a123' /&gt;
        &lt;/el-form-item&gt;
        &lt;el-form-item label='APPKEY' :label-width='formLabelWidth'&gt;
          &lt;el-input v-model='input' disabled placeholder='sddd' /&gt;
        &lt;/el-form-item&gt;
        &lt;el-form-item label='SECRETKEY' :label-width='formLabelWidth'&gt;
          &lt;el-input v-model='input' disabled placeholder='asd*****' style='width: 130px;' /&gt;
          &lt;el-button type='primary' style='margin-left: 20px;'&gt; 重新生成 &lt;/el-button&gt;
          &lt;span class='Tkey'&gt;SECRETKEY生成一次后则无法查看,请重新生成!&lt;/span&gt;
        &lt;/el-form-item&gt;
        &lt;el-form-item label='LOG' :label-width='formLabelWidth'&gt;
          &lt;div class='demo-image__preview'&gt;
            &lt;el-image style='width: 180px; height: 100px' :src='url' :zoom-rate='1.2' :initial-index='4'
              fit='cover' /&gt;
          &lt;/div&gt;

          &lt;el-upload class='upload-demo' action='/your-upload-url' :auto-upload='false' multiple :limit='1'
            accept='.png'&gt;
            &lt;el-button slot='trigger' text style='font-size: 16px;'&gt;
              &lt;div class='log'&gt;&lt;/div&gt; 点击上传
            &lt;/el-button&gt;
          &lt;/el-upload&gt;
        &lt;/el-form-item&gt;
        &lt;span class='Viewfoot'&gt;支持文件格式:png,单个文件不能超过500kb,推荐分辨率为200px*60px&lt;/span&gt;

      &lt;/el-form&gt;
      &lt;el-divider /&gt;
      &lt;template #footer&gt;
        &lt;span class='dialog-footer'&gt;
          &lt;el-button type='primary' @click='ViewDetailsdDialogVisible = false'&gt;
            确定
          &lt;/el-button&gt;
        &lt;/span&gt;
      &lt;/template&gt;
    &lt;/el-dialog&gt;

    &lt;div class='interface_document' v-for='i in interfaceDocument'&gt;
      &lt;div class='item' v-for='detail in i.interfaces'&gt;
        &lt;div v-for='tableData in detail.contains'&gt;
          &lt;div class='item_table'&gt;
            &lt;el-table :data='tableData.Header' border style='width: 980px; margin-left: 20px;margin-top: 30px;'&gt;
              &lt;el-table-column prop='id' label='序号' width='60' /&gt;
              &lt;el-table-column prop='name' label='应用名称' width='100' /&gt;
              &lt;el-table-column prop='appID' label='APPID' width='100' /&gt;
              &lt;el-table-column prop='appkey' label='APPKEY' width='100' /&gt;
              &lt;el-table-column prop='secretkey' label='Secret Key' width='100' /&gt;
              &lt;el-table-column prop='date' label='创建时间' width='200' /&gt;
              &lt;el-table-column prop='state' label='状态' width='150' /&gt;
              &lt;template  v-slot:item='{ row }'&gt;
                &lt;p v-if='row.state === '已发布''&gt;&lt;/p&gt;
                &lt;p  v-else-if='row.state === '未发布''&gt;&lt;/p&gt;
              &lt;/template&gt;
              &lt;el-table-column prop='action' label='操作'&gt;
                &lt;a href='#'  class='transparent-link' &gt;取消发布&lt;/a&gt;
                &lt;div class='flex justify-space-between mb-4 flex-wrap gap-4'&gt;
                  &lt;el-button @click='open' class='transparent-delete'  v-for='button in buttons' :key='button.text'
                    :type='button.type' link&gt;{{ button.text
                    }}&lt;/el-button&gt;
                &lt;/div&gt;
                &lt;a href='#' class='transparent-link' @click='getdDialogVisible = true'&gt;查看日志&lt;/a&gt;
                &lt;a href='#' class='transparent-link'&gt;查看主页&lt;/a&gt;
                &lt;a href='#' class='transparent-link' @click='ViewDetailsdDialogVisible = true'&gt;查看详情&lt;/a&gt;

              &lt;/el-table-column&gt;
            &lt;/el-table&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/el-main&gt;
&lt;/el-container&gt;
</code></pre>
  </div>
</template>
<script lang='ts' setup>
// 引入侧边栏
// eslint-disable-next-line @typescript-eslint/quotes
import Left from '../console/Left.vue'
// 引入弹出框的页面
import { reactive, ref } from 'vue'

import { ElMessage, ElMessageBox } from 'element-plus'
const url =
  'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg'
const open = () => {
  ElMessageBox.confirm(
    '此操作将永久删除该项目, 是否继续?',
    '信息提示',
    {
      confirmButtonText: '确认',
      cancelButtonText: '取消',
      type: 'warning'
    }
  )
    .then(() => {
      ElMessage({
        type: 'success',
        message: '删除成功'
      })
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消成功'
      })
    })
}
const buttons = [
  { type: 'primary', text: '删除应用' }
] as const

const input = ref('')

const createDialogVisible = ref(false)

const changePasswordDialogVisible = ref(false)

const getdDialogVisible = ref(false)

const ViewDetailsdDialogVisible = ref(false)

const formLabelWidth = '120px'
const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: ''
})
const value1 = ref<[Date, Date]>([
  new Date(2000, 10, 10, 10, 10),
  new Date(2000, 10, 11, 10, 10)
])

// 接口文档数据
const interfaceDocument = [
  {

    interfaces: [
      {

        contains: [
          {
            Header: [
              {
                id: '1',
                name: 'testapp',
                appID: '1254256',
                appkey: 'VBCfs..',
                secretkey: 'asdvdfdfg',
                date: '2023年9月13日 14:33:16',
                state: '已发布'
              },
              {
                id: '2',
                name: 'testapp2',
                appID: '1254256',
                appkey: 'VBCfs..',
                secretkey: 'asdvdfdfg',
                date: '2023年9月13日 14:33:16',
                state: '未发布'
              },
              {
                id: '3',
                name: 'testapp3',
                appID: '1254256',
                appkey: 'VBCfs..',
                secretkey: 'asdvdfdfg',
                date: '2023年9月13日 14:33:16',
                state: '未发布'
              }]
          }
        ]
      }
    ]
  }

]
// 日志查询数据

const LoginterfaceDocument = [
  {

    interfaces: [
      {

        contains: [
          {
            Header: [
              {
                number: '1',
                infernce: '/addInformation',
                update: '成功',
                date: '2023年9月20日 13:59:08..'
              },
              {
                number: '2',
                infernce: '/addInformation',
                update: '失败',
                date: '2023年9月20日 13:59:08..'

              }
            ]

          }
        ]
      }
    ]
  }

]

</script>
<style >
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

.el-button--text {
  margin-right: 15px;
  margin-top: 15px
}

.el-input {
  width: 240px;
  height: 30px
}

.dialog-footer button:first-child {
  margin-right: 10px;
  margin-top: -50px;
}

.logfoot {
  margin-left: 120px;
  margin-top: -15px
}

.passfoot {
  float: right;
  margin-top: 20px;
  color: #b88230;
  font-size: 14px;
}

.waring-icon {
  display: flex;
  align-items: center;
  margin-top: 30px;
  margin-left: 5px;
}

.block {
  margin-left: 420px;
  height: 50px;
  margin-top: 25px;
  width: 450px;

}

.custom-link {
  text-decoration: underline;
  color: #60a5fa;
  margin-left: 5px;
}

i {
  color: red;
  margin-right: 5px;
}

.head {
  background-color: white;
  margin-top: 15px;
  margin-left: 10px;
  height: 180px;
}

.foot {
  background-color: white;
  margin-top: 15px;
  margin-left: 10px;
  height: 600px;
}

.icon {
  height: 20px;
  width: 5px;
  margin-top: 12px;
  background-color: #60a5fa;
  float: left;
}

.el-link {
  text-decoration: underline !important;
  margin-left: 30px;
  margin-top: 20px;
}

.common-layout {
  /* margin-left: 260px; */
  /* float: left; */
  display: flex;
  width: 100%;
}
.item_table .el-table__header th {
  color: black;
}

.page {
  margin-top: 40px;
  /* margin-left: 260px; */
}

.Tkey {
  color: #b88230;
  margin-top: 12px;
  font-size: small;
  margin-left: -80px;
}

.Viewfoot {
  font-size: smaller;
}

.transparent-link {
  margin-left: 15px;
  text-decoration: underline;
  color: #60a5fa;
}

a:hover {
  color: #60a5fa;
  font-weight: bold;
  /* 字体加粗 */
}

.transparent-delete {
  float: left;
  margin-top: -20px;
  margin-left: 80px;
  text-decoration: underline;
}

.log {
  height: 8px;
  width: 7px;
  border: 1px solid;
  margin-right: 6px;
}

.demo-image__error .image-slot {
  font-size: 30px;
}

.demo-image__error .image-slot .el-icon {
  font-size: 30px;
}

.demo-image__error .el-image {
  width: 100%;
  height: 200px;
}

/* 流动布局 */
.left {
  width: 200px;
  float: left;
}
.common-layout {
  margin-left: 220px;
  width: calc(100% - 220px);
}
/* 同比例放大 */
.common-layout, .left, .head, .foot, .interface_document, .item, .item_table, .el-table, .el-table-column, .el-button, .el-input, .el-form-item, .el-link, .el-dialog, .el-pagination {
  box-sizing: border-box;
  width: auto;
  height: auto;
  font-size: 1rem;
}

.common-layout * {
  font-size: inherit;
}

.common-layout, .left, .head, .foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.item_table, .el-table {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.el-table-column {
  width: auto;
}

.el-table-column:last-child {
  width: auto;
  flex: 1;
}

.el-button, .el-input, .el-form-item, .el-link {
  width: auto;
  height: auto;
}

.el-dialog {
  width: auto;
  height: auto;
}

.el-pagination {
  width: auto;
}

@media (min-width: 768px) {
  .common-layout {
    margin-left: 260px;
    width: calc(100% - 260px);
  }
  .left {
    width: 260px;
  }
}
</styl
应用管理平台 - 创建、管理和监控您的应用

原文地址: https://www.cveoy.top/t/topic/pbIV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录