commit
dc94199a1e
19 changed files with 1348 additions and 58 deletions
@ -0,0 +1,210 @@ |
||||
<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="需求"> |
||||
<j-dict-select-tag placeholder="请选择需求" v-model="queryParam.requirementId" dictCode="requirement_item,requirement_name,id"/> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="名称"> |
||||
<a-input placeholder="请输入名称" v-model="queryParam.entityName"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="英文名称"> |
||||
<a-input placeholder="请输入英文名称" v-model="queryParam.entityEnName"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="实体状态"> |
||||
<j-dict-select-tag placeholder="请选择实体状态" v-model="queryParam.entityStatus" dictCode="entity_status"/> |
||||
</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('需求实体抽取管理')">导出</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> |
||||
|
||||
</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"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" 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 @click="handleDetail(record)">详情</a> |
||||
<a-divider type="vertical" /> |
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<requirement-entity-modal ref="modalForm" @ok="modalFormOk"></requirement-entity-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import RequirementEntityModal from './modules/RequirementEntityModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
|
||||
export default { |
||||
name: 'RequirementEntityList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
RequirementEntityModal |
||||
}, |
||||
data () { |
||||
return { |
||||
description: '需求实体抽取管理管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
}, |
||||
{ |
||||
title:'需求', |
||||
align:"center", |
||||
dataIndex: 'requirementId_dictText' |
||||
}, |
||||
{ |
||||
title:'名称', |
||||
align:"center", |
||||
dataIndex: 'entityName' |
||||
}, |
||||
{ |
||||
title:'英文名称', |
||||
align:"center", |
||||
dataIndex: 'entityEnName' |
||||
}, |
||||
{ |
||||
title:'实体描述', |
||||
align:"center", |
||||
dataIndex: 'entityDescribe', |
||||
scopedSlots: {customRender: 'htmlSlot'} |
||||
}, |
||||
{ |
||||
title:'实体状态', |
||||
align:"center", |
||||
dataIndex: 'entityStatus_dictText' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/requiremententity/requirementEntity/list", |
||||
delete: "/requiremententity/requirementEntity/delete", |
||||
deleteBatch: "/requiremententity/requirementEntity/deleteBatch", |
||||
exportXlsUrl: "/requiremententity/requirementEntity/exportXls", |
||||
importExcelUrl: "requiremententity/requirementEntity/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:'requirementId',text:'需求',dictCode:'requirement_item,requirement_name,id'}) |
||||
fieldList.push({type:'string',value:'entityName',text:'名称',dictCode:''}) |
||||
fieldList.push({type:'string',value:'entityEnName',text:'英文名称',dictCode:''}) |
||||
fieldList.push({type:'string',value:'entityDescribe',text:'实体描述',dictCode:''}) |
||||
fieldList.push({type:'int',value:'entityStatus',text:'实体状态',dictCode:'entity_status'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,382 @@ |
||||
<template> |
||||
<a-modal |
||||
width="96%" |
||||
title="抽取对象" |
||||
:visible="visible" |
||||
:confirm-loading="confirmLoading" |
||||
@ok="handleOk" |
||||
@cancel="handleCancel" |
||||
> |
||||
|
||||
<div> |
||||
<span style="text-align: center;display:block;font-weight:bold;">需求名称:{{tableName}}</span> |
||||
<j-vxe-table |
||||
ref="xTable" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:loading="loading" |
||||
height='auto' |
||||
|
||||
toolbar |
||||
:toolbarConfig="toolbarConfig" |
||||
|
||||
row-number |
||||
row-selection |
||||
keep-source |
||||
async-remove |
||||
|
||||
:pagination="pagination" |
||||
style="margin-top: 8px;" |
||||
@pageChange="handlePageChange" |
||||
@added="added"> |
||||
<template v-slot:toolbarSuffix> |
||||
<a style=" |
||||
background: #e6f7ff; |
||||
color: red; |
||||
position: relative; |
||||
border: 1px solid #91d5ff; |
||||
padding: 6px 300px 8px 31px; |
||||
border-radius: 5px;"> |
||||
注意: 编辑后请点击保存按钮保存数据</a> |
||||
<!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>--> |
||||
<!-- <p style="color: red;font-size: 16px"></p>--> |
||||
</template> |
||||
|
||||
<template v-slot:action="props"> |
||||
<a @click="submitForm(props)">保存</a> |
||||
<a-divider type="vertical"/> |
||||
<!-- <a @click="viewDetail(props.rowId)">详情</a>--> |
||||
<!-- <a-divider type="vertical"/>--> |
||||
<a-popconfirm title="确定删除吗?" @confirm="handleDelete(props.rowId)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
</template> |
||||
</j-vxe-table> |
||||
|
||||
</div> |
||||
|
||||
</a-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import {JVXETypes} from '@/components/jeecg/JVxeTable' |
||||
import {filterObj} from '@/utils/util' |
||||
import { httpAction, getAction } from '@/api/manage' |
||||
|
||||
export default { |
||||
name: 'FieldxList', |
||||
mixins: [JeecgListMixin, mixinDevice], |
||||
components: {}, |
||||
data() { |
||||
return { |
||||
description: '抽取对象管理页面', |
||||
tableid:'', |
||||
visible: false, |
||||
confirmLoading: false, |
||||
// 工具栏的按钮配置 |
||||
toolbarConfig: { |
||||
// add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 |
||||
btn: ['add'], |
||||
}, |
||||
// 是否正在加载 |
||||
loading: false, |
||||
// 分页器参数 |
||||
pagination: { |
||||
// 当前页码 |
||||
current: 1, |
||||
// 每页的条数 |
||||
pageSize: 10, |
||||
// 可切换的条数 |
||||
pageSizeOptions: ['10', '20', '30', '100', '200'], |
||||
// 数据总数(目前并不知道真实的总数,所以先填写0,在后台查出来后再赋值) |
||||
total: 0, |
||||
showQuickJumper: true, |
||||
showSizeChanger: true, |
||||
id: null |
||||
}, |
||||
// 开启 reload 数据效果 |
||||
reloadEffect:true, |
||||
// 表头 |
||||
columns: [ |
||||
/*关于样式宽度布局 |
||||
如果留行号和可选择行的话 宽度得留给它12% 也就是还省88%的宽度 |
||||
关于插槽 每个按钮留10%的宽度 如果有两个按钮 宽度就设为20% 按钮一般就两个字 |
||||
*/ |
||||
// { |
||||
// title: '', width: '100px', fixed: 'left', key: '', |
||||
// type: JVXETypes.normal, |
||||
// placeholder: '请输入${title}', |
||||
// disabled: true, |
||||
// }, |
||||
// { |
||||
// key: 'tableId_dictText', title: '对应实体', width: '6%', |
||||
// type: JVXETypes.normal, |
||||
// disabled: true, |
||||
// }, |
||||
{ |
||||
key: 'entityName', title: '名称', width: '16%', |
||||
type: JVXETypes.input, |
||||
validateRules: [{required: true, message: '${title}不能为空'},{unique:true,message:'${title}重复'}] |
||||
}, |
||||
{ |
||||
key: 'entityEnName', title: '英文名称', width: '16%', |
||||
type: JVXETypes.input, |
||||
validateRules: [{required: true, message: '${title}不能为空'},{unique:true,message:'${title}重复'}] |
||||
}, |
||||
{ |
||||
key: 'entityStatus', title: '实体状态', width: '16%', |
||||
type: JVXETypes.select, |
||||
dictCode:'entity_status', |
||||
defaultValue:0, |
||||
validateRules: [{required: true, message: '${title}不能为空'}] |
||||
}, |
||||
// { |
||||
// key: 'verison', title: '版本号', width: '18%', |
||||
// type: JVXETypes.input, |
||||
// dictCode:'yn', |
||||
// }, |
||||
// { |
||||
// title: '操作', |
||||
// dataIndex: 'action', |
||||
// align: "center", |
||||
// fixed: "right", |
||||
// width: 147, |
||||
// scopedSlots: {customRender: 'action'} |
||||
// } |
||||
{ |
||||
title: '操作', |
||||
key: 'action', |
||||
type: JVXETypes.slot, |
||||
fixed: 'right', |
||||
// 对齐方式为居中 |
||||
align: 'center', |
||||
minWidth: '10%', |
||||
slotName: 'action', |
||||
} |
||||
], |
||||
url: { |
||||
add: "/requiremententity/requirementEntity/add", |
||||
edit: "/requiremententity/requirementEntity/edit", |
||||
list: "/requiremententity/requirementEntity/list", |
||||
delete: "/requiremententity/requirementEntity/delete", |
||||
deleteBatch: "/requiremententity/requirementEntity/deleteBatch", |
||||
exportXlsUrl: "/requiremententity/requirementEntity/exportXls", |
||||
importExcelUrl: "/requiremententity/requirementEntity/importExcel", |
||||
|
||||
}, |
||||
dictOptions: {}, |
||||
superFieldList: [], |
||||
//参数 |
||||
loadRouteType: false, |
||||
isorterx: { |
||||
column: 'createTime', |
||||
order: 'asc', |
||||
}, |
||||
tableName:'', |
||||
|
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function () { |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
submitForm(props) { |
||||
// 进行表单验证 |
||||
this.$refs.xTable.validateTable().then(errMap => { |
||||
if (!errMap) { |
||||
this.model = Object.assign({}, props); |
||||
var str = props.rowId; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if (str.search("row") !== -1) { |
||||
props.row.id =''; |
||||
console.log("新增") |
||||
httpurl += this.url.add; |
||||
method = 'post'; |
||||
} else { |
||||
console.log("编辑") |
||||
httpurl += this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
props.row.requirementId = this.tableid; |
||||
console.log(props.row) |
||||
httpAction(httpurl, props.row, method).then((res) => { |
||||
if (res.success) { |
||||
if(method=="post"){ |
||||
props.row.id =res.result.id; |
||||
} |
||||
this.$message.success(res.message); |
||||
this.$emit('ok'); |
||||
} else { |
||||
this.$message.warning(res.message); |
||||
} |
||||
}) |
||||
} else { |
||||
// 验证未通过,errMap里包含具体未验证通过的详情 |
||||
//console.log(errMap.entityName.rule.message) |
||||
this.$message.error(errMap.entityName.rule.message); |
||||
} |
||||
}); |
||||
|
||||
|
||||
}, |
||||
//新增触发事件 |
||||
added(event) { |
||||
//获取的表格所有数据,通过ref为表格起名 |
||||
// const values = this.$refs.xTable.getTableData() |
||||
// console.log('获取值:', { values }) |
||||
const {type, row, column, value, target} = event |
||||
console.log(event,"-------") |
||||
|
||||
target.setValues([{ |
||||
rowKey: row.id, |
||||
values: {tableId_dictText: this.tableName} |
||||
}]) |
||||
}, |
||||
//数据发生变化时事件 即 编辑 时同步保存 |
||||
async handleValueChange(event) { |
||||
//this.submitForm(event) |
||||
// console.log("//数据发生变化时事件", event); |
||||
//const str = event.row.id; |
||||
let httpUrl = this.url.edit; |
||||
let method = 'put'; |
||||
await httpAction(httpUrl, event.row, method).then((res) => { |
||||
if (res.success) { |
||||
this.$message.success(res.message); |
||||
this.$emit('ok'); |
||||
} else { |
||||
this.$message.warning(res.message); |
||||
} |
||||
}) |
||||
}, |
||||
edit(record) { |
||||
this.model = Object.assign({}, record); |
||||
console.log(this.model) |
||||
//console.log(topicid); |
||||
this.queryParam.requirementId = this.model.id; |
||||
this.tableid = this.model.id; |
||||
this.tableName=this.model.requirementName; |
||||
//console.log(this.queryParam.topicid); |
||||
this.loadData(); |
||||
}, |
||||
showModal() { |
||||
this.visible = true; |
||||
}, |
||||
// handleOk(e) { |
||||
// this.ModalText = 'The modal will be closed after two seconds'; |
||||
// this.confirmLoading = true; |
||||
// setTimeout(() => { |
||||
// this.visible = false; |
||||
// this.confirmLoading = false; |
||||
// }, 2000); |
||||
// }, |
||||
handleOk(e) { |
||||
this.visible = false; |
||||
}, |
||||
handleCancel(e) { |
||||
console.log('Clicked cancel button'); |
||||
this.visible = false; |
||||
}, |
||||
initDictConfig() { |
||||
}, |
||||
//加载传递参数 |
||||
loadParameter() { |
||||
if (this.loadRouteType === false) { |
||||
// this.id = this.$route.query.id; |
||||
console.log('this.id -----------------', this.id) |
||||
//this.styleId = this.id; |
||||
//this.biaoTi = this.$route.query.styleNames + "款式型号管理"; |
||||
//console.log("**********传递到此层的id:" + this.id); |
||||
this.loadRouteType = true; |
||||
} |
||||
}, |
||||
// 加载数据 |
||||
loadData(arg) { |
||||
//加载数据 若传入参数1则加载第一页的内容 |
||||
if (arg === 1) { |
||||
this.pagination.current = 1; |
||||
} |
||||
// 调用查询数据接口 |
||||
this.loadParameter(); |
||||
var params = this.getQueryParams1();//查询条件 |
||||
this.loading = true; |
||||
getAction(this.url.list, params).then(res => { |
||||
if (res.success) { |
||||
/*// 后台查询回来的 total,数据总数量 |
||||
this.pagination.total = res.result.total*/ |
||||
// 将查询的数据赋值给 dataSource |
||||
this.dataSource = res.result.records || res.result; |
||||
console.log(this.dataSource, 'abc') |
||||
if (res.result.total) { |
||||
this.pagination.total = res.result.total; |
||||
} else { |
||||
this.pagination.total = 0; |
||||
} |
||||
//this.dataSource = res.result.records |
||||
|
||||
} else { |
||||
this.$error({title: '主表查询失败', content: res.message}) |
||||
} |
||||
}).finally(() => { |
||||
// 这里是无论成功或失败都会执行的方法,在这里关闭loading |
||||
this.loading = false |
||||
}) |
||||
}, |
||||
// 当分页参数变化时触发的事件 |
||||
handlePageChange(event) { |
||||
// 重新赋值 |
||||
this.pagination.current = event.current |
||||
this.pagination.pageSize = event.pageSize |
||||
// 查询数据 |
||||
this.loadData() |
||||
}, |
||||
|
||||
getQueryParams1() { |
||||
//获取查询条件 |
||||
let sqp = {} |
||||
if (this.superQueryParams) { |
||||
sqp['superQueryParams'] = encodeURI(this.superQueryParams) |
||||
sqp['superQueryMatchType'] = this.superQueryMatchType |
||||
} |
||||
var param = Object.assign(sqp, this.queryParam, this.isorterx, this.filters); |
||||
param.pageNo = this.pagination.current; |
||||
param.pageSize = this.pagination.pageSize; |
||||
//param.id = this.id |
||||
return filterObj(param); |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'tableId',text:'对应实体',dictCode:'tablex,table_name,id'}) |
||||
fieldList.push({type:'string',value:'fieldName',text:'中文名称',dictCode:''}) |
||||
fieldList.push({type:'string',value:'fieldEnName',text:'英文名称',dictCode:''}) |
||||
fieldList.push({type:'sel_search',value:'type',text:'数据类型',dictTable:'', dictText:'', dictCode:'date_type'}) |
||||
fieldList.push({type:'int',value:'length',text:'数据长度',dictCode:''}) |
||||
fieldList.push({type:'int',value:'accuracy',text:'浮点精度',dictCode:''}) |
||||
fieldList.push({type:'string',value:'format',text:'显示形式',dictCode:''}) |
||||
fieldList.push({type:'int',value:'isPk',text:'是否主键',dictCode:''}) |
||||
fieldList.push({type:'int',value:'isFk',text:'是否外键',dictCode:''}) |
||||
fieldList.push({type:'string',value:'associateTable',text:'关联实体',dictCode:'tablex,table_name,id'}) |
||||
fieldList.push({type:'string',value:'associateField',text:'关联字段',dictCode:'fieldx,field_name,id'}) |
||||
fieldList.push({type:'int',value:'isNull',text:'是否为空',dictCode:''}) |
||||
fieldList.push({type:'int',value:'isUniqueness',text:'是否重复',dictCode:''}) |
||||
fieldList.push({type:'string',value:'rule',text:'字段规则',dictCode:''}) |
||||
fieldList.push({type:'int',value:'status',text:'字段状态',dictCode:''}) |
||||
fieldList.push({type:'int',value:'verisonStatus',text:'版本状态',dictCode:''}) |
||||
fieldList.push({type:'int',value:'verison',text:'版本号',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,133 @@ |
||||
<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="requirementId"> |
||||
<j-dict-select-tag type="list" v-model="model.requirementId" dictCode="requirement_item,requirement_name,id" placeholder="请选择需求" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityName"> |
||||
<a-input v-model="model.entityName" placeholder="请输入名称" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityEnName"> |
||||
<a-input v-model="model.entityEnName" placeholder="请输入英文名称" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="实体描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityDescribe"> |
||||
<j-editor v-model="model.entityDescribe" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="实体状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityStatus"> |
||||
<j-dict-select-tag type="radio" v-model="model.entityStatus" dictCode="entity_status" placeholder="请选择实体状态" /> |
||||
</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: 'RequirementEntityForm', |
||||
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: { |
||||
requirementId: [ |
||||
{ required: true, message: '请输入需求!'}, |
||||
], |
||||
entityName: [ |
||||
{ required: true, message: '请输入名称!'}, |
||||
], |
||||
entityEnName: [ |
||||
{ required: true, message: '请输入英文名称!'}, |
||||
], |
||||
}, |
||||
url: { |
||||
add: "/requiremententity/requirementEntity/add", |
||||
edit: "/requiremententity/requirementEntity/edit", |
||||
queryById: "/requiremententity/requirementEntity/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,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<requirement-entity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></requirement-entity-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import RequirementEntityForm from './RequirementEntityForm' |
||||
export default { |
||||
name: 'RequirementEntityModal', |
||||
components: { |
||||
RequirementEntityForm |
||||
}, |
||||
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,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<requirement-entity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></requirement-entity-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 RequirementEntityForm from './RequirementEntityForm' |
||||
|
||||
export default { |
||||
name: 'RequirementEntityModal', |
||||
components: { |
||||
RequirementEntityForm |
||||
}, |
||||
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,171 @@ |
||||
package org.jeecg.modules.demo.requiremententity.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.requiremententity.entity.RequirementEntity; |
||||
import org.jeecg.modules.demo.requiremententity.service.IRequirementEntityService; |
||||
|
||||
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; |
||||
|
||||
/** |
||||
* @Description: 需求实体抽取管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-07-10 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="需求实体抽取管理") |
||||
@RestController |
||||
@RequestMapping("/requiremententity/requirementEntity") |
||||
@Slf4j |
||||
public class RequirementEntityController extends JeecgController<RequirementEntity, IRequirementEntityService> { |
||||
@Autowired |
||||
private IRequirementEntityService requirementEntityService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param requirementEntity |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "需求实体抽取管理-分页列表查询") |
||||
@ApiOperation(value="需求实体抽取管理-分页列表查询", notes="需求实体抽取管理-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(RequirementEntity requirementEntity, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<RequirementEntity> queryWrapper = QueryGenerator.initQueryWrapper(requirementEntity, req.getParameterMap()); |
||||
Page<RequirementEntity> page = new Page<RequirementEntity>(pageNo, pageSize); |
||||
IPage<RequirementEntity> pageList = requirementEntityService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param requirementEntity |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "需求实体抽取管理-添加") |
||||
@ApiOperation(value="需求实体抽取管理-添加", notes="需求实体抽取管理-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody RequirementEntity requirementEntity) { |
||||
requirementEntityService.save(requirementEntity); |
||||
return Result.OK(requirementEntity); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param requirementEntity |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "需求实体抽取管理-编辑") |
||||
@ApiOperation(value="需求实体抽取管理-编辑", notes="需求实体抽取管理-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody RequirementEntity requirementEntity) { |
||||
requirementEntityService.updateById(requirementEntity); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "需求实体抽取管理-通过id删除") |
||||
@ApiOperation(value="需求实体抽取管理-通过id删除", notes="需求实体抽取管理-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
requirementEntityService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "需求实体抽取管理-批量删除") |
||||
@ApiOperation(value="需求实体抽取管理-批量删除", notes="需求实体抽取管理-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.requirementEntityService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "需求实体抽取管理-通过id查询") |
||||
@ApiOperation(value="需求实体抽取管理-通过id查询", notes="需求实体抽取管理-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
RequirementEntity requirementEntity = requirementEntityService.getById(id); |
||||
if(requirementEntity==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(requirementEntity); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param requirementEntity |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, RequirementEntity requirementEntity) { |
||||
return super.exportXls(request, requirementEntity, RequirementEntity.class, "需求实体抽取管理"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, RequirementEntity.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,79 @@ |
||||
package org.jeecg.modules.demo.requiremententity.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 需求实体抽取管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-07-10 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("requirement_entity") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="requirement_entity对象", description="需求实体抽取管理") |
||||
public class RequirementEntity implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**需求id*/ |
||||
@Excel(name = "需求id", width = 15, dictTable = "requirement_item", dicText = "requirement_name", dicCode = "id") |
||||
@Dict(dictTable = "requirement_item", dicText = "requirement_name", dicCode = "id") |
||||
@ApiModelProperty(value = "需求id") |
||||
private java.lang.String requirementId; |
||||
/**名称*/ |
||||
@Excel(name = "名称", width = 15) |
||||
@ApiModelProperty(value = "名称") |
||||
private java.lang.String entityName; |
||||
/**英文名称*/ |
||||
@Excel(name = "英文名称", width = 15) |
||||
@ApiModelProperty(value = "英文名称") |
||||
private java.lang.String entityEnName; |
||||
/**实体描述*/ |
||||
@Excel(name = "实体描述", width = 15) |
||||
@ApiModelProperty(value = "实体描述") |
||||
private java.lang.String entityDescribe; |
||||
/**实体状态*/ |
||||
@Excel(name = "实体状态", width = 15, dicCode = "entity_status") |
||||
@Dict(dicCode = "entity_status") |
||||
@ApiModelProperty(value = "实体状态") |
||||
private java.lang.Integer entityStatus; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.requiremententity.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 需求实体抽取管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-07-10 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface RequirementEntityMapper extends BaseMapper<RequirementEntity> { |
||||
|
||||
} |
@ -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.requiremententity.mapper.RequirementEntityMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.requiremententity.service; |
||||
|
||||
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 需求实体抽取管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-07-10 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IRequirementEntityService extends IService<RequirementEntity> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.requiremententity.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity; |
||||
import org.jeecg.modules.demo.requiremententity.mapper.RequirementEntityMapper; |
||||
import org.jeecg.modules.demo.requiremententity.service.IRequirementEntityService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 需求实体抽取管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-07-10 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class RequirementEntityServiceImpl extends ServiceImpl<RequirementEntityMapper, RequirementEntity> implements IRequirementEntityService { |
||||
|
||||
} |
Loading…
Reference in new issue