CzRger пре 3 недеља
родитељ
комит
d4f46e0cda

+ 1 - 16
src/router/modules/big-model.ts

@@ -217,22 +217,7 @@ const getMenus = () => [
         component: () => import('@/views/manage/center/approve/index.vue'),
         meta: {
           title: '审批流程配置管理',
-        },
-      },
-      {
-        path: 'safe',
-        name: '9da8b83f-d7f9-4081-b3f3-0d637382349f',
-        component: () => import('@/views/manage/center/safe/index.vue'),
-        meta: {
-          title: '安全管理',
-        },
-      },
-      {
-        path: 'api',
-        name: 'e995a6b2-d230-4b36-a714-d4d01f92ad36',
-        component: () => import('@/views/manage/center/api/index.vue'),
-        meta: {
-          title: 'API服务管控',
+          auths: [{ value: 'save', label: '保存' }],
         },
       },
     ],

+ 0 - 9
src/views/manage/center/api/index.vue

@@ -1,9 +0,0 @@
-<template>API服务管控</template>
-
-<script setup lang="ts">
-import { reactive } from 'vue'
-
-const state: any = reactive({})
-</script>
-
-<style lang="scss" scoped></style>

+ 27 - 3
src/views/manage/center/approve/index.vue

@@ -1,12 +1,36 @@
 <template>
-  <div class="bm-main-box"><processGraph /></div>
+  <div class="bm-main-box relative">
+    <div
+      class="absolute z-10 mt-4 ml-4 flex items-center gap-4"
+      v-if="AppStore.hasPermission($route.name, 'save')"
+    >
+      <CzrButton type="primary" title="保存" @click="ref_processGraph.save()" />
+      <div
+        class="flex items-center text-[var(--czr-error-color)]"
+        v-if="state.isEdit"
+      >
+        <SvgIcon name="czr_tip" color="var(--czr-error-color)" class="mr-1" />
+        有未保存的修改
+      </div>
+    </div>
+    <processGraph
+      ref="ref_processGraph"
+      @autoSave="state.isEdit = true"
+      @save="state.isEdit = false"
+    />
+  </div>
 </template>
 
 <script setup lang="ts">
-import { reactive } from 'vue'
+import { reactive, ref } from 'vue'
 import processGraph from '@/views/process/index.vue'
+import { useAppStore } from '@/stores'
 
-const state: any = reactive({})
+const AppStore = useAppStore()
+const state: any = reactive({
+  isEdit: false,
+})
+const ref_processGraph = ref()
 </script>
 
 <style lang="scss" scoped></style>

+ 0 - 9
src/views/manage/center/safe/index.vue

@@ -1,9 +0,0 @@
-<template>安全管理</template>
-
-<script setup lang="ts">
-import { reactive } from 'vue'
-
-const state: any = reactive({})
-</script>
-
-<style lang="scss" scoped></style>

+ 6 - 14
src/views/process/index.vue

@@ -3,16 +3,6 @@
     <TeleportContainer />
     <div class="relative z-1 size-full">
       <workflowChart :ID="ID" :data="state.workflowData" ref="ref_workflow" />
-      <div class="absolute top-4 left-4 flex items-center gap-4">
-        <CzrButton type="primary" title="保存" @click="onSave" />
-        <div
-          class="flex items-center text-[var(--czr-error-color)]"
-          v-if="state.isEdit"
-        >
-          <SvgIcon name="czr_tip" color="var(--czr-error-color)" class="mr-1" />
-          有未保存的修改
-        </div>
-      </div>
     </div>
     <div
       class="absolute top-0 top-4 right-4 z-2 flex gap-2.5"
@@ -44,20 +34,19 @@ const DialogStore = useDialogStore()
 const AppStore = useAppStore()
 const TeleportContainer = getTeleport()
 const ProcessStore = useProcessStore()
-const emit = defineEmits(['autoSave'])
+const emit = defineEmits(['autoSave', 'save'])
 const props = defineProps({
   ID: {},
 })
 const { proxy }: any = getCurrentInstance()
 const state: any = reactive({
   workflowData: null,
-  isEdit: false,
 })
 const ref_workflow = ref()
 watch(
   () => ProcessStore.autoSaveFlag,
   () => {
-    state.isEdit = true
+    emit('autoSave')
   },
 )
 const onSave = () => {
@@ -107,7 +96,7 @@ const onSave = () => {
     background: 'rgba(0, 0,0, 0.3)',
   })
   console.log(res)
-  state.isEdit = false
+  emit('save')
   loading.close()
 }
 const initData = () => {
@@ -253,6 +242,9 @@ onMounted(() => {
   initDictionary()
 })
 const initDictionary = () => {}
+defineExpose({
+  save: onSave,
+})
 </script>
 
 <style lang="scss" scoped></style>