浏览代码

添加工作流

qinhb 3 月之前
父节点
当前提交
9c9d456088
共有 2 个文件被更改,包括 125 次插入0 次删除
  1. 1 0
      src/common/configs/dictDataUtil.ts
  2. 124 0
      src/views/flow/definition/index.vue

+ 1 - 0
src/common/configs/dictDataUtil.ts

@@ -71,6 +71,7 @@ const DictDataUtil = {
     process_type: "process_type",
     filter_order: "filter_order",
     quality_grade: "quality_grade",
+    flow_type: "flow_type",
   },
   EXPAND_FIELD_TABLE: {
     //字段类型

+ 124 - 0
src/views/flow/definition/index.vue

@@ -0,0 +1,124 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange1"
+    >
+      <template #menu="{ size }">
+        <el-button
+            icon="el-icon-setting"
+            text
+            type="primary"
+            :size="size"
+        >编辑</el-button
+        >
+      </template>
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const clickRows = ref([]);
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/definition",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  searchEnter: true,
+  delBtn: false,
+  selection: false,
+  addBtn: false,
+  editBtn:false,
+  viewBtn:false,
+  column: [
+    /*{
+      label: "流程编码",
+      prop: "flowCode",
+    },*/
+    {
+      label: "流程名称",
+      prop: "flowName",
+      search: true,
+    },
+    {
+      label: "流程类型",
+      prop: "flowType",
+      type: "select",
+      search: true,
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.flow_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      }
+    },
+    {
+      label: "流程版本",
+      prop: "flowVersion",
+      html: true,
+      formatter: (val) => {
+        return '<b class="el-tag el-tag--success el-tag--light">V'+val.flowVersion+'</b>';
+      },
+
+    },
+    {
+      label: "状态",
+      prop: "enable",
+      type: "select",
+      search: true,
+      dicData: [{"label": "启用","value": "0"},{"label": "禁用","value": "1"}],
+      html: true,
+      formatter: (val) => {
+        if(val.enable === '0'){
+          return '<b class="el-tag el-tag--success el-tag--light">启用</b>';
+        }else{
+          return '<b class="el-tag el-tag--info el-tag--light">禁用</b>';
+        }
+      },
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      display: false,
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      display: false,
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+</script>