天台祥和 水稻系统数据管理

dev
ccongli 2 years ago
parent e4f41bc4a1
commit 00ed74e234

@ -6,12 +6,19 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="电表编号"> <a-form-item label="电表设备编号">
<!-- <a-input placeholder="请输入设备编号" v-model="queryParam.eqtNo"></a-input>--> <!-- <a-input placeholder="请输入设备编号" v-model="queryParam.eqtNo"></a-input>-->
<j-input placeholder="请输入电表编号" v-model="queryParam.eqtNo"></j-input> <j-input placeholder="请输入电表编号" v-model="queryParam.eqtNo"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="电表设备IP">
<!-- <a-input placeholder="请输入设备编号" v-model="queryParam.eqtNo"></a-input>-->
<j-input placeholder="请输入电表设备IP" v-model="queryParam.eqtIp"></j-input>
</a-form-item>
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24"> <a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="开始时间"> <a-form-item label="开始时间">
<j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
@ -133,7 +140,7 @@
}, },
data () { data () {
return { return {
description: 'tt_electric_meter管理页面', description: '数字电表历史数据管理页面',
// //
columns: [ columns: [
// { // {
@ -152,19 +159,27 @@
dataIndex: 'eqtNo' dataIndex: 'eqtNo'
}, },
{ {
title:'设备位置', title:'设备名称',
align:"center", align:"center",
dataIndex: 'location' dataIndex: 'descr'
}, },
{ {
title:'谷电量(度)', title:'设备IP',
align:"center", align:"center",
dataIndex: 'valleyPower' dataIndex: 'eqtIp'
}, },
{ {
title:'电量(度)', title:'累计总用电量(度)',
align:"center", align:"center",
dataIndex: 'peakPower' dataIndex: 'totalPower'
},
{
title:'昨日用电量(度)',
align:"center",
dataIndex: 'lastUse',
customRender:function (t,r,index) {
return t =="0" ? "暂无" : t;;
}
}, },
{ {
title:'采集时间', title:'采集时间',
@ -181,13 +196,11 @@
} }
], ],
url: { url: {
// list: "/ttelectricmeter/ttElectricMeter/list",
list: "/ttelectricmeter/ttElectricMeter/list", list: "/ttelectricmeter/ttElectricMeter/list",
delete: "/ttelectricmeter/ttElectricMeter/delete", delete: "/ttelectricmeter/ttElectricMeter/delete",
deleteBatch: "/ttelectricmeter/ttElectricMeter/deleteBatch", deleteBatch: "/ttelectricmeter/ttElectricMeter/deleteBatch",
exportXlsUrl: "/ttelectricmeter/ttElectricMeter/exportXls", exportXlsUrl: "/ttelectricmeter/ttElectricMeter/exportXls",
importExcelUrl: "ttelectricmeter/ttElectricMeter/importExcel", importExcelUrl: "ttelectricmeter/ttElectricMeter/importExcel",
}, },
dictOptions:{}, dictOptions:{},
superFieldList:[], superFieldList:[],
@ -207,8 +220,7 @@
getSuperFieldList(){ getSuperFieldList(){
let fieldList=[]; let fieldList=[];
fieldList.push({type:'string',value:'eqtNo',text:'电表编号'}) fieldList.push({type:'string',value:'eqtNo',text:'电表编号'})
fieldList.push({type:'number',value:'valleyPower',text:'谷电量'}) // fieldList.push({type:'number',value:'total_power',text:''})
fieldList.push({type:'number',value:'peakPower',text:'峰电量'})
fieldList.push({type:'datetime',value:'createTime',text:'采集时间'}) fieldList.push({type:'datetime',value:'createTime',text:'采集时间'})
this.superFieldList = fieldList this.superFieldList = fieldList
} }

@ -9,13 +9,13 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="电量(度)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="valleyPower"> <a-form-model-item label="总累计电量(度)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalPower">
<a-input-number v-model="model.valleyPower" placeholder="请输入谷电量" style="width: 100%" /> <a-input-number v-model="model.totalPower" placeholder="总累计电量" disabled="disabled" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="电量(度)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="peakPower"> <a-form-model-item label="昨日用电量(度)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastUse">
<a-input-number v-model="model.peakPower" placeholder="请输入电量" style="width: 100%" /> <a-input-number v-model="model.lastUse" placeholder="请输入电量" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -44,7 +44,7 @@
data () { data () {
return { return {
model:{ model:{
}, },
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 }, sm: { span: 5 },
@ -58,8 +58,8 @@
eqtNo: [ eqtNo: [
{ required: true, message: '请输入电表编号!'}, { required: true, message: '请输入电表编号!'},
], ],
peakPower: [ lastUse: [
{ required: true, message: '请输入电量!'}, { required: true, message: '请输入电量!'},
], ],
}, },
url: { url: {

@ -0,0 +1,220 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="开始时间">
<j-date placeholder="请选择开始时间点" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.time_begin"></j-date>
<span class="query-group-split-cust"></span>
<j-date placeholder="请选择结束时间点" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.time_end"></j-date>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_collect')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown> -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)"></a> -->
<!-- <a-divider type="vertical" /> -->
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-collect-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-collect-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayCollectModal from './modules/TtWaterwayCollectModal'
export default {
name: 'TtWaterwayCollectList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayCollectModal
},
data () {
return {
description: 'tt_waterway_collect管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'温度采集点1',
align:"center",
dataIndex: 'tempParam1'
},
{
title:'温度采集点2',
align:"center",
dataIndex: 'tempParam2'
},
{
title:'温度采集点3',
align:"center",
dataIndex: 'tempParam3'
},
{
title:'温度采集点4',
align:"center",
dataIndex: 'tempParam4'
},
{
title:'温度采集点5',
align:"center",
dataIndex: 'tempParam5'
},
{
title:'时间点',
align:"center",
dataIndex: 'time',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwaycollect/ttWaterwayCollect/list",
delete: "/ttwaterwaycollect/ttWaterwayCollect/delete",
deleteBatch: "/ttwaterwaycollect/ttWaterwayCollect/deleteBatch",
exportXlsUrl: "/ttwaterwaycollect/ttWaterwayCollect/exportXls",
importExcelUrl: "ttwaterwaycollect/ttWaterwayCollect/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'number',value:'tempParam1',text:'温度采集点1'})
fieldList.push({type:'number',value:'tempParam2',text:'温度采集点2'})
fieldList.push({type:'number',value:'tempParam3',text:'温度采集点3'})
fieldList.push({type:'number',value:'tempParam4',text:'温度采集点4'})
fieldList.push({type:'number',value:'tempParam5',text:'温度采集点5'})
fieldList.push({type:'date',value:'time',text:'时间点'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/ttwaterwaycollect文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309182920020', NULL, 'tt_waterway_collect', '/ttwaterwaycollect/ttWaterwayCollectList', 'ttwaterwaycollect/TtWaterwayCollectList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920021', '2023041309182920020', '添加tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920022', '2023041309182920020', '编辑tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920023', '2023041309182920020', '删除tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920024', '2023041309182920020', '批量删除tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920025', '2023041309182920020', '导出excel_tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920026', '2023041309182920020', '导入excel_tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,129 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="温度采集点1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam1">
<a-input-number v-model="model.tempParam1" placeholder="请输入温度采集点1" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点2" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam2">
<a-input-number v-model="model.tempParam2" placeholder="请输入温度采集点2" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点3" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam3">
<a-input-number v-model="model.tempParam3" placeholder="请输入温度采集点3" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点4" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam4">
<a-input-number v-model="model.tempParam4" placeholder="请输入温度采集点4" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点5" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam5">
<a-input-number v-model="model.tempParam5" placeholder="请输入温度采集点5" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="时间点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
<j-date placeholder="请选择时间点" v-model="model.time" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayCollectForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaycollect/ttWaterwayCollect/add",
edit: "/ttwaterwaycollect/ttWaterwayCollect/edit",
queryById: "/ttwaterwaycollect/ttWaterwayCollect/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-collect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-collect-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayCollectForm from './TtWaterwayCollectForm'
export default {
name: 'TtWaterwayCollectModal',
components: {
TtWaterwayCollectForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-collect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-collect-form>
</j-modal>
</template>
<script>
import TtWaterwayCollectForm from './TtWaterwayCollectForm'
export default {
name: 'TtWaterwayCollectModal',
components: {
TtWaterwayCollectForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,227 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="型号表编号">
<a-input placeholder="请输入型号表编号" v-model="queryParam.typeid"></a-input>
</a-form-item>
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="绑定时间">
<j-date placeholder="请选择开始日期" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.bindTime_begin"></j-date>
<span class="query-group-split-cust"></span>
<j-date placeholder="请选择结束日期" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.bindTime_end"></j-date>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_fid')"></a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown> -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)"></a>
<a-divider type="vertical" /> -->
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-fid-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-fid-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayFidModal from './modules/TtWaterwayFidModal'
export default {
name: 'TtWaterwayFidList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayFidModal
},
data () {
return {
description: 'tt_waterway_fid管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'FID编号',
align:"center",
dataIndex: 'fid'
},
{
title:'批次号',
align:"center",
dataIndex: 'batchNumber'
},
{
title:'框数',
align:"center",
dataIndex: 'number'
},
{
title:'型号表编号',
align:"center",
dataIndex: 'typeid'
},
{
title:'绑定时间',
align:"center",
dataIndex: 'bindTime',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
// {
// title:'',
// align:"center",
// dataIndex: 'description'
// },
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwayfid/ttWaterwayFid/list",
delete: "/ttwaterwayfid/ttWaterwayFid/delete",
deleteBatch: "/ttwaterwayfid/ttWaterwayFid/deleteBatch",
exportXlsUrl: "/ttwaterwayfid/ttWaterwayFid/exportXls",
importExcelUrl: "ttwaterwayfid/ttWaterwayFid/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'fid',text:'FID编号'})
fieldList.push({type:'string',value:'batchNumber',text:'批次号'})
fieldList.push({type:'int',value:'number',text:'框数'})
fieldList.push({type:'int',value:'typeid',text:'型号表编号'})
fieldList.push({type:'date',value:'bindTime',text:'绑定时间'})
fieldList.push({type:'string',value:'description',text:'描述'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/ttwaterwayfid文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309186230120', NULL, 'tt_waterway_fid', '/ttwaterwayfid/ttWaterwayFidList', 'ttwaterwayfid/TtWaterwayFidList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230121', '2023041309186230120', '添加tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230122', '2023041309186230120', '编辑tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230123', '2023041309186230120', '删除tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230124', '2023041309186230120', '批量删除tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230125', '2023041309186230120', '导出excel_tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230126', '2023041309186230120', '导入excel_tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,130 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="FID编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fid">
<a-input v-model="model.fid" placeholder="请输入FID编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
<a-input v-model="model.batchNumber" placeholder="请输入批次号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="框数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
<a-input-number v-model="model.number" placeholder="请输入框数" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号表编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeid">
<a-input-number v-model="model.typeid" placeholder="请输入型号表编号" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="绑定时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bindTime">
<j-date placeholder="请选择绑定时间" v-model="model.bindTime" style="width: 100%"
:showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-input v-model="model.description" placeholder="请输入描述" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayFidForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwayfid/ttWaterwayFid/add",
edit: "/ttwaterwayfid/ttWaterwayFid/edit",
queryById: "/ttwaterwayfid/ttWaterwayFid/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-fid-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-fid-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayFidForm from './TtWaterwayFidForm'
export default {
name: 'TtWaterwayFidModal',
components: {
TtWaterwayFidForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-fid-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-fid-form>
</j-modal>
</template>
<script>
import TtWaterwayFidForm from './TtWaterwayFidForm'
export default {
name: 'TtWaterwayFidModal',
components: {
TtWaterwayFidForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,198 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="绑定时间">
<j-date placeholder="请选择开始日期" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.time_begin"></j-date>
<span class="query-group-split-cust"></span>
<j-date placeholder="请选择结束日期" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.time_end"></j-date>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_message')"></a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown> -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)"></a>
<a-divider type="vertical" /> -->
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-message-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-message-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayMessageModal from './modules/TtWaterwayMessageModal'
export default {
name: 'TtWaterwayMessageList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayMessageModal
},
data () {
return {
description: 'tt_waterway_message管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'报警信息内容',
align:"center",
dataIndex: 'message'
},
{
title:'报警时间',
align:"center",
dataIndex: 'time',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwaymessage/ttWaterwayMessage/list",
delete: "/ttwaterwaymessage/ttWaterwayMessage/delete",
deleteBatch: "/ttwaterwaymessage/ttWaterwayMessage/deleteBatch",
exportXlsUrl: "/ttwaterwaymessage/ttWaterwayMessage/exportXls",
importExcelUrl: "ttwaterwaymessage/ttWaterwayMessage/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'message',text:'报警信息内容'})
fieldList.push({type:'date',value:'time',text:'报警时间'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/ttwaterwaymessage文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309161110410', NULL, 'tt_waterway_message', '/ttwaterwaymessage/ttWaterwayMessageList', 'ttwaterwaymessage/TtWaterwayMessageList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110411', '2023041309161110410', '添加tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110412', '2023041309161110410', '编辑tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110413', '2023041309161110410', '删除tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110414', '2023041309161110410', '批量删除tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110415', '2023041309161110410', '导出excel_tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110416', '2023041309161110410', '导入excel_tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,110 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="报警信息内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="message">
<a-textarea v-model="model.message" rows="4" placeholder="请输入报警信息内容" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="报警时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
<j-date placeholder="请选择报警时间" v-model="model.time" style="width: 100%"
:showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayMessageForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaymessage/ttWaterwayMessage/add",
edit: "/ttwaterwaymessage/ttWaterwayMessage/edit",
queryById: "/ttwaterwaymessage/ttWaterwayMessage/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-message-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-message-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayMessageForm from './TtWaterwayMessageForm'
export default {
name: 'TtWaterwayMessageModal',
components: {
TtWaterwayMessageForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-message-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-message-form>
</j-modal>
</template>
<script>
import TtWaterwayMessageForm from './TtWaterwayMessageForm'
export default {
name: 'TtWaterwayMessageModal',
components: {
TtWaterwayMessageForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,212 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="FID">
<a-input placeholder="请输入FID" v-model="queryParam.fid"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_outenter')"></a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown> -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)"></a>
<a-divider type="vertical" /> -->
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-outenter-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-outenter-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayOutenterModal from './modules/TtWaterwayOutenterModal'
export default {
name: 'TtWaterwayOutenterList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayOutenterModal
},
data () {
return {
description: 'tt_waterway_outenter管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'FID',
align:"center",
dataIndex: 'fid'
},
{
title:'入水时间',
align:"center",
dataIndex: 'waterEnter',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'预热时间',
align:"center",
dataIndex: 'waterYure',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'出水时间',
align:"center",
dataIndex: 'waterOut',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwayoutenter/ttWaterwayOutenter/list",
delete: "/ttwaterwayoutenter/ttWaterwayOutenter/delete",
deleteBatch: "/ttwaterwayoutenter/ttWaterwayOutenter/deleteBatch",
exportXlsUrl: "/ttwaterwayoutenter/ttWaterwayOutenter/exportXls",
importExcelUrl: "ttwaterwayoutenter/ttWaterwayOutenter/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'fid',text:'FID'})
fieldList.push({type:'date',value:'waterEnter',text:'入水时间'})
fieldList.push({type:'date',value:'waterYure',text:'预热时间'})
fieldList.push({type:'date',value:'waterOut',text:'出水时间'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/ttwaterwayoutenter文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309173610490', NULL, 'tt_waterway_outenter', '/ttwaterwayoutenter/ttWaterwayOutenterList', 'ttwaterwayoutenter/TtWaterwayOutenterList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610491', '2023041309173610490', '添加tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610492', '2023041309173610490', '编辑tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610493', '2023041309173610490', '删除tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610494', '2023041309173610490', '批量删除tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610495', '2023041309173610490', '导出excel_tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173620496', '2023041309173610490', '导入excel_tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,119 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="FID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fid">
<a-input v-model="model.fid" placeholder="请输入FID" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="入水时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="waterEnter">
<j-date placeholder="请选择入水时间" v-model="model.waterEnter" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="预热时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="waterYure">
<j-date placeholder="请选择预热时间" v-model="model.waterYure" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="出水时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="waterOut">
<j-date placeholder="请选择出水时间" v-model="model.waterOut" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayOutenterForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwayoutenter/ttWaterwayOutenter/add",
edit: "/ttwaterwayoutenter/ttWaterwayOutenter/edit",
queryById: "/ttwaterwayoutenter/ttWaterwayOutenter/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-outenter-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-outenter-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayOutenterForm from './TtWaterwayOutenterForm'
export default {
name: 'TtWaterwayOutenterModal',
components: {
TtWaterwayOutenterForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-outenter-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-outenter-form>
</j-modal>
</template>
<script>
import TtWaterwayOutenterForm from './TtWaterwayOutenterForm'
export default {
name: 'TtWaterwayOutenterModal',
components: {
TtWaterwayOutenterForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,361 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('型号管理')"></a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@change="handleTableChange"
@expand="handleExpand"
v-bind="tableProps">
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleAddChild(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<ttWaterwayType-modal ref="modalForm" @ok="modalFormOk"></ttWaterwayType-modal>
</a-card>
</template>
<script>
import { getAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayTypeModal from './modules/TtWaterwayTypeModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
export default {
name: "TtWaterwayTypeList",
mixins:[JeecgListMixin],
components: {
TtWaterwayTypeModal
},
data () {
return {
description: '型号管理管理页面',
//
columns: [
{
title:'ID',
align:"left",
dataIndex: 'id'
},
{
title:'分类名称',
align:"left",
dataIndex: 'name'
},
{
title:'优先级',
align:"left",
dataIndex: 'priority'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
isorter: {
column: "priority",
order: "desc"
},
url: {
list: "/ttwaterwaytype/ttWaterwayType/rootList",
childList: "/ttwaterwaytype/ttWaterwayType/childList",
getChildListBatch: "/ttwaterwaytype/ttWaterwayType/getChildListBatch",
delete: "/ttwaterwaytype/ttWaterwayType/delete",
deleteBatch: "/ttwaterwaytype/ttWaterwayType/deleteBatch",
exportXlsUrl: "/ttwaterwaytype/ttWaterwayType/exportXls",
importExcelUrl: "ttwaterwaytype/ttWaterwayType/importExcel",
},
expandedRowKeys:[],
hasChildrenField:"hasChild",
pidField:"parentid",
dictOptions: {},
loadParent: false,
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
tableProps() {
let _this = this
return {
//
rowSelection: {
selectedRowKeys: _this.selectedRowKeys,
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
}
}
}
},
methods: {
loadData(arg){
if(arg==1){
this.ipagination.current=1
}
this.loading = true
let params = this.getQueryParams()
params.hasQuery = 'true'
getAction(this.url.list,params).then(res=>{
if(res.success){
let result = res.result
if(Number(result.total)>0){
this.ipagination.total = Number(result.total)
this.dataSource = this.getDataByResult(res.result.records)
return this.loadDataByExpandedRows(this.dataSource)
}else{
this.ipagination.total=0
this.dataSource=[]
}
}else{
this.$message.warning(res.message)
}
}).finally(()=>{
this.loading = false
})
},
//
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{
if (res.success && res.result.records.length>0) {
//
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item[this.pidField];
if (this.expandedRowKeys.join(',').includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
},
getQueryParams(arg) {
//
let sqp = {}
let param = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
if(arg){
param = Object.assign(sqp, this.isorter ,this.filters);
}else{
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
}
if(JSON.stringify(this.queryParam) === "{}" || arg){
param.hasQuery = 'false'
}else{
param.hasQuery = 'true'
}
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
searchReset() {
//
this.expandedRowKeys = []
this.queryParam = {}
this.loadData(1);
},
getDataByResult(result){
if(result){
return result.map(item=>{
//
if(item[this.hasChildrenField]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
},
handleExpand(expanded, record){
//
if (expanded) {
this.expandedRowKeys.push(record.id)
if (record.children.length>0 && record.children[0].isLoading === true) {
let params = this.getQueryParams(1);//
params[this.pidField] = record.id
params.hasQuery = 'false'
params.superQueryParams=""
getAction(this.url.childList,params).then((res)=>{
if(res.success){
if(res.result.records){
record.children = this.getDataByResult(res.result.records)
this.dataSource = [...this.dataSource]
}else{
record.children=''
record.hasChildrenField='0'
}
}else{
this.$message.warning(res.message)
}
})
}
}else{
let keyIndex = this.expandedRowKeys.indexOf(record.id)
if(keyIndex>=0){
this.expandedRowKeys.splice(keyIndex, 1);
}
}
},
handleAddChild(record){
this.loadParent = true
let obj = {}
obj[this.pidField] = String(record['id']) // String
this.$refs.modalForm.add(obj);
},
handleDeleteNode(id) {
if(!this.url.delete){
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
that.loadData(1)
} else {
that.$message.warning(res.message);
}
});
},
batchDel(){
if(this.selectedRowKeys.length<=0){
this.$message.warning('请选择一条记录!');
return false;
}else{
let ids = "";
let that = this;
that.selectedRowKeys.forEach(function(val) {
ids+=val+",";
});
that.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
that.handleDeleteNode(ids)
that.onClearSelected();
}
});
}
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'name',text:'分类名称',dictCode:''})
fieldList.push({type:'int',value:'status',text:'状态',dictCode:'status'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/ttwaterwaytype2文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041302469020260', NULL, '型号管理', '/ttwaterwaytype2/ttWaterwayTypeList', 'ttwaterwaytype2/TtWaterwayTypeList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020261', '2023041302469020260', '添加型号管理', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020262', '2023041302469020260', '编辑型号管理', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020263', '2023041302469020260', '删除型号管理', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020264', '2023041302469020260', '批量删除型号管理', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020265', '2023041302469020260', '导出excel_型号管理', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020266', '2023041302469020260', '导入excel_型号管理', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,162 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="分类类别名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入分类类别名称" ></a-input>
</a-form-model-item>
<a-form-model-item label="父级分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parentid">
<j-tree-select
ref="treeSelect"
placeholder="请选择父级分类"
v-model="model.parentid"
dict="tt_waterway_type,name,id"
pidField="parentid"
pidValue="0"
hasChildField="has_child"
>
</j-tree-select>
</a-form-model-item>
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag type="list" v-model="model.status" dictCode="status" placeholder="请选择状态: 0禁用1启用" />
</a-form-model-item>
<a-form-model-item label="优先级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority">
<a-input-number v-model="model.priority" placeholder="请输入优先级,越大,同级显示的时候越靠前" style="width: 100%" />
</a-form-model-item>
<a-form-model-item label="深度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="depth">
<a-input-number v-model="model.depth" placeholder="请输入深度从1递增" style="width: 100%" />
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: "TtWaterwayTypeModal",
components: {
},
data () {
return {
title:"操作",
width:800,
visible: false,
model:{
status:1,
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaytype/ttWaterwayType/add",
edit: "/ttwaterwaytype/ttWaterwayType/edit",
},
expandedRowKeys:[],
pidField:"parentid"
}
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add (obj) {
this.modelDefault.parentid=''
this.edit(Object.assign(this.modelDefault , obj));
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate()
},
handleOk () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
if(this.model.id && this.model.id === this.model[this.pidField]){
that.$message.warning("父级节点不能选择自己");
that.confirmLoading = false;
return;
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
this.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false
}
})
},
handleCancel () {
this.close()
},
submitSuccess(formData,flag){
if(!formData.id){
let treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys=[]
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
this.$emit('ok',formData,this.expandedRowKeys.reverse());
}else{
this.$emit('ok',formData,flag);
}
},
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid){
this.expandedRowKeys.push(arr[i].key)
this.getExpandKeysByPid(arr[i]['parentId'],all,all)
}else{
this.getExpandKeysByPid(pid,arr[i].children,all)
}
}
}
}
}
}
</script>

@ -0,0 +1,197 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_type')"></a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> -->
<!-- </a-dropdown> -->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)"></a>
<a-divider type="vertical" /> -->
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-type-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-type-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayTypeModal from './modules/TtWaterwayTypeModal'
export default {
name: 'TtWaterwayTypeList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayTypeModal
},
data () {
return {
description: 'tt_waterway_type管理页面',
//
columns: [
// {
// title: '#',
// dataIndex: '',
// key:'rowIndex',
// width:60,
// align:"center",
// customRender:function (t,r,index) {
// return parseInt(index)+1;
// }
// },
{
title:'分类名称',
align:"center",
dataIndex: 'name'
},
{
title:'父级分类',
align:"center",
dataIndex: 'parentid'
},
{
title:'深度',
align:"center",
dataIndex: 'depth'
},
{
title:'状态',
align:"center",
dataIndex: 'status_dictText', //
// customRender:function (t,r,index) {
// return r.status == 0 ? '' : '';
// }
},
{
title:'优先级',
align:"center",
dataIndex: 'priority'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwaytype/ttWaterwayType/list",
delete: "/ttwaterwaytype/ttWaterwayType/delete",
deleteBatch: "/ttwaterwaytype/ttWaterwayType/deleteBatch",
exportXlsUrl: "/ttwaterwaytype/ttWaterwayType/exportXls",
importExcelUrl: "ttwaterwaytype/ttWaterwayType/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'name',text:'分类类别名称'})
fieldList.push({type:'int',value:'parentid',text:'母亲分类id'})
fieldList.push({type:'int',value:'depth',text:'深度从1递增'})
fieldList.push({type:'int',value:'status',text:'状态: 0禁用1启用'})
fieldList.push({type:'int',value:'priority',text:'优先级,越大,同级显示的时候越靠前'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/ttwaterwaytype文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('202304130916170080', NULL, 'tt_waterway_type', '/ttwaterwaytype/ttWaterwayTypeList', 'ttwaterwaytype/TtWaterwayTypeList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202304130916170081', '202304130916170080', '添加tt_waterway_type', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype:tt_waterway_type:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202304130916170082', '202304130916170080', '编辑tt_waterway_type', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype:tt_waterway_type:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202304130916170083', '202304130916170080', '删除tt_waterway_type', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype:tt_waterway_type:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202304130916170084', '202304130916170080', '批量删除tt_waterway_type', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype:tt_waterway_type:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202304130916170085', '202304130916170080', '导出excel_tt_waterway_type', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype:tt_waterway_type:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202304130916170086', '202304130916170080', '导入excel_tt_waterway_type', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype:tt_waterway_type:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:08', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,124 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入分类名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="父级分类id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parentid">
<a-input-number v-model="model.parentid" placeholder="请输入父级分类id" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="深度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="depth">
<a-input-number v-model="model.depth" placeholder="请输入深度" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-input-number v-model="model.status" placeholder="请选择状态" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="优先级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority">
<a-input-number v-model="model.priority" placeholder="请输入优先级,越大,同级显示的时候越靠前" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayTypeForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaytype/ttWaterwayType/add",
edit: "/ttwaterwaytype/ttWaterwayType/edit",
queryById: "/ttwaterwaytype/ttWaterwayType/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-type-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayTypeForm from './TtWaterwayTypeForm'
export default {
name: 'TtWaterwayTypeModal',
components: {
TtWaterwayTypeForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-type-form>
</j-modal>
</template>
<script>
import TtWaterwayTypeForm from './TtWaterwayTypeForm'
export default {
name: 'TtWaterwayTypeModal',
components: {
TtWaterwayTypeForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,354 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('商品分类')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@change="handleTableChange"
@expand="handleExpand"
v-bind="tableProps">
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleAddChild(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<testShoptypeTree-modal ref="modalForm" @ok="modalFormOk"></testShoptypeTree-modal>
</a-card>
</template>
<script>
import { getAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TestShoptypeTreeModal from './modules/TestShoptypeTreeModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
export default {
name: "TestShoptypeTreeList",
mixins:[JeecgListMixin],
components: {
TestShoptypeTreeModal
},
data () {
return {
description: '商品分类管理页面',
//
columns: [
{
title:'商品分类',
align:"left",
dataIndex: 'typeName'
},
{
title:'分类图片',
align:"left",
dataIndex: 'pic',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/demo888/testShoptypeTree/rootList",
childList: "/demo888/testShoptypeTree/childList",
getChildListBatch: "/demo888/testShoptypeTree/getChildListBatch",
delete: "/demo888/testShoptypeTree/delete",
deleteBatch: "/demo888/testShoptypeTree/deleteBatch",
exportXlsUrl: "/demo888/testShoptypeTree/exportXls",
importExcelUrl: "demo888/testShoptypeTree/importExcel",
},
expandedRowKeys:[],
hasChildrenField:"hasChild",
pidField:"pid",
dictOptions: {},
loadParent: false,
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
tableProps() {
let _this = this
return {
//
rowSelection: {
selectedRowKeys: _this.selectedRowKeys,
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
}
}
}
},
methods: {
loadData(arg){
if(arg==1){
this.ipagination.current=1
}
this.loading = true
let params = this.getQueryParams()
params.hasQuery = 'true'
getAction(this.url.list,params).then(res=>{
if(res.success){
let result = res.result
if(Number(result.total)>0){
this.ipagination.total = Number(result.total)
this.dataSource = this.getDataByResult(res.result.records)
return this.loadDataByExpandedRows(this.dataSource)
}else{
this.ipagination.total=0
this.dataSource=[]
}
}else{
this.$message.warning(res.message)
}
}).finally(()=>{
this.loading = false
})
},
//
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{
if (res.success && res.result.records.length>0) {
//
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item[this.pidField];
if (this.expandedRowKeys.join(',').includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
},
getQueryParams(arg) {
//
let sqp = {}
let param = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
if(arg){
param = Object.assign(sqp, this.isorter ,this.filters);
}else{
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
}
if(JSON.stringify(this.queryParam) === "{}" || arg){
param.hasQuery = 'false'
}else{
param.hasQuery = 'true'
}
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
searchReset() {
//
this.expandedRowKeys = []
this.queryParam = {}
this.loadData(1);
},
getDataByResult(result){
if(result){
return result.map(item=>{
//
if(item[this.hasChildrenField]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
},
handleExpand(expanded, record){
//
if (expanded) {
this.expandedRowKeys.push(record.id)
if (record.children.length>0 && record.children[0].isLoading === true) {
let params = this.getQueryParams(1);//
params[this.pidField] = record.id
params.hasQuery = 'false'
params.superQueryParams=""
getAction(this.url.childList,params).then((res)=>{
if(res.success){
if(res.result.records){
record.children = this.getDataByResult(res.result.records)
this.dataSource = [...this.dataSource]
}else{
record.children=''
record.hasChildrenField='0'
}
}else{
this.$message.warning(res.message)
}
})
}
}else{
let keyIndex = this.expandedRowKeys.indexOf(record.id)
if(keyIndex>=0){
this.expandedRowKeys.splice(keyIndex, 1);
}
}
},
handleAddChild(record){
this.loadParent = true
let obj = {}
obj[this.pidField] = record['id']
this.$refs.modalForm.add(obj);
},
handleDeleteNode(id) {
if(!this.url.delete){
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
that.loadData(1)
} else {
that.$message.warning(res.message);
}
});
},
batchDel(){
if(this.selectedRowKeys.length<=0){
this.$message.warning('请选择一条记录!');
return false;
}else{
let ids = "";
let that = this;
that.selectedRowKeys.forEach(function(val) {
ids+=val+",";
});
that.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
that.handleDeleteNode(ids)
that.onClearSelected();
}
});
}
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'typeName',text:'商品分类',dictCode:''})
fieldList.push({type:'string',value:'pic',text:'分类图片',dictCode:''})
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/demo888文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041302342260040', NULL, '商品分类', '/demo888/testShoptypeTreeList', 'demo888/TestShoptypeTreeList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302342260041', '2023041302342260040', '添加商品分类', NULL, NULL, 0, NULL, NULL, 2, 'demo888:test_shoptype_tree:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302342260042', '2023041302342260040', '编辑商品分类', NULL, NULL, 0, NULL, NULL, 2, 'demo888:test_shoptype_tree:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302342260043', '2023041302342260040', '删除商品分类', NULL, NULL, 0, NULL, NULL, 2, 'demo888:test_shoptype_tree:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302342260044', '2023041302342260040', '批量删除商品分类', NULL, NULL, 0, NULL, NULL, 2, 'demo888:test_shoptype_tree:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302342260045', '2023041302342260040', '导出excel_商品分类', NULL, NULL, 0, NULL, NULL, 2, 'demo888:test_shoptype_tree:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302342260046', '2023041302342260040', '导入excel_商品分类', NULL, NULL, 0, NULL, NULL, 2, 'demo888:test_shoptype_tree:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:34:04', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,156 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="商品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName">
<a-input v-model="model.typeName" placeholder="请输入商品分类" ></a-input>
</a-form-model-item>
<a-form-model-item label="分类图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pic">
<j-image-upload isMultiple v-model="model.pic" ></j-image-upload>
</a-form-model-item>
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<j-tree-select
ref="treeSelect"
placeholder="请选择父级节点"
v-model="model.pid"
dict="test_shoptype_tree,type_name,id"
pidField="pid"
pidValue="0"
hasChildField="has_child"
>
</j-tree-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: "TestShoptypeTreeModal",
components: {
},
data () {
return {
title:"操作",
width:800,
visible: false,
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/demo888/testShoptypeTree/add",
edit: "/demo888/testShoptypeTree/edit",
},
expandedRowKeys:[],
pidField:"pid"
}
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add (obj) {
this.modelDefault.pid=''
this.edit(Object.assign(this.modelDefault , obj));
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate()
},
handleOk () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
if(this.model.id && this.model.id === this.model[this.pidField]){
that.$message.warning("父级节点不能选择自己");
that.confirmLoading = false;
return;
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
this.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false
}
})
},
handleCancel () {
this.close()
},
submitSuccess(formData,flag){
if(!formData.id){
let treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys=[]
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
this.$emit('ok',formData,this.expandedRowKeys.reverse());
}else{
this.$emit('ok',formData,flag);
}
},
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid){
this.expandedRowKeys.push(arr[i].key)
this.getExpandKeysByPid(arr[i]['parentId'],all,all)
}else{
this.getExpandKeysByPid(pid,arr[i].children,all)
}
}
}
}
}
}
</script>

@ -27,6 +27,7 @@ import org.jeecg.modules.demo.tteqtbase.entity.TtEqtBase;
import org.jeecg.modules.demo.tteqtbase.service.ITtEqtBaseService; import org.jeecg.modules.demo.tteqtbase.service.ITtEqtBaseService;
import org.jeecg.modules.demo.ttfeedingequip.entity.TtFeedingEquip; import org.jeecg.modules.demo.ttfeedingequip.entity.TtFeedingEquip;
import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip; import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip;
import org.jeecg.modules.demo.ttpouringequip.entity.TtPouringEquip;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -60,20 +61,6 @@ public class TtElectricMeterController extends JeecgController<TtElectricMeter,
@Autowired @Autowired
private ITtEqtBaseService ttEqtBaseService; private ITtEqtBaseService ttEqtBaseService;
@ApiOperation(value = "tt列表查询", notes = "tt列表查询")
@GetMapping(value = "/QueryElectricMeterList")
public Result<IPage<TtElectricMeter>> QueryElectricMeterList(TtElectricMeter ttElectricMeter,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtElectricMeter> queryWrapper = QueryGenerator.initQueryWrapper(ttElectricMeter, req.getParameterMap());
Page<TtElectricMeter> page = new Page<TtElectricMeter>(pageNo, pageSize);
IPage<TtElectricMeter> pageList = ttElectricMeterService.QueryElectricMeter(page, ttElectricMeter);
return Result.OK(pageList);
}
/** /**
* *
* *
@ -87,22 +74,24 @@ public class TtElectricMeterController extends JeecgController<TtElectricMeter,
@ApiOperation(value = "tt_electric_meter-分页列表查询", notes = "tt_electric_meter-分页列表查询") @ApiOperation(value = "tt_electric_meter-分页列表查询", notes = "tt_electric_meter-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<TtElectricMeter>> queryPageList(TtElectricMeter ttElectricMeter, public Result<IPage<TtElectricMeter>> queryPageList(TtElectricMeter ttElectricMeter,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
HttpServletRequest req) {
QueryWrapper<TtElectricMeter> queryWrapper = QueryGenerator.initQueryWrapper(ttElectricMeter, req.getParameterMap()); QueryWrapper<TtElectricMeter> queryWrapper = QueryGenerator.initQueryWrapper(ttElectricMeter, req.getParameterMap());
Page<TtElectricMeter> page = new Page<TtElectricMeter>(pageNo, pageSize); Page<TtElectricMeter> page = new Page<TtElectricMeter>(pageNo, pageSize);
IPage<TtElectricMeter> pageList = ttElectricMeterService.page(page, queryWrapper); IPage<TtElectricMeter> pageList = ttElectricMeterService.page(page, queryWrapper);
List<TtElectricMeter> list = pageList.getRecords(); List<TtElectricMeter> list = pageList.getRecords();
if (list.size() > 0) { if (list.size() > 0) {
// 查询所有电表设备
QueryWrapper<TtEqtBase> qw = new QueryWrapper<>();
qw.eq("eqt_type", 6);
List<TtEqtBase> eqtBaseList = ttEqtBaseService.list(qw);
Map<String, TtEqtBase> eqtBaseMap = eqtBaseList.stream().collect(Collectors.toMap(TtEqtBase::getEqtIp, v -> v));
for (TtElectricMeter meter : list) { for (TtElectricMeter meter : list) {
QueryWrapper<TtEqtBase> eqtBase = new QueryWrapper<>(); QueryWrapper<TtEqtBase> eqtBase = new QueryWrapper<>();
eqtBase.eq("eqt_no", meter.getEqtNo()); String eqtIp = meter.getEqtIp();
eqtBase.eq("eqt_type", 6); TtEqtBase ttEqtBase = eqtBaseMap.get(eqtIp);
eqtBase.eq("location", "数字电表");
TtEqtBase ttEqtBase = ttEqtBaseService.getOne(eqtBase);
if (ttEqtBase != null) { if (ttEqtBase != null) {
meter.setLocation(ttEqtBase.getLocation()); meter.setDescr(ttEqtBase.getDescr());
} }
} }
} }
@ -193,10 +182,6 @@ public class TtElectricMeterController extends JeecgController<TtElectricMeter,
* @param ttElectricMeter * @param ttElectricMeter
*/ */
//@RequiresPermissions("ttelectricmeter:tt_electric_meter:exportXls") //@RequiresPermissions("ttelectricmeter:tt_electric_meter:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, TtElectricMeter ttElectricMeter) {
// return super.exportXls(request, ttElectricMeter, TtElectricMeter.class, "tt_electric_meter");
// }
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtElectricMeter ttElectricMeter) { public ModelAndView exportXls(HttpServletRequest request, TtElectricMeter ttElectricMeter) {
ModelAndView modelAndView = super.exportXls(request, ttElectricMeter, TtElectricMeter.class, "tt_electric_meter"); ModelAndView modelAndView = super.exportXls(request, ttElectricMeter, TtElectricMeter.class, "tt_electric_meter");

@ -34,39 +34,66 @@ public class TtElectricMeter implements Serializable {
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private java.lang.Integer id; private java.lang.Integer id;
/**电表编号*/ /**电表编号*/
@Excel(name = "电表编号", width = 15) @Excel(name = "电表编号", width = 15)
@ApiModelProperty(value = "电表编号") @ApiModelProperty(value = "电表编号")
private java.lang.String eqtNo; private java.lang.String eqtNo;
/**设备位置*/
@Excel(name = "设备位置",width = 15) /**设备IP*/
@TableField(exist = false) @Excel(name = "设备IP", width = 15)
private java.lang.String location; @ApiModelProperty(value = "设备IP")
private String eqtIp;
/**谷电量*/ /**谷电量*/
@Excel(name = "谷电量", width = 15) @Excel(name = "累计总用电量", width = 15)
@ApiModelProperty(value = "谷电量") @ApiModelProperty(value = "累计总用电量")
private java.math.BigDecimal valleyPower; private java.math.BigDecimal totalPower;
/**峰电量*/
@Excel(name = "峰电量", width = 15) @Excel(name = "昨日用电量", width = 15)
@ApiModelProperty(value = "峰电量") @ApiModelProperty(value = "昨日用电量")
private java.math.BigDecimal peakPower; private java.math.BigDecimal lastUse;
/**记录的创建时间*/ /**记录的创建时间*/
@Excel(name = "采集时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") @Excel(name = "采集时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "记录的创建时间") @ApiModelProperty(value = "记录的创建时间")
private java.util.Date createTime; private java.util.Date createTime;
/**记录的创建人默认admin*/ /**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin") @ApiModelProperty(value = "记录的创建人默认admin")
private java.lang.String createBy; private java.lang.String createBy;
/**记录的修改时间*/ /**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "记录的修改时间") @ApiModelProperty(value = "记录的修改时间")
private java.util.Date updateTime; private java.util.Date updateTime;
/**记录的修改人,修改人员的登录账号*/ /**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号") @ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private java.lang.String updateBy; private java.lang.String updateBy;
@ApiModelProperty(value = "设备状态")
@TableField(exist = false)
private Integer eqtStatus;
// @ApiModelProperty(value = "设备近7天使用率")
// @TableField(exist = false)
// private BigDecimal utilizeRate;
@ApiModelProperty(value = "设备描述")
@TableField(exist = false)
private String descr;
@ApiModelProperty(value = "设备位置")
@TableField(exist = false)
private String location;
@ApiModelProperty(value = "设备厂家")
@TableField(exist = false)
private String eqtSupplier;
} }

@ -2,21 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttelectricmeter.mapper.TtElectricMeterMapper"> <mapper namespace="org.jeecg.modules.demo.ttelectricmeter.mapper.TtElectricMeterMapper">
<select id="TtElectricMeterinfo" resultType="org.jeecg.modules.demo.ttelectricmeter.entity.TtElectricMeter"> <select id="TtElectricMeterinfo" resultType="org.jeecg.modules.demo.ttelectricmeter.entity.TtElectricMeter">
SELECT SELECT
a.id, a.id,
a.eqt_no, a.eqt_no,
b.location, b.location,
valley_power, a.create_by,
peak_power, a.create_time,
a.create_by, a.update_by,
a.create_time, a.update_time
a.update_by, FROM
a.update_time tt_electric_meter a,
FROM tt_eqt_base b
tt_electric_meter a, WHERE
tt_eqt_base b b.eqt_type = 6
WHERE AND a.eqt_no = b.eqt_no
b.eqt_type = 6
AND a.eqt_no = b.eqt_no
</select> </select>
</mapper> </mapper>

@ -24,6 +24,7 @@ public class TtElectricMeterServiceImpl extends ServiceImpl<TtElectricMeterMappe
TtElectricMeterMapper ttElectricMeterMapper; TtElectricMeterMapper ttElectricMeterMapper;
@Override @Override
@Deprecated
public IPage QueryElectricMeter(Page<TtElectricMeter> page, TtElectricMeter ttElectricMeter) { public IPage QueryElectricMeter(Page<TtElectricMeter> page, TtElectricMeter ttElectricMeter) {
return ttElectricMeterMapper.TtElectricMeterinfo(page,ttElectricMeter); return ttElectricMeterMapper.TtElectricMeterinfo(page,ttElectricMeter);
} }

@ -0,0 +1,178 @@
package org.jeecg.modules.demo.ttwaterwaycollect.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.ttwaterwaycollect.entity.TtWaterwayCollect;
import org.jeecg.modules.demo.ttwaterwaycollect.service.ITtWaterwayCollectService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: tt_waterway_collect
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Api(tags="tt_waterway_collect")
@RestController
@RequestMapping("/ttwaterwaycollect/ttWaterwayCollect")
@Slf4j
public class TtWaterwayCollectController extends JeecgController<TtWaterwayCollect, ITtWaterwayCollectService> {
@Autowired
private ITtWaterwayCollectService ttWaterwayCollectService;
/**
*
*
* @param ttWaterwayCollect
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tt_waterway_collect-分页列表查询")
@ApiOperation(value="tt_waterway_collect-分页列表查询", notes="tt_waterway_collect-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TtWaterwayCollect>> queryPageList(TtWaterwayCollect ttWaterwayCollect,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtWaterwayCollect> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayCollect, req.getParameterMap());
Page<TtWaterwayCollect> page = new Page<TtWaterwayCollect>(pageNo, pageSize);
IPage<TtWaterwayCollect> pageList = ttWaterwayCollectService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param ttWaterwayCollect
* @return
*/
@AutoLog(value = "tt_waterway_collect-添加")
@ApiOperation(value="tt_waterway_collect-添加", notes="tt_waterway_collect-添加")
//@RequiresPermissions("ttwaterwaycollect:tt_waterway_collect:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtWaterwayCollect ttWaterwayCollect) {
ttWaterwayCollectService.save(ttWaterwayCollect);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttWaterwayCollect
* @return
*/
@AutoLog(value = "tt_waterway_collect-编辑")
@ApiOperation(value="tt_waterway_collect-编辑", notes="tt_waterway_collect-编辑")
//@RequiresPermissions("ttwaterwaycollect:tt_waterway_collect:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtWaterwayCollect ttWaterwayCollect) {
ttWaterwayCollectService.updateById(ttWaterwayCollect);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "tt_waterway_collect-通过id删除")
@ApiOperation(value="tt_waterway_collect-通过id删除", notes="tt_waterway_collect-通过id删除")
//@RequiresPermissions("ttwaterwaycollect:tt_waterway_collect:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttWaterwayCollectService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "tt_waterway_collect-批量删除")
@ApiOperation(value="tt_waterway_collect-批量删除", notes="tt_waterway_collect-批量删除")
//@RequiresPermissions("ttwaterwaycollect:tt_waterway_collect:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttWaterwayCollectService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "tt_waterway_collect-通过id查询")
@ApiOperation(value="tt_waterway_collect-通过id查询", notes="tt_waterway_collect-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtWaterwayCollect> queryById(@RequestParam(name="id",required=true) String id) {
TtWaterwayCollect ttWaterwayCollect = ttWaterwayCollectService.getById(id);
if(ttWaterwayCollect==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttWaterwayCollect);
}
/**
* excel
*
* @param request
* @param ttWaterwayCollect
*/
//@RequiresPermissions("ttwaterwaycollect:tt_waterway_collect:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtWaterwayCollect ttWaterwayCollect) {
return super.exportXls(request, ttWaterwayCollect, TtWaterwayCollect.class, "tt_waterway_collect");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttwaterwaycollect:tt_waterway_collect:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtWaterwayCollect.class);
}
}

@ -0,0 +1,81 @@
package org.jeecg.modules.demo.ttwaterwaycollect.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tt_waterway_collect
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Data
@TableName("tt_waterway_collect")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tt_waterway_collect对象", description="tt_waterway_collect")
public class TtWaterwayCollect implements Serializable {
private static final long serialVersionUID = 1L;
/**主键编号*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键编号")
private java.lang.Integer id;
/**温度采集点1*/
@Excel(name = "温度采集点1", width = 15)
@ApiModelProperty(value = "温度采集点1")
private java.lang.Double tempParam1;
/**温度采集点2*/
@Excel(name = "温度采集点2", width = 15)
@ApiModelProperty(value = "温度采集点2")
private java.lang.Double tempParam2;
/**温度采集点3*/
@Excel(name = "温度采集点3", width = 15)
@ApiModelProperty(value = "温度采集点3")
private java.lang.Double tempParam3;
/**温度采集点4*/
@Excel(name = "温度采集点4", width = 15)
@ApiModelProperty(value = "温度采集点4")
private java.lang.Double tempParam4;
/**温度采集点5*/
@Excel(name = "温度采集点5", width = 15)
@ApiModelProperty(value = "温度采集点5")
private java.lang.Double tempParam5;
/**时间点*/
@Excel(name = "时间点", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "时间点")
private java.util.Date time;
/**记录的创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的创建时间")
private java.util.Date createTime;
/**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin")
private java.lang.String createBy;
/**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的修改时间")
private java.util.Date updateTime;
/**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private java.lang.String updateBy;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.ttwaterwaycollect.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.ttwaterwaycollect.entity.TtWaterwayCollect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tt_waterway_collect
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface TtWaterwayCollectMapper extends BaseMapper<TtWaterwayCollect> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttwaterwaycollect.mapper.TtWaterwayCollectMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.ttwaterwaycollect.service;
import org.jeecg.modules.demo.ttwaterwaycollect.entity.TtWaterwayCollect;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: tt_waterway_collect
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface ITtWaterwayCollectService extends IService<TtWaterwayCollect> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.ttwaterwaycollect.service.impl;
import org.jeecg.modules.demo.ttwaterwaycollect.entity.TtWaterwayCollect;
import org.jeecg.modules.demo.ttwaterwaycollect.mapper.TtWaterwayCollectMapper;
import org.jeecg.modules.demo.ttwaterwaycollect.service.ITtWaterwayCollectService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tt_waterway_collect
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Service
public class TtWaterwayCollectServiceImpl extends ServiceImpl<TtWaterwayCollectMapper, TtWaterwayCollect> implements ITtWaterwayCollectService {
}

@ -0,0 +1,204 @@
<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- -END -->
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_collect')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<!-- -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/></a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-collect-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-collect-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayCollectModal from './modules/TtWaterwayCollectModal'
export default {
name: 'TtWaterwayCollectList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayCollectModal
},
data () {
return {
description: 'tt_waterway_collect',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'1',
align:"center",
dataIndex: 'tempParam1'
},
{
title:'2',
align:"center",
dataIndex: 'tempParam2'
},
{
title:'3',
align:"center",
dataIndex: 'tempParam3'
},
{
title:'4',
align:"center",
dataIndex: 'tempParam4'
},
{
title:'5',
align:"center",
dataIndex: 'tempParam5'
},
{
title:'',
align:"center",
dataIndex: 'time',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwaycollect/ttWaterwayCollect/list",
delete: "/ttwaterwaycollect/ttWaterwayCollect/delete",
deleteBatch: "/ttwaterwaycollect/ttWaterwayCollect/deleteBatch",
exportXlsUrl: "/ttwaterwaycollect/ttWaterwayCollect/exportXls",
importExcelUrl: "ttwaterwaycollect/ttWaterwayCollect/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'number',value:'tempParam1',text:'1'})
fieldList.push({type:'number',value:'tempParam2',text:'2'})
fieldList.push({type:'number',value:'tempParam3',text:'3'})
fieldList.push({type:'number',value:'tempParam4',text:'4'})
fieldList.push({type:'number',value:'tempParam5',text:'5'})
fieldList.push({type:'date',value:'time',text:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttwaterwaycollect
-- sqlcomponent
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309182920020', NULL, 'tt_waterway_collect', '/ttwaterwaycollect/ttWaterwayCollectList', 'ttwaterwaycollect/TtWaterwayCollectList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0);
-- sql
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920021', '2023041309182920020', 'tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920022', '2023041309182920020', 'tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920023', '2023041309182920020', 'tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920024', '2023041309182920020', 'tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920025', '2023041309182920020', 'excel_tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309182920026', '2023041309182920020', 'excel_tt_waterway_collect', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaycollect:tt_waterway_collect:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:02', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,129 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="温度采集点1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam1">
<a-input-number v-model="model.tempParam1" placeholder="请输入温度采集点1" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点2" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam2">
<a-input-number v-model="model.tempParam2" placeholder="请输入温度采集点2" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点3" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam3">
<a-input-number v-model="model.tempParam3" placeholder="请输入温度采集点3" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点4" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam4">
<a-input-number v-model="model.tempParam4" placeholder="请输入温度采集点4" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度采集点5" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tempParam5">
<a-input-number v-model="model.tempParam5" placeholder="请输入温度采集点5" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="时间点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
<j-date placeholder="请选择时间点" v-model="model.time" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayCollectForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaycollect/ttWaterwayCollect/add",
edit: "/ttwaterwaycollect/ttWaterwayCollect/edit",
queryById: "/ttwaterwaycollect/ttWaterwayCollect/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-collect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-collect-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;"></a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayCollectForm from './TtWaterwayCollectForm'
export default {
name: 'TtWaterwayCollectModal',
components: {
TtWaterwayCollectForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-collect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-collect-form>
</j-modal>
</template>
<script>
import TtWaterwayCollectForm from './TtWaterwayCollectForm'
export default {
name: 'TtWaterwayCollectModal',
components: {
TtWaterwayCollectForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,178 @@
package org.jeecg.modules.demo.ttwaterwayfid.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.ttwaterwayfid.entity.TtWaterwayFid;
import org.jeecg.modules.demo.ttwaterwayfid.service.ITtWaterwayFidService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: tt_waterway_fid
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Api(tags="tt_waterway_fid")
@RestController
@RequestMapping("/ttwaterwayfid/ttWaterwayFid")
@Slf4j
public class TtWaterwayFidController extends JeecgController<TtWaterwayFid, ITtWaterwayFidService> {
@Autowired
private ITtWaterwayFidService ttWaterwayFidService;
/**
*
*
* @param ttWaterwayFid
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tt_waterway_fid-分页列表查询")
@ApiOperation(value="tt_waterway_fid-分页列表查询", notes="tt_waterway_fid-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TtWaterwayFid>> queryPageList(TtWaterwayFid ttWaterwayFid,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtWaterwayFid> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayFid, req.getParameterMap());
Page<TtWaterwayFid> page = new Page<TtWaterwayFid>(pageNo, pageSize);
IPage<TtWaterwayFid> pageList = ttWaterwayFidService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param ttWaterwayFid
* @return
*/
@AutoLog(value = "tt_waterway_fid-添加")
@ApiOperation(value="tt_waterway_fid-添加", notes="tt_waterway_fid-添加")
//@RequiresPermissions("ttwaterwayfid:tt_waterway_fid:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtWaterwayFid ttWaterwayFid) {
ttWaterwayFidService.save(ttWaterwayFid);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttWaterwayFid
* @return
*/
@AutoLog(value = "tt_waterway_fid-编辑")
@ApiOperation(value="tt_waterway_fid-编辑", notes="tt_waterway_fid-编辑")
//@RequiresPermissions("ttwaterwayfid:tt_waterway_fid:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtWaterwayFid ttWaterwayFid) {
ttWaterwayFidService.updateById(ttWaterwayFid);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "tt_waterway_fid-通过id删除")
@ApiOperation(value="tt_waterway_fid-通过id删除", notes="tt_waterway_fid-通过id删除")
//@RequiresPermissions("ttwaterwayfid:tt_waterway_fid:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttWaterwayFidService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "tt_waterway_fid-批量删除")
@ApiOperation(value="tt_waterway_fid-批量删除", notes="tt_waterway_fid-批量删除")
//@RequiresPermissions("ttwaterwayfid:tt_waterway_fid:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttWaterwayFidService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "tt_waterway_fid-通过id查询")
@ApiOperation(value="tt_waterway_fid-通过id查询", notes="tt_waterway_fid-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtWaterwayFid> queryById(@RequestParam(name="id",required=true) String id) {
TtWaterwayFid ttWaterwayFid = ttWaterwayFidService.getById(id);
if(ttWaterwayFid==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttWaterwayFid);
}
/**
* excel
*
* @param request
* @param ttWaterwayFid
*/
//@RequiresPermissions("ttwaterwayfid:tt_waterway_fid:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtWaterwayFid ttWaterwayFid) {
return super.exportXls(request, ttWaterwayFid, TtWaterwayFid.class, "tt_waterway_fid");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttwaterwayfid:tt_waterway_fid:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtWaterwayFid.class);
}
}

@ -0,0 +1,81 @@
package org.jeecg.modules.demo.ttwaterwayfid.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tt_waterway_fid
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Data
@TableName("tt_waterway_fid")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tt_waterway_fid对象", description="tt_waterway_fid")
public class TtWaterwayFid implements Serializable {
private static final long serialVersionUID = 1L;
/**id编号*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id编号")
private java.lang.Integer id;
/**FID编号*/
@Excel(name = "FID编号", width = 15)
@ApiModelProperty(value = "FID编号")
private java.lang.String fid;
/**批次号*/
@Excel(name = "批次号", width = 15)
@ApiModelProperty(value = "批次号")
private java.lang.String batchNumber;
/**框数*/
@Excel(name = "框数", width = 15)
@ApiModelProperty(value = "框数")
private java.lang.Integer number;
/**型号表编号*/
@Excel(name = "型号表编号", width = 15)
@ApiModelProperty(value = "型号表编号")
private java.lang.Integer typeid;
/**绑定时间*/
@Excel(name = "绑定时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "绑定时间")
private java.util.Date bindTime;
/**描述*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述")
private java.lang.String description;
/**记录的创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的创建时间")
private java.util.Date createTime;
/**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin")
private java.lang.String createBy;
/**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的修改时间")
private java.util.Date updateTime;
/**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private java.lang.String updateBy;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.ttwaterwayfid.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.ttwaterwayfid.entity.TtWaterwayFid;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tt_waterway_fid
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface TtWaterwayFidMapper extends BaseMapper<TtWaterwayFid> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttwaterwayfid.mapper.TtWaterwayFidMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.ttwaterwayfid.service;
import org.jeecg.modules.demo.ttwaterwayfid.entity.TtWaterwayFid;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: tt_waterway_fid
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface ITtWaterwayFidService extends IService<TtWaterwayFid> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.ttwaterwayfid.service.impl;
import org.jeecg.modules.demo.ttwaterwayfid.entity.TtWaterwayFid;
import org.jeecg.modules.demo.ttwaterwayfid.mapper.TtWaterwayFidMapper;
import org.jeecg.modules.demo.ttwaterwayfid.service.ITtWaterwayFidService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tt_waterway_fid
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Service
public class TtWaterwayFidServiceImpl extends ServiceImpl<TtWaterwayFidMapper, TtWaterwayFid> implements ITtWaterwayFidService {
}

@ -0,0 +1,204 @@
<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- -END -->
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_fid')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<!-- -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/></a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-fid-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-fid-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayFidModal from './modules/TtWaterwayFidModal'
export default {
name: 'TtWaterwayFidList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayFidModal
},
data () {
return {
description: 'tt_waterway_fid',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'FID',
align:"center",
dataIndex: 'fid'
},
{
title:'',
align:"center",
dataIndex: 'batchNumber'
},
{
title:'',
align:"center",
dataIndex: 'number'
},
{
title:'',
align:"center",
dataIndex: 'typeid'
},
{
title:'',
align:"center",
dataIndex: 'bindTime',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'',
align:"center",
dataIndex: 'description'
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwayfid/ttWaterwayFid/list",
delete: "/ttwaterwayfid/ttWaterwayFid/delete",
deleteBatch: "/ttwaterwayfid/ttWaterwayFid/deleteBatch",
exportXlsUrl: "/ttwaterwayfid/ttWaterwayFid/exportXls",
importExcelUrl: "ttwaterwayfid/ttWaterwayFid/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'fid',text:'FID'})
fieldList.push({type:'string',value:'batchNumber',text:''})
fieldList.push({type:'int',value:'number',text:''})
fieldList.push({type:'int',value:'typeid',text:''})
fieldList.push({type:'date',value:'bindTime',text:''})
fieldList.push({type:'string',value:'description',text:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttwaterwayfid
-- sqlcomponent
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309186230120', NULL, 'tt_waterway_fid', '/ttwaterwayfid/ttWaterwayFidList', 'ttwaterwayfid/TtWaterwayFidList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0);
-- sql
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230121', '2023041309186230120', 'tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230122', '2023041309186230120', 'tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230123', '2023041309186230120', 'tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230124', '2023041309186230120', 'tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230125', '2023041309186230120', 'excel_tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309186230126', '2023041309186230120', 'excel_tt_waterway_fid', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayfid:tt_waterway_fid:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:18:12', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,129 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="FID编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fid">
<a-input v-model="model.fid" placeholder="请输入FID编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
<a-input v-model="model.batchNumber" placeholder="请输入批次号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="框数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
<a-input-number v-model="model.number" placeholder="请输入框数" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号表编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeid">
<a-input-number v-model="model.typeid" placeholder="请输入型号表编号" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="绑定时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bindTime">
<j-date placeholder="请选择绑定时间" v-model="model.bindTime" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-input v-model="model.description" placeholder="请输入描述" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayFidForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwayfid/ttWaterwayFid/add",
edit: "/ttwaterwayfid/ttWaterwayFid/edit",
queryById: "/ttwaterwayfid/ttWaterwayFid/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-fid-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-fid-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;"></a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayFidForm from './TtWaterwayFidForm'
export default {
name: 'TtWaterwayFidModal',
components: {
TtWaterwayFidForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-fid-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-fid-form>
</j-modal>
</template>
<script>
import TtWaterwayFidForm from './TtWaterwayFidForm'
export default {
name: 'TtWaterwayFidModal',
components: {
TtWaterwayFidForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,178 @@
package org.jeecg.modules.demo.ttwaterwaymessage.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.ttwaterwaymessage.entity.TtWaterwayMessage;
import org.jeecg.modules.demo.ttwaterwaymessage.service.ITtWaterwayMessageService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: tt_waterway_message
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Api(tags="tt_waterway_message")
@RestController
@RequestMapping("/ttwaterwaymessage/ttWaterwayMessage")
@Slf4j
public class TtWaterwayMessageController extends JeecgController<TtWaterwayMessage, ITtWaterwayMessageService> {
@Autowired
private ITtWaterwayMessageService ttWaterwayMessageService;
/**
*
*
* @param ttWaterwayMessage
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tt_waterway_message-分页列表查询")
@ApiOperation(value="tt_waterway_message-分页列表查询", notes="tt_waterway_message-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TtWaterwayMessage>> queryPageList(TtWaterwayMessage ttWaterwayMessage,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtWaterwayMessage> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayMessage, req.getParameterMap());
Page<TtWaterwayMessage> page = new Page<TtWaterwayMessage>(pageNo, pageSize);
IPage<TtWaterwayMessage> pageList = ttWaterwayMessageService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param ttWaterwayMessage
* @return
*/
@AutoLog(value = "tt_waterway_message-添加")
@ApiOperation(value="tt_waterway_message-添加", notes="tt_waterway_message-添加")
//@RequiresPermissions("ttwaterwaymessage:tt_waterway_message:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtWaterwayMessage ttWaterwayMessage) {
ttWaterwayMessageService.save(ttWaterwayMessage);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttWaterwayMessage
* @return
*/
@AutoLog(value = "tt_waterway_message-编辑")
@ApiOperation(value="tt_waterway_message-编辑", notes="tt_waterway_message-编辑")
//@RequiresPermissions("ttwaterwaymessage:tt_waterway_message:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtWaterwayMessage ttWaterwayMessage) {
ttWaterwayMessageService.updateById(ttWaterwayMessage);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "tt_waterway_message-通过id删除")
@ApiOperation(value="tt_waterway_message-通过id删除", notes="tt_waterway_message-通过id删除")
//@RequiresPermissions("ttwaterwaymessage:tt_waterway_message:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttWaterwayMessageService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "tt_waterway_message-批量删除")
@ApiOperation(value="tt_waterway_message-批量删除", notes="tt_waterway_message-批量删除")
//@RequiresPermissions("ttwaterwaymessage:tt_waterway_message:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttWaterwayMessageService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "tt_waterway_message-通过id查询")
@ApiOperation(value="tt_waterway_message-通过id查询", notes="tt_waterway_message-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtWaterwayMessage> queryById(@RequestParam(name="id",required=true) String id) {
TtWaterwayMessage ttWaterwayMessage = ttWaterwayMessageService.getById(id);
if(ttWaterwayMessage==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttWaterwayMessage);
}
/**
* excel
*
* @param request
* @param ttWaterwayMessage
*/
//@RequiresPermissions("ttwaterwaymessage:tt_waterway_message:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtWaterwayMessage ttWaterwayMessage) {
return super.exportXls(request, ttWaterwayMessage, TtWaterwayMessage.class, "tt_waterway_message");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttwaterwaymessage:tt_waterway_message:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtWaterwayMessage.class);
}
}

@ -0,0 +1,65 @@
package org.jeecg.modules.demo.ttwaterwaymessage.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tt_waterway_message
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Data
@TableName("tt_waterway_message")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tt_waterway_message对象", description="tt_waterway_message")
public class TtWaterwayMessage implements Serializable {
private static final long serialVersionUID = 1L;
/**主键编号*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键编号")
private java.lang.Integer id;
/**报警信息内容*/
@Excel(name = "报警信息内容", width = 15)
@ApiModelProperty(value = "报警信息内容")
private java.lang.String message;
/**报警时间*/
@Excel(name = "报警时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "报警时间")
private java.util.Date time;
/**记录的创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的创建时间")
private java.util.Date createTime;
/**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin")
private java.lang.String createBy;
/**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的修改时间")
private java.util.Date updateTime;
/**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private java.lang.String updateBy;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.ttwaterwaymessage.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.ttwaterwaymessage.entity.TtWaterwayMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tt_waterway_message
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface TtWaterwayMessageMapper extends BaseMapper<TtWaterwayMessage> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttwaterwaymessage.mapper.TtWaterwayMessageMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.ttwaterwaymessage.service;
import org.jeecg.modules.demo.ttwaterwaymessage.entity.TtWaterwayMessage;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: tt_waterway_message
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface ITtWaterwayMessageService extends IService<TtWaterwayMessage> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.ttwaterwaymessage.service.impl;
import org.jeecg.modules.demo.ttwaterwaymessage.entity.TtWaterwayMessage;
import org.jeecg.modules.demo.ttwaterwaymessage.mapper.TtWaterwayMessageMapper;
import org.jeecg.modules.demo.ttwaterwaymessage.service.ITtWaterwayMessageService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tt_waterway_message
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Service
public class TtWaterwayMessageServiceImpl extends ServiceImpl<TtWaterwayMessageMapper, TtWaterwayMessage> implements ITtWaterwayMessageService {
}

@ -0,0 +1,180 @@
<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- -END -->
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_message')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<!-- -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/></a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-message-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-message-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayMessageModal from './modules/TtWaterwayMessageModal'
export default {
name: 'TtWaterwayMessageList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayMessageModal
},
data () {
return {
description: 'tt_waterway_message',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'',
align:"center",
dataIndex: 'message'
},
{
title:'',
align:"center",
dataIndex: 'time',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwaymessage/ttWaterwayMessage/list",
delete: "/ttwaterwaymessage/ttWaterwayMessage/delete",
deleteBatch: "/ttwaterwaymessage/ttWaterwayMessage/deleteBatch",
exportXlsUrl: "/ttwaterwaymessage/ttWaterwayMessage/exportXls",
importExcelUrl: "ttwaterwaymessage/ttWaterwayMessage/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'message',text:''})
fieldList.push({type:'date',value:'time',text:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttwaterwaymessage
-- sqlcomponent
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309161110410', NULL, 'tt_waterway_message', '/ttwaterwaymessage/ttWaterwayMessageList', 'ttwaterwaymessage/TtWaterwayMessageList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0);
-- sql
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110411', '2023041309161110410', 'tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110412', '2023041309161110410', 'tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110413', '2023041309161110410', 'tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110414', '2023041309161110410', 'tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110415', '2023041309161110410', 'excel_tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309161110416', '2023041309161110410', 'excel_tt_waterway_message', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaymessage:tt_waterway_message:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:16:41', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,109 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="报警信息内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="message">
<a-textarea v-model="model.message" rows="4" placeholder="请输入报警信息内容" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="报警时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
<j-date placeholder="请选择报警时间" v-model="model.time" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayMessageForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaymessage/ttWaterwayMessage/add",
edit: "/ttwaterwaymessage/ttWaterwayMessage/edit",
queryById: "/ttwaterwaymessage/ttWaterwayMessage/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-message-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-message-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;"></a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayMessageForm from './TtWaterwayMessageForm'
export default {
name: 'TtWaterwayMessageModal',
components: {
TtWaterwayMessageForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-message-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-message-form>
</j-modal>
</template>
<script>
import TtWaterwayMessageForm from './TtWaterwayMessageForm'
export default {
name: 'TtWaterwayMessageModal',
components: {
TtWaterwayMessageForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,178 @@
package org.jeecg.modules.demo.ttwaterwayoutenter.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.ttwaterwayoutenter.entity.TtWaterwayOutenter;
import org.jeecg.modules.demo.ttwaterwayoutenter.service.ITtWaterwayOutenterService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: tt_waterway_outenter
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Api(tags="tt_waterway_outenter")
@RestController
@RequestMapping("/ttwaterwayoutenter/ttWaterwayOutenter")
@Slf4j
public class TtWaterwayOutenterController extends JeecgController<TtWaterwayOutenter, ITtWaterwayOutenterService> {
@Autowired
private ITtWaterwayOutenterService ttWaterwayOutenterService;
/**
*
*
* @param ttWaterwayOutenter
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tt_waterway_outenter-分页列表查询")
@ApiOperation(value="tt_waterway_outenter-分页列表查询", notes="tt_waterway_outenter-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TtWaterwayOutenter>> queryPageList(TtWaterwayOutenter ttWaterwayOutenter,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtWaterwayOutenter> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayOutenter, req.getParameterMap());
Page<TtWaterwayOutenter> page = new Page<TtWaterwayOutenter>(pageNo, pageSize);
IPage<TtWaterwayOutenter> pageList = ttWaterwayOutenterService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param ttWaterwayOutenter
* @return
*/
@AutoLog(value = "tt_waterway_outenter-添加")
@ApiOperation(value="tt_waterway_outenter-添加", notes="tt_waterway_outenter-添加")
//@RequiresPermissions("ttwaterwayoutenter:tt_waterway_outenter:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtWaterwayOutenter ttWaterwayOutenter) {
ttWaterwayOutenterService.save(ttWaterwayOutenter);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttWaterwayOutenter
* @return
*/
@AutoLog(value = "tt_waterway_outenter-编辑")
@ApiOperation(value="tt_waterway_outenter-编辑", notes="tt_waterway_outenter-编辑")
//@RequiresPermissions("ttwaterwayoutenter:tt_waterway_outenter:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtWaterwayOutenter ttWaterwayOutenter) {
ttWaterwayOutenterService.updateById(ttWaterwayOutenter);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "tt_waterway_outenter-通过id删除")
@ApiOperation(value="tt_waterway_outenter-通过id删除", notes="tt_waterway_outenter-通过id删除")
//@RequiresPermissions("ttwaterwayoutenter:tt_waterway_outenter:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttWaterwayOutenterService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "tt_waterway_outenter-批量删除")
@ApiOperation(value="tt_waterway_outenter-批量删除", notes="tt_waterway_outenter-批量删除")
//@RequiresPermissions("ttwaterwayoutenter:tt_waterway_outenter:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttWaterwayOutenterService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "tt_waterway_outenter-通过id查询")
@ApiOperation(value="tt_waterway_outenter-通过id查询", notes="tt_waterway_outenter-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtWaterwayOutenter> queryById(@RequestParam(name="id",required=true) String id) {
TtWaterwayOutenter ttWaterwayOutenter = ttWaterwayOutenterService.getById(id);
if(ttWaterwayOutenter==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttWaterwayOutenter);
}
/**
* excel
*
* @param request
* @param ttWaterwayOutenter
*/
//@RequiresPermissions("ttwaterwayoutenter:tt_waterway_outenter:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtWaterwayOutenter ttWaterwayOutenter) {
return super.exportXls(request, ttWaterwayOutenter, TtWaterwayOutenter.class, "tt_waterway_outenter");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttwaterwayoutenter:tt_waterway_outenter:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtWaterwayOutenter.class);
}
}

@ -0,0 +1,77 @@
package org.jeecg.modules.demo.ttwaterwayoutenter.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tt_waterway_outenter
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Data
@TableName("tt_waterway_outenter")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tt_waterway_outenter对象", description="tt_waterway_outenter")
public class TtWaterwayOutenter implements Serializable {
private static final long serialVersionUID = 1L;
/**主键编号*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键编号")
private java.lang.Integer id;
/**FID*/
@Excel(name = "FID", width = 15)
@ApiModelProperty(value = "FID")
private java.lang.String fid;
/**入水时间*/
@Excel(name = "入水时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "入水时间")
private java.util.Date waterEnter;
/**预热时间*/
@Excel(name = "预热时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "预热时间")
private java.util.Date waterYure;
/**出水时间*/
@Excel(name = "出水时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "出水时间")
private java.util.Date waterOut;
/**记录的创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的创建时间")
private java.util.Date createTime;
/**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin")
private java.lang.String createBy;
/**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的修改时间")
private java.util.Date updateTime;
/**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private java.lang.String updateBy;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.ttwaterwayoutenter.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.ttwaterwayoutenter.entity.TtWaterwayOutenter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tt_waterway_outenter
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface TtWaterwayOutenterMapper extends BaseMapper<TtWaterwayOutenter> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttwaterwayoutenter.mapper.TtWaterwayOutenterMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.ttwaterwayoutenter.service;
import org.jeecg.modules.demo.ttwaterwayoutenter.entity.TtWaterwayOutenter;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: tt_waterway_outenter
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface ITtWaterwayOutenterService extends IService<TtWaterwayOutenter> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.ttwaterwayoutenter.service.impl;
import org.jeecg.modules.demo.ttwaterwayoutenter.entity.TtWaterwayOutenter;
import org.jeecg.modules.demo.ttwaterwayoutenter.mapper.TtWaterwayOutenterMapper;
import org.jeecg.modules.demo.ttwaterwayoutenter.service.ITtWaterwayOutenterService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tt_waterway_outenter
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Service
public class TtWaterwayOutenterServiceImpl extends ServiceImpl<TtWaterwayOutenterMapper, TtWaterwayOutenter> implements ITtWaterwayOutenterService {
}

@ -0,0 +1,198 @@
<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- -END -->
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_waterway_outenter')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<!-- -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/></a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-waterway-outenter-modal ref="modalForm" @ok="modalFormOk"></tt-waterway-outenter-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayOutenterModal from './modules/TtWaterwayOutenterModal'
export default {
name: 'TtWaterwayOutenterList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtWaterwayOutenterModal
},
data () {
return {
description: 'tt_waterway_outenter',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'FID',
align:"center",
dataIndex: 'fid'
},
{
title:'',
align:"center",
dataIndex: 'waterEnter',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'',
align:"center",
dataIndex: 'waterYure',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'',
align:"center",
dataIndex: 'waterOut',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttwaterwayoutenter/ttWaterwayOutenter/list",
delete: "/ttwaterwayoutenter/ttWaterwayOutenter/delete",
deleteBatch: "/ttwaterwayoutenter/ttWaterwayOutenter/deleteBatch",
exportXlsUrl: "/ttwaterwayoutenter/ttWaterwayOutenter/exportXls",
importExcelUrl: "ttwaterwayoutenter/ttWaterwayOutenter/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'fid',text:'FID'})
fieldList.push({type:'date',value:'waterEnter',text:''})
fieldList.push({type:'date',value:'waterYure',text:''})
fieldList.push({type:'date',value:'waterOut',text:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttwaterwayoutenter
-- sqlcomponent
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041309173610490', NULL, 'tt_waterway_outenter', '/ttwaterwayoutenter/ttWaterwayOutenterList', 'ttwaterwayoutenter/TtWaterwayOutenterList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0);
-- sql
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610491', '2023041309173610490', 'tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610492', '2023041309173610490', 'tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610493', '2023041309173610490', 'tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610494', '2023041309173610490', 'tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173610495', '2023041309173610490', 'excel_tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041309173620496', '2023041309173610490', 'excel_tt_waterway_outenter', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwayoutenter:tt_waterway_outenter:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 09:17:49', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,119 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="FID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fid">
<a-input v-model="model.fid" placeholder="请输入FID" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="入水时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="waterEnter">
<j-date placeholder="请选择入水时间" v-model="model.waterEnter" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="预热时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="waterYure">
<j-date placeholder="请选择预热时间" v-model="model.waterYure" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="出水时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="waterOut">
<j-date placeholder="请选择出水时间" v-model="model.waterOut" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtWaterwayOutenterForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwayoutenter/ttWaterwayOutenter/add",
edit: "/ttwaterwayoutenter/ttWaterwayOutenter/edit",
queryById: "/ttwaterwayoutenter/ttWaterwayOutenter/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-waterway-outenter-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-waterway-outenter-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;"></a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtWaterwayOutenterForm from './TtWaterwayOutenterForm'
export default {
name: 'TtWaterwayOutenterModal',
components: {
TtWaterwayOutenterForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-waterway-outenter-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-waterway-outenter-form>
</j-modal>
</template>
<script>
import TtWaterwayOutenterForm from './TtWaterwayOutenterForm'
export default {
name: 'TtWaterwayOutenterModal',
components: {
TtWaterwayOutenterForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,284 @@
package org.jeecg.modules.demo.ttwaterwaytype.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.demo.ttwaterwaytype.entity.TtWaterwayType;
import org.jeecg.modules.demo.ttwaterwaytype.service.ITtWaterwayTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description:
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Api(tags="型号管理")
@RestController
@RequestMapping("/ttwaterwaytype/ttWaterwayType")
@Slf4j
public class TtWaterwayTypeController extends JeecgController<TtWaterwayType, ITtWaterwayTypeService>{
@Autowired
private ITtWaterwayTypeService ttWaterwayTypeService;
/**
*
*
* @param ttWaterwayType
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "型号管理-分页列表查询")
@ApiOperation(value="型号管理-分页列表查询", notes="型号管理-分页列表查询")
@GetMapping(value = "/rootList")
public Result<IPage<TtWaterwayType>> queryPageList(TtWaterwayType ttWaterwayType,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
String hasQuery = req.getParameter("hasQuery");
if(hasQuery != null && "true".equals(hasQuery)){
QueryWrapper<TtWaterwayType> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayType, req.getParameterMap());
List<TtWaterwayType> list = ttWaterwayTypeService.queryTreeListNoPage(queryWrapper);
IPage<TtWaterwayType> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}else{
String parentId = String.valueOf(ttWaterwayType.getParentid());
if (oConvertUtils.isEmpty(parentId)) {
parentId = "0";
}
ttWaterwayType.setParentid(null);
QueryWrapper<TtWaterwayType> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayType, req.getParameterMap());
// 使用 eq 防止模糊查询
queryWrapper.eq("parentid", parentId);
Page<TtWaterwayType> page = new Page<TtWaterwayType>(pageNo, pageSize);
IPage<TtWaterwayType> pageList = ttWaterwayTypeService.page(page, queryWrapper);
return Result.OK(pageList);
}
}
/**
* vue3
*
* @param pid
* @return
*/
@RequestMapping(value = "/loadTreeChildren", method = RequestMethod.GET)
public Result<List<SelectTreeModel>> loadTreeChildren(@RequestParam(name = "pid") String pid) {
Result<List<SelectTreeModel>> result = new Result<>();
try {
List<SelectTreeModel> ls = ttWaterwayTypeService.queryListByPid(pid);
result.setResult(ls);
result.setSuccess(true);
} catch (Exception e) {
e.printStackTrace();
result.setMessage(e.getMessage());
result.setSuccess(false);
}
return result;
}
/**
* vue3/
*
* @param async
* @param pcode
* @return
*/
@RequestMapping(value = "/loadTreeRoot", method = RequestMethod.GET)
public Result<List<SelectTreeModel>> loadTreeRoot(@RequestParam(name = "async") Boolean async, @RequestParam(name = "pcode") String pcode) {
Result<List<SelectTreeModel>> result = new Result<>();
try {
List<SelectTreeModel> ls = ttWaterwayTypeService.queryListByCode(pcode);
if (!async) {
loadAllChildren(ls);
}
result.setResult(ls);
result.setSuccess(true);
} catch (Exception e) {
e.printStackTrace();
result.setMessage(e.getMessage());
result.setSuccess(false);
}
return result;
}
/**
* vue3
*
* @param ls
*/
private void loadAllChildren(List<SelectTreeModel> ls) {
for (SelectTreeModel tsm : ls) {
List<SelectTreeModel> temp = ttWaterwayTypeService.queryListByPid(tsm.getKey());
if (temp != null && temp.size() > 0) {
tsm.setChildren(temp);
loadAllChildren(temp);
}
}
}
/**
*
* @param ttWaterwayType
* @param req
* @return
*/
//@AutoLog(value = "型号管理-获取子数据")
@ApiOperation(value="型号管理-获取子数据", notes="型号管理-获取子数据")
@GetMapping(value = "/childList")
public Result<IPage<TtWaterwayType>> queryPageList(TtWaterwayType ttWaterwayType,HttpServletRequest req) {
QueryWrapper<TtWaterwayType> queryWrapper = QueryGenerator.initQueryWrapper(ttWaterwayType, req.getParameterMap());
List<TtWaterwayType> list = ttWaterwayTypeService.list(queryWrapper);
IPage<TtWaterwayType> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}
/**
*
* @param parentIds ID
* @return IPage
* @param parentIds
* @return
*/
//@AutoLog(value = "型号管理-批量获取子数据")
@ApiOperation(value="型号管理-批量获取子数据", notes="型号管理-批量获取子数据")
@GetMapping("/getChildListBatch")
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
try {
QueryWrapper<TtWaterwayType> queryWrapper = new QueryWrapper<>();
List<String> parentIdList = Arrays.asList(parentIds.split(","));
queryWrapper.in("parentid", parentIdList);
List<TtWaterwayType> list = ttWaterwayTypeService.list(queryWrapper);
IPage<TtWaterwayType> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
} catch (Exception e) {
log.error(e.getMessage(), e);
return Result.error("批量查询子节点失败:" + e.getMessage());
}
}
/**
*
*
* @param ttWaterwayType
* @return
*/
@AutoLog(value = "型号管理-添加")
@ApiOperation(value="型号管理-添加", notes="型号管理-添加")
//@RequiresPermissions("ttwaterwaytype:tt_waterway_type:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtWaterwayType ttWaterwayType) {
ttWaterwayTypeService.addTtWaterwayType(ttWaterwayType);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttWaterwayType
* @return
*/
@AutoLog(value = "型号管理-编辑")
@ApiOperation(value="型号管理-编辑", notes="型号管理-编辑")
//@RequiresPermissions("ttwaterwaytype:tt_waterway_type:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtWaterwayType ttWaterwayType) {
ttWaterwayTypeService.updateTtWaterwayType(ttWaterwayType);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "型号管理-通过id删除")
@ApiOperation(value="型号管理-通过id删除", notes="型号管理-通过id删除")
//@RequiresPermissions("ttwaterwaytype:tt_waterway_type:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttWaterwayTypeService.deleteTtWaterwayType(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "型号管理-批量删除")
@ApiOperation(value="型号管理-批量删除", notes="型号管理-批量删除")
//@RequiresPermissions("ttwaterwaytype:tt_waterway_type:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttWaterwayTypeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "型号管理-通过id查询")
@ApiOperation(value="型号管理-通过id查询", notes="型号管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtWaterwayType> queryById(@RequestParam(name="id",required=true) String id) {
TtWaterwayType ttWaterwayType = ttWaterwayTypeService.getById(id);
if(ttWaterwayType==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttWaterwayType);
}
/**
* excel
*
* @param request
* @param ttWaterwayType
*/
//@RequiresPermissions("ttwaterwaytype:tt_waterway_type:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtWaterwayType ttWaterwayType) {
return super.exportXls(request, ttWaterwayType, TtWaterwayType.class, "型号管理");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttwaterwaytype:tt_waterway_type:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtWaterwayType.class);
}
}

@ -0,0 +1,73 @@
package org.jeecg.modules.demo.ttwaterwaytype.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description:
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Data
@TableName("tt_waterway_type")
@ApiModel(value="tt_waterway_type对象", description="型号管理")
public class TtWaterwayType implements Serializable {
private static final long serialVersionUID = 1L;
/**型号表编号*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "型号表编号")
private java.lang.Integer id;
/**分类类别名称*/
@Excel(name = "分类类别名称", width = 15)
@ApiModelProperty(value = "分类类别名称")
private java.lang.String name;
/**父级分类*/
@Excel(name = "父级分类", width = 15)
@ApiModelProperty(value = "父级分类")
private java.lang.Integer parentid;
/**深度从1递增*/
@Excel(name = "深度从1递增", width = 15)
@ApiModelProperty(value = "深度从1递增")
private java.lang.Integer depth;
/**状态: 0禁用1启用*/
@Excel(name = "状态: 0禁用1启用", width = 15, dicCode = "status")
@Dict(dicCode = "status")
@ApiModelProperty(value = "状态: 0禁用1启用")
private java.lang.Integer status;
/**优先级,越大,同级显示的时候越靠前*/
@Excel(name = "优先级,越大,同级显示的时候越靠前", width = 15)
@ApiModelProperty(value = "优先级,越大,同级显示的时候越靠前")
private java.lang.Integer priority;
/**记录的创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的创建时间")
private java.util.Date createTime;
/**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin")
private java.lang.String createBy;
/**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的修改时间")
private java.util.Date updateTime;
/**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private java.lang.String updateBy;
/**是否有子节点*/
@Excel(name = "是否有子节点", width = 15)
@ApiModelProperty(value = "是否有子节点")
private java.lang.String hasChild;
}

@ -0,0 +1,35 @@
package org.jeecg.modules.demo.ttwaterwaytype.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.demo.ttwaterwaytype.entity.TtWaterwayType;
import java.util.List;
import java.util.Map;
/**
* @Description:
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface TtWaterwayTypeMapper extends BaseMapper<TtWaterwayType> {
/**
*
* @param id
* @param status
*/
void updateTreeNodeStatus(@Param("id") String id,@Param("status") String status);
/**
* vue3ID
*
* @param pid
* @param query
* @return
*/
List<SelectTreeModel> queryListByPid(@Param("pid") String pid, @Param("query") Map<String, String> query);
}

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttwaterwaytype.mapper.TtWaterwayTypeMapper">
<update id="updateTreeNodeStatus" parameterType="java.lang.String">
update tt_waterway_type set has_child = #{status} where id = #{id}
</update>
<!-- 【vue3专用】 -->
<select id="queryListByPid" parameterType="java.lang.Object" resultType="org.jeecg.common.system.vo.SelectTreeModel">
select
id as "key",
name as "title",
(case when has_child = '1' then 0 else 1 end) as isLeaf,
parentid as parentId
from tt_waterway_type
where parentid = #{pid}
<if test="query != null">
<foreach collection="query.entrySet()" item="value" index="key">
and ${key} = #{value}
</foreach>
</if>
</select>
</mapper>

@ -0,0 +1,74 @@
package org.jeecg.modules.demo.ttwaterwaytype.service;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.demo.ttwaterwaytype.entity.TtWaterwayType;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
/**
* @Description:
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
public interface ITtWaterwayTypeService extends IService<TtWaterwayType> {
/**根节点父ID的值*/
public static final String ROOT_PID_VALUE = "0";
/**树节点有子节点状态值*/
public static final String HASCHILD = "1";
/**树节点无子节点状态值*/
public static final String NOCHILD = "0";
/**
*
*
* @param ttWaterwayType
*/
void addTtWaterwayType(TtWaterwayType ttWaterwayType);
/**
*
*
* @param ttWaterwayType
* @throws JeecgBootException
*/
void updateTtWaterwayType(TtWaterwayType ttWaterwayType) throws JeecgBootException;
/**
*
*
* @param id
* @throws JeecgBootException
*/
void deleteTtWaterwayType(String id) throws JeecgBootException;
/**
*
*
* @param queryWrapper
* @return List<TtWaterwayType>
*/
List<TtWaterwayType> queryTreeListNoPage(QueryWrapper<TtWaterwayType> queryWrapper);
/**
* vue3
*
* @param parentCode
* @return
*/
List<SelectTreeModel> queryListByCode(String parentCode);
/**
* vue3pid
*
* @param pid
* @return
*/
List<SelectTreeModel> queryListByPid(String pid);
}

@ -0,0 +1,220 @@
package org.jeecg.modules.demo.ttwaterwaytype.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.demo.ttwaterwaytype.entity.TtWaterwayType;
import org.jeecg.modules.demo.ttwaterwaytype.mapper.TtWaterwayTypeMapper;
import org.jeecg.modules.demo.ttwaterwaytype.service.ITtWaterwayTypeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description:
* @Author: jeecg-boot
* @Date: 2023-04-13
* @Version: V1.0
*/
@Service
public class TtWaterwayTypeServiceImpl extends ServiceImpl<TtWaterwayTypeMapper, TtWaterwayType> implements ITtWaterwayTypeService {
@Override
public void addTtWaterwayType(TtWaterwayType ttWaterwayType) {
//新增时设置hasChild为0
ttWaterwayType.setHasChild(ITtWaterwayTypeService.NOCHILD);
if(oConvertUtils.isEmpty(ttWaterwayType.getParentid())){
ttWaterwayType.setParentid(Integer.valueOf(ITtWaterwayTypeService.ROOT_PID_VALUE));
}else{
//如果当前节点父ID不为空 则设置父节点的hasChildren 为1
TtWaterwayType parent = baseMapper.selectById(ttWaterwayType.getParentid());
if(parent!=null && !"1".equals(parent.getHasChild())){
parent.setHasChild("1");
baseMapper.updateById(parent);
}
}
System.out.println(ttWaterwayType);
baseMapper.insert(ttWaterwayType);
}
@Override
public void updateTtWaterwayType(TtWaterwayType ttWaterwayType) {
TtWaterwayType entity = this.getById(ttWaterwayType.getId());
if(entity==null) {
throw new JeecgBootException("未找到对应实体");
}
String old_pid = String.valueOf(entity.getParentid());
String new_pid = String.valueOf(ttWaterwayType.getParentid());
if(!old_pid.equals(new_pid)) {
updateOldParentNode(old_pid);
if(oConvertUtils.isEmpty(new_pid)){
ttWaterwayType.setParentid(Integer.valueOf(ITtWaterwayTypeService.ROOT_PID_VALUE));
}
if(!ITtWaterwayTypeService.ROOT_PID_VALUE.equals(ttWaterwayType.getParentid())) {
baseMapper.updateTreeNodeStatus(String.valueOf(ttWaterwayType.getParentid()), ITtWaterwayTypeService.HASCHILD);
}
}
baseMapper.updateById(ttWaterwayType);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteTtWaterwayType(String id) throws JeecgBootException {
//查询选中节点下所有子节点一并删除
id = this.queryTreeChildIds(id);
if(id.indexOf(",")>0) {
StringBuffer sb = new StringBuffer();
String[] idArr = id.split(",");
for (String idVal : idArr) {
if(idVal != null){
TtWaterwayType ttWaterwayType = this.getById(idVal);
String pidVal = String.valueOf(ttWaterwayType.getParentid());
//查询此节点上一级是否还有其他子节点
List<TtWaterwayType> dataList = baseMapper.selectList(new QueryWrapper<TtWaterwayType>().eq("parentid", pidVal).notIn("id",Arrays.asList(idArr)));
boolean flag = (dataList == null || dataList.size() == 0) && !Arrays.asList(idArr).contains(pidVal) && !sb.toString().contains(pidVal);
if(flag){
//如果当前节点原本有子节点 现在木有了,更新状态
sb.append(pidVal).append(",");
}
}
}
//批量删除节点
baseMapper.deleteBatchIds(Arrays.asList(idArr));
//修改已无子节点的标识
String[] pidArr = sb.toString().split(",");
for(String pid : pidArr){
this.updateOldParentNode(pid);
}
}else{
TtWaterwayType ttWaterwayType = this.getById(id);
if(ttWaterwayType==null) {
throw new JeecgBootException("未找到对应实体");
}
updateOldParentNode(String.valueOf(ttWaterwayType.getParentid()));
baseMapper.deleteById(id);
}
}
@Override
public List<TtWaterwayType> queryTreeListNoPage(QueryWrapper<TtWaterwayType> queryWrapper) {
List<TtWaterwayType> dataList = baseMapper.selectList(queryWrapper);
List<TtWaterwayType> mapList = new ArrayList<>();
for(TtWaterwayType data : dataList){
String pidVal = String.valueOf(data.getParentid());
//递归查询子节点的根节点
if(pidVal != null && !ITtWaterwayTypeService.NOCHILD.equals(pidVal)){
TtWaterwayType rootVal = this.getTreeRoot(pidVal);
if(rootVal != null && !mapList.contains(rootVal)){
mapList.add(rootVal);
}
}else{
if(!mapList.contains(data)){
mapList.add(data);
}
}
}
return mapList;
}
@Override
public List<SelectTreeModel> queryListByCode(String parentCode) {
String pid = ROOT_PID_VALUE;
if (oConvertUtils.isNotEmpty(parentCode)) {
LambdaQueryWrapper<TtWaterwayType> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TtWaterwayType::getParentid, parentCode);
List<TtWaterwayType> list = baseMapper.selectList(queryWrapper);
if (list == null || list.size() == 0) {
throw new JeecgBootException("该编码【" + parentCode + "】不存在,请核实!");
}
if (list.size() > 1) {
throw new JeecgBootException("该编码【" + parentCode + "】存在多个,请核实!");
}
pid = String.valueOf(list.get(0).getId());
}
return baseMapper.queryListByPid(pid, null);
}
@Override
public List<SelectTreeModel> queryListByPid(String pid) {
if (oConvertUtils.isEmpty(pid)) {
pid = ROOT_PID_VALUE;
}
return baseMapper.queryListByPid(pid, null);
}
/**
* pid
* @param pid
*/
private void updateOldParentNode(String pid) {
if(!ITtWaterwayTypeService.ROOT_PID_VALUE.equals(pid)) {
Long count = baseMapper.selectCount(new QueryWrapper<TtWaterwayType>().eq("parentid", pid));
if(count==null || count<=1) {
baseMapper.updateTreeNodeStatus(pid, ITtWaterwayTypeService.NOCHILD);
}
}
}
/**
*
* @param pidVal
* @return
*/
private TtWaterwayType getTreeRoot(String pidVal){
TtWaterwayType data = baseMapper.selectById(pidVal);
if(data != null && !ITtWaterwayTypeService.ROOT_PID_VALUE.equals(data.getParentid())){
return this.getTreeRoot(String.valueOf(data.getParentid()));
}else{
return data;
}
}
/**
* idid
* @param ids
* @return
*/
private String queryTreeChildIds(String ids) {
//获取id数组
String[] idArr = ids.split(",");
StringBuffer sb = new StringBuffer();
for (String pidVal : idArr) {
if(pidVal != null){
if(!sb.toString().contains(pidVal)){
if(sb.toString().length() > 0){
sb.append(",");
}
sb.append(pidVal);
this.getTreeChildIds(pidVal,sb);
}
}
}
return sb.toString();
}
/**
*
* @param pidVal
* @param sb
* @return
*/
private StringBuffer getTreeChildIds(String pidVal,StringBuffer sb){
List<TtWaterwayType> dataList = baseMapper.selectList(new QueryWrapper<TtWaterwayType>().eq("parentid", pidVal));
if(dataList != null && dataList.size()>0){
for(TtWaterwayType tree : dataList) {
if(!sb.toString().contains(String.valueOf(tree.getId()))){
sb.append(",").append(tree.getId());
}
this.getTreeChildIds(String.valueOf(tree.getId()),sb);
}
}
return sb;
}
}

@ -0,0 +1,360 @@
<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- -END -->
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('型号管理')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<!-- -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/></a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@change="handleTableChange"
@expand="handleExpand"
v-bind="tableProps">
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleAddChild(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<ttWaterwayType-modal ref="modalForm" @ok="modalFormOk"></ttWaterwayType-modal>
</a-card>
</template>
<script>
import { getAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtWaterwayTypeModal from './modules/TtWaterwayTypeModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
export default {
name: "TtWaterwayTypeList",
mixins:[JeecgListMixin],
components: {
TtWaterwayTypeModal
},
data () {
return {
description: '',
// 表头
columns: [
{
title:'',
align:"left",
dataIndex: 'name'
},
{
title:'1',
align:"left",
dataIndex: 'depth'
},
{
title:': 01',
align:"left",
dataIndex: 'status_dictText'
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/ttwaterwaytype2/ttWaterwayType/rootList",
childList: "/ttwaterwaytype2/ttWaterwayType/childList",
getChildListBatch: "/ttwaterwaytype2/ttWaterwayType/getChildListBatch",
delete: "/ttwaterwaytype2/ttWaterwayType/delete",
deleteBatch: "/ttwaterwaytype2/ttWaterwayType/deleteBatch",
exportXlsUrl: "/ttwaterwaytype2/ttWaterwayType/exportXls",
importExcelUrl: "ttwaterwaytype2/ttWaterwayType/importExcel",
},
expandedRowKeys:[],
hasChildrenField:"hasChild",
pidField:"parentid",
dictOptions: {},
loadParent: false,
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
tableProps() {
let _this = this
return {
// 列表项是否可选择
rowSelection: {
selectedRowKeys: _this.selectedRowKeys,
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
}
}
}
},
methods: {
loadData(arg){
if(arg==1){
this.ipagination.current=1
}
this.loading = true
let params = this.getQueryParams()
params.hasQuery = 'true'
getAction(this.url.list,params).then(res=>{
if(res.success){
let result = res.result
if(Number(result.total)>0){
this.ipagination.total = Number(result.total)
this.dataSource = this.getDataByResult(res.result.records)
return this.loadDataByExpandedRows(this.dataSource)
}else{
this.ipagination.total=0
this.dataSource=[]
}
}else{
this.$message.warning(res.message)
}
}).finally(()=>{
this.loading = false
})
},
// 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据)
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{
if (res.success && res.result.records.length>0) {
//已展开的数据批量子节点
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item[this.pidField];
if (this.expandedRowKeys.join(',').includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
},
getQueryParams(arg) {
//获取查询条件
let sqp = {}
let param = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
if(arg){
param = Object.assign(sqp, this.isorter ,this.filters);
}else{
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
}
if(JSON.stringify(this.queryParam) === "{}" || arg){
param.hasQuery = 'false'
}else{
param.hasQuery = 'true'
}
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
searchReset() {
//重置
this.expandedRowKeys = []
this.queryParam = {}
this.loadData(1);
},
getDataByResult(result){
if(result){
return result.map(item=>{
//判断是否标记了带有子节点
if(item[this.hasChildrenField]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
},
handleExpand(expanded, record){
// 判断是否是展开状态
if (expanded) {
this.expandedRowKeys.push(record.id)
if (record.children.length>0 && record.children[0].isLoading === true) {
let params = this.getQueryParams(1);//查询条件
params[this.pidField] = record.id
params.hasQuery = 'false'
params.superQueryParams=""
getAction(this.url.childList,params).then((res)=>{
if(res.success){
if(res.result.records){
record.children = this.getDataByResult(res.result.records)
this.dataSource = [...this.dataSource]
}else{
record.children=''
record.hasChildrenField='0'
}
}else{
this.$message.warning(res.message)
}
})
}
}else{
let keyIndex = this.expandedRowKeys.indexOf(record.id)
if(keyIndex>=0){
this.expandedRowKeys.splice(keyIndex, 1);
}
}
},
handleAddChild(record){
this.loadParent = true
let obj = {}
obj[this.pidField] = record['id']
this.$refs.modalForm.add(obj);
},
handleDeleteNode(id) {
if(!this.url.delete){
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
that.loadData(1)
} else {
that.$message.warning(res.message);
}
});
},
batchDel(){
if(this.selectedRowKeys.length<=0){
this.$message.warning('');
return false;
}else{
let ids = "";
let that = this;
that.selectedRowKeys.forEach(function(val) {
ids+=val+",";
});
that.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
that.handleDeleteNode(ids)
that.onClearSelected();
}
});
}
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'name',text:'',dictCode:''})
fieldList.push({type:'int',value:'parentid',text:'',dictCode:''})
fieldList.push({type:'int',value:'depth',text:'1',dictCode:''})
fieldList.push({type:'int',value:'status',text:': 01',dictCode:'status'})
fieldList.push({type:'int',value:'priority',text:'',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttwaterwaytype2
-- sqlcomponent
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023041302469020260', NULL, '', '/ttwaterwaytype2/ttWaterwayTypeList', 'ttwaterwaytype2/TtWaterwayTypeList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0);
-- sql
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020261', '2023041302469020260', '', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020262', '2023041302469020260', '', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020263', '2023041302469020260', '', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020264', '2023041302469020260', '', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020265', '2023041302469020260', 'excel_', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023041302469020266', '2023041302469020260', 'excel_', NULL, NULL, 0, NULL, NULL, 2, 'ttwaterwaytype2:tt_waterway_type:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-04-13 14:46:26', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,163 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="分类类别名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入分类类别名称" ></a-input>
</a-form-model-item>
<a-form-model-item label="父级分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parentid">
<j-tree-select
ref="treeSelect"
placeholder="请选择父级分类"
v-model="model.parentid"
dict="tt_waterway_type,name,id"
pidField="parentid"
pidValue="0"
hasChildField="has_child"
>
</j-tree-select>
</a-form-model-item>
<a-form-model-item label="深度从1递增" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="depth">
<a-input-number v-model="model.depth" placeholder="请输入深度从1递增" style="width: 100%" />
</a-form-model-item>
<a-form-model-item label="状态: 0禁用1启用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag type="list" v-model="model.status" dictCode="status" placeholder="请选择状态: 0禁用1启用" />
</a-form-model-item>
<a-form-model-item label="优先级,越大,同级显示的时候越靠前" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority">
<a-input-number v-model="model.priority" placeholder="请输入优先级,越大,同级显示的时候越靠前" style="width: 100%" />
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: "TtWaterwayTypeModal",
components: {
},
data () {
return {
title:"操作",
width:800,
visible: false,
model:{
status:1,
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttwaterwaytype2/ttWaterwayType/add",
edit: "/ttwaterwaytype2/ttWaterwayType/edit",
},
expandedRowKeys:[],
pidField:"parentid"
}
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add (obj) {
this.modelDefault.parentid=''
this.edit(Object.assign(this.modelDefault , obj));
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate()
},
handleOk () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
if(this.model.id && this.model.id === this.model[this.pidField]){
that.$message.warning("父级节点不能选择自己");
that.confirmLoading = false;
return;
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
this.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false
}
})
},
handleCancel () {
this.close()
},
submitSuccess(formData,flag){
if(!formData.id){
let treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys=[]
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
this.$emit('ok',formData,this.expandedRowKeys.reverse());
}else{
this.$emit('ok',formData,flag);
}
},
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid){
this.expandedRowKeys.push(arr[i].key)
this.getExpandKeysByPid(arr[i]['parentId'],all,all)
}else{
this.getExpandKeysByPid(pid,arr[i].children,all)
}
}
}
}
}
}
</script>
Loading…
Cancel
Save