Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2022-11-09 16:04:44 +08:00
commit 9df64d83fb
7 changed files with 98 additions and 8 deletions

View File

@ -1,4 +1,6 @@
ALTER TABLE `sys_log` ALTER TABLE `sys_log`
CHANGE COLUMN `user_id` `user_id` BIGINT NULL COMMENT '操作人', CHANGE COLUMN `user_id` `user_id` BIGINT NULL COMMENT '操作人',
CHANGE COLUMN `login_name` `login_name` VARCHAR (255) NULL COMMENT '登录账号', CHANGE COLUMN `login_name` `login_name` VARCHAR (255) NULL COMMENT '登录账号',
CHANGE COLUMN `nick_name` `nick_name` VARCHAR (255) NULL COMMENT '姓名'; CHANGE COLUMN `nick_name` `nick_name` VARCHAR (255) NULL COMMENT '姓名';
UPDATE `sys_menu` SET `component` = 'dataset/Form' WHERE (`menu_id` = '800');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

After

Width:  |  Height:  |  Size: 272 KiB

View File

@ -222,6 +222,10 @@ class TimeDateRangeServiceImpl extends WidgetService {
} }
} }
dynamicDateFormNow(element) { dynamicDateFormNow(element) {
const values = this.dynamicDateFormNowProxy(element)
return this.formatDynamicTimes(values, element)
}
dynamicDateFormNowProxy(element) {
if (element.options.attrs.default === null || typeof element.options.attrs.default === 'undefined' || !element.options.attrs.default.isDynamic) return null if (element.options.attrs.default === null || typeof element.options.attrs.default === 'undefined' || !element.options.attrs.default.isDynamic) return null
if (element.options.attrs.default.dkey === 0) { if (element.options.attrs.default.dkey === 0) {
@ -265,6 +269,34 @@ class TimeDateRangeServiceImpl extends WidgetService {
return [startTime, endTime] return [startTime, endTime]
} }
} }
formatDynamicTimes(values, element) {
if (!values?.length || !element.options.attrs.default.isDynamic) {
return values
}
const baseTime = +new Date('2022-11-09 00:00:00.000')
let labelFormat = 'yyyy-MM-dd'
if (element.options.attrs.showTime && element.options.attrs.accuracy) {
labelFormat = labelFormat + ' ' + element.options.attrs.accuracy
}
let [ start, end ] = values
const attrs = element.options.attrs
if (attrs.default.sDynamicSuffixTime && attrs.default.isDynamic && attrs.default.dkey === 4 && attrs.showTime) {
start = attrs.default.sDynamicSuffixTime - baseTime + timeSection(start, 'date')[0]
} else {
start = timeSection(start, 'date', labelFormat)[0]
}
if (attrs.default.eDynamicSuffixTime && attrs.default.isDynamic && attrs.default.dkey === 4 && attrs.showTime) {
end = attrs.default.eDynamicSuffixTime - baseTime + timeSection(end, 'date')[0]
} else {
end = timeSection(end, 'date', labelFormat)[1]
}
const results = [start, end]
return results
}
validDynamicValue(element) { validDynamicValue(element) {
if (!element.options.attrs.default.isDynamic) return true if (!element.options.attrs.default.isDynamic) return true
if (element.options.attrs.default.dkey !== 4) return true if (element.options.attrs.default.dkey !== 4) return true

View File

@ -770,7 +770,7 @@ div:focus {
.no-label-item { .no-label-item {
.el-form-item__content { .el-form-item__content {
margin-left: 10px !important; margin-left: 5px !important;
} }
} }

View File

@ -68,6 +68,7 @@
</deBtn> </deBtn>
<el-dropdown <el-dropdown
v-if="table.type === 'excel' && hasDataPermission('manage', param.privileges)" v-if="table.type === 'excel' && hasDataPermission('manage', param.privileges)"
style="margin-left: 12px;"
size="small" size="small"
trigger="click" trigger="click"
placement="bottom-end" placement="bottom-end"

View File

@ -13,10 +13,8 @@
@change="dynamicChange" @change="dynamicChange"
> >
<el-radio :label="false">{{ $t('dynamic_time.fix') }}</el-radio> <el-radio :label="false">{{ $t('dynamic_time.fix') }}</el-radio>
<el-radio <el-radio :label="true">{{ $t('dynamic_time.dynamic') }}</el-radio>
:label="true"
:disabled="isTimeWidget && element.options.attrs.showTime"
>{{ $t('dynamic_time.dynamic') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -82,6 +80,7 @@
> >
<el-input-number <el-input-number
v-model="element.options.attrs.default.sDynamicPrefix" v-model="element.options.attrs.default.sDynamicPrefix"
style="min-width: 80px;width: auto;"
controls-position="right" controls-position="right"
size="mini" size="mini"
:min="0" :min="0"
@ -97,6 +96,7 @@
> >
<el-select <el-select
v-model="element.options.attrs.default.sDynamicInfill" v-model="element.options.attrs.default.sDynamicInfill"
style="min-width: 60px; width: auto;"
size="mini" size="mini"
placeholder="" placeholder=""
@change="dynamicInfillChange" @change="dynamicInfillChange"
@ -128,6 +128,7 @@
<el-select <el-select
v-model="element.options.attrs.default.sDynamicSuffix" v-model="element.options.attrs.default.sDynamicSuffix"
style="min-width: 60px; width: auto;"
size="mini" size="mini"
placeholder="" placeholder=""
@change="dynamicSuffixChange" @change="dynamicSuffixChange"
@ -143,6 +144,21 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item
v-if="element.options.attrs.default.isDynamic && element.options.attrs.default.dkey === 4 && isTimeWidget && element.options.attrs.showTime"
label=""
class="no-label-item"
>
<el-time-picker
v-model="element.options.attrs.default.sDynamicSuffixTime"
value-format="timestamp"
:format="element.options.attrs.accuracy"
style="width: auto; min-width: 110px;"
placeholder=""
@change="eDynamicSuffixTimeChange"
/>
</el-form-item>
</div> </div>
<div class="inline-first"> <div class="inline-first">
@ -153,6 +169,7 @@
> >
<el-input-number <el-input-number
v-model="element.options.attrs.default.eDynamicPrefix" v-model="element.options.attrs.default.eDynamicPrefix"
style="min-width: 80px;width: auto;"
controls-position="right" controls-position="right"
size="mini" size="mini"
:min="0" :min="0"
@ -168,6 +185,7 @@
> >
<el-select <el-select
v-model="element.options.attrs.default.eDynamicInfill" v-model="element.options.attrs.default.eDynamicInfill"
style="min-width: 60px;width: auto;"
size="mini" size="mini"
placeholder="" placeholder=""
@change="dynamicInfillChange" @change="dynamicInfillChange"
@ -199,6 +217,7 @@
<el-select <el-select
v-model="element.options.attrs.default.eDynamicSuffix" v-model="element.options.attrs.default.eDynamicSuffix"
style="min-width: 60px;width: auto;"
size="mini" size="mini"
placeholder="" placeholder=""
@change="dynamicSuffixChange" @change="dynamicSuffixChange"
@ -214,6 +233,21 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item
v-if="element.options.attrs.default.isDynamic && element.options.attrs.default.dkey === 4 && isTimeWidget && element.options.attrs.showTime"
label=""
class="no-label-item"
>
<el-time-picker
v-model="element.options.attrs.default.eDynamicSuffixTime"
value-format="timestamp"
style="min-width: 110px;width: auto;"
:format="element.options.attrs.accuracy"
placeholder=""
@change="eDynamicSuffixTimeChange"
/>
</el-form-item>
</div> </div>
<el-form-item <el-form-item
@ -264,7 +298,8 @@ export default {
}, },
data() { data() {
return { return {
dval: null dval: null,
baseTime: new Date('2022-11-09 00:00:00.000').getTime()
} }
}, },
computed: { computed: {
@ -300,6 +335,7 @@ export default {
} }
}, },
created() { created() {
this.fillEmptySuffixTime()
this.setDval() this.setDval()
}, },
methods: { methods: {
@ -336,6 +372,22 @@ export default {
this.dval = time this.dval = time
bus.$emit('valid-values-change', (!time || time.length === 0 || time[1] > time[0] || this.isOneDay)) bus.$emit('valid-values-change', (!time || time.length === 0 || time[1] > time[0] || this.isOneDay))
this.element.options.manualModify = false this.element.options.manualModify = false
},
fillEmptySuffixTime() {
if (!this.element.options.attrs.default.sDynamicSuffixTime) {
this.$set(this.element.options.attrs.default, 'sDynamicSuffixTime', this.baseTime)
}
if (!this.element.options.attrs.default.eDynamicSuffixTime) {
this.$set(this.element.options.attrs.default, 'eDynamicSuffixTime', new Date('2022-11-09 23:59:59.999').getTime())
}
},
eDynamicSuffixTimeChange(val) {
this.setDval()
},
sDynamicSuffixTimeChange(val) {
this.setDval()
} }
} }
} }

View File

@ -270,7 +270,10 @@ export default {
}, },
showTimeChange(value) { showTimeChange(value) {
this.attrs.accuracy = this.accuracyOptions[1].id this.attrs.accuracy = this.accuracyOptions[1].id
this.attrs.default.isDynamic = false if (this.widget.name !== 'timeDateRangeWidget') {
this.attrs.default.isDynamic = false
}
this.fillAttrs2Filter() this.fillAttrs2Filter()
}, },
checkedViewsChange(values) { checkedViewsChange(values) {