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') }}
+