提交 f2f9a1e6 作者: Hao

add

父级 1710f157
...@@ -9,7 +9,6 @@ declare module 'vue' { ...@@ -9,7 +9,6 @@ declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AutomaticPrompt: typeof import('./src/components/AutomaticPrompt.vue')['default'] AutomaticPrompt: typeof import('./src/components/AutomaticPrompt.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside'] ElAside: typeof import('element-plus/es')['ElAside']
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElContainer: typeof import('element-plus/es')['ElContainer'] ElContainer: typeof import('element-plus/es')['ElContainer']
ElFooter: typeof import('element-plus/es')['ElFooter'] ElFooter: typeof import('element-plus/es')['ElFooter']
...@@ -20,8 +19,6 @@ declare module 'vue' { ...@@ -20,8 +19,6 @@ declare module 'vue' {
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMain: typeof import('element-plus/es')['ElMain'] ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
EmotionComponent: typeof import('./src/components/EmotionComponent.vue')['default'] EmotionComponent: typeof import('./src/components/EmotionComponent.vue')['default']
IndexComponent: typeof import('./src/components/IndexComponent.vue')['default'] IndexComponent: typeof import('./src/components/IndexComponent.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"@luohc92/vue3-image-viewer": "^1.0.0", "@luohc92/vue3-image-viewer": "^1.0.0",
"axios": "^1.6.7", "axios": "^1.6.7",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"cos-js-sdk-v5": "^1.7.0",
"cos-wx-sdk-v5": "^1.6.0", "cos-wx-sdk-v5": "^1.6.0",
"element-plus": "^2.6.1", "element-plus": "^2.6.1",
"emoji.json": "^15.1.0", "emoji.json": "^15.1.0",
......
// axios.js // axios.js
import axios from 'axios'; import axios from "axios";
const instance = axios.create({ const instance = axios.create({
baseURL: '/api', // 设置基础 URL baseURL: "/api", // 设置基础 URL
timeout: 1000, // 设置请求超时时间 timeout: 1000, // 设置请求超时时间
}); });
instance.interceptors.request.use( instance.interceptors.request.use(
(config:any) => { (config: any) => {
// 在发送请求之前做些什么,例如添加 token // 在发送请求之前做些什么,例如添加 token
const token = localStorage.getItem('token'); const token = localStorage.getItem("token");
if (token) { if (token) {
config.headers.Authorization = `Bearer ${token}`; config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
(error:any) => {
return Promise.reject(error);
} }
return config;
},
(error: any) => {
return Promise.reject(error);
}
); );
instance.interceptors.response.use( instance.interceptors.response.use(
(response:any) => { (response: any) => {
// 对响应数据做点什么 // 对响应数据做点什么
return response.data; return response.data;
}, },
(error:any) => { (error: any) => {
// 对响应错误做点什么 // 对响应错误做点什么
return Promise.reject(error); return Promise.reject(error);
} }
); );
export default instance; export default instance;
import http from "../index"; import http from "../index";
//登录
const Login = (query: any) => { const Login = (query: any) => {
return http({ return http({
url: `/login`, url: `/login`,
...@@ -6,4 +7,61 @@ const Login = (query: any) => { ...@@ -6,4 +7,61 @@ const Login = (query: any) => {
data: query, data: query,
}); });
}; };
export { Login }; //新增询价单
const InquiryAdd = (query: any) => {
return http({
url: `/inquiryAdd`,
method: "get",
data: query,
});
};
//快捷回复
const Kjiehuifu = (query: any) => {
return http({
url: "/Kjiehuifu",
method: "get",
data: query,
});
};
//获取用户列表
const getUserList = (query: any) => {
return http({
url: "/getUserList",
method: "get",
data: query,
});
};
//查看未读消息
const checkMesssages = (query: any) => {
return http({
url: "/checkMesssages",
method: "get",
data: query,
});
};
//上传接口
const getUploadConfigInfo = (query: any) => {
return http({
url: "/getUploadConfigInfo",
method: "get",
data: query,
});
};
//系统上传
const upload = (query: any) => {
return http({
url: "/sys/common/upload",
method: "get",
data: query,
});
};
export {
Login,
InquiryAdd,
Kjiehuifu,
getUserList,
checkMesssages,
upload,
getUploadConfigInfo,
};
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
v-model="state" v-model="state"
ref="automaticPromptRef" ref="automaticPromptRef"
class="el-autocomplete" class="el-autocomplete"
placeholder="请输入问题" placeholder="输入信息"
type="textarea" type="textarea"
resize="none" resize="none"
@change="handleSelect" @change="handleSelect"
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
import Emotion from './IndexComponent.vue' import Emotion from './IndexComponent.vue'
import { ElLoading } from 'element-plus' import { ElLoading } from 'element-plus'
import { ref, watch, defineEmits, defineExpose } from 'vue' import { ref, watch, defineEmits, defineExpose } from 'vue'
import { upLoadFilesHander } from '../minxins/UploadMixin'
import axios from 'axios' import axios from 'axios'
const state = ref('') const state = ref('')
const file = ref(null) const file = ref(null)
...@@ -78,6 +79,7 @@ interface LinkItem { ...@@ -78,6 +79,7 @@ interface LinkItem {
value: string value: string
link: string link: string
} }
// uploadMixin()
const showEmotion = ref<boolean>(false) const showEmotion = ref<boolean>(false)
const automaticPromptRef = ref(null) const automaticPromptRef = ref(null)
const links = ref<LinkItem[]>([]) const links = ref<LinkItem[]>([])
...@@ -92,7 +94,10 @@ const upfile = () => { ...@@ -92,7 +94,10 @@ const upfile = () => {
const fileChange = () => { const fileChange = () => {
var e = window.event || event var e = window.event || event
var oFile = e.target.files[0] var oFile = e.target.files[0]
console.log(oFile) upLoadFilesHander(oFile).then((ress) => {
const { success, result } = ress
console.log(result)
})
const loading = ElLoading.service({ const loading = ElLoading.service({
lock: true, lock: true,
text: '上传中...', text: '上传中...',
...@@ -164,7 +169,7 @@ defineExpose({ ...@@ -164,7 +169,7 @@ defineExpose({
.el-input { .el-input {
width: 100%; width: 100%;
} }
:deep(.el-textarea__inner ){ :deep(.el-textarea__inner) {
width: 100%; width: 100%;
align-items: start; align-items: start;
box-shadow: none; box-shadow: none;
......
const COS = require('cos-wx-sdk-v5'); const COS = require('cos-wx-sdk-v5');
import { ElMessage } from 'element-plus'
const uploadMixin = { const uploadMixin = {
data() { data() {
return { return {
...@@ -22,11 +23,11 @@ const uploadMixin = { ...@@ -22,11 +23,11 @@ const uploadMixin = {
uploadObj[i] = message; uploadObj[i] = message;
if (!success) { if (!success) {
uploadObj[i] = ''; uploadObj[i] = '';
wx.showToast({
title: `[${i+1}]上传失败,请重新上传!`, ElMessage({
icon: 'none', message: `[${i+1}]上传失败,请重新上传!`,
duration: 2000 type: 'none',
}); })
} }
if (uploadNum == 0) { if (uploadNum == 0) {
const arr = Array.from(uploadObj); const arr = Array.from(uploadObj);
......
...@@ -6,7 +6,7 @@ Mock.mock("/api/login", "get", () => { ...@@ -6,7 +6,7 @@ Mock.mock("/api/login", "get", () => {
message: '', message: '',
result: { result: {
userName: "admin", userName: "admin",
token:'admin' token: 'admin'
}, },
}; };
}); });
...@@ -15,10 +15,99 @@ Mock.mock("/api/inquiryAdd", "get", () => { ...@@ -15,10 +15,99 @@ Mock.mock("/api/inquiryAdd", "get", () => {
return { return {
code: "200", code: "200",
success: true, success: true,
message: '', message: '操作成功!',
result: { result: {
userName: "admin", userName: "admin",
token:'admin' token: 'admin'
}, },
}; };
}); });
//快捷回复
Mock.mock("/api/kjiehuifu", 'get', () => {
return {
code: '200',
success: true,
message: '',
result: [
{
message: '感谢您的咨询,我们会尽快回复您',
}, {
message: '感谢您的耐心等待,您的问题已经收到,将尽快给您答复。'
}, {
messag: '谢谢你的来信,我会尽快回复。'
}, {
messag: '谢谢你的信息,我会尽快做出回复。'
}
]
}
})
//列表
Mock.mock("/api/getUserList", 'get', () => {
return {
code: '200',
success: true,
message: '',
result: [{
userId: '11fb824c0deb4e8b947275e1e7c4f7a2',
userName: '1710323861524',
userImg: 'https://cdn.lirimall.com//lirigo/filetempImage/新鲜水果_1661668973048.png',
messages: []
}, {
userId: '4f99b6dc32d84a288d88e7d9635521a3',
userName: '1710317951930',
userImg: 'https://cdn.lirimall.com//lirigo/filetempImage/新鲜水果_1661668973048.png',
messages: []
}]
}
})
//查看未读消息
Mock.mock("/api/checkMesssages", 'get', () => {
return {
code: '200',
success: true,
message: '',
result: []
}
})
Mock.mock("/api/getUploadConfigInfo", 'get', () => {
return {
code: '200',
success: true,
message: '',
result: {
bucketName: "",
regionid: "",
upLoadPath: "",
uploadType: "",
staticDomain: "",
startTime: "",
expiredTime: "",
credentials: {
tmpSecretId: "",
tmpSecretKey: "",
sessionToken: "",
},
}
}
})
Mock.mock("/api/upload", 'get', () => {
return {
code: '200',
success: true,
message: '',
result: {
bucketName: "",
regionid: "",
upLoadPath: "",
uploadType: "",
staticDomain: "",
startTime: "",
expiredTime: "",
credentials: {
tmpSecretId: "",
tmpSecretKey: "",
sessionToken: "",
},
},
}
})
\ No newline at end of file
...@@ -4,3 +4,4 @@ declare module '*.vue' { ...@@ -4,3 +4,4 @@ declare module '*.vue' {
const component: DefineComponent<{}, {}, any> const component: DefineComponent<{}, {}, any>
export default component export default component
} }
declare module 'cos-wx-sdk-v5';
\ No newline at end of file
...@@ -23,6 +23,10 @@ export const useUserStore = defineStore("user", { ...@@ -23,6 +23,10 @@ export const useUserStore = defineStore("user", {
setUserInfo(res: any) { setUserInfo(res: any) {
this.userInfo = res; this.userInfo = res;
}, },
setUserList(res: any) {
console.log(res,'数据呢')
this.userList = res;
},
setUserListMessages(res: any) { setUserListMessages(res: any) {
const userList: any = this.userList || []; const userList: any = this.userList || [];
const obj = { const obj = {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"src/**/*.vue", "src/**/*.vue",
"tests/**/*.ts", "tests/**/*.ts",
"tests/**/*.tsx" "tests/**/*.tsx"
, "src/minxins/minxin.js" ], ],
"exclude": [ "exclude": [
"node_modules" "node_modules"
] ]
......
...@@ -2795,6 +2795,13 @@ core-util-is@~1.0.0: ...@@ -2795,6 +2795,13 @@ core-util-is@~1.0.0:
resolved "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz" resolved "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz"
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
cos-js-sdk-v5@^1.7.0:
version "1.7.0"
resolved "https://registry.npmmirror.com/cos-js-sdk-v5/-/cos-js-sdk-v5-1.7.0.tgz#88166b2bfb8c01120011f25f5ee7d5c196941671"
integrity sha512-/xiR86tOcJ448nXPkJq0lhsP/Kg4LmvcRO+C5LwrAvmTMTZE75ESjMHi7qbQVAxNPBroOvVyYR0YOin9UN8yHQ==
dependencies:
"@xmldom/xmldom" "^0.8.6"
cos-wx-sdk-v5@^1.6.0: cos-wx-sdk-v5@^1.6.0:
version "1.6.0" version "1.6.0"
resolved "https://registry.npmmirror.com/cos-wx-sdk-v5/-/cos-wx-sdk-v5-1.6.0.tgz#dfdf1724863177e39c2ca9e20ae5507a71570bb3" resolved "https://registry.npmmirror.com/cos-wx-sdk-v5/-/cos-wx-sdk-v5-1.6.0.tgz#dfdf1724863177e39c2ca9e20ae5507a71570bb3"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论