mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 12:03:05 +08:00
Merge pull request #3238 from dataease/pr@dev_dataset_source
Pr@dev dataset source
This commit is contained in:
commit
d38e556671
@ -145,11 +145,12 @@ export function batchEdit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function post(url, data, showLoading = true, timeout = 60000) {
|
export function post(url, data, showLoading = true, timeout = 60000, hideMsg) {
|
||||||
return request({
|
return request({
|
||||||
url: url,
|
url: url,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
loading: showLoading,
|
loading: showLoading,
|
||||||
|
hideMsg,
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handlerConfirm(options,confirmButtonTextInfo) {
|
handlerConfirm(options,confirmButtonTextInfo) {
|
||||||
let { title, content, type = 'danger', cb, confirmButtonText = confirmButtonTextInfo?confirmButtonTextInfo:this.$t('commons.delete'), showCancelButton = true, cancelButtonText = this.$t("commons.cancel"), cancelCb = () => {} } = options;
|
let { title, content, type = 'danger', cb, confirmButtonText = confirmButtonTextInfo?confirmButtonTextInfo:this.$t('commons.delete'), showCancelButton = true, cancelButtonText = this.$t("commons.cancel"), cancelCb = () => {}, finallyCb = () => {} } = options;
|
||||||
let text = content ? `<span>${ this.$t(title) }</span><br><span class="use-html">${ this.$t(content) }</span>` : this.$t(title);
|
let text = content ? `<span>${ this.$t(title) }</span><br><span class="use-html">${ this.$t(content) }</span>` : this.$t(title);
|
||||||
const dangerouslyUseHTMLString = Boolean(content);
|
const dangerouslyUseHTMLString = Boolean(content);
|
||||||
let customClass = `de-confirm de-confirm-fail ${ dangerouslyUseHTMLString && 'de-use-html'}`
|
let customClass = `de-confirm de-confirm-fail ${ dangerouslyUseHTMLString && 'de-use-html'}`
|
||||||
@ -34,8 +34,11 @@ export default {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
cb();
|
cb();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((action) => {
|
||||||
cancelCb()
|
cancelCb(action)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
finallyCb()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,7 @@ export const $confirm = (message, callback, options = {}) => {
|
|||||||
const title = i18n.t('commons.message_box.confirm')
|
const title = i18n.t('commons.message_box.confirm')
|
||||||
MessageBox.confirm(message, title, defaultOptions).then(() => {
|
MessageBox.confirm(message, title, defaultOptions).then(() => {
|
||||||
callback()
|
callback()
|
||||||
})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const $success = (message, duration) => {
|
export const $success = (message, duration) => {
|
||||||
|
@ -116,7 +116,7 @@ service.interceptors.response.use(response => {
|
|||||||
msg = error.message
|
msg = error.message
|
||||||
}
|
}
|
||||||
!config.hideMsg && (!headers['authentication-status']) && $error(msg)
|
!config.hideMsg && (!headers['authentication-status']) && $error(msg)
|
||||||
return Promise.reject(error)
|
return Promise.reject(config.url === '/dataset/table/sqlPreview' ? msg : error)
|
||||||
})
|
})
|
||||||
const checkDownError = response => {
|
const checkDownError = response => {
|
||||||
if (response.request && response.request.responseType && response.request.responseType === 'blob' && response.headers && response.headers['de-down-error-msg']) {
|
if (response.request && response.request.responseType && response.request.responseType === 'blob' && response.headers && response.headers['de-down-error-msg']) {
|
||||||
|
@ -5,14 +5,16 @@
|
|||||||
</p>
|
</p>
|
||||||
<div v-show="showLeft" class="table-list">
|
<div v-show="showLeft" class="table-list">
|
||||||
<p class="select-ds">
|
<p class="select-ds">
|
||||||
<span>{{ $t('deDataset.select_data_table ') }}
|
<span
|
||||||
|
>{{ $t('deDataset.select_data_table ') }}
|
||||||
<el-tooltip class="item" effect="dark" placement="right">
|
<el-tooltip class="item" effect="dark" placement="right">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
{{ $t('dataset.excel_info_1') }}<br>
|
{{ $t('dataset.excel_info_1') }}<br />
|
||||||
{{ $t('dataset.excel_info_2') }}<br>
|
{{ $t('dataset.excel_info_2') }}<br />
|
||||||
{{ $t('dataset.excel_info_3') }}
|
{{ $t('dataset.excel_info_3') }}
|
||||||
</div>
|
</div>
|
||||||
<i class="el-icon-warning-outline" /> </el-tooltip></span>
|
<i class="el-icon-warning-outline" /> </el-tooltip
|
||||||
|
></span>
|
||||||
<i class="el-icon-d-arrow-left" @click="showLeft = false" />
|
<i class="el-icon-d-arrow-left" @click="showLeft = false" />
|
||||||
</p>
|
</p>
|
||||||
<el-upload
|
<el-upload
|
||||||
@ -34,7 +36,7 @@
|
|||||||
:loading="uploading"
|
:loading="uploading"
|
||||||
secondary
|
secondary
|
||||||
:disabled="uploading"
|
:disabled="uploading"
|
||||||
>{{ $t('deDataset.upload_data') }}
|
>{{ $t('deDataset.upload_data') }}
|
||||||
</deBtn>
|
</deBtn>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div class="table-checkbox-list">
|
<div class="table-checkbox-list">
|
||||||
@ -53,7 +55,10 @@
|
|||||||
>
|
>
|
||||||
<span slot-scope="{ data }" class="custom-tree-node">
|
<span slot-scope="{ data }" class="custom-tree-node">
|
||||||
{{ data.excelLable }}
|
{{ data.excelLable }}
|
||||||
<span v-if="data.nameExsit && !param.tableId" class="error-name-exsit">
|
<span
|
||||||
|
v-if="data.nameExsit && !param.tableId"
|
||||||
|
class="error-name-exsit"
|
||||||
|
>
|
||||||
<svg-icon icon-class="exclamationmark" class="ds-icon-scene" />
|
<svg-icon icon-class="exclamationmark" class="ds-icon-scene" />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -118,24 +123,20 @@
|
|||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="field.fieldType === 'TEXT'"
|
v-if="field.fieldType === 'TEXT'"
|
||||||
icon-class="field_text"
|
icon-class="field_text"
|
||||||
class="field-icon-text"
|
class="field-icon-text" />
|
||||||
/>
|
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="field.fieldType === 'DATETIME'"
|
v-if="field.fieldType === 'DATETIME'"
|
||||||
icon-class="field_time"
|
icon-class="field_time"
|
||||||
class="field-icon-time"
|
class="field-icon-time" />
|
||||||
/>
|
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="
|
v-if="
|
||||||
field.fieldType === 'LONG' ||
|
field.fieldType === 'LONG' ||
|
||||||
field.fieldType === 'DOUBLE'
|
field.fieldType === 'DOUBLE'
|
||||||
"
|
"
|
||||||
icon-class="field_value"
|
icon-class="field_value"
|
||||||
class="field-icon-value"
|
class="field-icon-value" />
|
||||||
/>
|
<i class="el-icon-arrow-down el-icon--right"
|
||||||
<i
|
/></span>
|
||||||
class="el-icon-arrow-down el-icon--right"
|
|
||||||
/></span>
|
|
||||||
<el-dropdown-menu
|
<el-dropdown-menu
|
||||||
slot="dropdown"
|
slot="dropdown"
|
||||||
style="width: 178px"
|
style="width: 178px"
|
||||||
@ -145,32 +146,34 @@
|
|||||||
v-for="item in fieldOptions"
|
v-for="item in fieldOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:command="item.value"
|
:command="item.value"
|
||||||
><span>
|
><span>
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="item.value === 'TEXT'"
|
v-if="item.value === 'TEXT'"
|
||||||
icon-class="field_text"
|
icon-class="field_text"
|
||||||
class="field-icon-text"
|
class="field-icon-text"
|
||||||
/>
|
/>
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="item.value === 'DATETIME'"
|
v-if="item.value === 'DATETIME'"
|
||||||
icon-class="field_time"
|
icon-class="field_time"
|
||||||
class="field-icon-time"
|
class="field-icon-time"
|
||||||
/>
|
/>
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="
|
v-if="
|
||||||
item.value === 'LONG' || item.value === 'DOUBLE'
|
item.value === 'LONG' || item.value === 'DOUBLE'
|
||||||
"
|
"
|
||||||
icon-class="field_value"
|
icon-class="field_value"
|
||||||
class="field-icon-value"
|
class="field-icon-value"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
style="
|
style="
|
||||||
color: #8492a6;
|
color: #8492a6;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
"
|
"
|
||||||
>{{ item.label }}</span></el-dropdown-item>
|
>{{ item.label }}</span
|
||||||
|
></el-dropdown-item
|
||||||
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<span style="font-size: 14px; margin-left: 10px">
|
<span style="font-size: 14px; margin-left: 10px">
|
||||||
@ -219,7 +222,7 @@ export default {
|
|||||||
originName: {
|
originName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -292,9 +295,7 @@ export default {
|
|||||||
this.defaultCheckedKeys.splice(index, 1)
|
this.defaultCheckedKeys.splice(index, 1)
|
||||||
}
|
}
|
||||||
this.validateName()
|
this.validateName()
|
||||||
const labelList = this.$refs.tree
|
const labelList = this.$refs.tree.getCheckedNodes().map((ele) => ele.id)
|
||||||
.getCheckedNodes()
|
|
||||||
.map((ele) => ele.id)
|
|
||||||
const excelList = this.excelData.map((ele) => ele.id)
|
const excelList = this.excelData.map((ele) => ele.id)
|
||||||
this.$emit(
|
this.$emit(
|
||||||
'setTableNum',
|
'setTableNum',
|
||||||
@ -351,7 +352,7 @@ export default {
|
|||||||
},
|
},
|
||||||
calHeight() {
|
calHeight() {
|
||||||
const that = this
|
const that = this
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
const currentHeight = document.documentElement.clientHeight
|
const currentHeight = document.documentElement.clientHeight
|
||||||
that.height = currentHeight - 56 - 30 - 26 - 25 - 35 - 10 - 37 - 20 - 10
|
that.height = currentHeight - 56 - 30 - 26 - 25 - 35 - 10 - 37 - 20 - 10
|
||||||
}, 10)
|
}, 10)
|
||||||
@ -478,14 +479,15 @@ export default {
|
|||||||
this.param.tableId &&
|
this.param.tableId &&
|
||||||
(effectExtField || changeFiled)
|
(effectExtField || changeFiled)
|
||||||
) {
|
) {
|
||||||
var msg = effectExtField
|
const options = {
|
||||||
? i18n.t('dataset.task.effect_ext_field') +
|
title: 'deDataset.replace_the_data',
|
||||||
', ' +
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
i18n.t('dataset.task.excel_replace_msg')
|
content:
|
||||||
: i18n.t('dataset.task.excel_replace_msg')
|
'替换可能会影响自定义数据集、关联数据集、仪表板等,是否替换?',
|
||||||
$confirm(msg, () => {
|
type: 'primary',
|
||||||
this.saveExcelData(sheetFileMd5, table)
|
cb: () => this.saveExcelData(sheetFileMd5, table)
|
||||||
})
|
}
|
||||||
|
this.handlerConfirm(options)
|
||||||
} else {
|
} else {
|
||||||
this.saveExcelData(sheetFileMd5, table)
|
this.saveExcelData(sheetFileMd5, table)
|
||||||
}
|
}
|
||||||
@ -495,25 +497,23 @@ export default {
|
|||||||
new Set(sheetFileMd5).size !== sheetFileMd5.length &&
|
new Set(sheetFileMd5).size !== sheetFileMd5.length &&
|
||||||
!this.param.tableId
|
!this.param.tableId
|
||||||
) {
|
) {
|
||||||
this.$confirm(
|
const options = {
|
||||||
this.$t('dataset.task.excel_replace_msg'),
|
title: 'dataset.merge_title',
|
||||||
this.$t('dataset.merge_title'),
|
content: 'dataset.task.excel_replace_msg',
|
||||||
{
|
confirmButtonText: this.$t('dataset.merge'),
|
||||||
distinguishCancelAndClose: true,
|
cancelButtonText: this.$t('dataset.no_merge'),
|
||||||
confirmButtonText: this.$t('dataset.merge'),
|
type: 'primary',
|
||||||
cancelButtonText: this.$t('dataset.no_merge'),
|
cb: () => {
|
||||||
type: 'info'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(() => {
|
|
||||||
table.mergeSheet = true
|
table.mergeSheet = true
|
||||||
this.loading = true
|
this.loading = true
|
||||||
post('/dataset/table/update', table).then((response) => {
|
post('/dataset/table/update', table).then((response) => {
|
||||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||||
this.cancel(response.data)
|
this.cancel(response.data)
|
||||||
})
|
}).finally(() => {
|
||||||
})
|
this.loading = false
|
||||||
.catch((action) => {
|
})
|
||||||
|
},
|
||||||
|
cancelCb: (action) => {
|
||||||
if (action === 'close') {
|
if (action === 'close') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -527,10 +527,9 @@ export default {
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
.finally(() => {
|
}
|
||||||
this.loading = false
|
this.handlerConfirm(options)
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
post('/dataset/table/update', table)
|
post('/dataset/table/update', table)
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
:image-size="60"
|
:image-size="60"
|
||||||
:image="errImg"
|
:image="errImg"
|
||||||
:description="$t('deDataset.run_failed')"
|
:description="$t('deDataset.run_failed')"
|
||||||
/>
|
>{{ errMsgCont }}</el-empty>
|
||||||
<ux-grid
|
<ux-grid
|
||||||
v-else
|
v-else
|
||||||
ref="plxTable"
|
ref="plxTable"
|
||||||
@ -386,6 +386,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
fieldData: [],
|
fieldData: [],
|
||||||
errMsg: false,
|
errMsg: false,
|
||||||
|
errMsgCont: '',
|
||||||
options: [],
|
options: [],
|
||||||
sql: '',
|
sql: '',
|
||||||
dataReference: false,
|
dataReference: false,
|
||||||
@ -601,6 +602,7 @@ export default {
|
|||||||
|
|
||||||
getSQLPreview() {
|
getSQLPreview() {
|
||||||
this.errMsg = false
|
this.errMsg = false
|
||||||
|
this.errMsgCont = ''
|
||||||
this.initFlag = false
|
this.initFlag = false
|
||||||
if (!this.dataSource || this.datasource === '') {
|
if (!this.dataSource || this.datasource === '') {
|
||||||
this.openMessageSuccess('dataset.pls_slc_data_source', 'error')
|
this.openMessageSuccess('dataset.pls_slc_data_source', 'error')
|
||||||
@ -608,7 +610,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.parseVariable()
|
this.parseVariable()
|
||||||
this.fields = []
|
this.fields = []
|
||||||
this.$refs.plxTable.reloadData([])
|
this.$refs.plxTable?.reloadData([])
|
||||||
post('/dataset/table/sqlPreview', {
|
post('/dataset/table/sqlPreview', {
|
||||||
dataSourceId: this.dataSource,
|
dataSourceId: this.dataSource,
|
||||||
type: 'sql',
|
type: 'sql',
|
||||||
@ -617,7 +619,7 @@ export default {
|
|||||||
sql: Base64.encode(this.sql.trim()),
|
sql: Base64.encode(this.sql.trim()),
|
||||||
isBase64Encryption: true
|
isBase64Encryption: true
|
||||||
})
|
})
|
||||||
})
|
}, true, 60000, true)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.fields = response.data.fields
|
this.fields = response.data.fields
|
||||||
this.data = response.data.data
|
this.data = response.data.data
|
||||||
@ -626,7 +628,8 @@ export default {
|
|||||||
this.$refs.plxTable?.reloadData(datas)
|
this.$refs.plxTable?.reloadData(datas)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err, msg) => {
|
||||||
|
this.errMsgCont = err
|
||||||
this.errMsg = true
|
this.errMsg = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -40,8 +40,20 @@
|
|||||||
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
||||||
}}</span>
|
}}</span>
|
||||||
<span @mousedown="mousedownDrag" class="drag"></span>
|
<span @mousedown="mousedownDrag" class="drag"></span>
|
||||||
|
<el-button
|
||||||
|
class="de-text-btn posi-right"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="previewData"
|
||||||
|
>
|
||||||
|
{{ $t('deDataset.data_preview') }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<union-preview :unionHeight="unionHeight" :table="previewTable" :dataset="dataset" />
|
<union-preview
|
||||||
|
:unionHeight="unionHeight"
|
||||||
|
:table="previewTable"
|
||||||
|
:dataset="dataset"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!--选择数据集-->
|
<!--选择数据集-->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
@ -108,9 +120,10 @@ import UnionEdit from '@/views/dataset/add/union/UnionEdit'
|
|||||||
import { post } from '@/api/dataset/dataset'
|
import { post } from '@/api/dataset/dataset'
|
||||||
import UnionPreview from '@/views/dataset/add/union/UnionPreview'
|
import UnionPreview from '@/views/dataset/add/union/UnionPreview'
|
||||||
import cancelMix from './cancelMix'
|
import cancelMix from './cancelMix'
|
||||||
|
import msgCfm from '@/components/msgCfm/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AddUnion',
|
name: 'AddUnion',
|
||||||
mixins: [cancelMix],
|
mixins: [cancelMix, msgCfm],
|
||||||
components: {
|
components: {
|
||||||
UnionPreview,
|
UnionPreview,
|
||||||
UnionEdit,
|
UnionEdit,
|
||||||
@ -216,7 +229,7 @@ export default {
|
|||||||
this.openMessageSuccess('dataset.char_can_not_more_50', 'error')
|
this.openMessageSuccess('dataset.char_can_not_more_50', 'error')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
const table = {
|
const table = {
|
||||||
id: this.param.tableId,
|
id: this.param.tableId,
|
||||||
name: this.param.name,
|
name: this.param.name,
|
||||||
@ -226,12 +239,14 @@ export default {
|
|||||||
mode: this.dataset[0].currentDs.mode,
|
mode: this.dataset[0].currentDs.mode,
|
||||||
info: '{"union":' + JSON.stringify(this.dataset) + '}'
|
info: '{"union":' + JSON.stringify(this.dataset) + '}'
|
||||||
}
|
}
|
||||||
post('/dataset/table/update', table).then((response) => {
|
post('/dataset/table/update', table)
|
||||||
this.$emit('saveSuccess', table)
|
.then((response) => {
|
||||||
this.cancel(response.data)
|
this.$emit('saveSuccess', table)
|
||||||
}).finally(() => {
|
this.cancel(response.data)
|
||||||
this.loading = false;
|
})
|
||||||
})
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
selectDs() {
|
selectDs() {
|
||||||
this.selectDsDialog = true
|
this.selectDsDialog = true
|
||||||
@ -367,7 +382,7 @@ export default {
|
|||||||
.unio-editer-container {
|
.unio-editer-container {
|
||||||
min-height: 298px;
|
min-height: 298px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #F5F6F7;
|
background: #f5f6f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-container {
|
.preview-container {
|
||||||
@ -382,12 +397,20 @@ export default {
|
|||||||
height: 54px;
|
height: 54px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: var(--deTextPrimary, #1f2329);
|
color: var(--deTextPrimary, #1f2329);
|
||||||
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
|
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
|
||||||
|
|
||||||
|
.posi-right {
|
||||||
|
position: absolute;
|
||||||
|
right: 24px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
.result-num {
|
.result-num {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: var(--deTextSecondary, #646a73);
|
color: var(--deTextSecondary, #646a73);
|
||||||
|
@ -49,19 +49,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
|
||||||
prop="lastExecTime"
|
|
||||||
key="lastExecTime"
|
|
||||||
min-width="178"
|
|
||||||
:label="$t('dataset.task.last_exec_time')"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>
|
|
||||||
{{ scope.row.lastExecTime | timestampFormatDate }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="lastExecStatus"
|
prop="lastExecStatus"
|
||||||
key="lastExecStatus"
|
key="lastExecStatus"
|
||||||
@ -80,6 +67,19 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="lastExecTime"
|
||||||
|
key="lastExecTime"
|
||||||
|
min-width="178"
|
||||||
|
:label="$t('dataset.task.last_exec_time')"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>
|
||||||
|
{{ scope.row.lastExecTime | timestampFormatDate }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="nextExecTime"
|
prop="nextExecTime"
|
||||||
key="nextExecTime"
|
key="nextExecTime"
|
||||||
@ -269,7 +269,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="taskForm.name"
|
v-model="taskForm.name"
|
||||||
size="small"
|
size="small"
|
||||||
:placeholder="$t('dataset.task_name')"
|
:placeholder="$t('fu.search_bar.please_input') + $t('dataset.task_name')"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('dataset.update_type')" prop="type">
|
<el-form-item :label="$t('dataset.update_type')" prop="type">
|
||||||
@ -280,7 +280,7 @@
|
|||||||
>
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="add-scope-cont" v-if="taskForm.type === 'add_scope'">
|
<div class="add-scope-cont" v-if="taskForm.type === 'add_scope' && table.type !== 'api'">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
prop="type"
|
prop="type"
|
||||||
:label="$t('dataset.incremental_update_type')"
|
:label="$t('dataset.incremental_update_type')"
|
||||||
@ -542,7 +542,7 @@ export default {
|
|||||||
startTime: [
|
startTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: this.$t('dataset.required'),
|
message: this.$t('components.time_is_required'),
|
||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="de-dataset-form">
|
<div class="de-dataset-form">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<span class="name">
|
<span class="name">
|
||||||
<i @click="back" class="el-icon-arrow-left"></i>
|
<i @click="logOutTips" class="el-icon-arrow-left"></i>
|
||||||
<svg-icon
|
<svg-icon
|
||||||
style="margin: 0 9.5px 0 16.2px"
|
style="margin: 0 9.5px 0 16.2px"
|
||||||
:icon-class="`de-${datasetType}-new`"
|
:icon-class="`de-${datasetType}-new`"
|
||||||
@ -53,9 +53,11 @@ import AddExcel from './add/AddExcel'
|
|||||||
import AddUnion from '@/views/dataset/add/AddUnion'
|
import AddUnion from '@/views/dataset/add/AddUnion'
|
||||||
import { post } from '@/api/dataset/dataset'
|
import { post } from '@/api/dataset/dataset'
|
||||||
import { datasetTypeMap } from './group/options'
|
import { datasetTypeMap } from './group/options'
|
||||||
|
import msgCfm from '@/components/msgCfm/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'DatasetForm',
|
name: 'DatasetForm',
|
||||||
components: { AddDB, AddSQL, AddExcel, AddApi, AddUnion },
|
components: { AddDB, AddSQL, AddExcel, AddApi, AddUnion },
|
||||||
|
mixins: [msgCfm],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
originName: '',
|
originName: '',
|
||||||
@ -132,6 +134,18 @@ export default {
|
|||||||
back() {
|
back() {
|
||||||
this.$router.push('/dataset/index')
|
this.$router.push('/dataset/index')
|
||||||
},
|
},
|
||||||
|
logOutTips() {
|
||||||
|
const options = {
|
||||||
|
title: 'role.tips',
|
||||||
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
|
content: 'system_parameter_setting.sure_to_exit',
|
||||||
|
type: 'primary',
|
||||||
|
cb: () => {
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.handlerConfirm(options)
|
||||||
|
},
|
||||||
nameBlur() {
|
nameBlur() {
|
||||||
this.nameExsitValidator()
|
this.nameExsitValidator()
|
||||||
this.showInput = this.nameExsit
|
this.showInput = this.nameExsit
|
||||||
|
@ -562,6 +562,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
const currentNodeId = sessionStorage.getItem('dataset-current-node')
|
const currentNodeId = sessionStorage.getItem('dataset-current-node')
|
||||||
if (currentNodeId) {
|
if (currentNodeId) {
|
||||||
|
sessionStorage.setItem('dataset-current-node', '')
|
||||||
this.dfsTableData(this.tData, currentNodeId)
|
this.dfsTableData(this.tData, currentNodeId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@
|
|||||||
"
|
"
|
||||||
:label="$t('datasource.extra_params')"
|
:label="$t('datasource.extra_params')"
|
||||||
>
|
>
|
||||||
<el-input v-model="form.configuration.extraParams" autocomplete="off" />
|
<el-input :placeholder="$t('fu.search_bar.please_input') + $t('datasource.extra_params')" v-model="form.configuration.extraParams" autocomplete="off" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -495,7 +495,7 @@
|
|||||||
<div class="row-rules">
|
<div class="row-rules">
|
||||||
<span>{{ $t('datasource.column_info') }}</span>
|
<span>{{ $t('datasource.column_info') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-container">
|
<div class="table-container de-svg-in-table">
|
||||||
<el-table
|
<el-table
|
||||||
ref="apiItemTable"
|
ref="apiItemTable"
|
||||||
:data="apiItem.jsonFields"
|
:data="apiItem.jsonFields"
|
||||||
@ -525,7 +525,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.name"
|
v-model="scope.row.name"
|
||||||
:disabled="scope.row.children"
|
:disabled="scope.row.children"
|
||||||
size="mini"
|
size="small"
|
||||||
type="text"
|
type="text"
|
||||||
@change="fieldNameChange(scope.row)"
|
@change="fieldNameChange(scope.row)"
|
||||||
/>
|
/>
|
||||||
@ -540,7 +540,8 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="scope.row.deExtractType"
|
v-model="scope.row.deExtractType"
|
||||||
:disabled="scope.row.children"
|
:disabled="scope.row.children"
|
||||||
size="mini"
|
size="small"
|
||||||
|
class="select-type"
|
||||||
style="display: inline-block; width: 120px"
|
style="display: inline-block; width: 120px"
|
||||||
@change="fieldTypeChange(scope.row)"
|
@change="fieldTypeChange(scope.row)"
|
||||||
>
|
>
|
||||||
@ -567,6 +568,20 @@
|
|||||||
>{{ item.label }}</span>
|
>{{ item.label }}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<span class="select-svg-icon">
|
||||||
|
<span v-if="scope.row.deType === 0">
|
||||||
|
<svg-icon
|
||||||
|
icon-class="field_text"
|
||||||
|
class="field-icon-text"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span v-if="[ 2, 3 ].includes(scope.row.deType)">
|
||||||
|
<svg-icon
|
||||||
|
icon-class="field_value"
|
||||||
|
class="field-icon-value"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -712,7 +727,7 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: i18n.t('datasource.input_name'),
|
validator: this.nameRepeat,
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -955,6 +970,22 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
nameRepeat(rule, value, callback) {
|
||||||
|
let hasRepeatName = false
|
||||||
|
this.form.apiConfiguration.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.name === this.apiItem.name &&
|
||||||
|
item.serialNumber !== this.apiItem.serialNumber
|
||||||
|
) {
|
||||||
|
hasRepeatName = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (hasRepeatName) {
|
||||||
|
callback(new Error(i18n.t('theme.name_repeat')));
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
},
|
||||||
next() {
|
next() {
|
||||||
if (this.active === 1) {
|
if (this.active === 1) {
|
||||||
let hasRepeatName = false
|
let hasRepeatName = false
|
||||||
@ -1504,4 +1535,23 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.de-svg-in-table {
|
||||||
|
.select-type {
|
||||||
|
width: 180px;
|
||||||
|
::v-deep.el-input__inner {
|
||||||
|
padding-left: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.select-svg-icon {
|
||||||
|
position: absolute;
|
||||||
|
left: 24px;
|
||||||
|
top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.el-table__expand-icon {
|
||||||
|
.el-icon-arrow-right::before {
|
||||||
|
content: "\E791" !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="de-ds-form" v-loading="formLoading">
|
<div class="de-ds-form" v-loading="formLoading">
|
||||||
<div class="de-ds-top">
|
<div class="de-ds-top">
|
||||||
<span class="name">
|
<span class="name">
|
||||||
<i @click="backToList" class="el-icon-arrow-left"></i>
|
<i @click="logOutTips" class="el-icon-arrow-left"></i>
|
||||||
{{
|
{{
|
||||||
params &&
|
params &&
|
||||||
params.id &&
|
params.id &&
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="apply">
|
<div class="apply">
|
||||||
<template v-if="canEdit">
|
<template v-if="canEdit">
|
||||||
<deBtn secondary @click="backToList"
|
<deBtn secondary @click="logOutTips"
|
||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</deBtn>
|
</deBtn>
|
||||||
<deBtn
|
<deBtn
|
||||||
@ -189,7 +189,7 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: i18n.t('datasource.input_name'),
|
validator: this.nameRepeat,
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -834,6 +834,18 @@ export default {
|
|||||||
backToList() {
|
backToList() {
|
||||||
this.$router.push('/datasource/index')
|
this.$router.push('/datasource/index')
|
||||||
},
|
},
|
||||||
|
logOutTips() {
|
||||||
|
const options = {
|
||||||
|
title: 'role.tips',
|
||||||
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
|
content: 'system_parameter_setting.sure_to_exit',
|
||||||
|
type: 'primary',
|
||||||
|
cb: () => {
|
||||||
|
this.backToList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.handlerConfirm(options)
|
||||||
|
},
|
||||||
refreshType(form) {
|
refreshType(form) {
|
||||||
this.$emit('refresh-type', form)
|
this.$emit('refresh-type', form)
|
||||||
},
|
},
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
@click.native="selectDataset"
|
@click.native="selectDataset"
|
||||||
:label="$t('chart.select_dataset')"
|
:label="$t('chart.select_dataset')"
|
||||||
prop="datasetName"
|
prop="datasetName"
|
||||||
|
:disabled="taskForm.id"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="taskForm.datasetName"
|
v-model="taskForm.datasetName"
|
||||||
|
Loading…
Reference in New Issue
Block a user