102 lines
2.2 KiB
Vue
102 lines
2.2 KiB
Vue
<template>
|
|
<a-modal
|
|
class="show-setting"
|
|
:title="$t('docTool.split.batchSetting')"
|
|
:visible="visible"
|
|
:confirm-loading="confirmLoading"
|
|
@ok="handleOk"
|
|
@cancel="handleCancel"
|
|
style="width: 1000px;height: auto"
|
|
>
|
|
<add-form
|
|
ref="fileForm"
|
|
@submitFormData="submitFormData"
|
|
:flag="'4'"
|
|
:url="urlBatSet">
|
|
</add-form>
|
|
</a-modal>
|
|
</template>
|
|
|
|
<script>
|
|
import AddForm from '@/components/customField/AddForm'
|
|
import { postAction } from '@/api/manage'
|
|
|
|
export default {
|
|
name: 'SplitDetailBatchSetting',
|
|
components: { AddForm },
|
|
data () {
|
|
return {
|
|
visible: false, // 批量设置弹框显示
|
|
confirmLoading: false,
|
|
url: {
|
|
addInfo: '/jero-boot/split/sarFileSplitItems/addSplitItems', // 新增
|
|
updateInfo: '/jero-boot/split/sarFileSplitItems/updateSplitItems', // 编辑
|
|
},
|
|
urlBatSet: {
|
|
getAddForm: 'split/sarFileSplitItems/getBatchSetForm',
|
|
addInfo: '/jero-boot/split/sarFileSplitItems/batchSet'
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
open (ids) {
|
|
this.ids = ids
|
|
this.visible = true
|
|
},
|
|
// 批量设置确定
|
|
handleOk () {
|
|
this.$refs.fileForm.submit()
|
|
},
|
|
// 表单提交
|
|
submitFormData (formInline) {
|
|
if (this.confirmLoading) {
|
|
return
|
|
}
|
|
this.confirmLoading = true
|
|
let url = ''
|
|
if (this.formInline.id) {
|
|
url = this.url.updateInfo
|
|
} else {
|
|
url = this.url.addInfo
|
|
}
|
|
formInline.ids = this.ids
|
|
postAction(url, formInline).then((res) => {
|
|
if (res.data.success) {
|
|
this.$message.success(this.$t('operationSuccessful'))
|
|
this.visible = false
|
|
this.$emit('ok')
|
|
} else {
|
|
this.$message.warning(this.$t('operationFailed'))
|
|
}
|
|
}).finally(() => {
|
|
this.confirmLoading = false
|
|
})
|
|
},
|
|
// 批量设置取消
|
|
handleCancel () {
|
|
this.visible = false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.show-setting {
|
|
.ant-modal {
|
|
min-width: 700px;
|
|
}
|
|
|
|
.ant-select-dropdown--multiple {
|
|
max-height: 39vh !important;
|
|
}
|
|
|
|
.ant-modal-body {
|
|
overflow-y: visible !important;
|
|
}
|
|
|
|
.ant-modal-footer {
|
|
text-align: center;
|
|
}
|
|
}
|
|
</style>
|