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

This commit is contained in:
taojinlong
2021-12-31 10:37:44 +08:00
11 changed files with 50 additions and 22 deletions

View File

@@ -315,7 +315,7 @@ export default {
this.refId = uuid.v1
if (this.element && this.element.propValue && this.element.propValue.viewId) {
const hasFilter = this.componentData.filter(item => item.type === 'custom').some(item => item.options.value && !(item.options.value instanceof Object) || (item.options.attrs && item.options.attrs.default && item.options.attrs.default.isDynamic))
hasFilter || this.getData(this.element.propValue.viewId, false)
if (!hasFilter || this.filters.length > 0) { this.getData(this.element.propValue.viewId, false) }
}
},
methods: {

View File

@@ -17,13 +17,13 @@
{{ $t('commons.all') }}</el-checkbox>
<el-checkbox-group v-model="value" @change="handleCheckedChange">
<el-checkbox v-for="item in datas.filter(node => node.id && node.id.includes(keyWord))" :key="item.id" :label="item.id">{{ item.id }}</el-checkbox>
<el-checkbox v-for="item in datas.filter(node => !keyWord || (node.id && node.id.includes(keyWord)))" :key="item.id" :label="item.id">{{ item.id }}</el-checkbox>
</el-checkbox-group>
</div>
<div v-else class="radio-group-container">
<el-radio-group v-model="value" @change="changeRadioBox">
<el-radio v-for="(item, index) in datas.filter(node => node.id && node.id.includes(keyWord))" :key="index" :label="item.id" @click.native.prevent="testChange(item)">
<el-radio v-for="(item, index) in datas.filter(node => !keyWord || (node.id && node.id.includes(keyWord)))" :key="index" :label="item.id" @click.native.prevent="testChange(item)">
<span>{{ item.id }}</span>
</el-radio>
</el-radio-group>
@@ -36,8 +36,8 @@
</template>
<script>
import {multFieldValues, linkMultFieldValues} from '@/api/dataset/dataset'
import {getLinkToken, getToken} from "@/utils/auth";
import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset'
import { getLinkToken, getToken } from '@/utils/auth'
export default {
props: {
@@ -109,7 +109,7 @@ export default {
'element.options.attrs.fieldId': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.datas = []
let method = multFieldValues
let method = multFieldValues
const token = this.$store.getters.token || getToken()
const linkToken = this.$store.getters.linkToken || getLinkToken()
if (!token && linkToken) {
@@ -117,16 +117,16 @@ export default {
}
this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 &&
method({fieldIds: this.element.options.attrs.fieldId.split(',')}).then(res => {
this.datas = this.optionDatas(res.data)
}) || (this.element.options.value = '')
method({ fieldIds: this.element.options.attrs.fieldId.split(',') }).then(res => {
this.datas = this.optionDatas(res.data)
}) || (this.element.options.value = '')
},
'element.options.attrs.multiple': function(value, old) {
if (typeof old === 'undefined' || value === old) return
if (!this.inDraw) {
this.value = value ? [] : null
this.element.options.value = ''
}
// if (!this.inDraw) {
this.value = value ? [] : null
this.element.options.value = ''
// }
this.show = false
this.$nextTick(() => {
@@ -148,7 +148,7 @@ export default {
if (!token && linkToken) {
method = linkMultFieldValues
}
method({fieldIds: this.element.options.attrs.fieldId.split(',')}).then(res => {
method({ fieldIds: this.element.options.attrs.fieldId.split(',') }).then(res => {
this.datas = this.optionDatas(res.data)
if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length

View File

@@ -1466,11 +1466,11 @@ export default {
}).catch(err => {
this.resetView()
this.resetDrill()
this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err.response.data.message
this.$nextTick(() => {
this.getChart(id)
})
this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err.response.data.message
return true
})
} else {

View File

@@ -347,6 +347,8 @@ export default {
post('/dataset/field/save', item).then(response => {
this.initField()
}).catch(res => {
this.initField()
})
},

View File

@@ -3,7 +3,7 @@
<el-row>
<span class="header-title">{{ $t('panel.share_in') }}</span>
<div class="block" style="margin-top:8px;">
<el-tree :data="datas" :props="defaultProps" :highlight-current="true" node-key="name" :default-expanded-keys="expandNodes" @node-click="handleNodeClick">
<el-tree ref="topTree" :data="datas" :props="defaultProps" :highlight-current="true" node-key="name" :default-expanded-keys="expandNodes" @node-click="handleNodeClick">
<span slot-scope="{ data }" class="custom-tree-node father">
<span style="display: flex; flex: 1 1 0%; width: 0px;" :class="!!data.msgNode ? 'msg-node-class': ''">
<span v-if="!!data.id">
@@ -20,7 +20,7 @@
<el-row>
<span class="header-title">{{ $t('panel.share_out') }}</span>
<div class="block" style="margin-top:8px;">
<el-tree :data="outDatas" :props="defaultProps" :highlight-current="true" node-key="name" :default-expand-all="true">
<el-tree ref="botTree" :data="outDatas" :props="defaultProps" :highlight-current="true" node-key="name" :default-expand-all="true">
<span slot-scope="{ data }" class="custom-tree-node father">
<span style="display: flex; flex: 1 1 0%; width: 0px;" @click="viewMyShare(data)">
<span v-if="!!data.id">
@@ -110,6 +110,7 @@ export default {
this.$store.dispatch('panel/setPanelInfo', data)
bus.$emit('set-panel-show-type', 1)
})
this.$refs['botTree'].setCurrentKey(null)
},
viewMyShare(data) {
get('panel/group/findOne/' + data.id).then(response => {
@@ -119,6 +120,7 @@ export default {
this.$store.dispatch('panel/setPanelInfo', data)
bus.$emit('set-panel-show-type', 2)
})
this.$refs['topTree'].setCurrentKey(null)
},
resetID(data) {
if (data) {