diff --git a/core/core-backend/src/main/resources/db/desktop/V2.0__core_ddl.sql b/core/core-backend/src/main/resources/db/desktop/V2.0__core_ddl.sql index b1c72a94d1..d39e37808c 100644 --- a/core/core-backend/src/main/resources/db/desktop/V2.0__core_ddl.sql +++ b/core/core-backend/src/main/resources/db/desktop/V2.0__core_ddl.sql @@ -136,7 +136,7 @@ CREATE TABLE `core_dataset_table_field` `group_type` varchar(50) DEFAULT NULL COMMENT '维度/指标标识 d:维度,q:指标', `type` varchar(255) NOT NULL COMMENT '原始字段类型', `size` int DEFAULT NULL, - `de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制', + `de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制,7-URL', `de_extract_type` int NOT NULL COMMENT 'de记录的原始类型', `ext_field` int DEFAULT NULL COMMENT '是否扩展字段 0原始 1复制 2计算字段...', `checked` tinyint(1) DEFAULT '1' COMMENT '是否选中', diff --git a/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql index 402bd95878..1dd004b962 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.0__core_ddl.sql @@ -138,7 +138,7 @@ CREATE TABLE `core_dataset_table_field` `group_type` varchar(50) DEFAULT NULL COMMENT '维度/指标标识 d:维度,q:指标', `type` varchar(255) NOT NULL COMMENT '原始字段类型', `size` int DEFAULT NULL, - `de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制', + `de_type` int NOT NULL COMMENT 'dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制,7-URL', `de_extract_type` int NOT NULL COMMENT 'de记录的原始类型', `ext_field` int DEFAULT NULL COMMENT '是否扩展字段 0原始 1复制 2计算字段...', `checked` tinyint(1) DEFAULT NULL DEFAULT '1' COMMENT '是否选中', diff --git a/core/core-frontend/src/assets/svg/field_url.svg b/core/core-frontend/src/assets/svg/field_url.svg new file mode 100644 index 0000000000..4d6d540892 --- /dev/null +++ b/core/core-frontend/src/assets/svg/field_url.svg @@ -0,0 +1 @@ + diff --git a/core/core-frontend/src/components/icon-custom/src/Icon.vue b/core/core-frontend/src/components/icon-custom/src/Icon.vue index c7deac92e6..786b6b13b7 100644 --- a/core/core-frontend/src/components/icon-custom/src/Icon.vue +++ b/core/core-frontend/src/components/icon-custom/src/Icon.vue @@ -232,6 +232,7 @@ import field_location from '@/assets/svg/field_location.svg' import field_text from '@/assets/svg/field_text.svg' import field_time from '@/assets/svg/field_time.svg' import field_value from '@/assets/svg/field_value.svg' +import field_url from '@/assets/svg/field_url.svg' import filterCenter from '@/assets/svg/filter-center.svg' import filterHCenter from '@/assets/svg/filter-h-center.svg' import filterHLeft from '@/assets/svg/filter-h-left.svg' @@ -901,6 +902,7 @@ const iconMap = { field_text: field_text, field_time: field_time, field_value: field_value, + field_url: field_url, 'filter-center': filterCenter, 'filter-h-center': filterHCenter, 'filter-h-left': filterHLeft, diff --git a/core/core-frontend/src/utils/attr.ts b/core/core-frontend/src/utils/attr.ts index f373d9bd57..57a6123af8 100644 --- a/core/core-frontend/src/utils/attr.ts +++ b/core/core-frontend/src/utils/attr.ts @@ -99,8 +99,17 @@ export const selectKey = ['textAlign', 'borderStyle', 'verticalAlign'] export const horizontalPosition = ['headHorizontalPosition'] -export const fieldType = ['text', 'time', 'value', 'value', 'value', 'location'] -export const fieldTypeText = ['文本', '时间', '数值', '数值(小数)', '数值', '地理位置'] +export const fieldType = ['text', 'time', 'value', 'value', 'value', 'location', 'binary', 'url'] +export const fieldTypeText = [ + '文本', + '时间', + '数值', + '数值(小数)', + '数值', + '地理位置', + '文件', + 'URL' +] export const optionMap = { textAlign: textAlignOptions, diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue index f423f3aaa0..c3a58e9980 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue @@ -198,7 +198,7 @@ onMounted(() => { diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index 836f1bb5c9..d73d656a8c 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -292,7 +292,7 @@ onMounted(() => { diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue index 73dcb2d95b..46a64a9148 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue @@ -178,7 +178,7 @@ const init = () => { } const initOptions = item => { if (item.field) { - if (item.field.deType === 0 || item.field.deType === 5) { + if ([0, 5, 7].includes(item.field.deType)) { item.options = JSON.parse(JSON.stringify(textOptions)) } else if (item.field.deType === 1) { item.options = JSON.parse(JSON.stringify(dateOptions)) @@ -270,7 +270,9 @@ init() > diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index 70f7ffddfd..3ddbd72bca 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -2986,7 +2986,9 @@ const deleteChartFieldItem = id => { > @@ -3059,7 +3061,9 @@ const deleteChartFieldItem = id => { > diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index 432f068890..73d4e2e8af 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -8,7 +8,25 @@ import { isNumber } from 'lodash-es' import { copyContent, SortTooltip } from '@/views/chart/components/js/panel/common/common_table' const { t } = useI18n() - +class ImageCell extends TableDataCell { + protected drawTextShape(): void { + const img = new Image() + const { x, y, width, height, fieldValue } = this.meta + img.src = fieldValue as string + img.onload = () => { + !this.cfg.children && (this.cfg.children = []) + this.textShape = this.addShape('image', { + attrs: { + x, + y, + width, + height, + img + } + }) + } + } +} /** * 明细表 */ @@ -127,13 +145,16 @@ export class TableInfo extends S2ChartView { } return new TableColCell(node, sheet, config) } - s2Options.dataCell = viewMeta => { - if (viewMeta.colIndex === 0) { - viewMeta.fieldValue = - pageInfo.pageSize * (pageInfo.currentPage - 1) + viewMeta.rowIndex + 1 - } - return new TableDataCell(viewMeta, viewMeta?.spreadsheet) + } + s2Options.dataCell = viewMeta => { + const deType = axisMap[viewMeta.valueField]?.deType + if (deType === 7) { + return new ImageCell(viewMeta, viewMeta?.spreadsheet) } + if (viewMeta.colIndex === 0 && s2Options.showSeriesNumber) { + viewMeta.fieldValue = pageInfo.pageSize * (pageInfo.currentPage - 1) + viewMeta.rowIndex + 1 + } + return new TableDataCell(viewMeta, viewMeta?.spreadsheet) } // tooltip this.configTooltip(chart, s2Options) diff --git a/core/core-frontend/src/views/visualized/data/dataset/form/index.vue b/core/core-frontend/src/views/visualized/data/dataset/form/index.vue index c887f1cafc..2dda56480b 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/form/index.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/form/index.vue @@ -138,7 +138,8 @@ const fieldOptions = [ { label: t('dataset.value') + '(' + t('dataset.float') + ')', value: 3 - } + }, + { label: 'URL', value: 7 } ] const fieldOptionsText = [ @@ -739,6 +740,9 @@ const getIconName = (type: number) => { if (type === 5) { return 'location' } + if (type === 7) { + return 'url' + } } const allfields = ref([]) @@ -1632,7 +1636,9 @@ const getDsIconName = data => { diff --git a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasetTableFieldDTO.java b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasetTableFieldDTO.java index a3f3f8a14e..3b644ab85f 100644 --- a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasetTableFieldDTO.java +++ b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasetTableFieldDTO.java @@ -82,7 +82,7 @@ public class DatasetTableFieldDTO implements Serializable { private Integer scale; /** - * dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制 + * dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制, 7-URL */ private Integer deType;