提交 946c84ec authored 作者: taojinlong's avatar taojinlong

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

...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
left join panel_group g on g.id = s.panel_group_id left join panel_group g on g.id = s.panel_group_id
where where
( s.target_id = #{userId} and s.type = 0 ) or ( s.target_id = #{userId} and s.type = 0 ) or
( s.target_id = #{deptId} and s.type = 1 ) or ( s.target_id = #{deptId} and s.type = 2 ) or
s.target_id in ( s.target_id in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'> <foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId} #{roleId}
</foreach> </foreach>
and s.type = 1 )
<if test="orderByClause == null"> <if test="orderByClause == null">
order by s.create_time desc order by s.create_time desc
</if> </if>
......
...@@ -1197,7 +1197,6 @@ export default { ...@@ -1197,7 +1197,6 @@ export default {
// 如果辅助设计 需要最后调整矩阵 // 如果辅助设计 需要最后调整矩阵
if (this.canvasStyleData.auxiliaryMatrix) { if (this.canvasStyleData.auxiliaryMatrix) {
debugger
this.recordMatrixCurStyle() this.recordMatrixCurStyle()
} }
this.hasMove && this.$store.commit('recordSnapshot') this.hasMove && this.$store.commit('recordSnapshot')
......
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
:prop-value="item.propValue" :prop-value="item.propValue"
:element="item" :element="item"
:out-style="getShapeStyleInt(item.style)" :out-style="getShapeStyleInt(item.style)"
:edit-mode="'edit'"
:active="item === curComponent"
@input="handleInput" @input="handleInput"
/> />
<component <component
......
...@@ -271,6 +271,7 @@ export default { ...@@ -271,6 +271,7 @@ export default {
float: right; float: right;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
min-width: 900px;
/*background: #fff;*/ /*background: #fff;*/
/*border-bottom: 1px solid #ddd;*/ /*border-bottom: 1px solid #ddd;*/
......
<template> <template>
<div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup"> <div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup">
<!-- tabindex >= 0 使得双击时聚集该元素 --> <!-- tabindex >= 0 使得双击时聚集该元素 -->
<div :contenteditable="canEdit" :class="{ canEdit }" @dblclick="setEdit" :tabindex="element.id" @paste="clearStyle" <div
@mousedown="handleMousedown" @blur="handleBlur" ref="text" v-html="element.propValue" @input="handleInput" ref="text"
:style="{ verticalAlign: element.style.verticalAlign }" :contenteditable="canEdit"
></div> :class="{ canEdit }"
</div> :tabindex="element.id"
<div v-else class="v-text"> :style="{ verticalAlign: element.style.verticalAlign }"
<div v-html="element.propValue" :style="{ verticalAlign: element.style.verticalAlign }"></div> @dblclick="setEdit"
</div> @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> </template>
<script> <script>
import { mapState } from 'vuex'
import { keycodes } from '@/components/canvas/utils/shortcutKey.js' import { keycodes } from '@/components/canvas/utils/shortcutKey.js'
export default { export default {
props: { props: {
propValue: { propValue: {
type: String, type: String,
require: true, require: true
},
element: {
type: Object,
},
}, },
data() { element: {
return { type: Object
canEdit: false,
ctrlKey: 17,
isCtrlDown: false,
}
}, },
computed: { editMode: {
...mapState([ type: String,
'editMode', require: false,
]), default: 'preview'
}, },
methods: { active: {
handleInput(e) { type: Boolean,
this.$emit('input', this.element, e.target.innerHTML) require: false,
}, default: false
}
handleKeydown(e) {
if (e.keyCode == this.ctrlKey) { },
this.isCtrlDown = true data() {
} else if (this.isCtrlDown && this.canEdit && keycodes.includes(e.keyCode)) { return {
e.stopPropagation() canEdit: false,
} else if (e.keyCode == 46) { // deleteKey ctrlKey: 17,
e.stopPropagation() isCtrlDown: false
} }
}, },
computed: {
handleKeyup(e) { },
if (e.keyCode == this.ctrlKey) {
this.isCtrlDown = false watch: {
} active: {
}, handler(newVal, oldVla) {
debugger
handleMousedown(e) { this.removeSelectText()
if (this.canEdit) { },
e.stopPropagation() deep: true
} }
}, },
methods: {
clearStyle(e) { handleInput(e) {
e.preventDefault() this.$emit('input', this.element, e.target.innerHTML)
const clp = e.clipboardData },
const text = clp.getData('text/plain') || ''
if (text !== '') { handleKeydown(e) {
document.execCommand('insertText', false, text) if (e.keyCode == this.ctrlKey) {
} this.isCtrlDown = true
} else if (this.isCtrlDown && this.canEdit && keycodes.includes(e.keyCode)) {
this.$emit('input', this.element, e.target.innerHTML) e.stopPropagation()
}, } else if (e.keyCode == 46) { // deleteKey
e.stopPropagation()
handleBlur(e) { }
this.element.propValue = e.target.innerHTML || '&nbsp;' },
this.canEdit = false
}, handleKeyup(e) {
if (e.keyCode == this.ctrlKey) {
setEdit() { this.isCtrlDown = false
this.canEdit = true }
// 全选 },
this.selectText(this.$refs.text)
}, handleMousedown(e) {
if (this.canEdit) {
selectText(element) { e.stopPropagation()
const selection = window.getSelection() }
const range = document.createRange()
range.selectNodeContents(element)
selection.removeAllRanges()
selection.addRange(range)
},
}, },
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> </script>
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
width="500" width="500"
trigger="click" 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%;"> <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> <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> </el-button>
...@@ -161,7 +161,8 @@ export default { ...@@ -161,7 +161,8 @@ export default {
editUnion: false, editUnion: false,
sourceFieldOption: [], sourceFieldOption: [],
targetFieldOption: [], targetFieldOption: [],
targetTable: {} targetTable: {},
customType: ['db', 'sql', 'excel']
} }
}, },
watch: { watch: {
...@@ -191,11 +192,22 @@ export default { ...@@ -191,11 +192,22 @@ export default {
}, },
showUnionEdit() { showUnionEdit() {
this.union.sourceTableId = this.table.id // 校验同步状态
fieldList(this.table.id).then(response => { post('/dataset/table/checkDorisTableIsExists/' + this.table.id, {}, true).then(response => {
this.sourceFieldOption = response.data 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() { saveUnion() {
// console.log(this.union) // console.log(this.union)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论