Parcourir la source

feat: 详情,写死假数据演示。

luoyali il y a 1 an
Parent
commit
f9f72e4057
1 fichiers modifiés avec 12 ajouts et 3 suppressions
  1. 12 3
      src/views/approve/components/approvedContent.vue

+ 12 - 3
src/views/approve/components/approvedContent.vue

@@ -38,7 +38,10 @@
 					<div class="scroll-wrap">
 						<!-- 表单 -->
 						<div v-loading="validateForm.loading" class="form-wrap">
-							<FormCreate v-show="validateForm.rule.length" v-model:api="validateForm.api" :option="validateForm.option" :rule="validateForm.rule" />
+							<!--
+              <FormCreate v-show="validateForm.rule.length" v-model:api="validateForm.api" :option="validateForm.option" :rule="validateForm.rule" />
+              -->
+							<er-form-preview ref="EReditorRef" :is-show-complete-button="false" />
 							<LeNoData v-if="!validateForm.rule.length" message="表单无数据" />
 						</div>
 
@@ -126,7 +129,7 @@
 										<el-icon><Plus /></el-icon>
 										加签
 									</el-dropdown-item>
-									<el-dropdown-item @click.native="openComment('loseSignVisible')" v-if="false">
+									<el-dropdown-item v-if="false" @click.native="openComment('loseSignVisible')">
 										<el-icon><Minus /></el-icon>
 										减签
 									</el-dropdown-item>
@@ -196,6 +199,7 @@ import RollbackDialog from './rollbackDialog'
 import viewForm from '@/utils/form'
 import { storeToRefs } from 'pinia'
 import { ElMessage, ElMessageBox } from 'element-plus'
+import { erFormPreview } from 'everright-formeditor'
 
 defineProps({
 	/**
@@ -227,7 +231,9 @@ const activeData = ref([])
 const currentType = ref(null)
 const currentFormData = ref({})
 // 当前form 表单数据字符串
-let cur_processForm_str = '[]'
+let cur_processForm_str =
+	'{"formStructure":{"list":[{"type":"inline","columns":["G87FL_bjPlVjZjSd2P3SE"],"style":{},"id":"XqyjpOONTVRdA9XeA667G","key":"inline_XqyjpOONTVRdA9XeA667G"},{"type":"inline","columns":["fg_137feCy7pJSJs9sOaU"],"style":{},"id":"RsbiEBhHked3LYw_GDwYt","key":"inline_RsbiEBhHked3LYw_GDwYt"}],"config":{"isSync":true,"pc":{"size":"default","labelPosition":"left","completeButton":{"text":"提交","color":"","backgroundColor":""}},"mobile":{"labelPosition":"left","completeButton":{"text":"提交","color":"","backgroundColor":""}}},"fields":[{"type":"input","label":"姓名","icon":"input","key":"input_name","id":"G87FL_bjPlVjZjSd2P3SE","options":{"clearable":true,"isShowWordLimit":false,"renderType":1,"disabled":false,"showPassword":false,"defaultValue":"","placeholder":"请输入","labelWidth":100,"isShowLabel":true,"required":false,"min":null,"max":null},"style":{"width":{"pc":"100%","mobile":"100%"}}},{"type":"input","label":"别名","icon":"input","key":"input_alias","id":"fg_137feCy7pJSJs9sOaU","options":{"clearable":true,"isShowWordLimit":false,"renderType":1,"disabled":false,"showPassword":false,"defaultValue":"","placeholder":"请输入","labelWidth":100,"isShowLabel":true,"required":false,"min":null,"max":null},"style":{"width":{"pc":"100%","mobile":"100%"}}}],"data":{},"logic":{}},"formData":{"input_name":"罗小胖","input_alias":"luoxiaopang"}}'
+const EReditorRef = ref()
 const taskId = computed(() => {
 	return currentTaskRow.value.taskId || ''
 })
@@ -337,6 +343,9 @@ const getTaskDetail = () => {
 						showValue
 					}
 				})*/
+				const { formStructure, formData } = JSON.parse(cur_processForm_str)
+				EReditorRef.value.setData(formStructure, formData)
+				return
 				const forms = JSON.parse(data.formContent)
 				cur_processForm_str = data.formContent
 				if (Array.isArray(forms)) {