-
{{ $t('dataset.sql_variable_limit_1')
- }}
- {{ $t('dataset.sql_variable_limit_2') }}
+
+
+
+
+ {{ $t('chart.back') }}
+ {{ $t('deDataset.data_reference') }}
+
+
+
+
+
+ {{ (showTable && dataTable) || selectedDatasource.name }}
+
+
+
+ {{ (showTable && fieldData.length) || tableData.length }}
+
+
-
-
-
-
-
- {{
+ $t('deDataset.to_start_using')
+ }}
+
+
+
+ {{ ele.fieldName }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('deDataset.running_results') }}
+ {{
+ `(${$t('dataset.preview_show')} 1000 ${$t(
+ 'dataset.preview_item'
+ )})`
+ }}
+
+
+
+
+ {{ $t('deDataset.the_running_results') }}
+
+
+
+
+
+
+
+
+
+ {{ $t('dataset.sql_variable_limit_1') }}
+ {{ $t('dataset.sql_variable_limit_2') }}
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
+
@@ -292,10 +384,12 @@ import 'codemirror/addon/hint/show-hint.css'
import 'codemirror/addon/hint/sql-hint'
import 'codemirror/addon/hint/show-hint'
import { engineMode } from '@/api/system/engine'
+import msgCfm from '@/components/msgCfm/index'
export default {
name: 'AddSQL',
components: { codemirror },
+ mixins: [msgCfm],
props: {
param: {
type: Object,
@@ -305,9 +399,15 @@ export default {
data() {
return {
dataSource: '',
+ dataTable: '',
+ initFlag: true,
+ showTable: false,
+ tableData: [],
+ fieldData: [],
errMsg: false,
options: [],
sql: '',
+ dataReference: false,
sqlOption: {
tabSize: 2,
styleActiveLine: true,
@@ -322,7 +422,8 @@ export default {
},
data: [],
errImg: require('@/assets/error.png'),
- sqlHeight: 330,
+ initImg: require('@/assets/None.png'),
+ sqlHeight: 248,
fields: [],
mode: '0',
syncType: 'sync_now',
@@ -392,7 +493,8 @@ export default {
computed: {
codemirror() {
return this.$refs.myCm.codemirror
- }
+ },
+ dataSourceDetail() {}
},
watch: {
'param.tableId': {
@@ -421,6 +523,19 @@ export default {
})
},
methods: {
+ getField(name) {
+ post('/dataset/table/getFields', {
+ dataSourceId: this.dataSource,
+ info: JSON.stringify({ table: name })
+ }).then((res) => {
+ this.fieldData = res.data
+ })
+ },
+ typeSwitch({ name }) {
+ this.showTable = true
+ this.dataTable = name
+ this.getField(name)
+ },
mousedownDrag() {
document
.querySelector('.dataset-sql')
@@ -455,6 +570,9 @@ export default {
}
}
}
+ post('/datasource/getTables/' + this.dataSource, {}).then((response) => {
+ this.tableData = response.data
+ })
},
calHeight() {
const that = this
@@ -492,12 +610,9 @@ export default {
getSQLPreview() {
this.errMsg = false
+ this.initFlag = false
if (!this.dataSource || this.datasource === '') {
- this.$message({
- showClose: true,
- message: this.$t('dataset.pls_slc_data_source'),
- type: 'error'
- })
+ this.openMessageSuccess('dataset.pls_slc_data_source', 'error')
return
}
this.parseVariable()
@@ -523,27 +638,15 @@ export default {
save() {
if (!this.dataSource || this.datasource === '') {
- this.$message({
- showClose: true,
- message: this.$t('dataset.pls_slc_data_source'),
- type: 'error'
- })
+ this.openMessageSuccess('dataset.pls_slc_data_source', 'error')
return
}
if (!this.table.name || this.table.name === '') {
- this.$message({
- showClose: true,
- message: this.$t('dataset.pls_input_name'),
- type: 'error'
- })
+ this.openMessageSuccess('dataset.pls_input_name', 'error')
return
}
if (this.table.name.length > 50) {
- this.$message({
- showClose: true,
- message: this.$t('dataset.char_can_not_more_50'),
- type: 'error'
- })
+ this.openMessageSuccess('dataset.char_can_not_more_50', 'error')
return
}
this.parseVariable()
@@ -562,20 +665,13 @@ export default {
})
}
post('/dataset/table/update', table).then((response) => {
- this.$emit('saveSuccess', table)
+ this.openMessageSuccess('deDataset.set_saved_successfully')
this.cancel()
})
},
cancel() {
- if (this.param.tableId) {
- this.$emit('switchComponent', {
- name: 'ViewTable',
- param: this.param.table
- })
- } else {
- this.$emit('switchComponent', { name: '' })
- }
+ this.$router.back()
},
showSQL(val) {
@@ -715,16 +811,90 @@ export default {
display: flex;
flex-direction: column;
.sql-editer {
- min-height: 330px;
background: #f5f6f7;
padding: 16px 24px;
- .code-container {
- box-sizing: border-box;
- height: calc(100% - 64px);
- margin-top: 16px;
- color: var(--deTextPrimary, #1f2329);
- .CodeMirror {
- height: 100% !important;
+ }
+
+ .refrence-sql-table {
+ flex: 1;
+ display: flex;
+ flex-direction: row-reverse;
+ overflow: hidden;
+ .data-reference {
+ width: 280px;
+ height: 100%;
+ overflow: hidden;
+ border-left: 1px solid var(--deCardStrokeColor, #dee0e3);
+ .no-select-datasource {
+ font-family: PingFang SC;
+ font-size: 14px;
+ color: var(--deTextPrimary, #1f2329);
+ font-weight: 400;
+ display: inline-block;
+ width: 100%;
+ padding: 16px 12px;
+ }
+ .table-database-name {
+ font-family: PingFang SC;
+ font-size: 16px;
+ font-weight: 500;
+ color: var(--deTextPrimary, #1f2329);
+ padding: 16px 12px;
+ border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
+ p {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin: 0;
+ }
+
+ :nth-child(2)p {
+ margin-top: 16px;
+ }
+ .grey {
+ font-size: 14px;
+ font-weight: 400;
+ color: var(--deTextSecondary, #646a73);
+ }
+ }
+
+ .item-list {
+ padding: 16px 8px;
+ height: calc(100vh - 200px);
+ overflow: auto;
+ .table-or-field {
+ height: 40px;
+ width: 100%;
+ box-sizing: border-box;
+ border-radius: 4px;
+ color: var(--primary, #3370ff);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: flex;
+ align-items: center;
+ padding-left: 4px;
+
+ &:hover {
+ background: rgba(31, 35, 41, 0.1);
+ }
+ }
+ }
+ }
+ .sql-table {
+ flex: 1;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ .code-container {
+ background: #f5f6f7;
+ box-sizing: border-box;
+ min-height: 248px;
+ color: var(--deTextPrimary, #1f2329);
+ .CodeMirror {
+ height: 100% !important;
+ }
}
}
}
@@ -768,6 +938,14 @@ export default {
padding: 18px 25px;
overflow-y: auto;
box-sizing: border-box;
+ .el-empty__bottom,
+ .el-empty__description p {
+ font-family: PingFang SC;
+ font-size: 14px;
+ font-weight: 400;
+ margin-top: 0;
+ color: var(--deTextSecondary, #646a73);
+ }
}
}
}
diff --git a/frontend/src/views/dataset/add/AddUnion.vue b/frontend/src/views/dataset/add/AddUnion.vue
index ba42bf5b8e..f97e268a30 100644
--- a/frontend/src/views/dataset/add/AddUnion.vue
+++ b/frontend/src/views/dataset/add/AddUnion.vue
@@ -209,19 +209,11 @@ export default {
},
save() {
if (!this.param.name || this.param.name === '') {
- this.$message({
- showClose: true,
- message: this.$t('dataset.pls_input_name'),
- type: 'error'
- })
+ this.openMessageSuccess('dataset.pls_input_name', 'error')
return
}
if (this.param.name.length > 50) {
- this.$message({
- showClose: true,
- message: this.$t('dataset.char_can_not_more_50'),
- type: 'error'
- })
+ this.openMessageSuccess('dataset.char_can_not_more_50', 'error')
return
}
const table = {
@@ -239,14 +231,7 @@ export default {
})
},
cancel() {
- if (this.param.tableId) {
- this.$emit('switchComponent', {
- name: 'ViewTable',
- param: this.param.table
- })
- } else {
- this.$emit('switchComponent', { name: '' })
- }
+ this.$router.back()
},
selectDs() {
this.selectDsDialog = true
@@ -260,11 +245,7 @@ export default {
},
confirmSelectDs() {
if (this.tempDs.mode === 0 && this.tempDs.modelInnerType === 'sql') {
- this.$message({
- showClose: true,
- message: this.$t('dataset.sql_ds_union_error'),
- type: 'error'
- })
+ this.openMessageSuccess('deDataset.sql_ds_union_error')
return
}
const ds = JSON.parse(JSON.stringify(this.unionItem))
@@ -315,11 +296,7 @@ export default {
if (this.checkUnion()) {
this.editUnion = false
} else {
- this.$message({
- message: this.$t('dataset.union_error'),
- type: 'error',
- showClose: true
- })
+ this.openMessageSuccess('deDataset.union_error')
}
},
cancelUnion(val) {
diff --git a/frontend/src/views/dataset/data/FieldEdit.vue b/frontend/src/views/dataset/data/FieldEdit.vue
index 4a1b739927..f436fc42fd 100644
--- a/frontend/src/views/dataset/data/FieldEdit.vue
+++ b/frontend/src/views/dataset/data/FieldEdit.vue
@@ -326,7 +326,7 @@
style="margin-left: -4px"
:disabled="!hasDataPermission('manage', param.privileges)"
@click="dqTrans(scope.row, 'd')"
- >{{ $t('convert_to_indicator') }}{{ $t('deDataset.convert_to_indicator') }}
{{ $t('deDataset.display') }} {{ form.row }}
- {{ $t('deDataset.that_s_ok') }}
{{ $t('deDataset.selected') }} {{ tableNum }}
- {{ $t('deDataset.zhang_biao') }}
{{
$t('commons.save')
diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue
index 98656749fd..8de1f2799a 100644
--- a/frontend/src/views/dataset/group/Group.vue
+++ b/frontend/src/views/dataset/group/Group.vue
@@ -72,7 +72,7 @@
{{ $t('deDataset.no_dataset_click') }}
clickAdd()" class="no-tdata-new">{{
- $t('deDataset.newly_build')
+ $t('deDataset.create')
}}
- {{ $t("datasource.data_table") }}
+ {{ $t('datasource.data_table') }}
{{ $t("commons.add") }}{{ $t('commons.add') }}
-
+
-
-
- {{ api.name }}
- {{ $t("datasource.invalid") }}
- {{ $t("datasource.valid") }}
-
-
-
-
-
-
- {{ $t("datasource.delete_this_item") }}
-
+ v-for="api in form.apiConfiguration"
+ :key="api.id"
+ class="api-card"
+ >
+
+
+ {{ api.name }}
+ {{ $t('datasource.invalid') }}
+ {{ $t('datasource.valid') }}
+
+
-
-
-
-
-
{{ $t("datasource.method") }}
-
{{ $t("datasource.url") }}
+
+
+
+
+ {{ $t('datasource.delete_this_item') }}
+
+
+
+
+
+
+
+ {{ $t('datasource.method') }}
+ {{ $t('datasource.url') }}
+
+
+ {{ api.method }}
+ {{ api.url }}
+
-
- {{ api.method }}
- {{ api.url }}
-
-
@@ -94,7 +100,11 @@
:label="$t('datasource.host')"
prop="configuration.host"
>
-
+
-
+
{{ $t("datasource.oracle_sid") }}
+ >{{ $t('datasource.oracle_sid') }}
- {{ $t("datasource.oracle_service_name") }}
+ {{ $t('datasource.oracle_service_name') }}
@@ -164,7 +178,7 @@
>
- {{ $t("datasource.kerbers_info") }}
+ {{ $t('datasource.kerbers_info') }}
@@ -183,7 +197,11 @@
"
:label="$t('datasource.user_name')"
>
-
+
-
+
-
+
-
+
- {{ $t("datasource.schema") }}
+ {{ $t('datasource.schema') }}
{{ $t("datasource.get_schema") }}
+ >{{ $t('datasource.get_schema') }}
{{ $t("datasource.priority")
+ >{{ $t('datasource.priority')
}}
@@ -369,7 +399,7 @@
type="number"
:min="0"
>
- {{ $t("panel.second") }}
+ {{ $t('panel.second') }}
@@ -408,7 +438,7 @@
:rules="rule"
>
- {{ $t("datasource.base_info") }}
+ {{ $t('datasource.base_info') }}
@@ -439,7 +469,7 @@
- {{ $t("datasource.req_param") }}
+ {{ $t('datasource.req_param') }}
@@ -462,7 +492,7 @@
:rules="rule"
>
- {{ $t("datasource.column_info") }}
+ {{ $t('datasource.column_info') }}
-
-
- {{ $t("dataset.data_preview") }}
+ {{ $t('dataset.data_preview') }}
@@ -617,25 +649,25 @@
\ No newline at end of file