update code

dev_xd
lijun 2024-12-09 00:25:42 +08:00
parent 69e2d0cb35
commit 300608c53e
3 changed files with 53 additions and 113 deletions

View File

@ -48,6 +48,16 @@ public class GreenCarbonData extends BaseEntity
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long isDel;
private Date dataDate;
public Date getDataDate() {
return dataDate;
}
public void setDataDate(Date dataDate) {
this.dataDate = dataDate;
}
private GreenCarbonItem greenCarbonItem;
public GreenCarbonItem getGreenCarbonItem() {

View File

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="comId" column="com_id" />
<result property="projectId" column="project_id" />
<result property="dataDate" column="data_date"/>
<result property="itemId" column="item_id" />
<result property="estimateValue" column="estimate_value" />
<result property="practicalValue" column="practical_value" />
@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectGreenCarbonDataVo">
select gd.id, gd.com_id, gd.project_id, gd.item_id, gd.estimate_value, gd.practical_value, gd.state,
select gd.id, gd.com_id, gd.project_id,gd.data_date, gd.item_id, gd.estimate_value, gd.practical_value, gd.state,
gd.remark, gd.is_del, gd.create_by, gd.create_time, gd.update_by, gd.update_time,
dp.`dept_name` comp_name,pi.`project_name`,g.id gid,g.carbon_factor_type,g.carbon_name,g.unit,g.carbon_factor
from green_carbon_data gd
@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="comId != null">com_id,</if>
<if test="projectId != null">project_id,</if>
<if test="dataDate != null">data_date,</if>
<if test="itemId != null">item_id,</if>
<if test="estimateValue != null">estimate_value,</if>
<if test="practicalValue != null">practical_value,</if>
@ -76,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="comId != null">#{comId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="dataDate != null">#{dataDate},</if>
<if test="itemId != null">#{itemId},</if>
<if test="estimateValue != null">#{estimateValue},</if>
<if test="practicalValue != null">#{practicalValue},</if>
@ -94,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="comId != null">com_id = #{comId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="dataDate != null">data_date = #{dataDate},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="estimateValue != null">estimate_value = #{estimateValue},</if>
<if test="practicalValue != null">practical_value = #{practicalValue},</if>

View File

@ -1,108 +1,23 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="公司主键" prop="comId">
<el-input
v-model="queryParams.comId"
placeholder="请输入公司主键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="分包单位" prop="projectId">
<el-input
v-model="queryParams.projectId"
placeholder="请输入分包单位"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="因子ID-外键" prop="itemId">
<el-input
v-model="queryParams.itemId"
placeholder="请输入因子ID-外键"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="预估使用数量" prop="estimateValue">
<el-input
v-model="queryParams.estimateValue"
placeholder="请输入预估使用数量"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label=" 实际使用量" prop="practicalValue">
<el-input
v-model="queryParams.practicalValue"
placeholder="请输入 实际使用量"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="state">
<el-input
v-model="queryParams.state"
placeholder="请输入状态"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="${comment}" prop="isDel">
<el-input
v-model="queryParams.isDel"
placeholder="请输入${comment}"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<div class="app-container green-carbon-data">
<el-tabs v-model="data.selTab" type="card" class="main-tab">
<el-tab-pane v-for="(it, idx) in data.types" :key="idx" :name="it.value" :label="it.text"></el-tab-pane>
</el-tabs>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['manage:greenCarbonData:add']"
>新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd"
v-hasPermi="['manage:greenCarbonData:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['manage:greenCarbonData:edit']"
>修改</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
v-hasPermi="['manage:greenCarbonData:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:greenCarbonData:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['manage:greenCarbonData:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="greenCarbonDataList" @selection-change="handleSelectionChange">
@ -118,19 +33,16 @@
<el-table-column label="${comment}" align="center" prop="isDel" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:greenCarbonData:edit']"></el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:greenCarbonData:remove']"></el-button>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['manage:greenCarbonData:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['manage:greenCarbonData:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改建碳管理对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
@ -172,7 +84,7 @@
<script setup name="GreenCarbonData">
import { listGreenCarbonData, getGreenCarbonData, delGreenCarbonData, addGreenCarbonData, updateGreenCarbonData } from "@/api/manage/greenCarbonData";
import greenCarbonData, { getGreenCarbon } from "../greenCarbonItem/greenCarbonData";
const { proxy } = getCurrentInstance();
const greenCarbonDataList = ref([]);
@ -199,7 +111,9 @@ const data = reactive({
isDel: null,
},
rules: {
}
},
types: greenCarbonData.types,
selTab: 1
});
const { queryParams, form, rules } = toRefs(data);
@ -301,12 +215,12 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除建碳管理编号为"' + _ids + '"的数据项?').then(function() {
proxy.$modal.confirm('是否确认删除建碳管理编号为"' + _ids + '"的数据项?').then(function () {
return delGreenCarbonData(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => { });
}
/** 导出按钮操作 */
@ -318,3 +232,15 @@ function handleExport() {
getList();
</script>
<style lang="scss">
.green-carbon-data{
.main-tab{
.el-tabs__item{
&.is-active{
background-color: rgb(64, 158, 255);
color: #fff;
}
}
}
}
</style>