From c8b65690b946b28b179796fbe2f020e732043c58 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期四, 08 一月 2026 18:10:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津军泰伟业' into dev_天津军泰伟业

---
 src/views/collaborativeApproval/rpaManagement/index.vue |  669 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 357 insertions(+), 312 deletions(-)

diff --git a/src/views/collaborativeApproval/rpaManagement/index.vue b/src/views/collaborativeApproval/rpaManagement/index.vue
index 81cde62..8e1a148 100644
--- a/src/views/collaborativeApproval/rpaManagement/index.vue
+++ b/src/views/collaborativeApproval/rpaManagement/index.vue
@@ -3,84 +3,93 @@
     <div class="search_form">
       <div>
         <span class="search_title">绋嬪簭鍚嶏細</span>
-        <el-input
-          v-model="searchForm.programName"
-          style="width: 240px"
-          placeholder="璇疯緭鍏ョ▼搴忓悕鎼滅储"
-          @change="handleQuery"
-          clearable
-          :prefix-icon="Search"
-        />
+        <el-input v-model="searchForm.programName"
+                  style="width: 240px"
+                  placeholder="璇疯緭鍏ョ▼搴忓悕鎼滅储"
+                  @change="handleQuery"
+                  clearable
+                  :prefix-icon="Search" />
         <span class="search_title ml10">鎵ц鐘舵�侊細</span>
-        <el-select v-model="searchForm.status" clearable @change="handleQuery" style="width: 240px">
-          <el-option label="杩愯涓�" :value="'running'" />
-          <el-option label="宸插仠姝�" :value="'stopped'" />
-          <el-option label="寮傚父" :value="'error'" />
+        <el-select v-model="searchForm.status"
+                   clearable
+                   @change="handleQuery"
+                   style="width: 240px">
+          <el-option label="杩愯涓�"
+                     :value="'running'" />
+          <el-option label="宸插仠姝�"
+                     :value="'stopped'" />
+          <el-option label="寮傚父"
+                     :value="'error'" />
         </el-select>
-        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">
+        <el-button type="primary"
+                   @click="handleQuery"
+                   style="margin-left: 10px">
           鎼滅储
         </el-button>
       </div>
       <div>
-        <el-button type="primary" @click="openForm('add')">鏂板</el-button>
-        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+        <el-button @click="handleExport"
+                   style="margin-right: 10px">瀵煎嚭</el-button>
+        <el-button type="primary"
+                   @click="openForm('add')">鏂板</el-button>
+        <el-button type="danger"
+                   plain
+                   @click="handleDelete">鍒犻櫎</el-button>
       </div>
     </div>
     <div class="table_list">
-      <PIMTable
-        rowKey="id"
-        :column="tableColumn"
-        :tableData="tableData"
-        :page="page"
-        :isSelection="true"
-        @selection-change="handleSelectionChange"
-        :tableLoading="tableLoading"
-        @pagination="pagination"
-        :total="page.total"
-      ></PIMTable>
+      <PIMTable rowKey="id"
+                :column="tableColumn"
+                :tableData="tableData"
+                :page="page"
+                :isSelection="true"
+                @selection-change="handleSelectionChange"
+                :tableLoading="tableLoading"
+                @pagination="pagination"
+                :total="page.total"></PIMTable>
     </div>
-
     <!-- RPA琛ㄥ崟寮圭獥 -->
-    <el-dialog
-      v-model="dialogVisible"
-      :title="dialogTitle"
-      width="500px"
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="formRef"
-        :model="form"
-        :rules="rules"
-        label-width="100px"
-      >
-        <el-form-item label="绋嬪簭鍚�" prop="programName">
-          <el-input
-            v-model="form.programName"
-            placeholder="璇疯緭鍏ョ▼搴忓悕"
-            clearable
-          />
+    <el-dialog v-model="dialogVisible"
+               :title="dialogTitle"
+               width="500px"
+               :close-on-click-modal="false">
+      <el-form ref="formRef"
+               :model="form"
+               :rules="rules"
+               label-width="100px">
+        <el-form-item label="绋嬪簭鍚�"
+                      prop="programName">
+          <el-input v-model="form.programName"
+                    placeholder="璇疯緭鍏ョ▼搴忓悕"
+                    clearable />
         </el-form-item>
