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

This commit is contained in:
taojinlong 2021-06-16 19:08:25 +08:00
commit 946c84ecaf
6 changed files with 138 additions and 92 deletions

View File

@ -22,11 +22,12 @@
left join panel_group g on g.id = s.panel_group_id
where
( s.target_id = #{userId} and s.type = 0 ) or
( s.target_id = #{deptId} and s.type = 1 ) or
s.target_id in
( s.target_id = #{deptId} and s.type = 2 ) or
( s.target_id in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and s.type = 1 )
<if test="orderByClause == null">
order by s.create_time desc
</if>

View File

@ -1197,7 +1197,6 @@ export default {
//
if (this.canvasStyleData.auxiliaryMatrix) {
debugger
this.recordMatrixCurStyle()
}
this.hasMove && this.$store.commit('recordSnapshot')

View File

@ -40,6 +40,8 @@
:prop-value="item.propValue"
:element="item"
:out-style="getShapeStyleInt(item.style)"
:edit-mode="'edit'"
:active="item === curComponent"
@input="handleInput"
/>
<component

View File

@ -271,6 +271,7 @@ export default {
float: right;
height: 35px;
line-height: 35px;
min-width: 900px;
/*background: #fff;*/
/*border-bottom: 1px solid #ddd;*/

View File

@ -1,99 +1,130 @@
<template>
<div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup">
<!-- tabindex >= 0 使得双击时聚集该元素 -->
<div :contenteditable="canEdit" :class="{ canEdit }" @dblclick="setEdit" :tabindex="element.id" @paste="clearStyle"
@mousedown="handleMousedown" @blur="handleBlur" ref="text" v-html="element.propValue" @input="handleInput"
:style="{ verticalAlign: element.style.verticalAlign }"
></div>
</div>
<div v-else class="v-text">
<div v-html="element.propValue" :style="{ verticalAlign: element.style.verticalAlign }"></div>
</div>
<div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup">
<!-- tabindex >= 0 使得双击时聚集该元素 -->
<div
ref="text"
:contenteditable="canEdit"
:class="{ canEdit }"
:tabindex="element.id"
:style="{ verticalAlign: element.style.verticalAlign }"
@dblclick="setEdit"
@paste="clearStyle"
@mousedown="handleMousedown"
@blur="handleBlur"
@input="handleInput"
v-html="element.propValue"
/>
</div>
<div v-else class="v-text">
<div :style="{ verticalAlign: element.style.verticalAlign }" v-html="element.propValue" />
</div>
</template>
<script>
import { mapState } from 'vuex'
import { keycodes } from '@/components/canvas/utils/shortcutKey.js'
export default {
props: {
propValue: {
type: String,
require: true,
},
element: {
type: Object,
},
props: {
propValue: {
type: String,
require: true
},
data() {
return {
canEdit: false,
ctrlKey: 17,
isCtrlDown: false,
}
element: {
type: Object
},
computed: {
...mapState([
'editMode',
]),
editMode: {
type: String,
require: false,
default: 'preview'
},
methods: {
handleInput(e) {
this.$emit('input', this.element, e.target.innerHTML)
},
active: {
type: Boolean,
require: false,
default: false
}
handleKeydown(e) {
if (e.keyCode == this.ctrlKey) {
this.isCtrlDown = true
} else if (this.isCtrlDown && this.canEdit && keycodes.includes(e.keyCode)) {
e.stopPropagation()
} else if (e.keyCode == 46) { // deleteKey
e.stopPropagation()
}
},
},
data() {
return {
canEdit: false,
ctrlKey: 17,
isCtrlDown: false
}
},
computed: {
},
handleKeyup(e) {
if (e.keyCode == this.ctrlKey) {
this.isCtrlDown = false
}
},
handleMousedown(e) {
if (this.canEdit) {
e.stopPropagation()
}
},
clearStyle(e) {
e.preventDefault()
const clp = e.clipboardData
const text = clp.getData('text/plain') || ''
if (text !== '') {
document.execCommand('insertText', false, text)
}
this.$emit('input', this.element, e.target.innerHTML)
},
handleBlur(e) {
this.element.propValue = e.target.innerHTML || '&nbsp;'
this.canEdit = false
},
setEdit() {
this.canEdit = true
//
this.selectText(this.$refs.text)
},
selectText(element) {
const selection = window.getSelection()
const range = document.createRange()
range.selectNodeContents(element)
selection.removeAllRanges()
selection.addRange(range)
},
watch: {
active: {
handler(newVal, oldVla) {
debugger
this.removeSelectText()
},
deep: true
}
},
methods: {
handleInput(e) {
this.$emit('input', this.element, e.target.innerHTML)
},
handleKeydown(e) {
if (e.keyCode == this.ctrlKey) {
this.isCtrlDown = true
} else if (this.isCtrlDown && this.canEdit && keycodes.includes(e.keyCode)) {
e.stopPropagation()
} else if (e.keyCode == 46) { // deleteKey
e.stopPropagation()
}
},
handleKeyup(e) {
if (e.keyCode == this.ctrlKey) {
this.isCtrlDown = false
}
},
handleMousedown(e) {
if (this.canEdit) {
e.stopPropagation()
}
},
clearStyle(e) {
e.preventDefault()
const clp = e.clipboardData
const text = clp.getData('text/plain') || ''
if (text !== '') {
document.execCommand('insertText', false, text)
}
this.$emit('input', this.element, e.target.innerHTML)
},
handleBlur(e) {
this.element.propValue = e.target.innerHTML || '&nbsp;'
this.canEdit = false
},
setEdit() {
this.canEdit = true
//
this.selectText(this.$refs.text)
},
selectText(element) {
const selection = window.getSelection()
const range = document.createRange()
range.selectNodeContents(element)
selection.removeAllRanges()
selection.addRange(range)
},
removeSelectText() {
const selection = window.getSelection()
selection.removeAllRanges()
}
}
}
</script>

View File

@ -92,7 +92,7 @@
width="500"
trigger="click"
>
<dataset-group-selector :mode="1" @getTable="getTable" />
<dataset-group-selector :custom-type="customType" :mode="1" @getTable="getTable" />
<el-button slot="reference" size="mini" style="width: 100%;">
<p class="table-name-css" :title="targetTable.name || $t('dataset.pls_slc_union_table')">{{ targetTable.name || $t('dataset.pls_slc_union_table') }}</p>
</el-button>
@ -161,7 +161,8 @@ export default {
editUnion: false,
sourceFieldOption: [],
targetFieldOption: [],
targetTable: {}
targetTable: {},
customType: ['db', 'sql', 'excel']
}
},
watch: {
@ -191,11 +192,22 @@ export default {
},
showUnionEdit() {
this.union.sourceTableId = this.table.id
fieldList(this.table.id).then(response => {
this.sourceFieldOption = response.data
//
post('/dataset/table/checkDorisTableIsExists/' + this.table.id, {}, true).then(response => {
if (response.data) {
this.union.sourceTableId = this.table.id
fieldList(this.table.id).then(response => {
this.sourceFieldOption = response.data
})
this.editUnion = true
} else {
this.$message({
type: 'error',
message: this.$t('dataset.invalid_table_check'),
showClose: true
})
}
})
this.editUnion = true
},
saveUnion() {
// console.log(this.union)