Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong 2022-10-20 17:37:31 +08:00
commit ef4d09f740
18 changed files with 143 additions and 272 deletions

View File

@ -153,14 +153,13 @@
<div class="dataset">
<span class="name">{{ $t('dataset.name') }}</span>
<el-input
v-if="activeIndex !== -1"
v-model="tableData[activeIndex].datasetName"
v-model="activeTable.datasetName"
size="small"
clearable
@change="validateName"
/>
<div
v-if="tableData[activeIndex].nameExsit"
v-if="activeTable.nameExsit"
style="left: 107px; top: 52px"
class="el-form-item__error"
>
@ -257,15 +256,13 @@ export default {
avilibelTable: false,
noAvilibelTableImg: require('@/assets/None.png'),
noSelectTable: require('@/assets/None_Select_ds.png'),
activeTable: {},
activeName: ''
}
},
computed: {
activeIndex() {
return this.tableData.findIndex((ele) => ele.name === this.activeName)
},
checkDatasetName() {
return this.tableData
return this.tables
.filter((ele, index) => {
return this.checkTableList.includes(ele.name)
})
@ -285,11 +282,11 @@ export default {
const dsName = this.options.find((ele) => ele.id === val).name
post('/datasource/getTables/' + val, {}).then((response) => {
this.tables = response.data
this.tableData = JSON.parse(JSON.stringify(this.tables))
this.tableData.forEach((ele) => {
this.tables.forEach((ele) => {
this.$set(ele, 'datasetName', dsName + '_' + ele.name)
this.$set(ele, 'nameExsit', false)
})
this.tableData = [...this.tables]
this.avilibelTable = !this.tableData.some((ele) => ele.enableCheck)
}).finally(() => {
this.dsLoading = false
@ -302,18 +299,15 @@ export default {
}
},
searchTable(val) {
this.activeName = ''
if (val && val !== '') {
this.tableData = JSON.parse(
JSON.stringify(
this.tables.filter((ele) => {
return ele.name
.toLocaleLowerCase()
.includes(val.toLocaleLowerCase())
})
)
)
this.tableData = [...this.tables.filter((ele) => {
return ele.name
.toLocaleLowerCase()
.includes(val.toLocaleLowerCase())
})]
} else {
this.tableData = JSON.parse(JSON.stringify(this.tables))
this.tableData = [...this.tables]
}
}
},
@ -355,17 +349,17 @@ export default {
}
this.LeftWidth = e.pageX
},
nameExsitValidator(activeIndex) {
this.tableData[activeIndex].nameExsit =
nameExsitValidator(ele) {
ele.nameExsit =
this.nameList
.concat(this.checkDatasetName)
.filter((name) => name === this.tableData[activeIndex].datasetName)
.filter((name) => name === ele.datasetName)
.length > 1
},
validateName() {
this.tableData.forEach((ele, index) => {
if (this.checkDatasetName.includes(ele.datasetName)) {
this.nameExsitValidator(index)
this.tables.forEach((ele, index) => {
if (this.checkTableList.includes(ele.name)) {
this.nameExsitValidator(ele)
} else {
ele.nameExsit = false
}
@ -381,6 +375,7 @@ export default {
setActiveName({ name, datasourceId, enableCheck }) {
if (!enableCheck) return
this.activeName = name
this.activeTable = this.tableData.find((ele) => ele.name === this.activeName) || {}
this.dbPreview({
dataSourceId: datasourceId,
info: JSON.stringify({ table: name })
@ -428,7 +423,7 @@ export default {
const mode = this.mode
const syncType = this.syncType
this.checkTableList.forEach((name) => {
const datasetName = this.tableData.find(
const datasetName = this.tables.find(
(ele) => ele.name === name
).datasetName
tables.push({
@ -449,13 +444,6 @@ export default {
.finally(() => {
this.loading = false
})
},
dataReset() {
this.searchTable = ''
this.options = []
this.dataSource = ''
this.tables = []
this.checkTableList = []
}
}
}

View File

@ -160,14 +160,13 @@
<div class="dataset">
<span class="name">{{ $t('dataset.name') }}</span>
<el-input
v-if="activeIndex !== -1"
v-model="tableData[activeIndex].datasetName"
v-model="activeTable.datasetName"
size="small"
clearable
@change="validateName"
/>
<div
v-if="tableData[activeIndex].nameExsit"
v-if="activeTable.nameExsit"
style="left: 107px; top: 52px"
class="el-form-item__error"
>
@ -263,15 +262,13 @@ export default {
avilibelTable: false,
noAvilibelTableImg: require('@/assets/None.png'),
noSelectTable: require('@/assets/None_Select_ds.png'),
activeTable: {},
activeName: ''
}
},
computed: {
activeIndex() {
return this.tableData.findIndex((ele) => ele.name === this.activeName)
},
checkDatasetName() {
return this.tableData
return this.tables
.filter((ele, index) => {
return this.checkTableList.includes(ele.name)
})
@ -288,14 +285,15 @@ export default {
this.dsLoading = true
this.checkTableList = []
this.activeName = ''
this.activeTable = {}
const dsName = this.options.find((ele) => ele.id === val).name
post('/datasource/getTables/' + val, {}).then((response) => {
this.tables = response.data
this.tableData = JSON.parse(JSON.stringify(this.tables))
this.tableData.forEach((ele) => {
this.tables.forEach((ele) => {
this.$set(ele, 'datasetName', dsName + '_' + ele.name)
this.$set(ele, 'nameExsit', false)
})
this.tableData = [...this.tables]
this.avilibelTable = !this.tableData.some((ele) => ele.enableCheck)
}).finally(() => {
this.dsLoading = false
@ -318,18 +316,15 @@ export default {
}
},
searchTable(val) {
this.activeName = ''
if (val && val !== '') {
this.tableData = JSON.parse(
JSON.stringify(
this.tables.filter((ele) => {
return ele.name
.toLocaleLowerCase()
.includes(val.toLocaleLowerCase())
})
)
)
this.tableData = [...this.tables.filter((ele) => {
return ele.name
.toLocaleLowerCase()
.includes(val.toLocaleLowerCase())
})]
} else {
this.tableData = JSON.parse(JSON.stringify(this.tables))
this.tableData = [...this.tables]
}
}
},
@ -371,17 +366,17 @@ export default {
}
this.LeftWidth = e.pageX
},
nameExsitValidator(activeIndex) {
this.tableData[activeIndex].nameExsit =
nameExsitValidator(ele) {
ele.nameExsit =
this.nameList
.concat(this.checkDatasetName)
.filter((name) => name === this.tableData[activeIndex].datasetName)
.filter((name) => name === ele.datasetName)
.length > 1
},
validateName() {
this.tableData.forEach((ele, index) => {
if (this.checkDatasetName.includes(ele.datasetName)) {
this.nameExsitValidator(index)
this.tables.forEach((ele, index) => {
if (this.checkTableList.includes(ele.name)) {
this.nameExsitValidator(ele)
} else {
ele.nameExsit = false
}
@ -410,6 +405,7 @@ export default {
setActiveName({ name, datasourceId, enableCheck }) {
if (!enableCheck) return
this.activeName = name
this.activeTable = this.tableData.find((ele) => ele.name === this.activeName) || {}
this.dbPreview({
dataSourceId: datasourceId,
info: JSON.stringify({ table: name })
@ -444,7 +440,7 @@ export default {
const mode = this.mode
const syncType = this.syncType
this.checkTableList.forEach((name) => {
const datasetName = this.tableData.find(
const datasetName = this.tables.find(
(ele) => ele.name === name
).datasetName
tables.push({
@ -465,13 +461,6 @@ export default {
.finally(() => {
this.loading = false
})
},
dataReset() {
this.searchTable = ''
this.options = []
this.dataSource = ''
this.tables = []
this.checkTableList = []
}
}
}

View File

@ -479,7 +479,7 @@ export default {
errMsgCont: '',
options: [],
sql: '',
dataReference: false,
dataReference: true,
sqlOption: {
tabSize: 2,
styleActiveLine: true,

View File

@ -1,6 +1,6 @@
<template>
<el-col style="padding: 0 5px 0 5px;">
<el-row>
<el-row class="de-tree">
<span class="header-title">{{ $t('panel.share_in') }}</span>
<div
class="block"
@ -40,7 +40,7 @@
</div>
</el-row>
<el-row>
<el-row class="de-tree">
<span class="header-title">{{ $t('panel.share_out') }}</span>
<div
class="block"

View File

@ -241,7 +241,6 @@ export default {
originLoginType: null
}
},
computed: {},
beforeCreate() {
ldapStatus().then((res) => {
if (res.success && res.data) {
@ -392,7 +391,7 @@ export default {
updateInfo(param).then((response) => {
const flag = response.success
if (flag) {
if (response.data && response.data.needLogout) {
if (response.data?.needLogout) {
const casEnable = response.data.casEnable
bus.$emit('sys-logout', { casEnable })
return

View File

@ -132,6 +132,7 @@ import { emailInfo, updateInfo, validate } from '@/api/system/email'
import operater from './Operater'
import msgCfm from '@/components/msgCfm'
import dePwd from '@/components/deCustomCm/dePwd.vue'
const list = ['host', 'port', 'account', 'password', 'ssl', 'tls', '', 'recipient']
export default {
name: 'EmailSetting',
components: {
@ -192,28 +193,18 @@ export default {
})
},
change() {
if (
!this.formInline.host ||
const result = !this.formInline.host ||
!this.formInline.port ||
!this.formInline.account
) {
this.disabledConnection = true
this.disabledSave = true
} else {
this.disabledConnection = false
this.disabledSave = false
}
this.disabledConnection = result
this.disabledSave = result
},
testConnection(formInline) {
const param = {
'smtp.host': this.formInline.host,
'smtp.port': this.formInline.port,
'smtp.account': this.formInline.account,
'smtp.password': this.formInline.password,
'smtp.ssl': this.formInline.ssl,
'smtp.tls': this.formInline.tls,
'smtp.recipient': this.formInline.recipient
}
const param = list.reduce((pre, next) => {
if (!next) return pre
pre[`smtp.${next}`] = this.formInline[next]
return pre
}, {})
this.$refs[formInline].validate((valid) => {
if (valid) {
validate(param).then((response) => {
@ -235,50 +226,16 @@ export default {
this.showCancel = false
this.showSave = false
this.show = true
const param = [
{
paramKey: 'smtp.host',
paramValue: this.formInline.host,
const param = list.reduce((pre, next, index) => {
if (!next) return pre
pre.push({
paramKey: `smtp.${next}`,
paramValue: this.formInline[next],
type: 'text',
sort: 1
},
{
paramKey: 'smtp.port',
paramValue: this.formInline.port,
type: 'text',
sort: 2
},
{
paramKey: 'smtp.account',
paramValue: this.formInline.account,
type: 'text',
sort: 3
},
{
paramKey: 'smtp.password',
paramValue: this.formInline.password,
type: 'password',
sort: 4
},
{
paramKey: 'smtp.ssl',
paramValue: this.formInline.ssl,
type: 'text',
sort: 5
},
{
paramKey: 'smtp.tls',
paramValue: this.formInline.tls,
type: 'text',
sort: 6
},
{
paramKey: 'smtp.recipient',
paramValue: this.formInline.recipient,
type: 'text',
sort: 8
}
]
sort: index + 1
})
return pre
}, [])
this.$refs[formInline].validate((valid) => {
if (valid) {

View File

@ -47,17 +47,17 @@
>
<template slot-scope="scope">
<el-button
class="text-btn"
class="de-text-btn"
type="text"
@click="create(scope.row)"
>{{ $t("commons.edit") }}</el-button>
<el-button
class="text-btn"
class="de-text-btn"
type="text"
@click="validateById(scope.row)"
>{{ $t("commons.validate") }}</el-button>
<el-button
class="text-btn"
class="de-text-btn"
type="text"
@click="del(scope.row)"
>{{
@ -341,22 +341,6 @@ export default {
.table-box {
height: calc(100% - 52px);
margin-top: 16px;
.text-btn {
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: center;
margin-left: 2px;
border: none;
padding: 2px 4px;
}
.text-btn:hover {
background: rgba(51, 112, 255, 0.1);
}
}
}
</style>

View File

@ -118,12 +118,8 @@ export default {
},
nodeClick(data, node) {
let parent = null
if (node.parent.data instanceof Array) {
parent = node.parent.data[0]
} else {
parent = node.parent.data
}
const arr = node.parent?.data
const parent = Array.isArray(arr) ? arr[0] : arr
const nodeInfo = {
code: data.code,
name: data.name,
@ -132,24 +128,20 @@ export default {
}
this.$emit('show-node-info', this.setStatus(nodeInfo, 'read-only'))
},
addHandler(data, node) {
addHandler({ code: pCode }, { level: pLevel }) {
let form = {
pLevel: node.level,
pCode: data.code
pLevel,
pCode
}
if (node.level > 4) {
if (pLevel > 4) {
this.$error('不支持4级行政级别')
form = {}
}
this.$emit('emit-add', this.setStatus(form, 'add'))
},
removeHandler(data, node) {
let parent = null
if (node.parent.data instanceof Array) {
parent = node.parent.data[0]
} else {
parent = node.parent.data
}
const arr = node.parent?.data
const parent = Array.isArray(arr) ? arr[0] : arr
const param = {
code: data.code,
pcode: parent.code,
@ -185,10 +177,10 @@ export default {
this.$refs.tree.setCurrentKey(code)
},
isChina(code) {
return code && code.startsWith('156')
return code?.startsWith('156')
},
isGlobal(code) {
return code && code.startsWith('000')
return code?.startsWith('000')
}
}
}

View File

@ -2,7 +2,7 @@
<div>
<!--基础配置表单-->
<el-form
v-if="status !== 'empty' && status !== 'read-only'"
v-if="!status.includes['read-only', 'empty']"
ref="formInline"
v-loading="loading"
:model="formInline"
@ -10,11 +10,6 @@
class="demo-form-inline"
size="small"
>
<el-input
v-show="false"
v-model="formInline.pLevel"
/>
<el-row>
<el-row>
<el-col>
@ -26,7 +21,7 @@
v-if="treeShow"
ref="deSelectTree"
v-model="formInline.pCode"
:popper-append-to-body="true"
popper-append-to-body
popover-class="map-class-wrap"
:data="treeDatas"
:select-params="selectParams"
@ -107,7 +102,7 @@
</el-button>
<el-input
v-model="formInline.fileName"
:disabled="true"
disabled
/>
</el-form-item>
</el-col>
@ -318,13 +313,13 @@ export default {
},
loadForm(form) {
if (form && form.code) {
if (form?.code) {
this.nodeInfo = JSON.parse(JSON.stringify(form))
this.setGeoJson()
}
},
setGeoJson() {
if (!this.nodeInfo || !this.nodeInfo.code) {
if (!this.nodeInfo?.code) {
this.json = JSON.parse(JSON.stringify(this.noGsoJson))
return
}
@ -348,9 +343,6 @@ export default {
if (!value) return true
return data.id.toString().indexOf(value.toString()) !== -1
},
//
_nodeClickFun(data, node, vm) {
},
//
_searchFun(value) {
this.$refs.deSelectTree.filterFun(value)

View File

@ -51,28 +51,27 @@ export default {
methods: {
emitAdd(form) {
this.setStatus(form.status)
this.$refs && this.$refs['map_setting_form'] && this.$refs['map_setting_form'].emitAdd(form)
this.$refs['map_setting_form']?.emitAdd(form)
},
loadForm(nodeInfo) {
this.setStatus(nodeInfo.status)
this.$refs && this.$refs['map_setting_form'] && this.$refs['map_setting_form'].loadForm(nodeInfo)
this.$refs['map_setting_form']?.loadForm(nodeInfo)
},
setStatus(status) {
this.formStatus = status
},
loadTreeData() {
Object.keys(this.treeDatas).length === 0 && areaMapping().then(res => {
!Object.keys(this.treeDatas).length && areaMapping().then(res => {
this.treeDatas = res.data
})
},
refreshTree(node) {
areaMapping().then(res => {
this.treeDatas = res.data
if (node && node.code) {
this.$refs && this.$refs['map_setting_tree'] && this.$refs['map_setting_tree'].showNewNode(node.code)
}
if (!node?.code) return
this.$refs['map_setting_tree']?.showNewNode(node.code)
})
}
}

View File

@ -20,7 +20,6 @@
<el-select
v-model="form.type"
:placeholder="$t('datasource.please_choose_type')"
filterable
@change="changeType()"
>
@ -160,14 +159,10 @@ export default {
port: '',
extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull'
},
input: '',
visible: true,
showEdit: true,
showSave: false,
showCancel: false,
show: true,
disabledConnection: false,
disabledSave: false,
loading: false,
rules: {
'configuration.host': [
@ -202,7 +197,6 @@ export default {
]
}
},
created() {
this.query()
},

View File

@ -8,40 +8,40 @@
class="de-tabs"
>
<el-tab-pane
:lazy="true"
lazy
:label="$t('system_parameter_setting.basic_setting')"
name="zero"
/>
<el-tab-pane
:lazy="true"
lazy
:label="$t('system_parameter_setting.mailbox_service_settings')"
name="first"
/>
<el-tab-pane
:lazy="true"
lazy
:label="$t('sysParams.map')"
name="ten"
/>
<el-tab-pane
v-if="engineMode === 'simple'"
:lazy="true"
lazy
:label="$t('system_parameter_setting.engine_mode_setting')"
name="six"
/>
<el-tab-pane
v-if="engineMode === 'cluster'"
:lazy="true"
lazy
:label="$t('system_parameter_setting.engine_mode_setting')"
name="seven"
/>
<el-tab-pane
v-if="engineMode === 'cluster'"
:lazy="true"
lazy
:label="$t('system_parameter_setting.kettle_setting')"
name="eight"
/>
@ -95,8 +95,6 @@ export default {
engineMode: 'local'
}
},
computed: {
},
beforeCreate() {
pluginLoaded().then((res) => {
this.isPluginLoaded = res.success && res.data
@ -104,10 +102,6 @@ export default {
engineMode().then((res) => {
this.engineMode = res.data
})
},
methods: {
handlerBtn(btn) {
}
}
}
</script>

View File

@ -333,36 +333,7 @@
</template>
<script>
const columnOptions = [
{
label: 'dataset.task_name',
props: 'name'
},
{
label: 'dataset.task.dataset',
props: 'datasetName'
},
{
label: 'dataset.execute_rate',
props: 'rate'
},
{
label: 'dataset.task.last_exec_time',
props: 'lastExecTime'
},
{
label: 'dataset.task.last_exec_status',
props: 'lastExecStatus'
},
{
label: 'dataset.task.next_exec_time',
props: 'nextExecTime'
},
{
label: 'dataset.task.task_status',
props: 'status'
}
]
import { columnOptions } from './options'
import { formatOrders } from '@/utils/index'
import { datasetTaskList, post } from '@/api/dataset/dataset'
import { hasDataPermission } from '@/utils/permission'

View File

@ -502,9 +502,10 @@ export default {
},
insertParamToCodeMirror(param) {
const pos1 = this.$refs.myCm.codemirror.getCursor()
const pos2 = {}
pos2.line = pos1.line
pos2.ch = pos1.ch
const pos2 = {
line: pos1.line,
ch: pos1.ch
}
this.$refs.myCm.codemirror.replaceRange(param, pos2)
},
saveTask(task) {
@ -542,14 +543,14 @@ export default {
this.incrementalConfig = response.data
if (
this.incrementalConfig.incrementalAdd.length === 0 &&
this.incrementalConfig.incrementalDelete.length === 0
!this.incrementalConfig.incrementalAdd.length &&
!this.incrementalConfig.incrementalDelete.length
) {
this.incrementalUpdateType = 'incrementalAdd'
this.sql = ''
return
}
if (this.incrementalConfig.incrementalAdd.length > 0) {
if (this.incrementalConfig.incrementalAdd.length) {
this.incrementalUpdateType = 'incrementalAdd'
this.sql = this.incrementalConfig.incrementalAdd
} else {
@ -561,29 +562,13 @@ export default {
},
incrementalUpdateTypeChange: function() {
if (this.incrementalUpdateType === 'incrementalAdd') {
if (this.sql) {
this.incrementalConfig.incrementalDelete = this.sql
} else {
this.incrementalConfig.incrementalDelete = ''
}
if (this.incrementalConfig.incrementalAdd) {
this.sql = this.incrementalConfig.incrementalAdd
} else {
this.sql = ''
}
this.incrementalConfig.incrementalDelete = this.sql || ''
this.sql = this.incrementalConfig.incrementalAdd || ''
}
if (this.incrementalUpdateType === 'incrementalDelete') {
if (this.sql) {
this.incrementalConfig.incrementalAdd = this.sql
} else {
this.incrementalConfig.incrementalAdd = ''
}
if (this.incrementalConfig.incrementalDelete) {
this.sql = this.incrementalConfig.incrementalDelete
} else {
this.sql = ''
}
this.incrementalConfig.incrementalAdd = this.sql || ''
this.sql = this.incrementalConfig.incrementalDelete || ''
}
}
}

View File

@ -5,16 +5,8 @@
<script>
export default ({
data() {
return {
}
},
created() {
this.$store.dispatch('app/toggleSideBarHide', false)
},
method: {
}
})
</script>

View File

@ -14,6 +14,38 @@ const filterDatasetRecord = {
value: 'Error'
}]
}
const columnOptions = [
{
label: 'dataset.task_name',
props: 'name'
},
{
label: 'dataset.task.dataset',
props: 'datasetName'
},
{
label: 'dataset.execute_rate',
props: 'rate'
},
{
label: 'dataset.task.last_exec_time',
props: 'lastExecTime'
},
{
label: 'dataset.task.last_exec_status',
props: 'lastExecStatus'
},
{
label: 'dataset.task.next_exec_time',
props: 'nextExecTime'
},
{
label: 'dataset.task.task_status',
props: 'status'
}
]
const filterDataset = [{
name: 'dataset.execute_rate',
type: 'dataset_table_task.rate',
@ -75,5 +107,6 @@ function dateFormat(fmt, date) {
export {
filterDataset,
dateFormat,
filterDatasetRecord
filterDatasetRecord,
columnOptions
}

View File

@ -289,7 +289,6 @@ export default {
const results = res.data.map(node => {
if (node.hasChildren && !node.children) {
node.children = null
// delete node.children
}
return node
})

View File

@ -100,6 +100,9 @@ module.exports = {
sass: {
prependData: `@import "@/style/index.scss"`
}
},
extract: {
ignoreOrder: true,
}
}