You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.7 KiB

3 years ago
  1. <template>
  2. <IvzBasicView #if(${cfg.moduleName})name="$!{cfg.moduleName}"#end #if(${cfg.rowKey})rowKey="$!{cfg.rowKey}"#end auth>
  3. <IvzViewSearch>
  4. #foreach($vue in ${cfg.searchFields})
  5. #if(${vue.component})
  6. ${vue.component}
  7. #end
  8. #end
  9. <template #func>
  10. <IvzFuncBtn func="query" url="/${package.ModuleName}/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end/view">搜索</IvzFuncBtn>
  11. <IvzFuncBtn func="add" url="/${package.ModuleName}/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end/add">新增</IvzFuncBtn>
  12. <IvzFuncBtn func="reset">重置</IvzFuncBtn>
  13. </template>
  14. </IvzViewSearch>
  15. <IvzViewModal width="860" layout="vertical" :rules="rules">
  16. <template #default="{model}">
  17. <IvzRow :gutter="16" span="24">
  18. #foreach($vue in ${cfg.formFields})
  19. #if(${vue.component})
  20. ${vue.component}
  21. #end
  22. #end
  23. </IvzRow>
  24. </template>
  25. <template #title="{model}">
  26. {{model.id ? '修改${cfg.moduleName}' : '新增${cfg.moduleName}'}}
  27. </template>
  28. <template #footer="{model}">
  29. <IvzFuncBtn func="cancel">取消</IvzFuncBtn>
  30. <IvzFuncBtn func="submit" :url="model.id ? '/${package.ModuleName}/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end/edit' : '/${package.ModuleName}/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end/add'">提交</IvzFuncBtn>
  31. <IvzFuncBtn func="reset">重置</IvzFuncBtn>
  32. </template>
  33. </IvzViewModal>
  34. <IvzViewTable :columns="columns" :bordered="true" size="small">
  35. <template #c_action="{record}">
  36. <IvzFuncTag func="edit" :data="record" url="/${package.ModuleName}/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end/edit">修改</IvzFuncTag>
  37. <IvzFuncTag func="del" :data="record" url="/${package.ModuleName}/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end/del">删除</IvzFuncTag>
  38. </template>
  39. </IvzViewTable>
  40. </IvzBasicView>
  41. </template>
  42. <!-- ${cfg.moduleName}功能 -->
  43. <script>
  44. import {ref, reactive} from "vue";
  45. export default {
  46. name: "$entity",
  47. setup() {
  48. let columns = ref([
  49. #foreach($field in ${cfg.tableFields})
  50. ${field.component}
  51. #end
  52. ]);
  53. let rules = reactive({
  54. #foreach($field in ${cfg.vueFields})
  55. #if(${field.required})
  56. ${field.field}: {required: true, message: '${field.label}必填'},
  57. #end
  58. #end
  59. })
  60. return {columns, rules}
  61. },
  62. }
  63. </script>
  64. <style scoped> </style>