parent
e4f41bc4a1
commit
00ed74e234
@ -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,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,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,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,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,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,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>
|
@ -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,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,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,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,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,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,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,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,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,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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【vue3专用】根据父级ID查询树节点数据
|
||||||
|
*
|
||||||
|
* @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,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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询所有子节点id
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue