ludc
2023-09-19 904897d888962511eb58b0dec9168983ecc1a439
Source/UBCS-WEB/src/views/integration/systemInfo.vue
@@ -1,6 +1,6 @@
<template>
    <basic-container>
        <avue-crud ref="crud" :table-loading="loading" :data="data" :option="option" :page.sync="page" :search.sync="search"
    <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :search.sync="search" :table-loading="loading"
            @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" @row-update="handleEdit"
            @refresh-change="handleRefresh" @size-change="handleSizePage" @current-change="handleCurrentPage"
            @selection-change="selectionChange" @row-click="handleRowClick">
@@ -15,19 +15,27 @@
                    <el-option v-for="item in selectOption" :key="item.value" :label="item.label" :value="item.value">
                    </el-option>
                </el-select>
                <el-input :placeholder="`请输入${selectValue === 'id' ? '系统编号' : '系统名称'}并按回车查询`" :size="size"
                    style="width:300px;margin-left: 10px;" v-model="search[selectValue]" clearable
                    @keyup.enter.native="handleEnter" @clear="handleClear"></el-input>
        <el-input v-model="search[selectValue]" :placeholder="`请输入${selectValue === 'id' ? '系统编号' : '系统名称'}并按回车查询`"
                  :size="size" clearable style="width:300px;margin-left: 10px;"
                  @clear="handleClear" @keyup.enter.native="handleEnter"></el-input>
      </template>
      <template #menu="{row,index,size}">
        <el-button type="text" icon="el-icon-menu" size="small" @click="classifyHandler">分类授权</el-button>
            </template>
        </avue-crud>
    <el-dialog :visible.sync="dialogVisible" append-to-body title="分类授权">
    </el-dialog>
    </basic-container>
</template>
<script>
import { getSysInfoList, sysInfoAdd, sysInfoEdit, sysInfoDel } from '@/api/integration/sysInfo.js'
export default {
    data() {
        return {
            loading: false,
      dialogVisible:false,
            page: {
                currentPage: 1,
                pageSize: 10,
@@ -92,23 +100,32 @@
        }
    },
    methods: {
        // 获取列表
    //分类授权
    classifyHandler(){
      this.dialogVisible=true;
    },
        async getDataList() {
            this.loading = true
            console.log(this.search)
            const { pageSize, currentPage } = this.page
            let param = { size: pageSize, current: currentPage }
            this.search = Object.keys(this.search)
                .filter((key) => this.search[key] !== null && this.search[key] !== undefined && this.search[key] !== "")
                .reduce((acc, key) => ({ ...acc, [key]: this.search[key] }), {});
            const response = await getSysInfoList({ ...param, ...this.search })
      this.loading = true;
      console.log(this.search);
      const { pageSize, currentPage } = this.page;
      const conditions = {};
      if (Object.keys(this.search).length > 0) {
        for (const key in this.search) {
          if (this.search[key]) {
            conditions[`conditionMap[${key}_like]`] = this.search[key];
          }
        }
      }
      const response = await getSysInfoList(pageSize, currentPage, conditions);
            if (response.status === 200) {
                console.log(response)
                this.loading = false
                const data = response.data.data
                this.data = data.records
                this.page.total = data.total
            } else this.loading = false
        console.log(response);
        this.loading = false;
        const data = response.data.data;
        this.data = data.records;
        this.page.total = data.total;
      } else {
        this.loading = false;
      }
        },
        // 新增
        async handleSave(row, done, loading) {