odc.xiaohui
2023-02-09 085fa2fb257e9f11f8f6d34bf12e2dc281c36b4d
src/views/systemSetting/platform/cockpitManage/index.vue
@@ -12,11 +12,13 @@
                    <div class="search-item">
                        <span>状态:</span>
                        <div class="option">
                            <el-input v-model="searchStatus" placeholder="选择状态"></el-input>
                          <el-select v-model="searchStatus" placeholder="选择状态">
                            <el-option v-for="{ label, value } in statusOptions" :key="value" :label="label" :value="value"></el-option>
                          </el-select>
                        </div>
                    </div>
                    <div class="findBtn">
                        <el-button type="primary" @click="getUserList">查询</el-button>
                        <el-button type="primary" @click="getDepartmentList">查询</el-button>
                    </div>
                </div>
            </div>
@@ -30,16 +32,18 @@
                        :http-request="importTable"
                        :show-file-list="false"
                        :auto-upload="true"
                        multiple
                        :limit="1">
                      <el-button type="primary">导入</el-button>
                    </el-upload>
                    <el-button style="margin-left: 10px" type="primary" @click="exportTable">导出</el-button>
                    <el-button type="primary" @click="showAddDialog">添加</el-button>
                    <el-button class="button-addition" type="primary" @click="showAddDialog">添加</el-button>
                </div>
                <!-- 数据展示 -->
                <el-table ref="multipleTable"
                    :header-cell-style="{ background: '#06122c', 'font-size': '12px', color: '#4b9bb7', 'font-weight': '650', 'line-height': '45px' }"
                <el-table
                    border
                    stripe
                    ref="multipleTable"
                    :header-cell-style="{ 'background':'#F5F5F5', 'font-size': '14px',  'font-weight': '650', 'line-height': '45px' }"
                    :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"
                    @selection-change="tableChange">
                    <el-table-column prop="name" label="部门名称" min-width="8">
