parent
633258b417
commit
0b25429b72
8 changed files with 568 additions and 4 deletions
@ -0,0 +1,132 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
</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,type:'radio'}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
|
||||
</a-table> |
||||
</div> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
||||
import { httpAction, getAction,deleteAction } from '@/api/manage' |
||||
|
||||
export default { |
||||
name: 'RequirementEntityList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
}, |
||||
data () { |
||||
return { |
||||
ids:"", |
||||
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' |
||||
}, |
||||
], |
||||
url: { |
||||
list: "/requiremententity/requirementEntity/list1?id="+"", |
||||
hb:"/requiremententity/requirementEntity/hb", |
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
add(ids){ |
||||
this.url.list = "/requiremententity/requirementEntity/list1?id="+ids; |
||||
this.ids = ids; |
||||
this.loadData(); |
||||
//this.ids = ids; |
||||
}, |
||||
submitForm () { |
||||
deleteAction(this.url.hb,{ids:this.ids,id:this.selectedRowKeys[0]}).then((res)=>{ |
||||
if (res.success) { |
||||
this.$message.success(res.message); |
||||
this.$emit('ok'); |
||||
}else{ |
||||
this.$message.warning(res.message); |
||||
} |
||||
}); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,61 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭" |
||||
okText="保留"> |
||||
<requirement-entity-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></requirement-entity-form1> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import RequirementEntityForm1 from './RequirementEntityForm1' |
||||
export default { |
||||
name: 'RequirementEntityModal1', |
||||
components: { |
||||
RequirementEntityForm1 |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add (ids) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(ids); |
||||
}) |
||||
}, |
||||
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,165 @@ |
||||
<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="moduleId"> |
||||
<j-search-select-tag v-model="model.moduleId" dict="modulex,module_name,id" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<!-- <a-col :span="24">--> |
||||
<!-- <a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">--> |
||||
<!-- <a-input v-model="model.tableName" placeholder="请输入中文名称" ></a-input>--> |
||||
<!-- </a-form-model-item>--> |
||||
<!-- </a-col>--> |
||||
<!-- <a-col :span="24">--> |
||||
<!-- <a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableEnName">--> |
||||
<!-- <a-input v-model="model.tableEnName" placeholder="请输入英文名称" ></a-input>--> |
||||
<!-- </a-form-model-item>--> |
||||
<!-- </a-col>--> |
||||
<!-- <a-col :span="24">--> |
||||
<!-- <a-form-model-item label="表结构SQL" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableStructure">--> |
||||
<!-- <a-input v-model="model.tableStructure" placeholder="请输入表结构SQL" ></a-input>--> |
||||
<!-- </a-form-model-item>--> |
||||
<!-- </a-col>--> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="结构图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="structuralDiagram"> |
||||
<j-image-upload v-model="model.structuralDiagram" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="实体状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> |
||||
<j-search-select-tag v-model="model.status" dict="a_status" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="版本状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verisonStatus"> |
||||
<j-search-select-tag v-model="model.verisonStatus" dict="verison_status" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<!-- <a-col :span="24">--> |
||||
<!-- <a-form-model-item label="版本号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verison">--> |
||||
<!-- <a-input-number v-model="model.verison" 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: 'TablexForm1', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
reid:"", |
||||
model:{ |
||||
status:1, |
||||
verisonStatus:1, |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
moduleId: [ |
||||
{ required: true, message: '请选择对应模块!'}, |
||||
], |
||||
tableName: [ |
||||
{ required: true, message: '请输入中文名称!'}, |
||||
], |
||||
tableEnName: [ |
||||
{ required: true, message: '请输入英文名称!'}, |
||||
], |
||||
status: [ |
||||
{ required: true, message: '请选择实体状态!'}, |
||||
], |
||||
verisonStatus: [ |
||||
{ required: true, message: '请选择版本状态!'}, |
||||
], |
||||
verison: [ |
||||
{ required: true, message: '请输入版本号!'}, |
||||
], |
||||
}, |
||||
url: { |
||||
add: "/tablex/tablex/zh", |
||||
edit: "/tablex/tablex/edit", |
||||
queryById: "/tablex/tablex/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add (id) { |
||||
this.reid = id; |
||||
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'; |
||||
this.model.id = this.reid; |
||||
}else{ |
||||
httpurl+=this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
httpAction(httpurl,this.model,method).then((res)=>{ |
||||
if(res.success){ |
||||
this.model.id = ""; |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
}else{ |
||||
this.model.id = ""; |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
this.model.id = ""; |
||||
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="关闭"> |
||||
<tablex-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tablex-form1> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import TablexForm1 from './TablexForm1' |
||||
export default { |
||||
name: 'TablexModal1', |
||||
components: { |
||||
TablexForm1 |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add (id) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(id); |
||||
}) |
||||
}, |
||||
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> |
Loading…
Reference in new issue