|
@@ -156,13 +156,13 @@
|
|
<div class="table-tip-foot">
|
|
<div class="table-tip-foot">
|
|
<div class="tip-left-btn">
|
|
<div class="tip-left-btn">
|
|
<HcTooltip keys="wbs_import_table">
|
|
<HcTooltip keys="wbs_import_table">
|
|
- <div class="text-gray-400 dow-text">
|
|
|
|
|
|
+ <div class="text-gray-400 dow-text" @click="importModal">
|
|
<HcIcon name="publish" ui="text-lg" />
|
|
<HcIcon name="publish" ui="text-lg" />
|
|
<span class="ml-1">导入列表数据</span>
|
|
<span class="ml-1">导入列表数据</span>
|
|
</div>
|
|
</div>
|
|
</HcTooltip>
|
|
</HcTooltip>
|
|
<HcTooltip keys="wbs_download_table">
|
|
<HcTooltip keys="wbs_download_table">
|
|
- <div class="text-main dow-text">
|
|
|
|
|
|
+ <div class="text-main dow-text" @click="downModal(item)">
|
|
<HcIcon name="file_download" ui="text-lg" />
|
|
<HcIcon name="file_download" ui="text-lg" />
|
|
<span class="ml-1">下载导入模板</span>
|
|
<span class="ml-1">下载导入模板</span>
|
|
</div>
|
|
</div>
|
|
@@ -401,8 +401,8 @@ import HcFormula from './formula.vue'
|
|
import HcCopy from './test-copy.vue'
|
|
import HcCopy from './test-copy.vue'
|
|
import NoDataSvg from '~src/assets/view/no-data.svg'
|
|
import NoDataSvg from '~src/assets/view/no-data.svg'
|
|
import {
|
|
import {
|
|
- arrIndex, deepClone, getArrValue,
|
|
|
|
- getObjVal, getObjValue, isNullES, setPosRange,
|
|
|
|
|
|
+ arrIndex, deepClone, downloadBlob,
|
|
|
|
+ getArrValue, getObjVal, getObjValue, isNullES, setPosRange,
|
|
} from 'js-fast-way'
|
|
} from 'js-fast-way'
|
|
import { delMessageV2 } from '~com/message/index.js'
|
|
import { delMessageV2 } from '~com/message/index.js'
|
|
//参数
|
|
//参数
|
|
@@ -642,7 +642,7 @@ const setTableFormMenu = (info) => {
|
|
newArr.push({ label: '关联试验数据', key: 'test' })
|
|
newArr.push({ label: '关联试验数据', key: 'test' })
|
|
newArr.push({ label: '关联试验文件', key: 'file' })
|
|
newArr.push({ label: '关联试验文件', key: 'file' })
|
|
newArr.push({ label: '公式参数', key: 'formula' })
|
|
newArr.push({ label: '公式参数', key: 'formula' })
|
|
- if (isStatus.value === 1 || isStatus.value === '' || isStatus.value === null || isStatus.value === 2) {
|
|
|
|
|
|
+ if (isStatus.value !== 3) {
|
|
newArr.push({ label: '清除数据', key: 'clear' })
|
|
newArr.push({ label: '清除数据', key: 'clear' })
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1502,7 +1502,45 @@ const getActiveKey = () => {
|
|
const setActiveKey = (key) => {
|
|
const setActiveKey = (key) => {
|
|
return ActiveKey.value = key
|
|
return ActiveKey.value = key
|
|
}
|
|
}
|
|
|
|
+//导入模板
|
|
|
|
+const importModal = ()=>{
|
|
|
|
|
|
|
|
+}
|
|
|
|
+const downloadLoading = ref(false)
|
|
|
|
+const getdownloadExcel = async (pKeyId)=>{
|
|
|
|
+ downloadLoading.value = true
|
|
|
|
+ const { error, disposition, res } = await wbsApi.downloadExcel({ pKeyId: pKeyId })
|
|
|
|
+ //处理数据
|
|
|
|
+ downloadLoading.value = false
|
|
|
|
+ if (!error) {
|
|
|
|
+ if (disposition) {
|
|
|
|
+ downloadBlob(res, disposition)
|
|
|
|
+ } else {
|
|
|
|
+ window.$message?.error('数据异常')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+//下载模板
|
|
|
|
+const downModal = (item)=>{
|
|
|
|
+ const { pkeyId } = item
|
|
|
|
+ if (isStatus.value === 3) {
|
|
|
|
+ window?.$messageBox?.alert('是否选择把数据一起导出?', '下载模板', {
|
|
|
|
+ showCancelButton: true,
|
|
|
|
+ confirmButtonText: '是',
|
|
|
|
+ cancelButtonText: '否',
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
+ console.log('数据')
|
|
|
|
+ } else if ( action === 'cancel') {
|
|
|
|
+ console.log('清表')
|
|
|
|
+ getdownloadExcel(pkeyId)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ console.log('清表')
|
|
|
|
+ }
|
|
|
|
+}
|
|
// 暴露出去
|
|
// 暴露出去
|
|
defineExpose({
|
|
defineExpose({
|
|
getFormData,
|
|
getFormData,
|