Merge branch 'feature-template2' into uat

This commit is contained in:
steven
2022-11-30 10:21:59 +08:00
2 changed files with 24 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request'
/* 同步数据 */
export function syncProductTest(sn) {
return request({
url: `/console/surveys/${sn}/sync_product_test`,
method: 'POST',
})
}

View File

@@ -58,7 +58,7 @@
<template v-slot:title>
产品测试模块会同步该列表数据并作统计展示
</template>
<a-button type="primary" class="operChd custom-button" @click="syncData">同步数据</a-button>
<a-button type="primary" class="operChd custom-button" @click="syncData" :loading="syncDataLoading">同步数据</a-button>
</a-tooltip>
</div>
<!-- 配置 -->
@@ -76,9 +76,11 @@ import { message } from 'ant-design-vue'
import ColumnConfig from './../../particulars/components/ColumnConfig'
import DownloadData from './../../particulars/components/DownloadData'
import { addDownloadCenter } from '@/api/download.js'
import { syncProductTest } from './api'
import DownloadCenter from '@/views/DownloadCenter/index.vue'
import { CaretDownOutlined } from '@ant-design/icons-vue'
import { Modal } from 'ant-design-vue'
const props = defineProps({
answer_columns: {
type: Array,
@@ -105,6 +107,8 @@ const opList = ref([
{ value: '1', label: '导出数据' },
{ value: '2', label: '删除' }
])
const syncDataLoading = ref(false);
// 导出选中答卷
const opChange = (e) => {
const { key } = e
@@ -248,9 +252,16 @@ const noData = () => {
}
// 同步数据
function syncData() {
message.success('同步成功!');
// message.success('同步成功,您还需在产品测试模块导入该问卷哦~');
async function syncData() {
syncDataLoading.value = true;
try {
await syncProductTest(sn.value);
message.success('同步成功!');
// message.success('同步成功,您还需在产品测试模块导入该问卷哦~');
} catch (error) {
console.error('同步数据错误', error)
}
syncDataLoading.value = false;
}
defineExpose({ delSurveysAnswers })