Zhangbw 1 сар өмнө
parent
commit
ceab344d99

+ 1 - 1
src/api/stock/info/index.ts

@@ -56,7 +56,7 @@ export function delStockInfo(ids: number | number[]) {
 /**
  * 添加股票到池
  */
-export function addToPool(data: { stockCode: string; stockName: string; poolType: number; reason?: string }) {
+export function addToPool(data: { stockCode: string; stockName: string; poolType: number; addDate?: string; reason?: string }) {
   return request({
     url: '/stock/pool/add',
     method: 'post',

+ 19 - 0
src/views/stock/info/index.vue

@@ -358,6 +358,25 @@ const getChangeClass = (val: any) => {
 /** 加入股票池 */
 const handleAddToPool = async (row: any, poolType: number) => {
   const poolName = poolType === 1 ? '超短池' : '强势池';
+
+  // 强势池直接加入,不弹窗
+  if (poolType === 2) {
+    try {
+      await addToPool({
+        stockCode: row.stockCode,
+        stockName: row.stockName,
+        poolType: poolType,
+        addDate: new Date().toISOString().split('T')[0] // 当天
+      });
+      proxy?.$modal.msgSuccess(`已加入${poolName}`);
+      await refreshQuotesOnly();
+    } catch (error) {
+      console.error('加入股票池失败:', error);
+    }
+    return;
+  }
+
+  // 超短池弹出日期选择对话框
   poolDialog.title = `加入${poolName}`;
   poolForm.value = {
     stockCode: row.stockCode,