caiaa 1 년 전
부모
커밋
d10b41d71e

+ 1 - 1
mock/dict.js

@@ -17,7 +17,7 @@ module.exports = [
     }
   },
   {
-    url: '/sysDict/type/bisiness_type',
+    url: '/sysDict/type/business_type',
     type: 'get',
     response: config => {
       return {

+ 2 - 2
src/components/Upload/UploadExcel.vue

@@ -72,10 +72,10 @@ export default {
       const formData = new FormData()
       formData.append('file', options.file)
       uploadExcel(this.type, formData).then(res => {
-        if (options.onSuccess && res.data) {
+        if (options.onSuccess) {
           options.onSuccess(res.data)
         } else {
-          options.onError(new Error(res.data))
+          console.log(res.data)
         }
       }).catch(error => {
         console.log(error)

+ 2 - 2
src/components/Upload/UploadFile.vue

@@ -72,10 +72,10 @@ export default {
       const formData = new FormData()
       formData.append('file', options.file)
       uploadFile(this.fileType, formData).then(res => {
-        if (options.onSuccess && res.data) {
+        if (options.onSuccess) {
           options.onSuccess(res.data)
         } else {
-          options.onError(new Error('Upload Failed: ' + res.data))
+          console.log(res.data)
         }
       }).catch(error => {
         console.log(error)

+ 1 - 0
src/layout/components/AppMain.vue

@@ -9,6 +9,7 @@
       Copyright © 2023 厦门市巨龙信息科技有限公司  建议使用1280*768以上分辨率
     </span>
     <section>
+      <!-- <div class="">在线留言</div> -->
       <information ref="Information" />
     </section>
   </section>

+ 15 - 18
src/views/application/index.vue

@@ -19,7 +19,7 @@
                   <span class="top-count">{{ formatCount(item.downloads) }}次下载</span>
                 </div>
               </div>
-              <el-button type="primary" size="small" style="width:56px">下载</el-button>
+              <el-button type="primary" size="small" style="width:56px" @click="downloadItem(item)">下载</el-button>
             </div>
           </div>
         </div>
@@ -114,6 +114,7 @@ import { fetchFileList, fetchTopN, pushDeleteFile } from '@/api/file'
 
 import { hasValidRecords, formatDictData, isNull } from '@/utils/convert'
 import { formatBytes, formatCount } from '@/utils'
+import { formatFileUrl } from '@/filters'
 
 import EllipsisTooltip from '@/components/EllipsisTooltip'
 import UploadFile from '@/components/Upload/UploadFile.vue'
@@ -221,27 +222,23 @@ export default {
       })
     },
     downloadItem(item) {
-      window.open(item.url, '_blank')
+      window.open(formatFileUrl(item.url), '_blank')
       item.downloads++
     },
     deleteItem(id) {
-      this.$message({
-        type: 'info',
-        message: '开发中'
+      this.loading = true
+      pushDeleteFile(id).then(res => {
+        this.getTablelist()
+      }).catch(error => {
+        console.log(error)
+        this.loading = false
+        this.$message({
+          type: 'error',
+          duration: 0,
+          showClose: true,
+          message: '删除软件出错: ' + error.message
+        })
       })
-      // this.loading = true
-      // pushDeleteFile(id).then(res => {
-      //   this.getTablelist()
-      // }).catch(error => {
-      //   console.log(error)
-      //   this.loading = false
-      //   this.$message({
-      //     type: 'error',
-      //     duration: 0,
-      //     showClose: true,
-      //     message: '删除软件出错: ' + error.message
-      //   })
-      // })
     },
     getTopNData() {
       const typeIds = this.typeData.map(item => item.id).join(',')

+ 34 - 7
src/views/business/index.vue

@@ -25,9 +25,8 @@
       </div>
       <div class="list-button">
         <el-button type="primary" @click="showEdit('ADD')">新增</el-button>
-        <el-upload action="" class="upload-btn">
-          <el-button>导入</el-button>
-        </el-upload>
+        <upload-excel ref="uploadFile" class="upload-btn" type="BUSINESS" :before-upload="uploadBefore" :on-success="uploadSuccess" :on-error="uploadError" />
+        <el-button type="info" @click="downloadTemplate">模板下载</el-button>
       </div>
       <div v-loading="loading" class="list-box">
         <el-scrollbar class="list-scrollbar">
@@ -74,19 +73,21 @@
 
 <script>
 import { fetchDictData } from '@/api/dict'
+import { downloadTemplate } from '@/api/file'
 import { fetchAllBizList, pushDeleteBusiness } from '@/api/business'
 
 import { hasValidRecords, formatDictData, isNull } from '@/utils/convert'
 
 import DetailEdit from './components/DetailEdit'
+import UploadExcel from '@/components/Upload/UploadExcel'
 
 export default {
   name: 'Business',
-  components: { DetailEdit },
+  components: { DetailEdit, UploadExcel },
   data() {
     return {
       // type
-      dictType: 'bisiness_type',
+      dictType: 'business_type',
       typeData: [],
       // table
       current: 1,
@@ -102,7 +103,9 @@ export default {
       },
       // others
       loading: false,
-      typeLoading: false
+      typeLoading: false,
+      templateType: 'businessDemo',
+      uploadLoading: false
     }
   },
   created() {
@@ -110,6 +113,30 @@ export default {
     this.searchTable()
   },
   methods: {
+    // Upload
+    uploadSuccess(data) {
+      this.uploadLoading = false
+      this.$message({
+        type: 'success',
+        message: '上传成功!'
+      })
+      this.searchTable()
+    },
+    uploadError(error) {
+      this.uploadLoading = false
+      this.$message({
+        type: 'error',
+        duration: 0,
+        showClose: true,
+        message: '上传出错:' + error.message
+      })
+    },
+    uploadBefore() {
+      this.uploadLoading = true
+    },
+    downloadTemplate() {
+      downloadTemplate(this.templateType)
+    },
     // 改变每页显示条数
     handleSizeChange(val) {
       this.current = 1
@@ -262,7 +289,7 @@ export default {
 
     .upload-btn {
       display: inline-block;
-      margin-left: 10px;
+      margin: 0 10px;
     }
 
     .page {

+ 2 - 2
src/views/home/Business.vue

@@ -3,7 +3,7 @@
     <el-card>
       <div slot="header" class="clearfix">
         <span>我的业务</span>
-        <el-button style="float: right; padding: 3px 0" type="text" @click="showEdit">编辑</el-button>
+        <el-button style="float: right; padding: 3px 0;" type="text" @click="showEdit">编辑</el-button>
       </div>
 
       <el-scrollbar class="business-content">
@@ -40,7 +40,7 @@ export default {
   },
   data() {
     return {
-      dictType: 'bisiness_type',
+      dictType: 'business_type',
       // table
       current: 1,
       size: 20,

+ 5 - 1
src/views/home/components/SystemEdit.vue

@@ -157,11 +157,15 @@ export default {
         order: 'update_time',
         params: {
           delFlag: 0,
-          appType: this.appType,
           appName: this.formData.systemName,
           businessName: this.formData.businessName
         }
       }
+      if (this.appType === -1) {
+        params.params['isSpecial'] = 0
+      } else {
+        params.params['isSpecial'] = 1
+      }
       fetchAllSystemList(params).then(response => {
         this.allLoading = false
         if (hasValidRecords(response)) {

+ 1 - 1
src/views/info/index.vue

@@ -30,7 +30,7 @@
               v-model="formData.publishDate"
               type="daterange"
               value-format="yyyyMMdd"
-              range-separator="to"
+              range-separator="-"
               start-placeholder="开始日期"
               end-placeholder="截止日期"
               unlink-panels

+ 237 - 2
src/views/log/index.vue

@@ -1,5 +1,240 @@
 <template>
-  <div>
-    Hello {{ route.meta.title }}
+  <div class="log-container">
+    <div class="list-filter">
+      <el-form :ref="formName" inline label-width="110px">
+        <el-row>
+          <el-form-item prop="createUser" label="操作人姓名">
+            <el-input v-model="formData.createUser" class="filter-item" clearable placeholder="请输入" />
+          </el-form-item>
+          <el-form-item prop="createBy" label="身份证号">
+            <el-input v-model="formData.createBy" class="filter-item" clearable placeholder="请输入" />
+          </el-form-item>
+          <el-form-item prop="createOrgName" label="操作人单位名称">
+            <el-input v-model="formData.createOrgName" class="filter-item" clearable placeholder="请输入" />
+          </el-form-item>
+        </el-row>
+        <el-row>
+          <el-form-item prop="title" label="操作类型">
+            <el-input v-model="formData.title" class="filter-item" clearable placeholder="请输入" />
+          </el-form-item>
+          <el-form-item prop="moduleName" label="功能模块名称">
+            <el-select v-model="formData.moduleName" clearable placeholder="请选择">
+              <el-option v-for="(item) in moduleData" :key="item.id" :label="item.label" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="createTime" label="操作日期">
+            <el-date-picker
+              v-model="formData.createTime"
+              type="daterange"
+              value-format="yyyyMMdd"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="截止日期"
+              unlink-panels
+              clearable
+            />
+          </el-form-item>
+        </el-row>
+        <el-row>
+          <el-form-item class="filter-btn">
+            <el-button type="primary" @click="searchTable">查询</el-button>
+            <el-button type="danger" @click="resetForm">重置</el-button>
+          </el-form-item>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="list-table">
+      <el-table v-loading="loading" :data="tableData" fit border stripe height="calc(100% - 32px)">
+        <el-table-column type="index" label="序号" width="50" />
+        <el-table-column prop="createUser" label="操作人姓名" width="120" show-overflow-tooltip />
+        <el-table-column prop="createBy" label="操作人身份证号" show-overflow-tooltip />
+        <el-table-column prop="createOrgName" label="操作人单位名称" width="180" show-overflow-tooltip />
+        <el-table-column prop="moduleName" label="功能模块名称" width="200" show-overflow-tooltip />
+        <el-table-column prop="createTime" label="操作时间" width="160" />
+        <el-table-column prop="title" label="操作类型" width="160" />
+        <el-table-column prop="remoteAddr" label="终端IP" width="160" />
+        <el-table-column label="操作" align="center" width="160" class-name="action-column">
+          <template slot-scope="scope">
+            <el-button type="text" @click="viewItem(scope.row.id)">详情</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div v-if="total > 0" class="page">
+        <el-pagination
+          layout="total, sizes, prev, pager, next, jumper"
+          :current-page="current"
+          :total="total"
+          :page-sizes="pageSizeAll"
+          :page-size="size"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        />
+      </div>
+    </div>
   </div>
 </template>
+
+<script>
+
+import { isNull, hasValidRecords, formatDictData } from '@/utils/convert'
+
+export default {
+  name: 'Log',
+  components: { },
+  data() {
+    return {
+      // table
+      current: 1,
+      size: 20,
+      total: 0,
+      pageSizeAll: [10, 20, 50, 100, 200, 500],
+      tableData: [],
+      multipleSelection: [],
+      // filter
+      formName: 'filterForm',
+      formData: {
+        title: '',
+        content: '',
+        messageType: '',
+        deptCode: '',
+        publishDate: null
+      },
+      // select
+      moduleData: [],
+      // others
+      loading: false
+    }
+  },
+  created() {
+    this.getTypeData()
+    this.searchTable()
+  },
+  methods: {
+    // 改变每页显示条数
+    handleSizeChange(val) {
+      this.current = 1
+      this.size = val
+      this.getTablelist()
+    },
+    // 切换第几页
+    handleCurrentChange(val) {
+      this.current = val
+      this.getTablelist()
+    },
+    // 重置搜索项
+    resetForm() {
+      this.$refs[this.formName].resetFields()
+      this.getTablelist()
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    },
+    // 点击搜索按钮
+    searchTable() {
+      this.current = 1
+      this.getTablelist()
+    },
+    // 获取table数据
+    getTablelist() {
+      this.$message({
+        type: 'info',
+        message: '开发中'
+      })
+      // this.loading = true
+      // const params = {
+      //   current: this.current,
+      //   size: this.size,
+      //   delFlag: 0,
+      //   title: this.formData.title,
+      //   content: this.formData.content,
+      //   messageType: this.formData.messageType,
+      //   deptCode: this.formData.deptCode
+      // }
+      // if (this.formData.publishDate) {
+      //   params.publishTimeStart = this.formData.publishDate[0] + '000000'
+      //   params.publishTimeEnd = this.formData.publishDate[1] + '000000'
+      // }
+      // fetchTableList(params).then(response => {
+      //   this.loading = false
+      //   if (hasValidRecords(response)) {
+      //     this.tableData = response.data.records
+      //     this.total = response.data.total
+      //   } else {
+      //     this.tableData = []
+      //     this.total = 0
+      //   }
+      // }).catch(error => {
+      //   console.log(error)
+      //   this.loading = false
+      //   this.$message({
+      //     type: 'error',
+      //     duration: 0,
+      //     showClose: true,
+      //     message: '获取信息列表出错: ' + error.message
+      //   })
+      // })
+    },
+    viewItem(id) {
+      this.$refs['infoView'].open(id)
+    },
+    getTypeData() {
+      // fetchDictData(this.dictType).then(response => {
+      //   if (!isNull(response.data)) {
+      //     this.typeData = response.data
+      //   } else {
+      //     this.typeData = []
+      //   }
+      // }).catch(error => {
+      //   console.log(error)
+      //   this.topLoading = false
+      //   this.$message({
+      //     type: 'error',
+      //     duration: 0,
+      //     showClose: true,
+      //     message: '获取信息类型出错: ' + error.message
+      //   })
+      // })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.log-container {
+  min-width: 1430px;
+  .list-filter, .list-table{
+    padding: 10px 0 0 10px;
+    background-color: #fff;
+  }
+
+  .list-filter {
+    margin-bottom: 10px;
+    // height: 125px;
+
+    .filter-btn {
+      width: 1400px;
+      text-align: right;
+      margin-bottom: 5px !important;
+      margin-top: -12px !important;
+    }
+    ::v-deep {
+      .el-input__inner {
+        width: 350px;
+      }
+    }
+  }
+
+  .list-table {
+    height: calc(100% - 177px);
+  }
+
+  .list-btn {
+    height: 40px;
+    margin-bottom: 10px;
+  }
+
+  .page {
+    height: 32px;
+  }
+}
+</style>

+ 0 - 7
src/views/log/menu1/index.vue

@@ -1,7 +0,0 @@
-<template>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1">
-      <router-view />
-    </el-alert>
-  </div>
-</template>

+ 0 - 7
src/views/log/menu1/menu1-1/index.vue

@@ -1,7 +0,0 @@
-<template>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1-1" type="success">
-      <router-view />
-    </el-alert>
-  </div>
-</template>

+ 0 - 7
src/views/log/menu1/menu1-2/index.vue

@@ -1,7 +0,0 @@
-<template>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1-2" type="success">
-      <router-view />
-    </el-alert>
-  </div>
-</template>

+ 0 - 5
src/views/log/menu1/menu1-2/menu1-2-1/index.vue

@@ -1,5 +0,0 @@
-<template functional>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1-2-1" type="warning" />
-  </div>
-</template>

+ 0 - 5
src/views/log/menu1/menu1-2/menu1-2-2/index.vue

@@ -1,5 +0,0 @@
-<template functional>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1-2-2" type="warning" />
-  </div>
-</template>

+ 0 - 5
src/views/log/menu1/menu1-3/index.vue

@@ -1,5 +0,0 @@
-<template functional>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1-3" type="success" />
-  </div>
-</template>

+ 0 - 5
src/views/log/menu2/index.vue

@@ -1,5 +0,0 @@
-<template>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 2" />
-  </div>
-</template>

+ 1 - 1
src/views/system/index.vue

@@ -70,10 +70,10 @@
 
 <script>
 import { fetchDictData } from '@/api/dict'
+import { downloadTemplate } from '@/api/file'
 import { fetchAllSystemList, pushDeleteSystem } from '@/api/system'
 
 import { hasValidRecords, formatDictData, isNull } from '@/utils/convert'
-import { downloadTemplate } from '@/api/file'
 
 import DetailEdit from './components/DetailEdit'
 import UploadExcel from '@/components/Upload/UploadExcel'