-        <el-form-item label="鎵ц鐘舵��" prop="status">
-          <el-select v-model="form.status" placeholder="璇烽�夋嫨鎵ц鐘舵��" style="width: 100%">
-            <el-option label="杩愯涓�" value="running" />
-            <el-option label="宸插仠姝�" value="stopped" />
-            <el-option label="寮傚父" value="error" />
+        <el-form-item label="鎵ц鐘舵��"
+                      prop="status">
+          <el-select v-model="form.status"
+                     placeholder="璇烽�夋嫨鎵ц鐘舵��"
+                     style="width: 100%">
+            <el-option label="杩愯涓�"
+                       value="running" />
+            <el-option label="宸插仠姝�"
+                       value="stopped" />
+            <el-option label="寮傚父"
+                       value="error" />
           </el-select>
         </el-form-item>
-        <el-form-item label="鎻忚堪" prop="description">
-          <el-input
-            v-model="form.description"
-            type="textarea"
-            :rows="3"
-            placeholder="璇疯緭鍏PA绋嬪簭鎻忚堪"
-            clearable
-          />
+        <el-form-item label="鎻忚堪"
+                      prop="description">
+          <el-input v-model="form.description"
+                    type="textarea"
+                    :rows="3"
+                    placeholder="璇疯緭鍏PA绋嬪簭鎻忚堪"
+                    clearable />
         </el-form-item>
       </el-form>
       <template #footer>
         <span class="dialog-footer">
+          <el-button type="primary"
+                     @click="submitForm">纭畾</el-button>
           <el-button @click="dialogVisible = false">鍙栨秷</el-button>
-          <el-button type="primary" @click="submitForm">纭畾</el-button>
         </span>
       </template>
     </el-dialog>
@@ -88,268 +97,304 @@
 </template>
 
 <script setup>
