|
@@ -11,12 +11,12 @@ import type { PropsParams, TableFieldInfo, TablePaginationSetting } from '@/type
|
|
|
import type { ReqConfig } from '@/types/dataAnalysis.ts'
|
|
|
import { FieldSpecialEffectType } from '@/types/tableText.ts'
|
|
|
|
|
|
-import { initLoadResource } from '@/utils/resource'
|
|
|
-import { fuzzySearch, throttleFunc } from '@/utils/common'
|
|
|
+import { fuzzySearch, generateRandomFileName, throttleFunc } from '@/utils/common'
|
|
|
|
|
|
import { useTable } from '@/hooks/useTable.ts'
|
|
|
import { useRequest } from '@/hooks/useRequest.ts'
|
|
|
import { computed, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
|
+import { downLoadData } from '@/utils/table/table'
|
|
|
|
|
|
import TableFilterForm from '@/components/table/TableFilterForm/TableFilterForm.vue'
|
|
|
import axiosInstance from '@/utils/axios/axiosInstance.ts'
|
|
@@ -70,14 +70,6 @@ const reqConfig = reactive<ReqConfig>({
|
|
|
otherOptions: {}
|
|
|
})
|
|
|
|
|
|
-// 资源的加载路径
|
|
|
-const resourceInfo: Record<string, string> = {
|
|
|
- defaultHead: `/img/default/defaultHead.png`
|
|
|
-}
|
|
|
-
|
|
|
-// 使用blob的资源路径信息
|
|
|
-const blobUrlInfo = reactive<Record<string, string>>({})
|
|
|
-
|
|
|
// 一些公用方法
|
|
|
const { getTableData } = useTable(tableData, paginationConfig)
|
|
|
|
|
@@ -259,7 +251,7 @@ const getDecimalFromRange = (number: number) => {
|
|
|
/**
|
|
|
* @description: 单独处理拥有均值行的表格每个单元格的样式,均值字段均加粗,其他需要比较的字段根据自身百分比显示颜色
|
|
|
* 其中使用row-style无效,scope会导致无法覆盖样式
|
|
|
- * 同时由于我自定义了表格内容,哪里的样式会覆盖row的样式,所以只能单独对单元格设置
|
|
|
+ * 同时由于自定义了表格内容,哪里的样式会覆盖row的样式,所以只能单独对单元格设置
|
|
|
* @param {*} info 每个单元格的信息
|
|
|
*/
|
|
|
const tableCellStyle = (info: any) => {
|
|
@@ -432,7 +424,7 @@ const deleteRow = (url: string, fieldsInfo: any) => {
|
|
|
* @description: 下载表格数据
|
|
|
*/
|
|
|
const downLoadTable = () => {
|
|
|
- emits('downLoad', JSON.parse(JSON.stringify(tableData)))
|
|
|
+ downLoadData(generateRandomFileName(), JSON.parse(JSON.stringify(tableData)))
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -455,10 +447,6 @@ onMounted(() => {
|
|
|
initPageConfig()
|
|
|
initReqConfig()
|
|
|
loading.value = props.loadingState
|
|
|
- // 去加载所有需要的资源
|
|
|
- initLoadResource(resourceInfo).then((data) => {
|
|
|
- Object.assign(blobUrlInfo, data)
|
|
|
- })
|
|
|
})
|
|
|
</script>
|
|
|
|