@@ -67,6 +71,9 @@
                    <el-table-column prop="reviewOrLawsuitNumber" label="复议或诉讼数" min-width="15" v-if="mystatus === 1">
                    </el-table-column>
                    <el-table-column prop="status" label="状态" min-width="15" v-if="mystatus === 1">
                        <template slot-scope="scope">
                            <span>{{scope.row. status=== 1? '启动' : '禁用'}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="operation" label="操作" min-width="15">
                        <template slot-scope="scope">
@@ -79,29 +86,34 @@
                    </el-table-column>
                </el-table>
                <!-- 详情页展示 -->
                <el-dialog :visible.sync="dialogView" width="80%" title="基础信息(人工)" v-if="dialogView"
                <el-dialog :visible.sync="dialogView" width="60%" title="基础信息(人工)"
                    :before-close="handleClose">
                    <MyDetail :info=info v-if="mystatus === 1"></MyDetail>
                    <MyIllDetail :info=info v-else></MyIllDetail>
                </el-dialog>
                <el-dialog :visible.sync="dialogUpdate" width="40%" title="修改部门" v-if="dialogUpdate"
                <el-dialog :visible.sync="dialogUpdate" width="40%" title="修改部门"
                    :before-close="handleClose">
                    <updateUser @closeUpdateDialog="closeUpdateDialog()" :updateDepartmentData="updateDepartmentData" />
                    <update-user @closeUpdateDialog="closeUpdateDialog()"
                                :updateDepartmentData="updateDepartmentData"
                                :isUpdate="dialogType === 'update'"
                    />
                </el-dialog>
                <el-dialog :visible.sync="dialogcheck" width="40%" title="查看" v-if="dialogcheck"
                <el-dialog :visible.sync="dialogcheck" width="40%" title="查看"
                    :before-close="handleClose" >
                    <detailUser />
                </el-dialog>
                <el-dialog :visible.sync="dialogAdd" width="40%" title="添加部门" v-if="dialogAdd"
                <el-dialog :visible.sync="dialogAdd" width="40%" title="添加部门"
                    :before-close="handleClose">
                    <createUser @closeUpdateDialog="closeUpdateDialog()" />
                    <update-user @closeUpdateDialog="closeUpdateDialog()"
                                 :updateDepartmentData="updateDepartmentData"
                                 :isUpdate="dialogType === 'add'"
                    />
                </el-dialog>
                <div class="tools">
                    <div class="funs">
                    <!-- <div class="funs">
                        <div class="funsItem funs-sp">
                            <el-checkbox v-model="all" @change="selectAll()">全选</el-checkbox>
                        </div>
@@ -115,11 +127,10 @@
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    </div> -->
                    <div class="pagination">
                        <el-pagination background :current-page="currentPage" layout="prev, pager, next"
                            :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"
                            @prev-click="handlePrev" @next-click="handleNext">
                            :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage">
                        </el-pagination>
                    </div>
                </div>
@@ -128,22 +139,20 @@
    </div>
</template>
<script>
import createUser from "./createUser";
import updateUser from "./updateUser";
import detailUser from "./detailUser";
import { deleteTeam, exportTeamInfo, importTeamInfo, searchTeamInfo } from "@/api/system/portal/teamConstruction";
import {SUCCESS_CODE} from "@/utils";
import { SUCCESS_CODE } from "@/utils";
import {downloadFile} from "@/utils/helper";
export default {
    components: {
        updateUser, createUser, detailUser
    },
    components: { updateUser, detailUser },
    data() {
        return {
            updateDepartmentData: null,
            searchDepartment: '',
            searchStatus: '',
            searchDepartment: null,
            searchStatus: null,
            dialogUpdate: false,
            dialogcheck: false,
            tableData: [],
@@ -153,13 +162,28 @@
            updateFlag: false,
            userInfo: {},
            info: {},
            totalNum: 5,
            totalNum: 1,
            pageSize: 10,
            currentPage: 1,
            all: false,
            unsame: false,
            myIdx: 0,
            preMyIdx: 0,
            file: null,
            statusOptions: [
              {
                value: 2,
                label: '全部'
              },
              {
                value: 1,
                label: '启用'
              },
              {
                value: 0,
                label: '禁用'
              }
            ],
            options: [
                {
                    value: 0,
@@ -197,6 +221,7 @@
            caseId: '',
            caseCode: null,
            dialogAdd: false,
            dialogType: 'update'
        }
    },
@@ -206,8 +231,8 @@
            if (item.checked) {
                this.statusArr[1] = item.value;
            }
        })
        this.getUserList();
        });
        this.getDepartmentList();
    },
    methods: {
@@ -218,34 +243,19 @@
            this.updateDepartmentData = data;
        },
        // 查看
        showViewDialog() {
            this.dialogcheck = true;
        },
        // 添加界面
        showAddDialog() {
          this.dialogAdd = true;
          this.dialogType = 'add';
        },
        // 导出
        exportTable() {
          exportTeamInfo({ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus })
          const status = this.searchStatus === 2 ? null : this.searchStatus;
          exportTeamInfo({ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status })
              .then(res => {
                const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
                const fileName = res.contentDisposition.split('=')[1];
                if (window.navigator && window.navigator.msSaveBlob) {
                  navigator.msSaveBlob(blob, fileName);
                } else {
                  const link = document.createElement('a');
                  link.style.display = 'none';
                  link.href = URL.createObjectURL(blob);
                  link.setAttribute('download', decodeURI(fileName));
                  document.body.appendChild(link);
                  link.click();
                  URL.revokeObjectURL(link.href);
                  document.body.removeChild(link);
                }
                downloadFile(res);
                this.$message({ type: 'success', message: '操作成功' });
              })
              .catch(err => {
                this.$message({ type: 'error', message: err });
@@ -254,32 +264,31 @@
        // 导入
        importTable(file) {
          importTeamInfo({ 'multipartFile': file.file })
              .then(({ code, message }) => {
                if (code === SUCCESS_CODE) {
                  this.$message({ type: 'success', message });
                  this.getUserList();
          const formData = new FormData();
          formData.append('file', file.file);
          importTeamInfo(formData)
              .then(() => {
                  this.$message({ type: 'success', message: '操作成功' });
                  this.getDepartmentList();
                  this.$refs.uploadFile.clearFiles();
                } else {
                  this.$message({ type: 'error', message });
                }
              })
              .catch(err => {
                this.$message({ type: 'error', message: err });
                this.$refs.uploadFile.clearFiles();
              });
        },
        closeUpdateDialog() {
          this.dialogAdd = false;
          this.dialogUpdate = false;
          this.getUserList();
          this.getDepartmentList();
        },
        // 顶部下拉框
        setMystatus(value) {
        setMyStatus(value) {
            this.statusArr[1] = value;
            this.changeTypeChecked(value - 1);
            this.getUserList();
            this.getDepartmentList();
        },
        // 批量删除
@@ -288,7 +297,7 @@
                method: 'delete',
                url: 'sccg/violations/batch_delete?ids=' + idArr,
            }).then(res => {
                this.getUserList();
                this.getDepartmentList();
                this.$message({
                    message: res.message,
                    type: res.code === 200 ? 'success' : 'warning'
@@ -341,7 +350,7 @@
                    .then(({ code, message }) => {
                      if (code === SUCCESS_CODE) {
                        this.$message({ type: 'success', message });
                        this.getUserList();
                        this.getDepartmentList();
                      } else {
                        this.$message({ type: 'error', message });
                      }
@@ -353,17 +362,18 @@
        },
        // 获取用户列表
        getUserList() {
        getDepartmentList() {
          const status = this.searchStatus === 2 ? null : this.searchStatus;
          const searchInfo = {
            current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus
            current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status
          };
          searchTeamInfo(searchInfo)
              .then(({ data }) => {
                this.tableData = data.records;
                this.totalNum = data.total;
              .then(({ records, total }) => {
                this.tableData = records;
                this.totalNum = total;
              })
              .catch(err => {
                console.log(err);
                this.$message({ type: 'error', message: err });
              });
        },
@@ -374,7 +384,7 @@
            })
            this.mystatus = idx + 1;
            this.statusArr[1] = this.typeList[idx].value;
            this.getUserList();
            this.getDepartmentList();
        },
        // 设置表格斑马纹
@@ -389,19 +399,7 @@
        // 当前页改变触发事件
        changeCurrentPage(page) {
            this.currentPage = page;
            this.getUserList();
        },
        // 上一页点击事件
        handlePrev(page) {
            this.currentPage = page;
            this.getUserList();
        },
        // 下一页点击事件
        handleNext(page) {
            this.currentPage = page;
            this.getUserList();
            this.getDepartmentList();
        },
        handleClose(done) {
@@ -438,12 +436,7 @@
        // 关闭上传界面
        closeDialog({ flag }) {
            this.dialogUpload = flag;
            this.getUserList();
        },
        // 处理时间
        filterTime(time) {
            return helper(time);
            this.getDepartmentList();
        }
    }
}
@@ -451,11 +444,11 @@
<style lang="scss" scoped>
.userList {
    text-align: left;
    margin: 10px 20px;
    color: #4b9bb7;
  padding: 10px 20px;
    // color: #4b9bb7;
  border: 1px solid #ccc;
    header {
        background-color: #09152f;
        // background-color: #09152f;
        .headerContent {
            width: 100%;
@@ -467,17 +460,17 @@
                .search-item {
                    display: flex;
                    margin-right: 10vw;
                    margin-right: 1vw;
                }
                .el-input {
                    flex: 2;
                    color: #1d3f57;
                    // color: #1d3f57;
                    &::v-deep .el-input__inner {
                        background-color: #09152f;
                        border: 1px solid #17324c;
                    }
                    // &::v-deep .el-input__inner {
                    //     background-color: #09152f;
                    //     border: 1px solid #17324c;
                    // }
                }
            }
@@ -491,19 +484,19 @@
                .el-button {
                    padding: 12px 25px;
                    border-radius: 20px;
                    //border-radius: 20px;
                }
            }
        }
    }
    &::v-deep .el-input__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
    }
    // &::v-deep .el-input__inner {
    //     background-color: #09152f;
    //     border: 1px solid #17324c;
    // }
    main {
        background-color: #09152f;
        // background-color: #09152f;
        margin-top: 20px;
        padding-bottom: 50px;
@@ -515,6 +508,7 @@
            display: flex;
            line-height: 40px;
            align-items: center;
          margin-bottom: 10px;
        }
        .tools {
@@ -524,7 +518,7 @@
            padding: 0 20px;
            .funs-sp {
                border: 1px solid #17324c;
                // border: 1px solid #17324c;
            }
            .funs {
@@ -547,13 +541,13 @@
                        width: 120px;
                    }
                    &:hover {
                        border: 1px solid #4b9bb7;
                    }
                    // &:hover {
                    //     border: 1px solid #4b9bb7;
                    // }
                    &:hover .el-checkbox {
                        color: #4b9bb7;
                    }
                    // &:hover .el-checkbox {
                    //     color: #4b9bb7;
                    // }
                }
            }
@@ -566,28 +560,28 @@
                .el-pagination {
                    &::v-deep li,
                    &::v-deep .btn-prev,
                    &::v-deep .btn-next {
                        background-color: #071f39;
                        color: #4b9bb7;
                    }
                    // &::v-deep li,
                    // &::v-deep .btn-prev,
                    // &::v-deep .btn-next {
                    //     background-color: #071f39;
                    //     color: #4b9bb7;
                    // }
                    &::v-deep .active {
                        background-color: #409eff;
                        color: #fff;
                    }
                    // &::v-deep .active {
                    //     background-color: #409eff;
                    //     color: #fff;
                    // }
                }
            }
        }
        .el-table {
            color: #4b9bb7;
            font-size: 10px;
            // color: #4b9bb7;
            // font-size: 10px;
            .operation {
                display: flex;
                color: var(--operation-color);
                .line {
                    padding: 0 5px;
                }
@@ -603,4 +597,4 @@
        padding: 0 5px;
    }
}
</style>
</style>