shikeying
2023-04-11 bfee44c01a3f5f6de96c9dfa1e12cef4700eaf5b
src/views/system/config/index.vue
@@ -13,7 +13,7 @@
      <el-form-item label="参数键名" prop="configKey">
        <el-input
          v-model="queryParams.configKey"
          placeholder="请输入参数键名"
          placeholder="请输入参数 KEY"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
@@ -102,50 +102,8 @@
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="参数主键" align="center" prop="configId" />-->
      <el-table-column label="KEY" align="left" prop="config_key" :show-overflow-tooltip="true" />
      <el-table-column label="VALUE" align="left" prop="config_value" />
      <el-table-column label="描述" align="left" prop="config_name" :show-overflow-tooltip="true" />
      <el-table-column label="内置" align="center" prop="config_type">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.config_type"/>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true" />
      <el-table-column label="创建时间" align="center" prop="create_time" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.create_time) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:config:edit']"
          >修改</el-button>
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-delete"-->
<!--            @click="handleDelete(scope.row)"-->
<!--            v-hasPermi="['system:config:remove']"-->
<!--          >删除</el-button>-->
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!--列表-->
    <my-table-v3 ref="myTable" :filter="filterFrom" :table="table" />
    <!-- 添加或修改参数配置对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@@ -181,9 +139,11 @@
</template>
<script>
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
  import {addConfig, delConfig, getConfig, listConfig, refreshCache, updateConfig} from "@/api/system/config";
  import myTableV3 from '@/views/components/myTableV3';
export default {
  export default {
  components: {myTableV3},
  name: "Config",
  dicts: ['sys_yes_no'],
  data() {
@@ -229,13 +189,90 @@
        config_value: [
          { required: true, message: "参数键值不能为空", trigger: "blur" }
        ]
      },
      /** 搜索条件*/
      filterFrom: {
        title: null
      },
      table: {
        showIndex: true, // 是否显示序号
        expand: false, // 是否显示详情数据
        checkBox: false, // 是否显示复选框
        url: globalConf.baseUrl + '/system/config/list', // 请求地址
        // 工具条
        tools: {
          columnsCtrl: {// 列控制按钮
            show: false
          },
          generalExport: {// 通用导出按钮
            show: false
          },
          custom: [ // 自定义工具条按钮
          ]
        },
        columns: [
          { title: 'KEY', field: 'config_key', align: 'left', width: 190 },
          { title: 'VALUE', field: 'config_value', align: 'left', width: 200 },
          { title: '描述', field: 'config_name', align: 'left', width: 240 },
          { title: '内置', field: 'config_type', align: 'left', width: 60, formatter: row => {
              let title = '';
              switch (row.config_type) {
                case 'Y':
                  title = '是'
                  break
                case 'N':
                  title = '否'
                  break
              }
              return { value: title }
            }
          },
          { title: '创建时间', field: 'create_time', align: 'left', width: 170 },
          { title: '备注', field: 'remark', align: 'left', width: 260 }
        ],
        // 操作信息
        operation: {
          show: true, // 显示操作列
          width: '100', // 列宽
          attr: [
            {
              title: '编辑',
              checkPermission: 'system:config:edit',
              events: row => {
                this.handleUpdate(row)
              }
            }
          ]
        },
        paging: {
          show: true, // 显示分页
          // 分页信息
          page: {
            small: false,
            pageNum: 1,
            pageSize: platformPageSize,
            total: 0
          }
        }
      }
    };
  },
  created() {
    this.getList();
    // this.getList();
  },
  methods: {
    // 查询table列表
    search(pageNum) {
      if (pageNum != undefined) {
        this.$refs.myTable.search({ pageNum: pageNum })
      } else {
        this.$refs.myTable.search()
      }
    },
    /** 查询参数列表 */
    getList() {
      this.loading = true;
@@ -337,6 +374,11 @@
      refreshCache().then(() => {
        this.$modal.msgSuccess("刷新成功");
      });
    },
    /** 显示配置详情 */
    showDetail(row){
    }
  }
};