提交 386d15b7 authored 作者: taojinlong's avatar taojinlong

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

...@@ -629,7 +629,7 @@ export default { ...@@ -629,7 +629,7 @@ export default {
elementMouseDown(e) { elementMouseDown(e) {
// private 设置当前组件数据及状态 // private 设置当前组件数据及状态
this.$store.commit('setClickComponentStatus', true) this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-number-range') { if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range') {
e.preventDefault() e.preventDefault()
} }
// 阻止冒泡事件 // 阻止冒泡事件
......
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
elementMouseDown(e) { elementMouseDown(e) {
// private 设置当前组件数据及状态 // private 设置当前组件数据及状态
this.$store.commit('setClickComponentStatus', true) this.$store.commit('setClickComponentStatus', true)
if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-number-range') { if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range') {
e.preventDefault() e.preventDefault()
} }
// 阻止冒泡事件 // 阻止冒泡事件
......
...@@ -226,7 +226,7 @@ export default { ...@@ -226,7 +226,7 @@ export default {
handleMouseDownOnShape(e) { handleMouseDownOnShape(e) {
this.$store.commit('setClickComponentStatus', true) this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-number-range') { if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range') {
e.preventDefault() e.preventDefault()
} }
......
...@@ -4,14 +4,13 @@ ...@@ -4,14 +4,13 @@
<div class="de-select-grid-search"> <div class="de-select-grid-search">
<el-input v-model="keyWord" :placeholder="$t('deinputsearch.placeholder')" size="mini" prefix-icon="el-icon-search" clearable /> <el-input v-model="keyWord" :placeholder="$t('deinputsearch.placeholder')" size="mini" prefix-icon="el-icon-search" clearable />
</div> </div>
<div> <div class="list">
<el-tree <el-tree
v-if="options!== null && options.attrs!==null" v-if="options!== null && options.attrs!==null"
ref="deSelectGrid" ref="deSelectGrid"
:data="options.attrs.multiple ? [allNode, ...options.attrs.datas] : options.attrs.datas" :data="(options.attrs.multiple ? [allNode, ...options.attrs.datas] : options.attrs.datas).filter(node => node.text.includes(keyWord))"
:props="defaultProp" :props="defaultProp"
:indent="0" :indent="0"
:filter-node-method="filterNode"
class="de-filter-tree" class="de-filter-tree"
default-expand-all default-expand-all
> >
...@@ -71,7 +70,7 @@ export default { ...@@ -71,7 +70,7 @@ export default {
label: 'text', label: 'text',
children: 'children' children: 'children'
}, },
keyWord: null, keyWord: '',
allNode: { allNode: {
id: (-2 << 16) + '', id: (-2 << 16) + '',
text: this.$t('commons.all'), text: this.$t('commons.all'),
...@@ -107,10 +106,11 @@ export default { ...@@ -107,10 +106,11 @@ export default {
sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0]) sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0])
!this.inDraw && (this.options.value = null) !this.inDraw && (this.options.value = null)
} }
},
keyWord(val) {
this.$refs.deSelectGrid.filter(val)
} }
// keyWord(val) {
// console.log(val)
// this.$refs.deSelectGrid.filter(val)
// }
}, },
created() { created() {
this.options = this.element.options this.options = this.element.options
...@@ -206,10 +206,10 @@ export default { ...@@ -206,10 +206,10 @@ export default {
this.options.value = null this.options.value = null
this.changeRadioBox() this.changeRadioBox()
}, },
filterNode(value, data) { // filterNode(value, data) {
if (!value) return true // if (!value) return true
return data[this.defaultProp.label].indexOf(value) !== -1 // return data[this.defaultProp.label].indexOf(value) !== -1
}, // },
styleChange() { styleChange() {
this.$store.state.styleChangeTimes++ this.$store.state.styleChangeTimes++
} }
...@@ -246,4 +246,13 @@ export default { ...@@ -246,4 +246,13 @@ export default {
border-radius: 0px; border-radius: 0px;
} }
} }
.de-select-grid-class {
.list {
overflow-y: auto;
width: 100%;
position: absolute;
top: 30px;
bottom: 0;
}
}
</style> </style>
...@@ -840,7 +840,9 @@ export default { ...@@ -840,7 +840,9 @@ export default {
bubble_symbol: 'Shape', bubble_symbol: 'Shape',
gap_width: 'Gap Width', gap_width: 'Gap Width',
width: 'Width', width: 'Width',
height: 'Height' height: 'Height',
system_case: 'System',
custom_case: 'Custom'
}, },
dataset: { dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
......
...@@ -840,7 +840,9 @@ export default { ...@@ -840,7 +840,9 @@ export default {
bubble_symbol: '圖形', bubble_symbol: '圖形',
gap_width: '間隔', gap_width: '間隔',
width: '寬度', width: '寬度',
height: '高度' height: '高度',
system_case: '系統方案',
custom_case: '自定義'
}, },
dataset: { dataset: {
sheet_warn: '有多個sheet頁面,默認抽取第一個', sheet_warn: '有多個sheet頁面,默認抽取第一個',
......
...@@ -840,7 +840,9 @@ export default { ...@@ -840,7 +840,9 @@ export default {
bubble_symbol: '图形', bubble_symbol: '图形',
gap_width: '间隔', gap_width: '间隔',
width: '宽度', width: '宽度',
height: '高度' height: '高度',
system_case: '系统方案',
custom_case: '自定义'
}, },
dataset: { dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个', sheet_warn: '有多个 Sheet 页,默认抽取第一个',
......
...@@ -235,6 +235,15 @@ div:focus { ...@@ -235,6 +235,15 @@ div:focus {
div.el-input-group__append { div.el-input-group__append {
width: 10% !important; width: 10% !important;
} }
.de-select-grid-class {
.list {
position: relative !important;
height: 200px !important;
overflow-y: scroll !important;
top: 0px !important;
}
}
} }
%field-icon { %field-icon {
......
...@@ -4,6 +4,15 @@ ...@@ -4,6 +4,15 @@
<el-form ref="colorForm" :model="colorForm" label-width="80px" size="mini" :disabled="param && !hasDataPermission('manage',param.privileges)"> <el-form ref="colorForm" :model="colorForm" label-width="80px" size="mini" :disabled="param && !hasDataPermission('manage',param.privileges)">
<div v-if="sourceType==='view' || sourceType==='panelEchart'"> <div v-if="sourceType==='view' || sourceType==='panelEchart'">
<el-form-item v-show="chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :label="$t('chart.color_case')" class="form-item"> <el-form-item v-show="chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :label="$t('chart.color_case')" class="form-item">
<el-popover
placement="bottom"
width="400"
trigger="click"
:disabled="param && !hasDataPermission('manage',param.privileges)"
>
<div style="padding: 6px 10px;">
<div>
<span class="color-label">{{ $t('chart.system_case') }}</span>
<el-select v-model="colorForm.value" :placeholder="$t('chart.pls_slc_color_case')" size="mini" @change="changeColorCase"> <el-select v-model="colorForm.value" :placeholder="$t('chart.pls_slc_color_case')" size="mini" @change="changeColorCase">
<el-option v-for="option in colorCases" :key="option.value" :label="option.name" :value="option.value" style="display: flex;align-items: center;"> <el-option v-for="option in colorCases" :key="option.value" :label="option.name" :value="option.value" style="display: flex;align-items: center;">
<div style="float: left"> <div style="float: left">
...@@ -12,6 +21,29 @@ ...@@ -12,6 +21,29 @@
<span style="margin-left: 4px;">{{ option.name }}</span> <span style="margin-left: 4px;">{{ option.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
<el-button size="mini" type="text" style="margin-left: 2px;" @click="resetCustomColor">{{ $t('commons.reset') }}</el-button>
</div>
<div style="display: flex;align-items: center;margin-top: 10px;">
<span class="color-label">{{ $t('chart.custom_case') }}</span>
<span>
<el-radio-group v-model="customColor" class="color-type">
<el-radio v-for="(c,index) in colorForm.colors" :key="index" :label="c" style="padding: 2px;" @change="switchColor(index)">
<span :style="{width: '20px',height: '20px',display:'inline-block',backgroundColor: c}" />
</el-radio>
</el-radio-group>
</span>
</div>
<div style="display: flex;align-items: center;margin-top: 10px;">
<span class="color-label" />
<span>
<el-color-picker v-model="customColor" class="color-picker-style" @change="switchColorCase" />
</span>
</div>
</div>
<div slot="reference" style="cursor: pointer;margin-top: 2px;width: 180px;">
<span v-for="(c,index) in colorForm.colors" :key="index" :style="{width: '20px',height: '20px',display:'inline-block',backgroundColor: c}" />
</div>
</el-popover>
</el-form-item> </el-form-item>
<el-form-item v-show="(chart.type && chart.type.includes('text')) || sourceType==='panelTable'" :label="$t('chart.dimension_color')" class="form-item"> <el-form-item v-show="(chart.type && chart.type.includes('text')) || sourceType==='panelTable'" :label="$t('chart.dimension_color')" class="form-item">
...@@ -149,12 +181,16 @@ export default { ...@@ -149,12 +181,16 @@ export default {
colors: ['#00a3af', '#4da798', '#57baaa', '#62d0bd', '#6ee4d0', '#86e7d6', '#aeede1', '#bde1e6', '#e5e5e5'] colors: ['#00a3af', '#4da798', '#57baaa', '#62d0bd', '#6ee4d0', '#86e7d6', '#aeede1', '#bde1e6', '#e5e5e5']
} }
], ],
colorForm: JSON.parse(JSON.stringify(DEFAULT_COLOR_CASE)) colorForm: JSON.parse(JSON.stringify(DEFAULT_COLOR_CASE)),
customColor: null,
colorIndex: 0
} }
}, },
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.customColor = null
this.colorIndex = 0
this.init() this.init()
} }
} }
...@@ -172,6 +208,8 @@ export default { ...@@ -172,6 +208,8 @@ export default {
val.value = items[0].value val.value = items[0].value
val.colors = items[0].colors val.colors = items[0].colors
this.$emit('onColorChange', val) this.$emit('onColorChange', val)
this.customColor = null
this.colorIndex = 0
}, },
init() { init() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
...@@ -184,9 +222,27 @@ export default { ...@@ -184,9 +222,27 @@ export default {
} }
if (customAttr.color) { if (customAttr.color) {
this.colorForm = customAttr.color this.colorForm = customAttr.color
if (!this.customColor) {
this.customColor = this.colorForm.colors[0]
this.colorIndex = 0
} }
} }
} }
},
switchColor(index) {
this.colorIndex = index
},
switchColorCase() {
this.colorForm.colors[this.colorIndex] = this.customColor
this.$emit('onColorChange', this.colorForm)
},
resetCustomColor() {
this.customColor = this.colorForm.colors[0]
this.colorIndex = 0
this.changeColorCase()
}
} }
} }
</script> </script>
...@@ -220,4 +276,22 @@ export default { ...@@ -220,4 +276,22 @@ export default {
cursor: pointer; cursor: pointer;
z-index: 1003; z-index: 1003;
} }
.color-label{
display: inline-block;
width: 60px;
}
.color-type>>>.el-radio__input{
display: none;
}
.el-radio{
margin:0 2px 0 0!important;
}
.el-radio>>>.el-radio__label{
padding-left: 0;
}
.el-radio.is-checked{
border: 1px solid #0a7be0;
}
</style> </style>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<el-dialog <el-dialog
v-if="filterVisible && panelInfo.id" v-if="filterVisible && panelInfo.id"
:title="$t('panel.module')" :title="(currentWidget && currentWidget.getLeftPanel && currentWidget.getLeftPanel().label ? $t(currentWidget.getLeftPanel().label) : '') + $t('panel.module')"
:visible.sync="filterVisible" :visible.sync="filterVisible"
custom-class="de-filter-dialog" custom-class="de-filter-dialog"
> >
......
...@@ -39,8 +39,18 @@ ...@@ -39,8 +39,18 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
> >
<div slot-scope="{ node, data }" class="custom-tree-node"> <div slot-scope="{ node, data }" class="custom-tree-node">
<el-button v-if="data.type === 'db'" icon="el-icon-s-data" type="text" size="mini" /> <!-- <el-button v-if="data.type === 'db'" icon="el-icon-s-data" type="text" size="mini" /> -->
<span>
<svg-icon v-if="data.type === 'db'" icon-class="ds-db" class="ds-icon-db" />
<svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" />
<svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
</span>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">{{ node.label }}</div>
<span class="label-span">{{ node.label }}</span> <span class="label-span">{{ node.label }}</span>
</el-tooltip>
</div> </div>
</el-tree> </el-tree>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论