Commit 1afba5a5 by panjiangyi

scss to less

parent 86932012
...@@ -207,7 +207,7 @@ export default class ChatList extends Vue { ...@@ -207,7 +207,7 @@ export default class ChatList extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.chat-list-con { .chat-list-con {
.title { .title {
padding-left: 20px; padding-left: 20px;
......
...@@ -178,7 +178,7 @@ export default class ChatRoom extends Vue { ...@@ -178,7 +178,7 @@ export default class ChatRoom extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.room-title { .room-title {
font-size: 16px; font-size: 16px;
padding: 0 20px; padding: 0 20px;
...@@ -270,7 +270,7 @@ export default class ChatRoom extends Vue { ...@@ -270,7 +270,7 @@ export default class ChatRoom extends Vue {
} }
} }
.chat-area { .chat-area {
$input-height: 130px; --input-height: 130px;
.chat-messages { .chat-messages {
height: calc(100% - 130px + 1px); height: calc(100% - 130px + 1px);
...@@ -278,7 +278,7 @@ export default class ChatRoom extends Vue { ...@@ -278,7 +278,7 @@ export default class ChatRoom extends Vue {
} }
.chat-input { .chat-input {
height: $input-height; height: var(--input-height);
} }
} }
.order-info-con { .order-info-con {
......
...@@ -46,7 +46,7 @@ export default class Chat extends Vue { ...@@ -46,7 +46,7 @@ export default class Chat extends Vue {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.chat-dialog-con { .chat-dialog-con {
/deep/ .el-dialog__header { /deep/ .el-dialog__header {
display: none; display: none;
......
<template> <template>
<span class="file-icon" :title="value" v-html="html"></span> <span class="file-icon" :title="value" v-html="html"></span>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Model, Vue } from "vue-property-decorator" import { Component, Model, Vue } from "vue-property-decorator";
;
import { FileType, getSvg } from "./file-controller"; import { FileType, getSvg } from "./file-controller";
@Component({ components: {} }) @Component({ components: {} })
export default class FileIcon extends Vue { export default class FileIcon extends Vue {
@Model("update") @Model("update")
private value!: FileType private value!: FileType;
private get audio() { private get audio() {
return this.value === FileType.Audio; return this.value === FileType.Audio;
} }
private get excel() { private get excel() {
return this.value === FileType.Excel; return this.value === FileType.Excel;
} }
private get image() { private get image() {
return this.value === FileType.Image; return this.value === FileType.Image;
} }
private get others() { private get others() {
return this.value === FileType.Others; return this.value === FileType.Others;
} }
private get pdf() { private get pdf() {
return this.value === FileType.Pdf; return this.value === FileType.Pdf;
} }
private get ppt() { private get ppt() {
return this.value === FileType.Ppt; return this.value === FileType.Ppt;
} }
private get rp() { private get rp() {
return this.value === FileType.Rp; return this.value === FileType.Rp;
} }
private get txt() { private get txt() {
return this.value === FileType.Txt; return this.value === FileType.Txt;
} }
private get video() { private get video() {
return this.value === FileType.Video; return this.value === FileType.Video;
} }
private get word() { private get word() {
return this.value === FileType.Word; return this.value === FileType.Word;
} }
private get xmid() { private get xmid() {
return this.value === FileType.Xmind; return this.value === FileType.Xmind;
} }
private get zip() { private get zip() {
return this.value === FileType.Zip; return this.value === FileType.Zip;
} }
private get html() { private get html() {
return getSvg(this.value); return getSvg(this.value);
} }
} }
</script> </script>
<style lang="scss"> <style lang="less" scoped>
.file-icon { .file-icon {
margin-left: 10px; margin-left: 10px;
svg { svg {
max-width: 36px; max-width: 36px;
max-height: 36px; max-height: 36px;
} }
} }
</style> </style>
<template> <template>
<el-dialog <el-dialog
:modal="false" :modal="false"
:before-close="close" :before-close="close"
:visible="value" :visible="value"
custom-class="hide-header show-close padding-0 width-auto" custom-class="hide-header show-close padding-0 width-auto"
> >
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="preview-title text-center">图片预览</div> <div class="preview-title text-center">图片预览</div>
<div class="d-flex justify-content-center" style="min-width: 300px"> <div class="d-flex justify-content-center" style="min-width: 300px">
<img v-if="file" :src="file.url" :style="style" /> <img v-if="file" :src="file.url" :style="style" />
</div> </div>
<div class="d-flex justify-content-center actions"> <div class="d-flex justify-content-center actions">
<span <span
class="d-flex align-items-center justify-content-center" class="d-flex align-items-center justify-content-center"
@click="set2Default" @click="set2Default"
>1:1</span >1:1</span
> >
<a <a
class="d-flex align-items-center justify-content-center" class="d-flex align-items-center justify-content-center"
:href="file.url | downloadUrl(getAttachment)" :href="file.url | downloadUrl(getAttachment)"
:download="getAttachment" :download="getAttachment"
> >
<i class="el-icon-download"></i> <i class="el-icon-download"></i>
</a> </a>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -35,73 +35,72 @@ import { Component, Model, Prop, Vue } from "vue-property-decorator"; ...@@ -35,73 +35,72 @@ import { Component, Model, Prop, Vue } from "vue-property-decorator";
@Component({ components: {} }) @Component({ components: {} })
export default class ImagePreview extends Vue { export default class ImagePreview extends Vue {
@Model("update") @Model("update")
private value!: boolean private value!: boolean;
@Prop() @Prop()
private file!: { name: string; url: string } private file!: { name: string; url: string };
private style: { private style: {
"max-height": number | string; "max-height": number | string;
"max-width": number | string; "max-width": number | string;
} = { } = {
"max-height": "300px", "max-height": "300px",
"max-width": "600px", "max-width": "600px",
} };
private close() { private close() {
setTimeout( setTimeout(
() => () => (this.style = { "max-height": "300px", "max-width": "600px" }),
(this.style = { "max-height": "300px", "max-width": "600px" }), 300
300 );
); this.$emit("update", false);
this.$emit("update", false); }
}
private set2Default() { private set2Default() {
this.style = { "max-height": "1600px", "max-width": "1600px" }; this.style = { "max-height": "1600px", "max-width": "1600px" };
} }
private get getAttachment() { private get getAttachment() {
if (this.file) { if (this.file) {
return this.file.name; return this.file.name;
}
return "文件下载";
} }
return "文件下载";
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.preview-title { .preview-title {
font-size: 18px; font-size: 18px;
color: #333; color: #333;
margin-bottom: 15px; margin-bottom: 15px;
} }
.actions { .actions {
margin: 15px 0; margin: 15px 0;
> span, > span,
a { a {
width: 30px; width: 30px;
height: 30px; height: 30px;
background-color: #7a7b7d; background-color: #7a7b7d;
color: #fff; color: #fff;
border-radius: 50%; border-radius: 50%;
cursor: pointer; cursor: pointer;
i { i {
color: #fff; color: #fff;
font-size: 20px; font-size: 20px;
}
& + span {
margin-left: 15px;
}
} }
> a { & + span {
margin-left: 15px; margin-left: 15px;
} }
}
> a {
margin-left: 15px;
}
} }
</style> </style>
...@@ -430,7 +430,7 @@ export default class Message extends Vue { ...@@ -430,7 +430,7 @@ export default class Message extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.message-con { .message-con {
margin: 20px 0; margin: 20px 0;
......
<template> <template>
<el-dialog <el-dialog
:modal="false" :modal="false"
:before-close="close" :before-close="close"
:visible="value" :visible="value"
custom-class="hide-header show-close padding-0 width-auto" custom-class="hide-header show-close padding-0 width-auto"
> >
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="preview-title text-center">视频预览</div> <div class="preview-title text-center">视频预览</div>
<div class="d-flex justify-content-center" style="min-width: 300px"> <div class="d-flex justify-content-center" style="min-width: 300px">
<video <video
ref="video" ref="video"
v-if="file" v-if="file"
:src="file.url" :src="file.url"
controls controls
:style="style" :style="style"
></video> ></video>
</div> </div>
<div class="d-flex justify-content-center actions"> <div class="d-flex justify-content-center actions">
<span <span
class="d-flex align-items-center justify-content-center" class="d-flex align-items-center justify-content-center"
@click="set2Default" @click="set2Default"
>1:1</span >1:1</span
> >
<a <a
class="d-flex align-items-center justify-content-center" class="d-flex align-items-center justify-content-center"
:href="file.url | downloadUrl(getAttachment)" :href="file.url | downloadUrl(getAttachment)"
:download="getAttachment" :download="getAttachment"
> >
<i class="el-icon-download"></i> <i class="el-icon-download"></i>
</a> </a>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Model, Prop, Ref, Vue, Watch } from "vue-property-decorator"; import {
Component,
Model,
Prop,
Ref,
Vue,
Watch,
} from "vue-property-decorator";
@Component({ components: {} }) @Component({ components: {} })
export default class VideoPreview extends Vue { export default class VideoPreview extends Vue {
@Model("update") @Model("update")
private value!: boolean private value!: boolean;
@Prop() @Prop()
private file!: { name: string; url: string } private file!: { name: string; url: string };
@Ref("video") @Ref("video")
private video!: HTMLVideoElement private video!: HTMLVideoElement;
private style: { private style: {
"max-height": number | string; "max-height": number | string;
"max-width": number | string; "max-width": number | string;
} = { } = {
"max-height": "800px", "max-height": "800px",
"max-width": "800px", "max-width": "800px",
};
private close() {
setTimeout(
() => (this.style = { "max-height": "300px", "max-width": "600px" }),
300
);
this.$emit("update", false);
}
private set2Default() {
this.style = { "max-height": "1600px", "max-width": "1600px" };
}
private get getAttachment() {
if (this.file) {
return this.file.name;
} }
return "视频下载";
private close() { }
setTimeout(
() => @Watch("value")
(this.style = { "max-height": "300px", "max-width": "600px" }), private onOpen() {
300 if (this.value) {
); this.video?.load();
this.$emit("update", false); setTimeout(() => this.video?.play(), 100);
} } else {
this.video?.pause();
private set2Default() {
this.style = { "max-height": "1600px", "max-width": "1600px" };
}
private get getAttachment() {
if (this.file) {
return this.file.name;
}
return "视频下载";
}
@Watch("value")
private onOpen() {
if (this.value) {
this.video?.load();
setTimeout(() => this.video?.play(), 100);
} else {
this.video?.pause();
}
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.preview-title { .preview-title {
font-size: 18px; font-size: 18px;
color: #333; color: #333;
margin-bottom: 15px; margin-bottom: 15px;
} }
.actions { .actions {
margin: 15px 0; margin: 15px 0;
> span, > span,
a { a {
width: 30px; width: 30px;
height: 30px; height: 30px;
background-color: #7a7b7d; background-color: #7a7b7d;
color: #fff; color: #fff;
border-radius: 50%; border-radius: 50%;
cursor: pointer; cursor: pointer;
i { i {
color: #fff; color: #fff;
font-size: 20px; font-size: 20px;
}
& + span {
margin-left: 15px;
}
} }
> a { & + span {
margin-left: 15px; margin-left: 15px;
} }
}
> a {
margin-left: 15px;
}
} }
</style> </style>
...@@ -138,7 +138,7 @@ export default class WhoReadList extends Vue { ...@@ -138,7 +138,7 @@ export default class WhoReadList extends Vue {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.who-read-list { .who-read-list {
::before { ::before {
content: ""; content: "";
......
...@@ -88,4 +88,4 @@ export default class ChatCreator extends Vue { ...@@ -88,4 +88,4 @@ export default class ChatCreator extends Vue {
} }
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="less" scoped></style>
...@@ -512,7 +512,7 @@ export default class Input extends Vue { ...@@ -512,7 +512,7 @@ export default class Input extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.input-wrap { .input-wrap {
position: relative; position: relative;
padding-left: 20px; padding-left: 20px;
......
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 sign in to comment