Commit 70a10b26d2b5892a52713f7e4a85ca54ddc99951

Authored by YunaiV
1 parent 28da6b0c

优化 Vue3 模版,修改 title、visible 变量

yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm
1 1 <template>
2   - <Dialog :title="modelTitle" v-model="modelVisible">
  2 + <Dialog :title="dialogTitle" v-model="dialogVisible">
3 3 <el-form
4 4 ref="formRef"
5 5 :model="formData"
... ... @@ -116,7 +116,7 @@
116 116 </el-form>
117 117 <template #footer>
118 118 <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
119   - <el-button @click="modelVisible = false">取 消</el-button>
  119 + <el-button @click="dialogVisible = false">取 消</el-button>
120 120 </template>
121 121 </Dialog>
122 122 </template>
... ... @@ -129,8 +129,8 @@ import * as ${simpleClassName}Api from &#39;@/api/${table.moduleName}/${classNameVar
129 129 const { t } = useI18n() // 国际化
130 130 const message = useMessage() // 消息弹窗
131 131  
132   -const modelVisible = ref(false) // 弹窗的是否展示
133   -const modelTitle = ref('') // 弹窗的标题
  132 +const dialogVisible = ref(false) // 弹窗的是否展示
  133 +const dialogTitle = ref('') // 弹窗的标题
134 134 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
135 135 const formType = ref('') // 表单的类型:create - 新增;update - 修改
136 136 const formData = ref({
... ... @@ -168,8 +168,8 @@ const formRef = ref() // 表单 Ref
168 168  
169 169 /** 打开弹窗 */
170 170 const open = async (type: string, id?: number) => {
171   - modelVisible.value = true
172   - modelTitle.value = t('action.' + type)
  171 + dialogVisible.value = true
  172 + dialogTitle.value = t('action.' + type)
173 173 formType.value = type
174 174 resetForm()
175 175 // 修改时,设置数据
... ... @@ -202,7 +202,7 @@ const submitForm = async () =&gt; {
202 202 await ${simpleClassName}Api.update${simpleClassName}(data)
203 203 message.success(t('common.updateSuccess'))
204 204 }
205   - modelVisible.value = false
  205 + dialogVisible.value = false
206 206 // 发送操作成功的事件
207 207 emit('success')
208 208 } finally {
... ...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm
... ... @@ -97,6 +97,7 @@
97 97 #else
98 98 <el-button
99 99 type="primary"
  100 + plain
100 101 @click="openForm('create')"
101 102 v-hasPermi="['${permissionPrefix}:create']"
102 103 >
... ... @@ -214,7 +215,7 @@ const queryParams = reactive({
214 215 const queryFormRef = ref() // 搜索的表单
215 216 const exportLoading = ref(false) // 导出的加载中
216 217  
217   -/** 查询参数列表 */
  218 +/** 查询列表 */
218 219 const getList = async () => {
219 220 loading.value = true
220 221 try {
... ...