1、系统字典新增字典分组功能

2、前端积分管理页面细微调整
3、前端过渡动画调整
pull/254/head
xjs 4 years ago
parent 721c07f06d
commit d5913e0ad9

@ -1,12 +1,13 @@
package com.ruoyi.system.api.domain; package com.ruoyi.system.api.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.annotation.Excel.ColumnType; import com.ruoyi.common.core.annotation.Excel.ColumnType;
import com.ruoyi.common.core.web.domain.BaseEntity; import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/** /**
* sys_dict_type * sys_dict_type
@ -29,10 +30,24 @@ public class SysDictType extends BaseEntity
@Excel(name = "字典类型") @Excel(name = "字典类型")
private String dictType; private String dictType;
/**
*
*/
@Excel(name = "字典分组")
private String dictGroup;
/** 状态0正常 1停用 */ /** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用") @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status; private String status;
public String getDictGroup() {
return dictGroup;
}
public void setDictGroup(String dictGroup) {
this.dictGroup = dictGroup;
}
public Long getDictId() public Long getDictId()
{ {
return dictId; return dictId;

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<id property="dictId" column="dict_id" /> <id property="dictId" column="dict_id" />
<result property="dictName" column="dict_name" /> <result property="dictName" column="dict_name" />
<result property="dictType" column="dict_type" /> <result property="dictType" column="dict_type" />
<result property="dictGroup" column="dict_group" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -16,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDictTypeVo"> <sql id="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark select dict_id, dict_name, dict_type, dict_group, status, create_by, create_time, remark
from sys_dict_type from sys_dict_type
</sql> </sql>
@ -32,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dictType != null and dictType != ''"> <if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%') AND dict_type like concat('%', #{dictType}, '%')
</if> </if>
<if test="dictGroup != null and dictGroup != ''">
AND dict_group like concat('%', #{dictGroup}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if> </if>
@ -39,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if> </if>
</where> </where>
order by update_time desc ,dict_id desc order by dict_group desc, update_time desc ,dict_id desc
</select> </select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult"> <select id="selectDictTypeAll" resultMap="SysDictTypeResult">
@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<set> <set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="dictGroup != null and dictGroup != ''">dict_group = #{dictGroup},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
@ -89,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into sys_dict_type( insert into sys_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if> <if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if> <if test="dictType != null and dictType != ''">dict_type,</if>
<if test="dictGroup != null and dictGroup != ''">dict_group,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
@ -96,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)values( )values(
<if test="dictName != null and dictName != ''">#{dictName},</if> <if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if> <if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="dictGroup != null and dictGroup != ''">#{dictGroup},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>

@ -1,57 +1,57 @@
<template> <template>
<section class="app-main"> <section class="app-main">
<transition name="fade-transform" mode="out-in"> <transition name="el-fade-in-linear" mode="out-in">
<keep-alive :include="cachedViews"> <keep-alive :include="cachedViews">
<router-view :key="key" /> <router-view :key="key" />
</keep-alive> </keep-alive>
</transition> </transition>
</section> </section>
</template> </template>
<script> <script>
export default { export default {
name: 'AppMain', name: 'AppMain',
computed: { computed: {
cachedViews() { cachedViews() {
return this.$store.state.tagsView.cachedViews return this.$store.state.tagsView.cachedViews
}, },
key() { key() {
return this.$route.path return this.$route.path
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
/* 50= navbar 50 */ /* 50= navbar 50 */
min-height: calc(100vh - 50px); min-height: calc(100vh - 50px);
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.fixed-header+.app-main { .fixed-header+.app-main {
padding-top: 50px; padding-top: 50px;
} }
.hasTagsView { .hasTagsView {
.app-main { .app-main {
/* 84 = navbar + tags-view = 50 + 34 */ /* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px); min-height: calc(100vh - 84px);
} }
.fixed-header+.app-main { .fixed-header+.app-main {
padding-top: 84px; padding-top: 84px;
} }
} }
</style> </style>
<style lang="scss"> <style lang="scss">
// fix css style bug in open el-dialog // fix css style bug in open el-dialog
.el-popup-parent--hidden { .el-popup-parent--hidden {
.fixed-header { .fixed-header {
padding-right: 17px; padding-right: 17px;
} }
} }
</style> </style>

@ -11,7 +11,9 @@
<el-input-number v-model="formData.integralEnd" placeholder="积分区间结束" :min="0"></el-input-number> <el-input-number v-model="formData.integralEnd" placeholder="积分区间结束" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item size="large"> <el-form-item size="large">
<el-button type="primary" @click="submitForm"></el-button> <el-button type="primary"
v-hasPermi="['srb:integralGrade:save']"
@click="submitForm">提交</el-button>
<el-button @click="resetForm"></el-button> <el-button @click="resetForm"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -79,14 +81,9 @@ export default {
//id //id
getById(id) { getById(id) {
const loading = this.$loading({ this.$modal.loading("请稍候...");
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: "#666666"
});
getById(id).then(res => { getById(id).then(res => {
loading.close(); this.$modal.closeLoading()
this.formData = res.data this.formData = res.data
}) })
}, },

@ -81,16 +81,11 @@ export default {
methods: { methods: {
// //
fetchData() { fetchData() {
const loading = this.$loading({ this.$modal.loading("请稍候...");
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: "#666666"
});
getList().then(res => { getList().then(res => {
loading.close();
this.list = res.data this.list = res.data
this.$modal.closeLoading()
}).catch(err => { }).catch(err => {
}) })
loading.close(); loading.close();

@ -1,350 +1,389 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="字典名称" prop="dictName"> <el-form-item label="字典名称" prop="dictName">
<el-input <el-input
v-model="queryParams.dictName" v-model="queryParams.dictName"
placeholder="请输入字典名称" placeholder="请输入字典名称"
clearable clearable
size="small" size="small"
style="width: 240px" style="width: 180px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="字典类型" prop="dictType"> <el-form-item label="字典类型" prop="dictType">
<el-input <el-input
v-model="queryParams.dictType" v-model="queryParams.dictType"
placeholder="请输入字典类型" placeholder="请输入字典类型"
clearable clearable
size="small" size="small"
style="width: 240px" style="width: 180px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
placeholder="字典状态" placeholder="字典状态"
clearable clearable
size="small" size="small"
style="width: 240px" style="width: 120px"
> >
<el-option <el-option
v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="字典分组" prop="dictGroup">
<el-date-picker <el-select
v-model="dateRange" v-model="queryParams.dictGroup"
size="small" placeholder="字典分组"
style="width: 240px" clearable
value-format="yyyy-MM-dd" size="small"
type="daterange" style="width: 120px"
range-separator="-" >
start-placeholder="开始日期" <el-option
end-placeholder="结束日期" v-for="dict in dict.type.sys_dict_group"
></el-date-picker> :key="dict.value"
</el-form-item> :label="dict.label"
<el-form-item> :value="dict.value"
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> />
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> </el-select>
</el-form-item> </el-form-item>
</el-form> <el-form-item label="创建时间">
<el-date-picker
<el-row :gutter="10" class="mb8"> v-model="dateRange"
<el-col :span="1.5"> size="small"
<el-button style="width: 200px"
type="primary" value-format="yyyy-MM-dd"
plain type="daterange"
icon="el-icon-plus" range-separator="-"
size="mini" start-placeholder="开始日期"
@click="handleAdd" end-placeholder="结束日期"
v-hasPermi="['system:dict:add']" ></el-date-picker>
>新增</el-button> </el-form-item>
</el-col> <el-form-item>
<el-col :span="1.5"> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
type="success" </el-form-item>
plain </el-form>
icon="el-icon-edit"
size="mini" <el-row :gutter="10" class="mb8">
:disabled="single" <el-col :span="1.5">
@click="handleUpdate" <el-button
v-hasPermi="['system:dict:edit']" type="primary"
>修改</el-button> plain
</el-col> icon="el-icon-plus"
<el-col :span="1.5"> size="mini"
<el-button @click="handleAdd"
type="danger" v-hasPermi="['system:dict:add']"
plain >新增</el-button>
icon="el-icon-delete" </el-col>
size="mini" <el-col :span="1.5">
:disabled="multiple" <el-button
@click="handleDelete" type="success"
v-hasPermi="['system:dict:remove']" plain
>删除</el-button> icon="el-icon-edit"
</el-col> size="mini"
<el-col :span="1.5"> :disabled="single"
<el-button @click="handleUpdate"
type="warning" v-hasPermi="['system:dict:edit']"
plain >修改</el-button>
icon="el-icon-download" </el-col>
size="mini" <el-col :span="1.5">
@click="handleExport" <el-button
v-hasPermi="['system:dict:export']" type="danger"
>导出</el-button> plain
</el-col> icon="el-icon-delete"
<el-col :span="1.5"> size="mini"
<el-button :disabled="multiple"
type="danger" @click="handleDelete"
plain v-hasPermi="['system:dict:remove']"
icon="el-icon-refresh" >删除</el-button>
size="mini" </el-col>
@click="handleRefreshCache" <el-col :span="1.5">
v-hasPermi="['system:dict:remove']" <el-button
>刷新缓存</el-button> type="warning"
</el-col> plain
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> icon="el-icon-download"
</el-row> size="mini"
@click="handleExport"
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> v-hasPermi="['system:dict:export']"
<el-table-column type="selection" width="55" align="center" /> >导出</el-button>
<el-table-column label="字典编号" align="center" prop="dictId" /> </el-col>
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-col :span="1.5">
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true"> <el-button
<template slot-scope="scope"> type="danger"
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> plain
<span>{{ scope.row.dictType }}</span> icon="el-icon-refresh"
</router-link> size="mini"
</template> @click="handleRefreshCache"
</el-table-column> v-hasPermi="['system:dict:remove']"
<el-table-column label="状态" align="center" prop="status"> >刷新缓存</el-button>
<template slot-scope="scope"> </el-col>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</template> </el-row>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column type="selection" width="55" align="center" />
<template slot-scope="scope"> <el-table-column label="字典编号" align="center" prop="dictId" />
<span>{{ parseTime(scope.row.createTime) }}</span> <el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
</template> <el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
</el-table-column> <template slot-scope="scope">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<template slot-scope="scope"> <span>{{ scope.row.dictType }}</span>
<el-button </router-link>
size="mini" </template>
type="text" </el-table-column>
icon="el-icon-edit" <el-table-column label="状态" align="center" prop="status">
@click="handleUpdate(scope.row)" <template slot-scope="scope">
v-hasPermi="['system:dict:edit']" <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
>修改</el-button> </template>
<el-button </el-table-column>
size="mini" <el-table-column label="字典分组" align="center" prop="dictGroup" :show-overflow-tooltip="true" >
type="text" <template slot-scope="scope">
icon="el-icon-delete" <dict-tag :options="dict.type.sys_dict_group" :value="scope.row.dictGroup"/>
@click="handleDelete(scope.row)" </template>
v-hasPermi="['system:dict:remove']" </el-table-column>
>删除</el-button> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
</template> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
</el-table-column> <template slot-scope="scope">
</el-table> <span>{{ parseTime(scope.row.createTime) }}</span>
</template>
<pagination </el-table-column>
v-show="total>0" <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
:total="total" <template slot-scope="scope">
:page.sync="queryParams.pageNum" <el-button
:limit.sync="queryParams.pageSize" size="mini"
@pagination="getList" type="text"
/> icon="el-icon-edit"
@click="handleUpdate(scope.row)"
<!-- 添加或修改参数配置对话框 --> v-hasPermi="['system:dict:edit']"
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> >修改</el-button>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-button
<el-form-item label="字典名称" prop="dictName"> size="mini"
<el-input v-model="form.dictName" placeholder="请输入字典名称" /> type="text"
</el-form-item> icon="el-icon-delete"
<el-form-item label="字典类型" prop="dictType"> @click="handleDelete(scope.row)"
<el-input v-model="form.dictType" placeholder="请输入字典类型" /> v-hasPermi="['system:dict:remove']"
</el-form-item> >删除</el-button>
<el-form-item label="状态" prop="status"> </template>
<el-radio-group v-model="form.status"> </el-table-column>
<el-radio </el-table>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value" <pagination
:label="dict.value" v-show="total>0"
>{{dict.label}}</el-radio> :total="total"
</el-radio-group> :page.sync="queryParams.pageNum"
</el-form-item> :limit.sync="queryParams.pageSize"
<el-form-item label="备注" prop="remark"> @pagination="getList"
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> />
</el-form-item>
</el-form> <!-- 添加或修改参数配置对话框 -->
<div slot="footer" class="dialog-footer"> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-button type="primary" @click="submitForm"> </el-button> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-button @click="cancel"> </el-button> <el-form-item label="字典名称" prop="dictName">
</div> <el-input v-model="form.dictName" placeholder="请输入字典名称" />
</el-dialog> </el-form-item>
</div> <el-form-item label="字典类型" prop="dictType">
</template> <el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item>
<script> <el-form-item label="字典分组" prop="dictGroup">
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
<el-select
export default { v-model="form.dictGroup"
name: "Dict", placeholder="字典分组"
dicts: ['sys_normal_disable'], clearable
data() { size="small"
return { style="width: 240px"
// >
loading: true, <el-option
// v-for="dict in dict.type.sys_dict_group"
ids: [], :key="dict.value"
// :label="dict.label"
single: true, :value="dict.value"
// />
multiple: true, </el-select>
// </el-form-item>
showSearch: true, <el-form-item label="状态" prop="status">
// <el-radio-group v-model="form.status">
total: 0, <el-radio
// v-for="dict in dict.type.sys_normal_disable"
typeList: [], :key="dict.value"
// :label="dict.value"
title: "", >{{dict.label}}</el-radio>
// </el-radio-group>
open: false, </el-form-item>
// <el-form-item label="备注" prop="remark">
dateRange: [], <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
// </el-form-item>
queryParams: { </el-form>
pageNum: 1, <div slot="footer" class="dialog-footer">
pageSize: 10, <el-button type="primary" @click="submitForm"> </el-button>
dictName: undefined, <el-button @click="cancel"> </el-button>
dictType: undefined, </div>
status: undefined </el-dialog>
}, </div>
// </template>
form: {},
// <script>
rules: { import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" } export default {
], name: "Dict",
dictType: [ dicts: ['sys_normal_disable','sys_dict_group'],
{ required: true, message: "字典类型不能为空", trigger: "blur" } data() {
] return {
} //
}; loading: true,
}, //
created() { ids: [],
this.getList(); //
}, single: true,
methods: { //
/** 查询字典类型列表 */ multiple: true,
getList() { //
this.loading = true; showSearch: true,
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => { //
this.typeList = response.rows; total: 0,
this.total = response.total; //
this.loading = false; typeList: [],
} //
); title: "",
}, //
// open: false,
cancel() { //
this.open = false; dateRange: [],
this.reset(); //
}, queryParams: {
// pageNum: 1,
reset() { pageSize: 10,
this.form = { dictName: undefined,
dictId: undefined, dictType: undefined,
dictName: undefined, status: undefined,
dictType: undefined, dictGroup:undefined
status: "0", },
remark: undefined //
}; form: {},
this.resetForm("form"); //
}, rules: {
/** 搜索按钮操作 */ dictName: [
handleQuery() { { required: true, message: "字典名称不能为空", trigger: "blur" }
this.queryParams.pageNum = 1; ],
this.getList(); dictType: [
}, { required: true, message: "字典类型不能为空", trigger: "blur" }
/** 重置按钮操作 */ ]
resetQuery() { }
this.dateRange = []; };
this.resetForm("queryForm"); },
this.handleQuery(); created() {
}, this.getList();
/** 新增按钮操作 */ },
handleAdd() { methods: {
this.reset(); /** 查询字典类型列表 */
this.open = true; getList() {
this.title = "添加字典类型"; this.loading = true;
}, listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.typeList = response.rows;
handleSelectionChange(selection) { this.total = response.total;
this.ids = selection.map(item => item.dictId) this.loading = false;
this.single = selection.length!=1 }
this.multiple = !selection.length );
}, },
/** 修改按钮操作 */ //
handleUpdate(row) { cancel() {
this.reset(); this.open = false;
const dictId = row.dictId || this.ids this.reset();
getType(dictId).then(response => { },
this.form = response.data; //
this.open = true; reset() {
this.title = "修改字典类型"; this.form = {
}); dictId: undefined,
}, dictName: undefined,
/** 提交按钮 */ dictType: undefined,
submitForm: function() { status: "0",
this.$refs["form"].validate(valid => { remark: undefined
if (valid) { };
if (this.form.dictId != undefined) { this.resetForm("form");
updateType(this.form).then(response => { },
this.$modal.msgSuccess("修改成功"); /** 搜索按钮操作 */
this.open = false; handleQuery() {
this.getList(); this.queryParams.pageNum = 1;
}); this.getList();
} else { },
addType(this.form).then(response => { /** 重置按钮操作 */
this.$modal.msgSuccess("新增成功"); resetQuery() {
this.open = false; this.dateRange = [];
this.getList(); this.resetForm("queryForm");
}); this.handleQuery();
} },
} /** 新增按钮操作 */
}); handleAdd() {
}, this.reset();
/** 删除按钮操作 */ this.open = true;
handleDelete(row) { this.title = "添加字典类型";
const dictIds = row.dictId || this.ids; },
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { //
return delType(dictIds); handleSelectionChange(selection) {
}).then(() => { this.ids = selection.map(item => item.dictId)
this.getList(); this.single = selection.length!=1
this.$modal.msgSuccess("删除成功"); this.multiple = !selection.length
}).catch(() => {}); },
}, /** 修改按钮操作 */
/** 导出按钮操作 */ handleUpdate(row) {
handleExport() { this.reset();
this.download('system/dict/type/export', { const dictId = row.dictId || this.ids
...this.queryParams getType(dictId).then(response => {
}, `type_${new Date().getTime()}.xlsx`) this.form = response.data;
}, this.open = true;
/** 刷新缓存按钮操作 */ this.title = "修改字典类型";
handleRefreshCache() { });
refreshCache().then(() => { },
this.$modal.msgSuccess("刷新成功"); /** 提交按钮 */
}); submitForm: function() {
} this.$refs["form"].validate(valid => {
} if (valid) {
}; if (this.form.dictId != undefined) {
</script> updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/type/export', {
...this.queryParams
}, `type_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
});
}
}
};
</script>

Loading…
Cancel
Save