index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="mainContentBox">
  3. <avue-crud
  4. ref="crudRef"
  5. v-model:search="search"
  6. v-model="form"
  7. :data="data"
  8. :option="option"
  9. v-model:page="page"
  10. @row-save="createRow"
  11. @row-update="updateRow"
  12. @row-del="deleteRow"
  13. @search-change="searchChange"
  14. @search-reset="resetChange"
  15. @size-change="dataList"
  16. @current-change="dataList"
  17. >
  18. </avue-crud>
  19. <el-dialog
  20. v-model="dialog.visible"
  21. :title="dialog.title"
  22. width="1250px"
  23. @close="dialog.visible = false"
  24. >
  25. <div class="dialog-footer" align="center">
  26. <el-button @click="dialog.visible = false">取消</el-button>
  27. <el-button type="primary" @click="printPage">--</el-button>
  28. </div>
  29. </el-dialog>
  30. </div>
  31. </template>
  32. <script setup>
  33. import { ref, getCurrentInstance } from "vue";
  34. import { useCrud } from "@/hooks/userCrud";
  35. import { useCommonStoreHook } from "@/store";
  36. import dictDataUtil from "@/common/configs/dictDataUtil";
  37. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  38. const toPrintRef = ref(null);
  39. // 传入一个url,后面不带/
  40. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  41. useCrud({
  42. src: "/api/v1/flowTask",
  43. });
  44. const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
  45. Methords; //增删改查
  46. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  47. const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
  48. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  49. const dialog = reactive({
  50. title: "二维码打印",
  51. visible: false,
  52. });
  53. // 设置表格列或者其他自定义的option
  54. option.value = Object.assign(option.value, {
  55. searchEnter: true,
  56. delBtn: false,
  57. selection: false,
  58. addBtn: false,
  59. column: [
  60. {
  61. label: "待办类型",
  62. prop: "taskType",
  63. type: "select",
  64. search: true,
  65. editDisabled: true,
  66. dicUrl: dictDataUtil.request_url + "flow_type",
  67. props: {
  68. label: "dictLabel",
  69. value: "dictValue",
  70. },
  71. },
  72. {
  73. label: "任务名称",
  74. prop: "taskName",
  75. editDisabled: true,
  76. },
  77. {
  78. label: "业务名称",
  79. prop: "businessName",
  80. search: true,
  81. },
  82. {
  83. label: "当前节点",
  84. prop: "currentStep",
  85. },
  86. {
  87. label: "审核状态",
  88. prop: "state",
  89. type: "select",
  90. dicUrl:
  91. dictDataUtil.request_url + "flow_state",
  92. props: {
  93. label: "dictLabel",
  94. value: "dictValue",
  95. },
  96. }
  97. ],
  98. });
  99. onMounted(() => {
  100. search.value.state = "0"
  101. dataList();
  102. });
  103. </script>