5 changed files with 443 additions and 44 deletions
@ -0,0 +1,136 @@
|
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<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> |
||||
</a-table> |
||||
</div> |
||||
|
||||
<process-operation-log-modal ref="modalForm" @ok="modalFormOk"></process-operation-log-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ProcessOperationLogModal from './modules/ProcessOperationLogModal' |
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue' |
||||
|
||||
export default { |
||||
name: 'ProcessOperationLogList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ProcessOperationLogModal, |
||||
JSuperQuery, |
||||
}, |
||||
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: 'operator' |
||||
}, |
||||
{ |
||||
title:'行为', |
||||
align:"center", |
||||
dataIndex: 'behavior' |
||||
}, |
||||
{ |
||||
title:'操作时间', |
||||
align:"center", |
||||
dataIndex: 'operationDate', |
||||
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: "/processoperationlog/processOperationLog/list", |
||||
delete: "/processoperationlog/processOperationLog/delete", |
||||
deleteBatch: "/processoperationlog/processOperationLog/deleteBatch", |
||||
exportXlsUrl: "/processoperationlog/processOperationLog/exportXls", |
||||
importExcelUrl: "processoperationlog/processOperationLog/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:'operator',text:'操作人',dictCode:''}) |
||||
fieldList.push({type:'string',value:'behavior',text:'行为',dictCode:''}) |
||||
fieldList.push({type:'date',value:'operationDate',text:'操作时间'}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,151 @@
|
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form :form="form" slot="detail"> |
||||
<a-row> |
||||
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center"> |
||||
<a-button @click="submitForm">提 交</a-button> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import pick from 'lodash.pick' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
import JFormContainer from '@/components/jeecg/JFormContainer' |
||||
|
||||
export default { |
||||
name: 'ProcessOperationLogForm', |
||||
components: { |
||||
JFormContainer, |
||||
}, |
||||
props: { |
||||
//流程表单data |
||||
formData: { |
||||
type: Object, |
||||
default: ()=>{}, |
||||
required: false |
||||
}, |
||||
//表单模式:true流程表单 false普通表单 |
||||
formBpm: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
}, |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
form: this.$form.createForm(this), |
||||
model: {}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/processoperationlog/processOperationLog/add", |
||||
edit: "/processoperationlog/processOperationLog/edit", |
||||
queryById: "/processoperationlog/processOperationLog/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
if(this.formBpm===true){ |
||||
if(this.formData.disabled===false){ |
||||
return false |
||||
} |
||||
return true |
||||
} |
||||
return this.disabled |
||||
}, |
||||
showFlowSubmitButton(){ |
||||
if(this.formBpm===true){ |
||||
if(this.formData.disabled===false){ |
||||
return true |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
}, |
||||
created () { |
||||
//如果是流程中表单,则需要加载流程表单data |
||||
this.showFlowData(); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit({}); |
||||
}, |
||||
edit (record) { |
||||
this.form.resetFields(); |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
this.$nextTick(() => { |
||||
this.form.setFieldsValue(pick(this.model,'operator','behavior','operationDate')) |
||||
}) |
||||
}, |
||||
//渲染流程表单数据 |
||||
showFlowData(){ |
||||
if(this.formBpm === true){ |
||||
let params = {id:this.formData.dataId}; |
||||
getAction(this.url.queryById,params).then((res)=>{ |
||||
if(res.success){ |
||||
this.edit (res.result); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
submitForm () { |
||||
const that = this; |
||||
// 触发表单验证 |
||||
this.form.validateFields((err, values) => { |
||||
if (!err) { |
||||
that.confirmLoading = true; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if(!this.model.id){ |
||||
httpurl+=this.url.add; |
||||
method = 'post'; |
||||
}else{ |
||||
httpurl+=this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
let formData = Object.assign(this.model, values); |
||||
console.log("表单提交数据",formData) |
||||
httpAction(httpurl,formData,method).then((res)=>{ |
||||
if(res.success){ |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
}else{ |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
that.confirmLoading = false; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
popupCallback(row){ |
||||
this.form.setFieldsValue(pick(row,'operator','behavior','operationDate')) |
||||
}, |
||||
} |
||||
} |
||||
</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="关闭"> |
||||
<process-operation-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></process-operation-log-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ProcessOperationLogForm from './ProcessOperationLogForm' |
||||
export default { |
||||
name: 'ProcessOperationLogModal', |
||||
components: { |
||||
ProcessOperationLogForm |
||||
}, |
||||
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,83 @@
|
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
:visible="visible"> |
||||
<process-operation-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></process-operation-log-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 ProcessOperationLogForm from './ProcessOperationLogForm' |
||||
|
||||
export default { |
||||
name: 'ProcessOperationLogModal', |
||||
components: { |
||||
ProcessOperationLogForm |
||||
}, |
||||
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> |
Loading…
Reference in new issue