fix: 修复bug:柱状图导入数据问题; 直接访问工具收藏栏报错问题
This commit is contained in:
@@ -272,10 +272,12 @@ const updateDataFile = async (params) => {
|
||||
if(sheetArray.length == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
for(let item in sheetArray){
|
||||
if (sheetArray[item] != undefined) {
|
||||
tmpColumnData.push(sheetArray[item][0])
|
||||
tmpValueData.push(sheetArray[item][1])
|
||||
let tmp1 = sheetArray as []
|
||||
tmpColumnData.push(tmp1[item][0])
|
||||
tmpValueData.push(tmp1[item][1])
|
||||
}
|
||||
}
|
||||
useCount++
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useRoute } from 'vue-router'
|
||||
import { useToolsStore } from '@/store/modules/tools'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {rtrim} from '@/utils/string'
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
id: Number
|
||||
@@ -22,7 +23,8 @@ const userStore = useUserStore()
|
||||
|
||||
//根据路由查询tool id
|
||||
const getToolInfo = async () => {
|
||||
searchParam.route = route.path
|
||||
let routeStr = route.path
|
||||
searchParam.route = rtrim(routeStr, '/')
|
||||
await toolsStore.getToolInfo(searchParam)
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -113,11 +113,17 @@ export function numberToChinese(num: number): string {
|
||||
return chinese;
|
||||
}
|
||||
|
||||
//rtrim: 删除右侧指定字符, 默认删除空格
|
||||
export function rtrim(str, char = ' ') {
|
||||
return str.replace(new RegExp('\\'+char+'+$', 'g'), '');
|
||||
}
|
||||
|
||||
const StringUtils = {
|
||||
transferred,
|
||||
copy,
|
||||
genRandomStrByChars,
|
||||
numberToChinese
|
||||
numberToChinese,
|
||||
rtrim,
|
||||
}
|
||||
|
||||
export default StringUtils
|
||||
Reference in New Issue
Block a user