Merge remote-tracking branch 'origin/main'

main
wanglei 2 years ago
commit 109254e727

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* szxc_jm_tag * szxc_jm_tag
* *
* @author hs * @author hs
* @date 2024-03-16 * @date 2024-03-21
*/ */
public class SzxcJmTag extends BaseEntity public class SzxcJmTag extends BaseEntity
{ {
@ -21,6 +21,10 @@ public class SzxcJmTag extends BaseEntity
/** 标签id */ /** 标签id */
private Long tagId; private Long tagId;
/** 标签名称 */
@Excel(name = "标签名称")
private String tagName;
public void setJmId(Long jmId) public void setJmId(Long jmId)
{ {
this.jmId = jmId; this.jmId = jmId;
@ -39,12 +43,22 @@ public class SzxcJmTag extends BaseEntity
{ {
return tagId; return tagId;
} }
public void setTagName(String tagName)
{
this.tagName = tagName;
}
public String getTagName()
{
return tagName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId()) .append("jmId", getJmId())
.append("tagId", getTagId()) .append("tagId", getTagId())
.toString(); .append("tagName", getTagName())
.toString();
} }
} }

@ -7,15 +7,17 @@
<resultMap type="SzxcJmTag" id="SzxcJmTagResult"> <resultMap type="SzxcJmTag" id="SzxcJmTagResult">
<result property="jmId" column="jm_id" /> <result property="jmId" column="jm_id" />
<result property="tagId" column="tag_id" /> <result property="tagId" column="tag_id" />
<result property="tagName" column="tag_name" />
</resultMap> </resultMap>
<sql id="selectSzxcJmTagVo"> <sql id="selectSzxcJmTagVo">
select jm_id, tag_id from szxc_jm_tag select jm_id, tag_id, tag_name from szxc_jm_tag
</sql> </sql>
<select id="selectSzxcJmTagList" parameterType="SzxcJmTag" resultMap="SzxcJmTagResult"> <select id="selectSzxcJmTagList" parameterType="SzxcJmTag" resultMap="SzxcJmTagResult">
<include refid="selectSzxcJmTagVo"/> <include refid="selectSzxcJmTagVo"/>
<where> <where>
<if test="tagName != null and tagName != ''"> and tag_name like concat('%', #{tagName}, '%')</if>
</where> </where>
</select> </select>
@ -29,10 +31,12 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if> <if test="jmId != null">jm_id,</if>
<if test="tagId != null">tag_id,</if> <if test="tagId != null">tag_id,</if>
<if test="tagName != null">tag_name,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if> <if test="jmId != null">#{jmId},</if>
<if test="tagId != null">#{tagId},</if> <if test="tagId != null">#{tagId},</if>
<if test="tagName != null">#{tagName},</if>
</trim> </trim>
</insert> </insert>
@ -40,6 +44,7 @@
update szxc_jm_tag update szxc_jm_tag
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="tagId != null">tag_id = #{tagId},</if> <if test="tagId != null">tag_id = #{tagId},</if>
<if test="tagName != null">tag_name = #{tagName},</if>
</trim> </trim>
where jm_id = #{jmId} where jm_id = #{jmId}
</update> </update>

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标签名称" prop="tagName">
<el-input
v-model="queryParams.tagName"
placeholder="请输入标签名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -57,6 +65,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="居民id" align="center" prop="jmId" /> <el-table-column label="居民id" align="center" prop="jmId" />
<el-table-column label="标签id" align="center" prop="tagId" /> <el-table-column label="标签id" align="center" prop="tagId" />
<el-table-column label="标签名称" align="center" prop="tagName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -88,6 +97,9 @@
<!-- 添加或修改居民标签关联对话框 --> <!-- 添加或修改居民标签关联对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标签名称" prop="tagName">
<el-input v-model="form.tagName" placeholder="请输入标签名称" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -98,136 +110,138 @@
</template> </template>
<script> <script>
import { listJmtag, getJmtag, delJmtag, addJmtag, updateJmtag } from "@/api/szxc/jmtag"; import { listJmtag, getJmtag, delJmtag, addJmtag, updateJmtag } from "@/api/szxc/jmtag";
export default { export default {
name: "Jmtag", name: "Jmtag",
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
jmtagList: [], jmtagList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, tagName: null
// },
form: {}, //
// form: {},
rules: { //
} rules: {
}; }
},
created() {
this.getList();
},
methods: {
/** 查询居民标签关联列表 */
getList() {
this.loading = true;
listJmtag(this.queryParams).then(response => {
this.jmtagList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
jmId: null,
tagId: null
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询居民标签关联列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery(); this.loading = true;
}, listJmtag(this.queryParams).then(response => {
// this.jmtagList = response.rows;
handleSelectionChange(selection) { this.total = response.total;
this.ids = selection.map(item => item.jmId) this.loading = false;
this.single = selection.length!==1 });
this.multiple = !selection.length },
}, //
/** 新增按钮操作 */ cancel() {
handleAdd() { this.open = false;
this.reset(); this.reset();
this.open = true; },
this.title = "添加居民标签关联"; //
}, reset() {
/** 修改按钮操作 */ this.form = {
handleUpdate(row) { jmId: null,
this.reset(); tagId: null,
const jmId = row.jmId || this.ids tagName: null
getJmtag(jmId).then(response => { };
this.form = response.data; this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.jmId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "修改居民标签关联"; this.title = "添加居民标签关联";
}); },
}, /** 修改按钮操作 */
/** 提交按钮 */ handleUpdate(row) {
submitForm() { this.reset();
this.$refs["form"].validate(valid => { const jmId = row.jmId || this.ids
if (valid) { getJmtag(jmId).then(response => {
if (this.form.jmId != null) { this.form = response.data;
updateJmtag(this.form).then(response => { this.open = true;
this.$modal.msgSuccess("修改成功"); this.title = "修改居民标签关联";
this.open = false; });
this.getList(); },
}); /** 提交按钮 */
} else { submitForm() {
addJmtag(this.form).then(response => { this.$refs["form"].validate(valid => {
this.$modal.msgSuccess("新增成功"); if (valid) {
this.open = false; if (this.form.jmId != null) {
this.getList(); updateJmtag(this.form).then(response => {
}); this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addJmtag(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
} });
}); },
}, /** 删除按钮操作 */
/** 删除按钮操作 */ handleDelete(row) {
handleDelete(row) { const jmIds = row.jmId || this.ids;
const jmIds = row.jmId || this.ids; this.$modal.confirm('是否确认删除居民标签关联编号为"' + jmIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除居民标签关联编号为"' + jmIds + '"的数据项?').then(function() { return delJmtag(jmIds);
return delJmtag(jmIds); }).then(() => {
}).then(() => { this.getList();
this.getList(); this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功"); }).catch(() => {});
}).catch(() => {}); },
}, /** 导出按钮操作 */
/** 导出按钮操作 */ handleExport() {
handleExport() { this.download('szxc/jmtag/export', {
this.download('szxc/jmtag/export', { ...this.queryParams
...this.queryParams }, `jmtag_${new Date().getTime()}.xlsx`)
}, `jmtag_${new Date().getTime()}.xlsx`) }
} }
} };
};
</script> </script>

Loading…
Cancel
Save