Skip to content

Commit 88680f8

Browse files
committed
perf: 优化代码生成vue模板
1 parent 7664c2a commit 88680f8

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

ruoyi-fastapi-backend/module_generator/templates/vue/index-tree.vue.jinja2

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
</el-form-item>
3636
{% elif column.html_type == "datetime" and column.query_type != "BETWEEN" %}
3737
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
38-
<el-date-picker clearable
38+
<el-date-picker
3939
v-model="queryParams.{{ column.python_field }}"
4040
type="date"
4141
value-format="yyyy-MM-dd"
42-
placeholder="请选择{{ comment }}">
43-
</el-date-picker>
42+
placeholder="请选择{{ comment }}"
43+
clearable
44+
/>
4445
</el-form-item>
4546
{% elif column.html_type == "datetime" and column.query_type == "BETWEEN" %}
4647
<el-form-item label="{{ comment }}">
@@ -52,7 +53,7 @@
5253
range-separator="-"
5354
start-placeholder="开始日期"
5455
end-placeholder="结束日期"
55-
></el-date-picker>
56+
/>
5657
</el-form-item>
5758
{% endif %}
5859
{% endif %}

ruoyi-fastapi-backend/module_generator/templates/vue/index.vue.jinja2

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
</el-form-item>
3636
{% elif column.html_type == "datetime" and column.query_type != "BETWEEN" %}
3737
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
38-
<el-date-picker clearable
38+
<el-date-picker
3939
v-model="queryParams.{{ column.python_field }}"
4040
type="date"
4141
value-format="yyyy-MM-dd"
42-
placeholder="请选择{{ comment }}">
43-
</el-date-picker>
42+
placeholder="请选择{{ comment }}"
43+
clearable
44+
/>
4445
</el-form-item>
4546
{% elif column.html_type == "datetime" and column.query_type == "BETWEEN" %}
4647
<el-form-item label="{{ comment }}">
@@ -52,7 +53,7 @@
5253
range-separator="-"
5354
start-placeholder="开始日期"
5455
end-placeholder="结束日期"
55-
></el-date-picker>
56+
/>
5657
</el-form-item>
5758
{% endif %}
5859
{% endif %}

ruoyi-fastapi-backend/module_generator/templates/vue/v3/index-tree.vue.jinja2

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
v-model="queryParams.{{ column.python_field }}"
1414
placeholder="请输入{{ comment }}"
1515
clearable
16+
style="width: 240px"
1617
@keyup.enter="handleQuery"
1718
/>
1819
</el-form-item>
1920
{% elif (column.html_type == "select" or column.html_type == "radio") and dictType %}
2021
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
21-
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable>
22+
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable style="width: 240px">
2223
<el-option
2324
v-for="dict in {{ dictType }}"
2425
:key="dict.value"
@@ -29,18 +30,20 @@
2930
</el-form-item>
3031
{% elif (column.html_type == "select" or column.html_type == "radio") and not dictType %}
3132
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
32-
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable>
33+
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable style="width: 240px">
3334
<el-option label="请选择字典生成" value="" />
3435
</el-select>
3536
</el-form-item>
3637
{% elif column.html_type == "datetime" and column.query_type != "BETWEEN" %}
3738
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
38-
<el-date-picker clearable
39+
<el-date-picker
3940
v-model="queryParams.{{ column.python_field }}"
4041
type="date"
4142
value-format="YYYY-MM-DD"
42-
placeholder="请选择{{ comment }}">
43-
</el-date-picker>
43+
placeholder="请选择{{ comment }}"
44+
clearable
45+
style="width: 240px"
46+
/>
4447
</el-form-item>
4548
{% elif column.html_type == "datetime" and column.query_type == "BETWEEN" %}
4649
<el-form-item label="{{ comment }}" style="width: 308px">
@@ -51,7 +54,8 @@
5154
range-separator="-"
5255
start-placeholder="开始日期"
5356
end-placeholder="结束日期"
54-
></el-date-picker>
57+
style="width: 240px"
58+
/>
5559
</el-form-item>
5660
{% endif %}
5761
{% endif %}

ruoyi-fastapi-backend/module_generator/templates/vue/v3/index.vue.jinja2

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
v-model="queryParams.{{ column.python_field }}"
1414
placeholder="请输入{{ comment }}"
1515
clearable
16+
style="width: 240px"
1617
@keyup.enter="handleQuery"
1718
/>
1819
</el-form-item>
1920
{% elif (column.html_type == "select" or column.html_type == "radio") and dictType %}
2021
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
21-
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable>
22+
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable style="width: 240px">
2223
<el-option
2324
v-for="dict in {{ dictType }}"
2425
:key="dict.value"
@@ -29,18 +30,20 @@
2930
</el-form-item>
3031
{% elif (column.html_type == "select" or column.html_type == "radio") and not dictType %}
3132
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
32-
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable>
33+
<el-select v-model="queryParams.{{ column.python_field }}" placeholder="请选择{{ comment }}" clearable style="width: 240px">
3334
<el-option label="请选择字典生成" value="" />
3435
</el-select>
3536
</el-form-item>
3637
{% elif column.html_type == "datetime" and column.query_type != "BETWEEN" %}
3738
<el-form-item label="{{ comment }}" prop="{{ column.python_field }}">
38-
<el-date-picker clearable
39+
<el-date-picker
3940
v-model="queryParams.{{ column.python_field }}"
4041
type="date"
4142
value-format="YYYY-MM-DD"
42-
placeholder="请选择{{ comment }}">
43-
</el-date-picker>
43+
placeholder="请选择{{ comment }}"
44+
clearable
45+
style="width: 240px"
46+
/>
4447
</el-form-item>
4548
{% elif column.html_type == "datetime" and column.query_type == "BETWEEN" %}
4649
<el-form-item label="{{ comment }}" style="width: 308px">
@@ -51,7 +54,8 @@
5154
range-separator="-"
5255
start-placeholder="开始日期"
5356
end-placeholder="结束日期"
54-
></el-date-picker>
57+
style="width: 240px"
58+
/>
5559
</el-form-item>
5660
{% endif %}
5761
{% endif %}

0 commit comments

Comments
 (0)