-import { Search } from "@element-plus/icons-vue";
-import { onMounted, ref, reactive, toRefs } from "vue";
-import { ElMessage, ElMessageBox } from "element-plus";
-import PIMTable from "@/components/PIMTable/PIMTable.vue";
-import {listRpa, addRpa, updateRpa, delRpa, delRpaBatch} from "@/api/collaborativeApproval/rpaManagement.js";
-// 鍝嶅簲寮忔暟鎹�
-const data = reactive({
-  searchForm: {
-    programName: "",
-    status: "",
-  },
-  form: {
-    programName: "",
-    status: "",
-    description: ""
-  },
-  dialogVisible: false,
-  dialogTitle: "",
-  dialogType: "add",
-  tableLoading: false,
-  page: {
-    current: 1,
-    size: 20,
-    total: 0,
-  },
-  tableData: [],
-});
-
-const { searchForm, form, dialogVisible, dialogTitle, dialogType, selectedIds, tableLoading, page, tableData } = toRefs(data);
-
-// 琛ㄥ崟寮曠敤
-const formRef = ref();
-// 閫夋嫨鐨勮鏁版嵁
-const selectedRows = ref([]);
-
-// 琛ㄥ崟楠岃瘉瑙勫垯
-const rules = {
-  programName: [
-    { required: true, message: "璇疯緭鍏ョ▼搴忓悕", trigger: "blur" }
-  ],
-  status: [
-    { required: true, message: "璇烽�夋嫨鎵ц鐘舵��", trigger: "change" }
-  ]
-};
-
-// 琛ㄦ牸鍒楅厤缃�
-const tableColumn = ref([
-  {
-    label: "绋嬪簭鍚�",
-    prop: "programName",
-    // width: 200,
-  },
-  {
-    label: "鎵ц鐘舵��",
-    prop: "status",
-    dataType: "tag",
-    // width: 120,
-    formatData: (params) => {
-      const statusMap = {
-        running: "杩愯涓�",
-        stopped: "宸插仠姝�",
-        error: "寮傚父"
-      };
-      return statusMap[params] || params;
+  import { Search } from "@element-plus/icons-vue";
+  import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue";
+  import { ElMessage, ElMessageBox } from "element-plus";
+  import PIMTable from "@/components/PIMTable/PIMTable.vue";
+  import {
+    listRpa,
+    addRpa,
+    updateRpa,
+    delRpa,
+    delRpaBatch,
+  } from "@/api/collaborativeApproval/rpaManagement.js";
+  // 鍝嶅簲寮忔暟鎹�
+  const data = reactive({
+    searchForm: {
+      programName: "",
+      status: "",
     },
-    formatType: (params) => {
-      const typeMap = {
-        running: "success",
-        stopped: "info",
-        error: "danger"
-      };
-      return typeMap[params] || "info";
-    }
-  },
-  {
-    label: "鎻忚堪",
-    prop: "description",
-    // width: 300,
-    showOverflowTooltip: true,
-  },
-  {
-    label: "鍒涘缓鏃堕棿",
-    prop: "createTime",
-    // width: 180,
-  },
-  {
-    dataType: "action",
-    label: "鎿嶄綔",
-    align: "center",
-    fixed: "right",
-    width: 150,
-    operation: [
-      {
-        name: "缂栬緫",
-        type: "text",
-        clickFun: (row) => {
-          openForm("edit", row);
-        }
+    form: {
+      programName: "",
+      status: "",
+      description: "",
+    },
+    dialogVisible: false,
+    dialogTitle: "",
+    dialogType: "add",
+    tableLoading: false,
+    page: {
+      current: 1,
+      size: 20,
+      total: 0,
+    },
+    tableData: [],
+  });
+
+  const {
+    searchForm,
+    form,
+    dialogVisible,
+    dialogTitle,
+    dialogType,
+    selectedIds,
+    tableLoading,
+    page,
+    tableData,
+  } = toRefs(data);
+
+  // 琛ㄥ崟寮曠敤
+  const formRef = ref();
+  // 閫夋嫨鐨勮鏁版嵁
+  const selectedRows = ref([]);
+
+  // 琛ㄥ崟楠岃瘉瑙勫垯
+  const rules = {
+    programName: [{ required: true, message: "璇疯緭鍏ョ▼搴忓悕", trigger: "blur" }],
+    status: [{ required: true, message: "璇烽�夋嫨鎵ц鐘舵��", trigger: "change" }],
+  };
+
+  // 琛ㄦ牸鍒楅厤缃�
+  const tableColumn = ref([
+    {
+      label: "绋嬪簭鍚�",
+      prop: "programName",
+      // width: 200,
+    },
+    {
+      label: "鎵ц鐘舵��",
+      prop: "status",
+      dataType: "tag",
+      // width: 120,
+      formatData: params => {
+        const statusMap = {
+          running: "杩愯涓�",
+          stopped: "宸插仠姝�",
+          error: "寮傚父",
+        };
+        return statusMap[params] || params;
       },
-      // {
-      //   name: "寮�濮�",
-      //   type: "text",
-      //   clickFun: (row) => {
-      //     handleStart(row);
-      //   },
-      //   disabled: (row) => row.status !== 'stopped'
-      // },
-      // {
-      //   name: "鍋滄",
-      //   type: "text",
-      //   clickFun: (row) => {
-      //     handleStop(row);
-      //   },
-      //   disabled: (row) => row.status === 'stopped'
-      // }
-    ]
-  }
-]);
-
-
-// 鐢熷懡鍛ㄦ湡
-onMounted(() => {
-  getList();
-});
-
-// 鏌ヨ鏁版嵁
-const handleQuery = () => {
-  // page.value.current = 1;
-  getList();
-};
-
-const getList = () => {
-  tableLoading.value = true;
-  listRpa({...page.value, ...searchForm.value})
-  .then(res => {
-    tableLoading.value = false;
-    tableData.value = res.data.records
-    page.total = res.data.total;
-  }).catch(err => {
-    tableLoading.value = false;
-  })
-};
-
-// 鍒嗛〉澶勭悊
-const pagination = (obj) => {
-  page.value.current = obj.page;
-  page.value.size = obj.limit;
-  handleQuery();
-};
-
-// 閫夋嫨鍙樺寲澶勭悊
-const handleSelectionChange = (selection) => {
-  selectedRows.value = selection;
-};
-
-// 鎵撳紑琛ㄥ崟
-const openForm = (type, row) => {
-  dialogType.value = type;
-  dialogVisible.value = true;
-  
-  if (type === "add") {
-    dialogTitle.value = "娣诲姞RPA";
-  } else {
-    dialogTitle.value = "缂栬緫RPA";
-    form.value = { ...row };
-  }
-};
-
-// 鎻愪氦琛ㄥ崟
-const submitForm = async () => {
-  if (!formRef.value) return;
-  
-  try {
-    await formRef.value.validate();
-    
-    if (dialogType.value === "add") {
-      // 娣诲姞鏂癛PA
-      addRpa({...form.value}).then(res => {
-        if(res.code == 200){
-          ElMessage.success("娣诲姞鎴愬姛");
-            form.value = {
-            programName: "",
-            status: "",
-            description: ""
+      formatType: params => {
+        const typeMap = {
+          running: "success",
+          stopped: "info",
+          error: "danger",
+        };
+        return typeMap[params] || "info";
+      },
+    },
+    {
+      label: "鎻忚堪",
+      prop: "description",
+      // width: 300,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍒涘缓鏃堕棿",
+      prop: "createTime",
+      // width: 180,
+    },
+    {
+      dataType: "action",
+      label: "鎿嶄綔",
+      align: "center",
+      fixed: "right",
+      width: 150,
+      operation: [
+        {
+          name: "缂栬緫",
+          type: "text",
+          clickFun: row => {
+            openForm("edit", row);
           },
-          dialogVisible.value = false;
-          getList();
-        }
-      }).catch(err => {
-        ElMessage.error(err.msg);
+        },
+        // {
+        //   name: "寮�濮�",
+        //   type: "text",
+        //   clickFun: (row) => {
+        //     handleStart(row);
+        //   },
+        //   disabled: (row) => row.status !== 'stopped'
+        // },
+        // {
+        //   name: "鍋滄",
+        //   type: "text",
+        //   clickFun: (row) => {
+        //     handleStop(row);
+        //   },
+        //   disabled: (row) => row.status === 'stopped'
+        // }
+      ],
+    },
+  ]);
+
+  // 鐢熷懡鍛ㄦ湡
+  onMounted(() => {
+    getList();
+  });
+
+  // 鏌ヨ鏁版嵁
+  const handleQuery = () => {
+    // page.value.current = 1;
+    getList();
+  };
+
+  const getList = () => {
+    tableLoading.value = true;
+    listRpa({ ...page.value, ...searchForm.value })
+      .then(res => {
+        tableLoading.value = false;
+        tableData.value = res.data.records;
+        page.total = res.data.total;
       })
+      .catch(err => {
+        tableLoading.value = false;
+      });
+  };
+
+  // 鍒嗛〉澶勭悊
+  const pagination = obj => {
+    page.value.current = obj.page;
+    page.value.size = obj.limit;
+    handleQuery();
+  };
+
+  // 閫夋嫨鍙樺寲澶勭悊
+  const handleSelectionChange = selection => {
+    selectedRows.value = selection;
+  };
+
+  // 鎵撳紑琛ㄥ崟
+  const openForm = (type, row) => {
+    dialogType.value = type;
+    dialogVisible.value = true;
+
+    if (type === "add") {
+      dialogTitle.value = "娣诲姞RPA";
     } else {
-      // 缂栬緫RPA
-      updateRpa({...form.value}).then(res => {
-        if(res.code == 200){
-          ElMessage.success("鏇存柊鎴愬姛");
-          dialogVisible.value = false;
-          getList();
-        }
-      }).catch(err => {
-        ElMessage.error(err.msg);
-      })
+      dialogTitle.value = "缂栬緫RPA";
+      form.value = { ...row };
     }
-  } catch (error) {
-    console.error("琛ㄥ崟楠岃瘉澶辫触:", error);
-  }
-};
+  };
 
-// 寮�濮婻PA
-const handleStart = (row) => {
-  ElMessageBox.confirm(`纭畾瑕佸惎鍔≧PA绋嬪簭"${row.programName}"鍚楋紵`, "鎻愮ず", {
-    confirmButtonText: "纭",
-    cancelButtonText: "鍙栨秷",
-    type: "warning",
-  }).then(() => {
-    row.status = "running";
-    ElMessage.success("RPA鍚姩鎴愬姛");
-    getList();
-  }).catch(() => {
-    // 鐢ㄦ埛鍙栨秷
-  });
-};
+  // 鎻愪氦琛ㄥ崟
+  const submitForm = async () => {
+    if (!formRef.value) return;
 
-// 鍋滄RPA
-const handleStop = (row) => {
-  ElMessageBox.confirm(`纭畾瑕佸仠姝PA绋嬪簭"${row.programName}"鍚楋紵`, "鎻愮ず", {
-    confirmButtonText: "纭",
-    cancelButtonText: "鍙栨秷",
-    type: "warning",
-  }).then(() => {
-    row.status = "stopped";
-    ElMessage.success("RPA鍋滄鎴愬姛");
-    getList();
-  }).catch(() => {
-    // 鐢ㄦ埛鍙栨秷
-  });
-};
+    try {
+      await formRef.value.validate();
 
-// 鍒犻櫎RPA
-const handleDelete = () => {
-  let ids = [];
-	if (selectedRows.value.length > 0) {
-		ids = selectedRows.value.map((item) => item.id);
-	} else {
-		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
-		return;
-	}
-  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-	.then(() => {
-		delRpa(ids).then((res) => {
-				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-				getList();
-			})			
-	})
-	.catch(() => {
-		proxy.$modal.msg("宸插彇娑�");
-	});
-};
+      if (dialogType.value === "add") {
+        // 娣诲姞鏂癛PA
+        addRpa({ ...form.value })
+          .then(res => {
+            if (res.code == 200) {
+              ElMessage.success("娣诲姞鎴愬姛");
+              (form.value = {
+                programName: "",
+                status: "",
+                description: "",
+              }),
+                (dialogVisible.value = false);
+              getList();
+            }
+          })
+          .catch(err => {
+            ElMessage.error(err.msg);
+          });
+      } else {
+        // 缂栬緫RPA
+        updateRpa({ ...form.value })
+          .then(res => {
+            if (res.code == 200) {
+              ElMessage.success("鏇存柊鎴愬姛");
+              dialogVisible.value = false;
+              getList();
+            }
+          })
+          .catch(err => {
+            ElMessage.error(err.msg);
+          });
+      }
+    } catch (error) {
+      console.error("琛ㄥ崟楠岃瘉澶辫触:", error);
+    }
+  };
+
+  // 寮�濮婻PA
+  const handleStart = row => {
+    ElMessageBox.confirm(`纭畾瑕佸惎鍔≧PA绋嬪簭"${row.programName}"鍚楋紵`, "鎻愮ず", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        row.status = "running";
+        ElMessage.success("RPA鍚姩鎴愬姛");
+        getList();
+      })
+      .catch(() => {
+        // 鐢ㄦ埛鍙栨秷
+      });
+  };
+
+  // 鍋滄RPA
+  const handleStop = row => {
+    ElMessageBox.confirm(`纭畾瑕佸仠姝PA绋嬪簭"${row.programName}"鍚楋紵`, "鎻愮ず", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        row.status = "stopped";
+        ElMessage.success("RPA鍋滄鎴愬姛");
+        getList();
+      })
+      .catch(() => {
+        // 鐢ㄦ埛鍙栨秷
+      });
+  };
+
+  // 鍒犻櫎RPA
+  const handleDelete = () => {
+    let ids = [];
+    if (selectedRows.value.length > 0) {
+      ids = selectedRows.value.map(item => item.id);
+    } else {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        delRpa(ids)
+          .then(res => {
+            if (res.code == 200) {
+              ElMessage.success("鍒犻櫎鎴愬姛");
+              getList();
+            }
+          })
+          .catch(err => {
+            ElMessage.error(err.msg);
+          });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
+  // 瀵煎嚭鍔熻兘
+  const { proxy } = getCurrentInstance();
+  const handleExport = () => {
+    proxy.download(
+      "/rpaProcessAutomation/export",
+      { ...searchForm.value },
+      "RPA绠$悊.xlsx"
+    );
+  };
 </script>
 
 <style scoped></style>

--
Gitblit v1.9.3