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