Commit 80200a17 authored by mhw's avatar mhw

版本跟新

parent 56d379cc
...@@ -3180,7 +3180,6 @@ ...@@ -3180,7 +3180,6 @@
"version": "1.0.10", "version": "1.0.10",
"resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": { "requires": {
"sprintf-js": "~1.0.2" "sprintf-js": "~1.0.2"
} }
...@@ -8832,6 +8831,11 @@ ...@@ -8832,6 +8831,11 @@
"assert-plus": "^1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"github-markdown-css": {
"version": "5.5.0",
"resolved": "https://registry.npmmirror.com/github-markdown-css/-/github-markdown-css-5.5.0.tgz",
"integrity": "sha512-Ncp4putm+cGteDhtNYKGdchM4uiIm5tmQcAQx/eEYhuM0sOdjZYNQOauQTaodjDQjfw7whU99MijwC1M0FUY4w=="
},
"glob": { "glob": {
"version": "7.2.3", "version": "7.2.3",
"resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz",
...@@ -12064,6 +12068,14 @@ ...@@ -12064,6 +12068,14 @@
"verror": "1.10.0" "verror": "1.10.0"
} }
}, },
"katex": {
"version": "0.6.0",
"resolved": "https://registry.npmmirror.com/katex/-/katex-0.6.0.tgz",
"integrity": "sha512-rS4mY3SvHYg5LtQV6RBcK0if7ur6plyEukAOV+jGGPqFImuzu8fHL6M752iBmRGoUyF0bhZbAPoezehn7xYksA==",
"requires": {
"match-at": "^0.1.0"
}
},
"killable": { "killable": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmmirror.com/killable/-/killable-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/killable/-/killable-1.0.1.tgz",
...@@ -12137,6 +12149,14 @@ ...@@ -12137,6 +12149,14 @@
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true "dev": true
}, },
"linkify-it": {
"version": "1.2.4",
"resolved": "https://registry.npmmirror.com/linkify-it/-/linkify-it-1.2.4.tgz",
"integrity": "sha512-eGHwtlABkp1NOJSiKUNqBf3SYAS5jPHtvRXPAgNaQwTqmkTahjtiLH9NtxdR5IOPhNvwNMN/diswSfZKzUkhGg==",
"requires": {
"uc.micro": "^1.0.1"
}
},
"lint-staged": { "lint-staged": {
"version": "9.5.0", "version": "9.5.0",
"resolved": "https://registry.npmmirror.com/lint-staged/-/lint-staged-9.5.0.tgz", "resolved": "https://registry.npmmirror.com/lint-staged/-/lint-staged-9.5.0.tgz",
...@@ -13027,6 +13047,104 @@ ...@@ -13027,6 +13047,104 @@
"object-visit": "^1.0.0" "object-visit": "^1.0.0"
} }
}, },
"markdown-it": {
"version": "6.1.1",
"resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-6.1.1.tgz",
"integrity": "sha512-woFl7h/sqt9xRmiMweNuO7nu+w8Lz3SXsDlvE3TYeu1SdPqQ+VW4GZyaKP442Bq6XUN6V6IQjJTR93RDYG2mjw==",
"requires": {
"argparse": "^1.0.7",
"entities": "~1.1.1",
"linkify-it": "~1.2.2",
"mdurl": "~1.0.1",
"uc.micro": "^1.0.1"
},
"dependencies": {
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
}
}
},
"markdown-it-abbr": {
"version": "1.0.4",
"resolved": "https://registry.npmmirror.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz",
"integrity": "sha512-ZeA4Z4SaBbYysZap5iZcxKmlPL6bYA8grqhzJIHB1ikn7njnzaP8uwbtuXc4YXD5LicI4/2Xmc0VwmSiFV04gg=="
},
"markdown-it-deflist": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz",
"integrity": "sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg=="
},
"markdown-it-emoji": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz",
"integrity": "sha512-QCz3Hkd+r5gDYtS2xsFXmBYrgw6KuWcJZLCEkdfAuwzZbShCmCfta+hwAMq4NX/4xPzkSHduMKgMkkPUJxSXNg=="
},
"markdown-it-footnote": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/markdown-it-footnote/-/markdown-it-footnote-2.0.0.tgz",
"integrity": "sha512-GMWkJXSHh5tiQt77zCLOSZI2Xy3Oqdb82GmT0Q0h2UT6SbUrMCAiHEiMBIt5V7Xfm73rBxS0VOhlLndkn1GPnw=="
},
"markdown-it-ins": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/markdown-it-ins/-/markdown-it-ins-2.0.0.tgz",
"integrity": "sha512-DhLLxseIg2C7+AULvoyVI+zMeufR0QFvXJ2o0oV013hN5HvBvNh2rbVtTdxZjI959+hgo2AA0aRdtEIUaKPbhg=="
},
"markdown-it-katex": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/markdown-it-katex/-/markdown-it-katex-2.0.3.tgz",
"integrity": "sha512-nUkkMtRWeg7OpdflamflE/Ho/pWl64Lk9wNBKOmaj33XkQdumhXAIYhI0WO03GeiycPCsxbmX536V5NEXpC3Ng==",
"requires": {
"katex": "^0.6.0"
}
},
"markdown-it-mark": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/markdown-it-mark/-/markdown-it-mark-2.0.0.tgz",
"integrity": "sha512-iT8ua0Bda8QrVwHDOUNw1eyCuL7irXeYch5n8zGS4tb7wsDIn7EjQZLjihKaijzBiL0ikfWL2zAvL/ECqTvsNA=="
},
"markdown-it-sub": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz",
"integrity": "sha512-z2Rm/LzEE1wzwTSDrI+FlPEveAAbgdAdPhdWarq/ZGJrGW/uCQbKAnhoCsE4hAbc3SEym26+W2z/VQB0cQiA9Q=="
},
"markdown-it-sup": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz",
"integrity": "sha512-E32m0nV9iyhRR7CrhnzL5msqic7rL1juWre6TQNxsnApg7Uf+F97JOKxUijg5YwXz86lZ0mqfOnutoryyNdntQ=="
},
"markdown-it-task-lists": {
"version": "2.1.1",
"resolved": "https://registry.npmmirror.com/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz",
"integrity": "sha512-TxFAc76Jnhb2OUu+n3yz9RMu4CwGfaT788br6HhEDlvWfdeJcLUsxk1Hgw2yJio0OXsxv7pyIPmvECY7bMbluA=="
},
"markdown-it-toc-and-anchor": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/markdown-it-toc-and-anchor/-/markdown-it-toc-and-anchor-4.2.0.tgz",
"integrity": "sha512-DusSbKtg8CwZ92ztN7bOojDpP4h0+w7BVOPuA3PHDIaabMsERYpwsazLYSP/UlKedoQjOz21mwlai36TQ04EpA==",
"requires": {
"clone": "^2.1.0",
"uslug": "^1.0.4"
},
"dependencies": {
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/clone/-/clone-2.1.2.tgz",
"integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w=="
}
}
},
"marked": {
"version": "11.1.0",
"resolved": "https://registry.npmmirror.com/marked/-/marked-11.1.0.tgz",
"integrity": "sha512-fvKJWAPEafVj1dwGwcPI5mBB/0pvViL6NlCbNDG1HOIRwwAU/jeMoFxfbRLuirO1wRH7m4yPvBqD/O1wyWvayw=="
},
"match-at": {
"version": "0.1.1",
"resolved": "https://registry.npmmirror.com/match-at/-/match-at-0.1.1.tgz",
"integrity": "sha512-h4Yd392z9mST+dzc+yjuybOGFNOZjmXIPKWjxBd1Bb23r4SmDOsk2NYCU2BMUBGbSpZqwVsZYNq26QS3xfaT3Q=="
},
"matches-selector": { "matches-selector": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmmirror.com/matches-selector/-/matches-selector-1.2.0.tgz", "resolved": "https://registry.npmmirror.com/matches-selector/-/matches-selector-1.2.0.tgz",
...@@ -13050,6 +13168,11 @@ ...@@ -13050,6 +13168,11 @@
"integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==",
"dev": true "dev": true
}, },
"mdurl": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
},
"media-typer": { "media-typer": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz", "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz",
...@@ -17564,8 +17687,7 @@ ...@@ -17564,8 +17687,7 @@
"sprintf-js": { "sprintf-js": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
"dev": true
}, },
"sshpk": { "sshpk": {
"version": "1.17.0", "version": "1.17.0",
...@@ -18659,6 +18781,11 @@ ...@@ -18659,6 +18781,11 @@
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
"dev": true "dev": true
}, },
"uc.micro": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-1.0.6.tgz",
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
},
"uglify-js": { "uglify-js": {
"version": "3.4.10", "version": "3.4.10",
"resolved": "https://registry.npmmirror.com/uglify-js/-/uglify-js-3.4.10.tgz", "resolved": "https://registry.npmmirror.com/uglify-js/-/uglify-js-3.4.10.tgz",
...@@ -18771,6 +18898,11 @@ ...@@ -18771,6 +18898,11 @@
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true "dev": true
}, },
"unorm": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
},
"unpipe": { "unpipe": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
...@@ -18936,6 +19068,14 @@ ...@@ -18936,6 +19068,14 @@
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
"dev": true "dev": true
}, },
"uslug": {
"version": "1.0.4",
"resolved": "https://registry.npmmirror.com/uslug/-/uslug-1.0.4.tgz",
"integrity": "sha512-Jrbpp/NS3TvIGNjfJT1sn3/BCeykoxR8GbNYW5lF6fUscLkbXFwj1b7m4DvIkHm8k3Qr6Co68lbTmoZTMGk/ow==",
"requires": {
"unorm": ">= 1.0.0"
}
},
"util": { "util": {
"version": "0.11.1", "version": "0.11.1",
"resolved": "https://registry.npmmirror.com/util/-/util-0.11.1.tgz", "resolved": "https://registry.npmmirror.com/util/-/util-0.11.1.tgz",
...@@ -19245,6 +19385,33 @@ ...@@ -19245,6 +19385,33 @@
} }
} }
}, },
"vue-markdown": {
"version": "2.2.4",
"resolved": "https://registry.npmmirror.com/vue-markdown/-/vue-markdown-2.2.4.tgz",
"integrity": "sha512-hoTX/W1UIdHZrp/b0vpHSsJXAEfWsafaQLgtE2VX4gY8O/C3L2Gabqu95gyG429rL4ML1SwGv+xsPABX7yfFIQ==",
"requires": {
"highlight.js": "^9.12.0",
"markdown-it": "^6.0.1",
"markdown-it-abbr": "^1.0.3",
"markdown-it-deflist": "^2.0.1",
"markdown-it-emoji": "^1.1.1",
"markdown-it-footnote": "^2.0.0",
"markdown-it-ins": "^2.0.0",
"markdown-it-katex": "^2.0.3",
"markdown-it-mark": "^2.0.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-task-lists": "^2.0.1",
"markdown-it-toc-and-anchor": "^4.1.2"
},
"dependencies": {
"highlight.js": {
"version": "9.18.5",
"resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-9.18.5.tgz",
"integrity": "sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA=="
}
}
},
"vue-router": { "vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",
......
...@@ -40,4 +40,7 @@ export default class PresetTemplateController { ...@@ -40,4 +40,7 @@ export default class PresetTemplateController {
static deleteCollect (sender, params, axiosOption, httpOption) { static deleteCollect (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/promptTemplate/deleteCollect', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/promptTemplate/deleteCollect', 'post', params, axiosOption, httpOption);
} }
static listForTree (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/promptTemplate/listForTree', 'post', params, axiosOption, httpOption);
}
} }
...@@ -122,14 +122,24 @@ body .fullscreen-dialog .layui-layer-content { ...@@ -122,14 +122,24 @@ body .fullscreen-dialog .layui-layer-content {
} }
.orange-project { .orange-project {
.el-button--primary { .el-button--primary {
background-color: $--color-primary !important; background-color: $--color-primary;
border-color:$--color-primary !important; border-color:$--color-primary ;
} }
.el-button.is-plain:hover, .el-button.is-plain:focus{ .el-button--primary.is-plain {
background: #FFFFFF; color: #0092FF;
border-color: $--color-primary; background: #e6f4ff;
color: $--color-primary; border-color: #99d3ff;
} }
.el-button--primary.is-plain:hover, .el-button--primary.is-plain:focus {
background: #0092FF;
border-color: #0092FF;
color: #FFFFFF;
}
// .el-button.is-plain:hover, .el-button.is-plain:focus{
// background: #FFFFFF;
// border-color: $--color-primary;
// color: $--color-primary;
// }
.el-button--danger.is-plain:hover, .el-button--danger.is-plain:focus { .el-button--danger.is-plain:hover, .el-button--danger.is-plain:focus {
background: #F56C6C; background: #F56C6C;
border-color: #F56C6C; border-color: #F56C6C;
......
...@@ -34,6 +34,7 @@ import OnlineBaseCard from '@/online/components/OnlineBaseCard.vue'; ...@@ -34,6 +34,7 @@ import OnlineBaseCard from '@/online/components/OnlineBaseCard.vue';
import OnlineCustomTabs from '@/online/components/OnlineCustomTabs.vue'; import OnlineCustomTabs from '@/online/components/OnlineCustomTabs.vue';
import OnlineCustomTableContainer from '@/online/components/OnlineTableContainer/index.vue'; import OnlineCustomTableContainer from '@/online/components/OnlineTableContainer/index.vue';
import VueClipboard from 'vue-clipboard2' import VueClipboard from 'vue-clipboard2'
Vue.prototype.$SocketService = SocketService Vue.prototype.$SocketService = SocketService
Vue.use(VueClipboard) Vue.use(VueClipboard)
Vue.component('OnlineCustomBlock', OnlineCustomBlock); Vue.component('OnlineCustomBlock', OnlineCustomBlock);
...@@ -54,7 +55,14 @@ Vue.component('user-select', UserSelect); ...@@ -54,7 +55,14 @@ Vue.component('user-select', UserSelect);
Vue.component('dept-select', DeptSelect); Vue.component('dept-select', DeptSelect);
Vue.component('table-box', TableBox); Vue.component('table-box', TableBox);
Vue.component('right-add-btn', RightAddBtn); Vue.component('right-add-btn', RightAddBtn);
var EventBus = new Vue();
Object.defineProperties(Vue.prototype, {
$bus: {
get: function () {
return EventBus
}
}
})
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(VCharts); Vue.use(VCharts);
......
...@@ -49,7 +49,11 @@ ...@@ -49,7 +49,11 @@
</vxe-column> </vxe-column>
<vxe-column field="runCount" title="运行数量"></vxe-column> <vxe-column field="runCount" title="运行数量"></vxe-column>
<vxe-column field="taskDescribe" title="任务描述"></vxe-column> <vxe-column field="taskDescribe" title="任务描述"></vxe-column>
<vxe-column field="createUserId" title="创建人"></vxe-column> <vxe-column field="createUserId" title="创建人">
<template slot-scope="scope">
{{scope.row.createUserIdDictMap.name}}
</template>
</vxe-column>
<vxe-column field="createTime" title="创建时间"></vxe-column> <vxe-column field="createTime" title="创建时间"></vxe-column>
<vxe-column field="operation" title="操作"> <vxe-column field="operation" title="操作">
<template slot-scope="scope"> <template slot-scope="scope">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-descriptions title="基本信息" style="width: 100%;line-height: 30px;"> <el-descriptions title="基本信息" style="width: 100%;line-height: 30px;">
<el-descriptions-item label="任务名称:">{{tableItem.taskName}}</el-descriptions-item> <el-descriptions-item label="任务名称:">{{tableItem.taskName}}</el-descriptions-item>
<el-descriptions-item label="任务ID:">{{tableItem.taskId}}</el-descriptions-item> <el-descriptions-item label="任务ID:">{{tableItem.taskId}}</el-descriptions-item>
<el-descriptions-item label="创建人:">{{tableItem.updateUserId}}</el-descriptions-item> <el-descriptions-item label="创建人:">{{tableItem.createUserIdDictMap.name}}</el-descriptions-item>
<el-descriptions-item label="创建时间:">{{tableItem.createTime}}</el-descriptions-item> <el-descriptions-item label="创建时间:">{{tableItem.createTime}}</el-descriptions-item>
<el-descriptions-item label="任务描述:">{{tableItem.taskDescribe}}</el-descriptions-item> <el-descriptions-item label="任务描述:">{{tableItem.taskDescribe}}</el-descriptions-item>
<el-descriptions-item label="任务类型:">{{ModelType.getValue(tableItem.taskType) }}</el-descriptions-item> <el-descriptions-item label="任务类型:">{{ModelType.getValue(tableItem.taskType) }}</el-descriptions-item>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-descriptions title="基本信息"> <el-descriptions title="基本信息">
<el-descriptions-item label="运行名称:">{{item.runName}}</el-descriptions-item> <el-descriptions-item label="运行名称:">{{item.runName}}</el-descriptions-item>
<el-descriptions-item label="运行ID:">{{item.runId}}</el-descriptions-item> <el-descriptions-item label="运行ID:">{{item.runId}}</el-descriptions-item>
<el-descriptions-item label="创建人:">{{ item.createUserId }}</el-descriptions-item> <el-descriptions-item label="创建人:">{{ item.createUserIdDictMap.name }}</el-descriptions-item>
<el-descriptions-item label="创建时间:">{{item.createTime }}</el-descriptions-item> <el-descriptions-item label="创建时间:">{{item.createTime }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
......
...@@ -171,7 +171,7 @@ export default { ...@@ -171,7 +171,7 @@ export default {
particulars (item) { particulars (item) {
this.$dialog.show('任务详情', taskOperate, { this.$dialog.show('任务详情', taskOperate, {
area: ['100%', '100%'] area: ['100%', '100%']
}, {page: 'particulars', item: item }).then(res => { }, {page: 'particulars', item: {...item, createUserIdDictMap: this.tableItem.createUserIdDictMap} }).then(res => {
this.refresh(); this.refresh();
}).catch(e => { }).catch(e => {
this.refresh(); this.refresh();
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-table :data="tableData"> <el-table :data="tableData">
<el-table-column prop="label" label="自动规则打分指标"> <el-table-column prop="label" label="自动规则打分指标">
</el-table-column> </el-table-column>
<el-table-column prop="value" :label="item.modelTask.versionName" > <el-table-column prop="value" :label="item.modelVersionIdDictMap.name" >
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:data="myDataSetPage.tableData.impl.dataList" min-height="96"> :data="myDataSetPage.tableData.impl.dataList" min-height="96">
<vxe-column title="模型名称"> <vxe-column title="模型名称">
<template > <template >
{{ item.modelTask.versionName }} {{ item.modelVersionIdDictMap.name }}
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="input" title="Prompt问题"></vxe-column> <vxe-column field="input" title="Prompt问题"></vxe-column>
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<el-descriptions title="数据配置"> <el-descriptions title="数据配置">
<el-descriptions-item label="数据集:">{{item.datasetVersionId}}</el-descriptions-item> <el-descriptions-item label="数据集:">{{item.datasetVersionIdDictMap.name}}</el-descriptions-item>
<el-descriptions-item label="数据模型:">{{item.modelTask.versionName}}</el-descriptions-item> <el-descriptions-item label="数据模型:">{{item.modelVersionIdDictMap.name}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
}, },
mounted () { mounted () {
console.log(this.item);
}, },
methods: { methods: {
......
...@@ -46,7 +46,14 @@ export default { ...@@ -46,7 +46,14 @@ export default {
timeImg: null timeImg: null
}; };
}, },
props: ['page', 'item'], props: {
page: {
default: 'particulars'
},
item: {
default: {}
}
},
components: { particulars, assessmentReport, trainingLog }, components: { particulars, assessmentReport, trainingLog },
computed: {}, computed: {},
......
...@@ -49,6 +49,7 @@ import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/ ...@@ -49,6 +49,7 @@ import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/
import { ModelTask } from '@/api/gptController.js'; import { ModelTask } from '@/api/gptController.js';
// import editOrAdd from './dialog/editOrAdd'; // import editOrAdd from './dialog/editOrAdd';
import particulars from '@/views/gptTraining/modelManagement/modelEvaluation/dialog/particulars.vue'; import particulars from '@/views/gptTraining/modelManagement/modelEvaluation/dialog/particulars.vue';
import modelCompressionParticulars from '@/views/gptTraining/modelManagement/modelCompression/dialog/particulars.vue';
export default { export default {
data () { data () {
...@@ -136,12 +137,35 @@ export default { ...@@ -136,12 +137,35 @@ export default {
}) })
}, },
particulars (item) { particulars (item) {
console.log(item); // {
this.$dialog.show('详情', particulars, { // id: 0,
area: ['100%', '100%'] // name: '新建版本',
}, { item: item }).then(res => { // symbol: 'NewVersion'
this.refresh(); // },
}).catch(e => { }); // {
// id: 1,
// name: '模型评估',
// symbol: 'modelEvaluation'
// },
// {
// id: 2,
// name: '模型压缩',
// symbol: 'ModelCompression'
// }
console.log(item, item.taskStatus);
if (item.taskStatus === 2) { // 模型压缩
this.$dialog.show('详情', modelCompressionParticulars, {
area: ['100%', '100%']
}, { item: item }).then(res => {
this.refresh();
}).catch(e => { });
} else {
this.$dialog.show('详情', particulars, {
area: ['100%', '100%']
}, { item: item }).then(res => {
this.refresh();
}).catch(e => { });
}
}, },
refresh (reloadData = false) { refresh (reloadData = false) {
if (reloadData) { if (reloadData) {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<vxe-column field="taskType" title="任务类型"> <vxe-column field="taskType" title="任务类型">
<template slot-scope="scope"> <template slot-scope="scope">
{{ TaskType.getValue(scope.row.taskType) }} {{ TaskType.getValue(scope.row.taskType) }}
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="taskStatus" title="任务状态"> <vxe-column field="taskStatus" title="任务状态">
...@@ -49,7 +50,7 @@ import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/ ...@@ -49,7 +50,7 @@ import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/
import { ModelTask } from '@/api/gptController.js'; import { ModelTask } from '@/api/gptController.js';
// import editOrAdd from './dialog/editOrAdd'; // import editOrAdd from './dialog/editOrAdd';
import particulars from '@/views/gptTraining/modelManagement/modelEvaluation/dialog/particulars.vue'; import particulars from '@/views/gptTraining/modelManagement/modelEvaluation/dialog/particulars.vue';
import modelCompressionParticulars from '@/views/gptTraining/modelManagement/modelCompression/dialog/particulars.vue';
export default { export default {
data () { data () {
return { return {
...@@ -136,12 +137,20 @@ export default { ...@@ -136,12 +137,20 @@ export default {
}) })
}, },
particulars (item) { particulars (item) {
console.log(item); console.log(item, item.taskType);
this.$dialog.show('详情', particulars, { if (item.taskType === 2) { // 模型压缩
area: ['100%', '100%'] this.$dialog.show('模型压缩详情', modelCompressionParticulars, {
}, { item: item }).then(res => { area: ['100%', '100%']
this.refresh(); }, { item: item.modelCompress}).then(res => {
}).catch(e => { }); this.refresh();
}).catch(e => { });
} else {
this.$dialog.show('模型评估详情', particulars, {
area: ['100%', '100%']
}, { item: item.modelEstimate }).then(res => {
this.refresh();
}).catch(e => { });
}
}, },
refresh (reloadData = false) { refresh (reloadData = false) {
if (reloadData) { if (reloadData) {
......
<!-- 答案内容预览 -->
<template>
<vue-markdown :source="content" v-highlight class="markdown-body" >
</vue-markdown>
</template>
<script>
import hljs from 'highlight.js' // 代码块高亮
// import 'highlight.js/styles/github.css' // 代码块高亮样式
import 'github-markdown-css' // 整体 markdown 样式
import VueMarkdown from 'vue-markdown'
export default {
data () {
return {
result: undefined
};
},
props: ['content'],
components: {VueMarkdown},
computed: {},
directives: {
highlight: {
// 指令的定义
inserted: function (el) {
let blocks = el.querySelectorAll('pre code');
blocks.forEach((block, index) => {
/** 代码高亮 */
hljs.highlightBlock(block);
/** 手动添加一个hljs类名,防止不支持的语言背景变空白 */
block.classList.add('hljs');
})
}
}
},
mounted () {
},
methods: {}
}
</script>
<style scoped>
.markdown-body{
background: none !important;
font-size: 14px !important;
}
.markdown-body pre{
background-color: #3b3d3f;
}
</style>
<!--左侧操作界面 --> <!--左侧操作界面 -->
<template> <template>
<el-form label-position="left" ref="form" label-width="120px" :model="form" :size="defaultFormItemSize" style="padding:20px"> <el-form label-position="left" ref="form" label-width="120px" :model="form" :size="defaultFormItemSize"
style="padding:20px;width:400px">
<el-form-item label="请选择对话模式:"> <el-form-item label="请选择对话模式:">
<el-select v-model="form.pattern" placeholder="请选择"> <el-select v-model="form.pattern" placeholder="请选择">
<el-option v-for="item in ModeOfSpeaking.getList()" :key="item.id" :label="item.name" :value="item.name"> <el-option v-for="item in ModeOfSpeaking.getList()" :key="item.id" :label="item.name" :value="item.name">
...@@ -12,45 +13,66 @@ ...@@ -12,45 +13,66 @@
:props='{ label: "name", value: "name", emitPath: false }' @change="changeModel"></el-cascader> :props='{ label: "name", value: "name", emitPath: false }' @change="changeModel"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="Temperature:"> <el-form-item label="Temperature:">
<el-slider v-model="temperature" :format-tooltip="formatTooltip" @change="form.temperature=temperature / 100"></el-slider> <el-slider v-model="temperature" :format-tooltip="formatTooltip"
@change="form.temperature = temperature / 100"></el-slider>
</el-form-item> </el-form-item>
<el-form-item label="历史对话轮数:"> <el-form-item label="历史对话轮数:">
<el-input-number v-model="form.heistoryRotate" :min="0" :max="10" ></el-input-number> <el-input-number v-model="form.heistoryRotate" :min="0" :max="10"></el-input-number>
</el-form-item>
<el-form-item label="提示词:">
<el-select v-model="promptTemplate" filterable placeholder="请选择提示词" value-key="templateId"
@change="templateControllerChange" clearable>
<el-option v-for="item in templateControllerList" :key="item.value" :label="item.label" :value="item">
</el-option>
</el-select>
<el-switch @change="changePromptTemplate" style="margin-left: 10px;" v-model="isPromptTemplate"
active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item label-width="0px" v-if="form.prompt_template">
<div style="background-color: #f3f3f3;
padding: 10px;
border-radius: 10px;">
{{ form.prompt_template }}
</div>
</el-form-item> </el-form-item>
<el-form-item label-width="0px" v-if="form.pattern=='知识库问答'"> <el-form-item label-width="0px" v-if="form.pattern == '知识库问答'">
<el-collapse value="1"> <el-collapse value="1">
<el-collapse-item name="1"> <el-collapse-item name="1">
<template slot="title">知识库配置</template> <template slot="title">知识库配置</template>
<el-form-item label="请选择知识库:" style="margin-bottom:30px"> <el-form-item label="请选择知识库:" style="margin-bottom:30px">
<el-select ref="knowledgeSelect" v-model="form.knowledgeConfige.knowledge_base_name" placeholder="请选择" @change="changeKnowledge"> <el-select ref="knowledgeSelect" v-model="form.knowledgeConfige.knowledge_base_name" placeholder="请选择"
<el-option v-for="item in knowledgeList" :key="item.knowledgeId" :label="item.knowledgeName" :value="item.knowledgeName"> @change="changeKnowledge">
<el-option v-for="item in knowledgeList" :key="item.knowledgeId" :label="item.knowledgeName"
:value="item.knowledgeName">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="匹配知识条数:" style="margin-bottom:30px"> <el-form-item label="匹配知识条数:" style="margin-bottom:30px">
<el-input-number v-model="form.knowledgeConfige.top_k" :min="1" :max="20" ></el-input-number> <el-input-number v-model="form.knowledgeConfige.top_k" :min="1" :max="20"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="知识匹配分数阈值:"> <el-form-item label="知识匹配分数阈值:">
<el-slider v-model="form.knowledgeConfige.score_threshold" :format-tooltip="formatTooltip" @change="form.knowledgeConfige.score_threshold=knowledgeScoreThreshold / 100"></el-slider> <el-slider v-model="knowledgeScoreThreshold" :format-tooltip="formatTooltip"
@change="form.knowledgeConfige.score_threshold = knowledgeScoreThreshold / 100"></el-slider>
</el-form-item> </el-form-item>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</el-form-item> </el-form-item>
<el-form-item label-width="0px" v-if="form.pattern == '搜索引擎问答'">
<el-form-item label-width="0px" v-if="form.pattern=='搜索引擎问答'">
<el-collapse value="1"> <el-collapse value="1">
<el-collapse-item name="1"> <el-collapse-item name="1">
<template slot="title">搜索引擎配置</template> <template slot="title">搜索引擎配置</template>
<el-form-item label="选择搜索引擎:" style="margin-bottom:30px"> <el-form-item label="选择搜索引擎:" style="margin-bottom:30px">
<el-select ref="searchSelect" v-model="form.searchConfige.search_engine_name" placeholder="请选择" @change="changeSe"> <el-select ref="searchSelect" v-model="form.searchConfige.search_engine_name" placeholder="请选择"
<el-option v-for="item in [{label:'bing',value:'bing'},{label:'duckduckgo',value:'duckduckgo'}]" :key="item.value" :label="item.label" :value="item.value"> @change="changeSe">
<el-option v-for="item in [{ label: 'bing', value: 'bing' }, { label: 'duckduckgo', value: 'duckduckgo' }]"
:key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="匹配搜索结果条数:"> <el-form-item label="匹配搜索结果条数:">
<el-input-number v-model="form.searchConfige.top_k" :min="1" :max="20" ></el-input-number> <el-input-number v-model="form.searchConfige.top_k" :min="1" :max="20"></el-input-number>
</el-form-item> </el-form-item>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
...@@ -60,10 +82,14 @@ ...@@ -60,10 +82,14 @@
</template> </template>
<script> <script>
import { KnowledgeManage, MyModel, ModelVersion } from '@/api/gptController.js'; import { KnowledgeManage, MyModel, ModelVersion, TemplateController } from '@/api/gptController.js';
import promptWordTemplate from '../promptWordTemplate';
export default { export default {
data () { data () {
return { return {
isPromptTemplate: true,
promptTemplate: '',
templateControllerList: [],
modelList: [], modelList: [],
activeModelList: [], activeModelList: [],
loading: undefined, loading: undefined,
...@@ -75,6 +101,7 @@ export default { ...@@ -75,6 +101,7 @@ export default {
pattern: 'LLM 对话', // 对话模式 pattern: 'LLM 对话', // 对话模式
model_name: undefined, // 模型名称 model_name: undefined, // 模型名称
temperature: 0.7, temperature: 0.7,
prompt_template: '',
heistoryRotate: 10, // 历史对话轮数 heistoryRotate: 10, // 历史对话轮数
knowledgeConfige: {// 知识库配置 knowledgeConfige: {// 知识库配置
knowledge_base_name: '', knowledge_base_name: '',
...@@ -107,9 +134,24 @@ export default { ...@@ -107,9 +134,24 @@ export default {
mounted () { mounted () {
this.getKnowledgeList() this.getKnowledgeList()
this.getModelList() this.getModelList()
this.getTemplateControllerList()
}, },
methods: { methods: {
getTemplateControllerList () {
TemplateController.listForTree(this, {}).then(res => {
this.templateControllerList = res.data.map((item) => {
return {
templateId: item.templateId,
label: item.templateName,
value: item.templateContent,
parameterFormat: item.parameterFormat
}
})
}).catch(e => {
console.log(e);
});
},
getModelList () { getModelList () {
MyModel.listForTree(this, {}).then(res => { MyModel.listForTree(this, {}).then(res => {
this.modelList = res.data.map((item) => { this.modelList = res.data.map((item) => {
...@@ -159,7 +201,7 @@ export default { ...@@ -159,7 +201,7 @@ export default {
}, },
switchModel (versionId) { // 切换模型 switchModel (versionId) { // 切换模型
this.openLoading('LLM模型加载中') this.openLoading('LLM模型加载中')
ModelVersion.change(this, {versionId: versionId}).then(res => { ModelVersion.change(this, { versionId: versionId }).then(res => {
console.log(res); console.log(res);
this.loading.close(); this.loading.close();
}).catch(e => { }).catch(e => {
...@@ -179,13 +221,36 @@ export default { ...@@ -179,13 +221,36 @@ export default {
changeSe (dtat) { // 修改模型引擎 changeSe (dtat) { // 修改模型引擎
// this.openLoading('模型引擎加载中') // this.openLoading('模型引擎加载中')
// console.log(this.$refs.searchSelect); // console.log(this.$refs.searchSelect);
},
templateControllerChange (data) {
if (!data) {
this.form.prompt_template = ''
return
}
this.$dialog.show(data.label, promptWordTemplate, {
area: ['50%', '40%']
}, { data: data }).then(res => {
this.form.prompt_template = res
}).catch(e => {
this.promptTemplate = undefined
});
},
changePromptTemplate () {
console.log(1, this.$bus);
this.$bus.$emit('isPromptTemplate', this.isPromptTemplate);
} }
} }
} }
</script> </script>
<style > <style >
.myLoading .el-loading-spinner i{ .myLoading .el-loading-spinner i {
font-size: 24px !important; font-size: 24px !important;
} }
.el-form-item__content{
display: flex;
flex-direction: row;
align-items: center;
}
</style> </style>
<!-- 提示词模板 -->
<template>
<div>
<div class="promptWordTemplate">
<span v-for="(item,index) in content" :key="index">
<template v-if="item.text">
{{ item.text }}
</template>
<template v-else-if="item.placeholder">
<el-input v-model="item.value" style="display:inline-block;width: 100px;margin-left: 10px;" size="small" :placeholder="item.placeholder"></el-input>
</template>
</span>
<el-row type="flex" justify="end" class="dialog-btn-layer mt20">
<el-button :size="defaultFormItemSize" :plain="true" @click="onCancel(false)">取消</el-button>
<el-button type="primary" :size="defaultFormItemSize" @click="onSubmit">确定</el-button>
</el-row>
</div>
</div>
</template>
<script>
export default {
data () {
return {
content: undefined,
text: '',
placeholders: []
};
},
props: ['data'],
components: {},
computed: {},
mounted () {
this.content = this.domRender(this.data.value, this.data.parameterFormat).map((item, index) => {
let x = this.placeholders.indexOf(item) !== -1
return {
text: x ? '' : item,
value: '',
placeholder: x ? item : ''
}
})
},
methods: {
onCancel (isSuccess, data) {
if (this.observer != null) {
this.observer.cancel(isSuccess, data);
}
},
domRender (str, parameterFormat) {
var match;
let strData = str
var regexPattern = new RegExp(`\\${parameterFormat[0]}([^}]+)\\${parameterFormat[1]}`, 'g');
while ((match = regexPattern.exec(str)) !== null) {
this.placeholders.push(match[1]);
}
var reg = new RegExp(`\\${parameterFormat[0]}(.*?)\\${parameterFormat[1]}`, 'g')
strData = strData.split(reg);
return strData
},
onSubmit () {
this.content.forEach(element => {
this.text += element.text || element.value
});
this.onCancel(true, this.text)
}
}
}
</script>
<style scoped>
.promptWordTemplate{
line-height: 30px;
}
</style>
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
<template> <template>
<div class="box"> <div class="box">
<!-- {{ this.extractContent( item.answer, '```', '```') }} --> <!-- {{ this.extractContent( item.answer, '```', '```') }} -->
<div class="contentBox" ref="contentBox" v-if="myHistory.length>0"> <div class="contentBox" ref="contentBox" v-if="myHistory.length > 0">
<div v-for="(item,index) in myHistory" :key="index"> <div v-for="(item, index) in myHistory" :key="index">
<div class="userBox"> <div class="userBox">
<div class="content"> <div class="content">
{{ item.content }} <!-- {{ item.content }} -->
<contentView :content="item.content" />
</div> </div>
<div class="icon"> <div class="icon">
{{ item.role }} {{ item.role }}
...@@ -18,11 +19,11 @@ ...@@ -18,11 +19,11 @@
GPT GPT
</div> </div>
<div class="content"> <div class="content">
<span v-if="item.answer">{{ item.answer }}</span> <!-- <span v-if="item.answer">{{ item.answer }}</span>
<codePreview v-if="item.code.content" :type="item.code.language" :code="getcode(item.code.content)"/> <codePreview v-if="item.code.content" :type="item.code.language" :code="getcode(item.code.content)"/>
<span v-if="item.answer2">{{ item.answer2 }}</span> <span v-if="item.answer2">{{ item.answer2 }}</span> -->
<contentView :content="item.answer" />
</div> </div>
</div> </div>
</div> </div>
...@@ -30,15 +31,24 @@ ...@@ -30,15 +31,24 @@
<div class="initBox" v-else> <div class="initBox" v-else>
<div class="text"> <div class="text">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;你好,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;你好,<br>
我是人工智能语言模型<br> 我是人工智能语言模型<br>
我可以回答你的问题,为你提供有用信息,帮助你完成创作。<br> 我可以回答你的问题,为你提供有用信息,帮助你完成创作。<br>
</div> </div>
</div> </div>
<div class="inputBox"> <div class="inputBox">
<el-input placeholder="请输入内容" v-model="inputContent" class="input-with-select" @keyup.enter.native="submit"> <el-input placeholder="请输入内容" v-model="inputContent" class="input-with-select" @keyup.enter.native="submit">
<el-button slot="append" icon="el-icon-position" @click="submit"></el-button> <el-button slot="append" icon="el-icon-position" @click="submit"></el-button>
</el-input> </el-input>
<el-button icon="el-icon-delete" style="margin-left:10px" @click="clear" type="danger" plain></el-button>
<!-- <el-popover placement="top" width="400" trigger="click" ref="popover">
<el-select v-model="templateController" filterable placeholder="请选择" value-key="templateId" @change="templateControllerChange">
<el-option v-for="item in templateControllerList" :key="item.value" :label="item.label" :value="item">
</el-option>
</el-select>
<el-button slot="reference" icon="el-icon-s-opportunity" style="margin-left:10px" @click="clear" type="primary" plain>提示词</el-button>
</el-popover> -->
<el-button icon="el-icon-delete" style="margin-left:10px" @click="clear" type="danger" plain></el-button>
</div> </div>
</div> </div>
...@@ -46,17 +56,21 @@ ...@@ -46,17 +56,21 @@
<script> <script>
import { GetStreaming } from '@/utils/getStreaming.js'; import { GetStreaming } from '@/utils/getStreaming.js';
import codePreview from '../codePreview'; // import codePreview from '../codePreview';
import contentView from '../contentView';
export default { export default {
data () { data () {
return { return {
x: '当然可以,以下是使用JavaScript编写的“Hello World”示例代码: ```javascript console.log("Hello World"); ``` 将此代码复制并粘贴到浏览器的控制台或Node.js环境中,按下回车键,你将看到控制台输出 “Hello World”。', templateController: undefined,
isPromptTemplate: true,
inputContent: null, inputContent: null,
myHistory: [], myHistory: [],
heistoryRotate: null, // 历史轮数 heistoryRotate: null, // 历史轮数
param: { param: {
query: null, query: null,
history: [], history: [],
prompt_template: '',
'stream': true, 'stream': true,
'model_name': '', 'model_name': '',
'temperature': 0.7 'temperature': 0.7
...@@ -64,35 +78,21 @@ export default { ...@@ -64,35 +78,21 @@ export default {
}; };
}, },
props: ['chatForm'], props: ['chatForm'],
components: {codePreview}, components: { contentView },
computed: { computed: {
}, },
mounted () { mounted () {
// this.myHistory.push({ this.$bus.$on('isPromptTemplate', (data) => {
// 'role': 'user', this.isPromptTemplate = data
// 'content': this.inputContent, })
// 'answer': '', },
// 'code': { beforeDestroy () {
// temporary: '', // 移除监听事件 "share"
// language: undefined, this.$bus.$off('isPromptTemplate')
// content: ''
// },
// 'answer2': ''
// })
// let a = '当然可以,以下是使用JavaScript编写的“Hello World”示例代码: ```javascript console.log("Hello World"); ``` 将此代码复制并粘贴到浏览器的控制台或Node.js环境中,按下回车键,你将看到控制台输出 “Hello World”。'
// for (let index = 0; index < a.length; index++) {
// setTimeout(() => {
// // b += a[index]
// this.onmessage(a[index])
// }, 100 * index);
// }
}, },
methods: { methods: {
getCode (answer) { getCode (answer) {
...@@ -108,6 +108,7 @@ export default { ...@@ -108,6 +108,7 @@ export default {
this.param.model_name = this.chatForm.model_name this.param.model_name = this.chatForm.model_name
this.param.temperature = this.chatForm.temperature this.param.temperature = this.chatForm.temperature
this.heistoryRotate = this.chatForm.heistoryRotate this.heistoryRotate = this.chatForm.heistoryRotate
this.param.prompt_template = this.isPromptTemplate ? this.chatForm.prompt_template : undefined
let apiUrl let apiUrl
if (this.chatForm.pattern === 'LLM 对话') { if (this.chatForm.pattern === 'LLM 对话') {
apiUrl = '/2api/chat/chat' apiUrl = '/2api/chat/chat'
...@@ -130,10 +131,13 @@ export default { ...@@ -130,10 +131,13 @@ export default {
content: '' content: ''
}, },
'answer2': '' 'answer2': ''
}) })
this.inputContent = null; this.inputContent = null;
this.param.history = this.myHistory.slice(0, -1).slice(-this.heistoryRotate).map((item) => { return { role: item.role, content: item.content } }) // this.param.history =
this.myHistory.slice(0, -1).slice(-this.heistoryRotate).forEach((item) => {
this.param.history.push(...[{ role: item.role, content: item.content }, { role: 'assistant', content: item.answer + item.code?.content + item.answer2 }])
})
this.$emit('submit') this.$emit('submit')
let getData = new GetStreaming(apiUrl, this.param, this.onmessage) let getData = new GetStreaming(apiUrl, this.param, this.onmessage)
...@@ -141,42 +145,54 @@ export default { ...@@ -141,42 +145,54 @@ export default {
}, },
onmessage (data) { onmessage (data) {
let nowChat = this.myHistory[this.myHistory.length - 1] let nowChat = this.myHistory[this.myHistory.length - 1]
let code = nowChat.code if (this.chatForm.pattern === 'LLM 对话') {
let languages = ['javascript', 'php', 'java', 'css', 'python', 'html', 'c', 'c++', 'c#']
if (nowChat.answer.indexOf('```') === -1) {
nowChat.answer += data nowChat.answer += data
} else { } else if (this.chatForm.pattern === '知识库问答') {
if (code.content.indexOf('```') === -1) { let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
if (code.temporary.indexOf('```') === -1) { temporary.forEach((item) => {
nowChat.code.content += data nowChat.answer += item.answer || '\n' + item.docs
} })
nowChat.code.temporary += data } else if (this.chatForm.pattern === '搜索引擎问答') {
if (code.temporary.split(' ').length > 1) {
if (languages.indexOf(code.temporary.split(' ', 1)[0].toLowerCase()) === -1) {
code.language = undefined
} else {
code.language = code.temporary.split(' ')[0]
}
}
console.log(code);
} else {
console.log(data);
nowChat.answer2 += data
}
} }
// let code = nowChat.code
// let languages = ['javascript', 'php', 'java', 'css', 'python', 'html', 'c', 'c++', 'c#']
// if (nowChat.answer.indexOf('```') === -1) {
// nowChat.answer += data
// } else {
// if (code.content.indexOf('```') === -1) {
// if (code.temporary.indexOf('```') === -1) {
// code.content += data
// }
// code.temporary += data
// if (code.temporary.split(' ').length > 1) {
// if (languages.indexOf(code.temporary.split(' ', 1)[0].toLowerCase()) === -1) {
// code.language = undefined
// } else {
// code.language = code.temporary.split(' ')[0]
// }
// }
// } else {
// nowChat.answer2 += data
// }
// }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.contentBox.scrollTo(0, this.$refs.contentBox.scrollHeight) this.$refs.contentBox.scrollTo(0, this.$refs.contentBox.scrollHeight)
}) })
},
getcode (data) {
if (this.myHistory[this.myHistory.length - 1].code.language) {
}
return data.split(' ').slice(1).join('').replace('```', '')
} }
// getcode (data) {
// if (this.myHistory[this.myHistory.length - 1].code.language) {
// return data.split(' ').slice(1).join('').replace('```', '')
// } else {
// return data.replace('```', '')
// }
// }
} }
} }
...@@ -189,7 +205,8 @@ export default { ...@@ -189,7 +205,8 @@ export default {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
} }
.initBox .text{
.initBox .text {
background-color: #f3f3f3; background-color: #f3f3f3;
padding: 10px; padding: 10px;
border-radius: 10px; border-radius: 10px;
...@@ -197,23 +214,25 @@ export default { ...@@ -197,23 +214,25 @@ export default {
line-height: 23px; line-height: 23px;
font-size: 14px; font-size: 14px;
} }
.initBox{
.initBox {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 20px; padding-bottom: 20px;
} }
.box { .box {
height: 100%; height: 100%;
padding: 10px; padding: 10px;
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-image: url('~@/assets/img/ai.png'); background-image: url("~@/assets/img/ai.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-size: auto 50%; background-size: auto 50%;
} }
.icon { .icon {
height: 32px; height: 32px;
width: 32px; width: 32px;
...@@ -232,24 +251,28 @@ export default { ...@@ -232,24 +251,28 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
width: 100%; width: 100%;
} }
.userBox { .userBox {
justify-content: flex-end; justify-content: flex-end;
} }
.userBox .icon { .userBox .icon {
margin-left: 10px; margin-left: 10px;
background-color: #4754b1; background-color: #4754b1;
} }
.gptBox .icon { .gptBox .icon {
margin-right: 10px; margin-right: 10px;
background-color: #363c6e; background-color: #363c6e;
} }
.content { .content {
background-color: #f3f3f3; background-color: #f3f3f3;
padding: 10px; padding: 10px;
border-radius: 10px; border-radius: 10px;
height: fit-content; height: fit-content;
} }
.inputBox{
.inputBox {
display: flex; display: flex;
} }</style>
</style>
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
background: #fff; background: #fff;
position: relative; position: relative;
transition: all 0.3s; transition: all 0.3s;
} }
.leftBox{ .leftBox{
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
<div class="login-input"> <div class="login-input">
<span class="title">欢迎登录</span> <span class="title">欢迎登录</span>
<span class="desc">{{projectName}}</span> <span class="desc">{{projectName}}</span>
<el-form :model="dataForm" :rules="dataRule" size="medium" ref="dataForm" @keyup.enter.native="dataFormSubmit()"> <el-form :model="dataForm" label-position="top" :rules="dataRule" size="medium" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="70px">
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="mobilePhone" label="用户名" style="margin-bottom: 12px;"> <el-form-item prop="mobilePhone" label="用户名" >
<el-input v-model="dataForm.mobilePhone" style="width: 100%;" placeholder="帐号"> <el-input v-model="dataForm.mobilePhone" style="width: 100%;" placeholder="帐号">
<img slot="prefix" src="@/assets/img/login_username.png" alt=""> <img slot="prefix" src="@/assets/img/login_username.png" alt="">
</el-input> </el-input>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment