diff --git a/.env.development b/.env.development
index 848a90a..16407bf 100644
--- a/.env.development
+++ b/.env.development
@@ -3,7 +3,7 @@ ENV = 'development'
# 接口地址
# 许镇-本地服地址
-VUE_APP_BASE_API = 'http://192.168.99.72:11200'
+VUE_APP_BASE_API = 'http://192.168.99.63:11200'
# VUE_APP_BASE_API = 'http://192.168.99.72:11110'
# 107
@@ -11,6 +11,6 @@ VUE_APP_BASE_API = 'http://192.168.99.72:11200'
# VUE_APP_BASE_API = 'http://192.168.99.107:11200'
VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:12123'
-# VUE_APP_PROCESSMODEL_API = 'http://192.168.99.72:11200'
+VUE_APP_PROCESSMODEL_API = 'http://192.168.99.63:8080'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/src/utils/request.js b/src/utils/request.js
index d27feee..9e5e59f 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -48,7 +48,7 @@ service.interceptors.response.use(
return response.data
} else {
Message.error({
- message: errorMsg,
+ message: errorMsg || '数据请求失败',
duration: 5000
})
return Promise.reject(errorMsg)
diff --git a/src/views/archivesManage/managementLibrary/anjuan/tableList.vue b/src/views/archivesManage/managementLibrary/anjuan/tableList.vue
index 755bc5a..6854967 100644
--- a/src/views/archivesManage/managementLibrary/anjuan/tableList.vue
+++ b/src/views/archivesManage/managementLibrary/anjuan/tableList.vue
@@ -10,6 +10,7 @@
highlight-current-row
style="width: 100%;"
height="calc(100vh - 364px)"
+ :default-sort="{ prop: '', order: '' }"
:row-class-name="tableRowClassName"
:row-key="rowKey"
@select-all="selectAll"
@@ -19,6 +20,7 @@
@select="handleCurrentChange"
@mousedown.native="onMouseDown"
@mouseup.native="onMouseUp"
+ @sort-change="handleSortChange"
>
@@ -27,12 +29,12 @@
-
+
{{ scope.row.child === '' ? 0 : scope.row.child }}
-
+
`${k}:${v}`)
+ .join(',')
+
+ this.$nextTick(() => {
+ const table = this.$refs.table
+ table.columns.forEach(col => {
+ const order = this.sortMap[col.property]
+ if (order === 'asc') {
+ col.order = 'ascending'
+ } else if (order === 'desc') {
+ col.order = 'descending'
+ } else {
+ col.order = null
+ }
+ })
+ })
+
+ this.page.page = 0
+ this.currentPage = 1
+ this.loadTableData()
+ },
+ loadTableData() {
+ if (this.selectedCategory.arrangeType === 3) {
+ this.getViewTableList(2, this.parentsData.parentsProjectId, '')
+ } else if (this.selectedCategory.arrangeType === 1) {
+ this.getViewTableList(3, null, '')
+ } else {
+ this.getViewTableList(2, null, '')
+ }
+ },
// 触发单选
handleCurrentChange(selection, row) {
this.selections = selection
@@ -305,25 +368,13 @@ export default {
this.page.size = size
this.page.page = 0
localStorage.setItem('currentPageSize', size)
- if (this.selectedCategory.arrangeType === 3) {
- this.getViewTable(2, this.parentsData.parentsProjectId)
- } else if (this.selectedCategory.arrangeType === 1) {
- this.getViewTable(3, null)
- } else {
- this.getViewTable(2, null)
- }
+ this.loadTableData()
},
handleCurrentPage(pageVal) {
this.currentPage = pageVal
this.page.page = pageVal - 1
localStorage.setItem('currentPage', JSON.stringify(this.page.page))
- if (this.selectedCategory.arrangeType === 3) {
- this.getViewTable(2, this.parentsData.parentsProjectId)
- } else if (this.selectedCategory.arrangeType === 1) {
- this.getViewTable(3, null)
- } else {
- this.getViewTable(2, null)
- }
+ this.loadTableData()
}
}
}
diff --git a/src/views/archivesManage/managementLibrary/mixins/index.js b/src/views/archivesManage/managementLibrary/mixins/index.js
index 4afb188..31dd9fc 100644
--- a/src/views/archivesManage/managementLibrary/mixins/index.js
+++ b/src/views/archivesManage/managementLibrary/mixins/index.js
@@ -165,7 +165,8 @@ export const manageLibraryCrud = {
'size': this.page.size,
'sort': this.arrySort,
'canOpen': this.parentsData.checklist && this.parentsData.checklist.length === 0 ? null : (this.parentsData.checklist && this.parentsData.checklist.includes(1) ? true : null),
- 'canDestroy': this.parentsData.checklist && this.parentsData.checklist.length === 0 ? null : (this.parentsData.checklist && this.parentsData.checklist.includes(2) ? true : null)
+ 'canDestroy': this.parentsData.checklist && this.parentsData.checklist.length === 0 ? null : (this.parentsData.checklist && this.parentsData.checklist.includes(2) ? true : null),
+ 'handOrder': this.handOrder
}
FetchInitContorlView(params).then((res) => {
if (res.code !== 500) {
diff --git a/src/views/archivesManage/openInventory/index.vue b/src/views/archivesManage/openInventory/index.vue
index 4e55120..55a4640 100644
--- a/src/views/archivesManage/openInventory/index.vue
+++ b/src/views/archivesManage/openInventory/index.vue
@@ -8,7 +8,7 @@
v-model="status"
style="margin-right: 10px; width: 110px;"
placeholder="请选择"
- @change="getBusinessFlowHistory"
+ @change="handleStatusChange"
>
res.blob()).then(blob => {
+ // downloadFile(blob, this.rowCurrent.title, 'zip')
+ // }).catch(() => {
+ // this.$message({ message: '下载文件失败', type: 'error', offset: 8 })
+ // })
+ // } else {
+ // this.$message({ message: '下载文件路径获取失败', type: 'error', offset: 8 })
+ // }
+ // }
downloadFile() {
+ // bucketType = 3 离线下载
if (this.rowCurrent.zip_path) {
- const url = this.baseApi + '/downloadFile' + this.rowCurrent.zip_path
- fetch(url).then(res => res.blob()).then(blob => {
+ const url = this.baseApi + '/api/minioUpload/getFile?filePath=' + this.rowCurrent.zip_path + '&bucketType=3'
+ const fetchOptions = {
+ method: 'GET',
+ headers: {
+ 'Authorization': getToken()
+ }
+ }
+ fetch(url, fetchOptions).then(res => res.blob()).then(blob => {
downloadFile(blob, this.rowCurrent.title, 'zip')
+ this.downloading = false
}).catch(() => {
this.$message({ message: '下载文件失败', type: 'error', offset: 8 })
+ this.downloading = false
})
} else {
this.$message({ message: '下载文件路径获取失败', type: 'error', offset: 8 })
diff --git a/src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue b/src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
index 9f03e91..9d2be86 100644
--- a/src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
+++ b/src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
@@ -10,6 +10,7 @@
highlight-current-row
style="width: 100%;"
height="calc(100vh - 418px)"
+ :default-sort="{ prop: '', order: '' }"
:row-class-name="tableRowClassName"
:row-key="rowKey"
@select-all="selectAll"
@@ -19,6 +20,7 @@
@select="handleCurrentChange"
@mousedown.native="onMouseDown"
@mouseup.native="onMouseUp"
+ @sort-change="handleSortChange"
>
@@ -27,12 +29,12 @@
-
+
{{ scope.row.child === '' ? 0 : scope.row.child }}
-
+
`${k}:${v}`)
+ .join(',')
+
+ this.$nextTick(() => {
+ const table = this.$refs.table
+ table.columns.forEach(col => {
+ const order = this.sortMap[col.property]
+ if (order === 'asc') {
+ col.order = 'ascending'
+ } else if (order === 'desc') {
+ col.order = 'descending'
+ } else {
+ col.order = null
+ }
+ })
+ })
+
+ this.page.page = 0
+ this.currentPage = 1
+ this.loadTableData()
+ },
+ loadTableData() {
+ if (this.activeIndex === 1) {
+ this.getViewTableList(3, null, '')
+ } else {
+ if (this.selectedCategory.arrangeType === 3) {
+ this.getViewTableList(2, this.parentsData.parentsProjectId, '')
+ } else if (this.selectedCategory.arrangeType === 1) {
+ this.getViewTableList(3, null, '')
+ } else {
+ this.getViewTableList(2, null, '')
+ }
+ }
+ },
// 触发单选
handleCurrentChange(selection, row) {
this.selections = selection
@@ -281,33 +350,13 @@ export default {
this.page.size = size
this.page.page = 0
localStorage.setItem('currentPageSize', size)
- if (this.activeIndex === 1) {
- this.getViewTable(3, null)
- } else {
- if (this.selectedCategory.arrangeType === 3) {
- this.getViewTable(2, this.parentsData.parentsProjectId)
- } else if (this.selectedCategory.arrangeType === 1) {
- this.getViewTable(3, null)
- } else {
- this.getViewTable(2, null)
- }
- }
+ this.loadTableData()
},
handleCurrentPage(pageVal) {
this.currentPage = pageVal
this.page.page = pageVal - 1
localStorage.setItem('currentPage', JSON.stringify(this.page.page))
- if (this.activeIndex === 1) {
- this.getViewTable(3, null)
- } else {
- if (this.selectedCategory.arrangeType === 3) {
- this.getViewTable(2, this.parentsData.parentsProjectId)
- } else if (this.selectedCategory.arrangeType === 1) {
- this.getViewTable(3, null)
- } else {
- this.getViewTable(2, null)
- }
- }
+ this.loadTableData()
}
}
}
diff --git a/src/views/collectReorganizi/collectionLibrary/file/index.vue b/src/views/collectReorganizi/collectionLibrary/file/index.vue
index e673d9e..7045db1 100644
--- a/src/views/collectReorganizi/collectionLibrary/file/index.vue
+++ b/src/views/collectReorganizi/collectionLibrary/file/index.vue
@@ -101,6 +101,7 @@ import { header, form } from '@crud/crud'
import CollectHeader from '../module/collectHeader'
import { mapGetters } from 'vuex'
import { downloadFile } from '@/utils/index'
+import { getToken } from '@/utils/auth'
export default {
name: 'File',
components: { CollectHeader },
@@ -323,12 +324,28 @@ export default {
localStorage.setItem('fileCurrent', JSON.stringify(row))
},
// 下载附件
+ // downloadFile(row) {
+ // const url = this.baseApi + '/downloadFile' + row.file_path
+ // fetch(url).then(res => res.blob()).then(blob => {
+ // downloadFile(blob, row.file_name.split('.')[0], row.file_type)
+ // }).catch(() => {
+ // this.$message({ message: '下载文件失败!', type: 'error', offset: 8 })
+ // })
+ // }
downloadFile(row) {
- const url = this.baseApi + '/downloadFile' + row.file_path
- fetch(url).then(res => res.blob()).then(blob => {
+ const url = this.baseApi + '/api/minioUpload/getFile?filePath=' + row.file_path + '&bucketType=2'
+ const fetchOptions = {
+ method: 'GET',
+ headers: {
+ 'Authorization': getToken()
+ }
+ }
+ fetch(url, fetchOptions).then(res => res.blob()).then(blob => {
downloadFile(blob, row.file_name.split('.')[0], row.file_type)
+ this.downloading = false
}).catch(() => {
- this.$message({ message: '下载文件失败!', type: 'error', offset: 8 })
+ this.$message({ message: '下载文件失败', type: 'error', offset: 8 })
+ this.downloading = false
})
}
}
diff --git a/src/views/collectReorganizi/collectionLibrary/mixins/index.js b/src/views/collectReorganizi/collectionLibrary/mixins/index.js
index c0fecf7..c44e235 100644
--- a/src/views/collectReorganizi/collectionLibrary/mixins/index.js
+++ b/src/views/collectReorganizi/collectionLibrary/mixins/index.js
@@ -146,7 +146,8 @@ export const collectionLibraryCrud = {
'archive_ctg_no': this.query.archive_ctg_no,
'page': this.page.page,
'size': this.page.size,
- 'sort': this.arrySort
+ 'sort': this.arrySort,
+ 'handOrder': this.handOrder
}
FetchInitCategoryView(params).then((res) => {
if (res.code !== 500) {
diff --git a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
index 8e36ba7..0b23cad 100644
--- a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
+++ b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
@@ -396,6 +396,7 @@ import qs from 'qs'
import { downloadFile, exportFile } from '@/utils/index'
import { mapGetters } from 'vuex'
import elDragDialog from '@/utils/dialog'
+import { getToken } from '@/utils/auth'
export default {
name: 'CollectHeader',
@@ -1541,11 +1542,25 @@ export default {
this.$message({ message: '下载操作只可勾选唯一目标条目,请先确认!', offset: 8 })
return false
}
- const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
- fetch(url).then(res => res.blob()).then(blob => {
+ // const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
+ // fetch(url).then(res => res.blob()).then(blob => {
+ // downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
+ // }).catch(() => {
+ // this.$message({ message: '下载文件失败!', type: 'error', offset: 8 })
+ // })
+ const url = this.baseApi + '/api/minioUpload/getFile?filePath=' + this.selections[0].file_path + '&bucketType=2'
+ const fetchOptions = {
+ method: 'GET',
+ headers: {
+ 'Authorization': getToken()
+ }
+ }
+ fetch(url, fetchOptions).then(res => res.blob()).then(blob => {
downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
+ this.downloading = false
}).catch(() => {
- this.$message({ message: '下载文件失败!', type: 'error', offset: 8 })
+ this.$message({ message: '下载文件失败', type: 'error', offset: 8 })
+ this.downloading = false
})
},
// 回收站 - 恢复
diff --git a/src/views/components/category/PreviewForm.vue b/src/views/components/category/PreviewForm.vue
index e6b3f43..a6dbe7e 100644
--- a/src/views/components/category/PreviewForm.vue
+++ b/src/views/components/category/PreviewForm.vue
@@ -43,6 +43,8 @@
+
+
@@ -135,7 +148,7 @@
-
+
有
无
@@ -380,6 +393,48 @@ export default {
this.archivesType = null
this.activeIndex = null
},
+ // 根据数量自动同步「有无实体」单选框
+ syncEntityByQty(item) {
+ // 只处理这两个字段
+ if (item.fieldName !== 'doc_qty' && item.fieldName !== 'doc_qty_now') return
+
+ const val = Number(this.addOrUpdateForm[item.fieldName]) || 0
+
+ if (val === 0) {
+ // 输入 0 → 自动选 无实体
+ this.$set(this.addOrUpdateForm, 'is_entity', 0)
+ } else if (val > 0) {
+ // 输入 >0 → 自动选 有实体
+ this.$set(this.addOrUpdateForm, 'is_entity', 1)
+ }
+
+ // 触发实体切换逻辑(自动赋值、校验)
+ this.handleEntityChange(this.addOrUpdateForm.is_entity)
+ },
+ // 有无实体切换
+ handleEntityChange(val) {
+ // 找到这两个字段
+ // const qtyField = this.formPreviewData.find(item => item.fieldName === 'doc_qty')
+ // const qtyNowField = this.formPreviewData.find(item => item.fieldName === 'doc_qty_now')
+
+ if (val === 1) {
+ // 有实体 → 默认 1
+ this.$set(this.addOrUpdateForm, 'doc_qty', 1)
+ this.$set(this.addOrUpdateForm, 'doc_qty_now', 1)
+ } else {
+ // 无实体 → 必须 ≤0
+ this.$set(this.addOrUpdateForm, 'doc_qty', 0)
+ this.$set(this.addOrUpdateForm, 'doc_qty_now', 0)
+ }
+
+ // 重新触发表单校验(防止红色提示不消失)
+ this.$nextTick(() => {
+ if (this.$refs.addOrUpdateForm) {
+ this.$refs.addOrUpdateForm.validateField('doc_qty')
+ this.$refs.addOrUpdateForm.validateField('doc_qty_now')
+ }
+ })
+ },
shouldShowIcon(item) {
if (item.isInputClass !== 'number') return false
const ruleKey = `${this.isTitleType}-${this.selectedCategory.arrangeType}`
@@ -1317,6 +1372,19 @@ export default {
}
}
+ if (item.fieldName === 'doc_qty' || item.fieldName === 'doc_qty_now') {
+ rule.validator = (rule, value, callback) => {
+ // 无实体时不能 > 0
+ if (this.addOrUpdateForm.is_entity === 0) {
+ if (value > 0) {
+ callback(new Error('无实体时数量不能大于 0'))
+ return
+ }
+ }
+ callback()
+ }
+ }
+
// 获取当前字段在表单数据中的实际值
const fieldValue = this.addOrUpdateForm[item.fieldName]
if (item.isDataType && fieldValue) {
diff --git a/src/views/system/archivesCategory/listBrowsing/index.vue b/src/views/system/archivesCategory/listBrowsing/index.vue
index 61049fc..ba4b97e 100644
--- a/src/views/system/archivesCategory/listBrowsing/index.vue
+++ b/src/views/system/archivesCategory/listBrowsing/index.vue
@@ -61,10 +61,10 @@
-
+
-
+
{{ scope.row[field.fieldName] }}
@@ -130,6 +130,31 @@ export default {
this.initData()
},
methods: {
+ handleHeaderDragend(newWidth) {
+ const tableColumns = this.$refs.table.columns
+ if (!tableColumns) return
+
+ let targetIndex = -1
+ tableColumns.forEach((col, index) => {
+ if (col.realWidth === newWidth && col.width === newWidth) {
+ targetIndex = index
+ }
+ })
+
+ const fieldIndex = targetIndex - 1
+ if (fieldIndex < 0 || fieldIndex >= this.table.right.data.length) return
+ const field = this.table.right.data[fieldIndex]
+ field.displayLength = newWidth
+
+ console.log('✅ 拖动列成功:')
+ console.log('字段对象:', field)
+ console.log('字段中文名:', field?.fieldCnName)
+ console.log('字段英文名:', field?.fieldName)
+ console.log('拖动后新宽度:', newWidth)
+ console.log('列索引:', targetIndex - 1)
+
+ this.$refs.cuform.saveDragWidth([field])
+ },
initData() {
this.getDisplayFieldData()
this.getBottomTableData()
@@ -221,4 +246,8 @@ export default {
// text-overflow: unset !important;
// white-space: nowrap !important;
// }
+::v-deep .el-table--group,
+::v-deep .el-table--border{
+ border: none !important;
+}
diff --git a/src/views/system/archivesCategory/listBrowsing/module/form.vue b/src/views/system/archivesCategory/listBrowsing/module/form.vue
index 702c598..f2aa2c2 100644
--- a/src/views/system/archivesCategory/listBrowsing/module/form.vue
+++ b/src/views/system/archivesCategory/listBrowsing/module/form.vue
@@ -87,6 +87,21 @@ export default {
this.$message({ message: '保存成功', type: 'success', offset: 8 })
this.$emit('refresh')
})
+ },
+ // 新增:供父组件拖动列宽调用
+ saveDragWidth(fields) {
+ this.loading = true
+ edit(fields).then((res) => {
+ this.$message({
+ message: '列宽保存成功',
+ type: 'success',
+ offset: 8
+ })
+ this.loading = false
+ this.$emit('refresh')
+ }).catch(() => {
+ this.loading = false
+ })
}
}
}
diff --git a/src/views/system/archivesCategory/processManage/index.vue b/src/views/system/archivesCategory/processManage/index.vue
index 6de5926..2d61b18 100644
--- a/src/views/system/archivesCategory/processManage/index.vue
+++ b/src/views/system/archivesCategory/processManage/index.vue
@@ -93,11 +93,11 @@ export default {
this.editInfoFlow = null
this.$message({ message: '数据请求失败', type: 'error', offset: 8 })
}
-
+ console.log('this.editInfoFlow', this.editInfoFlow)
this.$nextTick(() => {
this.$refs.cuform.cuDialogVisible = true
this.$refs.cuform.setPocessCurrent = item
- this.$refs.cuform.getEditInfoFlow = this.editInfoFlow
+ this.$refs.cuform.getEditInfoFlow = this.editInfoFlow ? this.editInfoFlow : {}
this.$refs.cuform.handleEditInfoFlow(this.editInfoFlow)
})
}).catch(err => {
diff --git a/src/views/system/archivesCategory/processManage/module/form.vue b/src/views/system/archivesCategory/processManage/module/form.vue
index 64c6549..ea79d80 100644
--- a/src/views/system/archivesCategory/processManage/module/form.vue
+++ b/src/views/system/archivesCategory/processManage/module/form.vue
@@ -126,19 +126,45 @@ export default {
this.getAllJob()
},
methods: {
+ // handleEditInfoFlow(newVal) {
+ // console.log('getEditInfoFlow', this.getEditInfoFlow)
+ // const findItem = this.findIdByModelId(newVal.flowId)
+ // this.form.model = findItem
+ // this.selectModel(findItem, newVal)
+ // },
+ // findIdByModelId(modelId) {
+ // const item = this.modelOptions.find(data => data.modelId === modelId)
+ // if (item) {
+ // return item
+ // } else {
+ // return null
+ // }
+ // },
handleEditInfoFlow(newVal) {
- console.log('getEditInfoFlow', this.getEditInfoFlow)
+ console.log('编辑回显数据:', newVal)
+
+ // 确保 form 存在 model 属性
+ if (!this.form.model) {
+ this.form.model = null
+ }
+
+ // 无数据直接清空返回
+ if (!newVal || !newVal.flowId) {
+ this.form.model = null
+ return
+ }
+
const findItem = this.findIdByModelId(newVal.flowId)
this.form.model = findItem
- this.selectModel(findItem, newVal)
+
+ this.$nextTick(() => {
+ if (findItem) {
+ this.selectModel(findItem, newVal)
+ }
+ })
},
findIdByModelId(modelId) {
- const item = this.modelOptions.find(data => data.modelId === modelId)
- if (item) {
- return item
- } else {
- return null
- }
+ return this.modelOptions.find(data => data.modelId === modelId) || null
},
getAllFlowable() {
FetchInitFlowAll().then((res) => {
@@ -246,13 +272,21 @@ export default {
}
})
},
- handleCloseDialog(done) {
- // 重置表单数据
- this.$refs.form.resetFields()
+ handleCloseDialog() {
+ // 重置为初始状态,而不是直接赋空对象
+ this.form = {
+ model: null
+ }
this.srcImg = ''
this.taskList = []
- this.form = {}
+ this.selectFlowVal = null
+ this.getEditInfoFlow = {}
this.cuDialogVisible = false
+
+ // 清除校验状态(必须加)
+ if (this.$refs.form) {
+ this.$refs.form.clearValidate()
+ }
}
}
}
diff --git a/src/views/system/processManage/index.vue b/src/views/system/processManage/index.vue
index aae9c40..1a63754 100644
--- a/src/views/system/processManage/index.vue
+++ b/src/views/system/processManage/index.vue
@@ -8,7 +8,7 @@
运行中流程
历史流程
流程部署
-
+ 模型设计
diff --git a/src/views/system/processManage/modelDesign/index.vue b/src/views/system/processManage/modelDesign/index.vue
index ad35157..75b11df 100644
--- a/src/views/system/processManage/modelDesign/index.vue
+++ b/src/views/system/processManage/modelDesign/index.vue
@@ -4,18 +4,21 @@
-
-
+
+
@@ -32,56 +35,56 @@ export default {
return {
loading: true,
url: '',
- isMaintenance: false
+ isMaintenance: false // 初始为false:默认加载失败
}
},
- created() {
- },
mounted() {
this.getIframeState()
},
methods: {
getIframeState() {
- // http://192.168.99.72:11200/flowable-ui/modeler/
- const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ProcessModelUrl : process.env.VUE_APP_PROCESSMODEL_API
+ // 拼接正确的Flowable地址(避免重复/flowable-ui/modeler路径)
+ const linkSrc = process.env.NODE_ENV === 'production'
+ ? window.g.ProcessModelUrl
+ : process.env.VUE_APP_PROCESSMODEL_API
+ // 去除linkSrc末尾的/,避免路径拼接重复
+ const baseUrl = linkSrc.replace(/\/$/, '')
+
if (this.currentModelId) {
- this.url = linkSrc + '/flowable-ui/modeler/#/processes/' + this.currentModelId
+ this.url = `${baseUrl}/flowable-ui/modeler/#/processes/${this.currentModelId}`
} else {
- this.url = linkSrc + '/flowable-ui/modeler'
+ this.url = `${baseUrl}/flowable-ui/modeler/#/processes` // 补全哈希路由,避免302
}
+ console.log('最终访问地址:', this.url)
- // fetch(this.url)
- // .then(response => {
- // console.log('response', response)
- // if (response.ok) {
- // this.isMaintenance = true
- // console.log('地址能正常运行')
- // this.$nextTick(() => {
- // const iframe = this.$refs.myIframe
- // iframe.addEventListener('load', () => {
- // if (iframe.contentWindow) {
- // // iframe内容已加载完成
- // console.log('iframe内容已加载完成')
- // this.loading = false
- // } else {
- // // iframe内容加载出现错误
- // console.log('iframe内容加载出现错误')
- // this.loading = false
- // }
- // })
- // })
- // } else {
- // this.isMaintenance = false
- // console.log('地址无法正常运行,状态码:', response.status)
- // }
- // this.loading = false
- // console.log('this.isMaintenance', this.isMaintenance)
- // })
- // .catch(error => {
- // console.log('地址无法正常运行,错误信息:', error)
- // this.isMaintenance = false
- // this.loading = false
- // })
+ // 检测地址是否可访问
+ fetch(this.url, {
+ method: 'HEAD', // 仅请求头,不加载正文,提升性能
+ mode: 'no-cors' // 避免跨域导致fetch失败(关键!)
+ })
+ .then(response => {
+ // no-cors模式下,response.ok始终为undefined,只要不进入catch就视为连通
+ this.isMaintenance = true
+ console.log('Flowable服务可连通')
+ })
+ .catch(error => {
+ this.isMaintenance = false
+ console.error('Flowable服务无法连通:', error)
+ })
+ .finally(() => {
+ this.loading = false
+ })
+ },
+ // iframe加载成功回调
+ iframeLoadSuccess() {
+ console.log('Flowable Modeler iframe加载完成')
+ this.loading = false
+ },
+ // iframe加载失败回调
+ iframeLoadError() {
+ console.error('Flowable Modeler iframe加载失败')
+ this.isMaintenance = false
+ this.loading = false
}
}
}
@@ -92,15 +95,16 @@ export default {
width: 100%;
height: calc(100vh - 215px);
}
-.maintenance-message{
+.maintenance-message {
display: flex;
+ flex-direction: column; // 改为列布局,图片和文字垂直居中
justify-content: center;
align-items: center;
height: calc(100vh - 215px);
- p{
+ p {
font-size: 26px;
font-weight: bold;
- margin-left: 20px;
+ margin-top: 20px;
color: #000;
}
}
diff --git a/src/views/system/processManage/runningProcess/module/detail.vue b/src/views/system/processManage/runningProcess/module/detail.vue
index 2ad9044..de33021 100644
--- a/src/views/system/processManage/runningProcess/module/detail.vue
+++ b/src/views/system/processManage/runningProcess/module/detail.vue
@@ -179,9 +179,17 @@ export default {
})
},
getProcessImg() {
+ console.log('this.isMessage2', this.isMessage)
+ console.log('this.selectCenterRow2', this.selectCenterRow)
+ console.log('this.selectRow2', this.selectRow)
+ console.log('this.baseInfo', this.baseInfo)
this.srcImg = ''
FetchGenProcessDiagram({ 'processId': this.isMessage ? this.baseInfo.procInstId : this.selectRow.procInstId }).then((res) => {
- this.srcImg = res
+ if (res.code !== 500) {
+ this.srcImg = res
+ } else {
+ this.srcImg = ''
+ }
}).catch(err => {
console.log(err)
})
diff --git a/src/views/system/user/processCenter/module/form.vue b/src/views/system/user/processCenter/module/form.vue
index dc6c957..8e49038 100644
--- a/src/views/system/user/processCenter/module/form.vue
+++ b/src/views/system/user/processCenter/module/form.vue
@@ -128,7 +128,11 @@ export default {
getProcessImg() {
this.srcImg = ''
FetchGenProcessDiagram({ 'processId': this.isMessage ? (this.baseInfo && this.baseInfo.procInstId) : this.selectRow.procInstId }).then((res) => {
- this.srcImg = res
+ if (res.code !== 500) {
+ this.srcImg = res
+ } else {
+ this.srcImg = ''
+ }
}).catch(err => {
console.log(err)
})