mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 12:03:05 +08:00
Merge pull request #3133 from dataease/pr@dev_dataset_source
Pr@dev dataset source
This commit is contained in:
commit
8462368a2c
@ -148,4 +148,11 @@ export function updateDriver(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { dsGrid, addDs, editDs, delDs, validateDs, listDatasource, getSchema }
|
||||
export function getDatasourceDetail(id) {
|
||||
return request({
|
||||
url: `/datasource/get/${id}`,
|
||||
loading: true,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
export default { getDatasourceDetail, dsGrid, addDs, editDs, delDs, validateDs, listDatasource, getSchema }
|
||||
|
4
frontend/src/icons/svg/data-reference.svg
Normal file
4
frontend/src/icons/svg/data-reference.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 2.00033C11.5933 2.00033 5.23004 2.00033 3.99954 2.00033C3.26316 2.00033 2.66666 2.59728 2.66666 3.33366V10.0003H10.6667V1.00033H12V11.0003C12 11.1844 11.8508 11.3337 11.6667 11.3337H3.99999C3.26362 11.3337 2.66666 11.9306 2.66666 12.667C2.66666 13.4034 3.26164 14.0003 3.99802 14.0003C6.32365 14.0003 12.2815 14.0003 13 14.0003C13.1841 14.0003 13.3333 13.8511 13.3333 13.667V5.33366H14.6667V14.667C14.6667 15.0352 14.3682 15.3337 14 15.3337H3.99999C2.52724 15.3337 1.33333 14.1437 1.33333 12.6709C1.33333 10.0477 1.33333 6.0493 1.33333 3.33243C1.33333 1.85967 2.52688 0.666992 3.99964 0.666992C5.02765 0.666992 9.06402 0.666992 11.0023 0.666992C11.5546 0.666992 12 1.11471 12 1.66699V2.00033Z" />
|
||||
<path d="M4.33333 12.0003C4.14923 12.0003 3.99999 12.1496 3.99999 12.3337V13.0003C3.99999 13.1844 4.14923 13.3337 4.33333 13.3337H11.6667C11.8508 13.3337 12 13.1844 12 13.0003V12.3337C12 12.1496 11.8508 12.0003 11.6667 12.0003H4.33333Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
4
frontend/src/icons/svg/reference-field.svg
Normal file
4
frontend/src/icons/svg/reference-field.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.66668 4.66634H11C11.1841 4.66634 11.3333 4.81558 11.3333 4.99967V5.66634C11.3333 5.85044 11.1841 5.99967 11 5.99967H8.66668V10.9997C8.66668 11.1838 8.51744 11.333 8.33334 11.333H7.66668C7.48258 11.333 7.33334 11.1838 7.33334 10.9997V5.99967H5.00001C4.81592 5.99967 4.66668 5.85044 4.66668 5.66634V4.99967C4.66668 4.81558 4.81592 4.66634 5.00001 4.66634H7.33334C7.33334 4.66634 8.66668 4.68523 8.66668 4.66634Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 1.99967C1.33334 1.63148 1.63182 1.33301 2.00001 1.33301H14C14.3682 1.33301 14.6667 1.63148 14.6667 1.99967V13.9997C14.6667 14.3679 14.3682 14.6663 14 14.6663H2.00001C1.63182 14.6663 1.33334 14.3679 1.33334 13.9997V1.99967ZM2.66668 13.333V2.66634H13.3333V13.333H2.66668Z" fill="#646A73"/>
|
||||
</svg>
|
After Width: | Height: | Size: 863 B |
10
frontend/src/icons/svg/reference-play.svg
Normal file
10
frontend/src/icons/svg/reference-play.svg
Normal file
@ -0,0 +1,10 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4476_153334)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.99984 1.66699C11.4976 1.66699 14.3332 4.50261 14.3332 8.00033C14.3332 11.498 11.4976 14.3337 7.99984 14.3337C4.50212 14.3337 1.6665 11.498 1.6665 8.00033C1.6665 4.50261 4.50212 1.66699 7.99984 1.66699ZM7.99984 0.666992C12.0498 0.666992 15.3332 3.95033 15.3332 8.00033C15.3332 12.0503 12.0498 15.3337 7.99984 15.3337C3.94984 15.3337 0.666504 12.0503 0.666504 8.00033C0.666504 3.95033 3.94984 0.666992 7.99984 0.666992ZM6.85744 11.4096L11.4714 8.50657C11.5568 8.45249 11.6271 8.37772 11.6758 8.2892C11.7245 8.20069 11.75 8.1013 11.75 8.00027C11.75 7.89924 11.7245 7.79985 11.6758 7.71133C11.6271 7.62282 11.5568 7.54804 11.4714 7.49397L6.85764 4.59117C6.76324 4.53177 6.65444 4.50037 6.54324 4.50037C6.46511 4.50063 6.38779 4.51628 6.3157 4.54642C6.24361 4.57657 6.17816 4.62061 6.1231 4.67605C6.06803 4.73149 6.02443 4.79723 5.99477 4.86952C5.96511 4.94181 5.94998 5.01923 5.95024 5.09737V10.9036C5.95031 11.0152 5.98155 11.1247 6.04044 11.2196C6.0814 11.2859 6.13508 11.3435 6.1984 11.389C6.26172 11.4345 6.33342 11.4671 6.40937 11.4847C6.48532 11.5024 6.56402 11.5048 6.64092 11.4919C6.71782 11.479 6.79141 11.451 6.85744 11.4096Z"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4476_153334">
|
||||
<rect width="16" height="16"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
3
frontend/src/icons/svg/reference-setting.svg
Normal file
3
frontend/src/icons/svg/reference-setting.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 11.333H14.2393C14.3879 11.333 14.4418 11.3485 14.4961 11.3775C14.5505 11.4066 14.5931 11.4492 14.6221 11.5035C14.6512 11.5579 14.6667 11.6117 14.6667 11.7603V12.239C14.6667 12.3876 14.6512 12.4415 14.6221 12.4958C14.5931 12.5501 14.5505 12.5928 14.4961 12.6218C14.4418 12.6509 14.3879 12.6663 14.2393 12.6663H11V14.239C11 14.3876 10.9845 14.4415 10.9555 14.4958C10.9264 14.5501 10.8838 14.5928 10.8295 14.6218C10.7751 14.6509 10.7213 14.6663 10.5727 14.6663H10.094C9.94539 14.6663 9.89151 14.6509 9.83719 14.6218C9.78287 14.5928 9.74024 14.5501 9.71118 14.4958C9.68213 14.4415 9.66666 14.3876 9.66666 14.239V12.6663H1.76064C1.61206 12.6663 1.55817 12.6509 1.50385 12.6218C1.44953 12.5928 1.4069 12.5501 1.37785 12.4958C1.3488 12.4415 1.33333 12.3876 1.33333 12.239V11.7603C1.33333 11.6117 1.3488 11.5579 1.37785 11.5035C1.4069 11.4492 1.44953 11.4066 1.50385 11.3775C1.55817 11.3485 1.61206 11.333 1.76064 11.333H9.66666V9.76032C9.66666 9.61174 9.68213 9.55785 9.71118 9.50353C9.74024 9.44921 9.78287 9.40658 9.83719 9.37753C9.89151 9.34848 9.94539 9.33301 10.094 9.33301H10.5727C10.7213 9.33301 10.7751 9.34848 10.8295 9.37753C10.8838 9.40658 10.9264 9.44921 10.9555 9.50353C10.9845 9.55785 11 9.61174 11 9.76032V11.333ZM4.99999 3.33301V1.76032C4.99999 1.61174 5.01547 1.55785 5.04452 1.50353C5.07357 1.44921 5.1162 1.40658 5.17052 1.37753C5.22484 1.34848 5.27872 1.33301 5.42731 1.33301H5.90601C6.0546 1.33301 6.10848 1.34848 6.1628 1.37753C6.21712 1.40658 6.25976 1.44921 6.28881 1.50353C6.31786 1.55785 6.33333 1.61174 6.33333 1.76032V3.33301H14.2393C14.3879 3.33301 14.4418 3.34848 14.4961 3.37753C14.5505 3.40658 14.5931 3.44921 14.6221 3.50353C14.6512 3.55785 14.6667 3.61174 14.6667 3.76032V4.23903C14.6667 4.38761 14.6512 4.44149 14.6221 4.49582C14.5931 4.55014 14.5505 4.59277 14.4961 4.62182C14.4418 4.65087 14.3879 4.66634 14.2393 4.66634H6.33333V6.23903C6.33333 6.38761 6.31786 6.44149 6.28881 6.49582C6.25976 6.55014 6.21712 6.59277 6.1628 6.62182C6.10848 6.65087 6.0546 6.66634 5.90601 6.66634H5.42731C5.27872 6.66634 5.22484 6.65087 5.17052 6.62182C5.1162 6.59277 5.07357 6.55014 5.04452 6.49582C5.01547 6.44149 4.99999 6.38761 4.99999 6.23903V4.66634H1.76064C1.61206 4.66634 1.55817 4.65087 1.50385 4.62182C1.44953 4.59277 1.4069 4.55014 1.37785 4.49582C1.3488 4.44149 1.33333 4.38761 1.33333 4.23903V3.76032C1.33333 3.61174 1.3488 3.55785 1.37785 3.50353C1.4069 3.44921 1.44953 3.40658 1.50385 3.37753C1.55817 3.34848 1.61206 3.33301 1.76064 3.33301H4.99999Z" fill="#1F2329"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
3
frontend/src/icons/svg/reference-table.svg
Normal file
3
frontend/src/icons/svg/reference-table.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.15156 1.33301C2.1474 1.33301 1.33337 2.14703 1.33337 3.15119V12.8482C1.33337 13.8523 2.1474 14.6663 3.15155 14.6663H12.8485C13.8527 14.6663 14.6667 13.8523 14.6667 12.8482V3.15119C14.6667 2.14704 13.8527 1.33301 12.8485 1.33301H3.15156ZM13.3334 2.66634H2.66671V5.33301H5.33337H6.66671H9.33337H10.6667H13.3334V2.66634ZM2.66671 9.33301V6.66634H5.33337V9.33301H2.66671ZM2.66671 10.6663V13.333L5.33337 13.333V10.6663H2.66671ZM6.66671 10.6663V13.333H9.33337V10.6663H6.66671ZM10.6667 10.6663V13.333L13.3334 13.333V10.6663H10.6667ZM13.3334 9.33301V6.66634H10.6667V9.33301H13.3334ZM9.33337 9.33301H6.66671V6.66634H9.33337V9.33301Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 769 B |
@ -525,7 +525,10 @@ export default {
|
||||
convert_to_dimension: 'Convert to Dimension',
|
||||
left_to_edit: 'Select the data table on the left to edit',
|
||||
cannot_be_duplicate: 'The dataset name cannot be duplicate',
|
||||
set_saved_successfully: 'Data set saved successfully'
|
||||
set_saved_successfully: 'Data set saved successfully',
|
||||
to_start_using: 'Browse the contents of your database, tables and columns. Choose a database to get started.',
|
||||
to_run_query: 'Click to run query',
|
||||
the_running_results: 'You can view the running results'
|
||||
},
|
||||
detabs: {
|
||||
eidttitle: 'Edit Title',
|
||||
|
@ -525,7 +525,10 @@ export default {
|
||||
convert_to_dimension: '轉換為維度',
|
||||
left_to_edit: '選中左側的資料表可進行編輯',
|
||||
cannot_be_duplicate: '數据集名稱不允許重複',
|
||||
set_saved_successfully: '數据集保存成功'
|
||||
set_saved_successfully: '數据集保存成功',
|
||||
to_start_using: '瀏覽您的數据庫,表和列的內容。 選擇一個數据庫即可開始使用。',
|
||||
to_run_query: '點擊運行査詢',
|
||||
the_running_results: '即可查看運行結果'
|
||||
},
|
||||
detabs: {
|
||||
eidttitle: '編輯標題',
|
||||
|
@ -523,7 +523,10 @@ export default {
|
||||
convert_to_dimension: '转换为维度',
|
||||
left_to_edit: '选中左侧的数据表可进行编辑',
|
||||
cannot_be_duplicate: '数据集名称不允许重复',
|
||||
set_saved_successfully: '数据集保存成功'
|
||||
set_saved_successfully: '数据集保存成功',
|
||||
to_start_using: '浏览您的数据库,表和列的内容。 选择一个数据库即可开始使用。',
|
||||
to_run_query: '点击运行查询',
|
||||
the_running_results: '即可查看运行结果'
|
||||
},
|
||||
detabs: {
|
||||
eidttitle: '编辑标题',
|
||||
|
@ -32,7 +32,6 @@
|
||||
clearable
|
||||
/>
|
||||
<div class="table-checkbox-list">
|
||||
<!-- <div class="item" v-for="(ele, index) in tableData"> -->
|
||||
<el-checkbox-group v-model="checkTableList" size="small">
|
||||
<el-tooltip
|
||||
v-for="t in tableData"
|
||||
@ -57,7 +56,6 @@
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-checkbox-group>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-detail">
|
||||
@ -379,6 +377,7 @@ export default {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.arrow-right {
|
||||
position: absolute;
|
||||
|
@ -33,7 +33,6 @@
|
||||
clearable
|
||||
/>
|
||||
<div class="table-checkbox-list">
|
||||
<!-- <div class="item" v-for="(ele, index) in tableData"> -->
|
||||
<el-checkbox-group v-model="checkTableList" size="small">
|
||||
<el-tooltip
|
||||
:disabled="t.enableCheck"
|
||||
@ -59,7 +58,6 @@
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-checkbox-group>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-detail">
|
||||
@ -282,14 +280,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
nameExsitValidator(activeIndex) {
|
||||
if (
|
||||
!this.nameList ||
|
||||
this.nameList.length === 0 ||
|
||||
!this.checkDatasetName.includes(this.tableData[activeIndex].datasetName)
|
||||
) {
|
||||
this.tableData[activeIndex].nameExsit = false
|
||||
return
|
||||
}
|
||||
this.tableData[activeIndex].nameExsit =
|
||||
this.nameList
|
||||
.concat(this.checkDatasetName)
|
||||
@ -300,6 +290,8 @@ export default {
|
||||
this.tableData.forEach((ele, index) => {
|
||||
if (this.checkDatasetName.includes(ele.datasetName)) {
|
||||
this.nameExsitValidator(index)
|
||||
} else {
|
||||
ele.nameExsit = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -402,6 +394,8 @@ export default {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
|
||||
.arrow-right {
|
||||
position: absolute;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="dataset-excel">
|
||||
<p v-if="!showLeft" class="arrow-right" @click="showLeft = true">
|
||||
<i class="el-icon-d-arrow-right" />
|
||||
<p v-if="!showLeft" @click="showLeft = true" class="arrow-right">
|
||||
<i class="el-icon-d-arrow-right"></i>
|
||||
</p>
|
||||
<div v-else class="table-list">
|
||||
<p class="select-ds">
|
||||
@ -50,7 +50,14 @@
|
||||
highlight-current
|
||||
@node-click="handleNodeClick"
|
||||
@check-change="handleCheckChange"
|
||||
/>
|
||||
>
|
||||
<span class="custom-tree-node" slot-scope="{ data }">
|
||||
{{ data.excelLable }}
|
||||
<span class="error-name-exsit" v-if="data.nameExsit">
|
||||
<svg-icon icon-class="exclamationmark" class="ds-icon-scene" />
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-detail">
|
||||
@ -68,7 +75,15 @@
|
||||
v-model="sheetObj.datasetName"
|
||||
:placeholder="$t('commons.name')"
|
||||
@change="changeDatasetName"
|
||||
size="small"
|
||||
/>
|
||||
<div
|
||||
v-if="sheetObj.nameExsit"
|
||||
style="left: 107px; top: 52px"
|
||||
class="el-form-item__error"
|
||||
>
|
||||
{{ $t('deDataset.already_exists') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="data">
|
||||
<div class="result-num">
|
||||
@ -174,11 +189,13 @@ import { getToken } from '@/utils/auth'
|
||||
import i18n from '@/lang'
|
||||
import { $alert, $confirm } from '@/utils/message'
|
||||
import store from '@/store'
|
||||
import msgCfm from '@/components/msgCfm/index'
|
||||
|
||||
const token = getToken()
|
||||
|
||||
export default {
|
||||
name: 'AddExcel',
|
||||
mixins: [msgCfm],
|
||||
props: {
|
||||
param: {
|
||||
type: Object,
|
||||
@ -191,6 +208,10 @@ export default {
|
||||
editType: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
nameList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -230,15 +251,6 @@ export default {
|
||||
defaultCheckedKeys: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
defaultCheckedKeys(val) {
|
||||
const excelNum = this.excelData.map((ele) => ele.id)
|
||||
this.$emit(
|
||||
'setTableNum',
|
||||
val.filter((ele) => !excelNum.includes(ele)).length
|
||||
)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
this.calHeight()
|
||||
@ -266,7 +278,33 @@ export default {
|
||||
})
|
||||
this.defaultCheckedKeys.splice(index, 1)
|
||||
}
|
||||
this.$emit('setTableNum', this.defaultCheckedKeys.length)
|
||||
this.validateName()
|
||||
const labelList = this.$refs.tree.getCheckedNodes().map(ele => ele.excelLable)
|
||||
const excelList = this.excelData.map(ele => ele.excelLable);
|
||||
this.$emit('setTableNum', labelList.filter(ele => !excelList.includes(ele)).length)
|
||||
},
|
||||
nameExsitValidator(ele, checkList) {
|
||||
this.$set(
|
||||
ele,
|
||||
'nameExsit',
|
||||
this.nameList
|
||||
.concat(checkList)
|
||||
.filter((name) => name === ele.datasetName).length > 1
|
||||
)
|
||||
},
|
||||
validateName() {
|
||||
const checkList = this.$refs.tree
|
||||
.getCheckedNodes()
|
||||
.map((ele) => ele.datasetName)
|
||||
this.excelData
|
||||
.reduce((pre, next) => pre.concat(next.sheets), [])
|
||||
.forEach((ele, index) => {
|
||||
if (checkList.includes(ele.datasetName)) {
|
||||
this.nameExsitValidator(ele, checkList)
|
||||
} else {
|
||||
this.$set(ele, 'nameExsit', false)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
if (data.sheet) {
|
||||
@ -291,6 +329,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.validateName()
|
||||
},
|
||||
calHeight() {
|
||||
const that = this
|
||||
@ -358,24 +397,20 @@ export default {
|
||||
var effectExtField = false
|
||||
var changeFiled = false
|
||||
var selectNode = this.$refs.tree.getCheckedNodes()
|
||||
if (selectNode.some((ele) => ele.nameExsit)) {
|
||||
this.openMessageSuccess('deDataset.cannot_be_duplicate', 'error')
|
||||
return
|
||||
}
|
||||
for (var i = 0; i < selectNode.length; i++) {
|
||||
if (selectNode[i].sheet) {
|
||||
if (!selectNode[i].datasetName || selectNode[i].datasetName === '') {
|
||||
validate = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: this.$t('dataset.pls_input_name'),
|
||||
type: 'error'
|
||||
})
|
||||
this.openMessageSuccess('dataset.pls_input_name', 'error')
|
||||
return
|
||||
}
|
||||
if (selectNode[i].datasetName.length > 50 && !this.param.tableId) {
|
||||
validate = false
|
||||
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
|
||||
}
|
||||
if (selectNode[i].effectExtField) {
|
||||
@ -389,7 +424,7 @@ export default {
|
||||
}
|
||||
}
|
||||
if (selectedSheet.length == 0) {
|
||||
this.$message.warning(this.$t('dataset.ple_select_excel'))
|
||||
this.openMessageSuccess('dataset.ple_select_excel', 'error')
|
||||
return
|
||||
}
|
||||
if (!validate) {
|
||||
@ -420,8 +455,16 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.param.editType === 0 && this.param.tableId && (effectExtField || changeFiled)) {
|
||||
var msg = effectExtField ? i18n.t('dataset.effect_ext_field') + ', ' + i18n.t('dataset.excel_replace_msg') : i18n.t('dataset.excel_replace_msg')
|
||||
if (
|
||||
this.param.editType === 0 &&
|
||||
this.param.tableId &&
|
||||
(effectExtField || changeFiled)
|
||||
) {
|
||||
var msg = effectExtField
|
||||
? i18n.t('dataset.task.effect_ext_field') +
|
||||
', ' +
|
||||
i18n.t('dataset.task.excel_replace_msg')
|
||||
: i18n.t('dataset.task.excel_replace_msg')
|
||||
$confirm(msg, () => {
|
||||
this.saveExcelData(sheetFileMd5, table)
|
||||
})
|
||||
@ -435,7 +478,7 @@ export default {
|
||||
!this.param.tableId
|
||||
) {
|
||||
this.$confirm(
|
||||
this.$t('dataset.excel_replace_msg'),
|
||||
this.$t('dataset.task.excel_replace_msg'),
|
||||
this.$t('dataset.merge_title'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
@ -447,7 +490,7 @@ export default {
|
||||
.then(() => {
|
||||
table.mergeSheet = true
|
||||
post('/dataset/table/update', table).then((response) => {
|
||||
this.$emit('saveSuccess', table)
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel()
|
||||
})
|
||||
})
|
||||
@ -457,29 +500,20 @@ export default {
|
||||
}
|
||||
table.mergeSheet = false
|
||||
post('/dataset/table/update', table).then((response) => {
|
||||
this.$emit('saveSuccess', table)
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
post('/dataset/table/update', table).then((response) => {
|
||||
this.$emit('saveSuccess', table)
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel()
|
||||
})
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
this.dataReset()
|
||||
if (this.param.tableId) {
|
||||
this.$emit('switchComponent', {
|
||||
name: 'ViewTable',
|
||||
param: this.param.table
|
||||
})
|
||||
} else {
|
||||
this.$emit('switchComponent', { name: '' })
|
||||
}
|
||||
this.$router.back()
|
||||
},
|
||||
|
||||
dataReset() {
|
||||
this.searchTable = ''
|
||||
this.options = []
|
||||
@ -508,6 +542,8 @@ export default {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.arrow-right {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
@ -553,6 +589,18 @@ export default {
|
||||
.table-checkbox-list {
|
||||
height: calc(100% - 100px);
|
||||
overflow-y: auto;
|
||||
.custom-tree-node {
|
||||
position: relative;
|
||||
width: 80%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.error-name-exsit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.item {
|
||||
height: 40px;
|
||||
width: 215px;
|
||||
@ -588,6 +636,7 @@ export default {
|
||||
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
|
@ -1,15 +1,6 @@
|
||||
<template>
|
||||
<div class="dataset-sql" @mouseup="mouseupDrag">
|
||||
<!-- <el-input v-model="name" size="mini" :placeholder="$t('commons.name')"/> -->
|
||||
|
||||
<!-- <el-button size="mini" @click="cancel">
|
||||
{{ $t('dataset.cancel') }}
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="save">
|
||||
{{ $t('dataset.confirm') }}
|
||||
</el-button> -->
|
||||
|
||||
<div class="sql-editer" :style="{ height: sqlHeight + 'px' }">
|
||||
<div class="sql-editer">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-select
|
||||
@ -60,206 +51,293 @@
|
||||
</el-col>
|
||||
<el-col style="text-align: right" :span="12">
|
||||
<el-button
|
||||
icon="el-icon-s-operation"
|
||||
type="text"
|
||||
size="small"
|
||||
class="de-text-btn"
|
||||
@click="variableMgm"
|
||||
@click="dataReference = true"
|
||||
>
|
||||
{{ $t('sql_variable.variable_mgm') }}
|
||||
<svg-icon icon-class="data-reference" />
|
||||
{{ $t('deDataset.data_reference') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="el-icon-video-play"
|
||||
type="text"
|
||||
size="small"
|
||||
style="color: #1f2329"
|
||||
class="de-text-btn"
|
||||
@click="variableMgm"
|
||||
>
|
||||
<svg-icon icon-class="reference-setting" />
|
||||
{{ $t('sql_variable.variable_mgm') }}
|
||||
</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button
|
||||
class="de-text-btn"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="getSQLPreview"
|
||||
>
|
||||
<svg-icon icon-class="reference-play" />
|
||||
{{ $t('deDataset.run_a_query') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="code-container">
|
||||
<codemirror
|
||||
ref="myCm"
|
||||
v-model="sql"
|
||||
class="codemirror"
|
||||
:options="sqlOption"
|
||||
@ready="onCmReady"
|
||||
@focus="onCmFocus"
|
||||
@input="onCmCodeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sql-result">
|
||||
<div class="sql-title">
|
||||
{{ $t('deDataset.running_results') }}
|
||||
<span class="result-num">{{
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
||||
<div class="refrence-sql-table">
|
||||
<div class="data-reference" v-if="dataReference">
|
||||
<div class="table-database-name">
|
||||
<p>
|
||||
<span
|
||||
@click="
|
||||
showTable = false
|
||||
dataTable = ''
|
||||
"
|
||||
style="cursor: pointer"
|
||||
v-if="showTable"
|
||||
><i class="el-icon-arrow-left"></i> {{ $t('chart.back') }}</span
|
||||
>
|
||||
<span v-else>{{ $t('deDataset.data_reference') }}</span>
|
||||
<i
|
||||
@click="
|
||||
showTable = false
|
||||
dataTable = ''
|
||||
dataReference = false
|
||||
"
|
||||
style="cursor: pointer"
|
||||
class="el-icon-close"
|
||||
></i>
|
||||
</p>
|
||||
<p v-if="dataSource">
|
||||
<span>
|
||||
<svg-icon icon-class="db-de" />
|
||||
{{ (showTable && dataTable) || selectedDatasource.name }}
|
||||
</span>
|
||||
<span class="grey">
|
||||
<svg-icon
|
||||
:icon-class="showTable ? 'reference-table' : 'reference-field'"
|
||||
/>
|
||||
{{ (showTable && fieldData.length) || tableData.length }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<span class="no-select-datasource" v-if="!dataSource">{{
|
||||
$t('deDataset.to_start_using')
|
||||
}}</span>
|
||||
|
||||
<span @mousedown="mousedownDrag" class="drag"></span>
|
||||
</div>
|
||||
<div class="table-sql">
|
||||
<el-empty
|
||||
:image-size="60"
|
||||
v-if="errMsg"
|
||||
:image="errImg"
|
||||
:description="$t('deDataset.run_failed')"
|
||||
></el-empty>
|
||||
<ux-grid
|
||||
v-else
|
||||
ref="plxTable"
|
||||
size="mini"
|
||||
style="width: 100%"
|
||||
:height="height"
|
||||
:checkbox-config="{ highlight: true }"
|
||||
:width-resize="true"
|
||||
>
|
||||
<ux-table-column
|
||||
v-for="field in fields"
|
||||
:key="field.fieldName"
|
||||
min-width="200px"
|
||||
:field="field.fieldName"
|
||||
:title="field.remarks"
|
||||
:resizable="true"
|
||||
/>
|
||||
</ux-grid>
|
||||
</div>
|
||||
<el-drawer
|
||||
:title="dialogTitle"
|
||||
:visible.sync="showVariableMgm"
|
||||
custom-class="user-drawer sql-dataset-drawer"
|
||||
size="840px"
|
||||
v-closePress
|
||||
direction="rtl"
|
||||
>
|
||||
<div class="content">
|
||||
<i class="el-icon-info"></i> {{ $t('dataset.sql_variable_limit_1')
|
||||
}}<br />
|
||||
{{ $t('dataset.sql_variable_limit_2') }}<br />
|
||||
</div>
|
||||
<el-table :data="variablesTmp">
|
||||
<el-table-column prop="variableName" :label="$t('panel.param_name')">
|
||||
</el-table-column>
|
||||
<el-table-column width="200" :label="$t('deDataset.parameter_type')">
|
||||
<template slot-scope="scope">
|
||||
<el-cascader
|
||||
v-model="scope.row.type"
|
||||
size="mini"
|
||||
class="select-type"
|
||||
:options="fieldOptions"
|
||||
@change="variableTypeChange(scope.row)"
|
||||
>
|
||||
</el-cascader>
|
||||
<span class="select-svg-icon">
|
||||
<svg-icon
|
||||
v-if="scope.row.type[0] === 'TEXT'"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="
|
||||
[
|
||||
'DATETIME-YEAR',
|
||||
'DATETIME-YEAR-MONTH',
|
||||
'DATETIME',
|
||||
'DATETIME-YEAR-MONTH-DAY'
|
||||
].includes(scope.row.type[0])
|
||||
"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="['LONG', 'DOUBLE'].includes(scope.row.type[0])"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<!-- <svg-icon
|
||||
v-if="scope.row.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/> -->
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="350"
|
||||
prop="defaultValue"
|
||||
:label="$t('commons.params_value')"
|
||||
<div v-else-if="dataSource && !dataTable" class="item-list">
|
||||
<div
|
||||
@click="typeSwitch(ele)"
|
||||
:key="ele.name"
|
||||
v-for="ele in tableData"
|
||||
class="table-or-field"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
size="small"
|
||||
v-if="scope.row.type[0] === 'TEXT'"
|
||||
type="text"
|
||||
:placeholder="$t('fu.search_bar.please_input')"
|
||||
v-model="scope.row.defaultValue"
|
||||
/>
|
||||
<el-input
|
||||
size="small"
|
||||
v-if="
|
||||
scope.row.type[0] === 'LONG' || scope.row.type[0] === 'DOUBLE'
|
||||
"
|
||||
:placeholder="$t('fu.search_bar.please_input')"
|
||||
type="number"
|
||||
v-model="scope.row.defaultValue"
|
||||
/>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME-YEAR'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="year"
|
||||
size="small"
|
||||
value-format="yyyy"
|
||||
:placeholder="$t('dataset.select_year')"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME-YEAR-MONTH'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="month"
|
||||
size="small"
|
||||
:format="scope.row.type[1]"
|
||||
:value-format="scope.row.type[1]"
|
||||
:placeholder="$t('dataset.select_month')"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME-YEAR-MONTH-DAY'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="date"
|
||||
size="small"
|
||||
:format="scope.row.type[1]"
|
||||
:value-format="scope.row.type[1]"
|
||||
:placeholder="$t('dataset.select_date')"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="datetime"
|
||||
size="small"
|
||||
:format="scope.row.type[1]"
|
||||
:value-format="scope.row.type[1]"
|
||||
:placeholder="$t('dataset.select_time')"
|
||||
>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="de-foot">
|
||||
<deBtn secondary @click="closeVariableMgm">{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
<deBtn type="primary" @click="saveVariable()">{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
{{ ele.name }}
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<div v-else-if="dataSource && dataTable" class="item-list">
|
||||
<div
|
||||
:key="ele.fieldName"
|
||||
v-for="ele in fieldData"
|
||||
class="table-or-field"
|
||||
>
|
||||
{{ ele.fieldName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sql-table">
|
||||
<div class="code-container" :style="{ height: sqlHeight + 'px' }">
|
||||
<codemirror
|
||||
ref="myCm"
|
||||
v-model="sql"
|
||||
class="codemirror"
|
||||
:options="sqlOption"
|
||||
@ready="onCmReady"
|
||||
@focus="onCmFocus"
|
||||
@input="onCmCodeChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="sql-result">
|
||||
<div class="sql-title">
|
||||
{{ $t('deDataset.running_results') }}
|
||||
<span class="result-num">{{
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t(
|
||||
'dataset.preview_item'
|
||||
)})`
|
||||
}}</span>
|
||||
|
||||
<span @mousedown="mousedownDrag" class="drag"></span>
|
||||
</div>
|
||||
<div class="table-sql">
|
||||
<el-empty
|
||||
:image-size="125"
|
||||
v-if="initFlag"
|
||||
style="margin-top: 80px"
|
||||
:image="initImg"
|
||||
:description="$t('deDataset.to_run_query')"
|
||||
>{{ $t('deDataset.the_running_results') }}
|
||||
</el-empty>
|
||||
<el-empty
|
||||
:image-size="60"
|
||||
v-else-if="errMsg"
|
||||
:image="errImg"
|
||||
:description="$t('deDataset.run_failed')"
|
||||
></el-empty>
|
||||
<ux-grid
|
||||
v-else
|
||||
ref="plxTable"
|
||||
size="mini"
|
||||
style="width: 100%"
|
||||
:height="height"
|
||||
:checkbox-config="{ highlight: true }"
|
||||
:width-resize="true"
|
||||
>
|
||||
<ux-table-column
|
||||
v-for="field in fields"
|
||||
:key="field.fieldName"
|
||||
min-width="200px"
|
||||
:field="field.fieldName"
|
||||
:title="field.remarks"
|
||||
:resizable="true"
|
||||
/>
|
||||
</ux-grid>
|
||||
</div>
|
||||
<el-drawer
|
||||
:title="dialogTitle"
|
||||
:visible.sync="showVariableMgm"
|
||||
custom-class="user-drawer sql-dataset-drawer"
|
||||
size="840px"
|
||||
v-closePress
|
||||
direction="rtl"
|
||||
>
|
||||
<div class="content">
|
||||
<i class="el-icon-info"></i>
|
||||
{{ $t('dataset.sql_variable_limit_1') }}<br />
|
||||
{{ $t('dataset.sql_variable_limit_2') }}<br />
|
||||
</div>
|
||||
<el-table :data="variablesTmp">
|
||||
<el-table-column
|
||||
prop="variableName"
|
||||
:label="$t('panel.param_name')"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="200"
|
||||
:label="$t('deDataset.parameter_type')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-cascader
|
||||
v-model="scope.row.type"
|
||||
size="mini"
|
||||
class="select-type"
|
||||
:options="fieldOptions"
|
||||
@change="variableTypeChange(scope.row)"
|
||||
>
|
||||
</el-cascader>
|
||||
<span class="select-svg-icon">
|
||||
<svg-icon
|
||||
v-if="scope.row.type[0] === 'TEXT'"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="
|
||||
[
|
||||
'DATETIME-YEAR',
|
||||
'DATETIME-YEAR-MONTH',
|
||||
'DATETIME',
|
||||
'DATETIME-YEAR-MONTH-DAY'
|
||||
].includes(scope.row.type[0])
|
||||
"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="['LONG', 'DOUBLE'].includes(scope.row.type[0])"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="350"
|
||||
prop="defaultValue"
|
||||
:label="$t('commons.params_value')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
size="small"
|
||||
v-if="scope.row.type[0] === 'TEXT'"
|
||||
type="text"
|
||||
:placeholder="$t('fu.search_bar.please_input')"
|
||||
v-model="scope.row.defaultValue"
|
||||
/>
|
||||
<el-input
|
||||
size="small"
|
||||
v-if="
|
||||
scope.row.type[0] === 'LONG' ||
|
||||
scope.row.type[0] === 'DOUBLE'
|
||||
"
|
||||
:placeholder="$t('fu.search_bar.please_input')"
|
||||
type="number"
|
||||
v-model="scope.row.defaultValue"
|
||||
/>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME-YEAR'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="year"
|
||||
size="small"
|
||||
value-format="yyyy"
|
||||
:placeholder="$t('dataset.select_year')"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME-YEAR-MONTH'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="month"
|
||||
size="small"
|
||||
:format="scope.row.type[1]"
|
||||
:value-format="scope.row.type[1]"
|
||||
:placeholder="$t('dataset.select_month')"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME-YEAR-MONTH-DAY'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="date"
|
||||
size="small"
|
||||
:format="scope.row.type[1]"
|
||||
:value-format="scope.row.type[1]"
|
||||
:placeholder="$t('dataset.select_date')"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
<el-date-picker
|
||||
v-if="scope.row.type[0] === 'DATETIME'"
|
||||
v-model="scope.row.defaultValue"
|
||||
type="datetime"
|
||||
size="small"
|
||||
:format="scope.row.type[1]"
|
||||
:value-format="scope.row.type[1]"
|
||||
:placeholder="$t('dataset.select_time')"
|
||||
>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="de-foot">
|
||||
<deBtn secondary @click="closeVariableMgm">{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
<deBtn type="primary" @click="saveVariable()">{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,5 @@
|
||||
<template>
|
||||
<div class="dataset-union" @mouseup="mouseupDrag">
|
||||
<!-- <el-form :inline="true" style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<el-form-item class="form-item" :label="$t('commons.name')">
|
||||
<el-input v-model="name" size="mini" :placeholder="$t('commons.name')" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item">
|
||||
<el-button :disabled="dataset.length === 0" size="mini" @click="previewData">
|
||||
{{ $t('dataset.preview_result') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
<div :style="{ height: unionHeight + 'px' }" class="unio-editer-container">
|
||||
<!--添加第一个数据集按钮-->
|
||||
<div v-if="dataset.length === 0">
|
||||
@ -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) {
|
||||
|
@ -1,16 +1,5 @@
|
||||
<template>
|
||||
<div :style="{ height: maxHeight, overflow: 'auto' }">
|
||||
<!-- <el-row style="height: 26px;">-->
|
||||
<!-- <span style="line-height: 26px;">-->
|
||||
<!-- {{ $t('dataset.field_edit') }}-->
|
||||
<!-- <span>{{ param.name }}</span>-->
|
||||
<!-- </span>-->
|
||||
<!-- <el-row style="float: right">-->
|
||||
<!-- <el-button size="mini" @click="closeEdit">{{ $t('dataset.cancel') }}</el-button>-->
|
||||
<!-- <el-button type="primary" size="mini" @click="saveEdit">{{ $t('dataset.confirm') }}</el-button>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-divider />-->
|
||||
<el-row style="margin: 6px 0 16px 0">
|
||||
<el-col :span="12">
|
||||
<deBtn
|
||||
@ -187,7 +176,6 @@
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<!-- <span class="field-class">{{ $t("dataset.text") }}</span> -->
|
||||
</span>
|
||||
<span v-if="scope.row.deType === 1">
|
||||
<svg-icon
|
||||
@ -195,7 +183,6 @@
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<!-- <span class="field-class">{{ $t("dataset.time") }}</span> -->
|
||||
</span>
|
||||
<span v-if="scope.row.deType === 2 || scope.row.deType === 3">
|
||||
<svg-icon
|
||||
@ -203,12 +190,6 @@
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<!-- <span v-if="scope.row.deType === 2" class="field-class">{{
|
||||
$t("dataset.value")
|
||||
}}</span>
|
||||
<span v-if="scope.row.deType === 3" class="field-class">{{
|
||||
$t("dataset.value") + "(" + $t("dataset.float") + ")"
|
||||
}}</span> -->
|
||||
</span>
|
||||
<span v-if="scope.row.deType === 5">
|
||||
<svg-icon
|
||||
@ -216,7 +197,6 @@
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
<!-- <span class="field-class">{{ $t("dataset.location") }}</span> -->
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
@ -310,14 +290,6 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-radio-group v-model="scope.row.groupType" size="mini">-->
|
||||
<!-- <el-radio-button label="d">{{ $t('chart.dimension') }}</el-radio-button>-->
|
||||
<!-- <el-radio-button label="q">{{ $t('chart.quota') }}</el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column min-width="182" :label="$t('dataset.operator')">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -326,7 +298,7 @@
|
||||
style="margin-left: -4px"
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
@click="dqTrans(scope.row, 'd')"
|
||||
>{{ $t('convert_to_indicator') }}</el-button
|
||||
>{{ $t('deDataset.convert_to_indicator') }}</el-button
|
||||
>
|
||||
<template v-if="scope.row.extField !== 0">
|
||||
<el-button
|
||||
@ -522,7 +494,6 @@
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<!-- <span class="field-class">{{ $t("dataset.text") }}</span> -->
|
||||
</span>
|
||||
<span v-if="scope.row.deType === 1">
|
||||
<svg-icon
|
||||
@ -530,7 +501,6 @@
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<!-- <span class="field-class">{{ $t("dataset.time") }}</span> -->
|
||||
</span>
|
||||
<span v-if="scope.row.deType === 2 || scope.row.deType === 3">
|
||||
<svg-icon
|
||||
@ -538,12 +508,6 @@
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<!-- <span v-if="scope.row.deType === 2" class="field-class">{{
|
||||
$t("dataset.value")
|
||||
}}</span>
|
||||
<span v-if="scope.row.deType === 3" class="field-class">{{
|
||||
$t("dataset.value") + "(" + $t("dataset.float") + ")"
|
||||
}}</span> -->
|
||||
</span>
|
||||
<span v-if="scope.row.deType === 5">
|
||||
<svg-icon
|
||||
@ -551,7 +515,6 @@
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
<!-- <span class="field-class">{{ $t("dataset.location") }}</span> -->
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
@ -637,29 +600,6 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-radio-group v-model="scope.row.groupType" size="mini">-->
|
||||
<!-- <el-radio-button label="d">{{ $t('chart.dimension') }}</el-radio-button>-->
|
||||
<!-- <el-radio-button label="q">{{ $t('chart.quota') }}</el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column
|
||||
property="groupType"
|
||||
:label="$t('dataset.d_q_trans')"
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
icon="el-icon-sort"
|
||||
size="mini"
|
||||
circle
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
@click="dqTrans(scope.row, 'q')"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
min-width="182"
|
||||
property=""
|
||||
@ -734,7 +674,7 @@
|
||||
|
||||
<el-dialog
|
||||
:visible.sync="editCalcField"
|
||||
class="de-dialog-form"
|
||||
class="de-dialog-form de-center-dialog"
|
||||
width="980px"
|
||||
:title="
|
||||
currEditField.id
|
||||
@ -841,11 +781,6 @@ export default {
|
||||
})
|
||||
},
|
||||
saveEdit(item) {
|
||||
// const list = this.tableFields.dimensionListData.concat(this.tableFields.quotaListData)
|
||||
// batchEdit(list).then(response => {
|
||||
// // this.closeEdit()
|
||||
// this.initField()
|
||||
// })
|
||||
if (item.name && item.name.length > 50) {
|
||||
this.$message.error(this.$t('dataset.field_name_less_50'))
|
||||
return
|
||||
@ -1153,3 +1088,14 @@ span {
|
||||
border-bottom: 0 solid #e6ebf5 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.de-center-dialog {
|
||||
.el-dialog {
|
||||
margin: 0 !important;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -23,7 +23,7 @@
|
||||
</span>
|
||||
<span class="title-text" style="width: 100px"
|
||||
>{{ $t('deDataset.display') }} {{ form.row }}
|
||||
{{ $t('deDataset.that_s_ok') }}</span
|
||||
{{ $t('deDataset.row') }}</span
|
||||
>
|
||||
<el-popover
|
||||
popper-class="de-set-count de-card-dropdown"
|
||||
|
@ -185,15 +185,6 @@
|
||||
</grid-table>
|
||||
</div>
|
||||
|
||||
<!-- <el-row>
|
||||
<el-button v-if="hasDataPermission('manage',param.privileges) && enableUpdate" icon="el-icon-setting" size="mini" @click="showConfig">
|
||||
{{ $t('dataset.update_setting') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="refreshLog">
|
||||
{{ $t('commons.refresh') }}
|
||||
</el-button>
|
||||
</el-row> -->
|
||||
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="$t('dataset.detail')"
|
||||
@ -305,7 +296,7 @@
|
||||
</el-form-item>
|
||||
<div class="add-scope-cont" v-if="taskForm.type === 'add_scope'">
|
||||
<el-form-item
|
||||
prop="incrementalUpdateType"
|
||||
prop="type"
|
||||
:label="$t('dataset.incremental_update_type')"
|
||||
>
|
||||
<el-radio-group
|
||||
@ -451,13 +442,11 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div class="de-foot-layout">
|
||||
<!-- <div class="cont">
|
||||
<deBtn secondary @click="closeTask">{{ $t("dataset.cancel") }}</deBtn>
|
||||
<deBtn type="primary" @click="saveTask(taskForm)">{{
|
||||
$t("dataset.confirm")
|
||||
}}</deBtn>
|
||||
</div> -->
|
||||
<div class="de-foot">
|
||||
<deBtn secondary @click="closeTask">{{ $t('dataset.cancel') }}</deBtn>
|
||||
<deBtn type="primary" @click="saveTask(taskForm)">{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</el-col>
|
||||
@ -707,11 +696,7 @@ export default {
|
||||
showConfig() {
|
||||
this.userDrawer = true
|
||||
this.listTaskLog()
|
||||
// this.getIncrementalConfig()
|
||||
},
|
||||
// refreshLog() {
|
||||
// this.listTaskLog();
|
||||
// },
|
||||
showErrorMassage(massage) {
|
||||
this.show_error_massage = true
|
||||
this.error_massage = massage
|
||||
@ -857,47 +842,6 @@ export default {
|
||||
this.initSearch(false)
|
||||
})
|
||||
},
|
||||
// getIncrementalConfig() {
|
||||
// post("/dataset/table/incrementalConfig", { tableId: this.table.id }).then(
|
||||
// (response) => {
|
||||
// this.incrementalConfig = response.data;
|
||||
// if (
|
||||
// this.incrementalConfig.incrementalAdd.length === 0 &&
|
||||
// this.incrementalConfig.incrementalDelete.length === 0
|
||||
// ) {
|
||||
// this.incrementalUpdateType = "incrementalAdd";
|
||||
// this.sql = "";
|
||||
// return;
|
||||
// }
|
||||
// if (this.incrementalConfig.incrementalAdd.length > 0) {
|
||||
// this.incrementalUpdateType = "incrementalAdd";
|
||||
// this.sql = this.incrementalConfig.incrementalAdd;
|
||||
// } else {
|
||||
// this.incrementalUpdateType = "incrementalDelete";
|
||||
// this.sql = this.incrementalConfig.incrementalDelete;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
// },
|
||||
// saveIncrementalConfig() {
|
||||
// if (this.incrementalUpdateType === "incrementalAdd") {
|
||||
// this.incrementalConfig.incrementalAdd = this.sql;
|
||||
// } else {
|
||||
// this.incrementalConfig.incrementalDelete = this.sql;
|
||||
// }
|
||||
// this.incrementalConfig.tableId = this.table.id;
|
||||
// post(
|
||||
// "/dataset/table/save/incrementalConfig",
|
||||
// this.incrementalConfig
|
||||
// ).then((response) => {
|
||||
// this.$message({
|
||||
// message: this.$t("dataset.save_success"),
|
||||
// type: "success",
|
||||
// showClose: true,
|
||||
// });
|
||||
// this.update_setting = false;
|
||||
// });
|
||||
// },
|
||||
saveTask(task) {
|
||||
this.$refs.taskForm.validate((valid) => {
|
||||
if (valid) {
|
||||
@ -1203,7 +1147,7 @@ export default {
|
||||
|
||||
.codemirror-cont {
|
||||
box-sizing: border-box;
|
||||
width: 560px;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #bbbfc4;
|
||||
|
@ -102,8 +102,7 @@
|
||||
<el-tab-pane
|
||||
v-if="
|
||||
table.mode === 1 &&
|
||||
(table.type === 'excel' ||
|
||||
table.type === 'db' ||
|
||||
(table.type === 'db' ||
|
||||
table.type === 'sql' ||
|
||||
table.type === 'api')
|
||||
"
|
||||
|
@ -25,7 +25,7 @@
|
||||
class="table-num"
|
||||
v-if="['db', 'excel', 'api'].includes(datasetType)"
|
||||
>{{ $t('deDataset.selected') }} {{ tableNum }}
|
||||
{{ $t('deDataset.zhang_biao') }}</span
|
||||
{{ $t('deDataset.table') }}</span
|
||||
>
|
||||
<deBtn @click="datasetSave" type="primary">{{
|
||||
$t('commons.save')
|
||||
@ -173,6 +173,13 @@ export default {
|
||||
trigger: 'change'
|
||||
},
|
||||
{ required: true, trigger: 'blur', validator: this.nameValidator }
|
||||
],
|
||||
id: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('fu.search_bar.please_select'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -204,7 +211,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$router.back()
|
||||
this.$router.push('/dataset/index')
|
||||
},
|
||||
nameBlur() {
|
||||
this.nameExsitValidator()
|
||||
@ -340,7 +347,7 @@ export default {
|
||||
switchComponent(c) {
|
||||
let type = ''
|
||||
if (['db', 'excel', 'api'].includes(c)) {
|
||||
this.datasetFormRules = {}
|
||||
this.$delete(this.datasetFormRules, 'name')
|
||||
}
|
||||
switch (c) {
|
||||
case 'db':
|
||||
|
@ -72,7 +72,7 @@
|
||||
<div v-if="!tData.length" class="no-tdata">
|
||||
{{ $t('deDataset.no_dataset_click') }}
|
||||
<span @click="() => clickAdd()" class="no-tdata-new">{{
|
||||
$t('deDataset.newly_build')
|
||||
$t('deDataset.create')
|
||||
}}</span>
|
||||
</div>
|
||||
<el-tree
|
||||
@ -113,7 +113,6 @@
|
||||
class="child"
|
||||
>
|
||||
<span v-if="data.modelInnerType === 'group'" @click.stop>
|
||||
<!-- <el-dropdown trigger="click" size="small" @command="clickAdd"> -->
|
||||
<el-dropdown
|
||||
size="small"
|
||||
placement="bottom-start"
|
||||
@ -528,6 +527,9 @@ export default {
|
||||
this.$refs.datasetTreeRef.filter(this.filterText)
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
this.nodeClick(this.$refs.datasetTreeRef.getCurrentNode())
|
||||
},
|
||||
created() {
|
||||
this.kettleState()
|
||||
engineMode().then((res) => {
|
||||
|
@ -5,16 +5,15 @@
|
||||
<de-aside-container type="dataset">
|
||||
<group :save-status="saveStatus" @switchComponent="switchComponent" />
|
||||
</de-aside-container>
|
||||
|
||||
<de-main-container>
|
||||
<component
|
||||
:is="component"
|
||||
ref="dynamic_component"
|
||||
:param="param"
|
||||
@switchComponent="switchComponent"
|
||||
@saveSuccess="saveSuccess"
|
||||
/>
|
||||
</de-main-container>
|
||||
<de-main-container>
|
||||
<component
|
||||
:is="component"
|
||||
ref="dynamic_component"
|
||||
:param="param"
|
||||
@switchComponent="switchComponent"
|
||||
@saveSuccess="saveSuccess"
|
||||
/>
|
||||
</de-main-container>
|
||||
</de-container>
|
||||
</template>
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -47,7 +47,6 @@ import DsTree from "./DsTree";
|
||||
import DsForm from "./DsForm";
|
||||
import dsTable from "./dsTable";
|
||||
import DriverForm from "./DriverFormDetail";
|
||||
|
||||
export default {
|
||||
name: "DsMain",
|
||||
components: { DeMainContainer, DeAsideContainer, DsTree },
|
||||
@ -128,7 +127,6 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
|
||||
.el-empty {
|
||||
height: 100%;
|
||||
}
|
||||
@ -139,7 +137,6 @@ export default {
|
||||
min-width: 260px;
|
||||
max-width: 460px;
|
||||
}
|
||||
|
||||
.dsr-route-title {
|
||||
width: 100%;
|
||||
margin: -2px 0 22px 0;
|
||||
@ -147,7 +144,6 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.is-driver-mgm {
|
||||
background-color: var(--MainBG, #f5f6f7);
|
||||
padding: 24px;
|
||||
@ -155,7 +151,6 @@ export default {
|
||||
.ms-main-container {
|
||||
height: calc(100vh - 170px);
|
||||
background-color: var(--ContentBG, #ffffff);
|
||||
|
||||
.tree-style {
|
||||
padding-top: 24px;
|
||||
}
|
||||
@ -166,4 +161,4 @@ export default {
|
||||
padding: 24px 0 70px 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -246,7 +246,6 @@ import {
|
||||
import { ApplicationContext } from "@/utils/ApplicationContext";
|
||||
import deTextarea from "@/components/deCustomCm/deTextarea.vue";
|
||||
import msgCfm from "@/components/msgCfm";
|
||||
|
||||
export default {
|
||||
name: "DsTree",
|
||||
mixins: [msgCfm],
|
||||
@ -406,7 +405,6 @@ export default {
|
||||
}
|
||||
if (!(element.type in types)) {
|
||||
types[element.type] = [];
|
||||
// newArr.push(...element, ...{ children: types[element.type] })
|
||||
newArr.push({
|
||||
id: element.type,
|
||||
name: element.typeDesc,
|
||||
@ -415,7 +413,6 @@ export default {
|
||||
});
|
||||
}
|
||||
types[element.type].push(element);
|
||||
// newArr.children.push({ id: element.id, label: element.name })
|
||||
}
|
||||
return newArr;
|
||||
},
|
||||
@ -449,8 +446,8 @@ export default {
|
||||
},
|
||||
addDb({ type }) {
|
||||
this.$router.push({
|
||||
name: "datasource-form",
|
||||
params: { type },
|
||||
path: "/ds-form",
|
||||
query: { type },
|
||||
});
|
||||
},
|
||||
addFolderWithType(data) {
|
||||
@ -460,8 +457,8 @@ export default {
|
||||
this.editDriver = true;
|
||||
} else {
|
||||
this.$router.push({
|
||||
name: "datasource-form",
|
||||
params: { type: data.id },
|
||||
path: "/ds-form",
|
||||
query: { type: data.id },
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -547,10 +544,13 @@ export default {
|
||||
},
|
||||
switchMain(component, componentParam, tData, dsTypes) {
|
||||
if (component === "DsForm") {
|
||||
const { id, type, showModel } = componentParam;
|
||||
this.$router.push({
|
||||
name: "datasource-form",
|
||||
params: {
|
||||
...componentParam,
|
||||
path: "/ds-form",
|
||||
query: {
|
||||
id,
|
||||
type,
|
||||
showModel,
|
||||
msgNodeId: this.msgNodeId,
|
||||
},
|
||||
});
|
||||
@ -608,7 +608,6 @@ export default {
|
||||
.custom-tree-container {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@ -618,7 +617,6 @@ export default {
|
||||
padding-right: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.custom-tree-node-list {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@ -627,33 +625,27 @@ export default {
|
||||
font-size: 14px;
|
||||
padding: 0 8px;
|
||||
width: calc(100% - 40px);
|
||||
|
||||
.child {
|
||||
/*display: none;*/
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover .child {
|
||||
/*display: inline;*/
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-list ::v-deep .el-tree-node__expand-icon.is-leaf {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tree-style {
|
||||
padding: 16px 24px;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
.title-text {
|
||||
line-height: 26px;
|
||||
color: #1f2329;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.title-operate {
|
||||
text-align: right;
|
||||
i {
|
||||
@ -670,7 +662,6 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.db-card {
|
||||
height: 193px;
|
||||
width: 270px;
|
||||
@ -694,7 +685,6 @@ export default {
|
||||
padding: 8px 12px;
|
||||
border-top: 1px solid rgba(#1f2329, 0.15);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0px 6px 24px rgba(31, 35, 41, 0.08);
|
||||
}
|
||||
|
@ -211,13 +211,11 @@ export default {
|
||||
line-height: 24px;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
}
|
||||
|
||||
.table-container {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
|
||||
.el-table__fixed-right::before {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -4,10 +4,8 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
@ -200,6 +200,7 @@ export default {
|
||||
this.selectDatasets = [];
|
||||
this.datasetCahe = [];
|
||||
this.selectDatasetsCahe = [];
|
||||
this.$refs.datasetTreeRef.filter();
|
||||
this.$emit("search", [], []);
|
||||
},
|
||||
clearOneFilter(index) {
|
||||
@ -211,6 +212,9 @@ export default {
|
||||
} else {
|
||||
this[ele] = [];
|
||||
}
|
||||
if (ele === 'activeDataset') {
|
||||
this.$refs.datasetTreeRef.filter();
|
||||
}
|
||||
});
|
||||
},
|
||||
statusChange(value, type) {
|
||||
|
@ -42,7 +42,7 @@
|
||||
</el-form-item>
|
||||
<div class="add-scope-cont" v-if="taskForm.type === 'add_scope'">
|
||||
<el-form-item
|
||||
prop="incrementalUpdateType"
|
||||
prop="type"
|
||||
:label="$t('dataset.incremental_update_type')"
|
||||
>
|
||||
<el-radio-group
|
||||
@ -315,12 +315,6 @@ export default {
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
incrementalUpdateType: [
|
||||
{
|
||||
required: true,
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
cronEdit: false,
|
||||
sqlOption: {
|
||||
|
Loading…
Reference in New Issue
Block a user