Commit 168490ae by yuzhenWang

Merge branch 'test' into 'feature-20260313wyz-修改产品'

Test

See merge request !13
parents 06f2713e 15b5f869
...@@ -21,17 +21,23 @@ ...@@ -21,17 +21,23 @@
"@element-plus/icons-vue": "2.3.1", "@element-plus/icons-vue": "2.3.1",
"@vueup/vue-quill": "1.2.0", "@vueup/vue-quill": "1.2.0",
"@vueuse/core": "13.3.0", "@vueuse/core": "13.3.0",
"ali-oss": "^6.23.0",
"axios": "1.9.0", "axios": "1.9.0",
"clipboard": "2.0.11", "clipboard": "2.0.11",
"dompurify": "^3.3.3",
"echarts": "5.6.0", "echarts": "5.6.0",
"element-plus": "2.9.9", "element-plus": "2.9.9",
"file-saver": "2.0.5", "file-saver": "^2.0.5",
"fuse.js": "6.6.2", "fuse.js": "6.6.2",
"highlight.js": "^11.11.1",
"js-beautify": "1.14.11", "js-beautify": "1.14.11",
"js-cookie": "3.0.5", "js-cookie": "3.0.5",
"jsencrypt": "3.3.2", "jsencrypt": "3.3.2",
"jszip": "^3.10.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"marked": "^4.3.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"p-limit": "^7.3.0",
"pinia": "3.0.2", "pinia": "3.0.2",
"splitpanes": "^4.0.4", "splitpanes": "^4.0.4",
"vue": "3.5.16", "vue": "3.5.16",
......
// src/api/ai/ai.js
import request from '@/utils/request'
import { getToken } from '@/utils/auth'
import useUserStore from '@/store/modules/user'
// 加载随机词条列表
export function randList(data) {
return request({
url: '/ai/api/entry/rand/list',
method: 'post',
data: data
})
}
/**
* 查询输出流信息(流式响应)
* 增强错误处理:当HTTP状态非2xx时,解析错误响应体并抛出包含code属性的错误
*/
export function getStream(question, timeout = 300000) {
const userStore = useUserStore()
const token = getToken()
const tenantId = userStore.currentTenant?.apiLoginTenantInfoResponse?.tenantBizId
const headers = {
'Accept': 'text/event-stream',
'Authorization': `Bearer ${token}`
}
if (tenantId) {
headers['X-Tenant-ID'] = tenantId
}
const baseUrl = import.meta.env.VITE_APP_BASE_API
const url = `${baseUrl}/ai/api/api/ai/stream?question=${encodeURIComponent(question)}`
const controller = new AbortController()
const timeoutId = setTimeout(() => controller.abort(), timeout)
return fetch(url, {
method: 'GET',
headers,
signal: controller.signal
}).then(async (response) => {
clearTimeout(timeoutId)
if (!response.ok) {
// 尝试解析错误响应体
let errorCode = null
let errorMessage = response.statusText
try {
const errorBody = await response.json()
if (errorBody && errorBody.code !== undefined) {
errorCode = errorBody.code
errorMessage = errorBody.msg || errorBody.message || errorMessage
}
} catch (e) {
// 无法解析JSON,使用默认错误信息
}
const error = new Error(errorMessage)
error.code = errorCode
error.status = response.status
throw error
}
return response
}).finally(() => {
clearTimeout(timeoutId)
})
}
/**
* 获取服务卡片列表(产品列表)
*/
export async function getServiceCardList() {
const userStore = useUserStore()
const token = getToken()
const userId = userStore.userInfo?.userId || userStore.userId || '30'
let cleanToken = token
if (token && token.startsWith('Bearer ')) {
cleanToken = token.slice(7)
}
const headers = {
'Content-Type': 'application/json',
'x-authorization': `sfpfamilyfinancialplanning ${cleanToken}`
}
const url = 'https://hoservice.ydhomeoffice.cn/hoserviceApi/ydServiceCard/serviceCardList'
const body = {
userId: String(userId),
cardType: '11'
}
try {
const response = await fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(body)
})
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`)
}
const data = await response.json()
return data
} catch (error) {
console.error('获取服务卡片列表失败:', error)
throw error
}
}
\ No newline at end of file
...@@ -37,6 +37,22 @@ export const constantRoutes = [ ...@@ -37,6 +37,22 @@ export const constantRoutes = [
} }
] ]
}, },
// {
// path: '/system',
// component: Layout,
// children: [
// {
// path: 'ai',
// name: 'Ai',
// component: Ai,
// meta: {
// title: '银盾AI',
// icon: 'message' // 【关键修改】补充图标名,避免 undefined
// // 如果项目里有其他 svg 图标,换成对应的文件名(不含.svg)
// }
// }
// ]
// },
{ {
path: '/login', path: '/login',
component: () => import('@/views/login'), component: () => import('@/views/login'),
......
...@@ -83,8 +83,8 @@ const router = useRouter() ...@@ -83,8 +83,8 @@ const router = useRouter()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loginForm = ref({ const loginForm = ref({
username: 'admin', username: '',
password: '12345', password: '',
rememberMe: false, rememberMe: false,
code: '', code: '',
uuid: '' uuid: ''
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-table <el-table
height="70%"
:data="tableData" :data="tableData"
:span-method="objectSpanMethod" :span-method="objectSpanMethod"
border border
...@@ -52,7 +53,7 @@ ...@@ -52,7 +53,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="settingLoading" :data="settingList" border ref="settingTableRef"> <el-table v-loading="settingLoading" :data="settingList" border ref="settingTableRef" height="75%">
<el-table-column <el-table-column
label="序号 " label="序号 "
width="55" width="55"
......
...@@ -16,7 +16,13 @@ ...@@ -16,7 +16,13 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<div class="commonHeader">产品标题</div> <div class="commonHeader">产品标题</div>
<el-select <el-input
v-model="form['apiProductLaunchDto'].title"
placeholder="请输入"
maxlength="20"
show-word-limit
/>
<!-- <el-select
v-model="form['apiProductLaunchDto'].title" v-model="form['apiProductLaunchDto'].title"
filterable filterable
remote remote
...@@ -35,7 +41,7 @@ ...@@ -35,7 +41,7 @@
:label="item.productName" :label="item.productName"
:value="item.productBizId" :value="item.productBizId"
/> />
</el-select> </el-select> -->
</el-col> </el-col>
<el-col :span="24" :class="showNameTip ? '' : 'colBottomGap'"> <el-col :span="24" :class="showNameTip ? '' : 'colBottomGap'">
<div class="nameTip"> <div class="nameTip">
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px" <el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px" height="70%"
row-key="rowKey"> row-key="rowKey">
<!-- 动态生成所有列 --> <!-- 动态生成所有列 -->
<template v-for="column in tableColumns" :key="column.prop"> <template v-for="column in tableColumns" :key="column.prop">
......
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
label="短标题" label="短标题"
prop="shortTitle" prop="shortTitle"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
width="150" width="200"
/> />
<el-table-column label="状态" prop="status" align="left"> <el-table-column label="状态" prop="status" align="left" width="100">
<template #default="scope"> <template #default="scope">
<dict-tag :options="product_launch_status" :value="scope.row.status" /> <dict-tag :options="product_launch_status" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="createTime" align="left"> <el-table-column label="创建时间" prop="createTime" align="left" sortable >
<template #default="scope"> <template #default="scope">
{{ formatIsoToDateTime(scope.row.createTime) }} {{ formatIsoToDateTime(scope.row.createTime) }}
</template> </template>
......
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