lanceJiang 1 жил өмнө
parent
commit
247e6e8c08

+ 5 - 2
src/views/flow/create/business.vue

@@ -23,7 +23,7 @@
 				</div>
 			</div>
 			<div class="create-approval-header-right">
-				<el-button type="primary" @click="submitHandler">发布</el-button>
+				<el-button v-show="!isView" type="primary" @click="submitHandler">发布</el-button>
 			</div>
 		</div>
 		<div class="create-approval-main">
@@ -169,7 +169,10 @@ const activeComponent = index => {
 }
 
 const queryObj = computed(() => route.query)
-
+// 纯查看判断
+const isView = computed(() => {
+	return queryObj.value?.view === '1'
+})
 const getCurrentProcessDetailEv = () => {
 	let _id = queryObj.value.id
 	if (_id) {

+ 5 - 2
src/views/flow/create/child.vue

@@ -23,7 +23,7 @@
 				</div>
 			</div>
 			<div class="create-approval-header-right">
-				<el-button type="primary" @click="submitHandler">发布</el-button>
+				<el-button v-show="!isView" type="primary" @click="submitHandler">发布</el-button>
 			</div>
 		</div>
 		<div class="create-approval-main">
@@ -162,7 +162,10 @@ const activeComponent = index => {
 }
 
 const queryObj = computed(() => route.query)
-
+// 纯查看判断
+const isView = computed(() => {
+	return queryObj.value?.view === '1'
+})
 const getCurrentProcessDetailEv = () => {
 	let _id = queryObj.value.id
 	if (_id) {

+ 5 - 3
src/views/flow/create/index.vue

@@ -23,7 +23,7 @@
 				</div>
 			</div>
 			<div class="create-approval-header-right">
-				<el-button type="primary" @click="submitHandler">发布</el-button>
+				<el-button v-show="!isView" type="primary" @click="submitHandler">发布</el-button>
 			</div>
 		</div>
 		<div class="create-approval-main">
@@ -49,7 +49,6 @@ const router = useRouter()
 const route = useRoute()
 const flowStore = useFlowStore()
 const { categoryId, processId, processIcon, processKey, processName, remark, modelContent, processForm, processSetting } = storeToRefs(flowStore)
-
 const compRefs = ref() // 实例化子组件
 const cache_components = ref({})
 const componentsArr = [
@@ -176,7 +175,10 @@ const activeComponent = index => {
 }
 
 const queryObj = computed(() => route.query)
-
+// 纯查看判断
+const isView = computed(() => {
+	return queryObj.value?.view === '1'
+})
 const getCurrentProcessDetailEv = () => {
 	let _id = queryObj.value.id
 	if (_id) {

+ 14 - 6
src/views/flow/group/components/historyProcessList.vue

@@ -28,7 +28,7 @@
 				</el-tooltip>
 				<el-divider direction="vertical"></el-divider>
 				<el-tooltip content="预览" placement="bottom" effect="light">
-					<el-icon class="ibt0">
+					<el-icon class="ibt0" @click="previewHistoryEv(scope.row)">
 						<View />
 					</el-icon>
 				</el-tooltip>
@@ -43,14 +43,18 @@ import process from '@/api/flow/process'
 import { useTablePage } from '@/hooks/useTablePage'
 import { flowIconPrefix } from '@/utils/index'
 import { ElMessage } from 'element-plus'
+import router from '@/router'
 const props = defineProps({
 	modelValue: {
 		type: Boolean,
 		default: false
 	},
-	processId: {
-		type: String,
-		default: undefined
+	item: {
+		type: Object,
+		default: () => ({
+			processId: undefined,
+			processType: undefined
+		})
 	}
 })
 
@@ -67,7 +71,7 @@ const queryList = async () => {
 	const { options, searchParams } = tableOpts
 	options.loading = true
 	try {
-		const { records: list, total } = await process.pageHistoryListApi({ ...searchParams, data: { processId: props.processId } })
+		const { records: list, total } = await process.pageHistoryListApi({ ...searchParams, data: { processId: props.item.processId } })
 		tableOpts.total = total
 		tableOpts.list = list
 	} catch {
@@ -146,7 +150,11 @@ const checkoutHistoryEv = async row => {
 		$myEmit('successFn')
 	} catch (e) {}
 }
-
+// 预览历史
+const previewHistoryEv = async (row) => {
+	const _path = { main: 'index', business: 'business', child: 'child' }[props.item.processType] || 'index'
+	router.push(`/flow_create/${_path}?view=1&id=${row.id}`)
+}
 // 弹窗显隐
 const visibleDialog = computed({
 	get() {

+ 9 - 3
src/views/flow/group/components/listGroup.vue

@@ -124,7 +124,13 @@
 		</draggable>
 
 		<!-- 历史流程签出 -->
-		<history-process-list v-if="visibleHistory" ref="historyDialog" v-model="visibleHistory" :process-id="currentProcessId" @successFn="flowGroupListAll"></history-process-list>
+		<history-process-list
+			v-if="visibleHistory"
+			ref="historyDialog"
+			v-model="visibleHistory"
+			:item="currentProcess"
+			@success-fn="flowGroupListAll"
+		></history-process-list>
 	</div>
 </template>
 
@@ -143,7 +149,7 @@ import HistoryProcessList from './historyProcessList.vue'
 const categoryList = ref<any[]>([])
 const hideAddInput = ref(true)
 const visibleHistory = ref(false)
-const currentProcessId = ref('')
+const currentProcess = ref({})
 const listGroupName = ref('')
 const dragOptions = {
 	animation: 200,
@@ -297,7 +303,7 @@ const updateEv = async (element: any) => {
 
 // 打开当前流程的历史版本
 const historyEv = (element: any) => {
-	currentProcessId.value = element.processId
+	currentProcess.value = element
 	visibleHistory.value = !visibleHistory.value
 }