|
@@ -6,11 +6,17 @@ import { ColumnConfigType } from '@/components/ATable/type'
|
|
|
import { StrAnyObj, StrAnyObjArr } from '@/typings'
|
|
|
import { useHandleData } from '@/utils/useHandleData'
|
|
|
import {
|
|
|
+ getDefinitionPageApi,
|
|
|
+ getDefinitionApi,
|
|
|
addDefinitionApi,
|
|
|
+ updateDefinitionApi,
|
|
|
deleteDefinitionApi,
|
|
|
- getDefinitionApi,
|
|
|
- getDefinitionPageApi,
|
|
|
- updateDefinitionApi
|
|
|
+ getChartNoColorApi,
|
|
|
+ activeApi,
|
|
|
+ unActiveApi,
|
|
|
+ publishApi,
|
|
|
+ unPublishApi,
|
|
|
+ copyDefApi
|
|
|
} from '@/api/flow/definition'
|
|
|
import Design from '@/views/flow/definition/design.vue'
|
|
|
|
|
@@ -30,6 +36,9 @@ const formData = ref<StrAnyObj>({})
|
|
|
const dialogTitle = ref<string>('')
|
|
|
const dialogVisible = ref<boolean>(false)
|
|
|
|
|
|
+const chartVisible = ref(false)
|
|
|
+const imgUrl = ref('')
|
|
|
+
|
|
|
const queryConfig: FormConfigType[] = [
|
|
|
{
|
|
|
type: 'input',
|
|
@@ -114,8 +123,77 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ text: '流程图',
|
|
|
+ click(row) {
|
|
|
+ getChartNoColorApi(row.id).then((resp) => {
|
|
|
+ chartVisible.value = true
|
|
|
+ imgUrl.value = 'data:image/gif;base64,' + resp
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '发布',
|
|
|
+ if: (row) => row.isPublish === 0,
|
|
|
+ click(row) {
|
|
|
+ useHandleData(`是否发布流程编码为【${row.flowCode}】的数据项?`, () => {
|
|
|
+ publishApi(row.id).then(() => {
|
|
|
+ ElMessage.success('发布成功')
|
|
|
+ getPage()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '取消发布',
|
|
|
+ if: (row) => row.isPublish === 1,
|
|
|
+ click(row) {
|
|
|
+ useHandleData(`是否取消发布流程编码为【${row.flowCode}】的数据项?`, () => {
|
|
|
+ unPublishApi(row.id).then(() => {
|
|
|
+ ElMessage.success('取消发布成功')
|
|
|
+ getPage()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '激活',
|
|
|
+ if: (row) => row.activityStatus === 0,
|
|
|
+ click(row) {
|
|
|
+ useHandleData(`是否激活流程编码为【${row.flowCode}】的数据项?`, () => {
|
|
|
+ activeApi(row.id).then(() => {
|
|
|
+ ElMessage.success('激活成功')
|
|
|
+ getPage()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '挂起',
|
|
|
+ if: (row) => row.activityStatus === 1,
|
|
|
+ click(row) {
|
|
|
+ useHandleData(`是否挂起流程编码为【${row.flowCode}】的数据项?`, () => {
|
|
|
+ unActiveApi(row.id).then(() => {
|
|
|
+ ElMessage.success('挂起成功')
|
|
|
+ getPage()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '复制流程',
|
|
|
+ click(row) {
|
|
|
+ useHandleData(`是否复制流程编码为【${row.flowCode}】的数据项?`, () => {
|
|
|
+ copyDefApi(row.id).then(() => {
|
|
|
+ ElMessage.success('复制成功')
|
|
|
+ getPage()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
common: 'update',
|
|
|
permissions: 'sysConfig:edit',
|
|
|
+ if: (row) => row.isPublish === 0,
|
|
|
click(row) {
|
|
|
dialogVisible.value = true
|
|
|
dialogTitle.value = '编辑'
|
|
@@ -130,6 +208,7 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
{
|
|
|
common: 'delete',
|
|
|
permissions: 'sysConfig:delete',
|
|
|
+ if: (row) => row.isPublish === 0,
|
|
|
click(row) {
|
|
|
handleRemove(row.id)
|
|
|
}
|
|
@@ -277,5 +356,9 @@ function handleRemove(id: string) {
|
|
|
</a-dialog>
|
|
|
|
|
|
<design ref="designVisibleRef" v-model="designVisible" />
|
|
|
+
|
|
|
+ <a-dialog title="流程图" v-model="chartVisible" width="80%" :footer="false" append-to-body>
|
|
|
+ <img :src="imgUrl" width="100%" style="margin: 0 auto" alt="" />
|
|
|
+ </a-dialog>
|
|
|
</div>
|
|
|
</template>
|