From a4099cf645628c8f49df230e6787da20cd82cf1b Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Wed, 22 Sep 2021 09:06:51 +0800
Subject: [PATCH] Excel注解支持自定义数据处理器
---
ruoyi-ui/src/views/system/post/index.vue | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index d3a686f..9df34d0 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -22,10 +22,10 @@
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable size="small">
<el-option
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
+ v-for="dict in dict.type.sys_normal_disable"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
/>
</el-select>
</el-form-item>
@@ -87,7 +87,11 @@
<el-table-column label="岗位编码" align="center" prop="postCode" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位排序" align="center" prop="postSort" />
- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
+ <el-table-column label="状态" align="center" prop="status">
+ <template slot-scope="scope">
+ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+ </template>
+ </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -112,7 +116,7 @@
</template>
</el-table-column>
</el-table>
-
+
<pagination
v-show="total>0"
:total="total"
@@ -136,10 +140,10 @@
<el-form-item label="岗位状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictValue"
- >{{dict.dictLabel}}</el-radio>
+ v-for="dict in dict.type.sys_normal_disable"
+ :key="dict.value"
+ :label="dict.value"
+ >{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
@@ -159,6 +163,7 @@
export default {
name: "Post",
+ dicts: ['sys_normal_disable'],
data() {
return {
// 遮罩层
@@ -179,8 +184,6 @@
title: "",
// 是否显示弹出层
open: false,
- // 状态数据字典
- statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@@ -207,9 +210,6 @@
},
created() {
this.getList();
- this.getDicts("sys_normal_disable").then(response => {
- this.statusOptions = response.data;
- });
},
methods: {
/** 查询岗位列表 */
@@ -220,10 +220,6 @@
this.total = response.total;
this.loading = false;
});
- },
- // 岗位状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
},
// 取消按钮
cancel() {
--
Gitblit v1.9.3