Преглед на файлове

fix: 部分页面未引入FormGrid

lanjianrong преди 3 години
родител
ревизия
d04406f7cb

+ 2 - 0
src/pages/Institutions/Staff/components/StaffDetail.tsx

@@ -17,6 +17,7 @@ import {
   FormItem,
   Input,
   Switch,
+  FormGrid,
   Select,
   FormLayout,
   Form,
@@ -162,6 +163,7 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
     components: {
       FormLayout,
       FormItem,
+      FormGrid,
       Input,
       Switch,
       Select,

+ 2 - 0
src/pages/Project/Management/Detail/components/ProjectInfo.tsx

@@ -5,6 +5,7 @@ import {
   FormItem,
   Input,
   Select,
+  FormGrid,
   Radio,
   Checkbox,
   NumberPicker,
@@ -64,6 +65,7 @@ const ProjectInfo: React.FC<ProjectInfoProps> = ({
       FormItem,
       Input,
       Select,
+      FormGrid,
       Radio,
       Checkbox,
       NumberPicker,

+ 2 - 0
src/pages/Project/Management/List/components/ProjectModal.tsx

@@ -8,6 +8,7 @@ import {
   FormButtonGroup,
   Submit,
   FormLayout,
+  FormGrid,
   FormItem,
   Input,
   Select,
@@ -62,6 +63,7 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
     components: {
       FormLayout,
       FormItem,
+      FormGrid,
       Input,
       Select,
       Radio,

+ 1 - 1
src/pages/Project/Verification/Detail/Flow/components/Graph/index.tsx

@@ -102,7 +102,7 @@ const FlowGroph: React.FC<FlowGrophProps> = ({
     <ReactFlow {...defaultOptions} elements={elements} nodeTypes={nodeTypes} edgeTypes={edgeTypes}>
       <MiniMap />
       <Background />
-      <Controls {...controlsOptions} />
+      <Controls {...controlsOptions} className="text-xl" />
     </ReactFlow>
   )
 }

+ 39 - 3
src/pages/Project/Verification/index.tsx

@@ -2,15 +2,21 @@ import AnimateContent from '@/components/AnimateContent'
 import consts from '@/utils/consts'
 import { PageContainer } from '@ant-design/pro-layout'
 import ProTable from '@ant-design/pro-table'
-import { Button, message } from 'antd'
+import { message } from 'antd'
 import { useRef, useState } from 'react'
 import { useRequest } from 'umi'
-import { getApprovalList, saveApproval } from '@/services/api/project'
+import { getApprovalList, publishApproval, saveApproval } from '@/services/api/project'
 import type { ActionType } from '@ant-design/pro-table'
 
 import ApprovalDetail from './Detail'
 import { ModalForm, ProFormText } from '@ant-design/pro-form'
 import type { ProFormInstance } from '@ant-design/pro-form'
+
+export enum PublishType {
+  FAIL = '0',
+  SUCCESS = '1'
+}
+
 const FlowList = () => {
   const tRef = useRef<ActionType>(null)
   const formRef = useRef<ProFormInstance>(null)
@@ -38,6 +44,14 @@ const FlowList = () => {
   //     tRef.current?.reload()
   //   }
   // })
+
+  const { run: tryPublish } = useRequest(publishApproval, {
+    manual: true,
+    onSuccess() {
+      message.success('')
+      tRef.current?.reload()
+    }
+  })
   const { run: tryUpdate } = useRequest(saveApproval, {
     manual: true,
     onSuccess: () => {
@@ -69,6 +83,20 @@ const FlowList = () => {
       )
     },
     {
+      dataIndex: 'publish',
+      title: '流程状态',
+      valueEnum: {
+        [PublishType.SUCCESS]: {
+          text: '已发布',
+          status: 'Success'
+        },
+        [PublishType.FAIL]: {
+          text: '未发布',
+          statis: 'Default'
+        }
+      }
+    },
+    {
       dataIndex: 'opreate',
       title: '操作',
       onHeaderCell: () => ({ style: { textAlign: 'center' } }),
@@ -87,7 +115,7 @@ const FlowList = () => {
             编辑流程名称
           </span>
           <span
-            className="pl-2 text-primary hover:cursor-pointer hover:text-blue-600"
+            className="px-2 text-primary hover:cursor-pointer hover:text-blue-600"
             onClick={() =>
               setState({
                 ...state,
@@ -97,6 +125,14 @@ const FlowList = () => {
             }>
             查看流程图
           </span>
+          <span
+            className={[
+              'pl-2',
+              record.publish ? 'text-gray-500' : 'text-primary cursor-pointer'
+            ].join(' ')}
+            onClick={() => !record.publish && tryPublish({ ID: record.approval.ID })}>
+            发布
+          </span>
           {/* <Popconfirm
             title={`确认删除${record.name}吗?`}
             okText="确认"

+ 8 - 0
src/services/api/project.ts

@@ -158,3 +158,11 @@ export async function saveApprovalParticipant(params: {
     data: params
   })
 }
+
+/** 审批流程-发布流程 */
+export async function publishApproval(params: { ID: string }) {
+  return request('/approval/publish', {
+    method: 'POST',
+    data: params
+  })
+}

+ 1 - 0
src/services/api/schema.ts

@@ -11,6 +11,7 @@ export async function getSchemaByColmunType(params: API.SchemaParams) {
 export async function updateSchema(params) {
   return request('/BasicConfig/save', {
     method: 'POST',
+    requestType: 'form',
     data: params
   })
 }