Compare commits
2 Commits
fb7e6d8fe8
...
4f3d6b514d
| Author | SHA1 | Date |
|---|---|---|
|
|
4f3d6b514d | |
|
|
b80d9f96c2 |
|
|
@ -22,19 +22,19 @@
|
||||||
<i class="el-icon-lx-skin"></i>
|
<i class="el-icon-lx-skin"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-icon" @click="router.push('/ucenter')">
|
<!-- <div class="btn-icon" @click="router.push('/ucenter')">
|
||||||
<el-tooltip effect="dark" :content="message ? `有${message}条未读消息` : `消息中心`" placement="bottom">
|
<el-tooltip effect="dark" :content="message ? `有${message}条未读消息` : `消息中心`" placement="bottom">
|
||||||
<i class="el-icon-lx-notice"></i>
|
<i class="el-icon-lx-notice"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<span class="btn-bell-badge" v-if="message"></span>
|
<span class="btn-bell-badge" v-if="message"></span>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="btn-icon" @click="setFullScreen">
|
<div class="btn-icon" @click="setFullScreen">
|
||||||
<el-tooltip effect="dark" content="全屏" placement="bottom">
|
<el-tooltip effect="dark" content="全屏" placement="bottom">
|
||||||
<i class="el-icon-lx-full"></i>
|
<i class="el-icon-lx-full"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<!-- 用户头像 -->
|
<!-- 用户头像 -->
|
||||||
<el-avatar class="user-avator" :size="30" :src="imgurl" />
|
<el-avatar class="user-avator" :size="30" :src="imgurl2" />
|
||||||
<!-- 用户名下拉菜单 -->
|
<!-- 用户名下拉菜单 -->
|
||||||
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
|
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
|
|
@ -64,6 +64,7 @@ const username: string | null = localStorage.getItem('ms_username');
|
||||||
const message: number = 2;
|
const message: number = 2;
|
||||||
const imgurl2: string = localStorage.getItem('ms_imgurl') || imgurl;
|
const imgurl2: string = localStorage.getItem('ms_imgurl') || imgurl;
|
||||||
|
|
||||||
|
|
||||||
const sidebar = useSidebarStore();
|
const sidebar = useSidebarStore();
|
||||||
// 侧边栏折叠
|
// 侧边栏折叠
|
||||||
const collapseChage = () => {
|
const collapseChage = () => {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<el-input-number v-else-if="item.type === 'number'" v-model="form[item.prop]"
|
<el-input-number v-else-if="item.type === 'number'" v-model="form[item.prop]"
|
||||||
:disabled="item.disabled" controls-position="right"></el-input-number>
|
:disabled="item.disabled" controls-position="right"></el-input-number>
|
||||||
<el-select v-else-if="item.type === 'select'" v-model="form[item.prop]" :disabled="item.disabled"
|
<el-select v-else-if="item.type === 'select'" v-model="form[item.prop]" :disabled="item.disabled"
|
||||||
:placeholder="item.placeholder" clearable >
|
:placeholder="item.placeholder" clearable :multiple="item.multiple?true:false">
|
||||||
<el-option v-for="opt in item.opts" :label="opt.label" :value="opt.value"></el-option>
|
<el-option v-for="opt in item.opts" :label="opt.label" :value="opt.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-date-picker v-else-if="item.type === 'date'" type="date" v-model="form[item.prop]"
|
<el-date-picker v-else-if="item.type === 'date'" type="date" v-model="form[item.prop]"
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { FormOption } from '@/types/form-option';
|
import { FormOption } from '@/types/form-option';
|
||||||
|
import { json } from 'd3';
|
||||||
import { FormInstance, FormRules, UploadProps } from 'element-plus';
|
import { FormInstance, FormRules, UploadProps } from 'element-plus';
|
||||||
import { PropType, ref } from 'vue';
|
import { PropType, ref } from 'vue';
|
||||||
|
|
||||||
|
|
@ -62,7 +63,30 @@ const { options, formData, edit, update } = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const form = ref({ ...(edit ? formData : {}) });
|
//const form = ref({ ...(edit ? formData : {}) });
|
||||||
|
const form = ref();
|
||||||
|
|
||||||
|
const doFormData = () => {
|
||||||
|
let a={}
|
||||||
|
let initialForm = { ...(edit ? formData : {}) };
|
||||||
|
|
||||||
|
options.list.forEach(item => {
|
||||||
|
if (item.type === 'select' && item.multiple) {
|
||||||
|
let ids = formData[item.prop];
|
||||||
|
let id_list = JSON.parse(ids);
|
||||||
|
console.log(id_list);
|
||||||
|
let selectedValues = [];
|
||||||
|
for (let i = 0; i < id_list.length; i++) {
|
||||||
|
selectedValues.push(id_list[i]["id"]);
|
||||||
|
}
|
||||||
|
if (!Array.isArray(initialForm[item.prop])) {
|
||||||
|
initialForm[item.prop] = selectedValues;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return initialForm;
|
||||||
|
};
|
||||||
|
form.value=doFormData();
|
||||||
|
|
||||||
const rules: FormRules = options.list.map(item => {
|
const rules: FormRules = options.list.map(item => {
|
||||||
if (item.required) {
|
if (item.required) {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
title: '功能管理',
|
title: '功能管理',
|
||||||
permiss: '54',
|
permiss: '54',
|
||||||
},
|
},
|
||||||
component: () => import(/* webpackChunkName: "system-user" */ '../views/system/function.vue'),
|
component: () => import(/* webpackChunkName: "system-user" */ '../views/system/manage-function.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/manage-file',
|
path: '/manage-file',
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ export const usePermissStore = defineStore("permiss", {
|
||||||
"56", //文件管理
|
"56", //文件管理
|
||||||
"71", //用户功能管理
|
"71", //用户功能管理
|
||||||
],
|
],
|
||||||
user: ["0", "71", "8", "7", "9", "61", "53", "51", "56"],
|
user: ["0", "8", "7", "9", "51" ,"53","55" ,"56","61", "71"],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@ export interface File {
|
||||||
file_store_name: string;
|
file_store_name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fileUrl ="https://pm.ljsea.top/file/";
|
export const fileUrl ="https://pm.ljsea.top/tool/file/";
|
||||||
|
|
@ -6,6 +6,7 @@ export interface Function{
|
||||||
Name: string;
|
Name: string;
|
||||||
Info: string;
|
Info: string;
|
||||||
UserID: number;
|
UserID: number;
|
||||||
ModelID: number;
|
ModelID: number | Object | Array<any>;
|
||||||
|
ModelIDs: string;
|
||||||
Function: string;
|
Function: string;
|
||||||
}
|
}
|
||||||
|
|
@ -9,6 +9,7 @@ export interface Model{
|
||||||
Type: string;
|
Type: string;
|
||||||
Parameter: string;
|
Parameter: string;
|
||||||
Description: string;
|
Description: string;
|
||||||
|
token: number; //消耗大模型的token
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModelParameter{
|
export interface ModelParameter{
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,5 @@ export interface Session {
|
||||||
Countext: any;
|
Countext: any;
|
||||||
Name: string;
|
Name: string;
|
||||||
UserID: number;
|
UserID: number;
|
||||||
|
TokenUsage: number; //消耗大模型的token
|
||||||
}
|
}
|
||||||
|
|
@ -280,6 +280,18 @@ const saveAvatar =async () => {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
//文件
|
//文件
|
||||||
let file= dataURLtoFile(imgSrc.value, 'avatar.jpg');
|
let file= dataURLtoFile(imgSrc.value, 'avatar.jpg');
|
||||||
|
//文件类型限制
|
||||||
|
const allowedTypes = ['image/jpeg', 'image/png', 'image/jpg'];
|
||||||
|
if (!allowedTypes.includes(file.type)) {
|
||||||
|
ElMessage.error('文件类型不符合要求,请选择jpg或png格式的图片');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//文件大小限制
|
||||||
|
const maxSize = 2 * 1024 * 1024; // 5MB
|
||||||
|
if (file.size > maxSize) {
|
||||||
|
ElMessage.error('文件大小超过限制最大2MB');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
//console.log("add file: " + this.file);
|
//console.log("add file: " + this.file);
|
||||||
|
|
@ -297,7 +309,7 @@ const saveAvatar =async () => {
|
||||||
let resp_data = result.data;
|
let resp_data = result.data;
|
||||||
|
|
||||||
//console.log("resp:",resp_data);
|
//console.log("resp:",resp_data);
|
||||||
let url = "https://tx.ljsea.top/tool/file/"+resp_data.FileStoreName;
|
let url = "https://pm.ljsea.top/tool/file/"+resp_data.FileStoreName;
|
||||||
|
|
||||||
userInfo.value.Avatar = url;
|
userInfo.value.Avatar = url;
|
||||||
avatarImg.value = url;
|
avatarImg.value = url;
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ let options_edit = ref<FormOption>({
|
||||||
span: 12,
|
span: 12,
|
||||||
list: [
|
list: [
|
||||||
{ type: 'input', label: '名称', prop: 'Name', required: true },
|
{ type: 'input', label: '名称', prop: 'Name', required: true },
|
||||||
{ type: 'select', label: '模型', prop: 'ModelID', required: true, opts:model_select_opts.value, multiple: true},
|
{ type: 'select', label: '模型', prop: 'ModelIDS', required: true, opts:model_select_opts.value, multiple: true},
|
||||||
{ type: 'input', label: '功能', prop: 'Function', required: true },
|
{ type: 'input', label: '功能', prop: 'Function', required: true },
|
||||||
{ type: 'input', label: '描述', prop: 'Info', required: true },
|
{ type: 'input', label: '描述', prop: 'Info', required: true },
|
||||||
]
|
]
|
||||||
|
|
@ -138,19 +138,26 @@ const rowData = ref({});
|
||||||
const handleEdit = async (row: Function) => {
|
const handleEdit = async (row: Function) => {
|
||||||
let data = row;
|
let data = row;
|
||||||
rowData.value = data;
|
rowData.value = data;
|
||||||
console.log("edit_row_data:", rowData.value);
|
//console.log("edit_row_data:", rowData.value);
|
||||||
isEdit.value = true;
|
isEdit.value = true;
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
};
|
};
|
||||||
const updateData = async (data) => {
|
const updateData = async (data) => {
|
||||||
|
let model_id =[]
|
||||||
|
let model_id_list= data["ModelID"]
|
||||||
|
for (let i = 0; i < model_id_list.length; i++) {
|
||||||
|
model_id.push({"id":model_id_list[i]})
|
||||||
|
}
|
||||||
|
let model_ids = JSON.stringify(model_id)
|
||||||
let result ={}
|
let result ={}
|
||||||
try{
|
try{
|
||||||
let req={
|
let req={
|
||||||
token:localStorage.getItem("token"),
|
token:localStorage.getItem("token"),
|
||||||
id: data.ID,
|
id: data.ID,
|
||||||
name: data.Name,
|
name: data.Name,
|
||||||
model_id: data.ModelID,
|
model_id: model_id_list[0],
|
||||||
function: data.Function,
|
function: data.Function,
|
||||||
|
model_ids: model_ids,
|
||||||
info: data.Info
|
info: data.Info
|
||||||
};
|
};
|
||||||
result = await UpdateFunctionService(req)
|
result = await UpdateFunctionService(req)
|
||||||
|
|
@ -78,6 +78,7 @@ let columns = ref([
|
||||||
{prop: 'Description', label: '描述'},
|
{prop: 'Description', label: '描述'},
|
||||||
{ prop: 'Parameter', label: '参数', width: 250 },
|
{ prop: 'Parameter', label: '参数', width: 250 },
|
||||||
{prop: 'Url', label: 'URl'},
|
{prop: 'Url', label: 'URl'},
|
||||||
|
{ prop: 'token', label: '消耗token数',width:50},
|
||||||
{ prop: 'CreatedAt', label: '创建时间',type: 'date' },
|
{ prop: 'CreatedAt', label: '创建时间',type: 'date' },
|
||||||
{ prop: 'operator', label: '操作', width: 250 , operate: { view: true, edit: true, delete: true,push: {link: false,label:"继续该会话"},gen: {show: false,label:"下载文件"} }},
|
{ prop: 'operator', label: '操作', width: 250 , operate: { view: true, edit: true, delete: true,push: {link: false,label:"继续该会话"},gen: {show: false,label:"下载文件"} }},
|
||||||
])
|
])
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ let columns = ref([
|
||||||
{ prop: 'ID', label: '会话ID', width: 50 },
|
{ prop: 'ID', label: '会话ID', width: 50 },
|
||||||
{ prop: 'Name', label: '会话名' ,width: 300},
|
{ prop: 'Name', label: '会话名' ,width: 300},
|
||||||
{ prop: 'MsgCount', label: '消息数',width:50},
|
{ prop: 'MsgCount', label: '消息数',width:50},
|
||||||
|
{ prop: 'TokenUsage', label: '消耗token数',width:50},
|
||||||
{ prop: "Context", label: "会话背景参数" ,width: 100},
|
{ prop: "Context", label: "会话背景参数" ,width: 100},
|
||||||
{ prop: 'CreatedAt', label: '创建时间',type: 'date',width: 150 },
|
{ prop: 'CreatedAt', label: '创建时间',type: 'date',width: 150 },
|
||||||
{ prop: 'UpdatedAt', label: '更新时间',type: 'date',width: 150 },
|
{ prop: 'UpdatedAt', label: '更新时间',type: 'date',width: 150 },
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,46 @@
|
||||||
<div>
|
<div>
|
||||||
<h2>智能选题推荐</h2>
|
<h2>智能选题推荐</h2>
|
||||||
</div>
|
</div>
|
||||||
|
<el-select v-model="selected" placeholder="请选择" multiple>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
interface Option {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
interface OptionList {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const selected = ref();
|
||||||
|
const options = ref<Option[]>([
|
||||||
|
{ value: 'option1', label: '选项1' },
|
||||||
|
{ value: 'option2', label: '选项2' },
|
||||||
|
{ value: 'option3', label: '选项3' },
|
||||||
|
{ value: 'option4', label: '选项4' },
|
||||||
|
]);
|
||||||
|
const handleSearch = async () => {
|
||||||
|
// 这里可以添加查询逻辑
|
||||||
|
console.log('Selected:', selected.value);
|
||||||
|
// 发送请求到后端,获取推荐结果
|
||||||
|
// let req={
|
||||||
|
// token: localStorage.getItem('token'),
|
||||||
|
// type: "ID",
|
||||||
|
// id: parseInt(query.name)
|
||||||
|
// }
|
||||||
|
// let result = await FindModelService(req);
|
||||||
|
// tableData.value = result.data;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue