|
|
|
@ -27,6 +27,10 @@
|
|
|
|
|
删除
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-button type="link" class="pl0" @click="derivedExcel">
|
|
|
|
|
<span class="iconfont icon-Excel"></span>
|
|
|
|
|
导出待上线
|
|
|
|
|
</a-button>
|
|
|
|
|
<!-- <a-button type="link" @click="handleSave(false)" class="pl0">
|
|
|
|
|
<span class="iconfont icon-baocun" v-repeat></span>
|
|
|
|
|
保存
|
|
|
|
@ -118,6 +122,7 @@
|
|
|
|
|
import { formSchema, InfoColumns } from './columns'
|
|
|
|
|
import { ApiEdit, ApiInfo, ApiDelDetail, ApiImport } from './api'
|
|
|
|
|
import { ApiDealExcel } from '/@/views/ContainerManagement/RentIn/api'
|
|
|
|
|
import { ExportExcelByColumn } from '/@/api/common'
|
|
|
|
|
// 字典
|
|
|
|
|
import { getDictOption } from '/@/utils/dictUtil'
|
|
|
|
|
import { HotTable } from '@handsontable/vue3'
|
|
|
|
@ -133,7 +138,7 @@
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const rowId = ref()
|
|
|
|
|
const activeKey = ref('1')
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
|
|
|
|
const [registerForm, { resetFields, getFieldsValue, setFieldsValue, validate }] = useForm({
|
|
|
|
|
labelWidth: 100,
|
|
|
|
|
schemas: formSchema,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
@ -586,4 +591,41 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function derivedExcel() {
|
|
|
|
|
let ApiData: any = {
|
|
|
|
|
columnSets: [],
|
|
|
|
|
jsonDataStr: [],
|
|
|
|
|
}
|
|
|
|
|
columns.forEach((item, index) => {
|
|
|
|
|
if (!settings.hiddenColumns.columns.includes(index) && item?.type != 'checkbox') {
|
|
|
|
|
ApiData.columnSets.push({
|
|
|
|
|
title: item.title,
|
|
|
|
|
enTitle: item.data,
|
|
|
|
|
dataIndex: item.data,
|
|
|
|
|
visible: true,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
list.value.forEach((item) => {
|
|
|
|
|
ApiData.jsonDataStr.push({
|
|
|
|
|
...item,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
ApiData.jsonDataStr = JSON.stringify(ApiData.jsonDataStr)
|
|
|
|
|
ExportExcelByColumn(ApiData).then((res) => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
const xlsUrl = window.URL.createObjectURL(
|
|
|
|
|
new Blob([res], {
|
|
|
|
|
type: 'application/vnd.ms-excel;charset=utf-8',
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
const fname = `${getFieldsValue().templetName}待上线数据`
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
link.href = xlsUrl
|
|
|
|
|
link.setAttribute('download', fname)
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
link.click()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|