diff --git a/core/core-frontend/src/custom-component/v-query/Time.vue b/core/core-frontend/src/custom-component/v-query/Time.vue
index 84739de23e..224e65c9d1 100644
--- a/core/core-frontend/src/custom-component/v-query/Time.vue
+++ b/core/core-frontend/src/custom-component/v-query/Time.vue
@@ -299,11 +299,19 @@ const disabledDate = val => {
if (intervalType === 'timeInterval') {
const startTime =
regularOrTrends === 'fixed'
- ? regularOrTrendsValue[0]
+ ? new Date(
+ dayjs(new Date(regularOrTrendsValue[0]))
+ .startOf(queryTimeType.value)
+ .format('YYYY/MM/DD HH:mm:ss')
+ )
: getAround(relativeToCurrentType, around === 'f' ? 'subtract' : 'add', timeNum)
const endTime =
regularOrTrends === 'fixed'
- ? regularOrTrendsValue[1]
+ ? new Date(
+ dayjs(new Date(regularOrTrendsValue[1]))
+ .endOf(queryTimeType.value)
+ .format('YYYY/MM/DD HH:mm:ss')
+ )
: getAround(
relativeToCurrentTypeRange,
aroundRange === 'f' ? 'subtract' : 'add',
diff --git a/core/core-frontend/src/custom-component/v-query/time-format.ts b/core/core-frontend/src/custom-component/v-query/time-format.ts
index a6e4a5d1c4..1655625485 100644
--- a/core/core-frontend/src/custom-component/v-query/time-format.ts
+++ b/core/core-frontend/src/custom-component/v-query/time-format.ts
@@ -233,6 +233,7 @@ interface TimeRange {
regularOrTrends: string
regularOrTrendsValue: string
relativeToCurrent: string
+ relativeToCurrentRange: string
timeNum: number
relativeToCurrentType: ManipulateType
around: string
diff --git a/core/core-frontend/src/hooks/web/useFilter.ts b/core/core-frontend/src/hooks/web/useFilter.ts
index 204b182420..c6eaf8ef4f 100644
--- a/core/core-frontend/src/hooks/web/useFilter.ts
+++ b/core/core-frontend/src/hooks/web/useFilter.ts
@@ -1,6 +1,7 @@
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
import { getDynamicRange, getCustomTime } from '@/custom-component/v-query/time-format'
+import { getCustomRange } from '@/custom-component/v-query/time-format-dayjs'
const dvMainStore = dvMainStoreWithOut()
const { componentData } = storeToRefs(dvMainStore)
@@ -266,6 +267,7 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
timeNum,
relativeToCurrentType,
around,
+ relativeToCurrentRange,
arbitraryTime,
timeGranularity,
timeNumRange,
@@ -275,7 +277,7 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
arbitraryTimeRange
} = item
- const startTime = getCustomTime(
+ let startTime = getCustomTime(
timeNum,
relativeToCurrentType,
timeGranularity,
@@ -284,7 +286,7 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
timeGranularityMultiple,
'start-panel'
)
- const endTime = getCustomTime(
+ let endTime = getCustomTime(
timeNumRange,
relativeToCurrentTypeRange,
timeGranularity,
@@ -293,6 +295,10 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
timeGranularityMultiple,
'end-panel'
)
+
+ if (!!relativeToCurrentRange && relativeToCurrentRange !== 'custom') {
+ ;[startTime, endTime] = getCustomRange(relativeToCurrentRange)
+ }
item.defaultValue = [startTime, endTime]
item.selectValue = [startTime, endTime]
selectValue = [startTime, endTime]
diff --git a/core/core-frontend/src/hooks/web/useMoveLine.ts b/core/core-frontend/src/hooks/web/useMoveLine.ts
index 7602ad59e8..f1413f3c0d 100644
--- a/core/core-frontend/src/hooks/web/useMoveLine.ts
+++ b/core/core-frontend/src/hooks/web/useMoveLine.ts
@@ -1,7 +1,7 @@
import { ref, onBeforeUnmount, onMounted } from 'vue'
import { useCache } from '@/hooks/web/useCache'
-type Sidebar = 'DATASET' | 'DASHBOARD' | 'DATASOURCE'
+type Sidebar = 'DATASET' | 'DASHBOARD' | 'DATASOURCE' | 'DATA-FILLING'
export const useMoveLine = (type: Sidebar) => {
const { wsCache } = useCache('localStorage')
diff --git a/core/core-frontend/src/layout/components/Copilot.vue b/core/core-frontend/src/layout/components/Copilot.vue
index 14bba2251d..6070bf79c9 100644
--- a/core/core-frontend/src/layout/components/Copilot.vue
+++ b/core/core-frontend/src/layout/components/Copilot.vue
@@ -73,7 +73,7 @@ onMounted(() => {
border: 0px !important;
border-color: #ffffff !important;
font-weight: 500;
- color: rgba(51, 112, 255, 1) !important;
+ color: var(--ed-color-primary, rgba(51, 112, 255, 1)) !important;
}
}
}
diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts
index 06d6fefd59..191e0af9fa 100644
--- a/core/core-frontend/src/locales/en.ts
+++ b/core/core-frontend/src/locales/en.ts
@@ -1,5 +1,15 @@
export default {
common: {
+ component: {
+ input: 'Input',
+ textarea: 'Textarea',
+ select: 'Select',
+ radio: 'Radio',
+ checkbox: 'Checkbox',
+ date: 'Date Picker',
+ dateRange: 'Date Range Picker',
+ add_component_hint: 'Click or drag the component on the left to add a field'
+ },
inputText: 'Please input',
account: 'Account',
email: 'Email',
@@ -250,5 +260,163 @@ export default {
template_manage: {
name_already_exists_type: 'Classification name already exists',
the_same_category: 'The template name already exists under the same category'
+ },
+ data_fill: {
+ data_fill: 'Data Filling',
+ permission: 'Data Filling Permission',
+ enable: 'Enable',
+ enable_hint: 'Cannot disable after enable',
+ new_folder: 'New Folder',
+ form_manage: 'Form Manage',
+ my_job: 'My Job',
+ form: {
+ mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number',
+ email_format_is_incorrect: 'The mailbox format is incorrect',
+ name: 'Name',
+ rename: 'Rename',
+ untitled: 'Untitled',
+ create_new_form: 'Create New Form',
+ copy_new_form: 'Copy Form',
+ edit_form: 'Edit Form',
+ title: 'Title',
+ no_form: 'Click to Create New',
+ form_list_name: 'Form List',
+ create_form: 'Create Form',
+ please_select: 'Please Select',
+ component: 'Component',
+ component_setting: 'Component Setting',
+ hint: 'Hint',
+ option: 'Option',
+ form_setting: 'Form Setting',
+ input_limit_50: 'No more than 50 characters',
+ confirm_delete: 'Confirm delete? (The tables created in database will not be deleted)',
+ list: 'Form List',
+ record: 'Fill Record',
+ task_manage: 'Task Manage',
+ form_name: 'Form Name',
+ commit_type: 'Form Commit Type',
+ commit_type_append: 'Append',
+ commit_type_update: 'Update',
+ commit_rule: 'Update Rules',
+ commit_rule_add: 'Add Update Rule',
+ commit_rule_settings: 'Update Rule Settings',
+ commit_rule_set: 'Set',
+ folder: 'Folder',
+ datasource: 'Datasource',
+ table: 'Table',
+ creator: 'Creator',
+ createTime: 'Create Time',
+ operation: 'Operation',
+ operator: 'Operator',
+ operate_time: 'Operate Time',
+ modify: 'Modify',
+ show: 'Show',
+ delete: 'Delete',
+ show_data: 'Show Data',
+ text: 'Text',
+ number: 'Number',
+ tel: 'Tel',
+ email: 'Email',
+ duplicate_error: 'Duplicate',
+ value_not_exists: 'Value Not Exists',
+ range_separator: 'Range Separator',
+ start_hint_word: 'Start Hint Word',
+ end_hint_word: 'End Hint Word',
+ input_type: 'Input Type',
+ date_type: 'Date Format',
+ check: 'Check',
+ set_required: 'Set Required',
+ set_unique: 'Set Unique',
+ set_multiple: 'Set Multiple',
+ use_datetime: 'Use Datetime',
+ custom: 'Custom',
+ use_datasource: 'Bind Datasource',
+ bind_column: 'Bind Column',
+ bind_complete: 'Bind',
+ option_value: 'Options',
+ add_option: 'Add Option',
+ form_name_cannot_none: 'Form name cannot be null',
+ form_update_rule_none: 'Update Rules cannot be null',
+ form_components_cannot_null: 'Form components cannot be null',
+ option_list_cannot_empty: 'Option list cannot be empty',
+ option_list_datasource_cannot_empty: 'Datasource Settings of option list cannot be empty',
+ component_setting_error: 'Component setting error',
+ table_name: 'Table',
+ form_column: 'Form Column',
+ column_name: 'Table Column',
+ column_type: 'Table Column Type',
+ create_index: 'Create Index',
+ add_index: 'Add Index',
+ index_name: 'Index Name',
+ create_index_hint:
+ 'MySQL versions earlier than 8.0 or MariaDB versions earlier than 10.8.0 do not support Descending indexes',
+ index_column: 'Index Column',
+ order: 'Sort',
+ order_asc: 'Asc',
+ order_desc: 'Desc',
+ order_none: 'Default Order',
+ add_column: 'Add Column',
+ please_insert_start: 'Start Time Column Name',
+ please_insert_end: 'End Time Column Name',
+ save_form: 'Save Form',
+ default: 'default',
+ default_built_in: 'Built-in Database'
+ },
+ database: {
+ nvarchar: 'Nvarchar',
+ text: 'Text',
+ number: 'Number',
+ decimal: 'Decimal',
+ datetime: 'Datetime'
+ },
+ data: {
+ confirm_delete: 'Confirm delete?',
+ add_data: 'Add Data',
+ download_template: 'Download Template',
+ insert_data: 'Insert Data',
+ update_data: 'Update Data',
+ delete_data: 'Delete Data',
+ recent_committer: 'Recent Committer',
+ recent_commit_time: 'Recent Commit Time',
+ start: 'Start',
+ end: 'End',
+ id_is: 'ID [',
+ data_not_found: '] Not Found'
+ },
+ task: {
+ name: 'Name',
+ creator: 'Creator',
+ create_time: 'Create Time',
+ rate_type: 'Rate Type',
+ task_status: 'Status',
+ add_task: 'Add Task',
+ task_name: 'Task Name',
+ task_remain_time: 'Remaining Validity',
+ task_sender: 'Task Sender',
+ start_filling: 'Start Filling',
+ task_distribute_time: 'Distribution Time',
+ task_expiration_time: 'Expiration Time',
+ task_finished_time: 'Finished Time',
+ task_end_time: 'End Time',
+ edit_data: 'Edit Data',
+ show_data: 'Show Data',
+ confirm_enable: 'Confirm enable task?',
+ confirm_disable: 'Confirm disable task?',
+ edit_task: 'Edit Task',
+ create_task: 'Create Task',
+ edit: 'Edit',
+ stop: 'Stop',
+ start: 'Start',
+ delete: 'Delete',
+ no_time_limit: 'No Time Limit',
+ todo: 'Todo',
+ finished: 'Committed',
+ expired: 'Expired',
+ task_finish_in: 'Task Finished in ',
+ task_finish_in_suffix: '',
+ open_sub_task: 'Open Sub Tasks'
+ },
+ on_the_left: 'Please select a form on the left',
+ search_by_commit_name: 'Search by operator name'
}
}
diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts
index 68e07d703e..aaed10e25f 100644
--- a/core/core-frontend/src/locales/tw.ts
+++ b/core/core-frontend/src/locales/tw.ts
@@ -1,5 +1,15 @@
export default {
common: {
+ component: {
+ input: '單行輸入',
+ textarea: '多行輸入',
+ select: '下拉框',
+ radio: '單選',
+ checkbox: '多選框',
+ date: '日期',
+ dateRange: '時間范圍',
+ add_component_hint: '點擊或拖拽左側組件添加字段'
+ },
inputText: '请输入',
add: '添加',
account: '账号',
@@ -152,5 +162,162 @@ export default {
template_manage: {
name_already_exists_type: '分类名称已存在',
the_same_category: '同一分类下,该模板名称已存在'
+ },
+ data_fill: {
+ data_fill: '數據填報',
+ permission: '填報權限',
+ enable: '開啟',
+ enable_hint: '數據填報開啟后,可將表單數據存放至數據源中,一旦開啟后,后期不允許關閉。',
+ new_folder: '新建文件夾',
+ form_manage: '表單管理',
+ my_job: '我的填報',
+ form: {
+ mobile_number_format_is_incorrect: '手機號碼格式不正確',
+ email_format_is_incorrect: '郵箱格式不正確',
+ name: '名稱',
+ rename: '重命名',
+ untitled: '未命名表單',
+ create_new_form: '新建表單',
+ copy_new_form: '復制表單',
+ edit_form: '編輯表單',
+ title: '標題',
+ no_form: '暫無表單,點擊',
+ form_list_name: '填報表單',
+ create_form: '新建表單',
+ please_select: '請選擇',
+ component: '組件',
+ component_setting: '組件設置',
+ hint: '提示詞',
+ input_limit_50: '不超過50個字符',
+ option: '選項',
+ form_setting: '表單設置',
+ confirm_delete: '確認刪除?(不會刪除已創建的數據庫表)',
+ list: '表單數據',
+ record: '提交記錄',
+ task_manage: '任務管理',
+ form_name: '表單名稱',
+ commit_type: '表單提交方式',
+ commit_type_append: '數據追加',
+ commit_type_update: '數據更新',
+ commit_rule: '更新條件',
+ commit_rule_add: '添加更新規則',
+ commit_rule_settings: '更新規則設置',
+ commit_rule_set: '已設置',
+ folder: '所屬文件夾',
+ datasource: '數據源',
+ table: '數據庫表',
+ creator: '創建人',
+ createTime: '創建時間',
+ operation: '操作',
+ operator: '操作人',
+ operate_time: '操作時間',
+ modify: '修改',
+ show: '查看',
+ delete: '刪除',
+ show_data: '查看數據',
+ text: '普通文本',
+ number: '數字',
+ tel: '手機號',
+ email: '郵箱',
+ duplicate_error: '重復',
+ value_not_exists: '值不存在',
+ range_separator: '分割字符',
+ start_hint_word: '開始提示詞',
+ end_hint_word: '結束提示詞',
+ input_type: '格式類型',
+ date_type: '展示粒度',
+ check: '校驗',
+ set_required: '設置為必填項',
+ set_unique: '不允許重復值',
+ set_multiple: '允許多選',
+ use_datetime: '使用日期時間',
+ custom: '自定義',
+ use_datasource: '綁定數據源',
+ bind_column: '綁定字段',
+ bind_complete: '已綁定',
+ option_value: '選項值',
+ add_option: '添加選項值',
+ form_name_cannot_none: '表單名稱不能為空',
+ form_update_rule_none: '請配置更新規則',
+ form_components_cannot_null: '請添加表單組件',
+ option_list_cannot_empty: '選項值不能為空',
+ option_list_datasource_cannot_empty: '選項值綁定數據源配置不能為空',
+ component_setting_error: '組件設置錯誤',
+ table_name: '數據庫表名',
+ form_column: '表單字段',
+ column_name: '數據庫表字段名稱',
+ column_type: '數據庫字段類型',
+ create_index: '創建索引',
+ add_index: '新增索引',
+ index_name: '索引名稱',
+ create_index_hint: 'MySQL 8.0 或 MariaDB 10.8.0 以下版本不支持索引降序排序',
+ index_column: '索引字段',
+ order: '排序',
+ order_asc: '升序',
+ order_desc: '降序',
+ order_none: '默認排序',
+ add_column: '新增字段',
+ please_insert_start: '請輸入開始時間',
+ please_insert_end: '請輸入結束時間',
+ save_form: '保存表單',
+ default: '默認',
+ default_built_in: '內建數據庫'
+ },
+ database: {
+ nvarchar: '字符串',
+ text: '長文本',
+ number: '整型數字',
+ decimal: '小數數字',
+ datetime: '日期'
+ },
+ data: {
+ confirm_delete: '確認刪除?',
+ add_data: '添加數據',
+ download_template: '下載模板',
+ insert_data: '插入數據',
+ update_data: '更新數據',
+ delete_data: '刪除數據',
+ recent_committer: '最近提交人',
+ recent_commit_time: '最近提交時間',
+ start: '開始',
+ end: '結束',
+ id_is: 'ID為[',
+ data_not_found: ']的數據不存在'
+ },
+ task: {
+ name: '名稱',
+ creator: '創建人',
+ create_time: '創建時間',
+ rate_type: '任務下發模式',
+ task_status: '任務狀態',
+ add_task: '添加任務',
+ task_name: '任務名稱',
+ task_remain_time: '任務有效期',
+ task_sender: '任務下發人',
+ start_filling: '立即填報',
+ task_distribute_time: '任務下發時間',
+ task_expiration_time: '任務過期時間',
+ task_finished_time: '任務完成時間',
+ task_end_time: '任務截止時間',
+ edit_data: '編輯數據',
+ show_data: '查看數據',
+ confirm_enable: '確認啟動任務?(單次任務會新建下發任務)',
+ confirm_disable: '確認停止任務?',
+ edit_task: '編輯任務',
+ create_task: '新建任務',
+ edit: '編輯',
+ stop: '停止',
+ start: '啟動',
+ delete: '刪除',
+ no_time_limit: '不限時',
+ todo: '待辦項',
+ finished: '已提交',
+ expired: '已過期',
+ task_finish_in: '在任務下發',
+ task_finish_in_suffix: '內完成填報',
+ open_sub_task: '查看子任務'
+ },
+ on_the_left: '請在左側選擇表單',
+ search_by_commit_name: '根據操作人名稱搜索'
}
}
diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts
index c887e48ef2..d86105cc7f 100644
--- a/core/core-frontend/src/locales/zh-CN.ts
+++ b/core/core-frontend/src/locales/zh-CN.ts
@@ -1,5 +1,15 @@
export default {
common: {
+ component: {
+ input: '单行输入',
+ textarea: '多行输入',
+ select: '下拉框',
+ radio: '单选',
+ checkbox: '多选框',
+ date: '日期',
+ dateRange: '时间范围',
+ add_component_hint: '点击或拖拽左侧组件添加字段'
+ },
inputText: '请输入',
add: '添加',
account: '账号',
@@ -2562,6 +2572,10 @@ export default {
once_a_day: '每天',
once_a_week: '每周',
once_a_month: '每月',
+ hour: '小时',
+ day: '天',
+ week: '周',
+ month: '月',
week_mon: '一',
week_tue: '二',
week_wed: '三',
@@ -2578,5 +2592,162 @@ export default {
variable: {
give_up: 's',
save_apply: '保存并应用'
+ },
+ data_fill: {
+ data_fill: '数据填报',
+ permission: '填报权限',
+ enable: '开启',
+ enable_hint: '数据填报开启后,可将表单数据存放至数据源中,一旦开启后,后期不允许关闭。',
+ new_folder: '新建文件夹',
+ form_manage: '表单管理',
+ my_job: '我的填报',
+ form: {
+ special_characters_are_not_supported: '不支持特殊字符',
+ mobile_number_format_is_incorrect: '手机号码格式不正确',
+ name: '名称',
+ rename: '重命名',
+ untitled: '未命名表单',
+ create_new_form: '新建表单',
+ copy_new_form: '复制表单',
+ edit_form: '编辑表单',
+ title: '标题',
+ no_form: '暂无表单,点击',
+ form_list_name: '填报表单',
+ create_form: '新建表单',
+ please_select: '请选择',
+ component: '组件',
+ component_setting: '组件设置',
+ hint: '提示词',
+ input_limit_50: '不超过50个字符',
+ option: '选项',
+ form_setting: '表单设置',
+ confirm_delete: '确认删除?(不会删除已创建的数据库表)',
+ list: '表单数据',
+ record: '提交记录',
+ task_manage: '任务管理',
+ form_name: '表单名称',
+ commit_type: '表单提交方式',
+ commit_type_append: '数据追加',
+ commit_type_update: '数据更新',
+ commit_rule: '更新条件',
+ commit_rule_add: '添加更新规则',
+ commit_rule_settings: '更新规则设置',
+ commit_rule_set: '已设置',
+ folder: '所属文件夹',
+ datasource: '数据源',
+ table: '数据库表',
+ creator: '创建人',
+ createTime: '创建时间',
+ operation: '操作',
+ operator: '操作人',
+ operate_time: '操作时间',
+ modify: '修改',
+ show: '查看',
+ delete: '删除',
+ show_data: '查看数据',
+ text: '普通文本',
+ number: '数字',
+ tel: '手机号',
+ email: '邮箱',
+ duplicate_error: '重复',
+ value_not_exists: '值不存在',
+ range_separator: '分割字符',
+ start_hint_word: '开始提示词',
+ end_hint_word: '结束提示词',
+ input_type: '格式类型',
+ date_type: '展示粒度',
+ check: '校验',
+ set_required: '设置为必填项',
+ set_unique: '不允许重复值',
+ set_multiple: '允许多选',
+ use_datetime: '使用日期时间',
+ custom: '自定义',
+ use_datasource: '绑定数据源',
+ bind_column: '绑定字段',
+ bind_complete: '已绑定',
+ option_value: '选项值',
+ add_option: '添加选项值',
+ form_name_cannot_none: '表单名称不能为空',
+ form_update_rule_none: '请配置更新规则',
+ form_components_cannot_null: '请添加表单组件',
+ option_list_cannot_empty: '选项值不能为空',
+ option_list_datasource_cannot_empty: '选项值绑定数据源配置不能为空',
+ component_setting_error: '组件设置错误',
+ table_name: '数据库表名',
+ form_column: '表单字段',
+ column_name: '数据库表字段名称',
+ column_type: '数据库字段类型',
+ create_index: '创建索引',
+ add_index: '新增索引',
+ index_name: '索引名称',
+ create_index_hint: 'MySQL 8.0 或 MariaDB 10.8.0 以下版本不支持索引降序排序',
+ index_column: '索引字段',
+ order: '排序',
+ order_asc: '升序',
+ order_desc: '降序',
+ order_none: '默认排序',
+ add_column: '新增字段',
+ please_insert_start: '请输入开始时间',
+ please_insert_end: '请输入结束时间',
+ save_form: '保存表单',
+ default: '默认',
+ default_built_in: '内建数据库'
+ },
+ database: {
+ nvarchar: '字符串',
+ text: '长文本',
+ number: '整型数字',
+ decimal: '小数数字',
+ datetime: '日期'
+ },
+ data: {
+ confirm_delete: '确认删除?',
+ add_data: '添加数据',
+ download_template: '下载模板',
+ insert_data: '插入数据',
+ update_data: '更新数据',
+ delete_data: '删除数据',
+ recent_committer: '最近提交人',
+ recent_commit_time: '最近提交时间',
+ start: '开始',
+ end: '结束',
+ id_is: 'ID为[',
+ data_not_found: ']的数据不存在'
+ },
+ task: {
+ name: '名称',
+ creator: '创建人',
+ create_time: '创建时间',
+ rate_type: '任务下发模式',
+ task_status: '任务状态',
+ task_name: '任务名称',
+ add_task: '添加任务',
+ task_remain_time: '任务有效期',
+ task_sender: '任务下发人',
+ start_filling: '立即填报',
+ task_distribute_time: '任务下发时间',
+ task_expiration_time: '任务过期时间',
+ task_finished_time: '任务完成时间',
+ task_end_time: '任务截止时间',
+ edit_data: '编辑数据',
+ show_data: '查看数据',
+ confirm_enable: '确认启动任务?(单次任务会新建下发任务)',
+ confirm_disable: '确认停止任务?',
+ edit_task: '编辑任务',
+ create_task: '新建任务',
+ edit: '编辑',
+ stop: '停止',
+ start: '启动',
+ delete: '删除',
+ no_time_limit: '不限时',
+ todo: '待办项',
+ finished: '已提交',
+ expired: '已过期',
+ task_finish_in: '在任务下发',
+ task_finish_in_suffix: '内完成填报',
+ open_sub_task: '查看子任务'
+ },
+ on_the_left: '请在左侧选择表单',
+ search_by_commit_name: '根据操作人名称搜索'
}
}
diff --git a/core/core-frontend/src/pages/panel/ViewWrapper.vue b/core/core-frontend/src/pages/panel/ViewWrapper.vue
index daf158ae12..e905f83b82 100644
--- a/core/core-frontend/src/pages/panel/ViewWrapper.vue
+++ b/core/core-frontend/src/pages/panel/ViewWrapper.vue
@@ -113,8 +113,15 @@ onBeforeMount(async () => {
}
)
})
-const userViewEnlargeOpen = () => {
- userViewEnlargeRef.value.dialogInit(state.canvasStylePreview, viewInfo.value, config.value)
+const userViewEnlargeOpen = (a, b) => {
+ console.log(a, b, 'item')
+
+ userViewEnlargeRef.value.dialogInit(
+ state.canvasStylePreview,
+ viewInfo.value,
+ config.value,
+ 'details'
+ )
}
const onPointClick = param => {
diff --git a/core/core-frontend/src/store/modules/interactive.ts b/core/core-frontend/src/store/modules/interactive.ts
index 40d7392e98..c1e8292a02 100644
--- a/core/core-frontend/src/store/modules/interactive.ts
+++ b/core/core-frontend/src/store/modules/interactive.ts
@@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
-import { store } from '../index'
+import { store } from '@/store'
import { queryTreeApi } from '@/api/visualization/dataVisualization'
import { getDatasetTree } from '@/api/dataset'
import { listDatasources } from '@/api/datasource'
@@ -7,6 +7,7 @@ import type { BusiTreeRequest, BusiTreeNode } from '@/models/tree/TreeNode'
import { pathValid } from '@/store/modules/permission'
import { useCache } from '@/hooks/web/useCache'
import { useAppStoreWithOut } from '@/store/modules/app'
+import { listDataFillingForms } from '@/api/data-filling'
const appStore = useAppStoreWithOut()
const { wsCache } = useCache()
export interface InnerInteractive {
@@ -21,9 +22,9 @@ interface InteractiveState {
data: Record
}
-const apiMap = [queryTreeApi, queryTreeApi, getDatasetTree, listDatasources]
+const apiMap = [queryTreeApi, queryTreeApi, getDatasetTree, listDatasources, listDataFillingForms]
-const busiFlagMap = ['dashboard', 'dataV', 'dataset', 'datasource']
+const busiFlagMap = ['dashboard', 'dataV', 'dataset', 'datasource', 'data-filling']
export const interactiveStore = defineStore('interactive', {
state: (): InteractiveState => ({
diff --git a/core/core-frontend/src/utils/validate.ts b/core/core-frontend/src/utils/validate.ts
index 1cef68b90b..efb9858a7d 100644
--- a/core/core-frontend/src/utils/validate.ts
+++ b/core/core-frontend/src/utils/validate.ts
@@ -12,3 +12,5 @@ export function validUsername(str) {
}
export const PHONE_REGEX = '^1[3|4|5|7|8][0-9]{9}$'
+
+export const EMAIL_REGEX = '^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$'
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts
index f013a706ed..f22d360810 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts
@@ -1,4 +1,4 @@
-import { Column, ColumnOptions } from '@antv/g2plot/esm/plots/column'
+import type { Column, ColumnOptions } from '@antv/g2plot/esm/plots/column'
import { cloneDeep, isEmpty } from 'lodash-es'
import {
G2PlotChartView,
@@ -11,7 +11,7 @@ import {
setUpGroupSeriesColor,
setUpStackSeriesColor
} from '@/views/chart/components/js/util'
-import { Datum } from '@antv/g2plot'
+import type { Datum } from '@antv/g2plot'
import { valueFormatter } from '@/views/chart/components/js/formatter'
import {
BAR_AXIS_TYPE,
@@ -22,6 +22,7 @@ import { getPadding, setGradientColor } from '@/views/chart/components/js/panel/
import { useI18n } from '@/hooks/web/useI18n'
import { DEFAULT_LABEL } from '@/views/chart/components/editor/util/chart'
import { clearExtremum, extremumEvt } from '@/views/chart/components/js/extremumUitl'
+import { Group } from '@antv/g-canvas'
const { t } = useI18n()
const DEFAULT_DATA: any[] = []
@@ -93,7 +94,7 @@ export class Bar extends G2PlotChartView {
}
}
- drawChart(drawOptions: G2PlotDrawOptions): Column {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart?.data?.data?.length) {
clearExtremum(chart)
@@ -106,8 +107,9 @@ export class Bar extends G2PlotChartView {
data
}
const options: ColumnOptions = this.setupOptions(chart, initOptions)
-
- const newChart = new Column(container, options)
+ let newChart = null
+ const { Column: ColumnClass } = await import('@antv/g2plot/esm/plots/column')
+ newChart = new ColumnClass(container, options)
newChart.on('interval:click', action)
extremumEvt(newChart, chart, options, container)
return newChart
@@ -146,7 +148,7 @@ export class Bar extends G2PlotChartView {
return
}
const value = valueFormatter(data.value, labelCfg.formatterCfg)
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
group.addShape({
type: 'text',
attrs: {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts
index 895cbb292f..2aef190e8c 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts
@@ -9,14 +9,16 @@ import {
getYAxisExt,
setGradientColor
} from '@/views/chart/components/js/panel/common/common_antv'
-import {
+import type {
BidirectionalBar as G2BidirectionalBar,
BidirectionalBarOptions
} from '@antv/g2plot/esm/plots/bidirectional-bar'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { useI18n } from '@/hooks/web/useI18n'
import { valueFormatter } from '@/views/chart/components/js/formatter'
-import { Options } from '@antv/g2plot/esm'
+import type { Options } from '@antv/g2plot/esm'
+import { Group } from '@antv/g-canvas'
+
const { t } = useI18n()
/**
* 对称柱状图
@@ -101,7 +103,7 @@ export class BidirectionalHorizontalBar extends G2PlotChartView<
}
}
- drawChart(drawOptions: G2PlotDrawOptions): G2BidirectionalBar {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -150,8 +152,11 @@ export class BidirectionalHorizontalBar extends G2PlotChartView<
}
}
}
+ const { BidirectionalBar: BidirectionalBarClass } = await import(
+ '@antv/g2plot/esm/plots/bidirectional-bar'
+ )
// 开始渲染
- const newChart = new G2BidirectionalBar(container, options)
+ const newChart = new BidirectionalBarClass(container, options)
newChart.on('interval:click', action)
newChart.on('element:click', ev => {
@@ -451,7 +456,7 @@ export class BidirectionalHorizontalBar extends G2PlotChartView<
} else {
res = valueFormatter(value, l.labelFormatter)
}
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
const isValue = param['series-field-key'] === 'value'
const textAlign = isValue && layoutHorizontal ? 'end' : 'start'
const isMiddle = label.position === 'middle'
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts
index 1855afb072..be75cead88 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Bar, BarOptions } from '@antv/g2plot/esm/plots/bar'
+import type { Bar, BarOptions } from '@antv/g2plot/esm/plots/bar'
import { getPadding, setGradientColor } from '@/views/chart/components/js/panel/common/common_antv'
import { cloneDeep } from 'lodash-es'
import {
@@ -17,9 +17,10 @@ import {
BAR_EDITOR_PROPERTY,
BAR_EDITOR_PROPERTY_INNER
} from '@/views/chart/components/js/panel/charts/bar/common'
-import { Datum } from '@antv/g2plot/esm/types/common'
+import type { Datum } from '@antv/g2plot/esm/types/common'
import { useI18n } from '@/hooks/web/useI18n'
import { DEFAULT_LABEL } from '@/views/chart/components/editor/util/chart'
+import { Group } from '@antv/g-canvas'
const { t } = useI18n()
const DEFAULT_DATA = []
@@ -105,7 +106,7 @@ export class HorizontalBar extends G2PlotChartView {
]
}
- drawChart(drawOptions: G2PlotDrawOptions): Bar {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -122,6 +123,7 @@ export class HorizontalBar extends G2PlotChartView {
const options = this.setupOptions(chart, initOptions)
+ const { Bar } = await import('@antv/g2plot/esm/plots/bar')
// 开始渲染
const newChart = new Bar(container, options)
@@ -238,7 +240,7 @@ export class HorizontalBar extends G2PlotChartView {
return
}
const value = valueFormatter(data.value, labelCfg.formatterCfg)
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
group.addShape({
type: 'text',
attrs: {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/progress-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/progress-bar.ts
index 142acad842..6fef38049f 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/progress-bar.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/progress-bar.ts
@@ -2,7 +2,7 @@ import { G2PlotChartView, G2PlotDrawOptions } from '../../types/impl/g2plot'
import { flow, hexColorToRGBA, parseJson } from '../../../util'
import { setGradientColor } from '../../common/common_antv'
import { useI18n } from '@/hooks/web/useI18n'
-import { Bar as G2Progress, BarOptions } from '@antv/g2plot/esm/plots/bar'
+import type { Bar as G2Progress, BarOptions } from '@antv/g2plot/esm/plots/bar'
import {
BAR_AXIS_TYPE,
BAR_EDITOR_PROPERTY_INNER
@@ -66,7 +66,7 @@ export class ProgressBar extends G2PlotChartView {
appendPadding: [0, 0, 10, 0]
}
- drawChart(drawOptions: G2PlotDrawOptions): G2Progress {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -128,6 +128,7 @@ export class ProgressBar extends G2PlotChartView {
}
const options = this.setupOptions(chart, initOptions)
+ const { Bar: G2Progress } = await import('@antv/g2plot/esm/plots/bar')
// 开始渲染
const newChart = new G2Progress(container, options)
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/range-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/range-bar.ts
index a887e7d5eb..c84a2e737a 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/range-bar.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/range-bar.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Bar, BarOptions } from '@antv/g2plot/esm/plots/bar'
+import type { Bar, BarOptions } from '@antv/g2plot/esm/plots/bar'
import { getPadding, setGradientColor } from '@/views/chart/components/js/panel/common/common_antv'
import { cloneDeep, find } from 'lodash-es'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
@@ -107,7 +107,7 @@ export class RangeBar extends G2PlotChartView {
]
}
- drawChart(drawOptions: G2PlotDrawOptions): Bar {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -163,8 +163,9 @@ export class RangeBar extends G2PlotChartView {
const options = this.setupOptions(chart, initOptions)
+ const { Bar: BarClass } = await import('@antv/g2plot/esm/plots/bar')
// 开始渲染
- const newChart = new Bar(container, options)
+ const newChart = new BarClass(container, options)
newChart.on('interval:click', action)
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts
index f327d38041..5357fe6663 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts
@@ -1,4 +1,4 @@
-import { WaterfallOptions, Waterfall as G2Waterfall } from '@antv/g2plot/esm/plots/waterfall'
+import type { WaterfallOptions, Waterfall as G2Waterfall } from '@antv/g2plot/esm/plots/waterfall'
import { G2PlotChartView, G2PlotDrawOptions } from '../../types/impl/g2plot'
import { flow, hexColorToRGBA, parseJson } from '../../../util'
import { valueFormatter } from '../../../formatter'
@@ -60,7 +60,7 @@ export class Waterfall extends G2PlotChartView {
]
}
axis: AxisType[] = ['xAxis', 'yAxis', 'filter', 'drill', 'extLabel', 'extTooltip']
- public drawChart(drawOptions: G2PlotDrawOptions): G2Waterfall {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data) {
return
@@ -83,6 +83,7 @@ export class Waterfall extends G2PlotChartView {
]
}
const options = this.setupOptions(chart, baseOptions)
+ const { Waterfall: G2Waterfall } = await import('@antv/g2plot/esm/plots/waterfall')
const newChart = new G2Waterfall(container, options)
newChart.on('interval:click', action)
return newChart
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts
index c7f08f48f3..15a7b793bd 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Area as G2Area, AreaOptions } from '@antv/g2plot/esm/plots/area'
+import type { Area as G2Area, AreaOptions } from '@antv/g2plot/esm/plots/area'
import { getPadding, setGradientColor } from '@/views/chart/components/js/panel/common/common_antv'
import { cloneDeep } from 'lodash-es'
import {
@@ -22,6 +22,7 @@ import { Datum } from '@antv/g2plot/esm/types/common'
import { useI18n } from '@/hooks/web/useI18n'
import { DEFAULT_LABEL } from '@/views/chart/components/editor/util/chart'
import { clearExtremum, extremumEvt } from '@/views/chart/components/js/extremumUitl'
+import { Group } from '@antv/g-canvas'
const { t } = useI18n()
const DEFAULT_DATA = []
@@ -94,7 +95,7 @@ export class Area extends G2PlotChartView {
]
}
- drawChart(drawOptions: G2PlotDrawOptions): G2Area {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data.data?.length) {
clearExtremum(chart)
@@ -110,6 +111,7 @@ export class Area extends G2PlotChartView {
}
// options
const options = this.setupOptions(chart, initOptions)
+ const { Area: G2Area } = await import('@antv/g2plot/esm/plots/area')
// 开始渲染
const newChart = new G2Area(container, options)
@@ -150,7 +152,7 @@ export class Area extends G2PlotChartView {
return
}
const value = valueFormatter(data.value, labelCfg.formatterCfg)
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
group.addShape({
type: 'text',
attrs: {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts
index 5d4e4cf216..54ebb74e65 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Line as G2Line, LineOptions } from '@antv/g2plot/esm/plots/line'
+import type { Line as G2Line, LineOptions } from '@antv/g2plot/esm/plots/line'
import { getPadding } from '../../common/common_antv'
import {
flow,
@@ -17,10 +17,11 @@ import {
LINE_EDITOR_PROPERTY,
LINE_EDITOR_PROPERTY_INNER
} from '@/views/chart/components/js/panel/charts/line/common'
-import { Datum } from '@antv/g2plot/esm/types/common'
+import type { Datum } from '@antv/g2plot/esm/types/common'
import { useI18n } from '@/hooks/web/useI18n'
import { DEFAULT_LABEL } from '@/views/chart/components/editor/util/chart'
import { clearExtremum, extremumEvt } from '@/views/chart/components/js/extremumUitl'
+import { Group } from '@antv/g-canvas'
const { t } = useI18n()
const DEFAULT_DATA = []
@@ -46,7 +47,7 @@ export class Line extends G2PlotChartView {
type: 'q'
}
}
- drawChart(drawOptions: G2PlotDrawOptions): G2Line {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, action, container } = drawOptions
if (!chart.data.data?.length) {
clearExtremum(chart)
@@ -105,6 +106,7 @@ export class Line extends G2PlotChartView {
]
}
const options = this.setupOptions(chart, initOptions)
+ const { Line: G2Line } = await import('@antv/g2plot/esm/plots/line')
// 开始渲染
const newChart = new G2Line(container, options)
@@ -147,7 +149,7 @@ export class Line extends G2PlotChartView {
return
}
const value = valueFormatter(data.value, labelCfg.formatterCfg)
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
group.addShape({
type: 'text',
attrs: {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts
index ec8576544c..010545e475 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/stock-line.ts
@@ -2,12 +2,12 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Mix, MixOptions } from '@antv/g2plot/esm/plots/mix'
+import type { Mix, MixOptions } from '@antv/g2plot/esm/plots/mix'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { LINE_EDITOR_PROPERTY_INNER } from '@/views/chart/components/js/panel/charts/line/common'
import { useI18n } from '@/hooks/web/useI18n'
import { valueFormatter } from '@/views/chart/components/js/formatter'
-import { Options } from '@antv/g2plot/esm'
+import type { Options } from '@antv/g2plot/esm'
const { t } = useI18n()
const DEFAULT_DATA = []
@@ -206,7 +206,7 @@ export class StockLine extends G2PlotChartView {
})
}
- drawChart(drawOptions: G2PlotDrawOptions): Mix {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, action, container } = drawOptions
if (!chart.data.data?.length) {
return
@@ -341,7 +341,8 @@ export class StockLine extends G2PlotChartView {
...averageLines
]
})
- const plot = new Mix(container, option)
+ const { Mix: MixClass } = await import('@antv/g2plot/esm/plots/mix')
+ const plot = new MixClass(container, option)
this.registerEvent(data, plot, averagesLineData)
plot.on('schema:click', evt => {
const selectSchema = evt.data.data[xAxisDataeaseName]
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts
index bdbd824b2d..8f71c29927 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Liquid as G2Liquid, LiquidOptions } from '@antv/g2plot/esm/plots/liquid'
+import type { Liquid as G2Liquid, LiquidOptions } from '@antv/g2plot/esm/plots/liquid'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { DEFAULT_MISC } from '@/views/chart/components/editor/util/chart'
import { valueFormatter } from '@/views/chart/components/js/formatter'
@@ -50,7 +50,7 @@ export class Liquid extends G2PlotChartView {
}
}
- drawChart(drawOptions: G2PlotDrawOptions): G2Liquid {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container } = drawOptions
if (!chart.data?.series) {
return
@@ -59,6 +59,7 @@ export class Liquid extends G2PlotChartView {
percent: 0
}
const options = this.setupOptions(chart, initOptions)
+ const { Liquid: G2Liquid } = await import('@antv/g2plot/esm/plots/liquid')
// 开始渲染
return new G2Liquid(container, options)
}
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts
index 48b99a0bbb..bd13c74e37 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts
@@ -2,7 +2,7 @@ import {
L7PlotChartView,
L7PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/l7plot'
-import { Choropleth, ChoroplethOptions } from '@antv/l7plot/dist/esm/plots/choropleth'
+import type { Choropleth, ChoroplethOptions } from '@antv/l7plot/dist/esm/plots/choropleth'
import {
filterChartDataByRange,
flow,
@@ -17,7 +17,7 @@ import {
mapRendered,
mapRendering
} from '@/views/chart/components/js/panel/common/common_antv'
-import { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
+import type { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
import { cloneDeep, defaultsDeep } from 'lodash-es'
import { useI18n } from '@/hooks/web/useI18n'
import { valueFormatter } from '../../../formatter'
@@ -27,7 +27,7 @@ import {
MAP_EDITOR_PROPERTY_INNER,
MapMouseEvent
} from '@/views/chart/components/js/panel/charts/map/common'
-import { CategoryLegendListItem } from '@antv/l7plot-component/dist/lib/types/legend'
+import type { CategoryLegendListItem } from '@antv/l7plot-component/dist/lib/types/legend'
import createDom from '@antv/dom-util/esm/create-dom'
import {
CONTAINER_TPL,
@@ -143,6 +143,7 @@ export class Map extends L7PlotChartView {
}
const context = { drawOption, geoJson }
options = this.setupOptions(chart, options, context)
+ const { Choropleth } = await import('@antv/l7plot/dist/esm/plots/choropleth')
const view = new Choropleth(container, options)
this.configZoomButton(chart, view)
mapRendering(container)
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts
index 764cb46edc..cbffc6fee8 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { DualAxes, DualAxesOptions } from '@antv/g2plot/esm/plots/dual-axes'
+import type { DualAxes, DualAxesOptions } from '@antv/g2plot/esm/plots/dual-axes'
import {
getAnalyse,
getLabel,
@@ -21,10 +21,11 @@ import {
CHART_MIX_EDITOR_PROPERTY_INNER,
MixChartBasicStyle
} from './chart-mix-common'
-import { Datum } from '@antv/g2plot/esm/types/common'
+import type { Datum } from '@antv/g2plot/esm/types/common'
import { useI18n } from '@/hooks/web/useI18n'
import { DEFAULT_LABEL } from '@/views/chart/components/editor/util/chart'
-import { Options } from '@antv/g2plot/esm'
+import type { Options } from '@antv/g2plot/esm'
+import { Group } from '@antv/g-canvas'
const { t } = useI18n()
const DEFAULT_DATA = []
@@ -62,7 +63,7 @@ export class ColumnLineMix extends G2PlotChartView {
type: 'q'
}
}
- drawChart(drawOptions: G2PlotDrawOptions): DualAxes {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, action, container } = drawOptions
if (!chart.data?.left?.data?.length && !chart.data?.right?.data?.length) {
return
@@ -138,7 +139,7 @@ export class ColumnLineMix extends G2PlotChartView {
]
}
const options = this.setupOptions(chart, initOptions)
-
+ const { DualAxes } = await import('@antv/g2plot/esm/plots/dual-axes')
// 开始渲染
const newChart = new DualAxes(container, options)
@@ -190,7 +191,7 @@ export class ColumnLineMix extends G2PlotChartView {
return
}
const value = valueFormatter(data.value, labelCfg.formatterCfg)
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
group.addShape({
type: 'text',
attrs: {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts
index 1a80a98cfe..0f9aa41d82 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/funnel.ts
@@ -1,4 +1,4 @@
-import { FunnelOptions, Funnel as G2Funnel } from '@antv/g2plot/esm/plots/funnel'
+import type { FunnelOptions, Funnel as G2Funnel } from '@antv/g2plot/esm/plots/funnel'
import { G2PlotChartView, G2PlotDrawOptions } from '../../types/impl/g2plot'
import { flow, setUpSingleDimensionSeriesColor } from '@/views/chart/components/js/util'
import { getPadding } from '../../common/common_antv'
@@ -53,7 +53,7 @@ export class Funnel extends G2PlotChartView {
}
}
- public drawChart(drawOptions: G2PlotDrawOptions): G2Funnel {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data) {
return
@@ -104,6 +104,7 @@ export class Funnel extends G2PlotChartView {
}
}
const options = this.setupOptions(chart, baseOptions)
+ const { Funnel: G2Funnel } = await import('@antv/g2plot/esm/plots/funnel')
const newChart = new G2Funnel(container, options)
newChart.on('interval:click', action)
return newChart
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts
index 35cd34b235..60e937847a 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Gauge as G2Gauge, GaugeOptions } from '@antv/g2plot/esm/plots/gauge'
+import type { Gauge as G2Gauge, GaugeOptions } from '@antv/g2plot/esm/plots/gauge'
import { flow, parseJson } from '@/views/chart/components/js/util'
import {
DEFAULT_LABEL,
@@ -64,7 +64,7 @@ export class Gauge extends G2PlotChartView {
}
}
- drawChart(drawOptions: G2PlotDrawOptions): G2Gauge {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, scale } = drawOptions
if (!chart.data?.series) {
return
@@ -96,6 +96,7 @@ export class Gauge extends G2PlotChartView {
}
}
const options = this.setupOptions(chart, initOptions, { scale })
+ const { Gauge: G2Gauge } = await import('@antv/g2plot/esm/plots/gauge')
return new G2Gauge(container, options)
}
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts
index f727840883..4ddcc8456d 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/quadrant.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { ScatterOptions, Scatter as G2Scatter } from '@antv/g2plot/esm/plots/scatter'
+import type { ScatterOptions, Scatter as G2Scatter } from '@antv/g2plot/esm/plots/scatter'
import { flow, parseJson, setUpSingleDimensionSeriesColor } from '../../../util'
import { valueFormatter } from '@/views/chart/components/js/formatter'
import { useI18n } from '@/hooks/web/useI18n'
@@ -121,7 +121,7 @@ export class Quadrant extends G2PlotChartView {
return [...new Set(arr.map(JSON.stringify))].map(JSON.parse) as T[]
}
- public drawChart(drawOptions: G2PlotDrawOptions) {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action, quadrantDefaultBaseline } = drawOptions
if (!chart.data?.data) {
return
@@ -203,6 +203,7 @@ export class Quadrant extends G2PlotChartView {
}
const options = this.setupOptions(chart, baseOptions)
+ const { Scatter: G2Scatter } = await import('@antv/g2plot/esm/plots/scatter')
const newChart = new G2Scatter(container, options)
newChart.on('point:click', action)
newChart.on('click', () => quadrantDefaultBaseline(defaultBaselineQuadrant))
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts
index 2e61a13be9..db57672dff 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts
@@ -1,11 +1,12 @@
-import { RadarOptions, Radar as G2Radar } from '@antv/g2plot/esm/plots/radar'
+import type { RadarOptions, Radar as G2Radar } from '@antv/g2plot/esm/plots/radar'
import { G2PlotChartView, G2PlotDrawOptions } from '../../types/impl/g2plot'
import { flow, parseJson } from '../../../util'
import { getPadding } from '../../common/common_antv'
import { valueFormatter } from '../../../formatter'
-import { Datum } from '@antv/g2plot/esm/types/common'
+import type { Datum } from '@antv/g2plot/esm/types/common'
import { useI18n } from '@/hooks/web/useI18n'
import { DEFAULT_LABEL } from '@/views/chart/components/editor/util/chart'
+import { Group } from '@antv/g-canvas'
const { t } = useI18n()
@@ -59,7 +60,7 @@ export class Radar extends G2PlotChartView {
}
}
- public drawChart(drawOptions: G2PlotDrawOptions): G2Radar {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data) {
return
@@ -112,6 +113,7 @@ export class Radar extends G2PlotChartView {
]
}
const options = this.setupOptions(chart, baseOptions)
+ const { Radar: G2Radar } = await import('@antv/g2plot/esm/plots/radar')
const newChart = new G2Radar(container, options)
newChart.on('point:click', action)
return newChart
@@ -149,7 +151,7 @@ export class Radar extends G2PlotChartView {
return
}
const value = valueFormatter(data.value, labelCfg.formatterCfg)
- const group = new G2PlotChartView.engine.Group({})
+ const group = new Group({})
group.addShape({
type: 'text',
attrs: {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/sankey.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/sankey.ts
index e7c0ce11a1..d8facd28c2 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/sankey.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/sankey.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Sankey, SankeyOptions } from '@antv/g2plot/esm/plots/sankey'
+import type { Sankey, SankeyOptions } from '@antv/g2plot/esm/plots/sankey'
import { getPadding, setGradientColor } from '@/views/chart/components/js/panel/common/common_antv'
import { cloneDeep, get } from 'lodash-es'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
@@ -95,7 +95,7 @@ export class RangeBar extends G2PlotChartView {
]
}
- drawChart(drawOptions: G2PlotDrawOptions): Sankey {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -158,7 +158,7 @@ export class RangeBar extends G2PlotChartView {
}
const options = this.setupOptions(chart, initOptions)
-
+ const { Sankey } = await import('@antv/g2plot/esm/plots/sankey')
// 开始渲染
const newChart = new Sankey(container, options)
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/scatter.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/scatter.ts
index 4c13ced8f3..bef607ecd4 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/scatter.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/scatter.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { ScatterOptions, Scatter as G2Scatter } from '@antv/g2plot/esm/plots/scatter'
+import type { ScatterOptions, Scatter as G2Scatter } from '@antv/g2plot/esm/plots/scatter'
import { flow, parseJson } from '../../../util'
import { valueFormatter } from '../../../formatter'
import { getPadding } from '../../common/common_antv'
@@ -85,7 +85,7 @@ export class Scatter extends G2PlotChartView {
limit: 1
}
}
- public drawChart(drawOptions: G2PlotDrawOptions) {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data) {
return
@@ -131,6 +131,7 @@ export class Scatter extends G2PlotChartView {
]
}
const options = this.setupOptions(chart, baseOptions)
+ const { Scatter: G2Scatter } = await import('@antv/g2plot/esm/plots/scatter')
const newChart = new G2Scatter(container, options)
newChart.on('point:click', action)
return newChart
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts
index 3c1f8fa864..8a12792044 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/treemap.ts
@@ -55,7 +55,7 @@ export class Treemap extends G2PlotChartView {
}
}
- public drawChart(drawOptions: G2PlotDrawOptions): G2Treemap {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -102,6 +102,7 @@ export class Treemap extends G2PlotChartView {
]
}
const options = this.setupOptions(chart, baseOptions)
+ const { Treemap: G2Treemap } = await import('@antv/g2plot/esm/plots/treemap')
const newChart = new G2Treemap(container, options)
newChart.on('polygon:click', action)
return newChart
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/word-cloud.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/word-cloud.ts
index 44b1563586..13afe0fa93 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/word-cloud.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/word-cloud.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { WordCloud as G2WordCloud, WordCloudOptions } from '@antv/g2plot/esm/plots/word-cloud'
+import type { WordCloud as G2WordCloud, WordCloudOptions } from '@antv/g2plot/esm/plots/word-cloud'
import { flow, parseJson } from '@/views/chart/components/js/util'
import { getPadding } from '@/views/chart/components/js/panel/common/common_antv'
import { valueFormatter } from '@/views/chart/components/js/formatter'
@@ -56,7 +56,7 @@ export class WordCloud extends G2PlotChartView {
limit: 1
}
}
- drawChart(drawOptions: G2PlotDrawOptions): G2WordCloud {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (chart?.data) {
// data
@@ -80,6 +80,7 @@ export class WordCloud extends G2PlotChartView {
interactions: []
}
const options = this.setupOptions(chart, initOptions)
+ const { WordCloud: G2WordCloud } = await import('@antv/g2plot/esm/plots/word-cloud')
const newChart = new G2WordCloud(container, options)
newChart.on('point:click', param => {
action({ x: param.x, y: param.y, data: { data: param.data.data.datum } })
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts
index be12faae9d..9dafb6c8fc 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts
@@ -2,7 +2,7 @@ import {
G2PlotChartView,
G2PlotDrawOptions
} from '@/views/chart/components/js/panel/types/impl/g2plot'
-import { Pie as G2Pie, PieOptions } from '@antv/g2plot/esm/plots/pie'
+import type { Pie as G2Pie, PieOptions } from '@antv/g2plot/esm/plots/pie'
import {
flow,
hexColorToRGBA,
@@ -20,7 +20,7 @@ import {
PIE_EDITOR_PROPERTY,
PIE_EDITOR_PROPERTY_INNER
} from '@/views/chart/components/js/panel/charts/pie/common'
-import { Datum } from '@antv/g2plot/esm/types/common'
+import type { Datum } from '@antv/g2plot/esm/types/common'
import { add } from 'mathjs'
import isEmpty from 'lodash-es/isEmpty'
import { cloneDeep } from 'lodash-es'
@@ -35,7 +35,7 @@ export class Pie extends G2PlotChartView {
}
axisConfig = PIE_AXIS_CONFIG
- drawChart(drawOptions: G2PlotDrawOptions): G2Pie {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart.data?.data?.length) {
return
@@ -114,7 +114,7 @@ export class Pie extends G2PlotChartView {
}
}
const options = this.setupOptions(chart, initOptions)
-
+ const { Pie: G2Pie } = await import('@antv/g2plot/esm/plots/pie')
const newChart = new G2Pie(container, options)
newChart.on('interval:click', action)
return newChart
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts
index 6388184ca1..288b22626b 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/rose.ts
@@ -26,7 +26,7 @@ export class Rose extends G2PlotChartView {
propertyInner: EditorPropertyInner = PIE_EDITOR_PROPERTY_INNER
axisConfig = PIE_AXIS_CONFIG
- drawChart(drawOptions: G2PlotDrawOptions): G2Rose {
+ async drawChart(drawOptions: G2PlotDrawOptions): Promise {
const { chart, container, action } = drawOptions
if (!chart?.data?.data?.length) {
return
@@ -79,9 +79,8 @@ export class Rose extends G2PlotChartView {
}
}
const options = this.setupOptions(chart, baseOptions)
- // custom color
- // options.color = antVCustomColor(chart)
+ const { Rose: G2Rose } = await import('@antv/g2plot/esm/plots/rose')
// 开始渲染
const plot = new G2Rose(container, options)
diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts
index 5bc5b91243..93d2ef5934 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts
@@ -1,5 +1,5 @@
-import { PickOptions } from '@antv/g2plot/esm/core/plot'
-import { Plot } from '@antv/g2plot/esm/core/plot'
+import type { PickOptions } from '@antv/g2plot/esm/core/plot'
+import type { Plot } from '@antv/g2plot/esm/core/plot'
import {
getAnalyse,
getAnalyseHorizontal,
@@ -18,7 +18,7 @@ import {
ChartLibraryType,
ChartWrapper
} from '@/views/chart/components/js/panel/types'
-import { getEngine } from '@antv/g2/esm/core'
+
import {
getColor,
getGroupColor,
@@ -79,14 +79,12 @@ export abstract class G2PlotChartView<
O extends PickOptions = PickOptions,
P extends Plot = Plot
> extends AntVAbstractChartView {
- protected static engine = getEngine('canvas')
-
/**
* 根据参数构建图表对象然后返回
* @param drawOptions 图表配置参数
* @return 生成的图表对象,类型为 Plot 的子类
*/
- public abstract drawChart(drawOptions: G2PlotDrawOptions): G2PlotWrapper | P
+ public abstract drawChart(drawOptions: G2PlotDrawOptions): G2PlotWrapper | P | Promise
protected configTheme(chart: Chart, options: O): O {
const theme = getTheme(chart)
diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts
index 894fd5bc76..02edfc6728 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts
@@ -1,4 +1,4 @@
-import { Scene } from '@antv/l7-scene'
+import type { Scene } from '@antv/l7-scene'
import {
AntVAbstractChartView,
AntVDrawOptions,
@@ -7,7 +7,7 @@ import {
} from '@/views/chart/components/js/panel/types'
import { cloneDeep, defaultsDeep } from 'lodash-es'
import { parseJson } from '@/views/chart/components/js/util'
-import { ILayer } from '@antv/l7plot'
+import type { ILayer } from '@antv/l7plot'
import {
configL7Label,
configL7Tooltip,
diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts
index aeef5f90e9..8639d8a516 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts
@@ -1,7 +1,7 @@
-import { ViewLevel } from '@antv/l7plot/dist/esm/plots/choropleth/types'
-import { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
-import { PlotOptions } from '@antv/l7plot/dist/esm/types/plot'
-import { Plot as L7Plot } from '@antv/l7plot/dist/esm/core/plot'
+import type { ViewLevel } from '@antv/l7plot/dist/esm/plots/choropleth/types'
+import type { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
+import type { PlotOptions } from '@antv/l7plot/dist/esm/types/plot'
+import type { Plot as L7Plot } from '@antv/l7plot/dist/esm/core/plot'
import {
configL7Label,
configL7Legend,
diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts
index 00fc52bc77..5cdcd1a2ef 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts
@@ -3,7 +3,7 @@ import {
AntVDrawOptions,
ChartLibraryType
} from '@/views/chart/components/js/panel/types'
-import {
+import type {
S2Theme,
SpreadSheet,
Style,
diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
index aba5f1f1b0..d0c81edb3e 100644
--- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
+++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
@@ -225,7 +225,7 @@ const renderChart = async (view, callback?) => {
await renderL7(chart, chartView as L7ChartView, callback)
break
case ChartLibraryType.G2_PLOT:
- renderG2Plot(chart, chartView as G2PlotChartView)
+ await renderG2Plot(chart, chartView as G2PlotChartView)
callback?.()
break
default:
@@ -233,9 +233,9 @@ const renderChart = async (view, callback?) => {
}
}
let myChart = null
-const renderG2Plot = (chart, chartView: G2PlotChartView) => {
+const renderG2Plot = async (chart, chartView: G2PlotChartView) => {
myChart?.destroy()
- myChart = chartView.drawChart({
+ myChart = await chartView.drawChart({
chartObj: myChart,
container: containerId,
chart: chart,
diff --git a/core/core-frontend/src/views/visualized/data/dataset/form/DatasetUnion.vue b/core/core-frontend/src/views/visualized/data/dataset/form/DatasetUnion.vue
index 2d3858709f..83bf8d4c43 100644
--- a/core/core-frontend/src/views/visualized/data/dataset/form/DatasetUnion.vue
+++ b/core/core-frontend/src/views/visualized/data/dataset/form/DatasetUnion.vue
@@ -363,34 +363,32 @@ const confirmEditUnion = () => {
}, [])
if (!!idArr.length) {
- ElMessageBox.confirm(
- `${t('data_set.field')}${allfields.value
+ ElMessageBox.confirm('字段选择', {
+ confirmButtonText: t('dataset.confirm'),
+ cancelButtonText: t('common.cancel'),
+ showCancelButton: true,
+ tip: `${t('data_set.field')}: ${allfields.value
.filter(ele => [...new Set(idArr)].includes(ele.id) && ele.extField !== 2)
.map(ele => ele.name)
- .join(',')}${t('data_set.want_to_continue')}`,
- {
- confirmButtonText: t('dataset.confirm'),
- cancelButtonText: t('common.cancel'),
- showCancelButton: true,
- confirmButtonType: 'danger',
- type: 'warning',
- autofocus: false,
- showClose: false,
- callback: (action: Action) => {
- if (action === 'confirm') {
- delUpdateDsFields(currentNode.value.id, state.nodeList)
- const [fir] = state.nodeList
- if (fir.isShadow) {
- delete fir.isShadow
- }
- closeEditUnion()
- nextTick(() => {
- emits('updateAllfields')
- })
+ .join(',')}, 未被勾选, 与其相关的计算字段将被删除,确认删除?`,
+ confirmButtonType: 'danger',
+ type: 'warning',
+ autofocus: false,
+ showClose: false,
+ callback: (action: Action) => {
+ if (action === 'confirm') {
+ delUpdateDsFields(currentNode.value.id, state.nodeList)
+ const [fir] = state.nodeList
+ if (fir.isShadow) {
+ delete fir.isShadow
}
+ closeEditUnion()
+ nextTick(() => {
+ emits('updateAllfields')
+ })
}
}
- )
+ })
return
}
}
@@ -449,32 +447,26 @@ const handleCommand = (ele, command) => {
return pre
}, [])
fakeDelId = []
-
if (!!idArr.length) {
- ElMessageBox.confirm(
- `${t('field.want_to_continue')}${allfields.value
- .filter(ele => [...new Set(idArr)].includes(ele.id) && ele.extField !== 2)
- .map(ele => ele.name)
- .join(',')}${t('data_set.want_to_continue')}`,
- {
- confirmButtonText: t('dataset.confirm'),
- cancelButtonText: t('common.cancel'),
- showCancelButton: true,
- confirmButtonType: 'danger',
- type: 'warning',
- autofocus: false,
- showClose: false,
- callback: (action: Action) => {
- if (action === 'confirm') {
- delNode(ele.id, state.nodeList)
- nextTick(() => {
- emits('addComplete')
- emits('updateAllfields')
- })
- }
+ ElMessageBox.confirm(`确定要删除 ${ele.tableName} 吗`, {
+ confirmButtonText: t('dataset.confirm'),
+ cancelButtonText: t('common.cancel'),
+ showCancelButton: true,
+ tip: '删除后,被关联的表或sql片段将被删除,与其相关的计算字段也将被删除。',
+ confirmButtonType: 'danger',
+ type: 'warning',
+ autofocus: false,
+ showClose: false,
+ callback: (action: Action) => {
+ if (action === 'confirm') {
+ delNode(ele.id, state.nodeList)
+ nextTick(() => {
+ emits('addComplete')
+ emits('updateAllfields')
+ })
}
}
- )
+ })
return
}
}
@@ -531,6 +523,10 @@ const dfsNodeFieldBack = (list, { originName, datasetTableId }) => {
})
}
+const dfsNodeFieldBackReal = ele => {
+ dfsNodeFieldBack(state.nodeList, ele)
+}
+
const menuList = [
{
svgName: 'icon_text-box_outlined',
@@ -1014,7 +1010,7 @@ defineExpose({
getNodeList,
setStateBack,
notConfirm,
- dfsNodeFieldBack,
+ dfsNodeFieldBackReal,
initState,
setChangeStatus,
crossDatasources
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 b8fea14478..075edd5641 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
@@ -467,8 +467,20 @@ const delFieldByIdFake = (arr, fakeAllfields) => {
}
const deleteField = item => {
- ElMessageBox.confirm(t('dataset.confirm_delete'), {
+ let tip = ''
+ const idArr = allfields.value.reduce((pre, next) => {
+ if (next.extField !== 2) return pre
+ const idMap = next.originName.match(/\[(.+?)\]/g) || []
+ const result = idMap.map(itm => {
+ return itm.slice(1, -1)
+ })
+ pre = [...result, ...pre]
+ return pre
+ }, [])
+ tip = idArr.includes(item.id) ? `如果该字段被删除,与其相关的计算字段将被删除,确认删除?` : ''
+ ElMessageBox.confirm(`确认删除字段 ${item.name} 吗`, {
confirmButtonText: t('dataset.confirm'),
+ tip,
cancelButtonText: t('common.cancel'),
showCancelButton: true,
confirmButtonType: 'danger',
@@ -478,7 +490,7 @@ const deleteField = item => {
callback: (action: Action) => {
if (action === 'confirm') {
delFieldById([item.id])
- datasetDrag.value.dfsNodeFieldBack(datasetDrag.value.getNodeList(), item)
+ datasetDrag.value.dfsNodeFieldBackReal(item)
ElMessage({
message: t('chart.delete_success'),
type: 'success'
@@ -855,30 +867,28 @@ const confirmEditUnion = () => {
return pre
}, [])
- ElMessageBox.confirm(
- `${t('data_set.field')}${allfields.value
+ ElMessageBox.confirm('字段选择', {
+ confirmButtonText: t('dataset.confirm'),
+ cancelButtonText: t('common.cancel'),
+ showCancelButton: true,
+ tip: `${t('data_set.field')}: ${allfields.value
.filter(ele => [...new Set(idArr)].includes(ele.id) && ele.extField !== 2)
.map(ele => ele.name)
- .join(',')}${t('data_set.want_to_continue')}`,
- {
- confirmButtonText: t('dataset.confirm'),
- cancelButtonText: t('common.cancel'),
- showCancelButton: true,
- confirmButtonType: 'danger',
- type: 'warning',
- autofocus: false,
- showClose: false,
- callback: (action: Action) => {
- if (action === 'confirm') {
- datasetDrag.value.setStateBack(top, bottom)
- setFieldAll()
- editUnion.value = false
- addComplete()
- datasetDrag.value.setChangeStatus(to, from)
- }
+ .join(',')}, 未被勾选, 与其相关的计算字段将被删除,确认删除?`,
+ confirmButtonType: 'danger',
+ type: 'warning',
+ autofocus: false,
+ showClose: false,
+ callback: (action: Action) => {
+ if (action === 'confirm') {
+ datasetDrag.value.setStateBack(top, bottom)
+ setFieldAll()
+ editUnion.value = false
+ addComplete()
+ datasetDrag.value.setChangeStatus(to, from)
}
}
- )
+ })
return
}
diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue
index 655a31d5ce..40b39e85ec 100644
--- a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue
+++ b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue
@@ -14,6 +14,7 @@ import { CustomPassword } from '@/components/custom-password'
import { ElForm, ElMessage, ElMessageBox } from 'element-plus-secondary'
import Cron from '@/components/cron/src/Cron.vue'
import { ComponentPublicInstance } from 'vue'
+import { XpackComponent } from '@/components/plugin'
const { t } = useI18n()
const prop = defineProps({
form: {
@@ -28,6 +29,7 @@ const prop = defineProps({
configuration?: Configuration
apiConfiguration?: ApiConfiguration[]
paramsConfiguration?: ApiConfiguration[]
+ enableDataFill?: boolean
}>({
id: 0,
name: '',
@@ -340,16 +342,16 @@ const setItemRef = (ele: ComponentPublicInstance | null | Element) => {
}
const copyItem = (item?: ApiConfiguration) => {
- var newItem = JSON.parse(JSON.stringify(item))
+ const newItem = JSON.parse(JSON.stringify(item))
newItem.deTableName = ''
newItem.serialNumber =
form.value.apiConfiguration[form.value.apiConfiguration.length - 1].serialNumber + 1
- var reg = new RegExp(item.name + '_copy_' + '([0-9]*)', 'gim')
- var number = 0
- for (var i = 1; i < form.value.apiConfiguration.length; i++) {
- var match = form.value.apiConfiguration[i].name.match(reg)
+ const reg = new RegExp(item.name + '_copy_' + '([0-9]*)', 'gim')
+ let number = 0
+ for (let i = 1; i < form.value.apiConfiguration.length; i++) {
+ const match = form.value.apiConfiguration[i].name.match(reg)
if (match !== null) {
- var num = match[0].substring(
+ const num = match[0].substring(
form.value.apiConfiguration[i].name.length + 5,
match[0].length - 1
)
@@ -413,7 +415,7 @@ const resetForm = () => {
}
const returnItem = apiItem => {
- var find = false
+ let find = false
if (apiItem.type !== 'params') {
apiItem.status = 'Success'
for (let i = 0; i < form.value.apiConfiguration.length; i++) {
@@ -1227,6 +1229,12 @@ defineExpose({
+
+
+
{
return
} else if (currentDsType.value === 'API') {
- for (var i = 0; i < request.apiConfiguration.length; i++) {
+ for (let i = 0; i < request.apiConfiguration.length; i++) {
if (
request.apiConfiguration[i].deTableName === '' ||
request.apiConfiguration[i].deTableName === undefined ||
@@ -445,7 +445,7 @@ const saveDS = () => {
uuid.v1().replaceAll('-', '').substring(0, 10)
}
request.apiConfiguration[i].jsonFields = []
- for (var j = 0; j < request.apiConfiguration[i].fields.length; j++) {
+ for (let j = 0; j < request.apiConfiguration[i].fields.length; j++) {
request.apiConfiguration[i].fields[j].value = []
}
}
diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue
index 111f822778..97082ce1a2 100644
--- a/core/core-frontend/src/views/visualized/data/datasource/index.vue
+++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue
@@ -366,7 +366,8 @@ const defaultInfo = {
configuration: null,
syncSetting: null,
apiConfiguration: [],
- weight: 0
+ weight: 0,
+ enableDataFill: false
}
const nodeInfo = reactive(cloneDeep(defaultInfo))
const infoList = computed(() => {
@@ -504,7 +505,8 @@ const handleNodeClick = data => {
fileName,
size,
description,
- lastSyncTime
+ lastSyncTime,
+ enableDataFill
} = res.data
if (configuration) {
configuration = JSON.parse(Base64.decode(configuration))
@@ -531,7 +533,8 @@ const handleNodeClick = data => {
apiConfiguration: apiConfigurationStr,
paramsConfiguration: paramsStr,
weight: data.weight,
- lastSyncTime
+ lastSyncTime,
+ enableDataFill
})
activeTab.value = ''
activeName.value = 'config'
@@ -628,7 +631,8 @@ const editDatasource = (editType?: number) => {
fileName,
size,
description,
- lastSyncTime
+ lastSyncTime,
+ enableDataFill
} = res.data
if (configuration) {
configuration = JSON.parse(Base64.decode(configuration))
@@ -656,6 +660,7 @@ const editDatasource = (editType?: number) => {
apiConfiguration: apiConfigurationStr,
paramsConfiguration: paramsStr,
lastSyncTime,
+ enableDataFill,
isPlugin: arr && arr.length > 0,
staticMap: arr[0]?.staticMap
})
diff --git a/core/core-frontend/src/views/workbranch/ShortcutTable.vue b/core/core-frontend/src/views/workbranch/ShortcutTable.vue
index 8d5ec781a5..35ebfa5ed4 100644
--- a/core/core-frontend/src/views/workbranch/ShortcutTable.vue
+++ b/core/core-frontend/src/views/workbranch/ShortcutTable.vue
@@ -15,6 +15,7 @@ import ShareGrid from '@/views/share/share/ShareGrid.vue'
import ShareHandler from '@/views/share/share/ShareHandler.vue'
import { useAppStoreWithOut } from '@/store/modules/app'
import { useEmbedded } from '@/store/modules/embedded'
+import { XpackComponent } from '@/components/plugin'
const userStore = useUserStoreWithOut()
const { resolve } = useRouter()
const { t } = useI18n()
@@ -139,6 +140,10 @@ const tablePaneList = ref([
{ title: t('visualization.share_out'), name: 'share', disabled: false }
])
+const loadedDataFilling = data => {
+ tablePaneList.value.push(data)
+}
+
const busiAuthList = getBusiListWithPermission()
onMounted(() => {
!!busiAuthList.length &&
@@ -419,6 +424,14 @@ const getEmptyDesc = (): string => {
+