Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front
56
.gitea/workflows/prod_build_manual.yaml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: 手动触发 FiDA WEB-Node.js 生产分支构建部署
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [ 18.18.0 ]
|
||||||
|
env:
|
||||||
|
REMOTE_DEPLOY_PATH: /workspace/workspace_fida/Web_Workspace_Server/Prod
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 0.记录开始时间
|
||||||
|
id: build_start_time
|
||||||
|
run: echo "current_time=$(TZ='Asia/Hong_Kong' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: 1.检出代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
|
||||||
|
- name: 2.设置 Node.js 环境
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run build
|
||||||
|
- run: ls -l
|
||||||
|
|
||||||
|
- name: 3.同步文件到远程服务器
|
||||||
|
uses: appleboy/scp-action@v0.1.7
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
source: "./dist/*"
|
||||||
|
target: ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
ssh_options: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||||
|
strip_components: 0
|
||||||
|
|
||||||
|
- name: 4. 远程重载 Nginx 配置
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
# 核心:执行 Nginx 重载命令
|
||||||
|
script: |
|
||||||
|
echo "尝试重载 Nginx 服务..."
|
||||||
|
# 💡 注意:执行此命令需要服务器用户具有 sudo 权限,并且配置了 NOPASSWD。
|
||||||
|
# 否则工作流可能会因为权限不足而失败。
|
||||||
|
sudo systemctl reload nginx
|
||||||
|
echo "Nginx 重载命令已发送。"
|
||||||
@@ -5,5 +5,6 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"printWidth": 100,
|
"printWidth": 100,
|
||||||
"useTabs": true,
|
"useTabs": true,
|
||||||
"trailingComma": "none"
|
"trailingComma": "none",
|
||||||
|
"vueIndentScriptAndStyle": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "furniture",
|
"name": "furniture",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|||||||
3
src/assets/icons/copy.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M8.50645 1.33331H10.8282C11.3648 1.3333 11.8077 1.3333 12.1685 1.36278C12.5433 1.39339 12.8877 1.4591 13.2113 1.62396C13.7131 1.87963 14.121 2.28757 14.3767 2.78934C14.5415 3.1129 14.6072 3.45736 14.6379 3.8321C14.6673 4.19289 14.6673 4.63579 14.6673 5.17243V7.4942C14.6673 8.03084 14.6673 8.47374 14.6379 8.83453C14.6072 9.20926 14.5415 9.55373 14.3767 9.87729C14.121 10.3791 13.7131 10.787 13.2113 11.0427C12.8877 11.2075 12.5433 11.2732 12.1685 11.3039C11.9277 11.3235 11.6503 11.3301 11.3329 11.3322C11.3307 11.6497 11.3242 11.9271 11.3045 12.1679C11.2739 12.5426 11.2082 12.8871 11.0433 13.2106C10.7877 13.7124 10.3797 14.1203 9.87796 14.376C9.5544 14.5409 9.20993 14.6066 8.8352 14.6372C8.47441 14.6667 8.03151 14.6667 7.49487 14.6666H5.1731C4.63646 14.6667 4.19356 14.6667 3.83277 14.6372C3.45804 14.6066 3.11357 14.5409 2.79001 14.376C2.28824 14.1203 1.8803 13.7124 1.62463 13.2106C1.45977 12.8871 1.39406 12.5426 1.36345 12.1679C1.33397 11.8071 1.33398 11.3642 1.33398 10.8275V8.50578C1.33398 7.96913 1.33397 7.52623 1.36345 7.16543C1.39406 6.7907 1.45977 6.44623 1.62463 6.12267C1.8803 5.62091 2.28824 5.21296 2.79001 4.9573C3.11357 4.79244 3.45804 4.72673 3.83277 4.69611C4.07358 4.67643 4.35097 4.66989 4.66839 4.66772C4.67057 4.3503 4.67711 4.07291 4.69678 3.8321C4.7274 3.45736 4.79311 3.1129 4.95797 2.78934C5.21363 2.28757 5.62158 1.87963 6.12334 1.62396C6.4469 1.4591 6.79137 1.39339 7.1661 1.36278C7.5269 1.3333 7.96981 1.3333 8.50645 1.33331ZM6.00183 4.66665L7.49485 4.66665C8.0315 4.66664 8.4744 4.66663 8.8352 4.69611C9.20993 4.72673 9.5544 4.79244 9.87796 4.9573C10.3797 5.21296 10.7877 5.62091 11.0433 6.12267C11.2082 6.44623 11.2739 6.7907 11.3045 7.16543C11.334 7.52623 11.334 7.96914 11.334 8.5058V9.99881C11.631 9.99672 11.8642 9.99094 12.06 9.97495C12.3522 9.95107 12.5017 9.90778 12.606 9.85466C12.8569 9.72682 13.0608 9.52285 13.1887 9.27197C13.2418 9.1677 13.2851 9.01823 13.3089 8.72596C13.3335 8.4259 13.334 8.0377 13.334 7.46665V5.19998C13.334 4.62893 13.3335 4.24073 13.3089 3.94067C13.2851 3.6484 13.2418 3.49893 13.1887 3.39466C13.0608 3.14378 12.8569 2.9398 12.606 2.81197C12.5017 2.75885 12.3522 2.71556 12.06 2.69168C11.7599 2.66717 11.3717 2.66665 10.8007 2.66665H8.53398C7.96293 2.66665 7.57474 2.66717 7.27468 2.69168C6.9824 2.71556 6.83293 2.75884 6.72866 2.81197C6.47778 2.9398 6.27381 3.14378 6.14598 3.39466C6.09285 3.49893 6.04957 3.6484 6.02569 3.94067C6.00969 4.1364 6.00391 4.36963 6.00183 4.66665ZM3.94134 6.02501C3.64907 6.04889 3.4996 6.09218 3.39533 6.1453C3.14445 6.27314 2.94047 6.47711 2.81264 6.72799C2.75952 6.83226 2.71623 6.98173 2.69235 7.274C2.66784 7.57406 2.66732 7.96226 2.66732 8.53331V10.8C2.66732 11.371 2.66784 11.7592 2.69235 12.0593C2.71623 12.3516 2.75952 12.501 2.81264 12.6053C2.94047 12.8562 3.14445 13.0602 3.39533 13.188C3.4996 13.2411 3.64907 13.2844 3.94134 13.3083C4.2414 13.3328 4.6296 13.3333 5.20065 13.3333H7.46732C8.03837 13.3333 8.42657 13.3328 8.72663 13.3083C9.0189 13.2844 9.16837 13.2411 9.27264 13.188C9.52352 13.0602 9.7275 12.8562 9.85533 12.6053C9.90845 12.501 9.95174 12.3516 9.97562 12.0593C10.0001 11.7592 10.0007 11.371 10.0007 10.8V8.53331C10.0007 7.96226 10.0001 7.57406 9.97562 7.274C9.95174 6.98173 9.90845 6.83226 9.85533 6.72799C9.7275 6.47711 9.52352 6.27314 9.27264 6.1453C9.16837 6.09218 9.0189 6.04889 8.72663 6.02501C8.42657 6.0005 8.03837 5.99998 7.46732 5.99998H5.20065C4.6296 5.99998 4.2414 6.0005 3.94134 6.02501Z" fill="currentColor" fill-opacity="0.65"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.5 KiB |
3
src/assets/icons/equal.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M6 9C6 8.44772 6.44772 8 7 8H17C17.5523 8 18 8.44772 18 9C18 9.55228 17.5523 10 17 10H7C6.44772 10 6 9.55228 6 9ZM6 15C6 14.4477 6.44772 14 7 14H17C17.5523 14 18 14.4477 18 15C18 15.5523 17.5523 16 17 16H7C6.44772 16 6 15.5523 6 15Z" fill="currentColor"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 368 B |
3
src/assets/icons/refreshTransparent.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M0.00519349 5.25084C0.374352 2.29042 2.89859 0 5.95881 0C7.48038 0 8.89399 0.567115 9.9667 1.50293V0.666667C9.9667 0.298477 10.2652 0 10.6334 0C11.0016 0 11.3 0.298477 11.3 0.666667V3.33333C11.3 3.70152 11.0016 4 10.6334 4H7.95881C7.59062 4 7.29214 3.70152 7.29214 3.33333C7.29214 2.96514 7.59062 2.66667 7.95881 2.66667H9.26357C8.40925 1.84253 7.23221 1.33333 5.95881 1.33333C3.57953 1.33333 1.61525 3.11449 1.32828 5.41583C1.28272 5.78119 0.949604 6.04044 0.584243 5.99488C0.218883 5.94932 -0.0403663 5.6162 0.00519349 5.25084ZM11.3334 6.00512C11.6987 6.05068 11.958 6.3838 11.9124 6.74916C11.5433 9.70958 9.01902 12 5.95881 12C4.44096 12 3.03056 11.4357 1.95881 10.5039V11.3333C1.95881 11.7015 1.66033 12 1.29214 12C0.923951 12 0.625474 11.7015 0.625474 11.3333V8.66667C0.625474 8.29848 0.923951 8 1.29214 8H3.95881C4.327 8 4.62547 8.29848 4.62547 8.66667C4.62547 9.03486 4.327 9.33333 3.95881 9.33333H2.65404C3.50837 10.1575 4.6854 10.6667 5.95881 10.6667C8.33808 10.6667 10.3024 8.88551 10.5893 6.58417C10.6349 6.21881 10.968 5.95956 11.3334 6.00512Z" fill="currentColor" fill-opacity="0.65"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
3
src/assets/icons/thumbDown.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M7.91215 14.3308C7.77862 14.5645 7.51769 14.695 7.25063 14.6616L6.94814 14.6238C5.30337 14.4182 4.24269 12.7778 4.73015 11.1935L5.0988 9.99538C4.87276 9.99127 4.66908 9.98361 4.48636 9.96929C4.08346 9.93771 3.71249 9.87012 3.3762 9.69307C2.68269 9.32795 2.18492 8.67624 2.01514 7.9111C1.93281 7.54007 1.96521 7.16439 2.04076 6.76738C2.11454 6.37964 2.24367 5.9062 2.40205 5.3255L2.71371 4.18272C2.72491 4.14168 2.73591 4.10119 2.74677 4.06125C2.94391 3.33614 3.09216 2.79083 3.41704 2.37016C3.70217 2.00096 4.07916 1.71301 4.51038 1.53507C5.0017 1.33233 5.56681 1.33278 6.31825 1.33338C7.59912 1.3344 8.88 1.33344 10.1609 1.33344C10.6975 1.33343 11.1404 1.33343 11.5012 1.36291C11.8759 1.39352 12.2204 1.45923 12.544 1.62409C13.0457 1.87975 13.4537 2.2877 13.7093 2.78947C13.8742 3.11302 13.9399 3.45749 13.9705 3.83223C14 4.19302 14 4.63593 14 5.17258V6.66678C14 6.69781 14 6.72838 14 6.7585C14.0003 7.28876 14.0005 7.68253 13.9091 8.02363C13.6625 8.94387 12.9437 9.66267 12.0235 9.90925C11.6824 10.0006 11.2886 10.0004 10.7584 10.0001C10.7283 10.0001 10.6977 10.0001 10.6667 10.0001C10.4936 10.0001 10.3339 10.0928 10.2481 10.243L7.91215 14.3308ZM10.9793 2.67229C11.0928 2.87001 11.1819 3.08389 11.2425 3.30993C11.3339 3.65103 11.3336 4.0448 11.3334 4.57506C11.3333 4.60518 11.3333 4.63575 11.3333 4.66678V8.6602C11.505 8.65408 11.5992 8.64257 11.6784 8.62135C12.1385 8.49806 12.4979 8.13866 12.6212 7.67854C12.6609 7.53035 12.6667 7.32968 12.6667 6.66678V5.20011C12.6667 4.62906 12.6661 4.24086 12.6416 3.9408C12.6177 3.64852 12.5745 3.49906 12.5213 3.39479C12.3935 3.14391 12.1895 2.93993 11.9386 2.8121C11.8344 2.75897 11.6849 2.71569 11.3926 2.69181C11.2713 2.6819 11.1357 2.67591 10.9793 2.67229ZM9.99999 8.79359V4.66678C9.99999 4.00387 9.99426 3.8032 9.95456 3.65502C9.83127 3.1949 9.47187 2.8355 9.01175 2.71221C8.86356 2.6725 8.66289 2.66678 7.99999 2.66678H6.44413C5.50832 2.66678 5.23352 2.67906 5.01898 2.76759C4.80337 2.85656 4.61487 3.00053 4.47231 3.18513C4.33045 3.36882 4.24629 3.63071 4.00007 4.53354L3.69563 5.6498C3.52827 6.26345 3.41343 6.68636 3.35059 7.01663C3.28839 7.34349 3.29206 7.51073 3.31681 7.62227C3.4017 8.00484 3.65059 8.3307 3.99734 8.51326C4.09844 8.56648 4.25882 8.61403 4.59053 8.64003C4.9257 8.6663 5.36392 8.66678 5.99999 8.66678C6.21155 8.66678 6.41056 8.7672 6.53625 8.93738C6.66194 9.10756 6.69939 9.32729 6.63717 9.5295L6.00453 11.5856C5.77439 12.3335 6.23437 13.1065 6.97869 13.277L9.0904 9.58151C9.29853 9.21729 9.62205 8.94286 9.99999 8.79359Z" fill="currentColor" fill-opacity="0.65"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.6 KiB |
3
src/assets/icons/thumbUp.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M8.0879 1.66924C8.22143 1.43556 8.48236 1.3051 8.74942 1.33848L9.05191 1.37629C10.6967 1.58189 11.7574 3.22233 11.2699 4.8066L10.9012 6.00471C11.1273 6.00881 11.331 6.01648 11.5137 6.0308C11.9166 6.06238 12.2876 6.12997 12.6239 6.30702C13.3174 6.67214 13.8151 7.32385 13.9849 8.08898C14.0672 8.46002 14.0348 8.83569 13.9593 9.23271C13.8855 9.62045 13.7564 10.0939 13.598 10.6746L13.2863 11.8174C13.2751 11.8584 13.2641 11.8989 13.2533 11.9388C13.0561 12.6639 12.9079 13.2093 12.583 13.6299C12.2979 13.9991 11.9209 14.2871 11.4897 14.465C10.9983 14.6678 10.4332 14.6673 9.6818 14.6667C8.40093 14.6657 7.12005 14.6666 5.83918 14.6666C5.30254 14.6667 4.85964 14.6667 4.49885 14.6372C4.12412 14.6066 3.77965 14.5409 3.45609 14.376C2.95432 14.1203 2.54638 13.7124 2.29071 13.2106C2.12585 12.8871 2.06014 12.5426 2.02953 12.1679C2.00005 11.8071 2.00006 11.3642 2.00006 10.8275L2.00006 9.3333C2.00006 9.30228 2.00005 9.27171 2.00003 9.24158C1.99974 8.71133 1.99953 8.31756 2.09093 7.97646C2.33751 7.05621 3.0563 6.33742 3.97655 6.09084C4.31765 5.99944 4.71142 5.99965 5.24167 5.99994C5.2718 5.99996 5.30237 5.99997 5.33339 5.99997C5.50641 5.99997 5.66615 5.90727 5.75199 5.75705L8.0879 1.66924ZM5.02074 13.3278C4.90721 13.1301 4.81816 12.9162 4.75759 12.6902C4.66619 12.3491 4.66641 11.9553 4.66669 11.425C4.66671 11.3949 4.66673 11.3643 4.66673 11.3333V7.33988C4.49502 7.34601 4.40083 7.35752 4.32164 7.37874C3.86152 7.50203 3.50212 7.86143 3.37883 8.32155C3.33912 8.46974 3.3334 8.67041 3.3334 9.3333V10.8C3.3334 11.371 3.33392 11.7592 3.35843 12.0593C3.38231 12.3516 3.4256 12.501 3.47872 12.6053C3.60655 12.8562 3.81053 13.0602 4.06141 13.188C4.16568 13.2411 4.31515 13.2844 4.60742 13.3083C4.72871 13.3182 4.8644 13.3242 5.02074 13.3278ZM6.00006 7.20649V11.3333C6.00006 11.9962 6.00579 12.1969 6.04549 12.3451C6.16878 12.8052 6.52818 13.1646 6.9883 13.2879C7.13649 13.3276 7.33716 13.3333 8.00006 13.3333H9.55592C10.4917 13.3333 10.7665 13.321 10.9811 13.2325C11.1967 13.1435 11.3852 12.9996 11.5277 12.815C11.6696 12.6313 11.7538 12.3694 12 11.4665L12.3044 10.3503C12.4718 9.73663 12.5866 9.31372 12.6495 8.98346C12.7117 8.65659 12.708 8.48936 12.6832 8.37781C12.5983 7.99525 12.3495 7.66939 12.0027 7.48683C11.9016 7.4336 11.7412 7.38605 11.4095 7.36006C11.0744 7.33379 10.6361 7.33331 10.0001 7.33331C9.7885 7.33331 9.58949 7.23289 9.4638 7.06271C9.33811 6.89253 9.30066 6.6728 9.36288 6.47059L9.99552 4.41448C10.2257 3.66654 9.76568 2.89356 9.02136 2.7231L6.90965 6.41857C6.70152 6.7828 6.378 7.05723 6.00006 7.20649Z" fill="currentColor" fill-opacity="0.65"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/images/agent-thumb.jpg
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
src/assets/images/sender.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/assets/images/user-thumb.jpg
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
@@ -88,7 +88,10 @@ export default {
|
|||||||
diversity: 'Diversity',
|
diversity: 'Diversity',
|
||||||
relevance: 'Relevance'
|
relevance: 'Relevance'
|
||||||
},
|
},
|
||||||
confirm: 'Confirm'
|
confirm: 'Confirm',
|
||||||
|
styleTitle: 'Settings',
|
||||||
|
createProject: 'Create Project',
|
||||||
|
trendingReport: 'Trending Report'
|
||||||
},
|
},
|
||||||
area: {
|
area: {
|
||||||
unitedStates: 'United States',
|
unitedStates: 'United States',
|
||||||
@@ -102,6 +105,10 @@ export default {
|
|||||||
canada: 'Canada',
|
canada: 'Canada',
|
||||||
germany: 'Germany'
|
germany: 'Germany'
|
||||||
},
|
},
|
||||||
|
agent: {
|
||||||
|
copySuccess: 'Text copied to clipboard',
|
||||||
|
copyFaild: 'Copy failed. Your browser may be restricting clipboard access. Please try copying manually.'
|
||||||
|
},
|
||||||
|
|
||||||
// Version Tree
|
// Version Tree
|
||||||
VersionTree: {
|
VersionTree: {
|
||||||
@@ -114,7 +121,13 @@ export default {
|
|||||||
branchingNodeTree: 'Branching Node Tree',
|
branchingNodeTree: 'Branching Node Tree',
|
||||||
restore: 'Restore',
|
restore: 'Restore',
|
||||||
newChat: 'New Chat',
|
newChat: 'New Chat',
|
||||||
delete: 'Delete'
|
delete: 'Delete',
|
||||||
|
deleteChat:'Delete chat?',
|
||||||
|
deleteHint:'Once deleted, you won’t be able to view this conversation again.',
|
||||||
|
restoreChat:'Restore chat?',
|
||||||
|
restoreHint:'Once deleted, you won’t be able to view this conversation again.',
|
||||||
|
cancel: 'cancel',
|
||||||
|
Confirm: 'Confirm',
|
||||||
},
|
},
|
||||||
//generateSketch
|
//generateSketch
|
||||||
generateSketch: {
|
generateSketch: {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
orContinueWith: '或者使用',
|
orContinueWith: '或者使用',
|
||||||
googleLogin: '使用 Google 登录',
|
googleLogin: '使用 Google 登录',
|
||||||
wechatLogin: '使用微信登录',
|
wechatLogin: '使用微信登录',
|
||||||
indexTip: '一个多智能体画布,用于快速、趋势驱动的设计迭代。',
|
indexTip: '一个多智能体画布,用于快速、趋势驱动的设计迭代。'
|
||||||
},
|
},
|
||||||
Nuic: {
|
Nuic: {
|
||||||
hiName: '你好,{name}。这是 Fiphant。',
|
hiName: '你好,{name}。这是 Fiphant。',
|
||||||
@@ -49,7 +49,7 @@ export default {
|
|||||||
basedIn: '公司',
|
basedIn: '公司',
|
||||||
role: '角色',
|
role: '角色',
|
||||||
allSet: '准备好了!',
|
allSet: '准备好了!',
|
||||||
loadingTip: '我们正在自定义您的仪表板。',
|
loadingTip: '我们正在自定义您的仪表板。'
|
||||||
},
|
},
|
||||||
Home: {
|
Home: {
|
||||||
creditsNum: '积分: {num}',
|
creditsNum: '积分: {num}',
|
||||||
@@ -98,5 +98,36 @@ export default {
|
|||||||
japan: '日本',
|
japan: '日本',
|
||||||
canada: '加拿大',
|
canada: '加拿大',
|
||||||
germany: '德国'
|
germany: '德国'
|
||||||
|
},
|
||||||
|
agent: {
|
||||||
|
copySuccess: '文本已复制到剪贴板',
|
||||||
|
copyFaild:
|
||||||
|
'复制失败。您的浏览器可能限制了剪贴板访问,请允许浏览器访问剪贴板或尝试手动复制。'
|
||||||
|
},
|
||||||
|
|
||||||
|
// Version Tree
|
||||||
|
VersionTree: {
|
||||||
|
versionInformation: '版本信息',
|
||||||
|
input: '用户请求',
|
||||||
|
userRequest: '用户请求',
|
||||||
|
sketch: '设计草图',
|
||||||
|
generateResult: '生成结果',
|
||||||
|
linearNodeTree: '线性节点树',
|
||||||
|
branchingNodeTree: '分支节点树',
|
||||||
|
restore: '恢复',
|
||||||
|
newChat: '新建对话',
|
||||||
|
delete: '删除',
|
||||||
|
deleteChat:'删除对话?',
|
||||||
|
deleteHint:'删除后将无法恢复该对话。',
|
||||||
|
restoreChat:'恢复对话?',
|
||||||
|
restoreHint:'恢复后将显示该对话。',
|
||||||
|
cancel: '取消',
|
||||||
|
Confirm: '确认',
|
||||||
|
},
|
||||||
|
//generateSketch
|
||||||
|
generateSketch: {
|
||||||
|
restore: '恢复',
|
||||||
|
delete: '删除',
|
||||||
|
edit: '编辑'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,22 +17,22 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/index',
|
path: '/index',
|
||||||
name: 'index',
|
name: 'index',
|
||||||
component: () => import('../views/login/index.vue'),
|
component: () => import('../views/login/index.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
name: 'login',
|
name: 'login',
|
||||||
component: () => import('../views/login/login.vue'),
|
component: () => import('../views/login/login.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/register',
|
path: '/register',
|
||||||
name: 'register',
|
name: 'register',
|
||||||
component: () => import('../views/login/register.vue'),
|
component: () => import('../views/login/register.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/nuic',
|
path: '/nuic',
|
||||||
name: 'nuic',
|
name: 'nuic',
|
||||||
component: () => import('../views/nuic/index.vue'),
|
component: () => import('../views/nuic/index.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/home',
|
path: '/home',
|
||||||
@@ -48,7 +48,7 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/home/versionTree',
|
path: '/home/versionTree',
|
||||||
name: 'versionTree',
|
name: 'versionTree',
|
||||||
component: () => import('../views/home/versionTree.vue'),
|
component: () => import('../views/home/VersionTree.vue'),
|
||||||
meta: { topNavStyle: '2' }
|
meta: { topNavStyle: '2' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -62,12 +62,18 @@ const router = createRouter({
|
|||||||
component: () => import('../views/canvas/index.vue'),
|
component: () => import('../views/canvas/index.vue'),
|
||||||
meta: { topNavStyle: '2' }
|
meta: { topNavStyle: '2' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'agent',
|
||||||
|
name: 'agent',
|
||||||
|
component: () => import('../views/home/agent/index.vue')
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/:pathMatch(.*)',
|
path: '/:pathMatch(.*)',
|
||||||
name: '404',
|
name: '404',
|
||||||
component: () => import('../views/404.vue'),
|
component: () => import('../views/404.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
75
src/views/home/agent/components/Agent.vue
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div class="agent-container flex flex-col">
|
||||||
|
<div class="agent-header flex align-center space-between">
|
||||||
|
<div class="header-title-wrapper">
|
||||||
|
<div class="agent-title">{{ props.title }}</div>
|
||||||
|
<div class="agent-name">AI Assistant 1.0</div>
|
||||||
|
</div>
|
||||||
|
<SvgIcon name="equal" color="#0d0d0d" size="24" />
|
||||||
|
</div>
|
||||||
|
<div class="agent-body flex-1 flex flex-col">
|
||||||
|
<List />
|
||||||
|
<Input :is-agent-mode="true" @send="handleSendMessage" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import List from './List.vue'
|
||||||
|
import Input from '../../components/Input.vue'
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
title: string
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
title: 'Retro Sofa Sketch'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const handleSendMessage = (message: string) => {
|
||||||
|
console.log('Message sent:', message)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.c-svg {
|
||||||
|
width: initial;
|
||||||
|
}
|
||||||
|
.agent-container {
|
||||||
|
// width: 39%;
|
||||||
|
width: 63.4rem;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 2rem;
|
||||||
|
box-shadow: 0px 15px 21px 0px #0000000d;
|
||||||
|
|
||||||
|
.agent-header {
|
||||||
|
height: 7.4rem;
|
||||||
|
border-bottom: 0.1rem solid #c9c9c9;
|
||||||
|
font-family: 'GeneralMedium';
|
||||||
|
padding: 1.4rem 3.4rem 1.4rem 3.1rem;
|
||||||
|
|
||||||
|
.agent-title {
|
||||||
|
font-size: 1.8rem;
|
||||||
|
margin-bottom: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agent-name {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.agent-body {
|
||||||
|
padding: 3.2rem;
|
||||||
|
.assist-input-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 14.4rem;
|
||||||
|
min-height: 14.4rem !important;
|
||||||
|
max-height: 14.4rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.input-wrapper {
|
||||||
|
height: 14.4rem;
|
||||||
|
padding: 0 2rem 3rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
127
src/views/home/agent/components/Item.vue
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<div class="agent-item">
|
||||||
|
<div class="message-wrapper flex align-center" :class="{ 'is-user': content.isUser }">
|
||||||
|
<div class="thumb">
|
||||||
|
<img :src="content.isUser ? userThumb : agentThumb" class="thumb-icon" />
|
||||||
|
</div>
|
||||||
|
<div class="message-context">
|
||||||
|
<div class="message-txt">{{ content.text }}</div>
|
||||||
|
<div class="operate flex" :class="{ 'is-user': content.isUser }">
|
||||||
|
<template v-if="content.isUser">
|
||||||
|
<SvgIcon name="copy" size="16" color="#000" @click.stop="handleCopyText" />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<SvgIcon
|
||||||
|
v-for="operate in operateList"
|
||||||
|
:key="operate.name"
|
||||||
|
:name="operate.name"
|
||||||
|
:size="operate.name === 'refreshTransparent' ? '14' : '16'"
|
||||||
|
color="#000000A6"
|
||||||
|
@click.stop="operate.action"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
import userThumb from '@/assets/images/user-thumb.jpg'
|
||||||
|
import agentThumb from '@/assets/images/agent-thumb.jpg'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
content: Object
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const operateList = ref([
|
||||||
|
{
|
||||||
|
name: 'thumbUp',
|
||||||
|
action: () => {
|
||||||
|
console.log('thumbUp')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'thumbDown',
|
||||||
|
action: () => {
|
||||||
|
console.log('thumbDown')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'refreshTransparent',
|
||||||
|
action: () => {
|
||||||
|
console.log('refresh')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'copy',
|
||||||
|
action: () => {
|
||||||
|
handleCopyText()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
const handleCopyText = () => {
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(props.content.text)
|
||||||
|
.then(() => {
|
||||||
|
// console.log('Text copied to clipboard');
|
||||||
|
ElMessage({
|
||||||
|
message: t('agent.copySuccess'),
|
||||||
|
type: 'success',
|
||||||
|
offset: 300
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error('Could not copy text: ', err)
|
||||||
|
ElMessage({
|
||||||
|
message: t('agent.copyFailed'),
|
||||||
|
type: 'error',
|
||||||
|
offset: 300
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.c-svg {
|
||||||
|
width: initial;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.agent-item {
|
||||||
|
font-family: 'Regular';
|
||||||
|
font-size: 1.4rem;
|
||||||
|
.message-wrapper {
|
||||||
|
column-gap: 0.9rem;
|
||||||
|
&.is-user {
|
||||||
|
text-align: right;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
column-gap: 1.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumb {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 4.4rem;
|
||||||
|
height: 4.4rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 0.1rem solid #e5dfdf;
|
||||||
|
.thumb-icon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.operate {
|
||||||
|
margin-top: 1.3rem;
|
||||||
|
column-gap: 1.2rem;
|
||||||
|
&.is-user {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
29
src/views/home/agent/components/List.vue
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<template>
|
||||||
|
<div class="agent-list flex flex-col flex-1">
|
||||||
|
<Item v-for="message in messageList" :key="message.id" :content="message" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import Item from './Item.vue'
|
||||||
|
|
||||||
|
const messageList = ref([
|
||||||
|
{ id: 1, text: 'Hello', isUser: true },
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
text: 'Hey, I am your design assistant FiDA. I noticed that you want to design a yellow sofa. I can help you! Tell me what else you need?'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
text: 'Please design a vintage-inspired sofa with smooth, flowing lines and a sculptural silhouette. The sofa features a retro aesthetic combined with elegant curves, creating a timeless and refined look.',
|
||||||
|
isUser: true
|
||||||
|
}
|
||||||
|
])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.agent-list {
|
||||||
|
row-gap: 3.2rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
30
src/views/home/agent/index.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<div class="agent-wrapper flex space-between">
|
||||||
|
<Agent :title="agentTitle" />
|
||||||
|
<div class="preview-wrapper">preview</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import Agent from './components/Agent.vue'
|
||||||
|
const agentTitle = ref('Retro Sofa Sketch')
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.agent-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-top: 0.1rem solid #c9c9c9;
|
||||||
|
padding: 8rem 2.3rem 6rem 2.8rem;
|
||||||
|
|
||||||
|
.c-svg {
|
||||||
|
width: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-wrapper {
|
||||||
|
width: 91.2rem;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="assist-input-wrapper flex flex-col">
|
<div class="assist-input-wrapper flex flex-col" :class="{ agent: isAgentMode }">
|
||||||
<div class="scroll-content flex-col">
|
<div class="scroll-content flex-col">
|
||||||
<!-- 图片预览区域 -->
|
<!-- 图片预览区域 -->
|
||||||
<div v-if="uploadedImages.length > 0" class="image-preview-list flex wrap">
|
<div v-if="uploadedImages.length > 0" class="image-preview-list flex wrap">
|
||||||
<div v-for="(image, index) in uploadedImages" :key="index" class="image-preview-item">
|
<div
|
||||||
|
v-for="(image, index) in uploadedImages"
|
||||||
|
:key="index"
|
||||||
|
class="image-preview-item"
|
||||||
|
>
|
||||||
<img :src="image.url" :alt="image.name" class="preview-image" />
|
<img :src="image.url" :alt="image.name" class="preview-image" />
|
||||||
<div class="image-remove-btn" @click="removeImage(index)">
|
<div class="image-remove-btn" @click="removeImage(index)">
|
||||||
<SvgIcon name="delete" size="16" />
|
<SvgIcon name="delete" size="16" />
|
||||||
@@ -17,11 +21,14 @@
|
|||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
:placeholder="$t('Input.placeholder')"
|
:placeholder="$t('Input.placeholder')"
|
||||||
@input="handleEditorInput"
|
@input="handleEditorInput"
|
||||||
@keydown="handleEditorKeydown"
|
|
||||||
@paste="handleEditorPaste"
|
@paste="handleEditorPaste"
|
||||||
>
|
>
|
||||||
<!-- <Tag v-if="showReportTag" /> -->
|
<!-- <Tag v-if="showReportTag" /> -->
|
||||||
<div class="editor-tag report-btn flex-center" v-if="showReportTag" contenteditable="false">
|
<div
|
||||||
|
class="editor-tag report-btn flex-center"
|
||||||
|
v-if="showReportTag"
|
||||||
|
contenteditable="false"
|
||||||
|
>
|
||||||
<SvgIcon class="light-icon" name="light" size="16" />
|
<SvgIcon class="light-icon" name="light" size="16" />
|
||||||
<span>{{ $t('Input.trendingReport') }}</span>
|
<span>{{ $t('Input.trendingReport') }}</span>
|
||||||
<SvgIcon
|
<SvgIcon
|
||||||
@@ -34,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="operate flex space-between">
|
<div class="operate flex align-center space-between">
|
||||||
<div class="left flex align-center">
|
<div class="left flex align-center">
|
||||||
<div class="attach flex flex-center" @click="triggerFileUpload">
|
<div class="attach flex flex-center" @click="triggerFileUpload">
|
||||||
<img src="@/assets/icons/attach.svg" alt="" />
|
<img src="@/assets/icons/attach.svg" alt="" />
|
||||||
@@ -46,7 +53,11 @@
|
|||||||
style="display: none"
|
style="display: none"
|
||||||
@change="handleFileChange"
|
@change="handleFileChange"
|
||||||
/>
|
/>
|
||||||
<el-select v-model="typeValue" :placeholder="$t('Input.typePlaceholder')">
|
<el-select
|
||||||
|
v-if="!isAgentMode"
|
||||||
|
v-model="typeValue"
|
||||||
|
:placeholder="$t('Input.typePlaceholder')"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in typeOptions"
|
v-for="item in typeOptions"
|
||||||
class="input-option"
|
class="input-option"
|
||||||
@@ -55,7 +66,11 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="areaValue" :placeholder="$t('Input.areaPlaceholder')">
|
<el-select
|
||||||
|
v-if="!isAgentMode"
|
||||||
|
v-model="areaValue"
|
||||||
|
:placeholder="$t('Input.areaPlaceholder')"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in areaOptions"
|
v-for="item in areaOptions"
|
||||||
class="input-option"
|
class="input-option"
|
||||||
@@ -64,7 +79,7 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="fida-style-select-wrapper">
|
<div v-if="!isAgentMode" class="fida-style-select-wrapper">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="styleValue"
|
v-model="styleValue"
|
||||||
:placeholder="$t('Input.stylePlaceholder')"
|
:placeholder="$t('Input.stylePlaceholder')"
|
||||||
@@ -83,7 +98,9 @@
|
|||||||
<div class="fida-style-select-trigger"></div>
|
<div class="fida-style-select-trigger"></div>
|
||||||
</template>
|
</template>
|
||||||
<div class="fida-style-popover-content flex flex-col">
|
<div class="fida-style-popover-content flex flex-col">
|
||||||
<div class="fida-style-popover-header">{{ $t('Input.chooseStyle') }}</div>
|
<div class="fida-style-popover-header">
|
||||||
|
{{ $t('Input.chooseStyle') }}
|
||||||
|
</div>
|
||||||
<div class="fida-style-popover-grid">
|
<div class="fida-style-popover-grid">
|
||||||
<div
|
<div
|
||||||
v-for="item in styleOptions"
|
v-for="item in styleOptions"
|
||||||
@@ -137,13 +154,19 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div class="create-btn flex flex-center">
|
<div class="create-btn flex flex-center" v-if="!isAgentMode">
|
||||||
<img src="@/assets/images/shining.png" class="shining-icon" alt="" />
|
<img src="@/assets/images/shining.png" class="shining-icon" alt="" />
|
||||||
<span class="create-btn-text">{{ $t('Input.createProject') }}</span>
|
<span class="create-btn-text">{{ $t('Input.createProject') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
src="@/assets/images/sender.png"
|
||||||
|
class="sender-icon"
|
||||||
|
@click="handleSendAgent"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="report-btn flex flex-center" @click="toogltReportTag">
|
<div v-if="!isAgentMode" class="report-btn flex flex-center" @click="toogltReportTag">
|
||||||
<SvgIcon class="light-icon" name="light" size="16" />
|
<SvgIcon class="light-icon" name="light" size="16" />
|
||||||
<span>{{ $t('Input.trendingReport') }}</span>
|
<span>{{ $t('Input.trendingReport') }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -151,26 +174,37 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch, nextTick, onMounted } from 'vue'
|
import { computed, ref, watch, nextTick, onMounted } from 'vue'
|
||||||
import { areaList } from '@/utils/area'
|
import { areaList } from '@/utils/area'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
// import Tag from './Tag.vue'
|
// import Tag from './Tag.vue'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
isAgentMode?: boolean
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
isAgentMode: false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// 图片上传相关
|
const emits = defineEmits(['send'])
|
||||||
const fileInputRef = ref<HTMLInputElement | null>(null)
|
|
||||||
const uploadedImages = ref<Array<{ url: string; name: string }>>([])
|
|
||||||
|
|
||||||
// 触发文件上传
|
const { t } = useI18n()
|
||||||
const triggerFileUpload = () => {
|
|
||||||
|
// 图片上传相关
|
||||||
|
const fileInputRef = ref<HTMLInputElement | null>(null)
|
||||||
|
const uploadedImages = ref<Array<{ url: string; name: string }>>([])
|
||||||
|
|
||||||
|
// 触发文件上传
|
||||||
|
const triggerFileUpload = () => {
|
||||||
fileInputRef.value?.click()
|
fileInputRef.value?.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 标签被删除后无法重新出现
|
// BUG 标签被删除后无法重新出现
|
||||||
|
|
||||||
// 处理文件选择
|
// 处理文件选择
|
||||||
const handleFileChange = (event: Event) => {
|
const handleFileChange = (event: Event) => {
|
||||||
const input = event.target as HTMLInputElement
|
const input = event.target as HTMLInputElement
|
||||||
if (input.files) {
|
if (input.files) {
|
||||||
Array.from(input.files).forEach((file) => {
|
Array.from(input.files).forEach((file) => {
|
||||||
@@ -189,14 +223,14 @@ const handleFileChange = (event: Event) => {
|
|||||||
}
|
}
|
||||||
// 清空input的value,允许重复选择同一文件
|
// 清空input的value,允许重复选择同一文件
|
||||||
input.value = ''
|
input.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除图片
|
// 移除图片
|
||||||
const removeImage = (index: number) => {
|
const removeImage = (index: number) => {
|
||||||
uploadedImages.value.splice(index, 1)
|
uploadedImages.value.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const styleKeys: string[] = [
|
const styleKeys: string[] = [
|
||||||
'Coastal',
|
'Coastal',
|
||||||
'Verdant',
|
'Verdant',
|
||||||
'Traditional',
|
'Traditional',
|
||||||
@@ -206,20 +240,20 @@ const styleKeys: string[] = [
|
|||||||
'Bauhaus',
|
'Bauhaus',
|
||||||
'Constructivism',
|
'Constructivism',
|
||||||
'NordicNoir'
|
'NordicNoir'
|
||||||
]
|
]
|
||||||
|
|
||||||
// 标签相关(固定标签,v-show 控制显示)
|
// 标签相关(固定标签,v-show 控制显示)
|
||||||
const showReportTag = ref(false)
|
const showReportTag = ref(false)
|
||||||
const editorRef = ref<HTMLDivElement | null>(null)
|
const editorRef = ref<HTMLDivElement | null>(null)
|
||||||
const inputValue = ref<string>('')
|
const inputValue = ref<string>('')
|
||||||
|
|
||||||
const toogltReportTag = () => {
|
const toogltReportTag = () => {
|
||||||
console.log(showReportTag.value)
|
console.log(showReportTag.value)
|
||||||
|
|
||||||
showReportTag.value = !showReportTag.value
|
showReportTag.value = !showReportTag.value
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEditorInput = () => {
|
const handleEditorInput = () => {
|
||||||
if (!editorRef.value) return
|
if (!editorRef.value) return
|
||||||
|
|
||||||
// 提取纯文本(排除标签)
|
// 提取纯文本(排除标签)
|
||||||
@@ -237,101 +271,84 @@ const handleEditorInput = () => {
|
|||||||
|
|
||||||
// 自动调整高度
|
// 自动调整高度
|
||||||
autoResizeEditor()
|
autoResizeEditor()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEditorKeydown = (e: KeyboardEvent) => {
|
const handleEditorPaste = (e: ClipboardEvent) => {
|
||||||
// if (e.key === 'Backspace') {
|
|
||||||
// const selection = window.getSelection()
|
|
||||||
// if (selection && selection.rangeCount > 0) {
|
|
||||||
// const range = selection.getRangeAt(0)
|
|
||||||
// if (range.collapsed) {
|
|
||||||
// const node = range.startContainer
|
|
||||||
// const offset = range.startOffset
|
|
||||||
// // 如果光标在文本节点开头,且前一个兄弟是标签
|
|
||||||
// if (
|
|
||||||
// offset === 0 &&
|
|
||||||
// node.nodeType === Node.TEXT_NODE &&
|
|
||||||
// node.previousSibling &&
|
|
||||||
// (node.previousSibling as HTMLElement).classList.contains('editor-tag')
|
|
||||||
// ) {
|
|
||||||
// e.preventDefault()
|
|
||||||
// nextTick(() => (showReportTag.value = false))
|
|
||||||
// }
|
|
||||||
// // 如果光标在编辑器开头,且第一个子节点是标签
|
|
||||||
// else if (
|
|
||||||
// offset === 0 &&
|
|
||||||
// node === editorRef.value &&
|
|
||||||
// editorRef.value.firstChild &&
|
|
||||||
// (editorRef.value.firstChild as HTMLElement).classList.contains('editor-tag')
|
|
||||||
// ) {
|
|
||||||
// e.preventDefault()
|
|
||||||
// nextTick(() => (showReportTag.value = false))
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleEditorPaste = (e: ClipboardEvent) => {
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const text = e.clipboardData?.getData('text/plain') || ''
|
const text = e.clipboardData?.getData('text/plain') || ''
|
||||||
document.execCommand('insertText', false, text)
|
document.execCommand('insertText', false, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
const autoResizeEditor = () => {
|
const autoResizeEditor = () => {
|
||||||
const editor = editorRef.value
|
const editor = editorRef.value
|
||||||
if (editor) {
|
if (editor) {
|
||||||
|
if (props.isAgentMode) {
|
||||||
|
// editor.style.height = '6rem'
|
||||||
|
// editor.style.overflowY = 'auto'
|
||||||
|
return
|
||||||
|
} else {
|
||||||
editor.style.height = 'auto'
|
editor.style.height = 'auto'
|
||||||
const maxHeight = 20 * parseFloat(getComputedStyle(document.documentElement).fontSize || '16')
|
const maxHeight =
|
||||||
|
20 * parseFloat(getComputedStyle(document.documentElement).fontSize || '16')
|
||||||
editor.style.height = Math.min(editor.scrollHeight, maxHeight) + 'px'
|
editor.style.height = Math.min(editor.scrollHeight, maxHeight) + 'px'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 监听 inputValue 外部变化
|
const handleSendAgent=()=>{
|
||||||
watch(inputValue, () => {
|
emits('send', inputValue.value)
|
||||||
|
// 发送后清空输入框
|
||||||
|
if(editorRef.value){
|
||||||
|
editorRef.value.innerHTML = ''
|
||||||
|
}
|
||||||
|
inputValue.value = ''
|
||||||
|
}
|
||||||
|
// 监听 inputValue 外部变化
|
||||||
|
watch(inputValue, () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
autoResizeEditor()
|
autoResizeEditor()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 初始化编辑器高度
|
// 初始化编辑器高度
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
autoResizeEditor()
|
autoResizeEditor()
|
||||||
})
|
})
|
||||||
|
|
||||||
const typeValue = ref<string>('')
|
|
||||||
const areaValue = ref<string>('')
|
|
||||||
const styleValue = ref<string>('')
|
|
||||||
const tempSelectedValue = ref<string>('')
|
|
||||||
const stylePopupVisible = ref(false)
|
|
||||||
|
|
||||||
const settingPopupVisible = ref(false)
|
const typeValue = ref<string>('')
|
||||||
const settingOptions = ref([
|
const areaValue = ref<string>('')
|
||||||
|
const styleValue = ref<string>('')
|
||||||
|
const tempSelectedValue = ref<string>('')
|
||||||
|
const stylePopupVisible = ref(false)
|
||||||
|
|
||||||
|
const settingPopupVisible = ref(false)
|
||||||
|
const settingOptions = ref([
|
||||||
{ label: 'Input.settingOptions.creativity', value: 50 },
|
{ label: 'Input.settingOptions.creativity', value: 50 },
|
||||||
{ label: 'Input.settingOptions.diversity', value: 75 },
|
{ label: 'Input.settingOptions.diversity', value: 75 },
|
||||||
{ label: 'Input.settingOptions.relevance', value: 60 }
|
{ label: 'Input.settingOptions.relevance', value: 60 }
|
||||||
])
|
])
|
||||||
|
|
||||||
const openStylePopup = () => {
|
const openStylePopup = () => {
|
||||||
// 打开弹窗时初始化临时选中值为当前选中值
|
// 打开弹窗时初始化临时选中值为当前选中值
|
||||||
tempSelectedValue.value = styleValue.value
|
tempSelectedValue.value = styleValue.value
|
||||||
stylePopupVisible.value = true
|
stylePopupVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectStyle = (value: string) => {
|
const selectStyle = (value: string) => {
|
||||||
tempSelectedValue.value = value
|
tempSelectedValue.value = value
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmStyle = () => {
|
const confirmStyle = () => {
|
||||||
// 点击确认后才真正赋值
|
// 点击确认后才真正赋值
|
||||||
styleValue.value = tempSelectedValue.value
|
styleValue.value = tempSelectedValue.value
|
||||||
stylePopupVisible.value = false
|
stylePopupVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmSetting = () => {
|
const confirmSetting = () => {
|
||||||
settingPopupVisible.value = false
|
settingPopupVisible.value = false
|
||||||
}
|
}
|
||||||
const typeOptions = ref<any[]>([
|
const typeOptions = ref<any[]>([
|
||||||
{
|
{
|
||||||
label: 'Input.types.sofa',
|
label: 'Input.types.sofa',
|
||||||
value: 'Sofa'
|
value: 'Sofa'
|
||||||
@@ -344,18 +361,18 @@ const typeOptions = ref<any[]>([
|
|||||||
label: 'Input.types.chair',
|
label: 'Input.types.chair',
|
||||||
value: 'Chair'
|
value: 'Chair'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
const areaOptions = ref<any[]>(areaList)
|
const areaOptions = ref<any[]>(areaList)
|
||||||
const styleOptions = ref<any[]>(
|
const styleOptions = ref<any[]>(
|
||||||
styleKeys.map((key) => ({
|
styleKeys.map((key) => ({
|
||||||
label: `Input.styles.${key}`,
|
label: `Input.styles.${key}`,
|
||||||
value: key
|
value: key
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.assist-input-wrapper {
|
.assist-input-wrapper {
|
||||||
min-height: 23.5rem;
|
min-height: 23.5rem;
|
||||||
max-height: 43.5rem;
|
max-height: 43.5rem;
|
||||||
width: 106.3rem;
|
width: 106.3rem;
|
||||||
@@ -563,8 +580,8 @@ const styleOptions = ref<any[]>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.input-option {
|
.input-option {
|
||||||
// padding: 0 1rem;
|
// padding: 0 1rem;
|
||||||
margin: 0 0.6rem;
|
margin: 0 0.6rem;
|
||||||
padding: 0 0.8rem 0 1rem;
|
padding: 0 0.8rem 0 1rem;
|
||||||
@@ -577,24 +594,57 @@ const styleOptions = ref<any[]>(
|
|||||||
background-color: rgba(13, 13, 13, 0.02);
|
background-color: rgba(13, 13, 13, 0.02);
|
||||||
// border-radius: 0.6rem;
|
// border-radius: 0.6rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.agent {
|
||||||
|
padding: 1.2rem;
|
||||||
|
box-shadow: none;
|
||||||
|
border-radius: 1.5rem;
|
||||||
|
border: 0.1rem solid #0000001a;
|
||||||
|
.scroll-content {
|
||||||
|
padding: 0;
|
||||||
|
flex: 1;
|
||||||
|
overflow: auto;
|
||||||
|
.editor {
|
||||||
|
font-family: 'Regular';
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 1.22rem;
|
||||||
|
min-height: initial;
|
||||||
|
max-height: initial;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.operate {
|
||||||
|
padding: 1.2rem 0 0;
|
||||||
|
margin: 0;
|
||||||
|
.right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.sender-icon {
|
||||||
|
width: 3.2rem;
|
||||||
|
height: 3.2rem;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.fida-style-select-popover {
|
.fida-style-select-popover {
|
||||||
width: 34.2rem !important;
|
width: 34.2rem !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
border-radius: 0.6rem !important;
|
border-radius: 0.6rem !important;
|
||||||
box-shadow: 0px 5px 20px 0px rgba(0, 0, 0, 0.15) !important;
|
box-shadow: 0px 5px 20px 0px rgba(0, 0, 0, 0.15) !important;
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-content {
|
.fida-style-popover-content {
|
||||||
padding: 2rem 2.4rem 2.4rem;
|
padding: 2rem 2.4rem 2.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-header {
|
.fida-style-popover-header {
|
||||||
font-family: 'GeneralMedium';
|
font-family: 'GeneralMedium';
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
@@ -602,15 +652,15 @@ const styleOptions = ref<any[]>(
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
// padding: 1.8rem 2rem 1.5rem;
|
// padding: 1.8rem 2rem 1.5rem;
|
||||||
// border-bottom: 0.1rem solid #f0f0f0;
|
// border-bottom: 0.1rem solid #f0f0f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-grid {
|
.fida-style-popover-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-item {
|
.fida-style-popover-item {
|
||||||
height: 9.1rem;
|
height: 9.1rem;
|
||||||
width: 9.1rem;
|
width: 9.1rem;
|
||||||
background-color: #a6a6a6;
|
background-color: #a6a6a6;
|
||||||
@@ -620,30 +670,30 @@ const styleOptions = ref<any[]>(
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-item:hover {
|
.fida-style-popover-item:hover {
|
||||||
background-color: #e8e8e8;
|
background-color: #e8e8e8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-item.is-selected {
|
.fida-style-popover-item.is-selected {
|
||||||
background-color: #e3f2fd;
|
background-color: #e3f2fd;
|
||||||
.fida-option-label {
|
.fida-option-label {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
// border-color: #2196f3;
|
// border-color: #2196f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-item .fida-option-label {
|
.fida-style-popover-item .fida-option-label {
|
||||||
font-family: 'GeneralMedium';
|
font-family: 'GeneralMedium';
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-footer {
|
.fida-style-popover-footer {
|
||||||
// border-top: 0.1rem solid #f0f0f0;
|
// border-top: 0.1rem solid #f0f0f0;
|
||||||
margin-top: 2.4rem;
|
margin-top: 2.4rem;
|
||||||
.fida-confirm-btn {
|
.fida-confirm-btn {
|
||||||
@@ -660,9 +710,9 @@ const styleOptions = ref<any[]>(
|
|||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-setting-popover {
|
.fida-setting-popover {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
border-radius: 0.6rem !important;
|
border-radius: 0.6rem !important;
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
@@ -672,29 +722,29 @@ const styleOptions = ref<any[]>(
|
|||||||
|
|
||||||
box-shadow: 0px 11px 20px 0px #0000001a;
|
box-shadow: 0px 11px 20px 0px #0000001a;
|
||||||
border-radius: 0.6rem;
|
border-radius: 0.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .fida-setting-popover-content {
|
// .fida-setting-popover-content {
|
||||||
// padding: 2rem 2.4rem 2.4rem;
|
// padding: 2rem 2.4rem 2.4rem;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
.fida-setting-popover-header {
|
.fida-setting-popover-header {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
color: #000;
|
color: #000;
|
||||||
margin-bottom: 2rem !important;
|
margin-bottom: 2rem !important;
|
||||||
}
|
}
|
||||||
.fida-setting-popover-content {
|
.fida-setting-popover-content {
|
||||||
padding: 1.6rem 1.4rem 2.2rem !important;
|
padding: 1.6rem 1.4rem 2.2rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-setting-slider-list {
|
.fida-setting-slider-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
row-gap: 1rem;
|
row-gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-setting-slider-item {
|
.fida-setting-slider-item {
|
||||||
.fida-slider-label {
|
.fida-slider-label {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
@@ -712,8 +762,8 @@ const styleOptions = ref<any[]>(
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.setting-popover-slider {
|
.setting-popover-slider {
|
||||||
--el-slider-height: 0.4rem;
|
--el-slider-height: 0.4rem;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
.el-slider__runway {
|
.el-slider__runway {
|
||||||
@@ -744,5 +794,5 @@ const styleOptions = ref<any[]>(
|
|||||||
.el-slider__stop {
|
.el-slider__stop {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
139
src/views/home/versionTree/components/dialog.vue
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
||||||
|
const props = defineProps({
|
||||||
|
textData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
} as any,
|
||||||
|
styleData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
} as any,
|
||||||
|
callBack: {
|
||||||
|
type: Function,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// const emit = defineEmits([
|
||||||
|
// ])
|
||||||
|
let data = reactive({
|
||||||
|
})
|
||||||
|
|
||||||
|
const dialogFormVisible = ref(false)
|
||||||
|
|
||||||
|
const confirm = async ()=>{
|
||||||
|
if(props.callBack)await props.callBack()
|
||||||
|
dialogFormVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
})
|
||||||
|
onUnmounted(()=>{
|
||||||
|
})
|
||||||
|
defineExpose({open:()=>dialogFormVisible.value = true})
|
||||||
|
const {} = toRefs(data);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="dialog">
|
||||||
|
<el-dialog
|
||||||
|
:align-center="true"
|
||||||
|
v-model="dialogFormVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:title="props.textData?.title"
|
||||||
|
:show-close="false"
|
||||||
|
:width="props.styleData?.width || '50%'">
|
||||||
|
<template #header="{ close, titleId, titleClass }">
|
||||||
|
<div class="my-header">
|
||||||
|
<div class="text">{{ props.textData?.title }}</div>
|
||||||
|
<div class="icon" @click="dialogFormVisible = false">
|
||||||
|
<SvgIcon
|
||||||
|
name="close"
|
||||||
|
size="8"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="boundary"></div>
|
||||||
|
<div class="dialog-content">
|
||||||
|
{{ props.textData?.text }}
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<div class="dialog-footer-cancel" @click="dialogFormVisible = false">
|
||||||
|
{{ props.textData?.cancelText || 'Cancel' }}
|
||||||
|
</div>
|
||||||
|
<div class="dialog-footer-confirm" type="primary" @click="confirm">
|
||||||
|
{{ props.textData?.submitText || 'Confirm' }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.dialog{
|
||||||
|
--el-dialog-padding-primary: 1.6rem 1.2rem;
|
||||||
|
--el-dialog-border-radius: .8rem;
|
||||||
|
:deep(.el-dialog){
|
||||||
|
.my-header{
|
||||||
|
display: flex;
|
||||||
|
padding: 0 .5rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
--el-dialog-padding-primary: 1.2rem
|
||||||
|
.text{
|
||||||
|
font-family: 'Semibold';
|
||||||
|
font-size: 1.4rem;
|
||||||
|
line-height: 2rem;
|
||||||
|
letter-spacing: -0.18px;
|
||||||
|
}
|
||||||
|
.icon{
|
||||||
|
cursor: pointer;
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.boundary{
|
||||||
|
border-bottom: .7px solid rgba(0, 0, 0, 0.1);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.dialog-content{
|
||||||
|
padding: 0 .5rem;
|
||||||
|
padding-top: 1.2rem;
|
||||||
|
font-family: 'Regular';
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
line-height: 2rem;
|
||||||
|
letter-spacing: -0.18px;
|
||||||
|
}
|
||||||
|
.dialog-footer{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
--el-dialog-padding-primary: 1.7rem;
|
||||||
|
> div{
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
line-height: 2rem;
|
||||||
|
letter-spacing: -0.18px;
|
||||||
|
width: 5.9rem;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 1.5rem;
|
||||||
|
padding: .3rem 0 .4rem;
|
||||||
|
}
|
||||||
|
.dialog-footer-cancel{
|
||||||
|
color: #000;
|
||||||
|
margin-right: .6rem;
|
||||||
|
border: 0.7px solid #0000001A;
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
.dialog-footer-confirm{
|
||||||
|
color: #fff;
|
||||||
|
background-color: #f74545;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
||||||
import VersionDetail from './versionDetail.vue'
|
import VersionDetail from './versionDetail.vue'
|
||||||
import ChatHistory from './chatHistory.vue'
|
import ChatDetail from './chatDetail.vue'
|
||||||
//const props = defineProps({
|
//const props = defineProps({
|
||||||
//})
|
//})
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
@@ -14,7 +14,7 @@ const detailData = ref({
|
|||||||
versionSketch:'Version 1 - Sketch',
|
versionSketch:'Version 1 - Sketch',
|
||||||
versionSketchTime:'2023-08-01 10:00:00',
|
versionSketchTime:'2023-08-01 10:00:00',
|
||||||
},
|
},
|
||||||
userChatHistory:{
|
userChatDetail:{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,10 +35,10 @@ defineExpose({})
|
|||||||
></VersionDetail>
|
></VersionDetail>
|
||||||
</div>
|
</div>
|
||||||
<div class="useInput">
|
<div class="useInput">
|
||||||
<ChatHistory type="user"></ChatHistory>
|
<ChatDetail type="user"></ChatDetail>
|
||||||
</div>
|
</div>
|
||||||
<div class="systemInput">
|
<div class="systemInput">
|
||||||
<ChatHistory type="robot"></ChatHistory>
|
<ChatDetail type="robot"></ChatDetail>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
import { ref, onMounted, onUnmounted, reactive, toRefs } from 'vue'
|
||||||
import Tree from './tree/index.vue'
|
import Tree from './tree/index.vue'
|
||||||
import Detail from './detail/index.vue'
|
import Detail from './detail/index.vue'
|
||||||
import { versionsList } from './tools/versionsData'
|
import { versionsList } from './tools/versionsData'
|
||||||
import { findAndAddChild, findAndRemoveChild } from './tools/tools'
|
import { findAndAddChild, findAndRemoveChild } from './tools/tools'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
versionTreeData:{
|
versionTreeData: {
|
||||||
type:Object,
|
type: Object,
|
||||||
default:()=>{
|
default: () => {
|
||||||
return {
|
return {
|
||||||
drawer:false,
|
drawer: false,
|
||||||
list:[],
|
list: []
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
//const emit = defineEmits([
|
//const emit = defineEmits([
|
||||||
//])
|
//])
|
||||||
@@ -65,14 +65,11 @@ const versionDelete = (versionDetail)=>{
|
|||||||
treeKey.value++
|
treeKey.value++
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = reactive({
|
let data = reactive({})
|
||||||
})
|
onMounted(() => {})
|
||||||
onMounted(()=>{
|
onUnmounted(() => {})
|
||||||
})
|
|
||||||
onUnmounted(()=>{
|
|
||||||
})
|
|
||||||
defineExpose({})
|
defineExpose({})
|
||||||
const {} = toRefs(data);
|
const {} = toRefs(data)
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="versionTree">
|
<div class="versionTree">
|
||||||
@@ -80,9 +77,10 @@ const {} = toRefs(data);
|
|||||||
v-model="versionTreeData.drawer"
|
v-model="versionTreeData.drawer"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:size="treeState?'109rem':'49rem'"
|
:size="treeState ? '109rem' : '49rem'"
|
||||||
body-class="versionTreeBody"
|
body-class="versionTreeBody"
|
||||||
:with-header="false">
|
:with-header="false"
|
||||||
|
>
|
||||||
<div class="versionTreeTitle">
|
<div class="versionTreeTitle">
|
||||||
<span>Version Tree: Retro Sofa Sketch</span>
|
<span>Version Tree: Retro Sofa Sketch</span>
|
||||||
<div class="closeBtn" @click="versionTreeData.drawer = false">
|
<div class="closeBtn" @click="versionTreeData.drawer = false">
|
||||||
@@ -132,11 +130,24 @@ const {} = toRefs(data);
|
|||||||
--treeItem-background: #ffffff;
|
--treeItem-background: #ffffff;
|
||||||
--treeItem-active-background: #e6e6e6;
|
--treeItem-active-background: #e6e6e6;
|
||||||
|
|
||||||
:deep(.versionTreeBody){
|
:deep(.versionTreeBody) {
|
||||||
--el-drawer-padding-primary: 0rem;
|
--el-drawer-padding-primary: 0rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
.versionTreeTitle {
|
||||||
|
width: 100%;
|
||||||
|
height: 8rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 0.8rem 0 2.4rem;
|
||||||
|
border-bottom: 1px solid #c9c9c9;
|
||||||
|
> span {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 600;
|
||||||
|
font-family: 'SemiBold';
|
||||||
|
}
|
||||||
.versionTreeTitle{
|
.versionTreeTitle{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 8rem;
|
height: 8rem;
|
||||||
@@ -213,4 +224,24 @@ const {} = toRefs(data);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.expandBtnBox {
|
||||||
|
}
|
||||||
|
.versionTreeBox {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
> .tree {
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 2.1rem 0 5.4rem 2.2rem;
|
||||||
|
}
|
||||||
|
> .detail {
|
||||||
|
width: 35rem;
|
||||||
|
margin: 2.1rem 3rem 5.4rem 3.4rem;
|
||||||
|
height: calc(100% - 2.1rem - 5.4rem);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -6,6 +6,7 @@ import SpecialEdge from './speciaiEdge.vue'
|
|||||||
import InputNode from './InputNode.vue'//主
|
import InputNode from './InputNode.vue'//主
|
||||||
import SecondaryNode from './secondaryNode.vue'//分支
|
import SecondaryNode from './secondaryNode.vue'//分支
|
||||||
import { useLayout } from '../../tools/tools'
|
import { useLayout } from '../../tools/tools'
|
||||||
|
import dialogVue from "../../components/dialog.vue";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectItem: {
|
selectItem: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -22,6 +23,9 @@ const emit = defineEmits([
|
|||||||
'versionDelete',
|
'versionDelete',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const dialogDeleteRef = ref()
|
||||||
|
const dialogRestoreRef = ref()
|
||||||
|
|
||||||
// 节点类型:input、output、default、custom
|
// 节点类型:input、output、default、custom
|
||||||
// input:开始点,output:结尾点,default:普通节点,custom:自定义节点
|
// input:开始点,output:结尾点,default:普通节点,custom:自定义节点
|
||||||
const position = { x: 0, y: 0 }
|
const position = { x: 0, y: 0 }
|
||||||
@@ -88,10 +92,11 @@ watch(()=>props.selectItem.id, (newVal, oldVal) => {
|
|||||||
|
|
||||||
const versionRestore = ()=>{
|
const versionRestore = ()=>{
|
||||||
emit('versionRestore')
|
emit('versionRestore')
|
||||||
|
dialogRestoreRef.value?.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
const versionDelete = ()=>{
|
const versionDelete = ()=>{
|
||||||
emit('versionDelete')
|
dialogDeleteRef.value?.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
@@ -135,6 +140,30 @@ defineExpose({push})
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<dialogVue
|
||||||
|
:textData="{
|
||||||
|
title: $t('VersionTree.deleteChat'),
|
||||||
|
text: $t('VersionTree.deleteHint'),
|
||||||
|
submitText: $t('VersionTree.delete'),
|
||||||
|
cancelText: $t('VersionTree.cancel'),
|
||||||
|
}"
|
||||||
|
:styleData="{
|
||||||
|
width: '40.6rem'
|
||||||
|
}"
|
||||||
|
:callBack="()=>emit('versionDelete')"
|
||||||
|
ref="dialogDeleteRef" />
|
||||||
|
<dialogVue
|
||||||
|
:textData="{
|
||||||
|
title: $t('VersionTree.restoreChat'),
|
||||||
|
text: $t('VersionTree.restoreHint'),
|
||||||
|
submitText: $t('VersionTree.confirm'),
|
||||||
|
cancelText: $t('VersionTree.cancel'),
|
||||||
|
}"
|
||||||
|
:styleData="{
|
||||||
|
width: '40.6rem'
|
||||||
|
}"
|
||||||
|
:callBack="()=>emit('versionRestore')"
|
||||||
|
ref="dialogRestoreRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|||||||