Commit 151701d9 authored by ztf's avatar ztf

添加自定义组件

parent 7ba666f1
......@@ -5,3 +5,16 @@ const TaskCenterSelectUserComponentName = 'DeeChooseScopeUserDialog' // eslint-d
// 三元用户是否展示全局搜索
// eslint-disable-next-line
var InnerUserShowGlobalSearch = false
// 组织code
// eslint-disable-next-line no-unused-vars
const VUE_APP_USER_ORGCODE = {
wf_act_TeamRole_InterfaceSign_userList: 'SJXHQ',
handler: '001',
wf_act_TeamRole_SpecialReview_userList: 'ZXSC',
wf_act_TeamRole_secretRole_userList: 'dingmi',
wf_act_TeamRole_interfacePeoples_userList: '001',
// 组织 用于申请方/提资方
ORGANIZATION_CODE: 'T'
}
// eslint-disable-next-line no-unused-vars
const VUE_APP_COMMON_TITLE = '(机密)'
......@@ -14,3 +14,14 @@ export function downFileByFileCode(fileCode) {
export function downFileByFileId(fileId) {
return downloadFile(`/dfs/fileManager/downloadio?fileId=${fileId}`)
}
// // 下载文件
// export function downFileByFileId(objName, objId, linkId, disLoadingFlag) {
// let url = `/dfs/fileManager/downloadio?objName=${objName}&objId=${objId}&linkId=${linkId}`
// if (disLoadingFlag) {
// url += '&disLoadingFlag=' + disLoadingFlag
// }
// return downloadFile(url)
// }
export function downFileUseFileId(fileId) {
return downloadFile(`/dfs/fileManager/downloadio?fileId=${fileId}`)
}
......@@ -11,3 +11,17 @@ export function instDetail(instId) {
return get(`/workflow/inst/${instId}/simple`)
}
// 查询流程节点附件
export function getFlowNodeAttachment(instId) {
return get(`/workflow/task/${instId}/attachments`)
}
// 查询流程节点附件
export function getTerminationRecord(params) {
return get(`/workflow/inst/search?pboClass=${params.pboClass}&pboId=${params.pboId}`)
}
// 查询终止流程记录
export function getExtInterfaceEndFlow(params) {
return get(`ExtInterface/end/flow?id=${params.id}`)
}
<template>
<div class="addRaiseCapital">
<el-cascader
v-model="providerList"
style="width: 90%"
:options="providerListOptions"
:props="props"
clearable
@change="handleChange"
/>
<div class="btns">
<el-button type="primary" class="submitBTN" :disabled="!isDisable" @click="tosubmit">确定</el-button>
<el-button type="primary" @click="$emit('cancel')">取消</el-button>
</div>
</div>
</template>
<script >
import { post } from '@/utils/http'
export default {
name: 'AddRaiseCapital',
componentName: '增加提资方',
props: {
basicData: {
type: Object,
default: () => {}
}
},
data() {
return {
providerList: [],
providerListOptions: [],
props: { multiple: true }
}
},
computed: {
isDisable() {
return Boolean(this.providerList.length)
}
},
methods: {
getOrganization() {
const params = {
'items': [],
'operator': 'AND',
'sortAsc': true,
'sortProperties': [
'orgSort'
]
}
post('/Organization/nodes', params).then(res => {
if (res.code === 0) {
this.providerListOptions = res.items.map(item => {
const obj = {
label: item.orgName,
value: item.id
}
if (item.children.length) {
obj.children = item.children.map(x => {
return {
label: x.orgName,
value: x.id,
parentId: item.id
}
})
}
return obj
})
}
})
},
handleChange(val) {
this.providerList = val
},
tosubmit() {
console.log('提交数据')
}
}
}
</script>
<style lang="scss" scoped>
.addRaiseCapital{
.btns{
margin-top: 20px;
display: flex;
justify-content: center;
.submitBTN{
margin-right: 25px;
}
}
}
</style>
<template>
<div style="width: 100%">
<el-cascader
v-model="applicantOrg"
:size="size"
:disabled="readOnly"
:options="options"
clearable
filterable
change-on-select
:props="props"
@change="applicantOrgChange"
/>
</div>
</template>
<script>
import { get } from '@/utils/http'
export default {
name: 'ApplicantOrg',
componentName: '选择申请方',
components: {},
props: {
value: {
type: [String, Array],
default: () => ''
},
readOnly: {
type: Boolean,
default: () => false
},
size: {
type: String,
default: () => 'small'
},
field: {
type: String,
default: () => ''
}
},
data() {
return {
applicantOrg: '',
options: [],
props: {
value: 'sourceObject',
label: 'orgName',
checkStrictly: true
}
}
},
computed: {},
watch: {
'value': {
async handler(newVal) {
if (newVal) {
// await this.searchOrgByUserId()
this.getDisplay()
}
},
immediate: true
}
// async value() {
// await this.searchOrgByUserId()
// this.getDisplay()
// }
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
// this.searchOrgByUserId()
},
methods: {
async searchOrgByUserId() {
if (this.options.length) return
// eslint-disable-next-line no-undef
await get(`/DistributeRecord/searchOrgByUserId?userId=${localStorage.getItem('userId')}&code=${VUE_APP_USER_ORGCODE['ORGANIZATION_CODE']}`).then(res => {
if (res.code === 0) {
this.options = res.items.map(item => {
item.sourceObject = JSON.stringify(item)
return item
})
}
})
},
getAllParentNode(data, tree) {
for (const i in tree) {
if (tree[i].sourceObject === data) {
return [tree[i].sourceObject]
}
if (tree[i].children) {
const node = this.getAllParentNode(data, tree[i].children)
if (node !== undefined) {
return node.concat([tree[i].sourceObject])
}
}
}
},
getDisplay() {
this.applicantOrg = []
if (this.value) {
const data = typeof this.value === 'string' ? this.value : JSON.stringify(this.value)
this.applicantOrg = this.getAllParentNode(data, this.options).reverse()
} else {
this.applicantOrg = []
}
},
applicantOrgChange(val) {
const value = val[0]
this.$emit('input', this.field ? JSON.parse(value).id : value)
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
{{ scope? name:value }}
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'DictionaryConversionDisplayName',
componentName: '字典值转换显示名称',
components: {},
props: {
value: {
type: [String, Array],
default: () => ''
},
config: {
type: Object,
default: () => null
},
item: {
type: Object,
default: () => {}
},
form: {
type: Object,
default: () => {}
},
dictionariesKey: {
type: String,
default: () => ''
},
scope: {
type: Object,
default: () => null
}
},
data() {
return {
name: ''
}
},
computed: {},
watch: {
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
if (this.scope) {
let obj = this.scope.row
const keys = this.scope.column.property.split('.')
const key = this.scope.column.property
const dictCode = key === 'type' ? 'ApplicantType' : 'DesignPhase'
keys.forEach(key => {
obj = obj[key]
})
this.getTypeDictionaries(dictCode, obj)
console.log('obj', obj)
}
},
methods: {
getTypeDictionaries(dictCode, value) {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'items': [
{
'fieldName': 'dictState',
'operator': 'EQ',
'value': 'ENABLE'
},
{
'fieldName': 'dictCode',
'operator': 'EQ',
'value': dictCode
}
]
},
'sortItem': [
{
'fieldName': 'dictSeq',
'sortOrder': 'asc'
}
]
}
post('/DictData/search', params).then(res => {
if (res.code === 0) {
if (res.items && res.items.content) {
const obj = res.items.content.find(item => item.dictKey === value)
if (obj) {
this.$emit('input', obj.dictValue)
if (this.scope) {
this.name = obj.dictValue
}
} else {
this.name = value
}
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-13 16:53:02
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-08-13 16:55:03
* @LastEditTime: 2024-08-15 17:07:16
-->
<template>
<div class="ExtApplicantInternalInterfaceAddlist">
......@@ -10,7 +10,7 @@
class="FeatureTypicalcom"
:lay-config="{
typeName: 'ExtApplicant',
layKey: 'addContributors-InternalInterfaceApplication-AddList'
layKey: 'ExtApplicantInternalInterfaceAddlist'
}"
@selectionChange="selectionChange"
/>
......@@ -25,7 +25,7 @@
import { post } from '@/utils/http'
export default {
name: 'ExtApplicantInternalInterfaceAddlist',
componentName: '新增提资方-内部接口申请单-添加',
componentName: '内部接口申请单-添加',
props: {
basicData: {
type: Object,
......
/**
* @Description: 终止流程历史记录
* @author wx
* @date 2020/12/28
*/
<template>
<div class="porcess-history-record-com">
<dee-up-table
:data="porcessRecordData"
:columns="porcessColumns"
table-height="auto"
/>
<!-- 附件 -->
<dee-dialog
:dialog-visible="fileDialogVisible"
title="附件"
width="60%"
@handleClose="handleClose"
>
<dee-up-table
:data="fileTableData"
:columns="fileTaskColumns"
/>
</dee-dialog>
</div>
</template>
<script>
import { downFileUseFileId } from '@/api/file'
import { getExtInterfaceEndFlow, getFlowNodeAttachment } from '@/api/workflow'
export default {
name: 'ExtInterfaceTerminationHistory',
componentName: '终止流程历史记录',
props: {
basicData: {
type: Object,
required: true,
defalut: () => {}
},
processInstanceId: {
type: String,
default: () => null
},
modelName: {
type: String,
default: () => ''
}
},
data() {
const that = this
return {
porcessRecordData: [],
porcessColumns: [
{ title: '流程名称', key: 'name', minWidth: 150, align: 'center' },
{ title: '任务名称', key: 'taskName', minWidth: 100, align: 'center' },
{ title: '状态', key: 'status', width: 80, align: 'center' },
{ title: '工作责任人', key: 'assigneeName', width: 120, align: 'center' },
{ title: '角色', key: 'participantInfo.pluginShowContent', minWidth: 80, align: 'center' },
{ title: '开始时间', key: 'startTime', width: 150, align: 'center' },
{ title: '完成时间', key: 'endTime', width: 150, align: 'center' },
{ title: '处理结果', key: 'result', minWidth: 100, align: 'center' },
{ title: '备注', key: 'comments', align: 'center', minWidth: 100, formatter: function(row, column) {
return row.comments ? row.comments.join('\n') : ''
}
},
{ title: '附件', key: 'result', minWidth: 100, align: 'center', component: {
show: true,
name: 'EditTableRow',
props: {
btns: [
{
operation: '查看',
handleClick: (row, index) => {
// this.editFormTwo(true, row, index)
this.fileDialogVisible = true
this.fileTableData = row.attachments.map(r => {
r.show = true
return r
})
},
// icon: '/icons/c-edit.png',
showFun: (row) => {
return row.attachments && row.attachments.length
}
}
]
}
}}
],
pagination: {
currentPage: 1,
pageSize: 10,
total: 0,
pageSizes: [10, 20, 50]
},
fileTableData: [],
fileTaskColumns: [
{ title: '文件名称', key: 'attachmentName', align: 'center', component: {
render: function(h, data, column, index) {
return (<span class='link' on-click={(val) => {
that.loadFile(data)
}}>{data.attachmentName}</span>)
}
}},
{ title: '创建时间', key: 'createTime', align: 'center' }
]
}
},
computed: {
},
watch: {
basicData: {
handler: function(val) {
if (val && val.dxClassname) {
this.getExtInterfaceEndFlow()
}
},
deep: true
}
},
mounted() {
},
methods: {
translateStatus(status) {
let str = ''
switch (status) {
case 'COMPLETE':
str = '已完成'
break
case 'BE_RESOLVED':
str = '待处理'
break
case 'RUNNING':
str = '进行中'
}
return str
},
getExtInterfaceEndFlow() {
this.porcessRecordData = []
getExtInterfaceEndFlow(this.basicData).then(async res => {
if (res.items && res.items[0].historyInfo && res.items[0].historyInfo.length) {
this.porcessRecordData.push({
id: res.items[0].processInst.id,
name: res.items[0].processInst.name,
status: res.items[0].processInst.status
})
const historyInfo = res.items[0].historyInfo.map(x => {
const y = JSON.parse(JSON.stringify(x))
y.status = this.translateStatus(x.state)
y.taskName = x.aliasName || x.name
delete y.name
return y
})
await this.getFlowNodeAttachments(historyInfo)
}
})
},
getFlowNodeAttachments(flowNodes) {
const getAttachmentApi = flowNodes.map(r => {
return getFlowNodeAttachment(r.id)
})
Promise.all(getAttachmentApi).then(res => {
const objFileLinks = res.filter(r => r && r.items).map(r => r.items)
objFileLinks.forEach(files => {
if (files && files[0]) {
const taskId = files[0].taskId
const node = flowNodes.find(n => n.id === taskId)
if (node) {
node.objFileLinks = this.transferFilesLinksFormat(files)
}
}
})
if (flowNodes && flowNodes[0] && flowNodes[0].processInstanceId) {
const idx = this.porcessRecordData.findIndex(r => r.id === flowNodes[0].processInstanceId)
if (idx > -1) {
this.$set(this.porcessRecordData[idx], 'children', flowNodes)
}
}
})
},
transferFilesLinksFormat(files) {
return files.map(f => {
return {
contentType: 'FLOW_FILE',
target: {
originalFileName: f.attachmentName,
resourceId: f.resourceId
}
}
})
},
handleClose() {
this.fileDialogVisible = false
},
loadFile(val) {
downFileUseFileId(val.resourceId).then(res => {
this.downLoadFileUrl(res)
})
},
downLoadFileUrl(res) {
if (res.headers['content-disposition']) {
const fileName = decodeURI(res.headers['content-disposition'].substring(res.headers['content-disposition'].indexOf('=') + 1, res.headers['content-disposition'].length))
const url = window.URL.createObjectURL(new Blob([res.data], { type: res.headers['content-type'] }))
this.$utils.downLoadFileUrl(url, decodeURI(fileName))
} else {
if (res.data instanceof Blob) {
var reader = new FileReader()
reader.addEventListener('loadend', () => {
const message = reader.result && JSON.parse(reader.result)
this.$utils.showMessageWarning(message ? message.message : '数据包下载出错:未找到数据包内容的下载链接,请联系管理员排查问题!')
})
reader.readAsText(res.data, 'utf-8')
} else {
const message = res.data && res.data.message
this.$utils.showMessageWarning(message || '数据包下载出错:未找到数据包内容的下载链接,请联系管理员排查问题!')
}
}
}
}
}
</script>
<style lang='scss'>
</style>
<template>
<div>
<el-cascader
v-model="providerList"
:size="size"
:options="providerListOptions"
:props="props"
clearable
filterable
change-on-select
@change="handleChange"
/>
</div>
</template>
<script >
import { post } from '@/utils/http'
export default {
name: 'SelectRaiseCapital',
componentName: '选择提资方',
props: {
value: {
type: [String, Array],
default: () => ''
},
readOnly: {
type: Boolean,
default: () => false
},
size: {
type: String,
default: () => 'small'
},
displayName: {
type: Boolean,
default: () => false
},
scope: {
type: Object,
default: () => null
}
},
data() {
return {
providerList: [],
providerListOptions: [],
props: {
multiple: true,
value: 'id',
label: 'orgName'
}
}
},
watch: {
async value() {
await this.getOrganization()
this.getDisplay()
}
},
mounted() {
this.getTypeDictionaries()
},
methods: {
async getTypeDictionaries(value) {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'items': [
{
'fieldName': 'dictState',
'operator': 'EQ',
'value': 'ENABLE'
},
{
'fieldName': 'dictCode',
'operator': 'EQ',
'value': 'DesignPhase' // ApplicantType
}
]
},
'sortItem': [
{
'fieldName': 'dictSeq',
'sortOrder': 'asc'
}
]
}
await post('/DictData/search', params).then(res => {
if (res.code === 0) {
console.log('测试接口数据', res.items)
}
})
},
async getOrganization() {
const params = {
'items': [],
'operator': 'AND',
'sortAsc': true,
'sortProperties': [
'orgSort'
]
}
await post('/Organization/nodes', params).then(res => {
if (res.code === 0) {
this.providerRes = res.items
// eslint-disable-next-line no-undef
res.items = res.items.filter(item => item.orgCode === VUE_APP_USER_ORGCODE['ORGANIZATION_CODE'])
this.setOptionsData(res.items)
this.providerListOptions = res.items
// if (this.displayName) {
// this.getProviderName(this.isForm ? this.value : this.values)
// } else {
this.getDisplay()
// }
}
})
},
setOptionsData(data, parentId = '') {
data.map(item => {
item.parentId = parentId
if (item.children.length) {
this.setOptionsData(item.children, item.id)
}
})
},
getProviderName(value) {
if (value.length) {
const providers = value.split(',').map(item => Number(item))
this.providerList = []
providers.forEach(item => {
const list = this.getAllParentNode(item, this.providerRes) ? this.getAllParentNode(item, this.providerRes).reverse() : []
if (list.length) {
this.providerList.push(list.map(x => x.orgName))
}
})
}
},
getAllParentNode(id, tree) {
for (const i in tree) {
if (tree[i].id === id) {
return [{
id: tree[i].id,
orgName: tree[i]['orgName']
}]
}
if (tree[i].children) {
const node = this.getAllParentNode(id, tree[i].children)
if (node !== undefined) {
return node.concat({
id: tree[i].id,
orgName: tree[i]['orgName']
})
}
}
}
},
getDisplay() {
this.providerList = []
if (this.value.length) {
const providers = this.value.split(',').map(item => Number(item))
providers.forEach(item => {
const list = this.getAllParentNode(item, this.providerListOptions).reverse()
this.providerList.push(list.map(x => x.id))
})
} else {
this.providerList = []
}
},
handleChange(val) {
const providerList = []
if (val.length) {
val.forEach(item => {
providerList.push(item[item.length - 1])
})
}
this.$emit('input', providerList.length ? providerList.join(',') : '')
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-13 16:59:49
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-08-14 10:41:04
* @LastEditTime: 2024-08-14 20:01:08
-->
<template>
<div class="TerminateInternalInterface">
......@@ -46,21 +46,39 @@ export default {
mounted() {
},
methods: {
selectionChange(data) {
this.selections = data
},
// selectionChange(data) {
// this.selections = data
// },
tosubmit() {
const source = this.$parent.$parent.$parent.$parent.basicData
const params = this.selections.map(r => {
return {
source: source,
operator: 'ADD',
target: r
}
})
post('ExtAuditObject/recursions', params).then(res => {
this.$emit('completeEven')
const params = {
operator: 'ADD',
sourceExtAuditInterfLink: this.selections.map(item => {
return {
operator: 'ADD',
targetId: item.id,
targetIdType: item.subTypeName
}
})
}
// this.btnLoading = true
post(`/ExtAuditObject/recursion`, params).then(res => {
// this.btnLoading = false
this.$utils.showMessageSuccess('操作成功!')
// this.handleClose()
}).catch(() => {
this.btnLoading = false
})
// const source = this.$parent.$parent.$parent.$parent.basicData
// const params = this.selections.map(r => {
// return {
// source: source,
// operator: 'ADD',
// target: r
// }
// })
// post('ExtAuditObject/recursions', params).then(res => {
// this.$emit('completeEven')
// })
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment