提交 3ed4e7f7 作者: Hao

聊天修改

父级 9ce4221f
NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.135
\ No newline at end of file
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
NODE_ENV=production
VITE_USER_APP_API_URL=192.168.31.101
\ No newline at end of file
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
......@@ -16,5 +16,25 @@
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script>
window.onresize = () => {
let targetWidth = 1600;
// 2.拿到当前设备(浏览器)的宽度
// document.documentElement 获取html的宽度
let currentWidth =
document.documentElement.clientWidth || document.body.clientWidth;
console.log(currentWidth)
// 3.计算缩放比率(屏幕过宽,根据高度计算缩放比例)
let scaleRatio = currentWidth / targetWidth;
let fontSize = (currentWidth / targetWidth) * 100;
// 4.开始缩放网页
console.log(scaleRatio,fontSize, 'scaleRatio')
// 4.开始缩放网页
console.log(scaleRatio,'scaleRatio')
document.body.style = `zoom:${scaleRatio}`;
console.log(document.body, ' document.body')
}
</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1714962974283" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2311" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M270.387 27.273l484.233 485.222-485.222 484.233z" fill="#1C2021" p-id="2312"></path></svg>
\ No newline at end of file
......@@ -55,7 +55,7 @@
style="display: none;"
accept="image/bmp,image/jpeg,image/jpg,image/png"
type="file"
@change="fileChange"
@change="fileImgChange"
/>
</div>
</template>
......@@ -80,12 +80,18 @@ const upfile = () => {
file.value.click()
}
//上传的数据
const fileChange = () => {
const fileImgChange = async () => {
var e: any = window.event || event
var oFile = e.target.files[0]
console.log(oFile.type)
if (oFile.type == 'image/png') {
await setfileEvent(e.target)
} else {
upLoadFilesHander(oFile).then((ress) => {
const { success, result }: any = ress
const { success, result }: any = ress;
console.log(result,)
})
}
const loading: any = ElLoading?.service({
lock: true,
text: '上传中...',
......@@ -93,10 +99,27 @@ const fileChange = () => {
})
loading.close()
}
const setfileEvent = async (clipboardData: any) => {
const img = getPasteImageFile(clipboardData.files)
if (!img) {
return
}
const uploadRes = await fileToBase64(img)
if (!uploadRes) {
return
}
const oImage = await getImageObject(
uploadRes,
imgShowWidth.value,
imgShowHeight.value,
)
console.log(oImage, 'oImage')
elAutocomplete.value.innerHTML += oImage.outerHTML
inputVal.value = oImage.outerHTML
elAutocomplete.value.focus()
}
const handleSelect = (value: any) => {
inputVal.value = value.target.innerHTML
console.log(inputVal.value,'打印一下')
}
const emit = defineEmits(['updateState'])
......@@ -149,6 +172,7 @@ const handlePasteImageFile = async (clipboardData: any) => {
)
cursorInsert(oImage)
inputVal.value = elAutocomplete.value.innerHTML
// elAutocomplete.value.innerHTML = inputVal.value;
}
// 获取一个 image object
......
......@@ -99,7 +99,6 @@ export const upLoadHander = async (obj: any) => {
uploadMixin.uploadMixinType = result.uploadType;
staticDomain = result.staticDomain || "https://cdn.tikcos.cn";
if (uploadMixin.uploadMixinType === "txcos") {
console.log(result.response, " result.response");
const ress = res.result.response;
const credentials = ress.credentials;
uploadMixin.uploadMixinCredentials = {
......@@ -109,11 +108,6 @@ export const upLoadHander = async (obj: any) => {
StartTime: ress?.startTime,
ExpiredTime: ress?.expiredTime,
};
console.log(result, "result");
console.log(
uploadMixin.uploadMixinCredentials,
" uploadMixin.uploadMixinCredentials"
);
}
} else {
resResult = false;
......@@ -123,10 +117,7 @@ export const upLoadHander = async (obj: any) => {
if (resResult) {
const query = {};
// const res: any = await getUploadConfigInfo(query);
console.log(
uploadMixin.uploadMixinCredentials,
" console.log(uploadMixin.uploadMixinCredentials)"
);
const result: any = uploadMixin.upLoadMixinResult;
if (uploadMixin.uploadMixinType === "txcos") {
//走对象存储
......@@ -147,17 +138,10 @@ export const upLoadHander = async (obj: any) => {
Key: uploadMixin.uploadMixinPath + tempFolder + folder,
Body: fileInfo.file,
onProgress: function (progressData) {
console.log(progressData, "ada");
obj.onProgress(progressData);
},
},
(err, data) => {
console.log(err, data, "打印一下");
console.log({ success: true });
console.log(
`${staticDomain}/${uploadMixin.uploadMixinPath}${tempFolder}${folder}`,
"打印一下,数据"
);
if (!err && data.statusCode === 200) {
const imgurl = `${staticDomain}/${uploadMixin.uploadMixinPath}${tempFolder}${folder}`;
......@@ -178,7 +162,8 @@ export const upLoadHander = async (obj: any) => {
let formData = new FormData();
formData.append("biz", fileInfo.biz);
formData.append("file", newFile);
const uploadRes = await axios.post(`http://${VUE_APP_API_URL}:8080/sys/common/upload`,
const uploadRes = await axios.post(
`http://${VUE_APP_API_URL}:8080/sys/common/upload`,
formData,
{
headers: { ...obj.headers },
......@@ -193,6 +178,7 @@ export const upLoadHander = async (obj: any) => {
url = uploadRes.message.replaceAll("//", "/");
const pre = url.startsWith("/") ? "" : "/";
url = `http://${VUE_APP_API_URL}/sys/common/static` + pre + url;
console.log(url, "图片上传失败");
obj.onSuccess({ success: true, message: url });
} else {
obj.onError({
......
......@@ -5,6 +5,12 @@ const routes: Array<RouteRecordRaw> = [
name: "home",
component: () => import(/* @vite-ignore */ `@/views/HomeView.vue`),
},
{
path: "/loging",
name: "loging",
component: () =>
import(/* webpackChunkName: "about" */ `@/views/logingView.vue`),
},
];
const router = createRouter({
......
......@@ -228,14 +228,26 @@
</el-footer>
</el-container>
<el-aside
v-if="pageType == 1"
width="292px"
class="shirnk-aside"
v-shrink="{ isShrink, width: '0px' }"
:style="{
height: 'calc(100vh - 60px)',
}"
>
<div class="recentlyViewd">Browsing history</div>
<div class="Recommended">Recommended products</div>
<div class="shrink-text" @click="changeiShrink">
<el-icon size="30">
<DArrowLeft v-if="isShrink" />
<DArrowRight v-if="!isShrink" />
</el-icon>
</div>
<div v-if="pageType == 1" style="width: 292px;">
<div class="recentlyViewd" v-if="pageType == 2">
Browsing history
</div>
<div class="recentlyViewd" v-if="pageType == 1">
Recommended products
</div>
<div
v-for="(item, index) in productList"
:key="index"
......@@ -252,14 +264,8 @@
</div>
</div>
</div>
</el-aside>
<el-aside
width="292px"
v-if="pageType == 2"
:style="{
height: 'calc(100vh - 60px)',
}"
>
</div>
<div v-else style="width: 292px;">
<div class="recentlyViewd">Request for Quotations</div>
<div class="recently-input-box">
<el-form
......@@ -355,6 +361,7 @@
</div>
</el-form>
</div>
</div>
</el-aside>
</el-container>
</el-container>
......@@ -390,6 +397,60 @@ const ruleForm = ref({
EmailAddress: 'from china',
})
let isShrink = ref('')
const changeiShrink = () => {
console.log(isShrink.value, 'value')
isShrink.value = !isShrink.value
}
//收缩
const vShrink: Directive<HTMLElement, boolean | Props> = {
mounted(el, binding) {
console.log(el, binding, '打印')
let { option } = formatCOlorOption(binding.value)
option.isUpdate && renderStyle(el, option)
},
updated(el: HTMLElement, binding, vnode) {
//修改之后
let { option } = formatCOlorOption(binding.value)
if (option.isShrink) {
renderStyle(el, option)
//此时此刻还需要添加一个p对象
// renderAddNodes(el, option)
} else {
let obj = {
...option,
width: '292px',
}
// for (let key in option) obj[key] = ''
renderStyle(el, obj)
//此时此刻需要清空对象p
// renderAddNodes(el, option)
}
},
}
//设置style的属性值
function renderStyle(el, option) {
for (let key in option) el.style[key] = option[key]
}
//合并指令传递的数据和默认配置的数据
function formatCOlorOption(val: string | Props) {
const option =
typeof val !== 'string'
? Object.assign(defaultStyle, val)
: {
val,
...defaultStyle,
}
return {
option,
}
}
//登录
const defaultStyle: {
transition?: string
} = {
transition: 'all 0.6s linear',
}
const rules = reactive({
ProductName: [
{
......@@ -430,15 +491,7 @@ const rules = reactive({
const ruleFormRef = ref<FormInstance>()
const customerInfo = ref({})
const messages = ref([])
const isUpload = true
// const staticList = ref([
// 'Login account',
// 'Forgot password',
// 'Free entry',
// 'Add/manage products',
// 'improve',
// ])
const productInfo = ref({
productImg: require('../assets/shop.jpg'),
productName: 'The secret to looking glowup nowadays',
......@@ -479,7 +532,6 @@ onMounted(async () => {
})
const connectMsg = () => {
return new Promise((resolve: any, reject: any) => {
// console.log(import)
const useUser = useUserStore()
useUser.setUserInfo({
username: Date.now(),
......@@ -642,6 +694,20 @@ const toSendLink = (e: any) => {
}
</script>
<style lang="scss" scoped>
.shirnk-aside {
position: relative;
overflow: hidden;
overflow: initial;
.shrink-text {
position: absolute;
top: 50%;
transform: translate(-50%);
width: 20px;
height: 20px;
left: -20px;
font-size: 10px;
}
}
.inquiry-list {
display: flex;
width: 360px;
......
......@@ -77,7 +77,7 @@ export default {
if (!formEl) return
formEl.resetFields()
}
//登录
const submitForm = (formEl: FormInstance | undefined) => {
if (!formEl) return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论