From f6761597216f9a0f550bad4e924cc513c2c16b23 Mon Sep 17 00:00:00 2001
From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com>
Date: Wed, 7 Dec 2022 17:27:12 +0800
Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E6=BA=90=E6=9F=A5?=
=?UTF-8?q?=E7=9C=8B=E9=9A=90=E8=97=8F=E8=BE=83=E6=B7=B1=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=87=AA=E9=80=82=E5=BA=94=20SQL=20=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=97=81=E8=BE=B9=E6=8F=90=E7=A4=BA=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E6=8F=8F=E8=BF=B0=20#3812?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/deCustomCm/DeTextarea.vue | 22 +-
frontend/src/lang/en.js | 2 +
frontend/src/lang/tw.js | 2 +
frontend/src/lang/zh.js | 2 +
frontend/src/views/dataset/add/AddSQL.vue | 4 +-
.../src/views/dataset/data/TabDataPreview.vue | 16 +-
.../src/views/system/datasource/DsForm.vue | 1204 +---------------
.../views/system/datasource/DsFormContent.vue | 1209 +++++++++++++++++
.../src/views/system/datasource/DsTable.vue | 288 ++--
.../views/system/datasource/DsTableTabs.vue | 237 ++++
10 files changed, 1610 insertions(+), 1376 deletions(-)
create mode 100644 frontend/src/views/system/datasource/DsFormContent.vue
create mode 100644 frontend/src/views/system/datasource/DsTableTabs.vue
diff --git a/frontend/src/components/deCustomCm/DeTextarea.vue b/frontend/src/components/deCustomCm/DeTextarea.vue
index 1d8045e351..b624d7eea6 100644
--- a/frontend/src/components/deCustomCm/DeTextarea.vue
+++ b/frontend/src/components/deCustomCm/DeTextarea.vue
@@ -1,6 +1,6 @@
{{ ele.name }}
{{ ele.fieldName }}
+
diff --git a/frontend/src/views/system/datasource/DsTable.vue b/frontend/src/views/system/datasource/DsTable.vue
index 5a9c086759..e9d19132e7 100644
--- a/frontend/src/views/system/datasource/DsTable.vue
+++ b/frontend/src/views/system/datasource/DsTable.vue
@@ -1,239 +1,129 @@
-
-
-
- {{ params.name }}
-
-
-
-
-
-
-
-
-
-
- {{ $t("dataset.detail") }}
-
-
-
-
-
-
+
-
-
-
- {{ $t("datasource.table_name") }}
-
-
- {{ dsTableDetail.name }}
-
-
-
-
- {{ $t("datasource.table_description") }}
-
-
- {{ dsTableDetail.remark || "-" }}
-
-
-
-
-
-
-
- {{
- $t("dataset.text")
- }}
- {{
- $t("dataset.value")
- }}
- {{
- $t("dataset.value") + '(' + $t("dataset.float") + ')'
- }}
-
- {{ scope.row.fieldType }}
+
+
+
+
+
+
+
+ {{ $t('commons.edit') }}
+
+
+
+ {{ $t('commons.edit') }}
+
-
-
-
-
-
+
+ {{ $t('commons.validate') }}
+
+ {{ $t('commons.save') }}
+
+
+
+
+
+
+
-
diff --git a/frontend/src/views/system/datasource/DsTableTabs.vue b/frontend/src/views/system/datasource/DsTableTabs.vue
new file mode 100644
index 0000000000..59728978ee
--- /dev/null
+++ b/frontend/src/views/system/datasource/DsTableTabs.vue
@@ -0,0 +1,237 @@
+
+
+
+
+ {{ params.name }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t("dataset.detail") }}
+
+
+
+
+
+
+
+
+
+ {{ $t("datasource.table_name") }}
+
+
+ {{ dsTableDetail.name }}
+
+
+
+
+ {{ $t("datasource.table_description") }}
+
+
+ {{ dsTableDetail.remark || "-" }}
+
+
+
+
+
+
+
+ {{
+ $t("dataset.text")
+ }}
+ {{
+ $t("dataset.value")
+ }}
+ {{
+ $t("dataset.value") + '(' + $t("dataset.float") + ')'
+ }}
+
+ {{ scope.row.fieldType }}
+
+
+
+
+
+
+
+
+
+
+
+
From e401bc26271d7e559e2d8f138b40bcaf78bf82f7 Mon Sep 17 00:00:00 2001
From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com>
Date: Thu, 8 Dec 2022 10:07:53 +0800
Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E5=86=B2=E7=AA=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/system/datasource/DsFormContent.vue | 85 +++++++++++++++++--
1 file changed, 79 insertions(+), 6 deletions(-)
diff --git a/frontend/src/views/system/datasource/DsFormContent.vue b/frontend/src/views/system/datasource/DsFormContent.vue
index 9ec9e5fa07..c13ad0a377 100644
--- a/frontend/src/views/system/datasource/DsFormContent.vue
+++ b/frontend/src/views/system/datasource/DsFormContent.vue
@@ -69,8 +69,62 @@
/>
+
+ {{
+ positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info')
+ }}
+
+
+
+
+
+ {{ $t('app_template.datasource_new') }}
+
+
+ {{ $t('app_template.datasource_history') }}
+
+
+
+
+
+
+
+
+
+
-
- {{
- positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info')
- }}
-
+
+
+
+
+ {{ $t('commons.cancel') }}
+
+ {{ $t('commons.save') }}
+
+
+
+
From f292c7bd576353ef01a68bb05deab5718a068613 Mon Sep 17 00:00:00 2001
From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com>
Date: Thu, 8 Dec 2022 10:30:56 +0800
Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E5=86=B2=E7=AA=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/components/canvas/store/layer.js | 1 -
frontend/src/permission.js | 2 +-
.../chart/components/ChartComponentS2.vue | 5 +-
.../panel/appTemplateMarket/log/index.vue | 12 ++--
.../src/views/panel/edit/ComponentWait.vue | 5 +-
.../views/system/datasource/DsFormContent.vue | 68 +++++++++++++++----
6 files changed, 64 insertions(+), 29 deletions(-)
diff --git a/frontend/src/components/canvas/store/layer.js b/frontend/src/components/canvas/store/layer.js
index d30413ff64..c9ee096d67 100644
--- a/frontend/src/components/canvas/store/layer.js
+++ b/frontend/src/components/canvas/store/layer.js
@@ -14,7 +14,6 @@ export default {
toast('已经到顶了')
}
}
-
},
downComponent({ componentData, curComponent }) {
diff --git a/frontend/src/permission.js b/frontend/src/permission.js
index e490e0a576..ba89f734a7 100644
--- a/frontend/src/permission.js
+++ b/frontend/src/permission.js
@@ -53,7 +53,7 @@ const routeBefore = (callBack) => {
callBack()
}
}
-router.beforeEach(async (to, from, next) => routeBefore(() => {
+router.beforeEach(async(to, from, next) => routeBefore(() => {
// start progress bar
NProgress.start()
const mobileIgnores = ['/delink']
diff --git a/frontend/src/views/chart/components/ChartComponentS2.vue b/frontend/src/views/chart/components/ChartComponentS2.vue
index b1cb8b6555..ce21906be8 100644
--- a/frontend/src/views/chart/components/ChartComponentS2.vue
+++ b/frontend/src/views/chart/components/ChartComponentS2.vue
@@ -67,8 +67,8 @@
>
{{ $t('chart.total') }}
{{
- (chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
- }}
+ (chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
+ }}
{{ $t('chart.items') }}
{{
- $t('user.filter')
- }}
+ $t('user.filter')
+ }}
({{ cacheCondition.length }})
@@ -50,7 +50,7 @@
>
{{ paginationConfig.total }}
{{ $t('user.result_one') }}
-
+
{{ ele }}
+ class="el-icon-close"
+ @click="clearOneFilter(index)"
+ />
-
+
@@ -142,7 +142,6 @@ export default {
height: 100%;
}
-
.wait-tab {
height: 40px !important;
background-color: #9ea6b2;
diff --git a/frontend/src/views/system/datasource/DsFormContent.vue b/frontend/src/views/system/datasource/DsFormContent.vue
index c13ad0a377..cd3634b941 100644
--- a/frontend/src/views/system/datasource/DsFormContent.vue
+++ b/frontend/src/views/system/datasource/DsFormContent.vue
@@ -70,9 +70,9 @@
- {{
- positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info')
- }}
+ {{
+ positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info')
+ }}
import {
addDs,
- editDs,
- getSchema,
- validateDs,
- validateDsById,
checkApiDatasource,
+ editDs,
+ getDatasourceDetail,
+ getSchema,
+ listDatasource,
+ listDatasourceType,
listDriverByType,
- getDatasourceDetail
+ validateDs,
+ validateDsById
} from '@/api/system/datasource'
import { $confirm } from '@/utils/message'
import i18n from '@/lang/index'
import DsConfiguration from '@/views/system/datasource/DsConfiguration'
import PluginCom from '@/views/system/plugin/PluginCom'
-import { listDatasourceType, listDatasource } from '@/api/system/datasource'
import deTextarea from '@/components/deCustomCm/DeTextarea.vue'
import msgCfm from '@/components/msgCfm'
import { dsGroupTree } from '@/api/dataset/dataset'
@@ -347,6 +348,7 @@ export default {
},
data() {
return {
+ appMarketDatasource: [],
appMarketEdit: true,
attachRule: {
panelName: [
@@ -378,9 +380,20 @@ export default {
panelName: '',
datasetGroupPid: null,
datasetGroupId: null,
- datasetGroupName: ''
+ datasetGroupName: '',
+ datasourceFrom: 'new',
+ datasourceHistoryId: null
},
disabled: false,
+ historyFormRule: {
+ datasourceFrom: [
+ {
+ required: true,
+ trigger: 'blur'
+ }
+ ],
+ datasourceHistoryId: [{ required: true, message: i18n.t('dataset.pls_slc_data_source'), trigger: 'blur' }]
+ },
form: {
configuration: {
initialPoolSize: 5,
@@ -601,7 +614,7 @@ export default {
async created() {
await this.datasourceTypes()
this.queryTreeData()
- const params = this.configFromTabs.id ? this.configFromTabs : this.$route.query
+ const params = this.configFromTabs?.id ? this.configFromTabs : this.$route.query
let { id, showModel, type, name } = params
this.params = params
const appMarketCheck = this.positionCheck('appMarket')
@@ -618,6 +631,8 @@ export default {
this.attachForm.datasetGroupPid = this.outerParams.datasetGroupPid ? this.outerParams.datasetGroupPid : '0'
this.attachForm.datasetGroupId = this.outerParams.datasetGroupId
this.attachForm.datasetGroupName = this.outerParams.datasetGroupName
+ this.attachForm.datasourceFrom = this.outerParams.datasourceFrom ? this.outerParams.datasourceFrom : 'new'
+ this.attachForm.datasourceHistoryId = this.outerParams.datasourceHistoryId
this.params = {
id: this.outerParams.datasourceId,
showModel: this.outerParams.showModel,
@@ -646,6 +661,9 @@ export default {
})
},
methods: {
+ editDatasource() {
+ this.disabled = false
+ },
baseInfoDisabledCheck(privileges) {
return !(this.formType === 'add' ? true : hasDataPermission('manage', privileges))
},
@@ -655,6 +673,11 @@ export default {
delete node.children
}
},
+ getDatasourceOptions() {
+ return listDatasource().then((response) => {
+ this.options = response.data.filter((item) => item.type !== 'api')
+ })
+ },
getDatasetGroupTree() {
dsGroupTree({ nodeType: 'group', excludedId: this.attachForm.datasetGroupId }).then(res => {
this.datasetGroupList = [{
@@ -696,6 +719,9 @@ export default {
queryTreeData() {
listDatasource().then((res) => {
this.tData = this.buildTree(res.data)
+ if (this.positionCheck('appMarket') && res.data) {
+ this.appMarketDatasource = res.data.filter((item) => item.type === this.outerParams.datasourceType)
+ }
})
},
buildTree(array) {
@@ -763,8 +789,19 @@ export default {
reset() {
this.$refs.dsForm.resetFields()
},
- editDatasource() {
- this.disabled = false
+ saveAppMarketHistory() {
+ this.$refs.historyDsForm.validate(valid => {
+ if (!valid) {
+ return false
+ }
+ const appApplyForm = {
+ ...this.attachForm,
+ ...this.historyDsForm
+ }
+ const method = this.formType === 'add' ? appApply : appEdit
+ this.appApplyMethod(method, appApplyForm)
+ }
+ )
},
save() {
if (
@@ -942,6 +979,7 @@ export default {
}
appApplyForm = {
...this.attachForm,
+ ...this.historyDsForm,
datasourceList: [deepCopy(form)]
}
method = this.formType === 'add' ? appApply : appEdit