feat(X-Pack):【数据填报】新增表单复制功能

This commit is contained in:
ulleo 2024-05-11 15:30:54 +08:00
parent 3956c325e0
commit fc7ddeeae8
2 changed files with 22 additions and 0 deletions

View File

@ -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() {

View File

@ -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') }}
</el-dropdown-item>
<el-dropdown-item
icon="el-icon-document-copy"
:command="beforeClickMore('copy',data,node)"
>
{{ $t('dataset.copy') }}
</el-dropdown-item>
<el-dropdown-item
icon="el-icon-delete"
:command="beforeClickMore('delete', data, node)"