+
- {{ $t('sql_variable.variable_mgm') }}
+
+ {{ $t('deDataset.data_reference') }}
+
+ {{ $t('sql_variable.variable_mgm') }}
+
+
+
+
{{ $t('deDataset.run_a_query') }}
-
-
-
-
-
- {{ $t('deDataset.running_results') }}
-
{{
- `(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
+
+
+
+
+ {{ $t('chart.back') }}
+ {{ $t('deDataset.data_reference') }}
+
+
+
+
+
+ {{ (showTable && dataTable) || selectedDatasource.name }}
+
+
+
+ {{ (showTable && fieldData.length) || tableData.length }}
+
+
+
+
{{
+ $t('deDataset.to_start_using')
}}
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('dataset.sql_variable_limit_1')
- }}
- {{ $t('dataset.sql_variable_limit_2') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {{ 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 +370,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 +385,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 +408,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 +479,8 @@ export default {
computed: {
codemirror() {
return this.$refs.myCm.codemirror
- }
+ },
+ dataSourceDetail() {}
},
watch: {
'param.tableId': {
@@ -421,6 +509,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 +556,9 @@ export default {
}
}
}
+ post('/datasource/getTables/' + this.dataSource, {}).then((response) => {
+ this.tableData = response.data
+ })
},
calHeight() {
const that = this
@@ -492,12 +596,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,33 +624,21 @@ 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'
- })
+ if (!this.param.name || this.param.name === '') {
+ 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'
- })
+ if (this.param.name.length > 50) {
+ this.openMessageSuccess('dataset.char_can_not_more_50', 'error')
return
}
this.parseVariable()
const table = {
id: this.param.tableId,
- name: this.table.name,
+ name: this.param.name,
sceneId: this.param.id,
dataSourceId: this.dataSource,
type: 'sql',
@@ -562,20 +651,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) {
@@ -592,7 +674,7 @@ export default {
resetComponent() {
this.dataSource = ''
- this.table.name = ''
+ this.param.name = ''
this.sql = ''
this.data = []
this.fields = []
@@ -715,16 +797,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 +924,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..e7deb93c6f 100644
--- a/frontend/src/views/dataset/add/AddUnion.vue
+++ b/frontend/src/views/dataset/add/AddUnion.vue
@@ -1,15 +1,5 @@
-
@@ -209,19 +199,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 +221,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 +235,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 +286,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..13ae6bae6c 100644
--- a/frontend/src/views/dataset/data/FieldEdit.vue
+++ b/frontend/src/views/dataset/data/FieldEdit.vue
@@ -1,16 +1,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -310,14 +290,6 @@
-
-
-
-
-
-
-
-
{{ $t('convert_to_indicator') }}{{ $t('deDataset.convert_to_indicator') }}
-
-
-
-
@@ -637,29 +600,6 @@
-
-
-
-
-
-
-
-
-
+.de-center-dialog {
+ .el-dialog {
+ margin: 0 !important;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
+}
+
\ No newline at end of file
diff --git a/frontend/src/views/dataset/data/TabDataPreview.vue b/frontend/src/views/dataset/data/TabDataPreview.vue
index 1dd84f6dac..b72ce33586 100644
--- a/frontend/src/views/dataset/data/TabDataPreview.vue
+++ b/frontend/src/views/dataset/data/TabDataPreview.vue
@@ -23,7 +23,7 @@
{{ $t('deDataset.display') }} {{ form.row }}
- {{ $t('deDataset.that_s_ok') }}
-
-
-