Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303
This commit is contained in:
@@ -15,6 +15,7 @@ module.exports = {
|
|||||||
'avoidEscape': true,
|
'avoidEscape': true,
|
||||||
'allowTemplateLiterals': true
|
'allowTemplateLiterals': true
|
||||||
}],
|
}],
|
||||||
'semi': [2, 'never']
|
'semi': [2, 'never'],
|
||||||
|
'prefer-promise-reject-errors': 'warn'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,8 +105,7 @@ export default {
|
|||||||
this.innerValue = []
|
this.innerValue = []
|
||||||
} else {
|
} else {
|
||||||
this.initAreaData()
|
this.initAreaData()
|
||||||
const arr = this.areaData.getRealCode(value)
|
this.innerValue = this.areaData.getRealCode(value)
|
||||||
this.innerValue = arr
|
|
||||||
}
|
}
|
||||||
this.reload()
|
this.reload()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -81,13 +81,10 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
_attrs () {
|
_attrs () {
|
||||||
let attrs
|
return { ...this.$attrs }
|
||||||
attrs = { ...this.$attrs }
|
|
||||||
return attrs
|
|
||||||
},
|
},
|
||||||
// 透传给下级组件的事件,需要排除本组件使用的change事件
|
// 透传给下级组件的事件,需要排除本组件使用的change事件
|
||||||
childListeners () {
|
childListeners () {
|
||||||
const vm = this
|
|
||||||
const result = Object.assign({},
|
const result = Object.assign({},
|
||||||
this.$listeners
|
this.$listeners
|
||||||
)
|
)
|
||||||
@@ -121,9 +118,9 @@ export default {
|
|||||||
if (res.success && res.result) {
|
if (res.success && res.result) {
|
||||||
for (const i of res.result) {
|
for (const i of res.result) {
|
||||||
i.value = i.key
|
i.value = i.key
|
||||||
if (i.leaf == false) {
|
if (i.leaf === false) {
|
||||||
i.isLeaf = false
|
i.isLeaf = false
|
||||||
} else if (i.leaf == true) {
|
} else if (i.leaf === true) {
|
||||||
i.isLeaf = true
|
i.isLeaf = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,7 +133,7 @@ export default {
|
|||||||
|
|
||||||
/** 数据回显 */
|
/** 数据回显 */
|
||||||
loadItemByCode () {
|
loadItemByCode () {
|
||||||
if (!this.value || this.value == '0') {
|
if (!this.value || this.value === '0') {
|
||||||
this.treeValue = []
|
this.treeValue = []
|
||||||
} else {
|
} else {
|
||||||
getAction(this.view, { ids: this.value }).then(res => {
|
getAction(this.view, { ids: this.value }).then(res => {
|
||||||
@@ -185,9 +182,9 @@ export default {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
for (const i of res.result) {
|
for (const i of res.result) {
|
||||||
i.value = i.key
|
i.value = i.key
|
||||||
if (i.leaf == false) {
|
if (i.leaf === false) {
|
||||||
i.isLeaf = false
|
i.isLeaf = false
|
||||||
} else if (i.leaf == true) {
|
} else if (i.leaf === true) {
|
||||||
i.isLeaf = true
|
i.isLeaf = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,8 +198,8 @@ export default {
|
|||||||
addChildren (pid, children, treeArray) {
|
addChildren (pid, children, treeArray) {
|
||||||
if (treeArray && treeArray.length > 0) {
|
if (treeArray && treeArray.length > 0) {
|
||||||
for (const item of treeArray) {
|
for (const item of treeArray) {
|
||||||
if (item.key == pid) {
|
if (item.key + '' === pid + '') {
|
||||||
if (!children || children.length == 0) {
|
if (!children || children.length === 0) {
|
||||||
item.isLeaf = true
|
item.isLeaf = true
|
||||||
} else {
|
} else {
|
||||||
item.children = children
|
item.children = children
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-bind="fullScreenParentProps">
|
<div v-bind="fullScreenParentProps">
|
||||||
<a-icon v-if="fullScreen" class="full-screen-icon" :type="iconType" @click="()=>fullCoder=!fullCoder"/>
|
<a-icon v-if="fullScreen" class="full-screen-icon" :type="iconType" @click="()=>fullCoder=!fullCoder" />
|
||||||
|
|
||||||
<div class="code-editor-cust full-screen-child">
|
<div class="code-editor-cust full-screen-child">
|
||||||
<textarea ref="textarea"></textarea>
|
<textarea ref="textarea"></textarea>
|
||||||
@@ -284,11 +284,7 @@ export default {
|
|||||||
// 支持双向绑定
|
// 支持双向绑定
|
||||||
this.coder.on('change', (coder) => {
|
this.coder.on('change', (coder) => {
|
||||||
this.code = coder.getValue()
|
this.code = coder.getValue()
|
||||||
if (this.code) {
|
this.hasCode = !!this.code
|
||||||
this.hasCode = true
|
|
||||||
} else {
|
|
||||||
this.hasCode = false
|
|
||||||
}
|
|
||||||
if (this.$emit) {
|
if (this.$emit) {
|
||||||
this.$emit('input', this.code)
|
this.$emit('input', this.code)
|
||||||
}
|
}
|
||||||
@@ -297,11 +293,7 @@ export default {
|
|||||||
this.hasCode = true
|
this.hasCode = true
|
||||||
})
|
})
|
||||||
this.coder.on('blur', () => {
|
this.coder.on('blur', () => {
|
||||||
if (this.code) {
|
this.hasCode = !!this.code
|
||||||
this.hasCode = true
|
|
||||||
} else {
|
|
||||||
this.hasCode = false
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/* this.coder.on('cursorActivity',()=>{
|
/* this.coder.on('cursorActivity',()=>{
|
||||||
@@ -364,31 +356,36 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.code-editor-cust{
|
.code-editor-cust {
|
||||||
flex-grow:1;
|
flex-grow: 1;
|
||||||
display:flex;
|
display: flex;
|
||||||
position:relative;
|
position: relative;
|
||||||
height:100%;
|
height: 100%;
|
||||||
.CodeMirror{
|
|
||||||
flex-grow:1;
|
.CodeMirror {
|
||||||
z-index:1;
|
flex-grow: 1;
|
||||||
.CodeMirror-code{
|
z-index: 1;
|
||||||
line-height:19px;
|
|
||||||
|
.CodeMirror-code {
|
||||||
|
line-height: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.code-mode-select{
|
|
||||||
position:absolute;
|
.code-mode-select {
|
||||||
z-index:2;
|
position: absolute;
|
||||||
right:10px;
|
z-index: 2;
|
||||||
top:10px;
|
right: 10px;
|
||||||
max-width:130px;
|
top: 10px;
|
||||||
|
max-width: 130px;
|
||||||
}
|
}
|
||||||
.CodeMirror{
|
|
||||||
|
.CodeMirror {
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height:100%;
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
.null-tip{
|
|
||||||
|
.null-tip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 4px;
|
top: 4px;
|
||||||
left: 36px;
|
left: 36px;
|
||||||
@@ -396,17 +393,20 @@ export default {
|
|||||||
color: #ffffffc9;
|
color: #ffffffc9;
|
||||||
line-height: initial;
|
line-height: initial;
|
||||||
}
|
}
|
||||||
.null-tip-hidden{
|
|
||||||
|
.null-tip-hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**选中样式偶然出现高度不够的情况*/
|
/**选中样式偶然出现高度不够的情况*/
|
||||||
.CodeMirror-selected{
|
|
||||||
|
.CodeMirror-selected {
|
||||||
min-height: 19px !important;
|
min-height: 19px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 全屏样式 */
|
/* 全屏样式 */
|
||||||
.full-screen-parent {
|
.full-screen-parent {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.full-screen-icon {
|
.full-screen-icon {
|
||||||
@@ -474,9 +474,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-cursor{
|
.CodeMirror-cursor {
|
||||||
height:18.4px !important;
|
height: 18.4px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user