Merge branch 'dev-v2' into v2.10

This commit is contained in:
taojinlong
2025-03-13 10:22:25 +08:00
8 changed files with 57 additions and 27 deletions

View File

@@ -668,21 +668,23 @@ public class ExcelUtils {
List<TableField> fields = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
String s = reader.readLine();// first line
String[] split = s.split(",");
for (int i = 0; i < split.length; i++) {
String filedName = split[i];
if (StringUtils.isEmpty(filedName)) {
DEException.throwException(Translator.get("i18n_excel_error_first_row"));
if(StringUtils.isNotEmpty(s)){
String[] split = s.split(",");
for (int i = 0; i < split.length; i++) {
String filedName = split[i];
if (StringUtils.isEmpty(filedName)) {
DEException.throwException(Translator.get("i18n_excel_error_first_row"));
}
if (filedName.startsWith(UFEFF)) {
filedName = filedName.replace(UFEFF, "");
}
TableField tableFiled = new TableField();
tableFiled.setName(filedName);
tableFiled.setOriginName(filedName);
tableFiled.setFieldType(null);
tableFiled.setChecked(true);
fields.add(tableFiled);
}
if (filedName.startsWith(UFEFF)) {
filedName = filedName.replace(UFEFF, "");
}
TableField tableFiled = new TableField();
tableFiled.setName(filedName);
tableFiled.setOriginName(filedName);
tableFiled.setFieldType(null);
tableFiled.setChecked(true);
fields.add(tableFiled);
}
List<String[]> data = csvData(reader, isPreview, fields.size());
@@ -734,7 +736,7 @@ public class ExcelUtils {
return excelSheetDataList;
}
private static Map<String, String> downLoadFromFtp(ExcelConfiguration remoteExcelRequest) {
public static Map<String, String> downLoadFromFtp(ExcelConfiguration remoteExcelRequest) {
Map<String, String> fileNames = new HashMap<>();
String username = "";
String password = "";

View File

@@ -1,5 +1,6 @@
export default {
common: {
empty: ' ',
component: {
input: 'Input',
textarea: 'Textarea',
@@ -10,6 +11,8 @@ export default {
dateRange: 'Date Range Picker',
add_component_hint: 'Click or drag the component on the left to add a field'
},
local_excel: 'Local Excel/CSV',
remote_excel: 'Remote Excel/CSV',
list_selection: 'List selection',
date_setting: 'Date setting',
openMobileTerminal: 'Open mobile terminal',

View File

@@ -1,5 +1,6 @@
export default {
common: {
empty: '',
component: {
input: '單行輸入',
textarea: '多行輸入',
@@ -10,6 +11,8 @@ export default {
dateRange: '時間範圍',
add_component_hint: '點選或拖曳左側元件新增欄位'
},
local_excel: '本地 Excel/CSV',
remote_excel: '遠端 Excel/CSV',
list_selection: '清單選擇',
date_setting: '日期設定',
openMobileTerminal: '開啟行動端',

View File

@@ -1,6 +1,9 @@
export default {
common: {
empty: '',
timeout_tips: '请求超时请稍后再试',
local_excel: '本地 Excel/CSV',
remote_excel: '远程 Excel/CSV',
watermarkManagement: '水印管理',
list_selection: '列表选择',
date_setting: '日期设置',

View File

@@ -641,14 +641,31 @@ defineExpose({
:rules="[
{
required: true,
message: t('common.please_input') + t('datasource.datasource') + t('common.name')
message:
t('common.please_input') +
t('common.empty') +
t('datasource.datasource') +
t('common.empty') +
t('common.name')
}
]"
:label="t('visualization.custom') + t('datasource.datasource') + t('common.name')"
:label="
t('visualization.custom') +
t('common.empty') +
t('datasource.datasource') +
t('common.empty') +
t('common.name')
"
>
<el-input
v-model="param.name"
:placeholder="t('common.please_input') + t('datasource.datasource') + t('common.name')"
:placeholder="
t('common.please_input') +
t('common.empty') +
t('datasource.datasource') +
t('common.empty') +
t('common.name')
"
/>
</el-form-item>
</el-form>
@@ -787,7 +804,8 @@ defineExpose({
background: #f5f6f7;
padding: 16px;
.btn-select {
width: 164px;
min-width: 164px;
padding: 0 6px;
height: 32px;
display: flex;
align-items: center;
@@ -805,7 +823,7 @@ defineExpose({
}
.ed-button.is-text {
height: 24px;
width: 74px;
min-width: 74px;
line-height: 24px;
}
.ed-button + .ed-button {

View File

@@ -780,7 +780,7 @@ defineExpose({
</el-form-item>
<el-form-item :label="t('datasource.password')" v-show="activeStep !== 2">
<CustomPassword
:placeholder="t('common.inputText') + ' ' + t('datasource.password')"
:placeholder="t('common.inputText') + t('common.empty') + +t('datasource.password')"
show-password
type="password"
v-model="form.configuration.passwd"
@@ -1241,7 +1241,8 @@ defineExpose({
background: #f5f6f7;
padding: 16px;
.btn-select {
width: 164px;
min-width: 164px;
padding: 0 6px;
height: 32px;
display: flex;
align-items: center;
@@ -1259,7 +1260,7 @@ defineExpose({
}
.ed-button.is-text {
height: 24px;
width: 74px;
min-width: 74px;
line-height: 24px;
}
.ed-button + .ed-button {

View File

@@ -399,8 +399,8 @@ const doValidateDs = request => {
let excelRequest = JSON.parse(JSON.stringify(form2.configuration))
excelRequest.datasourceId = form2.id || 0
excelRequest.editType = form2.editType
excelRequest.userName = Base64.encode(request.userName)
excelRequest.passwd = Base64.encode(request.passwd)
excelRequest.userName = Base64.encode(excelRequest.userName)
excelRequest.passwd = Base64.encode(excelRequest.passwd)
return loadRemoteFile(excelRequest)
.then(res => {
dsLoading.value = false

View File

@@ -111,13 +111,13 @@ export const dsTypes = [
},
{
type: 'Excel',
name: '本地 Excel/CSV',
name: t('common.local_excel'),
catalog: 'LOCAL',
extraParams: ''
},
{
type: 'ExcelRemote',
name: '远程 Excel/CSV',
name: t('common.remote_excel'),
catalog: 'LOCAL',
extraParams: ''
}