|
@@ -41,21 +41,12 @@
|
|
|
<el-button type="primary" :loading="loading" @click="onSubmit">确定导入</el-button>
|
|
|
</el-form-item>
|
|
|
</base-form>
|
|
|
- <base-dialog v-model="importMethodVisible" title="选择导入方式" destroy-on-close :width="350">
|
|
|
- <!-- <base-form ref="formRef" :model="model" :items="items" :rules="rules" :label-width="useVW(72)"> -->
|
|
|
- <div style="color: red; font-size: 14px">已有数据,是否继续导入?</div>
|
|
|
- <el-radio-group v-model="clearMethod" size="large" style="text-align: center">
|
|
|
- <el-radio label="追加导入" />
|
|
|
- <el-radio v-if="curCheckStatus === 'CHOOSE'" label="清空导入" />
|
|
|
- </el-radio-group>
|
|
|
- <template #footer>
|
|
|
- <div class="flex justify-end">
|
|
|
- <confirm-button @confirm="sureImport" @cancel="cancelImport"></confirm-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <!-- </base-form> -->
|
|
|
- </base-dialog>
|
|
|
+ <import-method
|
|
|
+ v-model:visible="importMethodVisible"
|
|
|
+ v-model:clear="clear"
|
|
|
+ :check-status="curCheckStatus"
|
|
|
+ @sure="sureImport"
|
|
|
+ ></import-method>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="ImportSample">
|
|
@@ -68,8 +59,7 @@ import useForm from '@/hooks/useForm'
|
|
|
import useOptions from '@/hooks/useOptions'
|
|
|
import useUploadFile from '@/hooks/useUploadFile'
|
|
|
import useVW from '@/hooks/useVW'
|
|
|
-import BaseDialog from '@/components/element/BaseDialog.vue'
|
|
|
-import ConfirmButton from '@/components/common/ConfirmButton.vue'
|
|
|
+import ImportMethod from './importMethod.vue'
|
|
|
|
|
|
import type { FormGroup, EpFormItem, EpFormRules } from 'global-type'
|
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
@@ -203,17 +193,17 @@ const items = computed<EpFormItem[]>(() => {
|
|
|
]
|
|
|
})
|
|
|
|
|
|
-const clearMethod = ref('追加导入')
|
|
|
+// const clearMethod = ref('追加导入')
|
|
|
const importMethodVisible = ref(false)
|
|
|
const curCheckStatus = ref('')
|
|
|
const clear = ref(false)
|
|
|
const sureImport = () => {
|
|
|
- clear.value = clearMethod.value === '清空导入'
|
|
|
+ // clear.value = clearMethod.value === '清空导入'
|
|
|
submitHandler()
|
|
|
}
|
|
|
-const cancelImport = () => {
|
|
|
- importMethodVisible.value = false
|
|
|
-}
|
|
|
+// const cancelImport = () => {
|
|
|
+// importMethodVisible.value = false
|
|
|
+// }
|
|
|
const submitHandler = async () => {
|
|
|
showProgress.value = true
|
|
|
setPercentage(0)
|
|
@@ -235,7 +225,7 @@ async function onSubmit() {
|
|
|
})
|
|
|
console.log('checkRes:', checkRes)
|
|
|
curCheckStatus.value = checkRes
|
|
|
- clearMethod.value = '追加导入'
|
|
|
+ // clearMethod.value = '追加导入'
|
|
|
clear.value = false
|
|
|
if (checkRes === 'CHOOSE' || checkRes === 'APPEND') {
|
|
|
importMethodVisible.value = true
|