联调流程定义 流程图
This commit is contained in:
46
src/views/pqs/process/definition/allocation.vue
Normal file
46
src/views/pqs/process/definition/allocation.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="挂载表单" width="700" :before-close="handleClose">
|
||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="400" :data="equipmentList">
|
||||
<vxe-column field="formId" title="序号"></vxe-column>
|
||||
<vxe-column field="formName" title="功能名称"></vxe-column>
|
||||
<vxe-column title="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" link @click="mount(row)">挂载</el-button>
|
||||
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary">确定</el-button>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
const dialogVisible = ref(false)
|
||||
const List = ref({})
|
||||
const equipmentList = ref([
|
||||
{ formId: '1', formName: '谐波普测计划' },
|
||||
{ formId: '2', formName: '干扰源用户管理' },
|
||||
{ formId: '3', formName: '电能质量问题管理' }
|
||||
])
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
// 挂载
|
||||
const mount = (row: any) => {
|
||||
|
||||
}
|
||||
const open = (row: any) => {
|
||||
dialogVisible.value = true
|
||||
List.value = row
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -61,42 +61,38 @@ const initModeler = item => {
|
||||
}
|
||||
|
||||
/** 添加/修改模型 */
|
||||
const save = async bpmnXml => {
|
||||
const save = async (bpmnXml: any, form: any) => {
|
||||
const data = {
|
||||
// name
|
||||
// flowableXml
|
||||
// category
|
||||
...model.value,
|
||||
flowableXml: bpmnXml, // bpmnXml 只是初始化流程图,后续修改无法通过它获得
|
||||
category: '',
|
||||
name: ''
|
||||
category: form.category,
|
||||
name: form.name
|
||||
} as unknown as ModelApi.ModelVO
|
||||
// 提交
|
||||
if (data.id) {
|
||||
await ModelApi.updateModel(data)
|
||||
ElMessage.success('修改成功')
|
||||
} else {
|
||||
await ModelApi.createModel(data)
|
||||
await ModelApi.save(data)
|
||||
ElMessage.success('新增成功')
|
||||
}
|
||||
// 跳转回去
|
||||
close()
|
||||
emit('quit')
|
||||
}
|
||||
|
||||
/** 关闭按钮 */
|
||||
const close = () => {}
|
||||
const randomStr = () => {
|
||||
return Math.random().toString(36).slice(-8)
|
||||
}
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
const data: any = {}
|
||||
if (prop.model?.deploymentId === undefined) {
|
||||
if (!data.bpmnXml) {
|
||||
// 首次创建的 Model 模型,它是没有 bpmnXml,此时需要给它一个默认的
|
||||
data.key = Math.random().toString(36).slice(-8)
|
||||
console.log('🚀 ~ onMounted ~ data.key:', data.key)
|
||||
data.bpmnXml = ` <?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.activiti.org/processdef">
|
||||
<process id="${data.key}" name="${data.name}" />
|
||||
<process id="flow_${data.key}" name="${data.name || ''}" />
|
||||
<bpmndi:BPMNDiagram id="BPMNDiagram">
|
||||
<bpmndi:BPMNPlane id="${data.key}_di" bpmnElement="${data.key}" />
|
||||
</bpmndi:BPMNDiagram>
|
||||
@@ -110,11 +106,13 @@ onMounted(async () => {
|
||||
}
|
||||
// 查询模型
|
||||
|
||||
model.value = {
|
||||
...data,
|
||||
bpmnXml: undefined // 清空 bpmnXml 属性
|
||||
}
|
||||
xmlString.value = data.bpmnXml
|
||||
setTimeout(() => {
|
||||
model.value = {
|
||||
...data,
|
||||
bpmnXml: undefined // 清空 bpmnXml 属性
|
||||
}
|
||||
xmlString.value = data.bpmnXml
|
||||
}, 0)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
<Table ref="tableRef"></Table>
|
||||
</div>
|
||||
<!-- 设计流程 -->
|
||||
<editor v-if="!addedShow" :model="model" @quit="addedShow = true"/>
|
||||
<editor v-if="!addedShow" :model="model" @quit="quit" />
|
||||
<!-- 配置表单 -->
|
||||
<Allocation ref="allocationRef" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -25,15 +28,17 @@
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Allocation from './allocation.vue'
|
||||
import { onMounted, provide, ref } from 'vue'
|
||||
|
||||
import editor from './editor/index.vue';
|
||||
import editor from './editor/index.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/reate/word'
|
||||
name: '/flowable/definition/index'
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
const allocationRef = ref()
|
||||
const model = ref({})
|
||||
const addedShow = ref(true)
|
||||
|
||||
@@ -99,7 +104,9 @@ const tableStore = new TableStore({
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: async row => {}
|
||||
click: async row => {
|
||||
allocationRef.value.open(row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
@@ -150,6 +157,10 @@ onMounted(() => {
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
})
|
||||
const quit = () => {
|
||||
addedShow.value = true
|
||||
tableStore.index()
|
||||
}
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
</script>
|
||||
|
||||
26
src/views/pqs/supervise/retire/components/equipment.vue
Normal file
26
src/views/pqs/supervise/retire/components/equipment.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="500" :before-close="handleClose">
|
||||
<span>111</span>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary">确定</el-button>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const handleClose = (done: () => void) => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const open = (text: string) => {
|
||||
title.value = text
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -29,23 +29,21 @@
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
<!-- 新增编辑 -->
|
||||
<Equipment ref="EquipmentRef" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Equipment from './components/equipment.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { deleteIssues, archive } from '@/api/process-boot/electricitymanagement'
|
||||
import { deleteIssues } from '@/api/process-boot/electricitymanagement'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const dictData = useDictData()
|
||||
const FillingRef = ref()
|
||||
|
||||
const showNewlyAdded = ref(false)
|
||||
const dialogVisible = ref(false)
|
||||
const recordingRef = ref(false)
|
||||
const TableHeaderRef = ref()
|
||||
const detailRef = ref()
|
||||
const EquipmentRef = ref()
|
||||
const problemData = dictData.getBasicData('Problem_Sources')
|
||||
const fillingProgress = dictData.getBasicData('Fill_Progress')
|
||||
const auditStatus = dictData.getBasicData('Audit_Status')
|
||||
@@ -101,9 +99,7 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: async row => {
|
||||
detailRef.value.open(row)
|
||||
}
|
||||
click: async row => {}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
@@ -118,19 +114,12 @@ const tableStore: any = new TableStore({
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
dialogVisible.value = true
|
||||
setTimeout(() => {
|
||||
FillingRef.value.open(row)
|
||||
}, 10)
|
||||
}
|
||||
click: row => {}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '归档',
|
||||
disabled: row => {
|
||||
return !(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success')
|
||||
},
|
||||
|
||||
type: 'primary',
|
||||
icon: 'el-icon-SuccessFilled',
|
||||
render: 'basicButton',
|
||||
@@ -140,25 +129,16 @@ const tableStore: any = new TableStore({
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定归档?'
|
||||
},
|
||||
click: row => {
|
||||
archive(row.powerQualityProblemNo).then(() => {
|
||||
ElMessage.success('归档成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
click: row => {}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '审核记录',
|
||||
type: 'primary',
|
||||
disabled: row => {
|
||||
return row.reportProcessStatus == 'Init'
|
||||
},
|
||||
|
||||
icon: 'el-icon-PieChart',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
recordingRef.value.open(row)
|
||||
}
|
||||
click: row => {}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
@@ -172,9 +152,7 @@ const tableStore: any = new TableStore({
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除?'
|
||||
},
|
||||
disabled: row => {
|
||||
return row.reportProcess == 'Archived'
|
||||
},
|
||||
|
||||
click: row => {
|
||||
deleteIssues(row.powerQualityProblemNo).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
@@ -209,16 +187,6 @@ onMounted(() => {
|
||||
})
|
||||
// 新增
|
||||
const add = () => {
|
||||
showNewlyAdded.value = true
|
||||
}
|
||||
|
||||
// 关闭弹框
|
||||
const handleClose = () => {
|
||||
showNewlyAdded.value = false
|
||||
}
|
||||
// 关闭 填报
|
||||
const beforeClose = () => {
|
||||
dialogVisible.value = false
|
||||
tableStore.index()
|
||||
EquipmentRef.value.open('新增资产')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<el-form-item label="上级菜单">
|
||||
<el-cascader
|
||||
v-model="form.pid"
|
||||
clearable
|
||||
:options="tableStore.table.data"
|
||||
:props="cascaderProps"
|
||||
style="width: 100%"
|
||||
|
||||
Reference in New Issue
Block a user