From dc1d067c566bbde1c7170186960a8bd27f210a47 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 09 九月 2026 13:45:58 +0800
Subject: [PATCH] feat(bi): 新增决策总览仪表盘并优化预测分析功能

---
 src/views/wls/components/process-select-modal.vue |   83 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/src/views/wls/components/process-select-modal.vue b/src/views/wls/components/process-select-modal.vue
new file mode 100644
index 0000000..d32d546
--- /dev/null
+++ b/src/views/wls/components/process-select-modal.vue
@@ -0,0 +1,83 @@
+<script lang="ts" setup>
+import { computed, ref } from 'vue';
+
+import { useVbenModal } from '@vben/common-ui';
+
+import { message, Select } from 'ant-design-vue';
+
+interface ProcessDefinition {
+  id: string;
+  name: string;
+  key: string;
+}
+
+type ProcessSubmitFn = (id: number, processDefinitionKey: string) => Promise<unknown>;
+
+const emit = defineEmits(['success']);
+
+const bizId = ref<number>();
+const processList = ref<ProcessDefinition[]>([]);
+const selectedProcessKey = ref<string>('');
+
+const processOptions = computed(() => {
+  return processList.value.map((p) => ({
+    label: p.name,
+    value: p.key,
+  }));
+});
+
+const [Modal, modalApi] = useVbenModal({
+  async onConfirm() {
+    if (!selectedProcessKey.value) {
+      message.warning('璇烽�夋嫨瀹℃壒娴佺▼');
+      return;
+    }
+    modalApi.lock();
+    try {
+      await modalApi.getData<{ submitFn: ProcessSubmitFn }>().submitFn(
+        bizId.value!,
+        selectedProcessKey.value,
+      );
+      await modalApi.close();
+      emit('success');
+      message.success('鎻愪氦瀹℃壒鎴愬姛');
+    } finally {
+      modalApi.unlock();
+    }
+  },
+  async onOpenChange(isOpen: boolean) {
+    if (!isOpen) {
+      bizId.value = undefined;
+      selectedProcessKey.value = '';
+      processList.value = [];
+      return;
+    }
+    const data = modalApi.getData<{
+      id: number;
+      processList: ProcessDefinition[];
+      submitFn: ProcessSubmitFn;
+    }>();
+    bizId.value = data.id;
+    processList.value = data.processList || [];
+    // 榛樿閫夋嫨绗竴涓祦绋�
+    const first = processList.value[0];
+    if (first) {
+      selectedProcessKey.value = first.key;
+    }
+  },
+});
+</script>
+
+<template>
+  <Modal title="閫夋嫨瀹℃壒娴佺▼" class="w-1/3">
+    <div class="mb-4">
+      <span class="mr-2">瀹℃壒娴佺▼锛�</span>
+      <Select
+        v-model:value="selectedProcessKey"
+        :options="processOptions"
+        style="width: 200px"
+        placeholder="璇烽�夋嫨瀹℃壒娴佺▼"
+      />
+    </div>
+  </Modal>
+</template>
\ No newline at end of file

--
Gitblit v1.9.3