Bläddra i källkod

feat: 添加表单字段

Lesan 5 månader sedan
förälder
incheckning
77e84cc4fa

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 1
src/views/bpm/model/form/ExtraSettings.vue


+ 10 - 6
src/views/bpm/model/form/PrintTemplate/Index.vue

@@ -76,8 +76,11 @@ onBeforeUnmount(() => {
 <template>
   <el-dialog v-model="dialogVisible" title="自定义模板" fullscreen>
     <div style="margin: 0 10px;">
-      <el-alert title="输入 @ 可选择插入流程表单选项和默认选项" type="info" show-icon
-                :closable="false"/>
+      <el-alert
+        title="输入 @ 可选择插入流程表单选项和默认选项"
+        type="info"
+        show-icon
+        :closable="false"/>
     </div>
     <div style="border: 1px solid #ccc;margin: 10px;">
       <Toolbar
@@ -91,11 +94,12 @@ onBeforeUnmount(() => {
         v-model="valueHtml"
         :defaultConfig="editorConfig"
         :editorId="editorId"
-        @onCreated="handleCreated"
+        @on-created="handleCreated"
       />
-      <MentionModal v-if="isShowModal"
-                    @hideMentionModal="hideModal"
-                    @insertMention="insertMention"/>
+      <MentionModal
+        v-if="isShowModal"
+        @hide-mention-modal="hideModal"
+        @insert-mention="insertMention"/>
     </div>
     <div style="margin-right: 10px;float: right;">
       <el-button @click="dialogVisible = false">取 消</el-button>

+ 11 - 1
src/views/bpm/model/form/PrintTemplate/MentionModal.vue

@@ -14,7 +14,7 @@ const list = ref([
   {id: 'endTime', name: '发起时间'},
   {id: 'processStatus', name: '流程状态'},
   {id: 'processResult', name: '流程结果'},
-  {id: 'printUsername', name: '打印人'},
+  {id: 'printUser', name: '打印人'},
   {id: 'printTime', name: '打印时间'},
 ])
 const searchedList = computed(() => {
@@ -41,7 +41,17 @@ const insertMentionHandler = (id, name) => {
   emit('hideMentionModal')
 }
 
+const formFields = inject('formFieldsObj')
 onMounted(()=> {
+  if (formFields.value && formFields.value.length > 0) {
+    const cloneFormField = formFields.value.map((item) => {
+      return {
+        name: '[表单]'+item.title,
+        id: item.field
+      }
+    })
+    list.value.push(...cloneFormField)
+  }
   const domSelection = document.getSelection()
   const domRange = domSelection?.getRangeAt(0)
   if (domRange == null) return