添加标签name

main
hansha 2 years ago
parent 9f455a44e1
commit d6bb542f57

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

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

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

Loading…
Cancel
Save