This commit is contained in:
jxx1
2021-05-09 10:45:39 +08:00
5 changed files with 1265 additions and 1346 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,121 +1,132 @@
<template>
<div class="t-dis">
<VolHeader icon="md-apps" text="表单属性字段只读" style="margin-bottom: 20px;">
<VolHeader icon="md-apps"
text="表单属性字段只读"
style="margin-bottom: 20px;">
<div style="text-align: right;padding-top: 4px;">
<Button type="text" icon="ios-search" size="small" @click="getForm">获取表单</Button>
<Button type="text" icon="ios-search" size="small" @click="getForm">获取表单</Button>
<Button type="text"
icon="ios-search"
size="small"
@click="getForm">获取表单</Button>
<Button type="text"
icon="ios-search"
size="small"
@click="getForm">获取表单</Button>
</div>
</VolHeader>
<VolForm ref="myform" :loadKey="loadKey" :formFields="formFields" :formRules="formRules"></VolForm>
<VolForm ref="myform"
:loadKey="loadKey"
:formFields="formFields"
:formRules="formRules"></VolForm>
</div>
</template>
<script>
import VolForm from "@/components/basic/VolForm.vue";
import VolHeader from "@/components/basic/VolHeader.vue";
import VolForm from '@/components/basic/VolForm.vue'
import VolHeader from '@/components/basic/VolHeader.vue'
export default {
components: { VolForm, VolHeader },
methods: {
getForm() {
this.$message.error(JSON.stringify(this.formFields));
getForm () {
this.$message.error(JSON.stringify(this.formFields))
},
reset() {}
reset () { }
},
mounted() {},
data() {
mounted () { },
data () {
return {
loadKey: true,
formFields: {
Variety: "日用品",
DateRange: "2019-09-01",
City: "北京市",
Variety: '日用品',
DateRange: '2019-09-01',
City: '北京市',
AvgPrice: 8.88,
Variety1: "",
DateRange1: "2019-09-02",
City1: "上海市",
Variety1: '',
DateRange1: '2019-09-02',
City1: '上海市',
AvgPrice1: 7.72,
DateRange2: "2019-09-03",
City2: "广州市",
DateRange2: '2019-09-03',
City2: '广州市',
AvgPrice2: 6.66,
IsTop: "1"
IsTop: '1'
},
formRules: [
//两列的表单formRules数据格式为:[[{},{}]]
// 两列的表单formRules数据格式为:[[{},{}]]
[
{
title: "商品类型",
dataKey: "age",
//如果这里绑定了data数据后台不会加载此数据源
data: [{ key: "1", value: "1" }, { key: "2", value: "2" }],
title: '商品类型',
dataKey: 'age',
// 如果这里绑定了data数据后台不会加载此数据源
data: [{ key: '1', value: '1' }, { key: '2', value: '2' }],
required: false,
field: "Variety",
field: 'Variety',
disabled: true,
type: "select"
type: 'select'
},
{
dataKey: "city",
title: "所在城市",
field: "City",
dataKey: 'city',
title: '所在城市',
field: 'City',
disabled: true,
type: "select",
type: 'select',
data: []
},
{
title: "成交均价",
type: "number",
field: "AvgPrice",
title: '成交均价',
type: 'number',
field: 'AvgPrice',
disabled: true
}
],
[
{
dataKey: "city",
title: "所在地区",
field: "City1",
dataKey: 'city',
title: '所在地区',
field: 'City1',
disabled: true,
type: "select",
type: 'select',
data: []
},
{
title: "销售价格",
field: "AvgPrice1",
type: "number",
title: '销售价格',
field: 'AvgPrice1',
type: 'number',
disabled: true
},
{
title: "审核日期",
range: true, //设置为true可以选择开始与结束日期
title: '审核日期',
// range: true, //设置为true可以选择开始与结束日期
required: false,
field: "DateRange",
type: "date",
field: 'DateRange',
type: 'date',
disabled: true
}
],
[
{
dataKey: "city",
title: "详细地址",
field: "City2",
dataKey: 'city',
title: '详细地址',
field: 'City2',
disabled: true,
type: "select",
type: 'select',
data: []
},
{
title: "平均重量",
field: "AvgPrice2",
type: "number",
title: '平均重量',
field: 'AvgPrice2',
type: 'number',
disabled: true
},
{
type: "date",
title: "生产日期",
field: "DateRange2",
type: 'date',
title: '生产日期',
field: 'DateRange2',
disabled: true
}
]
]
};
}
}
};
}
</script>
<style scoped>
.t-dis {
@@ -128,4 +139,4 @@ export default {
padding: 5px;
border-radius: 5px;
}
</style>
</style>

View File

@@ -67,10 +67,11 @@ namespace VOL.Core.Filters
DateTime expDate = context.HttpContext.User.Claims.Where(x => x.Type == JwtRegisteredClaimNames.Exp)
.Select(x => x.Value).FirstOrDefault().GetTimeSpmpToDate();
//动态标识刷新token(2021.05.01)
if ((expDate - DateTime.Now).TotalMinutes < AppSetting.ExpMinutes/3)
if ((expDate - DateTime.Now).TotalMinutes < AppSetting.ExpMinutes/ 3 && context.HttpContext.Request.Path != replaceTokenPath)
{
context.HttpContext.Response.Headers.Add("vol_exp", "1");
}
}
private static readonly string replaceTokenPath = "/api/User/replaceToken";
}
}

View File

@@ -67,10 +67,11 @@ namespace VOL.Core.Filters
DateTime expDate = context.HttpContext.User.Claims.Where(x => x.Type == JwtRegisteredClaimNames.Exp)
.Select(x => x.Value).FirstOrDefault().GetTimeSpmpToDate();
//动态标识刷新token(2021.05.01)
if ((expDate - DateTime.Now).TotalMinutes < AppSetting.ExpMinutes/3)
if ((expDate - DateTime.Now).TotalMinutes < AppSetting.ExpMinutes/ 3 && context.HttpContext.Request.Path != replaceTokenPath)
{
context.HttpContext.Response.Headers.Add("vol_exp", "1");
}
}
private static readonly string replaceTokenPath = "/api/User/replaceToken";
}
}