Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
a9c6ba12
Commit
a9c6ba12
authored
Dec 25, 2020
by
RuoYi
Browse files
代码生成日期控件区分范围
parent
ba068eae
Changes
3
Hide whitespace changes
Inline
Side-by-side
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
View file @
a9c6ba12
...
...
@@ -38,15 +38,28 @@
<el-option
label=
"请选择字典生成"
value=
""
/>
</el-select>
</el-form-item>
#
elseif
($
column
.
htmlType
==
"datetime"
)
#
elseif
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
!=
"BETWEEN"
)
<el-form-item
label=
"
${
comment
}
"
prop=
"
${
column
.
javaField
}
"
>
<el-date-picker
clearable
size=
"small"
style=
"width: 200px"
<el-date-picker
clearable
size=
"small"
v-model=
"queryParams.
${
column
.
javaField
}
"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"选择
${
comment
}
"
>
</el-date-picker>
</el-form-item>
#
elseif
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
<el-form-item
label=
"
${
comment
}
"
>
<el-date-picker
v-model=
"daterange
${
AttrName
}
"
size=
"small"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</el-form-item>
#
end
#
end
#
end
...
...
@@ -201,7 +214,7 @@
</el-form-item>
#
elseif
($
column
.
htmlType
==
"datetime"
)
<el-form-item
label=
"
${
comment
}
"
prop=
"
${
field
}
"
>
<el-date-picker
clearable
size=
"small"
style=
"width: 200px"
<el-date-picker
clearable
size=
"small"
v-model=
"form.
${
field
}
"
type=
"date"
value-format=
"yyyy-MM-dd"
...
...
@@ -283,6 +296,10 @@ export default {
#
if
(${
column
.
dictType
}
!=
''
)
//
$
comment
字典
${
column
.
javaField
}
Options
:
[],
#
elseif
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
#
set
($
AttrName
=
$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
//
$
comment
时间范围
daterange
${
AttrName
}:
[],
#
end
#
end
// 查询参数
...
...
@@ -329,6 +346,21 @@ export default {
/** 查询
${
functionName
}
列表 */
getList
()
{
this
.
loading
=
true
;
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
this
.
queryParams
.
params
=
{
};
#
break
#
end
#
end
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
#
set
($
AttrName
=
$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
if
(
null
!=
this
.
daterange
${
AttrName
}
&&
''
!=
this
.
daterange
${
AttrName
})
{
this
.
queryParams
.
params
[
"
begin
${
AttrName
}
"
]
=
this
.
daterange
${
AttrName
}[
0
];
this
.
queryParams
.
params
[
"
end
${
AttrName
}
"
]
=
this
.
daterange
${
AttrName
}[
1
];
}
#
end
#
end
list
${
BusinessName
}(
this
.
queryParams
).
then
(
response
=>
{
this
.${
businessName
}
List
=
this
.
handleTree
(
response
.
data
,
"
${
treeCode
}
"
,
"
${
treeParentCode
}
"
);
this
.
loading
=
false
;
...
...
@@ -397,6 +429,12 @@ export default {
},
/** 重置按钮操作 */
resetQuery
()
{
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
#
set
($
AttrName
=
$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
this
.
daterange
${
AttrName
}
=
[];
#
end
#
end
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
...
...
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
View file @
a9c6ba12
...
...
@@ -38,15 +38,28 @@
<el-option
label=
"请选择字典生成"
value=
""
/>
</el-select>
</el-form-item>
#
elseif
($
column
.
htmlType
==
"datetime"
)
#
elseif
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
!=
"BETWEEN"
)
<el-form-item
label=
"
${
comment
}
"
prop=
"
${
column
.
javaField
}
"
>
<el-date-picker
clearable
size=
"small"
style=
"width: 200px"
<el-date-picker
clearable
size=
"small"
v-model=
"queryParams.
${
column
.
javaField
}
"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"选择
${
comment
}
"
>
</el-date-picker>
</el-form-item>
#
elseif
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
<el-form-item
label=
"
${
comment
}
"
>
<el-date-picker
v-model=
"daterange
${
AttrName
}
"
size=
"small"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</el-form-item>
#
end
#
end
#
end
...
...
@@ -95,7 +108,7 @@
v-hasPermi=
"['
${
moduleName
}
:
${
businessName
}
:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"
${
businessName
}
List"
@
selection-change=
"handleSelectionChange"
>
...
...
@@ -230,7 +243,7 @@
</el-form-item>
#
elseif
($
column
.
htmlType
==
"datetime"
)
<el-form-item
label=
"
${
comment
}
"
prop=
"
${
field
}
"
>
<el-date-picker
clearable
size=
"small"
style=
"width: 200px"
<el-date-picker
clearable
size=
"small"
v-model=
"form.
${
field
}
"
type=
"date"
value-format=
"yyyy-MM-dd"
...
...
@@ -315,6 +328,10 @@ export default {
#
if
(${
column
.
dictType
}
!=
''
)
//
$
comment
字典
${
column
.
javaField
}
Options
:
[],
#
elseif
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
#
set
($
AttrName
=
$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
//
$
comment
时间范围
daterange
${
AttrName
}:
[],
#
end
#
end
// 查询参数
...
...
@@ -363,6 +380,21 @@ export default {
/** 查询
${
functionName
}
列表 */
getList
()
{
this
.
loading
=
true
;
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
this
.
queryParams
.
params
=
{
};
#
break
#
end
#
end
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
#
set
($
AttrName
=
$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
if
(
null
!=
this
.
daterange
${
AttrName
}
&&
''
!=
this
.
daterange
${
AttrName
})
{
this
.
queryParams
.
params
[
"
begin
${
AttrName
}
"
]
=
this
.
daterange
${
AttrName
}[
0
];
this
.
queryParams
.
params
[
"
end
${
AttrName
}
"
]
=
this
.
daterange
${
AttrName
}[
1
];
}
#
end
#
end
list
${
BusinessName
}(
this
.
queryParams
).
then
(
response
=>
{
this
.${
businessName
}
List
=
response
.
rows
;
this
.
total
=
response
.
total
;
...
...
@@ -413,6 +445,12 @@ export default {
},
/** 重置按钮操作 */
resetQuery
()
{
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
htmlType
==
"datetime"
&&
$
column
.
queryType
==
"BETWEEN"
)
#
set
($
AttrName
=
$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
this
.
daterange
${
AttrName
}
=
[];
#
end
#
end
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
...
...
ruoyi-ui/src/utils/ruoyi.js
View file @
a9c6ba12
...
...
@@ -62,8 +62,8 @@ export function addDateRange(params, dateRange, propName) {
search
.
params
[
"
beginTime
"
]
=
dateRange
[
0
];
search
.
params
[
"
endTime
"
]
=
dateRange
[
1
];
}
else
{
search
.
params
[
propName
+
"
BeginTime
"
]
=
dateRange
[
0
];
search
.
params
[
propName
+
"
EndTime
"
]
=
dateRange
[
1
];
search
.
params
[
"
begin
"
+
propName
]
=
dateRange
[
0
];
search
.
params
[
"
end
"
+
propName
]
=
dateRange
[
1
];
}
}
return
search
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment