tianxincode 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/components/Header.js +1 -1
  2. package/package.json +1 -1
  3. package/web/dist/assets/{AiLogsView-3J-YAusV.js → AiLogsView-rdisKFSa.js} +1 -1
  4. package/web/dist/assets/{DevWorkflowView-DMCpylwg.js → DevWorkflowView-CV7LEFE2.js} +5 -5
  5. package/web/dist/assets/DevWorkflowView-D_iXemzz.css +1 -0
  6. package/web/dist/assets/{Layout-B905ASbH.js → Layout-WWXhjQI7.js} +1 -1
  7. package/web/dist/assets/{TasksView-CCzwoCHn.js → TasksView-vUyC5Nlz.js} +1 -1
  8. package/web/dist/assets/{TerminalView-CxtZwfd-.js → TerminalView-qS_Sznel.js} +1 -1
  9. package/web/dist/assets/{cssMode-tUnhOlEq.js → cssMode-CJFHsxhF.js} +1 -1
  10. package/web/dist/assets/{freemarker2-BkGxlHtf.js → freemarker2-GCZND4I7.js} +1 -1
  11. package/web/dist/assets/{handlebars-BCSYP3By.js → handlebars-IPke9hyC.js} +1 -1
  12. package/web/dist/assets/{html-D_GMhfaP.js → html-Dl_nDKmC.js} +1 -1
  13. package/web/dist/assets/{htmlMode-DDgBAK4r.js → htmlMode-DpdrVNft.js} +1 -1
  14. package/web/dist/assets/{index-CUPB0bCv.js → index-TrZtH1m_.js} +7 -7
  15. package/web/dist/assets/{javascript-CGc1uqdW.js → javascript-DHT2J-uS.js} +1 -1
  16. package/web/dist/assets/{jsonMode-Ce0FYmxJ.js → jsonMode-BeJp-o3r.js} +1 -1
  17. package/web/dist/assets/{liquid-BwNgZkfv.js → liquid-C5FLdOvv.js} +1 -1
  18. package/web/dist/assets/{mdx-CF1JkZ9f.js → mdx-CZwiqZoo.js} +1 -1
  19. package/web/dist/assets/{python-CXnk0DYj.js → python-D5pMpjh7.js} +1 -1
  20. package/web/dist/assets/{razor-CWGzlt3Z.js → razor-Ba49D4hB.js} +1 -1
  21. package/web/dist/assets/{tsMode-CXhn7HXH.js → tsMode-vBfGu0Qc.js} +1 -1
  22. package/web/dist/assets/{typescript-DF01mLhp.js → typescript-NOD0JyOl.js} +1 -1
  23. package/web/dist/assets/{xml-ZLfViiJc.js → xml-CJKugy72.js} +1 -1
  24. package/web/dist/assets/{yaml-CV_nX5Yg.js → yaml-CEjcQv6-.js} +1 -1
  25. package/web/dist/index.html +1 -1
  26. package/web/dist/assets/DevWorkflowView-BRvigFN5.css +0 -1
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Box, Text } from 'ink';
3
- const VERSION = '1.0.14';
3
+ const VERSION = '1.0.15';
4
4
  export const Header = React.memo(function Header() {
5
5
  return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
6
6
  React.createElement(Text, { bold: true, cyan: true }, " "),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tianxincode",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "type": "module",
5
5
  "description": "AI Coding Assistant",
6
6
  "main": "dist/index.js",
@@ -1 +1 @@
1
- import{n as x,a as n}from"./index-CUPB0bCv.js";const c=[{key:"ai_call_logs",name:"AI 日志",icon:"fa-solid fa-robot text-xs"}],p={name:"AiLogsView",data(){return{logTypes:c,selectedLogType:c[0],logs:[],page:1,pageSize:20,total:0,totalPages:1,sessions:[],loading:!1,filters:{callType:"",sessionId:"",startTime:"",endTime:""}}},async created(){await this.loadSessions(),await this.loadLogs()},methods:{async loadSessions(){try{const s=await n.getSessions(100,0);this.sessions=s.data||[]}catch(s){console.error("Load sessions failed:",s)}},selectLogType(s){this.selectedLogType=s,this.resetFilters()},async loadLogs(){this.loading=!0;try{const s=await n.getAiCallLogs(this.page,this.pageSize);let t=s.data.rows||[];if(this.filters.callType&&(t=t.filter(e=>e.call_type===this.filters.callType)),this.filters.sessionId&&(t=t.filter(e=>e.session_id&&e.session_id.includes(this.filters.sessionId))),this.filters.startTime){const e=new Date(this.filters.startTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()>=e)}if(this.filters.endTime){const e=new Date(this.filters.endTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()<=e)}this.logs=t,this.total=s.data.total,this.totalPages=s.data.totalPages}catch(s){console.error("Load logs failed:",s),this.logs=[]}finally{this.loading=!1}},resetFilters(){this.filters.callType="",this.filters.sessionId="",this.filters.startTime="",this.filters.endTime="",this.page=1,this.loadLogs()},async prevPage(){this.page>1&&(this.page--,await this.loadLogs())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadLogs())},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},getSessionTitle(s){if(!s)return"-";const t=this.sessions.find(e=>e.id===s);return t?t.title:s.substring(0,8)},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"}}};var b=function(){var l,d;var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[t._m(0),e("div",{staticClass:"flex-1 overflow-y-auto py-1"},t._l(t.logTypes,function(a){var i;return e("div",{key:a.key,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:((i=t.selectedLogType)==null?void 0:i.key)===a.key?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(r){return t.selectLogType(a)}}},[e("i",{class:a.icon}),e("span",{staticClass:"truncate"},[t._v(t._s(a.name))])])}),0)]),e("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar"},[e("div",{staticClass:"flex items-center gap-4 mb-3"},[e("div",{staticClass:"flex items-center gap-2"},[e("i",{class:(l=t.selectedLogType)==null?void 0:l.icon}),e("span",{staticClass:"text-white font-medium"},[t._v(t._s((d=t.selectedLogType)==null?void 0:d.name))])]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.total)+" 条记录")])]),e("div",{staticClass:"flex items-center gap-4 flex-wrap"},[e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("调用类型:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.callType,expression:"filters.callType"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"callType",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部")]),e("option",{attrs:{value:"tool_call"}},[t._v("工具调用")]),e("option",{attrs:{value:"normal"}},[t._v("普通对话")])])]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("会话:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.sessionId,expression:"filters.sessionId"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"sessionId",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部会话")]),t._l(t.sessions,function(a){return e("option",{key:a.id,domProps:{value:a.id}},[t._v(t._s(a.title))])})],2)]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("开始时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.startTime,expression:"filters.startTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.startTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"startTime",a.target.value)}}})]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("结束时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.endTime,expression:"filters.endTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.endTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"endTime",a.target.value)}}})]),e("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:t.loadLogs}},[t._v(" 查询 ")]),e("button",{staticClass:"px-3 py-1 text-textMuted text-xs rounded hover:bg-white/10",on:{click:t.resetFilters}},[t._v(" 重置 ")])])]),e("div",{staticClass:"flex-1 overflow-auto p-4"},[e("table",{staticClass:"w-full text-sm"},[t._m(1),e("tbody",[t._l(t.logs,function(a){return e("tr",{key:a.id,staticClass:"hover:bg-white/5"},[e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.id))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatTime(a.request_time)))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[e("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.call_type==="tool_call"?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"},[t._v(" "+t._s(a.call_type==="tool_call"?"工具调用":"普通对话")+" ")])]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.model_name))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatDuration(a.duration_ms)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.input_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.output_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v("$"+t._s((a.cost||0).toFixed(4)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[150px]",attrs:{title:a.session_id}},[t._v(t._s(t.getSessionTitle(a.session_id)))])])}),t.logs.length===0?e("tr",[e("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"9"}},[t._v("暂无数据")])]):t._e()],2)])]),e("div",{staticClass:"flex items-center justify-between px-4 py-2 border-t border-border bg-sidebar"},[e("span",{staticClass:"text-xs text-textMuted"},[t._v("共 "+t._s(t.total)+" 条")]),e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page<=1},on:{click:t.prevPage}},[e("i",{staticClass:"fa-solid fa-chevron-left"}),t._v(" 上一页 ")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.page)+" / "+t._s(t.totalPages||1))]),e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page>=t.totalPages},on:{click:t.nextPage}},[t._v(" 下一页 "),e("i",{staticClass:"fa-solid fa-chevron-right"})])])])])])},f=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[t("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-list"}),s._v(" 日志 ")])])},function(){var s=this,t=s._self._c;return t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",[t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("ID")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("类型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输入Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输出Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("费用")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("会话ID")])])])}],u=x(p,b,f,!1,null,null);const _=u.exports;export{_ as default};
1
+ import{n as x,a as n}from"./index-TrZtH1m_.js";const c=[{key:"ai_call_logs",name:"AI 日志",icon:"fa-solid fa-robot text-xs"}],p={name:"AiLogsView",data(){return{logTypes:c,selectedLogType:c[0],logs:[],page:1,pageSize:20,total:0,totalPages:1,sessions:[],loading:!1,filters:{callType:"",sessionId:"",startTime:"",endTime:""}}},async created(){await this.loadSessions(),await this.loadLogs()},methods:{async loadSessions(){try{const s=await n.getSessions(100,0);this.sessions=s.data||[]}catch(s){console.error("Load sessions failed:",s)}},selectLogType(s){this.selectedLogType=s,this.resetFilters()},async loadLogs(){this.loading=!0;try{const s=await n.getAiCallLogs(this.page,this.pageSize);let t=s.data.rows||[];if(this.filters.callType&&(t=t.filter(e=>e.call_type===this.filters.callType)),this.filters.sessionId&&(t=t.filter(e=>e.session_id&&e.session_id.includes(this.filters.sessionId))),this.filters.startTime){const e=new Date(this.filters.startTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()>=e)}if(this.filters.endTime){const e=new Date(this.filters.endTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()<=e)}this.logs=t,this.total=s.data.total,this.totalPages=s.data.totalPages}catch(s){console.error("Load logs failed:",s),this.logs=[]}finally{this.loading=!1}},resetFilters(){this.filters.callType="",this.filters.sessionId="",this.filters.startTime="",this.filters.endTime="",this.page=1,this.loadLogs()},async prevPage(){this.page>1&&(this.page--,await this.loadLogs())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadLogs())},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},getSessionTitle(s){if(!s)return"-";const t=this.sessions.find(e=>e.id===s);return t?t.title:s.substring(0,8)},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"}}};var b=function(){var l,d;var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[t._m(0),e("div",{staticClass:"flex-1 overflow-y-auto py-1"},t._l(t.logTypes,function(a){var i;return e("div",{key:a.key,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:((i=t.selectedLogType)==null?void 0:i.key)===a.key?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(r){return t.selectLogType(a)}}},[e("i",{class:a.icon}),e("span",{staticClass:"truncate"},[t._v(t._s(a.name))])])}),0)]),e("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar"},[e("div",{staticClass:"flex items-center gap-4 mb-3"},[e("div",{staticClass:"flex items-center gap-2"},[e("i",{class:(l=t.selectedLogType)==null?void 0:l.icon}),e("span",{staticClass:"text-white font-medium"},[t._v(t._s((d=t.selectedLogType)==null?void 0:d.name))])]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.total)+" 条记录")])]),e("div",{staticClass:"flex items-center gap-4 flex-wrap"},[e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("调用类型:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.callType,expression:"filters.callType"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"callType",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部")]),e("option",{attrs:{value:"tool_call"}},[t._v("工具调用")]),e("option",{attrs:{value:"normal"}},[t._v("普通对话")])])]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("会话:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.sessionId,expression:"filters.sessionId"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"sessionId",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部会话")]),t._l(t.sessions,function(a){return e("option",{key:a.id,domProps:{value:a.id}},[t._v(t._s(a.title))])})],2)]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("开始时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.startTime,expression:"filters.startTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.startTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"startTime",a.target.value)}}})]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("结束时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.endTime,expression:"filters.endTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.endTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"endTime",a.target.value)}}})]),e("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:t.loadLogs}},[t._v(" 查询 ")]),e("button",{staticClass:"px-3 py-1 text-textMuted text-xs rounded hover:bg-white/10",on:{click:t.resetFilters}},[t._v(" 重置 ")])])]),e("div",{staticClass:"flex-1 overflow-auto p-4"},[e("table",{staticClass:"w-full text-sm"},[t._m(1),e("tbody",[t._l(t.logs,function(a){return e("tr",{key:a.id,staticClass:"hover:bg-white/5"},[e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.id))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatTime(a.request_time)))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[e("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.call_type==="tool_call"?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"},[t._v(" "+t._s(a.call_type==="tool_call"?"工具调用":"普通对话")+" ")])]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.model_name))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatDuration(a.duration_ms)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.input_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.output_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v("$"+t._s((a.cost||0).toFixed(4)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[150px]",attrs:{title:a.session_id}},[t._v(t._s(t.getSessionTitle(a.session_id)))])])}),t.logs.length===0?e("tr",[e("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"9"}},[t._v("暂无数据")])]):t._e()],2)])]),e("div",{staticClass:"flex items-center justify-between px-4 py-2 border-t border-border bg-sidebar"},[e("span",{staticClass:"text-xs text-textMuted"},[t._v("共 "+t._s(t.total)+" 条")]),e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page<=1},on:{click:t.prevPage}},[e("i",{staticClass:"fa-solid fa-chevron-left"}),t._v(" 上一页 ")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.page)+" / "+t._s(t.totalPages||1))]),e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page>=t.totalPages},on:{click:t.nextPage}},[t._v(" 下一页 "),e("i",{staticClass:"fa-solid fa-chevron-right"})])])])])])},f=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[t("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-list"}),s._v(" 日志 ")])])},function(){var s=this,t=s._self._c;return t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",[t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("ID")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("类型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输入Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输出Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("费用")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("会话ID")])])])}],u=x(p,b,f,!1,null,null);const _=u.exports;export{_ as default};
@@ -1,11 +1,11 @@
1
- import{n as m,F as C,C as v,M as _,g as S,a as o}from"./index-CUPB0bCv.js";const x={name:"WorkflowSidebar",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>{}},currentCategory:{type:String,default:""},currentProject:{type:String,default:""},currentStep:{type:Number,default:1},isLoading:{type:Boolean,default:!1}},data(){return{selectedCategory:"",selectedProject:"",steps:[{id:1,title:"新建需求",desc:"创建新的需求项目",icon:"el-icon-folder-add"},{id:2,title:"方案设计",desc:"编写需求方案",icon:"el-icon-edit"},{id:3,title:"代码生成",desc:"根据方案生成代码",icon:"el-icon-document"},{id:4,title:"测试验收",desc:"测试验证功能",icon:"el-icon-s-check"}]}},computed:{hasAnyProject(){return Object.keys(this.projects||{}).length>0},visibleSteps(){return this.hasAnyProject?this.steps:this.steps.filter(s=>s.id===1)}},watch:{currentCategory(s){this.selectedCategory=s},currentProject(s){this.selectedProject=s}},methods:{onCategoryChange(s){this.selectedProject="",this.$emit("category-change",s)},onProjectChange(s){this.$emit("project-change",s)},onStepClick(s){this.$emit("step-change",s)},isStepCompleted(s){var i;if(!this.currentProject)return!1;const e=`${this.currentCategory}/${this.currentProject}`,t=this.projects[e];return((i=t==null?void 0:t.stepStatus)==null?void 0:i[s])===!0}}};var D=function(){var e=this,t=e._self._c;return t("div",{staticClass:"workflow-sidebar"},[t("div",{staticClass:"sidebar-header"},[t("h3",[e._v("当前项目")]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("大类")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentCategory||"-"))])]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("需求")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentProject||"-"))])])]),t("div",{staticClass:"step-list"},e._l(e.visibleSteps,function(i){return t("div",{key:i.id,class:["step-item",{active:e.currentStep===i.id,completed:e.isStepCompleted(i.id)}],on:{click:function(n){return e.onStepClick(i.id)}}},[t("div",{staticClass:"step-icon"},[t("i",{class:i.icon})]),t("div",{staticClass:"step-info"},[t("div",{staticClass:"step-title"},[e._v(e._s(i.title))]),t("div",{staticClass:"step-desc"},[e._v(e._s(i.desc))])]),t("div",{staticClass:"step-status"},[e.isStepCompleted(i.id)?t("i",{staticClass:"el-icon-circle-check",staticStyle:{color:"#22c55e"}}):e._e()])])}),0)])},T=[],F=m(x,D,T,!1,null,"8e3cf2bb");const q=F.exports,R={name:"Step1NewReq",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>({})},basePath:{type:String,default:""},currentCategory:{type:String,default:""},currentProject:{type:String,default:""}},data(){return{selectedCategory:"",selectedProject:"",dialogVisible:!1,dialogInput:"",requirementDialogVisible:!1,requirementDialogInput:""}},computed:{existingRequirementList(){if(!this.selectedCategory)return[];const s=`${this.selectedCategory}/`;return Object.keys(this.projects).filter(e=>e.startsWith(s)).map(e=>e.split("/")[1]).sort()}},watch:{currentCategory:{immediate:!0,handler(s){this.selectedCategory=s||""}},currentProject:{immediate:!0,handler(s){this.selectedProject=s||""}},selectedCategory(s){s||(this.selectedProject="")},existingRequirementList(s){this.selectedProject&&(!Array.isArray(s)||s.length===0||s.includes(this.selectedProject)||(this.selectedProject=""))}},methods:{onCategoryChange(){this.selectedProject="",this.$emit("category-change",this.selectedCategory||""),this.$emit("project-change","")},onProjectChange(){this.$emit("project-change",this.selectedProject||"")},showCreateRequirementDialog(){if(!this.selectedCategory){this.$message.warning("请先选择大类");return}this.requirementDialogInput="",this.requirementDialogVisible=!0},handleCreateRequirementConfirm(){const s=this.requirementDialogInput.trim();if(!s){this.$message.warning("需求名称不能为空");return}if(this.existingRequirementList.includes(s)){this.$message.warning("该需求已存在");return}this.$emit("create-requirement",{category:this.selectedCategory,name:s}),this.requirementDialogVisible=!1},showCreateCategoryDialog(){this.dialogInput="",this.dialogVisible=!0},handleDialogConfirm(){const s=this.dialogInput.trim();if(!s){this.$message.warning("名称不能为空");return}this.$emit("create-category",s),this.dialogVisible=!1}}};var V=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step1-container"},[t("div",{staticClass:"step1-main"},[t("div",{staticClass:"panel-section"},[e._m(0),t("div",{staticClass:"panel-section-body"},[t("el-form",{attrs:{"label-position":"top",size:"small"}},[t("el-form-item",{attrs:{label:"所属大类"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"请选择大类"},on:{change:e.onCategoryChange},model:{value:e.selectedCategory,callback:function(i){e.selectedCategory=i},expression:"selectedCategory"}},e._l(e.categories,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{on:{click:e.showCreateCategoryDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("el-form-item",{attrs:{label:"选择需求"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"选择已有需求目录",disabled:!e.selectedCategory},on:{change:e.onProjectChange},model:{value:e.selectedProject,callback:function(i){e.selectedProject=i},expression:"selectedProject"}},e._l(e.existingRequirementList,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{attrs:{disabled:!e.selectedCategory},on:{click:e.showCreateRequirementDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("div",{staticClass:"form-hint",staticStyle:{color:"#84848a"}},[e._v(" "+e._s(e.selectedCategory?"可直接选择已有需求,或点击“新建”创建需求目录":"请先选择大类")+" ")])],1)],1)])]),t("el-dialog",{attrs:{title:"新建大类",visible:e.dialogVisible,width:"400px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"大类名称"}},[t("el-input",{attrs:{placeholder:"输入大类名称"},model:{value:e.dialogInput,callback:function(i){e.dialogInput=i},expression:"dialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确定")])],1)],1),t("el-dialog",{attrs:{title:"新建需求",visible:e.requirementDialogVisible,width:"400px"},on:{"update:visible":function(i){e.requirementDialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"需求目录名称"}},[t("el-input",{attrs:{placeholder:"输入需求名称,如:用户管理"},model:{value:e.requirementDialogInput,callback:function(i){e.requirementDialogInput=i},expression:"requirementDialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.requirementDialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCreateRequirementConfirm}},[e._v("确定")])],1)],1)],1)},K=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-section-header"},[e("span",[e("i",{staticClass:"el-icon-folder-add"}),s._v(" 创建新需求")])])}],N=m(R,V,K,!1,null,"bf976168");const W=N.exports,L={name:"Step2Design",components:{ModelSelectDialog:_,CommandDialog:v,FileSelectDialog:C},props:{projectKey:{type:String,default:""},specContent:{type:String,default:""},chatMessages:{type:Array,default:()=>[]},sessionId:{type:String,default:""}},data(){return{editor:null,inputMessage:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,compactionRatio:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1}},computed:{projectName(){if(!this.projectKey)return"";const s=this.projectKey.split("/");return s[s.length-1]||""},specFilePath(){return this.projectKey?`E:\\ai\\txcode\\.txcode\\req\\${this.projectKey}\\${this.projectName}_方案.md`:"等待选择项目..."}},watch:{specContent:{immediate:!0,handler(s){this.syncEditorContent(s)}},sessionId:{immediate:!0,handler(s){s&&(this.initWs(s),this.loadMessages())}}},mounted(){this.initMonacoEditor(),this.loadDefaultModel()},beforeDestroy(){this.editor&&this.editor.dispose(),this.dotInterval&&clearInterval(this.dotInterval)},methods:{syncEditorContent(s){if(!this.editor||s===void 0||s===null)return;const e=String(s);this.editor.getValue()!==e&&this.editor.setValue(e)},initMonacoEditor(){const s=document.createElement("script");s.src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js",s.onload=()=>{window.require.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs"}}),window.require(["vs/editor/editor.main"],()=>{this.editor=monaco.editor.create(this.$refs.editorContainer,{value:this.specContent||`# 选择或创建需求项目开始设计
1
+ import{n as m,F as C,C as v,M as _,g as S,a as o}from"./index-TrZtH1m_.js";const x={name:"WorkflowSidebar",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>{}},currentCategory:{type:String,default:""},currentProject:{type:String,default:""},currentStep:{type:Number,default:1},isLoading:{type:Boolean,default:!1}},data(){return{selectedCategory:"",selectedProject:"",steps:[{id:1,title:"新建需求",desc:"创建新的需求项目",icon:"el-icon-folder-add"},{id:2,title:"方案设计",desc:"编写需求方案",icon:"el-icon-edit"},{id:3,title:"代码生成",desc:"根据方案生成代码",icon:"el-icon-document"},{id:4,title:"测试验收",desc:"测试验证功能",icon:"el-icon-s-check"}]}},computed:{hasAnyProject(){return Object.keys(this.projects||{}).length>0},visibleSteps(){return this.hasAnyProject?this.steps:this.steps.filter(s=>s.id===1)}},watch:{currentCategory(s){this.selectedCategory=s},currentProject(s){this.selectedProject=s}},methods:{onCategoryChange(s){this.selectedProject="",this.$emit("category-change",s)},onProjectChange(s){this.$emit("project-change",s)},onStepClick(s){this.$emit("step-change",s)},isStepCompleted(s){var i;if(!this.currentProject)return!1;const e=`${this.currentCategory}/${this.currentProject}`,t=this.projects[e];return((i=t==null?void 0:t.stepStatus)==null?void 0:i[s])===!0}}};var D=function(){var e=this,t=e._self._c;return t("div",{staticClass:"workflow-sidebar"},[t("div",{staticClass:"sidebar-header"},[t("h3",[e._v("当前项目")]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("大类")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentCategory||"-"))])]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("需求")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentProject||"-"))])])]),t("div",{staticClass:"step-list"},e._l(e.visibleSteps,function(i){return t("div",{key:i.id,class:["step-item",{active:e.currentStep===i.id,completed:e.isStepCompleted(i.id)}],on:{click:function(n){return e.onStepClick(i.id)}}},[t("div",{staticClass:"step-icon"},[t("i",{class:i.icon})]),t("div",{staticClass:"step-info"},[t("div",{staticClass:"step-title"},[e._v(e._s(i.title))]),t("div",{staticClass:"step-desc"},[e._v(e._s(i.desc))])]),t("div",{staticClass:"step-status"},[e.isStepCompleted(i.id)?t("i",{staticClass:"el-icon-circle-check",staticStyle:{color:"#22c55e"}}):e._e()])])}),0)])},T=[],q=m(x,D,T,!1,null,"8e3cf2bb");const F=q.exports,R={name:"Step1NewReq",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>({})},basePath:{type:String,default:""},currentCategory:{type:String,default:""},currentProject:{type:String,default:""}},data(){return{selectedCategory:"",selectedProject:"",dialogVisible:!1,dialogInput:"",requirementDialogVisible:!1,requirementDialogInput:""}},computed:{existingRequirementList(){if(!this.selectedCategory)return[];const s=`${this.selectedCategory}/`;return Object.keys(this.projects).filter(e=>e.startsWith(s)).map(e=>e.split("/")[1]).sort()}},watch:{currentCategory:{immediate:!0,handler(s){this.selectedCategory=s||""}},currentProject:{immediate:!0,handler(s){this.selectedProject=s||""}},selectedCategory(s){s||(this.selectedProject="")},existingRequirementList(s){this.selectedProject&&(!Array.isArray(s)||s.length===0||s.includes(this.selectedProject)||(this.selectedProject=""))}},methods:{onCategoryChange(){this.selectedProject="",this.$emit("category-change",this.selectedCategory||""),this.$emit("project-change","")},onProjectChange(){this.$emit("project-change",this.selectedProject||"")},showCreateRequirementDialog(){if(!this.selectedCategory){this.$message.warning("请先选择大类");return}this.requirementDialogInput="",this.requirementDialogVisible=!0},handleCreateRequirementConfirm(){const s=this.requirementDialogInput.trim();if(!s){this.$message.warning("需求名称不能为空");return}if(this.existingRequirementList.includes(s)){this.$message.warning("该需求已存在");return}this.$emit("create-requirement",{category:this.selectedCategory,name:s}),this.requirementDialogVisible=!1},showCreateCategoryDialog(){this.dialogInput="",this.dialogVisible=!0},handleDialogConfirm(){const s=this.dialogInput.trim();if(!s){this.$message.warning("名称不能为空");return}this.$emit("create-category",s),this.dialogVisible=!1}}};var V=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step1-container"},[t("div",{staticClass:"step1-main"},[t("div",{staticClass:"panel-section"},[e._m(0),t("div",{staticClass:"panel-section-body"},[t("el-form",{attrs:{"label-position":"top",size:"small"}},[t("el-form-item",{attrs:{label:"所属大类"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"请选择大类"},on:{change:e.onCategoryChange},model:{value:e.selectedCategory,callback:function(i){e.selectedCategory=i},expression:"selectedCategory"}},e._l(e.categories,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{on:{click:e.showCreateCategoryDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("el-form-item",{attrs:{label:"选择需求"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"选择已有需求目录",disabled:!e.selectedCategory},on:{change:e.onProjectChange},model:{value:e.selectedProject,callback:function(i){e.selectedProject=i},expression:"selectedProject"}},e._l(e.existingRequirementList,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{attrs:{disabled:!e.selectedCategory},on:{click:e.showCreateRequirementDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("div",{staticClass:"form-hint",staticStyle:{color:"#84848a"}},[e._v(" "+e._s(e.selectedCategory?"可直接选择已有需求,或点击“新建”创建需求目录":"请先选择大类")+" ")])],1)],1)])]),t("el-dialog",{attrs:{title:"新建大类",visible:e.dialogVisible,width:"400px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"大类名称"}},[t("el-input",{attrs:{placeholder:"输入大类名称"},model:{value:e.dialogInput,callback:function(i){e.dialogInput=i},expression:"dialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确定")])],1)],1),t("el-dialog",{attrs:{title:"新建需求",visible:e.requirementDialogVisible,width:"400px"},on:{"update:visible":function(i){e.requirementDialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"需求目录名称"}},[t("el-input",{attrs:{placeholder:"输入需求名称,如:用户管理"},model:{value:e.requirementDialogInput,callback:function(i){e.requirementDialogInput=i},expression:"requirementDialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.requirementDialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCreateRequirementConfirm}},[e._v("确定")])],1)],1)],1)},K=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-section-header"},[e("span",[e("i",{staticClass:"el-icon-folder-add"}),s._v(" 创建新需求")])])}],N=m(R,V,K,!1,null,"bf976168");const W=N.exports,L={name:"Step2Design",components:{ModelSelectDialog:_,CommandDialog:v,FileSelectDialog:C},props:{projectKey:{type:String,default:""},specContent:{type:String,default:""},chatMessages:{type:Array,default:()=>[]},sessionId:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{editor:null,inputMessage:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,compactionRatio:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1}},computed:{projectName(){if(!this.projectKey)return"";const s=this.projectKey.split("/");return s[s.length-1]||""},specFilePath(){return this.projectKey?`${this.reqBasePath}\\${this.projectKey}\\${this.projectName}_方案.md`:"等待选择项目..."}},watch:{specContent:{immediate:!0,handler(s){this.syncEditorContent(s)}},sessionId:{immediate:!0,handler(s){s&&(this.initWs(s),this.loadMessages())}}},mounted(){this.initMonacoEditor(),this.loadDefaultModel()},beforeDestroy(){this.editor&&this.editor.dispose(),this.dotInterval&&clearInterval(this.dotInterval)},methods:{syncEditorContent(s){if(!this.editor||s===void 0||s===null)return;const e=String(s);this.editor.getValue()!==e&&this.editor.setValue(e)},initMonacoEditor(){const s=document.createElement("script");s.src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js",s.onload=()=>{window.require.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs"}}),window.require(["vs/editor/editor.main"],()=>{this.editor=monaco.editor.create(this.$refs.editorContainer,{value:this.specContent||`# 选择或创建需求项目开始设计
2
2
  `,language:"markdown",theme:"vs-dark",fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Monaco, Consolas, monospace",minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:16}}),this.editor.addCommand(monaco.KeyMod.CtrlCmd|monaco.KeyCode.KeyS,()=>{this.saveSpec()}),this.syncEditorContent(this.specContent)})},document.head.appendChild(s)},saveSpec(){if(!this.editor)return;const s=this.editor.getValue();this.$emit("save-spec",s)},handleKeydown(s){s.shiftKey||(s.preventDefault(),this.sendMessage())},async sendMessage(){var a;const s=this.inputMessage.trim();if(!s||this.disabled)return;let e=this.sessionId;if(!e)try{if(e=((a=(await o.createSession(`[方案设计] ${this.projectKey}`)).data)==null?void 0:a.id)||"",!e){this.$message.error("创建方案会话失败");return}this.$emit("update:sessionId",e),this.wsConnected=!1,this.initWs(e)}catch(r){console.error("Create design session failed:",r),this.$message.error("创建方案会话失败");return}const t=this.specFilePath,i=t&&t!=="等待选择项目..."?`先在 ${t} 生成方案,先不要修改代码。
3
3
 
4
- 用户输入: ${s}`:s;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s});let n=0;this.dotAnimation=this.dots[n],this.dotInterval=setInterval(()=>{n=(n+1)%this.dots.length,this.dotAnimation=this.dots[n]},150),o.sessionWsIsConnected(e)?o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0}):(this.initWs(e),setTimeout(()=>{o.sessionWsIsConnected(e)&&o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0})},500))},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,o.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},initWs(s=this.sessionId){!s||this.wsConnected||o.sessionWsConnect(s,e=>this.handleWsMessage(e),()=>{this.wsConnected=!0},()=>{this.wsConnected=!1,setTimeout(()=>{o.sessionWsIsConnected(s)||this.initWs(s)},3e3)},e=>{this.wsConnected=!1,console.error(e)})},handleWsMessage(s){var n,a;const{type:e,data:t,error:i}=s;switch(e){case"todos":t!=null&&t.todos&&this.logItems.push({type:"todos",todos:t.todos});break;case"session":t!=null&&t.sessionId&&!this.sessionId&&this.$emit("update:sessionId",t.sessionId);break;case"step":t&&(this.logItems.push({type:"step",thought:t.thought,toolCalls:t.toolCalls,success:t.success}),(n=t.usage)!=null&&n.promptTokens&&(this.promptTokens=t.usage.promptTokens));break;case"compact":this.logItems.push({type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadMessages();break;case"done":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,t!=null&&t.modelName&&(this.modelName=t.modelName),(a=t==null?void 0:t.usage)!=null&&a.promptTokens&&(this.promptTokens=t.usage.promptTokens),t!=null&&t.response&&this.logItems.push({type:"think",content:t.response}),this.$emit("messages-updated",this.logItems),this.$emit("spec-updated");break;case"stopped":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,this.logItems.push({type:"think",content:"【已停止】"});break;case"error":this.$message.error(i||"发生错误"),this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null;break}this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await o.getMessages(this.sessionId);this.logItems=s.data||[],this.$emit("messages-updated",this.logItems)}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await o.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,o.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?S(s):""}}};var A=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step2-container"},[t("div",{staticClass:"step2-main"},[t("div",{staticClass:"editor-panel"},[t("div",{staticClass:"editor-header"},[t("i",{staticClass:"el-icon-document"}),t("span",{attrs:{id:"spec-file-path"}},[e._v(e._s(e.specFilePath))])]),t("div",{ref:"editorContainer",staticClass:"editor-container"})]),t("div",{staticClass:"chat-panel"},[e._m(0),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("输入需求描述,AI将协助您完善方案")])]),e._l(e.logItems,function(i,n){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(a,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(a.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(a.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(a,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(a.function.name)+" "),a.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(a.function.name,a.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入消息... (Enter 发送, @ 选择文件)",disabled:e.disabled&&!e.stopping},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.disabled&&!e.stopping?"status-thinking":"status-ready"},[e._v(" "+e._s(e.disabled&&!e.stopping?e.dotAnimation+" 思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:e.promptTokens>5e4?"token-warning":""},[e._v(e._s(e.promptTokens||0)+e._s(e.promptTokens>5e4&&!e.compactionRatio?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),e.compactionRatio?t("span",{staticClass:"compaction-info"},[e._v(e._s(e.compactionRatio)+"%压缩")]):e._e(),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}})],1)},E=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-header"},[e("span",[e("i",{staticClass:"el-icon-chat-dot-round"}),s._v(" AI 方案助手")])])}],H=m(L,A,E,!1,null,"24f603b8");const B=H.exports,O={name:"Step3CodeGen",components:{ModelSelectDialog:_,CommandDialog:v,FileSelectDialog:C},props:{projectKey:{type:String,default:""},sessionId:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,compactionRatio:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1}},computed:{projectName(){if(!this.projectKey)return"";const s=this.projectKey.split("/");return s[s.length-1]||""},specFilePath(){return this.projectKey?`E:\\ai\\txcode\\.txcode\\req\\${this.projectKey}\\${this.projectName}_方案.md`:""}},watch:{sessionId:{immediate:!0,handler(s){s&&(this.initWs(),this.loadMessages())}}},mounted(){this.loadDefaultModel()},beforeDestroy(){this.dotInterval&&clearInterval(this.dotInterval)},methods:{handleKeydown(s){s.shiftKey||(s.preventDefault(),this.sendMessage())},insertGenerateCommand(){this.projectKey&&(this.inputMessage=`根据 ${this.specFilePath} 方案开发相应功能,先不要修改方案文档。`)},async sendMessage(){var a;const s=this.inputMessage.trim();if(!s||this.disabled)return;let e=this.sessionId;if(!e)try{if(e=((a=(await o.createSession(`[代码生成] ${this.projectKey}`)).data)==null?void 0:a.id)||"",!e){this.$message.error("创建代码会话失败");return}this.$emit("update:sessionId",e),this.wsConnected=!1,this.initWs(e)}catch(r){console.error("Create code session failed:",r),this.$message.error("创建代码会话失败");return}const t=this.specFilePath,i=this.projectKey?`先参考方案文件 ${t} 进行代码开发,先不要修改方案文档。
4
+ 用户输入: ${s}`:s;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s});let n=0;this.dotAnimation=this.dots[n],this.dotInterval=setInterval(()=>{n=(n+1)%this.dots.length,this.dotAnimation=this.dots[n]},150),o.sessionWsIsConnected(e)?o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0}):(this.initWs(e),setTimeout(()=>{o.sessionWsIsConnected(e)&&o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0})},500))},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,o.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},initWs(s=this.sessionId){!s||this.wsConnected||o.sessionWsConnect(s,e=>this.handleWsMessage(e),()=>{this.wsConnected=!0},()=>{this.wsConnected=!1,setTimeout(()=>{o.sessionWsIsConnected(s)||this.initWs(s)},3e3)},e=>{this.wsConnected=!1,console.error(e)})},handleWsMessage(s){var n,a;const{type:e,data:t,error:i}=s;switch(e){case"todos":t!=null&&t.todos&&this.logItems.push({type:"todos",todos:t.todos});break;case"session":t!=null&&t.sessionId&&!this.sessionId&&this.$emit("update:sessionId",t.sessionId);break;case"step":t&&(this.logItems.push({type:"step",thought:t.thought,toolCalls:t.toolCalls,success:t.success}),(n=t.usage)!=null&&n.promptTokens&&(this.promptTokens=t.usage.promptTokens));break;case"compact":this.logItems.push({type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadMessages();break;case"done":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,t!=null&&t.modelName&&(this.modelName=t.modelName),(a=t==null?void 0:t.usage)!=null&&a.promptTokens&&(this.promptTokens=t.usage.promptTokens),t!=null&&t.response&&this.logItems.push({type:"think",content:t.response}),this.$emit("messages-updated",this.logItems),this.$emit("spec-updated");break;case"stopped":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,this.logItems.push({type:"think",content:"【已停止】"});break;case"error":this.$message.error(i||"发生错误"),this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null;break}this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await o.getMessages(this.sessionId);this.logItems=s.data||[],this.$emit("messages-updated",this.logItems)}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await o.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,o.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?S(s):""}}};var A=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step2-container"},[t("div",{staticClass:"step2-main"},[t("div",{staticClass:"editor-panel"},[t("div",{staticClass:"editor-header"},[t("i",{staticClass:"el-icon-document"}),t("span",{attrs:{id:"spec-file-path"}},[e._v(e._s(e.specFilePath))])]),t("div",{ref:"editorContainer",staticClass:"editor-container"})]),t("div",{staticClass:"chat-panel"},[e._m(0),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("输入需求描述,AI将协助您完善方案")])]),e._l(e.logItems,function(i,n){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(a,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(a.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(a.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(a,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(a.function.name)+" "),a.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(a.function.name,a.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入消息... (Enter 发送, @ 选择文件)",disabled:e.disabled&&!e.stopping},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.disabled&&!e.stopping?"status-thinking":"status-ready"},[e._v(" "+e._s(e.disabled&&!e.stopping?e.dotAnimation+" 思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:e.promptTokens>5e4?"token-warning":""},[e._v(e._s(e.promptTokens||0)+e._s(e.promptTokens>5e4&&!e.compactionRatio?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),e.compactionRatio?t("span",{staticClass:"compaction-info"},[e._v(e._s(e.compactionRatio)+"%压缩")]):e._e(),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}})],1)},B=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-header"},[e("span",[e("i",{staticClass:"el-icon-chat-dot-round"}),s._v(" AI 方案助手")])])}],H=m(L,A,B,!1,null,"e93db796");const E=H.exports,O={name:"Step3CodeGen",components:{ModelSelectDialog:_,CommandDialog:v,FileSelectDialog:C},props:{projectKey:{type:String,default:""},sessionId:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,compactionRatio:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1}},computed:{projectName(){if(!this.projectKey)return"";const s=this.projectKey.split("/");return s[s.length-1]||""},specFilePath(){return this.projectKey?`${this.reqBasePath}\\${this.projectKey}\\${this.projectName}_方案.md`:""}},watch:{sessionId:{immediate:!0,handler(s){s&&(this.initWs(),this.loadMessages())}}},mounted(){this.loadDefaultModel()},beforeDestroy(){this.dotInterval&&clearInterval(this.dotInterval)},methods:{handleKeydown(s){s.shiftKey||(s.preventDefault(),this.sendMessage())},insertGenerateCommand(){this.projectKey&&(this.inputMessage=`根据 ${this.specFilePath} 方案开发相应功能,先不要修改方案文档。`)},async sendMessage(){var a;const s=this.inputMessage.trim();if(!s||this.disabled)return;let e=this.sessionId;if(!e)try{if(e=((a=(await o.createSession(`[代码生成] ${this.projectKey}`)).data)==null?void 0:a.id)||"",!e){this.$message.error("创建代码会话失败");return}this.$emit("update:sessionId",e),this.wsConnected=!1,this.initWs(e)}catch(r){console.error("Create code session failed:",r),this.$message.error("创建代码会话失败");return}const t=this.specFilePath,i=this.projectKey?`先参考方案文件 ${t} 进行代码开发,先不要修改方案文档。
5
5
 
6
- 用户输入: ${s}`:s;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s});let n=0;this.dotAnimation=this.dots[n],this.dotInterval=setInterval(()=>{n=(n+1)%this.dots.length,this.dotAnimation=this.dots[n]},150),o.sessionWsIsConnected(e)?o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0}):(this.initWs(e),setTimeout(()=>{o.sessionWsIsConnected(e)&&o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0})},500))},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,o.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},initWs(s=this.sessionId){!s||this.wsConnected||o.sessionWsConnect(s,e=>this.handleWsMessage(e),()=>{this.wsConnected=!0},()=>{this.wsConnected=!1,setTimeout(()=>{o.sessionWsIsConnected(s)||this.initWs(s)},3e3)},e=>{this.wsConnected=!1,console.error(e)})},handleWsMessage(s){var n,a;const{type:e,data:t,error:i}=s;switch(e){case"todos":t!=null&&t.todos&&this.logItems.push({type:"todos",todos:t.todos});break;case"session":t!=null&&t.sessionId&&!this.sessionId&&this.$emit("update:sessionId",t.sessionId);break;case"step":t&&(this.logItems.push({type:"step",thought:t.thought,toolCalls:t.toolCalls,success:t.success}),(n=t.usage)!=null&&n.promptTokens&&(this.promptTokens=t.usage.promptTokens));break;case"compact":this.logItems.push({type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadMessages();break;case"done":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,t!=null&&t.modelName&&(this.modelName=t.modelName),(a=t==null?void 0:t.usage)!=null&&a.promptTokens&&(this.promptTokens=t.usage.promptTokens),t!=null&&t.response&&this.logItems.push({type:"think",content:t.response});break;case"stopped":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,this.logItems.push({type:"think",content:"【已停止】"});break;case"error":this.$message.error(i||"发生错误"),this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null;break}this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await o.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await o.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,o.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?S(s):""}}};var J=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step3-container"},[t("div",{staticClass:"step3-main"},[t("div",{staticClass:"code-chat-panel"},[t("div",{staticClass:"panel-header"},[e._m(0),t("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertGenerateCommand}},[t("i",{staticClass:"el-icon-document"}),e._v(" 根据方案生成代码 ")])],1),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("点击上方按钮或输入需求生成代码")])]),e._l(e.logItems,function(i,n){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(a,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(a.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(a.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(a,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(a.function.name)+" "),a.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(a.function.name,a.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入代码修改要求... (Enter 发送, @ 选择文件)",disabled:e.disabled&&!e.stopping},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.disabled&&!e.stopping?"status-thinking":"status-ready"},[e._v(" "+e._s(e.disabled&&!e.stopping?e.dotAnimation+" 思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:e.promptTokens>5e4?"token-warning":""},[e._v(e._s(e.promptTokens||0)+e._s(e.promptTokens>5e4&&!e.compactionRatio?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),e.compactionRatio?t("span",{staticClass:"compaction-info"},[e._v(e._s(e.compactionRatio)+"%压缩")]):e._e(),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}})],1)},G=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-code"}),s._v(" 代码生成对话")])}],z=m(O,J,G,!1,null,"a1097356");const Y=z.exports,Q={name:"Step4Test",components:{ModelSelectDialog:_,CommandDialog:v,FileSelectDialog:C},props:{projectKey:{type:String,default:""},sessionId:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,compactionRatio:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1}},computed:{projectName(){if(!this.projectKey)return"";const s=this.projectKey.split("/");return s[s.length-1]||""},specFilePath(){return this.projectKey?`E:\\ai\\txcode\\.txcode\\req\\${this.projectKey}\\${this.projectName}_方案.md`:""}},watch:{sessionId:{immediate:!0,handler(s){s&&(this.initWs(),this.loadMessages())}}},mounted(){this.loadDefaultModel()},beforeDestroy(){this.dotInterval&&clearInterval(this.dotInterval)},methods:{handleKeydown(s){s.shiftKey||(s.preventDefault(),this.sendMessage())},insertTestCommand(){this.projectKey&&(this.inputMessage=`根据 ${this.specFilePath} 方案测试相应功能是否实现。`)},async sendMessage(){var a;const s=this.inputMessage.trim();if(!s||this.disabled)return;let e=this.sessionId;if(!e)try{if(e=((a=(await o.createSession(`[测试验收] ${this.projectKey}`)).data)==null?void 0:a.id)||"",!e){this.$message.error("创建测试会话失败");return}this.$emit("update:sessionId",e),this.wsConnected=!1,this.initWs(e)}catch(r){console.error("Create test session failed:",r),this.$message.error("创建测试会话失败");return}const t=this.specFilePath,i=this.projectKey?`先参考方案文件 ${t} 进行功能测试验收。
6
+ 用户输入: ${s}`:s;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s});let n=0;this.dotAnimation=this.dots[n],this.dotInterval=setInterval(()=>{n=(n+1)%this.dots.length,this.dotAnimation=this.dots[n]},150),o.sessionWsIsConnected(e)?o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0}):(this.initWs(e),setTimeout(()=>{o.sessionWsIsConnected(e)&&o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0})},500))},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,o.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},initWs(s=this.sessionId){!s||this.wsConnected||o.sessionWsConnect(s,e=>this.handleWsMessage(e),()=>{this.wsConnected=!0},()=>{this.wsConnected=!1,setTimeout(()=>{o.sessionWsIsConnected(s)||this.initWs(s)},3e3)},e=>{this.wsConnected=!1,console.error(e)})},handleWsMessage(s){var n,a;const{type:e,data:t,error:i}=s;switch(e){case"todos":t!=null&&t.todos&&this.logItems.push({type:"todos",todos:t.todos});break;case"session":t!=null&&t.sessionId&&!this.sessionId&&this.$emit("update:sessionId",t.sessionId);break;case"step":t&&(this.logItems.push({type:"step",thought:t.thought,toolCalls:t.toolCalls,success:t.success}),(n=t.usage)!=null&&n.promptTokens&&(this.promptTokens=t.usage.promptTokens));break;case"compact":this.logItems.push({type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadMessages();break;case"done":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,t!=null&&t.modelName&&(this.modelName=t.modelName),(a=t==null?void 0:t.usage)!=null&&a.promptTokens&&(this.promptTokens=t.usage.promptTokens),t!=null&&t.response&&this.logItems.push({type:"think",content:t.response});break;case"stopped":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,this.logItems.push({type:"think",content:"【已停止】"});break;case"error":this.$message.error(i||"发生错误"),this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null;break}this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await o.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await o.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,o.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?S(s):""}}};var J=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step3-container"},[t("div",{staticClass:"step3-main"},[t("div",{staticClass:"code-chat-panel"},[t("div",{staticClass:"panel-header"},[e._m(0),t("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertGenerateCommand}},[t("i",{staticClass:"el-icon-document"}),e._v(" 根据方案生成代码 ")])],1),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("点击上方按钮或输入需求生成代码")])]),e._l(e.logItems,function(i,n){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(a,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(a.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(a.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(a,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(a.function.name)+" "),a.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(a.function.name,a.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入代码修改要求... (Enter 发送, @ 选择文件)",disabled:e.disabled&&!e.stopping},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.disabled&&!e.stopping?"status-thinking":"status-ready"},[e._v(" "+e._s(e.disabled&&!e.stopping?e.dotAnimation+" 思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:e.promptTokens>5e4?"token-warning":""},[e._v(e._s(e.promptTokens||0)+e._s(e.promptTokens>5e4&&!e.compactionRatio?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),e.compactionRatio?t("span",{staticClass:"compaction-info"},[e._v(e._s(e.compactionRatio)+"%压缩")]):e._e(),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}})],1)},G=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-code"}),s._v(" 代码生成对话")])}],z=m(O,J,G,!1,null,"c8164685");const Y=z.exports,Q={name:"Step4Test",components:{ModelSelectDialog:_,CommandDialog:v,FileSelectDialog:C},props:{projectKey:{type:String,default:""},sessionId:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,compactionRatio:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1}},computed:{projectName(){if(!this.projectKey)return"";const s=this.projectKey.split("/");return s[s.length-1]||""},specFilePath(){return this.projectKey?`${this.reqBasePath}\\${this.projectKey}\\${this.projectName}_方案.md`:""}},watch:{sessionId:{immediate:!0,handler(s){s&&(this.initWs(),this.loadMessages())}}},mounted(){this.loadDefaultModel()},beforeDestroy(){this.dotInterval&&clearInterval(this.dotInterval)},methods:{handleKeydown(s){s.shiftKey||(s.preventDefault(),this.sendMessage())},insertTestCommand(){this.projectKey&&(this.inputMessage=`根据 ${this.specFilePath} 方案测试相应功能是否实现。`)},async sendMessage(){var a;const s=this.inputMessage.trim();if(!s||this.disabled)return;let e=this.sessionId;if(!e)try{if(e=((a=(await o.createSession(`[测试验收] ${this.projectKey}`)).data)==null?void 0:a.id)||"",!e){this.$message.error("创建测试会话失败");return}this.$emit("update:sessionId",e),this.wsConnected=!1,this.initWs(e)}catch(r){console.error("Create test session failed:",r),this.$message.error("创建测试会话失败");return}const t=this.specFilePath,i=this.projectKey?`先参考方案文件 ${t} 进行功能测试验收。
7
7
 
8
- 用户输入: ${s}`:s;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s});let n=0;this.dotAnimation=this.dots[n],this.dotInterval=setInterval(()=>{n=(n+1)%this.dots.length,this.dotAnimation=this.dots[n]},150),o.sessionWsIsConnected(e)?o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0}):(this.initWs(e),setTimeout(()=>{o.sessionWsIsConnected(e)&&o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0})},500))},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,o.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},initWs(s=this.sessionId){!s||this.wsConnected||o.sessionWsConnect(s,e=>this.handleWsMessage(e),()=>{this.wsConnected=!0},()=>{this.wsConnected=!1,setTimeout(()=>{o.sessionWsIsConnected(s)||this.initWs(s)},3e3)},e=>{this.wsConnected=!1,console.error(e)})},handleWsMessage(s){var n,a;const{type:e,data:t,error:i}=s;switch(e){case"todos":t!=null&&t.todos&&this.logItems.push({type:"todos",todos:t.todos});break;case"session":t!=null&&t.sessionId&&!this.sessionId&&this.$emit("update:sessionId",t.sessionId);break;case"step":t&&(this.logItems.push({type:"step",thought:t.thought,toolCalls:t.toolCalls,success:t.success}),(n=t.usage)!=null&&n.promptTokens&&(this.promptTokens=t.usage.promptTokens));break;case"compact":this.logItems.push({type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadMessages();break;case"done":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,t!=null&&t.modelName&&(this.modelName=t.modelName),(a=t==null?void 0:t.usage)!=null&&a.promptTokens&&(this.promptTokens=t.usage.promptTokens),t!=null&&t.response&&this.logItems.push({type:"think",content:t.response});break;case"stopped":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,this.logItems.push({type:"think",content:"【已停止】"});break;case"error":this.$message.error(i||"发生错误"),this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null;break}this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await o.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await o.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,o.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?S(s):""}}};var U=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step4-container"},[t("div",{staticClass:"step4-main"},[t("div",{staticClass:"code-chat-panel"},[t("div",{staticClass:"panel-header"},[e._m(0),t("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertTestCommand}},[t("i",{staticClass:"el-icon-s-claim"}),e._v(" 根据方案测试 ")])],1),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("点击上方按钮或输入测试要求进行验收")])]),e._l(e.logItems,function(i,n){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(a,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(a.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(a.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(a,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(a.function.name)+" "),a.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(a.function.name,a.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入测试要求... (Enter 发送, @ 选择文件)",disabled:e.disabled&&!e.stopping},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.disabled&&!e.stopping?"status-thinking":"status-ready"},[e._v(" "+e._s(e.disabled&&!e.stopping?e.dotAnimation+" 思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:e.promptTokens>5e4?"token-warning":""},[e._v(e._s(e.promptTokens||0)+e._s(e.promptTokens>5e4&&!e.compactionRatio?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),e.compactionRatio?t("span",{staticClass:"compaction-info"},[e._v(e._s(e.compactionRatio)+"%压缩")]):e._e(),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}})],1)},X=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-s-check"}),s._v(" 测试验收对话")])}],Z=m(Q,U,X,!1,null,"407d40b9");const ee=Z.exports,I="software_dev_workflow",te={name:"DevWorkflowView",components:{WorkflowSidebar:q,Step1NewReq:W,Step2Design:B,Step3CodeGen:Y,Step4Test:ee},props:{sidebarVisible:{type:Boolean,default:!0}},data(){return{currentCategory:"",currentProject:"",categories:[],projects:{},currentStep:1,reqBasePath:"",isLoadingProjects:!1}},computed:{projectKey(){return!this.currentCategory||!this.currentProject?"":`${this.currentCategory}/${this.currentProject}`},currentProjectData(){return this.projects[this.projectKey]||null},hasSelectedProject(){return!!this.currentProjectData},currentSpecContent(){var s;return((s=this.currentProjectData)==null?void 0:s.specFile)||""},currentChatMessages(){if(!this.currentProjectData)return[];switch(this.currentStep){case 2:return this.currentProjectData.designChatHistory||[];case 3:return this.currentProjectData.codeChatHistory||[];case 4:return this.currentProjectData.testChatHistory||[];default:return[]}},currentSessionId(){return this.currentProjectData&&this.currentProjectData.designSessionId||""},currentCodeSessionId(){return this.currentProjectData&&this.currentProjectData.codeSessionId||""},currentTestSessionId(){return this.currentProjectData&&this.currentProjectData.testSessionId||""},stepTitle(){return{1:"新建需求",2:"方案设计",3:"代码生成",4:"测试验收"}[this.currentStep]||""},statusText(){return this.projectKey?`步骤 ${this.currentStep} / 4`:"就绪"}},created(){this.loadState(),this.loadCategories()},methods:{getSpecPath(s,e){return`${this.reqBasePath}\\${s}\\${e}\\${e}_方案.md`},getLegacySpecPath(s,e){return`${this.reqBasePath}\\${s}\\${e}\\方案.md`},getSessionPath(s,e){return`${this.reqBasePath}\\${s}\\${e}\\session.json`},async readSessionConfig(s,e){const t=this.getSessionPath(s,e);try{const i=await o.getFileContent(t);return JSON.parse(i.content||"{}")}catch{return{}}},async writeSessionConfig(s,e,t){const i=this.getSessionPath(s,e);await o.writeFile(i,JSON.stringify(t,null,2))},async persistProjectSessionsByKey(s,e={}){if(!s)return;const[t,i]=s.split("/"),n=this.projects[s]||{},a={designSessionId:e.designSessionId??n.designSessionId??"",codeSessionId:e.codeSessionId??n.codeSessionId??"",testSessionId:e.testSessionId??n.testSessionId??""};await this.writeSessionConfig(t,i,a)},loadState(){const s=localStorage.getItem(I);if(s){const e=JSON.parse(s);this.projects=e.projects||{},this.currentCategory=e.currentCategory||"",this.currentProject=e.currentProject||"",this.currentStep=e.currentStep||1}},saveState(){localStorage.setItem(I,JSON.stringify({currentCategory:this.currentCategory,currentProject:this.currentProject,projects:this.projects,currentStep:this.currentStep}))},generateSessionId(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){const e=Math.random()*16|0;return(s==="x"?e:e&3|8).toString(16)})},async loadCategories(){var s,e;try{const t=await o.getCwd();this.reqBasePath=((s=t.data)==null?void 0:s.basePath)||"";const n=((e=(await o.browseFilesystem(this.reqBasePath)).data)==null?void 0:e.items)||[];this.categories=n.filter(a=>a.is_directory).map(a=>a.name),this.categories.sort(),await this.loadAllRequirements(),this.ensureValidSelection()}catch(t){console.error("Load categories failed:",t),this.categories=[]}},ensureValidSelection(){if(!this.categories.length){this.currentCategory="",this.currentProject="",this.currentStep=1,this.saveState();return}(!this.currentCategory||!this.categories.includes(this.currentCategory))&&(this.currentCategory=this.categories[0]);const s=Object.keys(this.projects).filter(e=>e.startsWith(`${this.currentCategory}/`)).map(e=>e.split("/")[1]).sort();s.length?(!this.currentProject||!s.includes(this.currentProject))&&(this.currentProject=s[0]):(this.currentProject="",this.currentStep=1),this.saveState()},async loadAllRequirements(){const s={...this.projects};this.projects={};for(const e of this.categories)await this.loadRequirementsForCategory(e,s)},async loadRequirementsForCategory(s,e={}){var t,i;try{const n=`${this.reqBasePath}\\${s}`,l=(((t=(await o.browseFilesystem(n)).data)==null?void 0:t.items)||[]).filter(d=>d.is_directory);for(const d of l){const p=`${s}/${d.name}`,j=`${n}\\${d.name}`,b=this.getSpecPath(s,d.name),k=this.getLegacySpecPath(s,d.name),w=this.getSessionPath(s,d.name);let g=[];try{g=((i=(await o.browseFilesystem(j)).data)==null?void 0:i.items)||[]}catch{g=[]}const y=new Set(g.map(f=>f.name)),$=y.has(`${d.name}_方案.md`),P=y.has("方案.md"),M=y.has("session.json");let h="";if($)try{h=(await o.getFileContent(b)).content||""}catch{h=""}else if(P)try{h=(await o.getFileContent(k)).content||"",await o.writeFile(b,h)}catch{h=""}let u={};if(M)u=await this.readSessionConfig(s,d.name);else{u={designSessionId:"",codeSessionId:"",testSessionId:""};try{await o.writeFile(w,JSON.stringify(u,null,2))}catch{}}const c=e[p];this.$set(this.projects,p,{category:s,name:d.name,specFile:h,designSessionId:u.designSessionId||(c==null?void 0:c.designSessionId)||"",codeSessionId:u.codeSessionId||(c==null?void 0:c.codeSessionId)||"",testSessionId:u.testSessionId||(c==null?void 0:c.testSessionId)||"",designChatHistory:(c==null?void 0:c.designChatHistory)||[],codeChatHistory:(c==null?void 0:c.codeChatHistory)||[],testChatHistory:(c==null?void 0:c.testChatHistory)||[],stepStatus:(c==null?void 0:c.stepStatus)||{1:!0,2:!1,3:!1,4:!1}})}}catch(n){console.error(`Load requirements for ${s} failed:`,n)}},async onCategoryChange(s){if(this.currentCategory=s,this.currentProject="",!s){this.saveState();return}this.isLoadingProjects=!0,await this.loadRequirementsForCategory(s,this.projects),this.isLoadingProjects=!1,this.saveState()},onProjectChange(s){this.currentProject=s,!this.currentProject&&this.currentStep>1&&(this.currentStep=1),this.saveState()},onStepChange(s){!this.currentProjectData&&s>1||(this.currentStep=s,this.saveState())},async updateDesignSessionId(s){if(!s||!this.projectKey)return;const e=this.projectKey,t=this.projects[e]||{};this.$set(this.projects,e,{...t,designSessionId:s}),this.saveState();try{await this.persistProjectSessionsByKey(e,{designSessionId:s})}catch(i){console.error("Persist design session failed:",i)}},async updateCodeSessionId(s){if(!s||!this.projectKey)return;const e=this.projectKey,t=this.projects[e]||{};this.$set(this.projects,e,{...t,codeSessionId:s}),this.saveState();try{await this.persistProjectSessionsByKey(e,{codeSessionId:s})}catch(i){console.error("Persist code session failed:",i)}},async updateTestSessionId(s){if(!s||!this.projectKey)return;const e=this.projectKey,t=this.projects[e]||{};this.$set(this.projects,e,{...t,testSessionId:s}),this.saveState();try{await this.persistProjectSessionsByKey(e,{testSessionId:s})}catch(i){console.error("Persist test session failed:",i)}},async createCategory(s){if(this.categories.includes(s)){this.$message.warning("大类已存在");return}try{const e=`${this.reqBasePath}\\${s}`;await o.createDirectory(e),this.categories.push(s),this.categories.sort(),this.$message.success(`大类「${s}」创建成功`)}catch(e){console.error("Create category failed:",e),this.$message.error("创建大类失败")}},async renameCategory({oldName:s,newName:e}){if(this.categories.includes(e)){this.$message.warning("名称已存在");return}try{const t=`${this.reqBasePath}\\${s}`;await o.renameFile(t,e);const i=this.categories.indexOf(s);i>-1&&(this.categories[i]=e),this.categories.sort();const n={};for(const a in this.projects){const[r,l]=a.split("/");if(r===s){const d=`${e}/${l}`;n[d]={...this.projects[a],category:e}}else n[a]=this.projects[a]}this.projects=n,this.currentCategory===s&&(this.currentCategory=e),this.saveState(),this.$message.success(`已重命名为「${e}」`)}catch(t){console.error("Rename category failed:",t),this.$message.error("重命名大类失败")}},async deleteCategory(s){try{const e=`${this.reqBasePath}\\${s}`;await o.deleteFile(e),this.categories=this.categories.filter(i=>i!==s);const t=[];for(const i in this.projects)i.startsWith(s+"/")&&t.push(i);t.forEach(i=>delete this.projects[i]),this.currentCategory===s&&(this.currentCategory="",this.currentProject=""),this.saveState(),this.$message.success(`大类「${s}」已删除`)}catch(e){console.error("Delete category failed:",e),this.$message.error("删除大类失败")}},async createRequirement({category:s,name:e}){const t=`${s}/${e}`;if(this.projects[t]){this.$message.warning("需求已存在");return}try{const l=`${this.reqBasePath}\\${s}\\${e}`;await o.createDirectory(l)}catch(l){console.error("Create requirement directory failed:",l)}const i=`# ${e}方案
8
+ 用户输入: ${s}`:s;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s});let n=0;this.dotAnimation=this.dots[n],this.dotInterval=setInterval(()=>{n=(n+1)%this.dots.length,this.dotAnimation=this.dots[n]},150),o.sessionWsIsConnected(e)?o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0}):(this.initWs(e),setTimeout(()=>{o.sessionWsIsConnected(e)&&o.sessionWsSend(e,"chat",{message:i,sessionId:e,modelName:this.modelName||void 0})},500))},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,o.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},initWs(s=this.sessionId){!s||this.wsConnected||o.sessionWsConnect(s,e=>this.handleWsMessage(e),()=>{this.wsConnected=!0},()=>{this.wsConnected=!1,setTimeout(()=>{o.sessionWsIsConnected(s)||this.initWs(s)},3e3)},e=>{this.wsConnected=!1,console.error(e)})},handleWsMessage(s){var n,a;const{type:e,data:t,error:i}=s;switch(e){case"todos":t!=null&&t.todos&&this.logItems.push({type:"todos",todos:t.todos});break;case"session":t!=null&&t.sessionId&&!this.sessionId&&this.$emit("update:sessionId",t.sessionId);break;case"step":t&&(this.logItems.push({type:"step",thought:t.thought,toolCalls:t.toolCalls,success:t.success}),(n=t.usage)!=null&&n.promptTokens&&(this.promptTokens=t.usage.promptTokens));break;case"compact":this.logItems.push({type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadMessages();break;case"done":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,t!=null&&t.modelName&&(this.modelName=t.modelName),(a=t==null?void 0:t.usage)!=null&&a.promptTokens&&(this.promptTokens=t.usage.promptTokens),t!=null&&t.response&&this.logItems.push({type:"think",content:t.response});break;case"stopped":this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null,this.logItems.push({type:"think",content:"【已停止】"});break;case"error":this.$message.error(i||"发生错误"),this.disabled=!1,this.stopping=!1,this.dotAnimation="",clearInterval(this.dotInterval),this.dotInterval=null;break}this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await o.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await o.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,o.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?S(s):""}}};var U=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step4-container"},[t("div",{staticClass:"step4-main"},[t("div",{staticClass:"code-chat-panel"},[t("div",{staticClass:"panel-header"},[e._m(0),t("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertTestCommand}},[t("i",{staticClass:"el-icon-s-claim"}),e._v(" 根据方案测试 ")])],1),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("点击上方按钮或输入测试要求进行验收")])]),e._l(e.logItems,function(i,n){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(a,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(a.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(a.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(a,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(a.function.name)+" "),a.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(a.function.name,a.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入测试要求... (Enter 发送, @ 选择文件)",disabled:e.disabled&&!e.stopping},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.disabled&&!e.stopping?"status-thinking":"status-ready"},[e._v(" "+e._s(e.disabled&&!e.stopping?e.dotAnimation+" 思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:e.promptTokens>5e4?"token-warning":""},[e._v(e._s(e.promptTokens||0)+e._s(e.promptTokens>5e4&&!e.compactionRatio?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),e.compactionRatio?t("span",{staticClass:"compaction-info"},[e._v(e._s(e.compactionRatio)+"%压缩")]):e._e(),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}})],1)},X=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-s-check"}),s._v(" 测试验收对话")])}],Z=m(Q,U,X,!1,null,"adc5c6ca");const ee=Z.exports,I="software_dev_workflow",te={name:"DevWorkflowView",components:{WorkflowSidebar:F,Step1NewReq:W,Step2Design:E,Step3CodeGen:Y,Step4Test:ee},props:{sidebarVisible:{type:Boolean,default:!0}},data(){return{currentCategory:"",currentProject:"",categories:[],projects:{},currentStep:1,reqBasePath:"",isLoadingProjects:!1}},computed:{projectKey(){return!this.currentCategory||!this.currentProject?"":`${this.currentCategory}/${this.currentProject}`},currentProjectData(){return this.projects[this.projectKey]||null},hasSelectedProject(){return!!this.currentProjectData},currentSpecContent(){var s;return((s=this.currentProjectData)==null?void 0:s.specFile)||""},currentChatMessages(){if(!this.currentProjectData)return[];switch(this.currentStep){case 2:return this.currentProjectData.designChatHistory||[];case 3:return this.currentProjectData.codeChatHistory||[];case 4:return this.currentProjectData.testChatHistory||[];default:return[]}},currentSessionId(){return this.currentProjectData&&this.currentProjectData.designSessionId||""},currentCodeSessionId(){return this.currentProjectData&&this.currentProjectData.codeSessionId||""},currentTestSessionId(){return this.currentProjectData&&this.currentProjectData.testSessionId||""},stepTitle(){return{1:"新建需求",2:"方案设计",3:"代码生成",4:"测试验收"}[this.currentStep]||""},statusText(){return this.projectKey?`步骤 ${this.currentStep} / 4`:"就绪"}},created(){this.loadState(),this.loadCategories()},methods:{getSpecPath(s,e){return`${this.reqBasePath}\\${s}\\${e}\\${e}_方案.md`},getLegacySpecPath(s,e){return`${this.reqBasePath}\\${s}\\${e}\\方案.md`},getSessionPath(s,e){return`${this.reqBasePath}\\${s}\\${e}\\session.json`},async readSessionConfig(s,e){const t=this.getSessionPath(s,e);try{const i=await o.getFileContent(t);return JSON.parse(i.content||"{}")}catch{return{}}},async writeSessionConfig(s,e,t){const i=this.getSessionPath(s,e);await o.writeFile(i,JSON.stringify(t,null,2))},async persistProjectSessionsByKey(s,e={}){if(!s)return;const[t,i]=s.split("/"),n=this.projects[s]||{},a={designSessionId:e.designSessionId??n.designSessionId??"",codeSessionId:e.codeSessionId??n.codeSessionId??"",testSessionId:e.testSessionId??n.testSessionId??""};await this.writeSessionConfig(t,i,a)},loadState(){const s=localStorage.getItem(I);if(s){const e=JSON.parse(s);this.projects=e.projects||{},this.currentCategory=e.currentCategory||"",this.currentProject=e.currentProject||"",this.currentStep=e.currentStep||1}},saveState(){localStorage.setItem(I,JSON.stringify({currentCategory:this.currentCategory,currentProject:this.currentProject,projects:this.projects,currentStep:this.currentStep}))},generateSessionId(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){const e=Math.random()*16|0;return(s==="x"?e:e&3|8).toString(16)})},async loadCategories(){var s,e;try{const t=await o.getCwd();this.reqBasePath=((s=t.data)==null?void 0:s.basePath)||"";const n=((e=(await o.browseFilesystem(this.reqBasePath)).data)==null?void 0:e.items)||[];this.categories=n.filter(a=>a.is_directory).map(a=>a.name),this.categories.sort(),await this.loadAllRequirements(),this.ensureValidSelection()}catch(t){console.error("Load categories failed:",t),this.categories=[]}},ensureValidSelection(){if(!this.categories.length){this.currentCategory="",this.currentProject="",this.currentStep=1,this.saveState();return}(!this.currentCategory||!this.categories.includes(this.currentCategory))&&(this.currentCategory=this.categories[0]);const s=Object.keys(this.projects).filter(e=>e.startsWith(`${this.currentCategory}/`)).map(e=>e.split("/")[1]).sort();s.length?(!this.currentProject||!s.includes(this.currentProject))&&(this.currentProject=s[0]):(this.currentProject="",this.currentStep=1),this.saveState()},async loadAllRequirements(){const s={...this.projects};this.projects={};for(const e of this.categories)await this.loadRequirementsForCategory(e,s)},async loadRequirementsForCategory(s,e={}){var t,i;try{const n=`${this.reqBasePath}\\${s}`,l=(((t=(await o.browseFilesystem(n)).data)==null?void 0:t.items)||[]).filter(d=>d.is_directory);for(const d of l){const p=`${s}/${d.name}`,j=`${n}\\${d.name}`,b=this.getSpecPath(s,d.name),k=this.getLegacySpecPath(s,d.name),$=this.getSessionPath(s,d.name);let g=[];try{g=((i=(await o.browseFilesystem(j)).data)==null?void 0:i.items)||[]}catch{g=[]}const y=new Set(g.map(f=>f.name)),w=y.has(`${d.name}_方案.md`),P=y.has("方案.md"),M=y.has("session.json");let h="";if(w)try{h=(await o.getFileContent(b)).content||""}catch{h=""}else if(P)try{h=(await o.getFileContent(k)).content||"",await o.writeFile(b,h)}catch{h=""}let u={};if(M)u=await this.readSessionConfig(s,d.name);else{u={designSessionId:"",codeSessionId:"",testSessionId:""};try{await o.writeFile($,JSON.stringify(u,null,2))}catch{}}const c=e[p];this.$set(this.projects,p,{category:s,name:d.name,specFile:h,designSessionId:u.designSessionId||(c==null?void 0:c.designSessionId)||"",codeSessionId:u.codeSessionId||(c==null?void 0:c.codeSessionId)||"",testSessionId:u.testSessionId||(c==null?void 0:c.testSessionId)||"",designChatHistory:(c==null?void 0:c.designChatHistory)||[],codeChatHistory:(c==null?void 0:c.codeChatHistory)||[],testChatHistory:(c==null?void 0:c.testChatHistory)||[],stepStatus:(c==null?void 0:c.stepStatus)||{1:!0,2:!1,3:!1,4:!1}})}}catch(n){console.error(`Load requirements for ${s} failed:`,n)}},async onCategoryChange(s){if(this.currentCategory=s,this.currentProject="",!s){this.saveState();return}this.isLoadingProjects=!0,await this.loadRequirementsForCategory(s,this.projects),this.isLoadingProjects=!1,this.saveState()},onProjectChange(s){this.currentProject=s,!this.currentProject&&this.currentStep>1&&(this.currentStep=1),this.saveState()},onStepChange(s){!this.currentProjectData&&s>1||(this.currentStep=s,this.saveState())},async updateDesignSessionId(s){if(!s||!this.projectKey)return;const e=this.projectKey,t=this.projects[e]||{};this.$set(this.projects,e,{...t,designSessionId:s}),this.saveState();try{await this.persistProjectSessionsByKey(e,{designSessionId:s})}catch(i){console.error("Persist design session failed:",i)}},async updateCodeSessionId(s){if(!s||!this.projectKey)return;const e=this.projectKey,t=this.projects[e]||{};this.$set(this.projects,e,{...t,codeSessionId:s}),this.saveState();try{await this.persistProjectSessionsByKey(e,{codeSessionId:s})}catch(i){console.error("Persist code session failed:",i)}},async updateTestSessionId(s){if(!s||!this.projectKey)return;const e=this.projectKey,t=this.projects[e]||{};this.$set(this.projects,e,{...t,testSessionId:s}),this.saveState();try{await this.persistProjectSessionsByKey(e,{testSessionId:s})}catch(i){console.error("Persist test session failed:",i)}},async createCategory(s){if(this.categories.includes(s)){this.$message.warning("大类已存在");return}try{const e=`${this.reqBasePath}\\${s}`;await o.createDirectory(e),this.categories.push(s),this.categories.sort(),this.$message.success(`大类「${s}」创建成功`)}catch(e){console.error("Create category failed:",e),this.$message.error("创建大类失败")}},async renameCategory({oldName:s,newName:e}){if(this.categories.includes(e)){this.$message.warning("名称已存在");return}try{const t=`${this.reqBasePath}\\${s}`;await o.renameFile(t,e);const i=this.categories.indexOf(s);i>-1&&(this.categories[i]=e),this.categories.sort();const n={};for(const a in this.projects){const[r,l]=a.split("/");if(r===s){const d=`${e}/${l}`;n[d]={...this.projects[a],category:e}}else n[a]=this.projects[a]}this.projects=n,this.currentCategory===s&&(this.currentCategory=e),this.saveState(),this.$message.success(`已重命名为「${e}」`)}catch(t){console.error("Rename category failed:",t),this.$message.error("重命名大类失败")}},async deleteCategory(s){try{const e=`${this.reqBasePath}\\${s}`;await o.deleteFile(e),this.categories=this.categories.filter(i=>i!==s);const t=[];for(const i in this.projects)i.startsWith(s+"/")&&t.push(i);t.forEach(i=>delete this.projects[i]),this.currentCategory===s&&(this.currentCategory="",this.currentProject=""),this.saveState(),this.$message.success(`大类「${s}」已删除`)}catch(e){console.error("Delete category failed:",e),this.$message.error("删除大类失败")}},async createRequirement({category:s,name:e}){const t=`${s}/${e}`;if(this.projects[t]){this.$message.warning("需求已存在");return}try{const l=`${this.reqBasePath}\\${s}\\${e}`;await o.createDirectory(l)}catch(l){console.error("Create requirement directory failed:",l)}const i=`# ${e}方案
9
9
 
10
10
  > 所属大类:${s}
11
11
 
@@ -13,4 +13,4 @@ import{n as m,F as C,C as v,M as _,g as S,a as o}from"./index-CUPB0bCv.js";const
13
13
 
14
14
  ## 功能点
15
15
 
16
- `;try{const l=this.getSpecPath(s,e);await o.writeFile(l,i)}catch(l){console.error("Write spec file failed:",l)}let n="",a="",r="";try{await this.writeSessionConfig(s,e,{designSessionId:n,codeSessionId:a,testSessionId:r})}catch(l){console.error("Write session.json failed:",l),this.$message.error("session.json 创建失败");return}this.$set(this.projects,t,{category:s,name:e,specFile:i,designSessionId:n,codeSessionId:a,testSessionId:r,designChatHistory:[],codeChatHistory:[],testChatHistory:[],stepStatus:{1:!0,2:!1,3:!1,4:!1}}),this.currentCategory=s,this.currentProject=e,this.saveState(),this.$message.success(`需求「${e}」创建成功`),this.$nextTick(()=>{this.currentStep=2,this.saveState()})},async onSaveSpec(s){if(!this.projectKey)return;this.projects[this.projectKey].specFile=s,this.saveState();const[e,t]=this.projectKey.split("/"),i=this.getSpecPath(e,t);try{await o.writeFile(i,s),this.$message.success("方案已保存")}catch(n){console.error("Save spec to filesystem failed:",n),this.$message.error("保存方案失败")}},saveSpec(){this.$refs.step2Ref&&this.$refs.step2Ref.saveSpec()},async refreshSpec(){var n,a,r;if(!this.projectKey)return;const[s,e]=this.projectKey.split("/"),t=this.getSpecPath(s,e),i=this.getLegacySpecPath(s,e);try{let l="";try{const p=await o.getFileContent(t);l=p.content??((n=p.data)==null?void 0:n.content)??""}catch{const p=await o.getFileContent(i);l=p.content??((a=p.data)==null?void 0:a.content)??""}const d=this.projects[this.projectKey];d&&(this.projects={...this.projects,[this.projectKey]:{...d,specFile:l}},this.saveState()),this.currentStep===2&&((r=this.$refs.step2Ref)!=null&&r.syncEditorContent)&&this.$refs.step2Ref.syncEditorContent(l),this.$message.success("方案已刷新")}catch(l){console.error("Refresh spec failed:",l),this.$message.error("刷新方案失败")}}}};var se=function(){var e=this,t=e._self._c;return t("div",{staticClass:"dev-workflow-view"},[t("WorkflowSidebar",{ref:"sidebar",attrs:{categories:e.categories,projects:e.projects,"current-category":e.currentCategory,"current-project":e.currentProject,"current-step":e.currentStep,"is-loading":e.isLoadingProjects},on:{"category-change":e.onCategoryChange,"project-change":e.onProjectChange,"step-change":e.onStepChange,"delete-category":e.deleteCategory,"rename-category":e.renameCategory}}),t("div",{staticClass:"main-content"},[t("div",{staticClass:"panel-header"},[t("span",{staticClass:"panel-title"},[e._v(e._s(e.stepTitle))]),t("div",{staticClass:"panel-actions"},[e.currentStep===2?[t("el-button",{attrs:{type:"primary",plain:""},on:{click:e.saveSpec}},[t("i",{staticClass:"el-icon-save"}),e._v(" 保存方案 ")]),t("el-button",{attrs:{type:"info",plain:""},on:{click:e.refreshSpec}},[t("i",{staticClass:"el-icon-refresh"}),e._v(" 刷新方案 ")])]:e._e()],2)]),t("div",{staticClass:"step-content"},[t("Step1NewReq",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===1,expression:"currentStep === 1"}],attrs:{categories:e.categories,projects:e.projects,"base-path":e.reqBasePath,"current-category":e.currentCategory,"current-project":e.currentProject},on:{"category-change":e.onCategoryChange,"project-change":e.onProjectChange,"create-category":e.createCategory,"create-requirement":e.createRequirement}}),t("Step2Design",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===2&&e.hasSelectedProject,expression:"currentStep === 2 && hasSelectedProject"}],ref:"step2Ref",attrs:{"project-key":e.projectKey,"spec-content":e.currentSpecContent,"session-id":e.currentSessionId},on:{"update:sessionId":e.updateDesignSessionId,"save-spec":e.onSaveSpec,"spec-updated":e.refreshSpec}}),t("Step3CodeGen",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===3&&e.hasSelectedProject,expression:"currentStep === 3 && hasSelectedProject"}],ref:"step3Ref",attrs:{"project-key":e.projectKey,"session-id":e.currentCodeSessionId},on:{"update:sessionId":e.updateCodeSessionId}}),t("Step4Test",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===4&&e.hasSelectedProject,expression:"currentStep === 4 && hasSelectedProject"}],ref:"step4Ref",attrs:{"project-key":e.projectKey,"session-id":e.currentTestSessionId},on:{"update:sessionId":e.updateTestSessionId}})],1),t("div",{staticClass:"status-bar"},[t("span",[t("i",{staticClass:"el-icon-info"}),e._v(" "+e._s(e.statusText)+" ")]),t("span",[e._v(e._s(e.projectKey||"未选择项目"))])])])],1)},ie=[],ae=m(te,se,ie,!1,null,"3052e4a8");const ne=ae.exports;export{ne as default};
16
+ `;try{const l=this.getSpecPath(s,e);await o.writeFile(l,i)}catch(l){console.error("Write spec file failed:",l)}let n="",a="",r="";try{await this.writeSessionConfig(s,e,{designSessionId:n,codeSessionId:a,testSessionId:r})}catch(l){console.error("Write session.json failed:",l),this.$message.error("session.json 创建失败");return}this.$set(this.projects,t,{category:s,name:e,specFile:i,designSessionId:n,codeSessionId:a,testSessionId:r,designChatHistory:[],codeChatHistory:[],testChatHistory:[],stepStatus:{1:!0,2:!1,3:!1,4:!1}}),this.currentCategory=s,this.currentProject=e,this.saveState(),this.$message.success(`需求「${e}」创建成功`),this.$nextTick(()=>{this.currentStep=2,this.saveState()})},async onSaveSpec(s){if(!this.projectKey)return;this.projects[this.projectKey].specFile=s,this.saveState();const[e,t]=this.projectKey.split("/"),i=this.getSpecPath(e,t);try{await o.writeFile(i,s),this.$message.success("方案已保存")}catch(n){console.error("Save spec to filesystem failed:",n),this.$message.error("保存方案失败")}},saveSpec(){this.$refs.step2Ref&&this.$refs.step2Ref.saveSpec()},async refreshSpec(){var n,a,r;if(!this.projectKey)return;const[s,e]=this.projectKey.split("/"),t=this.getSpecPath(s,e),i=this.getLegacySpecPath(s,e);try{let l="";try{const p=await o.getFileContent(t);l=p.content??((n=p.data)==null?void 0:n.content)??""}catch{const p=await o.getFileContent(i);l=p.content??((a=p.data)==null?void 0:a.content)??""}const d=this.projects[this.projectKey];d&&(this.projects={...this.projects,[this.projectKey]:{...d,specFile:l}},this.saveState()),this.currentStep===2&&((r=this.$refs.step2Ref)!=null&&r.syncEditorContent)&&this.$refs.step2Ref.syncEditorContent(l),this.$message.success("方案已刷新")}catch(l){console.error("Refresh spec failed:",l),this.$message.error("刷新方案失败")}}}};var se=function(){var e=this,t=e._self._c;return t("div",{staticClass:"dev-workflow-view"},[t("WorkflowSidebar",{ref:"sidebar",attrs:{categories:e.categories,projects:e.projects,"current-category":e.currentCategory,"current-project":e.currentProject,"current-step":e.currentStep,"is-loading":e.isLoadingProjects},on:{"category-change":e.onCategoryChange,"project-change":e.onProjectChange,"step-change":e.onStepChange,"delete-category":e.deleteCategory,"rename-category":e.renameCategory}}),t("div",{staticClass:"main-content"},[t("div",{staticClass:"panel-header"},[t("span",{staticClass:"panel-title"},[e._v(e._s(e.stepTitle))]),t("div",{staticClass:"panel-actions"},[e.currentStep===2?[t("el-button",{attrs:{type:"primary",plain:""},on:{click:e.saveSpec}},[t("i",{staticClass:"el-icon-save"}),e._v(" 保存方案 ")]),t("el-button",{attrs:{type:"info",plain:""},on:{click:e.refreshSpec}},[t("i",{staticClass:"el-icon-refresh"}),e._v(" 刷新方案 ")])]:e._e()],2)]),t("div",{staticClass:"step-content"},[t("Step1NewReq",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===1,expression:"currentStep === 1"}],attrs:{categories:e.categories,projects:e.projects,"base-path":e.reqBasePath,"current-category":e.currentCategory,"current-project":e.currentProject},on:{"category-change":e.onCategoryChange,"project-change":e.onProjectChange,"create-category":e.createCategory,"create-requirement":e.createRequirement}}),t("Step2Design",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===2&&e.hasSelectedProject,expression:"currentStep === 2 && hasSelectedProject"}],ref:"step2Ref",attrs:{"project-key":e.projectKey,"spec-content":e.currentSpecContent,"session-id":e.currentSessionId,"req-base-path":e.reqBasePath},on:{"update:sessionId":e.updateDesignSessionId,"save-spec":e.onSaveSpec,"spec-updated":e.refreshSpec}}),t("Step3CodeGen",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===3&&e.hasSelectedProject,expression:"currentStep === 3 && hasSelectedProject"}],ref:"step3Ref",attrs:{"project-key":e.projectKey,"session-id":e.currentCodeSessionId,"req-base-path":e.reqBasePath},on:{"update:sessionId":e.updateCodeSessionId}}),t("Step4Test",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===4&&e.hasSelectedProject,expression:"currentStep === 4 && hasSelectedProject"}],ref:"step4Ref",attrs:{"project-key":e.projectKey,"session-id":e.currentTestSessionId,"req-base-path":e.reqBasePath},on:{"update:sessionId":e.updateTestSessionId}})],1),t("div",{staticClass:"status-bar"},[t("span",[t("i",{staticClass:"el-icon-info"}),e._v(" "+e._s(e.statusText)+" ")]),t("span",[e._v(e._s(e.projectKey||"未选择项目"))])])])],1)},ie=[],ae=m(te,se,ie,!1,null,"88e7118c");const ne=ae.exports;export{ne as default};
@@ -0,0 +1 @@
1
+ .workflow-sidebar[data-v-8e3cf2bb]{width:280px;background:#2d2d2d;border-right:1px solid #1e1e1e;display:flex;flex-direction:column;flex-shrink:0}.sidebar-header[data-v-8e3cf2bb]{padding:16px;border-bottom:1px solid #1e1e1e}.sidebar-header h3[data-v-8e3cf2bb]{font-size:14px;color:#84848a;margin-bottom:12px}.sidebar-header .el-select[data-v-8e3cf2bb]{width:100%;margin-bottom:8px}.project-display-row[data-v-8e3cf2bb]{display:flex;justify-content:space-between;gap:8px;margin-bottom:8px;padding:8px 10px;background:#ffffff0a;border:1px solid #3f3f46;border-radius:6px}.project-display-row .label[data-v-8e3cf2bb]{color:#84848a;font-size:12px}.project-display-row .value[data-v-8e3cf2bb]{color:#d4d4d8;font-size:12px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.step-list[data-v-8e3cf2bb]{flex:1;overflow-y:auto;padding:16px}.step-item[data-v-8e3cf2bb]{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:8px;margin-bottom:8px;cursor:pointer;transition:all .2s;border:1px solid transparent}.step-item[data-v-8e3cf2bb]:hover{background:#ffffff0d}.step-item.active[data-v-8e3cf2bb]{background:#409eff26;border-color:#409eff}.step-item.completed .step-icon[data-v-8e3cf2bb]{background:#22c55e}.step-item.active .step-icon[data-v-8e3cf2bb]{background:#409eff}.step-icon[data-v-8e3cf2bb]{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;color:#fff;flex-shrink:0}.step-info[data-v-8e3cf2bb]{flex:1}.step-title[data-v-8e3cf2bb]{font-size:14px;font-weight:500;margin-bottom:2px;color:#f4f4f5}.step-desc[data-v-8e3cf2bb]{font-size:12px;color:#84848a}.step-status[data-v-8e3cf2bb]{font-size:14px}.step1-container[data-v-bf976168]{height:100%;padding:24px;overflow:hidden}.step1-main[data-v-bf976168]{max-width:600px;margin:0 auto}.panel-section[data-v-bf976168]{background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden}.panel-section-header[data-v-bf976168]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;display:flex;align-items:center;justify-content:space-between;color:#f4f4f5}.panel-section-header .el-button[data-v-bf976168]{padding:4px 8px;font-size:12px}.panel-section-body[data-v-bf976168]{padding:24px}.form-hint[data-v-bf976168]{font-size:12px;color:#84848a;margin-top:8px}.form-hint code[data-v-bf976168]{background:#18191b;padding:2px 6px;border-radius:4px;font-family:ui-monospace,monospace;color:#409eff}.flex[data-v-bf976168]{display:flex}.gap-2[data-v-bf976168]{gap:8px}.step2-container[data-v-e93db796]{height:100%;display:flex;flex-direction:column}.step2-main[data-v-e93db796]{display:flex;flex:1;gap:16px;overflow:hidden;padding:16px}.editor-panel[data-v-e93db796]{flex:1;min-width:300px;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.editor-header[data-v-e93db796]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:13px;color:#84848a;display:flex;align-items:center;gap:8px}.editor-container[data-v-e93db796]{flex:1;min-height:0}.chat-panel[data-v-e93db796]{width:480px;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column;flex-shrink:0}.panel-header[data-v-e93db796]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;color:#f4f4f5;flex-shrink:0}.chat-messages[data-v-e93db796]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-e93db796]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-e93db796]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-e93db796]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-e93db796]{display:flex;align-items:center;gap:8px;padding:2px 0}.todo-status[data-v-e93db796],.todo-name[data-v-e93db796]{font-size:14px}.user-question[data-v-e93db796]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-e93db796] p{color:#d4d4d8;font-weight:400;margin:0 0 8px;font-size:14px;line-height:1.6}.user-question[data-v-e93db796] strong{color:#fff}.user-question[data-v-e93db796] code{background:#27272a;padding:2px 6px;border-radius:4px;color:#60a5fa;font-size:13px}.user-question[data-v-e93db796] pre{background:#1e1e1e;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0;font-size:13px}.user-question[data-v-e93db796] ul,.user-question[data-v-e93db796] ol{margin:8px 0;padding-left:20px;color:#d4d4d8}.user-question[data-v-e93db796] li{margin:4px 0;color:#d4d4d8}.user-question[data-v-e93db796] h1,.user-question[data-v-e93db796] h2,.user-question[data-v-e93db796] h3{color:#fff;margin:12px 0 8px}.user-question[data-v-e93db796] h1{font-size:20px}.user-question[data-v-e93db796] h2{font-size:18px}.user-question[data-v-e93db796] h3{font-size:16px}.user-question[data-v-e93db796] table{border-collapse:collapse;margin:8px 0;width:100%}.user-question[data-v-e93db796] th,.user-question[data-v-e93db796] td{border:1px solid #3f3f46;padding:6px 10px;color:#d4d4d8}.user-question[data-v-e93db796] th{background:#1e1e1e;color:#fff}.user-question[data-v-e93db796] blockquote{border-left:3px solid #409EFF;padding-left:12px;margin:8px 0;color:#a1a1aa}.user-question[data-v-e93db796] hr{border:none;border-top:1px solid #3f3f46;margin:12px 0}.ai-thought[data-v-e93db796]{color:#d4d4d8;margin-bottom:16px;font-size:14px;line-height:1.6}.ai-thought[data-v-e93db796] p{margin:0 0 8px}.ai-thought[data-v-e93db796] strong{color:#fff}.ai-thought[data-v-e93db796] code{background:#27272a;padding:2px 6px;border-radius:4px;color:#60a5fa;font-size:13px}.ai-thought[data-v-e93db796] pre{background:#1e1e1e;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0}.ai-thought[data-v-e93db796] ul,.ai-thought[data-v-e93db796] ol{margin:8px 0;padding-left:20px}.ai-thought[data-v-e93db796] li{margin:4px 0}.ai-thought[data-v-e93db796] h1,.ai-thought[data-v-e93db796] h2,.ai-thought[data-v-e93db796] h3{color:#fff;margin:12px 0 8px}.ai-thought[data-v-e93db796] table{border-collapse:collapse;margin:8px 0;width:100%}.ai-thought[data-v-e93db796] th,.ai-thought[data-v-e93db796] td{border:1px solid #3f3f46;padding:6px 10px}.ai-thought[data-v-e93db796] th{background:#1e1e1e}.ai-thought[data-v-e93db796] blockquote{border-left:3px solid #409EFF;padding-left:12px;margin:8px 0;color:#a1a1aa}.log-mute[data-v-e93db796]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-e93db796]{color:#22c55e}.tool-fail[data-v-e93db796]{color:#ef4444}.tool-input[data-v-e93db796]{color:#60a5fa;margin-left:8px}.build-info[data-v-e93db796]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.build-info .icon[data-v-e93db796]{color:#60a5fa;font-size:12px}.chat-input-area[data-v-e93db796]{border-top:1px solid #1e1e1e;padding:12px 16px;background:#121212;display:flex;flex-direction:column;gap:8px;flex-shrink:0}.input-area[data-v-e93db796]{width:100%}.input-actions[data-v-e93db796]{display:flex;justify-content:flex-end;gap:8px}.send-btn[data-v-e93db796],.stop-btn[data-v-e93db796]{height:auto}.status-bar[data-v-e93db796]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-e93db796]{color:#3f3f46}.status-ready[data-v-e93db796]{color:#22c55e}.status-thinking[data-v-e93db796]{color:#60a5fa}.token-warning[data-v-e93db796]{color:#ef4444}.compaction-info[data-v-e93db796]{color:#22c55e;margin-left:8px}.model-selector[data-v-e93db796]{cursor:pointer}.model-selector[data-v-e93db796]:hover{color:#60a5fa}.status-action[data-v-e93db796]{cursor:pointer}.status-action[data-v-e93db796]:hover{color:#60a5fa}.system-message[data-v-e93db796]{color:#a78bfa;font-size:13px;margin-bottom:16px;padding:8px 12px;background:#1e1e1e;border-radius:6px}.step3-container[data-v-c8164685]{height:100%;display:flex;flex-direction:column}.step3-main[data-v-c8164685]{flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-c8164685]{height:100%;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-c8164685]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;color:#f4f4f5;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.chat-messages[data-v-c8164685]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-c8164685]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-c8164685]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-c8164685]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-c8164685]{display:flex;align-items:center;gap:8px;padding:2px 0}.todo-status[data-v-c8164685],.todo-name[data-v-c8164685]{font-size:14px}.user-question[data-v-c8164685]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-c8164685] p{color:#d4d4d8;font-weight:400;margin:0 0 8px;font-size:14px;line-height:1.6}.user-question[data-v-c8164685] strong{color:#fff}.user-question[data-v-c8164685] code{background:#27272a;padding:2px 6px;border-radius:4px;color:#60a5fa;font-size:13px}.user-question[data-v-c8164685] pre{background:#1e1e1e;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0;font-size:13px}.user-question[data-v-c8164685] ul,.user-question[data-v-c8164685] ol{margin:8px 0;padding-left:20px;color:#d4d4d8}.user-question[data-v-c8164685] li{margin:4px 0;color:#d4d4d8}.user-question[data-v-c8164685] h1,.user-question[data-v-c8164685] h2,.user-question[data-v-c8164685] h3{color:#fff;margin:12px 0 8px}.user-question[data-v-c8164685] h1{font-size:20px}.user-question[data-v-c8164685] h2{font-size:18px}.user-question[data-v-c8164685] h3{font-size:16px}.user-question[data-v-c8164685] table{border-collapse:collapse;margin:8px 0;width:100%}.user-question[data-v-c8164685] th,.user-question[data-v-c8164685] td{border:1px solid #3f3f46;padding:6px 10px;color:#d4d4d8}.user-question[data-v-c8164685] th{background:#1e1e1e;color:#fff}.user-question[data-v-c8164685] blockquote{border-left:3px solid #409EFF;padding-left:12px;margin:8px 0;color:#a1a1aa}.user-question[data-v-c8164685] hr{border:none;border-top:1px solid #3f3f46;margin:12px 0}.ai-thought[data-v-c8164685]{color:#d4d4d8;margin-bottom:16px;font-size:14px;line-height:1.6}.ai-thought[data-v-c8164685] p{margin:0 0 8px}.ai-thought[data-v-c8164685] strong{color:#fff}.ai-thought[data-v-c8164685] code{background:#27272a;padding:2px 6px;border-radius:4px;color:#60a5fa;font-size:13px}.ai-thought[data-v-c8164685] pre{background:#1e1e1e;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0}.ai-thought[data-v-c8164685] ul,.ai-thought[data-v-c8164685] ol{margin:8px 0;padding-left:20px}.ai-thought[data-v-c8164685] li{margin:4px 0}.ai-thought[data-v-c8164685] h1,.ai-thought[data-v-c8164685] h2,.ai-thought[data-v-c8164685] h3{color:#fff;margin:12px 0 8px}.ai-thought[data-v-c8164685] table{border-collapse:collapse;margin:8px 0;width:100%}.ai-thought[data-v-c8164685] th,.ai-thought[data-v-c8164685] td{border:1px solid #3f3f46;padding:6px 10px}.ai-thought[data-v-c8164685] th{background:#1e1e1e}.ai-thought[data-v-c8164685] blockquote{border-left:3px solid #409EFF;padding-left:12px;margin:8px 0;color:#a1a1aa}.log-mute[data-v-c8164685]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-c8164685]{color:#22c55e}.tool-fail[data-v-c8164685]{color:#ef4444}.tool-input[data-v-c8164685]{color:#60a5fa;margin-left:8px}.build-info[data-v-c8164685]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.build-info .icon[data-v-c8164685]{color:#60a5fa;font-size:12px}.chat-input-area[data-v-c8164685]{border-top:1px solid #1e1e1e;padding:12px 16px;background:#121212;display:flex;flex-direction:column;gap:8px;flex-shrink:0}.input-area[data-v-c8164685]{width:100%}.input-actions[data-v-c8164685]{display:flex;justify-content:flex-end;gap:8px}.send-btn[data-v-c8164685],.stop-btn[data-v-c8164685]{height:auto}.status-bar[data-v-c8164685]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-c8164685]{color:#3f3f46}.status-ready[data-v-c8164685]{color:#22c55e}.status-thinking[data-v-c8164685]{color:#60a5fa}.token-warning[data-v-c8164685]{color:#ef4444}.compaction-info[data-v-c8164685]{color:#22c55e;margin-left:8px}.model-selector[data-v-c8164685]{cursor:pointer}.model-selector[data-v-c8164685]:hover{color:#60a5fa}.status-action[data-v-c8164685]{cursor:pointer}.status-action[data-v-c8164685]:hover{color:#60a5fa}.system-message[data-v-c8164685]{color:#a78bfa;font-size:13px;margin-bottom:16px;padding:8px 12px;background:#1e1e1e;border-radius:6px}.step4-container[data-v-adc5c6ca]{height:100%;display:flex;flex-direction:column}.step4-main[data-v-adc5c6ca]{flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-adc5c6ca]{height:100%;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-adc5c6ca]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;color:#f4f4f5;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.chat-messages[data-v-adc5c6ca]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-adc5c6ca]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-adc5c6ca]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-adc5c6ca]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-adc5c6ca]{display:flex;align-items:center;gap:8px;padding:2px 0}.todo-status[data-v-adc5c6ca],.todo-name[data-v-adc5c6ca]{font-size:14px}.user-question[data-v-adc5c6ca]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-adc5c6ca] p{color:#d4d4d8;font-weight:400;margin:0 0 8px;font-size:14px;line-height:1.6}.user-question[data-v-adc5c6ca] strong{color:#fff}.user-question[data-v-adc5c6ca] code{background:#27272a;padding:2px 6px;border-radius:4px;color:#60a5fa;font-size:13px}.user-question[data-v-adc5c6ca] pre{background:#1e1e1e;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0;font-size:13px}.user-question[data-v-adc5c6ca] ul,.user-question[data-v-adc5c6ca] ol{margin:8px 0;padding-left:20px;color:#d4d4d8}.user-question[data-v-adc5c6ca] li{margin:4px 0;color:#d4d4d8}.user-question[data-v-adc5c6ca] h1,.user-question[data-v-adc5c6ca] h2,.user-question[data-v-adc5c6ca] h3{color:#fff;margin:12px 0 8px}.user-question[data-v-adc5c6ca] h1{font-size:20px}.user-question[data-v-adc5c6ca] h2{font-size:18px}.user-question[data-v-adc5c6ca] h3{font-size:16px}.user-question[data-v-adc5c6ca] table{border-collapse:collapse;margin:8px 0;width:100%}.user-question[data-v-adc5c6ca] th,.user-question[data-v-adc5c6ca] td{border:1px solid #3f3f46;padding:6px 10px;color:#d4d4d8}.user-question[data-v-adc5c6ca] th{background:#1e1e1e;color:#fff}.user-question[data-v-adc5c6ca] blockquote{border-left:3px solid #409EFF;padding-left:12px;margin:8px 0;color:#a1a1aa}.user-question[data-v-adc5c6ca] hr{border:none;border-top:1px solid #3f3f46;margin:12px 0}.ai-thought[data-v-adc5c6ca]{color:#d4d4d8;margin-bottom:16px;font-size:14px;line-height:1.6}.ai-thought[data-v-adc5c6ca] p{margin:0 0 8px}.ai-thought[data-v-adc5c6ca] strong{color:#fff}.ai-thought[data-v-adc5c6ca] code{background:#27272a;padding:2px 6px;border-radius:4px;color:#60a5fa;font-size:13px}.ai-thought[data-v-adc5c6ca] pre{background:#1e1e1e;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0}.ai-thought[data-v-adc5c6ca] ul,.ai-thought[data-v-adc5c6ca] ol{margin:8px 0;padding-left:20px}.ai-thought[data-v-adc5c6ca] li{margin:4px 0}.ai-thought[data-v-adc5c6ca] h1,.ai-thought[data-v-adc5c6ca] h2,.ai-thought[data-v-adc5c6ca] h3{color:#fff;margin:12px 0 8px}.ai-thought[data-v-adc5c6ca] table{border-collapse:collapse;margin:8px 0;width:100%}.ai-thought[data-v-adc5c6ca] th,.ai-thought[data-v-adc5c6ca] td{border:1px solid #3f3f46;padding:6px 10px}.ai-thought[data-v-adc5c6ca] th{background:#1e1e1e}.ai-thought[data-v-adc5c6ca] blockquote{border-left:3px solid #409EFF;padding-left:12px;margin:8px 0;color:#a1a1aa}.log-mute[data-v-adc5c6ca]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-adc5c6ca]{color:#22c55e}.tool-fail[data-v-adc5c6ca]{color:#ef4444}.tool-input[data-v-adc5c6ca]{color:#60a5fa;margin-left:8px}.build-info[data-v-adc5c6ca]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.build-info .icon[data-v-adc5c6ca]{color:#60a5fa;font-size:12px}.chat-input-area[data-v-adc5c6ca]{border-top:1px solid #1e1e1e;padding:12px 16px;background:#121212;display:flex;flex-direction:column;gap:8px;flex-shrink:0}.input-area[data-v-adc5c6ca]{width:100%}.input-actions[data-v-adc5c6ca]{display:flex;justify-content:flex-end;gap:8px}.send-btn[data-v-adc5c6ca],.stop-btn[data-v-adc5c6ca]{height:auto}.status-bar[data-v-adc5c6ca]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-adc5c6ca]{color:#3f3f46}.status-ready[data-v-adc5c6ca]{color:#22c55e}.status-thinking[data-v-adc5c6ca]{color:#60a5fa}.token-warning[data-v-adc5c6ca]{color:#ef4444}.compaction-info[data-v-adc5c6ca]{color:#22c55e;margin-left:8px}.model-selector[data-v-adc5c6ca]{cursor:pointer}.model-selector[data-v-adc5c6ca]:hover{color:#60a5fa}.status-action[data-v-adc5c6ca]{cursor:pointer}.status-action[data-v-adc5c6ca]:hover{color:#60a5fa}.system-message[data-v-adc5c6ca]{color:#a78bfa;font-size:13px;margin-bottom:16px;padding:8px 12px;background:#1e1e1e;border-radius:6px}.dev-workflow-view[data-v-88e7118c]{display:flex;height:100%;overflow:hidden;background:#0a0a09}.main-content[data-v-88e7118c]{flex:1;display:flex;flex-direction:column;overflow:hidden}.panel-header[data-v-88e7118c]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 24px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.panel-title[data-v-88e7118c]{font-size:16px;font-weight:500;color:#f4f4f5}.panel-actions[data-v-88e7118c]{display:flex;gap:12px}.step-content[data-v-88e7118c]{flex:1;overflow:hidden}.status-bar[data-v-88e7118c]{background:#121212;border-top:1px solid #1e1e1e;padding:8px 24px;font-size:12px;color:#84848a;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
@@ -1 +1 @@
1
- import{n as i,a as r}from"./index-CUPB0bCv.js";const a={name:"Layout",data(){return{sidebarVisible:!0,showSessionDropdown:!1,sessions:[],currentSessionId:null,currentSessionName:""}},methods:{toggleSidebar(){this.sidebarVisible=!this.sidebarVisible},toggleSessionDropdown(){this.showSessionDropdown=!this.showSessionDropdown},async switchSession(s){this.currentSessionId=s.id,this.currentSessionName=s.title,this.showSessionDropdown=!1,this.$route.params.id!==s.id&&this.$router.push({name:"chat-session",params:{id:s.id}}).catch(()=>{})},async createNewSession(){try{const s=await r.createSession("新会话");this.sessions.unshift(s.data),this.switchSession(s.data),this.showSessionDropdown=!1}catch(s){this.$message.error("创建会话失败: "+s.message)}},async loadSessions(){try{const s=await r.getSessions();this.sessions=s.data||[],this.sessions.length>0&&!this.currentSessionId&&(this.currentSessionId=this.sessions[0].id,this.currentSessionName=this.sessions[0].title)}catch(s){console.error("加载会话失败:",s)}}},async created(){await this.loadSessions(),document.addEventListener("click",s=>{this.$el.contains(s.target)||(this.showSessionDropdown=!1)})}};var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-screen overflow-hidden"},[t("header",{staticClass:"h-10 bg-sidebar border-b border-black flex items-center justify-between px-4 shrink-0 z-20"},[t("div",{staticClass:"flex items-center gap-4"},[e._m(0),t("div",{staticClass:"relative"},[t("router-link",{staticClass:"hover:text-white px-3 py-1 rounded border border-transparent hover:border-accent transition-colors",class:e.$route.name==="devWorkflow"?"text-accent border-accent":"text-gray-400",attrs:{to:"/devWorkflow"}},[t("i",{staticClass:"fa-solid fa-laptop-code mr-1"}),e._v(" 软件研发 ")])],1)]),t("div",{staticClass:"flex items-center gap-3"},[e._m(1),t("button",{directives:[{name:"show",rawName:"v-show",value:e.$route.name==="chat",expression:"$route.name === 'chat'"}],staticClass:"hover:text-white",attrs:{title:e.sidebarVisible?"关闭侧栏":"显示侧栏"},on:{click:e.toggleSidebar}},[t("i",{staticClass:"fa-solid fa-columns"})])])]),t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("nav",{staticClass:"w-12 bg-activityBar flex flex-col items-center py-2 shrink-0 border-r border-black z-10 justify-between"},[t("div",{staticClass:"flex flex-col items-center w-full"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="codeView"||e.$route.name==="codeView-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/codeView",title:"工作台"}},[t("i",{staticClass:"fa-regular fa-comments text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="files"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/files",title:"文件"}},[t("i",{staticClass:"fa-solid fa-folder-open text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="terminal"||e.$route.name==="terminal-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/terminal",title:"终端"}},[t("i",{staticClass:"fa-solid fa-terminal text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="skills"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/skills",title:"Skill 管理"}},[t("i",{staticClass:"fa-solid fa-shapes text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="db"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/db",title:"数据库"}},[t("i",{staticClass:"fa-solid fa-database text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="tasks"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/tasks",title:"任务"}},[t("i",{staticClass:"fa-solid fa-clock text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="aiLogs"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/aiLogs",title:"AI 日志"}},[t("i",{staticClass:"fa-solid fa-robot text-xl"})])],1),t("div",{staticClass:"flex flex-col items-center w-full mb-2"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="settings"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent hover:bg-white/5",attrs:{to:"/settings",title:"设置"}},[t("i",{staticClass:"fa-solid fa-gear text-xl"})])],1)]),t("keep-alive",{attrs:{include:["CodeView","TerminalView","Files"]}},[t("router-view",{staticClass:"flex-1 flex overflow-hidden",attrs:{"sidebar-visible":e.sidebarVisible},on:{"toggle-sidebar":e.toggleSidebar}})],1)],1),e._m(2)])},n=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"font-bold text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-robot text-accent"}),e("span",[s._v("TXCode Agent")])])},function(){var s=this,e=s._self._c;return e("span",{staticClass:"text-xs text-textMuted mr-2"},[e("i",{staticClass:"fa-solid fa-circle text-green-500 text-[8px]"}),s._v(" Server Connected")])},function(){var s=this,e=s._self._c;return e("footer",{staticClass:"h-6 bg-accent text-white text-xs flex items-center justify-between px-3 shrink-0 z-20"},[e("div",{staticClass:"flex items-center gap-4"},[e("span",[e("i",{staticClass:"fa-solid fa-code-branch"}),s._v(" main")])]),e("div",{staticClass:"flex items-center gap-4"},[e("span",[s._v("TXCode")]),e("span",[s._v("UTF-8")])])])}],l=i(a,o,n,!1,null,null);const d=l.exports;export{d as default};
1
+ import{n as i,a as r}from"./index-TrZtH1m_.js";const a={name:"Layout",data(){return{sidebarVisible:!0,showSessionDropdown:!1,sessions:[],currentSessionId:null,currentSessionName:""}},methods:{toggleSidebar(){this.sidebarVisible=!this.sidebarVisible},toggleSessionDropdown(){this.showSessionDropdown=!this.showSessionDropdown},async switchSession(s){this.currentSessionId=s.id,this.currentSessionName=s.title,this.showSessionDropdown=!1,this.$route.params.id!==s.id&&this.$router.push({name:"chat-session",params:{id:s.id}}).catch(()=>{})},async createNewSession(){try{const s=await r.createSession("新会话");this.sessions.unshift(s.data),this.switchSession(s.data),this.showSessionDropdown=!1}catch(s){this.$message.error("创建会话失败: "+s.message)}},async loadSessions(){try{const s=await r.getSessions();this.sessions=s.data||[],this.sessions.length>0&&!this.currentSessionId&&(this.currentSessionId=this.sessions[0].id,this.currentSessionName=this.sessions[0].title)}catch(s){console.error("加载会话失败:",s)}}},async created(){await this.loadSessions(),document.addEventListener("click",s=>{this.$el.contains(s.target)||(this.showSessionDropdown=!1)})}};var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-screen overflow-hidden"},[t("header",{staticClass:"h-10 bg-sidebar border-b border-black flex items-center justify-between px-4 shrink-0 z-20"},[t("div",{staticClass:"flex items-center gap-4"},[e._m(0),t("div",{staticClass:"relative"},[t("router-link",{staticClass:"hover:text-white px-3 py-1 rounded border border-transparent hover:border-accent transition-colors",class:e.$route.name==="devWorkflow"?"text-accent border-accent":"text-gray-400",attrs:{to:"/devWorkflow"}},[t("i",{staticClass:"fa-solid fa-laptop-code mr-1"}),e._v(" 软件研发 ")])],1)]),t("div",{staticClass:"flex items-center gap-3"},[e._m(1),t("button",{directives:[{name:"show",rawName:"v-show",value:e.$route.name==="chat",expression:"$route.name === 'chat'"}],staticClass:"hover:text-white",attrs:{title:e.sidebarVisible?"关闭侧栏":"显示侧栏"},on:{click:e.toggleSidebar}},[t("i",{staticClass:"fa-solid fa-columns"})])])]),t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("nav",{staticClass:"w-12 bg-activityBar flex flex-col items-center py-2 shrink-0 border-r border-black z-10 justify-between"},[t("div",{staticClass:"flex flex-col items-center w-full"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="codeView"||e.$route.name==="codeView-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/codeView",title:"工作台"}},[t("i",{staticClass:"fa-regular fa-comments text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="files"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/files",title:"文件"}},[t("i",{staticClass:"fa-solid fa-folder-open text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="terminal"||e.$route.name==="terminal-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/terminal",title:"终端"}},[t("i",{staticClass:"fa-solid fa-terminal text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="skills"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/skills",title:"Skill 管理"}},[t("i",{staticClass:"fa-solid fa-shapes text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="db"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/db",title:"数据库"}},[t("i",{staticClass:"fa-solid fa-database text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="tasks"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/tasks",title:"任务"}},[t("i",{staticClass:"fa-solid fa-clock text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="aiLogs"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/aiLogs",title:"AI 日志"}},[t("i",{staticClass:"fa-solid fa-robot text-xl"})])],1),t("div",{staticClass:"flex flex-col items-center w-full mb-2"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="settings"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent hover:bg-white/5",attrs:{to:"/settings",title:"设置"}},[t("i",{staticClass:"fa-solid fa-gear text-xl"})])],1)]),t("keep-alive",{attrs:{include:["CodeView","TerminalView","Files"]}},[t("router-view",{staticClass:"flex-1 flex overflow-hidden",attrs:{"sidebar-visible":e.sidebarVisible},on:{"toggle-sidebar":e.toggleSidebar}})],1)],1),e._m(2)])},n=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"font-bold text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-robot text-accent"}),e("span",[s._v("TXCode Agent")])])},function(){var s=this,e=s._self._c;return e("span",{staticClass:"text-xs text-textMuted mr-2"},[e("i",{staticClass:"fa-solid fa-circle text-green-500 text-[8px]"}),s._v(" Server Connected")])},function(){var s=this,e=s._self._c;return e("footer",{staticClass:"h-6 bg-accent text-white text-xs flex items-center justify-between px-3 shrink-0 z-20"},[e("div",{staticClass:"flex items-center gap-4"},[e("span",[e("i",{staticClass:"fa-solid fa-code-branch"}),s._v(" main")])]),e("div",{staticClass:"flex items-center gap-4"},[e("span",[s._v("TXCode")]),e("span",[s._v("UTF-8")])])])}],l=i(a,o,n,!1,null,null);const d=l.exports;export{d as default};
@@ -1 +1 @@
1
- import{n as x,a as i}from"./index-CUPB0bCv.js";const b={"*/5 * * * *":"每5分钟","*/30 * * * *":"每30分钟","0 * * * *":"每小时","0 */2 * * *":"每2小时","0 */12 * * *":"每12小时","0 0 * * *":"每天0点","0 0 1 * *":"每月1日0点"},p={name:"TasksView",data(){return{tasks:[],models:[],availableSkills:[],showDialog:!1,showLogDialog:!1,isEditing:!1,currentTask:null,logs:[],form:{name:"",model:"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0}}},async created(){await this.loadTasks(),await this.loadModels(),await this.loadSkills()},methods:{async loadTasks(){try{const s=await i.getScheduledTasks();this.tasks=s.data||[]}catch(s){console.error("Load tasks failed:",s),this.$message.error("加载任务失败")}},async loadModels(){try{const s=await i.getModels();this.models=s.data||[],this.models.length>0&&!this.form.model&&(this.form.model=this.models[0].name)}catch(s){console.error("Load models failed:",s)}},async loadSkills(){var s;try{const e=await i.getSkills();this.availableSkills=((s=e.data)==null?void 0:s.map(t=>t.name))||[]}catch(e){console.error("Load skills failed:",e)}},formatSchedule(s){return b[s]||s},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"},openCreateDialog(){var s;this.isEditing=!1,this.form={name:"",model:((s=this.models[0])==null?void 0:s.name)||"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0},this.showDialog=!0},openEditDialog(s){this.isEditing=!0,this.currentTask=s,this.form={name:s.name,model:s.model,scheduleType:s.scheduleType,notifyType:s.notifyType,skills:[...s.skills||[]],content:s.content,enabled:s.enabled},this.showDialog=!0},closeDialog(){this.showDialog=!1,this.currentTask=null},async saveTask(){if(!this.form.name||!this.form.content){this.$message.error("请填写必填项");return}try{this.isEditing&&this.currentTask?(await i.updateScheduledTask(this.currentTask.id,this.form),this.$message.success("任务已更新")):(await i.createScheduledTask(this.form),this.$message.success("任务已创建")),this.closeDialog(),await this.loadTasks()}catch(s){this.$message.error("保存失败: "+s.message)}},async deleteTask(s){if(confirm(`确定删除任务 "${s.name}" 吗?`))try{await i.deleteScheduledTask(s.id),this.$message.success("任务已删除"),await this.loadTasks()}catch(e){this.$message.error("删除失败: "+e.message)}},async startTask(s){try{await i.startScheduledTask(s.id),this.$message.success("任务已启动"),await this.loadTasks()}catch(e){this.$message.error("启动失败: "+e.message)}},async stopTask(s){try{await i.stopScheduledTask(s.id),this.$message.success("任务已停用"),await this.loadTasks()}catch(e){this.$message.error("停用失败: "+e.message)}},async runTask(s){try{await i.runTaskNow(s.id),this.$message.success("任务已开始执行")}catch(e){this.$message.error("执行失败: "+e.message)}},async openLogDialog(s){this.currentTask=s,this.showLogDialog=!0;try{const e=await i.getTaskLogs(s.id);this.logs=e.data||[]}catch(e){console.error("Load logs failed:",e),this.logs=[]}}}};var m=function(){var u;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex flex-col overflow-hidden bg-[#1e1e1e]"},[t("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar shrink-0"},[t("div",{staticClass:"flex items-center justify-between"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-clock text-accent"}),t("span",{staticClass:"text-white font-medium"},[e._v("定时任务")]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.tasks.length)+" 个任务")])]),t("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:e.openCreateDialog}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" 新建任务 ")])])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(0),t("tbody",[e._l(e.tasks,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[a.enabled?t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-green-500/20 text-green-400"},[e._v("启用")]):t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-gray-500/20 text-gray-400"},[e._v("停用")])]),t("td",{staticClass:"px-3 py-2 text-gray-200 border-b border-border/30"},[e._v(e._s(a.name))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(a.model))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatSchedule(a.scheduleType)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},e._l(a.skills,function(o){var r;return(r=a.skills)!=null&&r.length?t("span",{key:o,staticClass:"text-xs px-1 py-0.5 bg-blue-500/20 text-blue-400 rounded mr-1"},[e._v(e._s(o))]):t("span",{staticClass:"text-textMuted"},[e._v("-")])}),0),t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("div",{staticClass:"flex items-center gap-2"},[a.enabled?t("button",{staticClass:"text-xs px-2 py-1 text-yellow-400 hover:bg-yellow-500/20 rounded",on:{click:function(o){return e.stopTask(a)}}},[e._v("停用")]):t("button",{staticClass:"text-xs px-2 py-1 text-green-400 hover:bg-green-500/20 rounded",on:{click:function(o){return e.startTask(a)}}},[e._v("启动")]),t("button",{staticClass:"text-xs px-2 py-1 text-blue-400 hover:bg-blue-500/20 rounded",on:{click:function(o){return e.runTask(a)}}},[e._v("执行")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openLogDialog(a)}}},[e._v("日志")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openEditDialog(a)}}},[e._v("编辑")]),t("button",{staticClass:"text-xs px-2 py-1 text-red-400 hover:bg-red-500/20 rounded",on:{click:function(o){return e.deleteTask(a)}}},[e._v("删除")])])])])}),e.tasks.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"6"}},[e._v('暂无任务,点击"新建任务"创建')])]):e._e()],2)])]),e.showDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[600px] max-h-[80vh] overflow-auto"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s(e.isEditing?"编辑任务":"新建任务"))]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:e.closeDialog}},[e._v("关闭")])]),t("div",{staticClass:"p-4 space-y-4"},[t("div",[e._m(1),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.name,expression:"form.name"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"text",placeholder:"任务名称"},domProps:{value:e.form.name},on:{input:function(a){a.target.composing||e.$set(e.form,"name",a.target.value)}}})]),t("div",[e._m(2),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.model,expression:"form.model"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"model",a.target.multiple?o:o[0])}}},e._l(e.models,function(a){return t("option",{key:a.id,domProps:{value:a.name}},[e._v(e._s(a.name))])}),0)]),t("div",[e._m(3),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.scheduleType,expression:"form.scheduleType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"scheduleType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"*/5 * * * *"}},[e._v("每5分钟")]),t("option",{attrs:{value:"*/30 * * * *"}},[e._v("每30分钟")]),t("option",{attrs:{value:"0 * * * *"}},[e._v("每小时")]),t("option",{attrs:{value:"0 */2 * * *"}},[e._v("每2小时")]),t("option",{attrs:{value:"0 */12 * * *"}},[e._v("每12小时")]),t("option",{attrs:{value:"0 0 * * *"}},[e._v("每天0点")]),t("option",{attrs:{value:"0 0 1 * *"}},[e._v("每月1日0点")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("通知方式")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.notifyType,expression:"form.notifyType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"notifyType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"message"}},[e._v("消息")]),t("option",{attrs:{value:"email"}},[e._v("邮件")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("关联技能")]),t("div",{staticClass:"flex flex-wrap gap-2"},e._l(e.availableSkills,function(a){return t("label",{key:a,staticClass:"flex items-center gap-1 text-xs text-textMuted cursor-pointer"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.skills,expression:"form.skills"}],staticClass:"accent-accent",attrs:{type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.form.skills)?e._i(e.form.skills,a)>-1:e.form.skills},on:{change:function(o){var r=e.form.skills,l=o.target,d=!!l.checked;if(Array.isArray(r)){var n=a,c=e._i(r,n);l.checked?c<0&&e.$set(e.form,"skills",r.concat([n])):c>-1&&e.$set(e.form,"skills",r.slice(0,c).concat(r.slice(c+1)))}else e.$set(e.form,"skills",d)}}}),e._v(" "+e._s(a)+" ")])}),0)]),t("div",[e._m(4),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.form.content,expression:"form.content"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded resize-none",attrs:{rows:"5",placeholder:"请描述任务内容..."},domProps:{value:e.form.content},on:{input:function(a){a.target.composing||e.$set(e.form,"content",a.target.value)}}})]),t("div",{staticClass:"flex items-center gap-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.enabled,expression:"form.enabled"}],staticClass:"accent-accent",attrs:{type:"checkbox",id:"taskEnabled"},domProps:{checked:Array.isArray(e.form.enabled)?e._i(e.form.enabled,null)>-1:e.form.enabled},on:{change:function(a){var o=e.form.enabled,r=a.target,l=!!r.checked;if(Array.isArray(o)){var d=null,n=e._i(o,d);r.checked?n<0&&e.$set(e.form,"enabled",o.concat([d])):n>-1&&e.$set(e.form,"enabled",o.slice(0,n).concat(o.slice(n+1)))}else e.$set(e.form,"enabled",l)}}}),t("label",{staticClass:"text-xs text-textMuted",attrs:{for:"taskEnabled"}},[e._v("立即启用")])])]),t("div",{staticClass:"px-4 py-3 border-t border-border flex justify-end gap-2"},[t("button",{staticClass:"px-4 py-1 text-textMuted text-sm rounded hover:bg-white/10",on:{click:e.closeDialog}},[e._v("取消")]),t("button",{staticClass:"px-4 py-1 bg-accent text-white text-sm rounded hover:bg-accent/80",on:{click:e.saveTask}},[e._v(" "+e._s(e.isEditing?"保存":"创建")+" ")])])])]):e._e(),e.showLogDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[900px] max-h-[80vh] overflow-hidden flex flex-col"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s((u=e.currentTask)==null?void 0:u.name)+" - 执行日志")]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:function(a){e.showLogDialog=!1}}},[e._v("关闭")])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(5),t("tbody",[e._l(e.logs,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.status==="success"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"},[e._v(" "+e._s(a.status==="success"?"成功":"失败")+" ")])]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatTime(a.executedAt)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatDuration(a.duration)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[400px]",attrs:{title:a.result}},[e._v(e._s(a.result||a.error||"-"))])])}),e.logs.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"4"}},[e._v("暂无执行记录")])]):e._e()],2)])])])]):e._e()])},f=[function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("名称")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("调度")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("技能")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("操作")])])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务名称 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("AI 模型 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("调度周期 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务内容 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("结果")])])])}],v=x(p,m,f,!1,null,null);const g=v.exports;export{g as default};
1
+ import{n as x,a as i}from"./index-TrZtH1m_.js";const b={"*/5 * * * *":"每5分钟","*/30 * * * *":"每30分钟","0 * * * *":"每小时","0 */2 * * *":"每2小时","0 */12 * * *":"每12小时","0 0 * * *":"每天0点","0 0 1 * *":"每月1日0点"},p={name:"TasksView",data(){return{tasks:[],models:[],availableSkills:[],showDialog:!1,showLogDialog:!1,isEditing:!1,currentTask:null,logs:[],form:{name:"",model:"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0}}},async created(){await this.loadTasks(),await this.loadModels(),await this.loadSkills()},methods:{async loadTasks(){try{const s=await i.getScheduledTasks();this.tasks=s.data||[]}catch(s){console.error("Load tasks failed:",s),this.$message.error("加载任务失败")}},async loadModels(){try{const s=await i.getModels();this.models=s.data||[],this.models.length>0&&!this.form.model&&(this.form.model=this.models[0].name)}catch(s){console.error("Load models failed:",s)}},async loadSkills(){var s;try{const e=await i.getSkills();this.availableSkills=((s=e.data)==null?void 0:s.map(t=>t.name))||[]}catch(e){console.error("Load skills failed:",e)}},formatSchedule(s){return b[s]||s},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"},openCreateDialog(){var s;this.isEditing=!1,this.form={name:"",model:((s=this.models[0])==null?void 0:s.name)||"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0},this.showDialog=!0},openEditDialog(s){this.isEditing=!0,this.currentTask=s,this.form={name:s.name,model:s.model,scheduleType:s.scheduleType,notifyType:s.notifyType,skills:[...s.skills||[]],content:s.content,enabled:s.enabled},this.showDialog=!0},closeDialog(){this.showDialog=!1,this.currentTask=null},async saveTask(){if(!this.form.name||!this.form.content){this.$message.error("请填写必填项");return}try{this.isEditing&&this.currentTask?(await i.updateScheduledTask(this.currentTask.id,this.form),this.$message.success("任务已更新")):(await i.createScheduledTask(this.form),this.$message.success("任务已创建")),this.closeDialog(),await this.loadTasks()}catch(s){this.$message.error("保存失败: "+s.message)}},async deleteTask(s){if(confirm(`确定删除任务 "${s.name}" 吗?`))try{await i.deleteScheduledTask(s.id),this.$message.success("任务已删除"),await this.loadTasks()}catch(e){this.$message.error("删除失败: "+e.message)}},async startTask(s){try{await i.startScheduledTask(s.id),this.$message.success("任务已启动"),await this.loadTasks()}catch(e){this.$message.error("启动失败: "+e.message)}},async stopTask(s){try{await i.stopScheduledTask(s.id),this.$message.success("任务已停用"),await this.loadTasks()}catch(e){this.$message.error("停用失败: "+e.message)}},async runTask(s){try{await i.runTaskNow(s.id),this.$message.success("任务已开始执行")}catch(e){this.$message.error("执行失败: "+e.message)}},async openLogDialog(s){this.currentTask=s,this.showLogDialog=!0;try{const e=await i.getTaskLogs(s.id);this.logs=e.data||[]}catch(e){console.error("Load logs failed:",e),this.logs=[]}}}};var m=function(){var u;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex flex-col overflow-hidden bg-[#1e1e1e]"},[t("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar shrink-0"},[t("div",{staticClass:"flex items-center justify-between"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-clock text-accent"}),t("span",{staticClass:"text-white font-medium"},[e._v("定时任务")]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.tasks.length)+" 个任务")])]),t("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:e.openCreateDialog}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" 新建任务 ")])])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(0),t("tbody",[e._l(e.tasks,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[a.enabled?t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-green-500/20 text-green-400"},[e._v("启用")]):t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-gray-500/20 text-gray-400"},[e._v("停用")])]),t("td",{staticClass:"px-3 py-2 text-gray-200 border-b border-border/30"},[e._v(e._s(a.name))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(a.model))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatSchedule(a.scheduleType)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},e._l(a.skills,function(o){var r;return(r=a.skills)!=null&&r.length?t("span",{key:o,staticClass:"text-xs px-1 py-0.5 bg-blue-500/20 text-blue-400 rounded mr-1"},[e._v(e._s(o))]):t("span",{staticClass:"text-textMuted"},[e._v("-")])}),0),t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("div",{staticClass:"flex items-center gap-2"},[a.enabled?t("button",{staticClass:"text-xs px-2 py-1 text-yellow-400 hover:bg-yellow-500/20 rounded",on:{click:function(o){return e.stopTask(a)}}},[e._v("停用")]):t("button",{staticClass:"text-xs px-2 py-1 text-green-400 hover:bg-green-500/20 rounded",on:{click:function(o){return e.startTask(a)}}},[e._v("启动")]),t("button",{staticClass:"text-xs px-2 py-1 text-blue-400 hover:bg-blue-500/20 rounded",on:{click:function(o){return e.runTask(a)}}},[e._v("执行")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openLogDialog(a)}}},[e._v("日志")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openEditDialog(a)}}},[e._v("编辑")]),t("button",{staticClass:"text-xs px-2 py-1 text-red-400 hover:bg-red-500/20 rounded",on:{click:function(o){return e.deleteTask(a)}}},[e._v("删除")])])])])}),e.tasks.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"6"}},[e._v('暂无任务,点击"新建任务"创建')])]):e._e()],2)])]),e.showDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[600px] max-h-[80vh] overflow-auto"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s(e.isEditing?"编辑任务":"新建任务"))]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:e.closeDialog}},[e._v("关闭")])]),t("div",{staticClass:"p-4 space-y-4"},[t("div",[e._m(1),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.name,expression:"form.name"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"text",placeholder:"任务名称"},domProps:{value:e.form.name},on:{input:function(a){a.target.composing||e.$set(e.form,"name",a.target.value)}}})]),t("div",[e._m(2),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.model,expression:"form.model"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"model",a.target.multiple?o:o[0])}}},e._l(e.models,function(a){return t("option",{key:a.id,domProps:{value:a.name}},[e._v(e._s(a.name))])}),0)]),t("div",[e._m(3),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.scheduleType,expression:"form.scheduleType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"scheduleType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"*/5 * * * *"}},[e._v("每5分钟")]),t("option",{attrs:{value:"*/30 * * * *"}},[e._v("每30分钟")]),t("option",{attrs:{value:"0 * * * *"}},[e._v("每小时")]),t("option",{attrs:{value:"0 */2 * * *"}},[e._v("每2小时")]),t("option",{attrs:{value:"0 */12 * * *"}},[e._v("每12小时")]),t("option",{attrs:{value:"0 0 * * *"}},[e._v("每天0点")]),t("option",{attrs:{value:"0 0 1 * *"}},[e._v("每月1日0点")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("通知方式")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.notifyType,expression:"form.notifyType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"notifyType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"message"}},[e._v("消息")]),t("option",{attrs:{value:"email"}},[e._v("邮件")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("关联技能")]),t("div",{staticClass:"flex flex-wrap gap-2"},e._l(e.availableSkills,function(a){return t("label",{key:a,staticClass:"flex items-center gap-1 text-xs text-textMuted cursor-pointer"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.skills,expression:"form.skills"}],staticClass:"accent-accent",attrs:{type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.form.skills)?e._i(e.form.skills,a)>-1:e.form.skills},on:{change:function(o){var r=e.form.skills,l=o.target,d=!!l.checked;if(Array.isArray(r)){var n=a,c=e._i(r,n);l.checked?c<0&&e.$set(e.form,"skills",r.concat([n])):c>-1&&e.$set(e.form,"skills",r.slice(0,c).concat(r.slice(c+1)))}else e.$set(e.form,"skills",d)}}}),e._v(" "+e._s(a)+" ")])}),0)]),t("div",[e._m(4),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.form.content,expression:"form.content"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded resize-none",attrs:{rows:"5",placeholder:"请描述任务内容..."},domProps:{value:e.form.content},on:{input:function(a){a.target.composing||e.$set(e.form,"content",a.target.value)}}})]),t("div",{staticClass:"flex items-center gap-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.enabled,expression:"form.enabled"}],staticClass:"accent-accent",attrs:{type:"checkbox",id:"taskEnabled"},domProps:{checked:Array.isArray(e.form.enabled)?e._i(e.form.enabled,null)>-1:e.form.enabled},on:{change:function(a){var o=e.form.enabled,r=a.target,l=!!r.checked;if(Array.isArray(o)){var d=null,n=e._i(o,d);r.checked?n<0&&e.$set(e.form,"enabled",o.concat([d])):n>-1&&e.$set(e.form,"enabled",o.slice(0,n).concat(o.slice(n+1)))}else e.$set(e.form,"enabled",l)}}}),t("label",{staticClass:"text-xs text-textMuted",attrs:{for:"taskEnabled"}},[e._v("立即启用")])])]),t("div",{staticClass:"px-4 py-3 border-t border-border flex justify-end gap-2"},[t("button",{staticClass:"px-4 py-1 text-textMuted text-sm rounded hover:bg-white/10",on:{click:e.closeDialog}},[e._v("取消")]),t("button",{staticClass:"px-4 py-1 bg-accent text-white text-sm rounded hover:bg-accent/80",on:{click:e.saveTask}},[e._v(" "+e._s(e.isEditing?"保存":"创建")+" ")])])])]):e._e(),e.showLogDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[900px] max-h-[80vh] overflow-hidden flex flex-col"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s((u=e.currentTask)==null?void 0:u.name)+" - 执行日志")]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:function(a){e.showLogDialog=!1}}},[e._v("关闭")])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(5),t("tbody",[e._l(e.logs,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.status==="success"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"},[e._v(" "+e._s(a.status==="success"?"成功":"失败")+" ")])]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatTime(a.executedAt)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatDuration(a.duration)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[400px]",attrs:{title:a.result}},[e._v(e._s(a.result||a.error||"-"))])])}),e.logs.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"4"}},[e._v("暂无执行记录")])]):e._e()],2)])])])]):e._e()])},f=[function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("名称")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("调度")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("技能")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("操作")])])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务名称 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("AI 模型 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("调度周期 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务内容 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("结果")])])])}],v=x(p,m,f,!1,null,null);const g=v.exports;export{g as default};