process.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <template>
  2. <xn-form-container
  3. v-model:visible="drawer"
  4. :destroy-on-close="true"
  5. :title="modelTitle"
  6. :width="700"
  7. :bodyStyle="{ 'padding-top': '0px' }"
  8. >
  9. <a-form ref="noticeFormRef" :model="formData" layout="vertical">
  10. <a-tabs v-model:activeKey="activeKey">
  11. <a-tab-pane key="1" tab="人员配置" force-render>
  12. <div v-show="formVerify" style="margin-bottom: 10px">
  13. <a-alert message="请切换标签查看,填写完必填项!" type="error" />
  14. </div>
  15. <div v-show="alertShow" style="margin-bottom: 10px">
  16. <a-alert message="未选择任何类型的人员配置,默认所有人均可参与此流程。" type="warning" />
  17. </div>
  18. <div class="mb-2">
  19. <span class="left-span-label">配置使用该流程的人员</span>
  20. </div>
  21. <a-button type="primary" round @click="selectionParticipants('ORG')" size="small">
  22. <plus-outlined />
  23. 选择机构
  24. </a-button>
  25. <p />
  26. <prop-tag :tagList="getTagList('ORG')" />
  27. <a-divider />
  28. <a-button type="primary" round @click="selectionParticipants('ROLE')" size="small">
  29. <plus-outlined />
  30. 选择角色
  31. </a-button>
  32. <p />
  33. <prop-tag :tagList="getTagList('ROLE')" />
  34. <a-divider />
  35. <a-button type="primary" round @click="selectionParticipants('POSITION')" size="small">
  36. <plus-outlined />
  37. 选择职位
  38. </a-button>
  39. <p />
  40. <prop-tag :tagList="getTagList('POSITION')" />
  41. <a-divider />
  42. <a-button type="primary" round @click="selectionParticipants('USER')" size="small">
  43. <plus-outlined />
  44. 选择用户
  45. </a-button>
  46. <p />
  47. <prop-tag :tagList="getTagList('USER')" />
  48. <a-divider />
  49. </a-tab-pane>
  50. <a-tab-pane key="2" tab="基础配置" force-render>
  51. <div class="mb-2">
  52. <span class="left-span-label">流程基础全局配置</span>
  53. </div>
  54. <a-row :gutter="[10, 0]">
  55. <a-col :span="12">
  56. <a-form-item
  57. label="流水号"
  58. name="processSnTemplateId"
  59. :rules="[{ required: true, message: '请选择流水号' }]"
  60. >
  61. <a-select
  62. v-model:value="form.properties.configInfo.processSnTemplateId"
  63. placeholder="请选择流水号"
  64. :options="snTemplateArray"
  65. >
  66. </a-select>
  67. </a-form-item>
  68. </a-col>
  69. <a-col :span="12">
  70. <a-form-item
  71. v-if="recordData.formType === 'DESIGN'"
  72. label="打印模板"
  73. name="processPrintTemplateId"
  74. :rules="[{ required: true, message: '请选择打印模板' }]"
  75. >
  76. <a-select
  77. v-model:value="form.properties.configInfo.processPrintTemplateId"
  78. placeholder="请选择打印模板"
  79. :options="printTemplateArray"
  80. />
  81. </a-form-item>
  82. <span v-else>
  83. <p>打印模板</p>
  84. <p>自定义表单内提供打印方法</p>
  85. </span>
  86. </a-col>
  87. </a-row>
  88. <a-form-item
  89. label="标题模板"
  90. name="processTitleTemplate"
  91. :rules="[{ required: true, message: '请创造标题模板' }]"
  92. >
  93. <template-generator
  94. ref="processTitleGenerator"
  95. v-model:inputValue="form.properties.configInfo.processTitleTemplate"
  96. :fieldInfoLis="fieldInfoLis"
  97. />
  98. </a-form-item>
  99. <a-form-item
  100. label="摘要模板"
  101. name="processAbstractTemplate"
  102. :rules="[{ required: true, message: '请创造摘要模板' }]"
  103. >
  104. <template-generator
  105. ref="processAbstractGenerator"
  106. v-model:inputValue="form.properties.configInfo.processAbstractTemplate"
  107. :fieldInfoLis="fieldInfoLis"
  108. />
  109. </a-form-item>
  110. <a-form-item label="开启自动去重" name="processEnableAutoDistinct">
  111. <a-switch v-model:checked="form.properties.configInfo.processEnableAutoDistinct" />
  112. </a-form-item>
  113. <a-form-item v-show="form.properties.configInfo.processEnableAutoDistinct" name="processAutoDistinctType">
  114. <a-radio-group v-model:value="form.properties.configInfo.processAutoDistinctType">
  115. <a-radio
  116. v-for="autoDistinctType in processAutoDistinctTypeList"
  117. :key="autoDistinctType.value"
  118. :value="autoDistinctType.value"
  119. >{{ autoDistinctType.label }}</a-radio
  120. >
  121. </a-radio-group>
  122. </a-form-item>
  123. <a-row :gutter="[10, 0]">
  124. <a-col :span="12">
  125. <a-form-item label="开启审批撤销" name="processEnableRevoke">
  126. <a-switch v-model:checked="form.properties.configInfo.processEnableRevoke" />
  127. </a-form-item>
  128. </a-col>
  129. <a-col :span="12">
  130. <a-form-item label="开启意见必填" name="processEnableCommentRequired">
  131. <a-switch v-model:checked="form.properties.configInfo.processEnableCommentRequired" />
  132. </a-form-item>
  133. </a-col>
  134. </a-row>
  135. </a-tab-pane>
  136. <a-tab-pane key="3" tab="通知配置" force-render>
  137. <div class="mb-2">
  138. <span class="left-span-label">配置通知事项</span>
  139. </div>
  140. <a-form-item label="开启退回通知" name="processEnableBackNotice">
  141. <a-switch v-model:checked="formData.processEnableBackNotice" />
  142. </a-form-item>
  143. <a-form-item
  144. label="退回通知方式"
  145. v-show="formData.processEnableBackNotice"
  146. name="processBackNoticeChannel"
  147. :rules="[{ required: formData.processEnableBackNotice, message: '请选择通知方式' }]"
  148. >
  149. <a-checkbox-group v-model:value="formData.processBackNoticeChannel" :options="noticeInfoList" />
  150. </a-form-item>
  151. <a-form-item
  152. label="退回通知模板"
  153. v-show="formData.processEnableBackNotice"
  154. name="processBackNoticeTemplate"
  155. :rules="[{ required: formData.processEnableBackNotice, message: '请创造通知模板' }]"
  156. >
  157. <template-generator
  158. ref="enableBackNoticeRef"
  159. v-model:inputValue="formData.processBackNoticeTemplate"
  160. :fieldInfoLis="fieldInfoLis"
  161. />
  162. </a-form-item>
  163. <a-form-item label="开启待办通知" name="processEnableTodoNotice">
  164. <a-switch v-model:checked="form.properties.configInfo.processEnableTodoNotice" />
  165. </a-form-item>
  166. <a-form-item
  167. label="待办通知方式"
  168. v-show="form.properties.configInfo.processEnableTodoNotice"
  169. name="processTodoNoticeChannel"
  170. :rules="[{ required: formData.processEnableTodoNotice, message: '请选择通知方式' }]"
  171. >
  172. <a-checkbox-group
  173. v-model:value="form.properties.configInfo.processTodoNoticeChannel"
  174. :options="noticeInfoList"
  175. />
  176. </a-form-item>
  177. <a-form-item
  178. label="待办通知模板"
  179. v-show="form.properties.configInfo.processEnableTodoNotice"
  180. name="processTodoNoticeTemplate"
  181. :rules="[{ required: formData.processEnableTodoNotice, message: '请创造通知模板' }]"
  182. >
  183. <template-generator
  184. ref="todoNoticeChannelRef"
  185. :fieldInfoLis="fieldInfoLis"
  186. v-model:inputValue="form.properties.configInfo.processTodoNoticeTemplate"
  187. />
  188. </a-form-item>
  189. <a-form-item label="开启抄送通知" name="processEnableCopyNotice">
  190. <a-switch v-model:checked="form.properties.configInfo.processEnableCopyNotice" />
  191. </a-form-item>
  192. <a-form-item
  193. label="抄送通知方式"
  194. v-show="form.properties.configInfo.processEnableCopyNotice"
  195. name="processCopyNoticeChannel"
  196. :rules="[{ required: formData.processEnableCopyNotice, message: '请选择通知方式' }]"
  197. >
  198. <a-checkbox-group
  199. v-model:value="form.properties.configInfo.processCopyNoticeChannel"
  200. :options="noticeInfoList"
  201. />
  202. </a-form-item>
  203. <a-form-item
  204. label="抄送通知模板"
  205. v-show="form.properties.configInfo.processEnableCopyNotice"
  206. name="processCopyNoticeTemplate"
  207. :rules="[{ required: formData.processEnableCopyNotice, message: '请创造通知模板' }]"
  208. >
  209. <template-generator
  210. ref="enableCopyNoticeRef"
  211. :fieldInfoLis="fieldInfoLis"
  212. v-model:inputValue="form.properties.configInfo.processCopyNoticeTemplate"
  213. />
  214. </a-form-item>
  215. <a-form-item label="开启完成通知" name="processEnableCompleteNotice">
  216. <a-switch v-model:checked="form.properties.configInfo.processEnableCompleteNotice" />
  217. </a-form-item>
  218. <a-form-item
  219. label="完成通知方式"
  220. v-show="form.properties.configInfo.processEnableCompleteNotice"
  221. name="processCompleteNoticeChannel"
  222. :rules="[{ required: formData.processEnableCompleteNotice, message: '请选择通知方式' }]"
  223. >
  224. <a-checkbox-group
  225. v-model:value="form.properties.configInfo.processCompleteNoticeChannel"
  226. :options="noticeInfoList"
  227. />
  228. </a-form-item>
  229. <a-form-item
  230. label="完成通知模板"
  231. v-show="form.properties.configInfo.processEnableCompleteNotice"
  232. name="processCompleteNoticeTemplate"
  233. :rules="[{ required: formData.processEnableCompleteNotice, message: '请创造通知模板' }]"
  234. >
  235. <template-generator
  236. ref="enableCompleteNoticeRef"
  237. :fieldInfoLis="fieldInfoLis"
  238. v-model:inputValue="form.properties.configInfo.processCompleteNoticeTemplate"
  239. />
  240. </a-form-item>
  241. </a-tab-pane>
  242. <a-tab-pane key="4" tab="表单预设" force-render v-if="recordData.formType !== 'DESIGN'">
  243. <div class="mb-2">
  244. <span class="left-span-label">预设全局需要的表单</span>
  245. </div>
  246. <a-form-item
  247. label="开始节点表单"
  248. name="processStartTaskFormUrl"
  249. :rules="[{ required: true, message: '请输入开始节点表单' }]"
  250. >
  251. <a-input
  252. v-model:value="form.properties.configInfo.processStartTaskFormUrl"
  253. addon-before="src/views/flw/customform/"
  254. addon-after=".vue"
  255. placeholder="请输入开始节点表单组件"
  256. allow-clear
  257. >
  258. <template #suffix>
  259. <a-button
  260. v-if="form.properties.configInfo.processStartTaskFormUrl"
  261. type="primary"
  262. size="small"
  263. @click="$refs.previewCustomFormRef.onOpen(form.properties.configInfo.processStartTaskFormUrl)"
  264. >
  265. 预览
  266. </a-button>
  267. </template>
  268. </a-input>
  269. </a-form-item>
  270. <a-form-item
  271. label="移动端开始节点表单"
  272. name="processStartTaskMobileFormUrl"
  273. :rules="[{ required: true, message: '请输入移动端开始节点表单' }]"
  274. >
  275. <a-input
  276. v-model:value="form.properties.configInfo.processStartTaskMobileFormUrl"
  277. addon-before="pages/flw/customform/"
  278. addon-after=".vue"
  279. placeholder="请输入移动端开始节点表单组件"
  280. allow-clear
  281. />
  282. </a-form-item>
  283. <a-form-item
  284. label="人员节点表单"
  285. name="processUserTaskFormUrl"
  286. :rules="[{ required: true, message: '请输入人员节点表单' }]"
  287. >
  288. <a-input
  289. v-model:value="form.properties.configInfo.processUserTaskFormUrl"
  290. addon-before="src/views/flw/customform/"
  291. addon-after=".vue"
  292. placeholder="请输入人员节点表单组件"
  293. allow-clear
  294. >
  295. <template #suffix>
  296. <a-button
  297. v-if="form.properties.configInfo.processUserTaskFormUrl"
  298. type="primary"
  299. size="small"
  300. @click="$refs.previewCustomFormRef.onOpen(form.properties.configInfo.processUserTaskFormUrl)"
  301. >
  302. 预览
  303. </a-button>
  304. </template>
  305. </a-input>
  306. </a-form-item>
  307. <a-form-item
  308. label="移动端人员节点表单"
  309. name="processUserTaskMobileFormUrl"
  310. :rules="[{ required: true, message: '请输入移动端人员节点表单' }]"
  311. >
  312. <a-input
  313. v-model:value="form.properties.configInfo.processUserTaskMobileFormUrl"
  314. addon-before="pages/flw/customform/"
  315. addon-after=".vue"
  316. placeholder="请输入移动端人员节点表单组件"
  317. allow-clear
  318. />
  319. </a-form-item>
  320. </a-tab-pane>
  321. <a-tab-pane key="5" tab="执行监听" force-render>
  322. <prop-listener-info
  323. ref="propListenerInfoRef"
  324. :listenerValue="form.properties.executionListenerInfo"
  325. :defaultListenerList="executionListenerInfo"
  326. :listener-value-array="executionListenerArray"
  327. listener-type="global"
  328. :execution-listener-selector-for-custom-event-array="executionListenerSelectorForCustomEventArray"
  329. />
  330. </a-tab-pane>
  331. </a-tabs>
  332. </a-form>
  333. <template #footer>
  334. <a-button type="primary" style="margin-right: 8px" @click="onFinish">保存</a-button>
  335. <a-button @click="drawer = false">取消</a-button>
  336. </template>
  337. <role-selector-plus
  338. ref="roleselectorPlus"
  339. :org-tree-api="selectorApiFunction.orgTreeApi"
  340. :role-page-api="selectorApiFunction.rolePageApi"
  341. :checked-role-list-api="selectorApiFunction.checkedRoleListApi"
  342. :data-is-converter-flw="true"
  343. @onBack="callBack"
  344. />
  345. <user-selector-plus
  346. ref="userselectorPlus"
  347. :org-tree-api="selectorApiFunction.orgTreeApi"
  348. :user-page-api="selectorApiFunction.userPageApi"
  349. :checked-user-list-api="selectorApiFunction.checkedUserListApi"
  350. :data-is-converter-flw="true"
  351. @onBack="callBack"
  352. />
  353. <pos-selector-plus
  354. ref="posselectorPlus"
  355. :org-tree-api="selectorApiFunction.orgTreeApi"
  356. :pos-page-api="selectorApiFunction.posPageApi"
  357. :checked-pos-list-api="selectorApiFunction.checkedPosListApi"
  358. :data-is-converter-flw="true"
  359. @onBack="callBack"
  360. />
  361. <org-selector-plus
  362. ref="orgselectorPlus"
  363. :org-tree-api="selectorApiFunction.orgTreeApi"
  364. :org-page-api="selectorApiFunction.orgPageApi"
  365. :checked-org-list-api="selectorApiFunction.checkedOrgListApi"
  366. :data-is-converter-flw="true"
  367. @onBack="callBack"
  368. />
  369. <preview-custom-form ref="previewCustomFormRef" />
  370. </xn-form-container>
  371. </template>
  372. <script>
  373. import { cloneDeep } from 'lodash-es'
  374. import templateGenerator from './nodes/prop/templateGenerator.vue'
  375. import config from '@/components/XnWorkflow/nodes/config/config'
  376. import roleSelectorPlus from '@/components/Selector/roleSelectorPlus.vue'
  377. import userSelectorPlus from '@/components/Selector/userSelectorPlus.vue'
  378. import posSelectorPlus from '@/components/Selector/posSelectorPlus.vue'
  379. import orgSelectorPlus from '@/components/Selector/orgSelectorPlus.vue'
  380. import propTag from './nodes/prop/propTag.vue'
  381. import PropListenerInfo from '@/components/XnWorkflow/nodes/prop/propListenerInfo.vue'
  382. import PreviewCustomForm from '@/components/XnWorkflow/nodes/common/previewCustomForm.vue'
  383. export default {
  384. components: {
  385. PropListenerInfo,
  386. templateGenerator,
  387. roleSelectorPlus,
  388. userSelectorPlus,
  389. posSelectorPlus,
  390. orgSelectorPlus,
  391. propTag,
  392. PreviewCustomForm
  393. },
  394. props: {
  395. modelValue: { type: Object, default: () => {} },
  396. formFieldListValue: { type: Array, default: () => [] },
  397. recordData: { type: Object, default: () => {} },
  398. snTemplateArray: { type: Array, default: () => [] },
  399. printTemplateArray: { type: Array, default: () => [] },
  400. executionListenerArray: { type: Array, default: () => [] },
  401. executionListenerSelectorForCustomEventArray: { type: Array, default: () => [] },
  402. taskListenerArray: { type: Array, default: () => [] },
  403. selectorApiFunction: { type: Object, default: () => {} }
  404. },
  405. data() {
  406. return {
  407. noticeInfoList: cloneDeep(config.noticeInfoList),
  408. // 摘要模板,因为要从传来的字段中取
  409. abstractStr: '',
  410. executionListenerInfo: cloneDeep(config.listener.processExecutionListenerInfo),
  411. // 自动去重类型
  412. processAutoDistinctTypeList: [
  413. {
  414. label: '当审批人和发起人是同一个人,审批自动通过',
  415. value: 'SAMPLE'
  416. },
  417. {
  418. label: '当同一审批人在流程中连续多次出现时,自动去重',
  419. value: 'MULTIPLE'
  420. }
  421. ],
  422. drawer: false,
  423. modelTitle: '全局属性',
  424. activeKey: '1',
  425. childNode: this.modelValue,
  426. form: {},
  427. formData: {},
  428. fieldInfoLis: [],
  429. formVerify: false
  430. }
  431. },
  432. computed: {
  433. // 监听内部数组,选了人员相关,我们就不提示
  434. alertShow() {
  435. return this.form.properties.participateInfo.length <= 0
  436. }
  437. },
  438. watch: {
  439. modelValue(val) {
  440. this.childNode = val
  441. },
  442. childNode(val) {
  443. this.$emit('update:modelValue', val)
  444. },
  445. formFieldListValue(val) {
  446. // 获取主表名称
  447. const parentTableName = JSON.parse(this.recordData.tableJson).filter((item) => item.tableType === 'parent')[0]
  448. .tableName
  449. // 监听到字段列表后,将其转至定义的变量中
  450. this.fieldInfoLis = []
  451. // 不仅表单中有字段,而且还要必须选择了主表
  452. if (val.length > 0) {
  453. const fildLists = this.getListField(val)
  454. fildLists.forEach((item) => {
  455. const obj = {}
  456. // 判断是否是选择了表,并且选择了字段
  457. if (item.selectTable && item.selectColumn) {
  458. // 判断是否是主表的字段,并且是必填项
  459. const requireds = item.rules[0].required
  460. if ((item.selectTable === parentTableName) & requireds) {
  461. obj.label = item.label
  462. obj.value = item.model
  463. this.fieldInfoLis.push(obj)
  464. }
  465. }
  466. })
  467. }
  468. }
  469. },
  470. methods: {
  471. showDrawer() {
  472. this.form = {}
  473. this.form = cloneDeep(this.childNode)
  474. this.formData = this.form.properties.configInfo
  475. this.drawer = true
  476. // 制作默认的摘要字段
  477. this.makeAbstractTemp()
  478. },
  479. // 制作默认显示的摘要信息
  480. makeAbstractTemp() {
  481. let temp = this.form.properties.configInfo.processAbstractTemplate
  482. if (temp === '') {
  483. if (this.fieldInfoLis.length > 0) {
  484. let fieldInfoTemp = ''
  485. for (let a = 0; a < this.fieldInfoLis.length; a++) {
  486. // 最多3个摘要,按顺序而来
  487. if (a < 3) {
  488. const str = this.fieldInfoLis[a].label + ':' + this.fieldInfoLis[a].value
  489. if (a === 3 - 1 || a === this.fieldInfoLis.length - 1) {
  490. fieldInfoTemp = fieldInfoTemp + str
  491. } else {
  492. fieldInfoTemp = fieldInfoTemp + str + ','
  493. }
  494. }
  495. }
  496. temp = fieldInfoTemp
  497. }
  498. }
  499. },
  500. onFinish() {
  501. // 校验表单的正确性
  502. this.$refs.noticeFormRef
  503. .validate()
  504. .then((values) => {
  505. if (this.form.id === '') {
  506. this.form.id = this.$TOOL.snowyUuid()
  507. }
  508. // 获取输入的监听
  509. this.form.properties.executionListenerInfo = this.$refs.propListenerInfoRef.selectedListenerList()
  510. this.form.dataLegal = true
  511. this.form.properties.configInfo = values
  512. this.$emit('update:modelValue', this.form)
  513. this.drawer = false
  514. })
  515. .catch((info) => {
  516. this.formVerify = true
  517. setTimeout((e) => {
  518. this.formVerify = false
  519. }, 2000)
  520. })
  521. },
  522. // 选择参与人
  523. selectionParticipants(type) {
  524. let participateInfo = this.form.properties.participateInfo
  525. let data = []
  526. if (participateInfo.length > 0) {
  527. participateInfo.forEach((item) => {
  528. if (item.key === type) {
  529. data.push(item)
  530. }
  531. })
  532. }
  533. if (type === 'ORG') {
  534. this.$refs.orgselectorPlus.showOrgPlusModal(data)
  535. }
  536. if (type === 'ROLE') {
  537. this.$refs.roleselectorPlus.showRolePlusModal(data)
  538. }
  539. if (type === 'POSITION') {
  540. this.$refs.posselectorPlus.showPosPlusModal(data)
  541. }
  542. if (type === 'USER') {
  543. this.$refs.userselectorPlus.showUserPlusModal(data)
  544. }
  545. },
  546. // 回调函数,这几个选择人员相关的设计器,都是的
  547. callBack(value) {
  548. let participateInfo = this.form.properties.participateInfo
  549. if (participateInfo.length > 0) {
  550. let mark = 0
  551. for (let a = 0; a < participateInfo.length; a++) {
  552. if (value.key === participateInfo[a].key) {
  553. if (value.label === '') {
  554. participateInfo.splice(a, 1)
  555. } else {
  556. participateInfo[a] = value
  557. }
  558. mark = 1
  559. }
  560. }
  561. if (mark === 0) {
  562. participateInfo.push(value)
  563. }
  564. } else {
  565. this.form.properties.participateInfo.push(value)
  566. }
  567. },
  568. // 获取tag标签的内容
  569. getTagList(type) {
  570. const participateInfo = this.form.properties.participateInfo
  571. if (participateInfo.length < 0) {
  572. return undefined
  573. } else {
  574. return participateInfo.find((item) => item.key === type)
  575. }
  576. },
  577. getListField(data) {
  578. let result = []
  579. // 递归遍历控件树
  580. const traverse = (array) => {
  581. array.forEach((element) => {
  582. if (element.type === 'grid' || element.type === 'tabs') {
  583. // 栅格布局 and 标签页
  584. element.columns.forEach((item) => {
  585. traverse(item.list)
  586. })
  587. } else if (element.type === 'card') {
  588. // 卡片布局 and 动态表格
  589. traverse(element.list)
  590. } else if (element.type === 'table') {
  591. // 表格布局
  592. element.trs.forEach((item) => {
  593. item.tds.forEach((val) => {
  594. traverse(val.list)
  595. })
  596. })
  597. } else {
  598. const type = element.type
  599. // 排除一些
  600. if (
  601. (type !== 'alert') &
  602. (type !== 'text') &
  603. (type !== 'divider') &
  604. (type !== 'batch') &
  605. (type !== 'html')
  606. ) {
  607. result.push(element)
  608. }
  609. }
  610. })
  611. }
  612. traverse(data)
  613. return result
  614. }
  615. }
  616. }
  617. </script>