odc.xiaohui
2023-03-18 f93a3e896a7d81f744b72e8069b8226bfdec8ade
部门管理导入导出
4个文件已修改
2个文件已添加
105 ■■■■■ 已修改文件
src/api/system/department.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/intelligentPatrol/runReport.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/baseSetting/department/index.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/platform/externalLinks.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/department.js
@@ -1,7 +1,15 @@
import http from "@/http";
import {exportTeamInfo, importTeamInfo} from "@/api/system/portal/teamConstruction";
export default {
    getDepartmentList: () => {
        return http.get('/sccg/sccg_region/getTree');
    },
    //导出
    }
export function exportTeamInfoDepartment(params) {
    return http.downloadFile('/sccg/depart/export', params);
}
export function importTeamInfoDepartment(params) {
    return http.uploadFile('/sccg/depart/import', params);
}
src/router/index.js
@@ -62,6 +62,11 @@
        path: 'cockpitManage',
        name: 'cockpitManage',
        component: () => import('@/views/systemSetting/platform/cockpitManage')
      },
          {
              path: 'externalLinks',
              name: '外部链接',
              component: () => import('@/views/systemSetting/platform/externalLinks')
      }
      ]
    },
@@ -365,6 +370,11 @@
    name: 'trendAnalysis',
    component: () => import('@/views/intelligentPatrol/trendAnalysis'),
  },
      {
          path: 'runReport', // 运行报告
          name: '运行报告',
          component: () => import('@/views/intelligentPatrol/runReport'),
      },
  // 违法统计
  {
    path: 'typeStatistics', // 按违规类型统计
src/views/intelligentPatrol/runReport.vue
New file
@@ -0,0 +1,15 @@
<template>
<div>
  运行报告
</div>
</template>
<script>
export default {
  name: "runReport"
}
</script>
<style scoped>
</style>
src/views/systemSetting/baseSetting/department/index.vue
@@ -7,6 +7,18 @@
          <el-input v-model="context" placeholder="请输入内容"></el-input>
          <div class="findBtn">
            <el-button type="primary" @click="search()">查询</el-button>
            <el-upload
                class="department-margin-left10"
                action=""
                ref="uploadFile"
                :http-request="importTable"
                :show-file-list="false"
                :auto-upload="true"
                :limit="1"
            >
              <el-button type="primary">导入</el-button>
            </el-upload>
            <el-button class="department-margin-left10" type="primary" @click="exportTable()">导出</el-button>
          </div>
        </div>
        <div class="addUser">
@@ -155,6 +167,9 @@
<script>
import createUser from "./createUser";
import updateUser from "./updateUser";
import {exportTeamInfo, importTeamInfo} from "@/api/system/portal/teamConstruction";
import {downloadFile} from "@/utils/helper";
import {exportTeamInfoDepartment, importTeamInfoDepartment} from "@/api/system/department";
export default {
  components: {
@@ -202,6 +217,43 @@
    this.getUserList();
  },
  methods: {
    // 导出
    exportTable() {
      // const status = this.searchStatus === 2 ? null : this.searchStatus;
      exportTeamInfoDepartment({
        // current: this.currentPage,
        // size: this.pageSize,
        // departName: this.searchDepartment,
        // status,
      })
          .then((res) => {
            console.log(res)
            downloadFile(res);
            this.$message({ type: "success", message: "操作成功" });
          })
          .catch((err) => {
            this.$message({ type: "error", message: err });
          });
    },
    // 导入
    importTable(file) {
      const formData = new FormData();
      formData.append("file", file.file);
      console.log(formData)
      console.log(file)
      importTeamInfoDepartment(formData)
          .then(() => {
            this.$message({ type: "success", message: "操作成功" });
            this.getUserList();
            this.$refs.uploadFile.clearFiles();
          })
          .catch((err) => {
            this.$message({ type: "error", message: err });
            this.$refs.uploadFile.clearFiles();
          });
    },
    selectChange(list) {
      console.log(this.tempList);
      if (this.tempList.length !== 0) {
@@ -446,6 +498,9 @@
};
</script>
<style lang="scss" scoped>
.department-margin-left10{
  margin-left: 10px;
}
.userList {
  text-align: left;
  padding: 10px 20px;
src/views/systemSetting/platform/externalLinks.vue
New file
@@ -0,0 +1,13 @@
<template>
<div>外部链接</div>
</template>
<script>
export default {
  name: "externalLinks"
}
</script>
<style scoped>
</style>
vue.config.js
@@ -39,8 +39,8 @@
    proxy: {
      // 跨域配置
      "/sccg": {
        target: `http://42.193.1.25/`,      //测试环境
        // target: `http://192.168.3.220:8082/`,
        // target: `http://42.193.1.25/`,      //测试环境
        target: `http://192.168.3.240:8082/`,
        changeOrigin: true
      }
    },