fix: 修复自定义JS数据集修改字段描述无效的情况

main
wu.jian2 2 years ago
parent b41a2c1e99
commit 8e2eee3453

@ -11,7 +11,7 @@
> >
<div class="bs-table-box"> <div class="bs-table-box">
<el-table <el-table
:data="outputFieldList" :data="insideFieldList"
:border="true" :border="true"
align="center" align="center"
class="bs-el-table" class="bs-el-table"
@ -72,11 +72,14 @@ export default {
data () { data () {
return { return {
dialogVisible: false, dialogVisible: false,
structurePreviewListCopy: [] structurePreviewListCopy: [],
//
insideFieldList: []
} }
}, },
methods: { methods: {
open () { open () {
this.insideFieldList = cloneDeep(this.outputFieldList)
this.dialogVisible = true this.dialogVisible = true
}, },
close () { close () {
@ -89,11 +92,12 @@ export default {
this.dialogVisible = false this.dialogVisible = false
}, },
setField () { setField () {
if (this.outputFieldList.length) { if (this.insideFieldList.length) {
this.fieldDesc = {} this.fieldDesc = {}
this.outputFieldList.forEach(key => { this.insideFieldList.forEach(key => {
this.fieldDesc[key.fieldName] = key.fieldDesc this.fieldDesc[key.fieldName] = key.fieldDesc
}) })
this.$emit('setFieldList', this.insideFieldList)
} else { } else {
this.fieldDesc = null this.fieldDesc = null
} }

@ -200,7 +200,7 @@
</div> </div>
<div class="field-wrap bs-field-wrap bs-scrollbar"> <div class="field-wrap bs-field-wrap bs-scrollbar">
<div <div
v-for="(field,key) in outputFieldList" v-for="(field, key) in outputFieldList"
:key="key" :key="key"
class="field-item" class="field-item"
@click="$refs.outputFieldDialog.open()" @click="$refs.outputFieldDialog.open()"
@ -338,6 +338,7 @@
<OutputFieldDialog <OutputFieldDialog
ref="outputFieldDialog" ref="outputFieldDialog"
:output-field-list="outputFieldList" :output-field-list="outputFieldList"
@setFieldList="(list) => { outputFieldList = list }"
/> />
</el-scrollbar> </el-scrollbar>
<FieldFillDialog <FieldFillDialog
@ -369,7 +370,7 @@ export default {
props: { props: {
config: { config: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
isEdit: { isEdit: {
type: Boolean, type: Boolean,
@ -448,8 +449,10 @@ export default {
} }
}, },
watch: { watch: {
'dataForm.config.script' () { 'dataForm.config.script' (val) {
this.passTest = false if (!val) {
this.passTest = false
}
} }
}, },
mounted () { mounted () {
@ -599,6 +602,7 @@ export default {
}, },
// //
scriptExecute (isInit = false) { scriptExecute (isInit = false) {
console.log(isInit)
if (this.dataForm.config.script) { if (this.dataForm.config.script) {
const javascript = this.dataForm.config.script const javascript = this.dataForm.config.script
let scriptMethod = null let scriptMethod = null
@ -635,7 +639,7 @@ export default {
}) })
} }
if (this.outputFieldList.length && this.fieldDesc) { if (this.outputFieldList.length && this.fieldDesc && !isInit) {
this.buildFieldDesc() this.buildFieldDesc()
} }
// //
@ -701,151 +705,152 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~packages/assets/style/bsTheme.scss'; @import '~packages/assets/style/bsTheme.scss';
.data-set-scrollbar { .data-set-scrollbar {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: none; overflow-x: none;
.el-scrollbar__view { .el-scrollbar__view {
height: 100%; height: 100%;
}
}
/deep/ .el-input__inner {
width: 100% !important;
} }
}
.page-header { /deep/ .el-input__inner {
display: flex; width: 100% !important;
position: relative; }
.page-header-right { .page-header {
position: absolute; display: flex;
right: 16px; position: relative;
}
}
.sql-config { .page-header-right {
padding: 0 16px; position: absolute;
right: 16px;
} }
}
.operation { .sql-config {
/deep/ .el-select { padding: 0 16px;
width: 200px !important; }
margin-right: 16px;
}
display: flex; .operation {
/deep/ .el-select {
width: 200px !important;
margin-right: 16px;
} }
/deep/ .CodeMirror { display: flex;
height: 180px !important; }
font-family: Helvetica, Tahoma;
}
.no-border { /deep/ .CodeMirror {
border: 0; height: 180px !important;
} font-family: Helvetica, Tahoma;
}
/deep/ .fieldDescCheck { .no-border {
.el-dialog__body { border: 0;
height: fit-content !important; }
min-height: unset !important;
}
}
.title-style { /deep/ .fieldDescCheck {
padding: 8px 12px; .el-dialog__body {
background-color: #f6f7fb; height: fit-content !important;
border-left: 5px solid var(--bs-el-color-primary); min-height: unset !important;
margin: 16px 16px 0 0;
} }
}
.field-wrap { .title-style {
// max-height: 110px; padding: 8px 12px;
overflow: auto; background-color: #f6f7fb;
margin-right: 16px; border-left: 5px solid var(--bs-el-color-primary);
cursor: pointer; margin: 16px 16px 0 0;
}
.field-item { .field-wrap {
line-height: 32px; // max-height: 110px;
padding: 0 12px 0 16px; overflow: auto;
margin-right: 16px;
cursor: pointer;
.edit_field { .field-item {
display: none; line-height: 32px;
} padding: 0 12px 0 16px;
.edit_field {
display: none;
}
&:hover { &:hover {
background-color: #f2f7fe; background-color: #f2f7fe;
.edit_field { .edit_field {
display: block; display: block;
}
} }
} }
} }
}
.right-setting { .right-setting {
height: 358px; height: 358px;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.paramConfig { .paramConfig {
max-height: 179px; max-height: 179px;
.field-wrap { .field-wrap {
max-height: 127px; max-height: 127px;
}
} }
}
.structure { .structure {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
.field-wrap { .field-wrap {
height: calc(100% - 40px); height: calc(100% - 40px);
}
} }
} }
}
.result-view { .result-view {
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
color: var(--bs-el-text); color: var(--bs-el-text);
position: relative; position: relative;
padding: 16px 0; padding: 16px 0;
padding-left: 12px; padding-left: 12px;
border-bottom: 1px solid var(--bs-background-1); border-bottom: 1px solid var(--bs-background-1);
&::before { &::before {
content: ""; content: "";
height: 14px; height: 14px;
position: absolute; position: absolute;
left: 0; left: 0;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
border-left: 4px solid var(--bs-el-color-primary); border-left: 4px solid var(--bs-el-color-primary);
}
} }
}
/deep/ .bs-table-box.is-Edit .el-table { /deep/ .bs-table-box.is-Edit .el-table {
max-height: unset !important; max-height: unset !important;
.el-table__body-wrapper { .el-table__body-wrapper {
max-height: unset !important; max-height: unset !important;
}
} }
}
.bs-table-box { .bs-table-box {
padding: 0; padding: 0;
height: 100% !important; height: 100% !important;
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
.tree-box{
padding: 0; .tree-box {
} padding: 0;
</style> }
</style>

Loading…
Cancel
Save