From fc7ddeeae83d349a2765043dc72ad6c9edc60493 Mon Sep 17 00:00:00 2001 From: ulleo Date: Sat, 11 May 2024 15:30:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(X-Pack):=E3=80=90=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E3=80=91=E6=96=B0=E5=A2=9E=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/views/dataFilling/form/create.vue | 10 ++++++++++ core/frontend/src/views/dataFilling/form/index.vue | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/core/frontend/src/views/dataFilling/form/create.vue b/core/frontend/src/views/dataFilling/form/create.vue index 191a08fa43..07d3521539 100644 --- a/core/frontend/src/views/dataFilling/form/create.vue +++ b/core/frontend/src/views/dataFilling/form/create.vue @@ -5,6 +5,7 @@ import clickoutside from 'element-ui/src/utils/clickoutside.js' import { filter, cloneDeep, find, concat } from 'lodash-es' import { v4 as uuidv4 } from 'uuid' import { EMAIL_REGEX, PHONE_REGEX } from '@/utils/validate' +import { getWithPrivileges } from '@/views/dataFilling/form/dataFilling' export default { name: 'DataFillingFormCreate', @@ -233,6 +234,15 @@ export default { if (this.$route.query.level !== undefined) { this.formSettings.level = this.$route.query.level } + if (this.$route.query.copy !== undefined) { + const id = this.$route.query.copy + getWithPrivileges(id).then(res => { + const tempData = res.data + this.formSettings.folder = tempData.pid + this.formSettings.level = tempData.level + this.formSettings.forms = JSON.parse(tempData.forms) + }) + } }, methods: { closeCreate: function() { diff --git a/core/frontend/src/views/dataFilling/form/index.vue b/core/frontend/src/views/dataFilling/form/index.vue index 080d878f9a..170714c021 100644 --- a/core/frontend/src/views/dataFilling/form/index.vue +++ b/core/frontend/src/views/dataFilling/form/index.vue @@ -114,6 +114,9 @@ export default { case 'move': this.moveTo(param.data) break + case 'copy': + this.copyForm(param.data) + break } }, moveTo(data) { @@ -170,6 +173,9 @@ export default { }).catch(() => { }) }, + copyForm(data) { + this.$router.push({ name: 'data-filling-form-create', query: { copy: data.id }}) + }, onMoveSuccess() { this.moveGroup = false listForm({}).then(res => { @@ -400,6 +406,12 @@ export default { > {{ $t('dataset.move_to') }} + + {{ $t('dataset.copy') }} +