Commit 5b0e1790 by Sixong.Zhu

eslint , remove moment

parent bd1a816c
......@@ -115,9 +115,7 @@
<script lang="ts">
import { Component, Prop, Ref, Vue } from "vue-property-decorator";
import { parserMessage } from "./controller";
import { EVENTS } from "@/EventConsts";
import { chatStore, ChatStore } from "@/customer-service/store/model";
import {
......
......@@ -54,9 +54,7 @@
<script lang="ts">
import { Component, Prop, Ref, Vue } from "vue-property-decorator";
import Controller from "./controller/chat-list";
import { EVENTS } from "@/EventConsts";
import avatar from "@/customer-service/components/avatar.vue";
import { Chat as ChatType } from "@/customer-service/xim/models/chat";
......
......@@ -20,6 +20,7 @@
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { ChatStore, chatStore } from "../store/model";
......@@ -66,6 +67,7 @@ export default class ChatMembers extends Vue {
}
}
</script>
<style lang="less" scoped>
.chat-members {
padding: 20px;
......
......@@ -34,6 +34,7 @@
</div>
</div>
</template>
<script lang="ts">
import {
Component,
......@@ -43,19 +44,13 @@ import {
Vue,
Watch,
} from "vue-property-decorator";
import MessageInput from "@/customer-service/components/message-input.vue";
import messages from "@/customer-service/components/message-list.vue";
import { ChatStore, chatStore } from "@/customer-service/store/model";
type RoomInfoTab = "customer" | "order";
@Component({
components: {
MessageInput,
messages,
},
})
@Component({ components: { MessageInput, messages } })
export default class ChatRoom extends Vue {
@Ref("chatBox") chatBox!: Element;
@Ref("top") refTop!: Element;
......
......@@ -56,9 +56,9 @@
/>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import ChatCreator from "@/customer-service/components/create-chat.vue";
import { ChatStore, chatStore } from "@/customer-service/store/model";
import { ChatRole } from "../model";
......@@ -192,6 +192,7 @@ export default class ChatTitle extends Vue {
}
}
</script>
<style lang="less" scoped>
.room-title {
font-size: 16px;
......
import { Component, Vue } from "vue-property-decorator";
import { parserMessage } from ".";
import { chatStore, ChatStore } from "@/customer-service/store/model";
import { formatTime, TimeFormatRule } from "@/customer-service/utils/time";
import { Chat as ChatItem } from "@/customer-service/xim/models/chat";
......
......@@ -6,13 +6,15 @@ export function parserMessage(type: string, rawMsg: string) {
if (type === MessageType.Text) {
const msg = JSON.parse(rawMsg);
return msg.text;
} else if (type === MessageType.Image) {
}
if (type === MessageType.Image) {
return `[图片]`;
} else if (type === MessageType.File) {
}
if (type === MessageType.File) {
return `[文件]`;
} else if (type === MessageType.Withdraw) {
}
if (type === MessageType.Withdraw) {
return `[撤回了一条消息]`;
} else {
return `[系统自动回复]`;
}
return `[系统自动回复]`;
}
......@@ -56,26 +56,19 @@
</span>
</el-dialog>
</template>
<script lang="ts">
import { ListEasy, ListTypes, TagManagerTypes } from "uniplat-sdk";
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
import buttonThrottle from "../utils/button-throttle";
import GeneralTagSelectForFilter from "@/components/statistic/GeneralTagSelectForFilter.vue";
import avatar from "@/customer-service/components/avatar.vue";
import chat from "@/customer-service/xim/index";
type User = {
id: string;
name: string;
};
type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
@Component({ components: { avatar, GeneralTagSelectForFilter } })
export default class ChatCreator extends Vue {
@Prop({
type: Array,
default: () => [],
})
@Prop({ type: Array, default: () => [] })
private selected!: number[];
@Watch("currentPage")
......@@ -83,7 +76,7 @@ export default class ChatCreator extends Vue {
this.nextPage();
}
private tagGroups: TagManagerTypes.TagGroup[] = []
private tagGroups: TagManagerTypes.TagGroup[] = [];
private searchText = "";
private currentPage = 1;
private total = 0;
......@@ -122,7 +115,7 @@ export default class ChatCreator extends Vue {
const { pageData, getList } = await list.query({
pageIndex: this.currentPage,
item_size: this.pageSize,
tagFilters: this.getSelectedTags()
tagFilters: this.getSelectedTags(),
});
this.total = pageData.record_count;
this.getList = getList;
......
......@@ -20,7 +20,7 @@
>
<a
class="d-flex align-items-center justify-content-center"
:href="file.url | downloadUrl(getAttachment)"
:href="file.url"
:download="getAttachment"
>
<i class="el-icon-download"></i>
......@@ -31,11 +31,10 @@
</template>
<script lang="ts">
import { Component, Mixins, Model, Prop } from "vue-property-decorator";
import { Component, Model, Prop, Vue } from "vue-property-decorator";
import { Filters } from '../mixin/filter';
@Component({ components: {} })
export default class ImagePreview extends Mixins(Filters) {
export default class ImagePreview extends Vue {
@Model("update")
private value!: boolean;
......@@ -52,7 +51,8 @@ export default class ImagePreview extends Mixins(Filters) {
private close() {
setTimeout(
() => (this.style = { "max-height": "300px", "max-width": "600px" }),
() =>
(this.style = { "max-height": "300px", "max-width": "600px" }),
300
);
this.$emit("update", false);
......
......@@ -8,7 +8,6 @@
</template>
<script lang="ts">
import { Component, Ref, Vue, Watch } from "vue-property-decorator";
import ChatInput, {
FILE_INFO_CLASS,
isImageOrFile,
......@@ -17,7 +16,6 @@ import { Message, MessageType } from "../model";
import { uploadFile } from "../service/upload";
import { ChatLoggerService } from "../xim/logger";
import xim from "../xim/xim";
import { ChatStore, chatStore } from "@/customer-service/store/model";
let sendingMessageIndex = 1;
......
......@@ -39,15 +39,12 @@
<script lang="ts">
import { Component, Prop, Ref, Vue, Watch } from "vue-property-decorator";
import { Message, MessageType } from "../model";
import { throttle } from "../utils";
import { formatTime } from "../utils/time";
import ImagePreview from "./image-preview.vue";
import message from "./message.vue";
import VideoPreview from "./video-preview.vue";
import { ChatStore, chatStore } from "@/customer-service/store/model";
import { dbController } from "../database";
......
......@@ -108,38 +108,32 @@
</template>
<script lang="ts">
import { Component, Inject, Mixins, Prop } from "vue-property-decorator";
import { Filters } from "../mixin/filter";
import * as dto from "../model";
import chat from "./../xim";
import {
import { Component, Inject, Prop, Vue } from "vue-property-decorator";
import * as dto from "../model";
import chat from "./../xim";
import {
isAudio,
isImage,
isVideo,
MAX_FILE_SIZE,
MAX_IMAGE_SIZE,
} from "./message-item/file-controller";
import WhoReadList from "./who-read-list.vue";
import avatar from "@/customer-service/components/avatar.vue";
import { chatStore, ChatStore } from "@/customer-service/store/model";
import ximInstance from "../xim/xim";
import { dbController } from "../database";
import ImageMessage from "./message-item/image-message.vue";
import FileMessage from "./message-item/file-message.vue";
import AudioMessage from "./message-item/audio-message.vue";
import VideoMessage from "./message-item/video-message.vue";
import TextMessage from "./message-item/text-message.vue";
import WithdrawMessage from "./message-item/withdraw-message.vue";
import xim from "./../xim";
const twoMinutes = 2 * 60 * 1000;
const messageMapping = new Map<dto.MessageType, string>([
} from "./message-item/file-controller";
import WhoReadList from "./who-read-list.vue";
import avatar from "@/customer-service/components/avatar.vue";
import { chatStore, ChatStore } from "@/customer-service/store/model";
import ximInstance from "../xim/xim";
import { dbController } from "../database";
import ImageMessage from "./message-item/image-message.vue";
import FileMessage from "./message-item/file-message.vue";
import AudioMessage from "./message-item/audio-message.vue";
import VideoMessage from "./message-item/video-message.vue";
import TextMessage from "./message-item/text-message.vue";
import WithdrawMessage from "./message-item/withdraw-message.vue";
import xim from "./../xim";
const twoMinutes = 2 * 60 * 1000;
const messageMapping = new Map<dto.MessageType, string>([
[dto.MessageType.Image, "image-message"],
[dto.MessageType.File, "file-message"],
[dto.MessageType.Video, "video-message"],
......@@ -147,9 +141,9 @@
[dto.MessageType.Text, "text-message"],
[dto.MessageType.Withdraw, "withdraw-message"],
[dto.MessageType.GeneralOrderMsg, "text-message"],
]);
]);
@Component({
@Component({
components: {
WhoReadList,
avatar,
......@@ -160,8 +154,8 @@
TextMessage,
WithdrawMessage,
},
})
export default class Message extends Mixins(Filters) {
})
export default class Message extends Vue {
@chatStore.State(ChatStore.STATE_CHAT_CURRENT_USER_UID)
private readonly chatMyId!: ChatStore.STATE_CHAT_CURRENT_USER_UID;
......@@ -392,11 +386,11 @@
private closeKeywordPopover() {
document.body.click();
}
}
}
</script>
<style lang="less" scoped>
.message-con {
.message-con {
padding-bottom: 20px;
margin-right: 15px;
position: relative;
......@@ -448,9 +442,9 @@
font-size: 16px;
margin-right: 10px;
}
}
}
.msg-name {
.msg-name {
font-size: 14px;
color: #888;
text-align: right;
......@@ -459,16 +453,16 @@
&.algin-left {
text-align: left;
}
}
}
.msg-content {
.msg-content {
text-align: right;
&.algin-left {
text-align: left;
}
}
}
.msg-detail {
.msg-detail {
margin-top: 10px;
font-size: 14px;
line-height: 20px;
......@@ -479,9 +473,9 @@
/deep/ img {
max-width: 300px;
}
}
}
.download-icon {
.download-icon {
cursor: pointer;
text-decoration: none;
margin-left: 15px;
......@@ -491,21 +485,21 @@
color: #fff;
font-size: 14px;
}
}
}
.no-selection {
.no-selection {
user-select: none;
}
}
.pointer {
.pointer {
cursor: pointer;
}
}
.all {
.all {
color: #4389f8;
}
}
.match-keyword {
.match-keyword {
background-color: #fff3e0;
border-radius: 13px;
padding: 3px 8px;
......@@ -531,9 +525,9 @@
i {
margin-right: 5px;
}
}
}
.keyword-action {
.keyword-action {
list-style: none;
li {
......@@ -546,11 +540,11 @@
background-color: #f5f6fa;
}
}
}
}
</style>
<style lang="less">
.match-keyword-popover {
.match-keyword-popover {
padding: 0;
}
}
</style>
......@@ -102,9 +102,8 @@
</template>
<script lang="ts">
import { Component, Ref, Vue } from "vue-property-decorator";
import { Component, Vue } from "vue-property-decorator";
import { MessageType } from "../model";
import { ChatStore, chatStore } from "../store/model";
import buttonThrottle from "../utils/button-throttle";
......
......@@ -26,7 +26,7 @@
>
<a
class="d-flex align-items-center justify-content-center"
:href="file.url | downloadUrl(getAttachment)"
:href="file.url"
:download="getAttachment"
>
<i class="el-icon-download"></i>
......@@ -39,16 +39,15 @@
<script lang="ts">
import {
Component,
Mixins,
Model,
Prop,
Ref,
Watch
Vue,
Watch,
} from "vue-property-decorator";
import { Filters } from '../mixin/filter';
@Component({ components: {} })
export default class VideoPreview extends Mixins(Filters) {
export default class VideoPreview extends Vue {
@Model("update")
private value!: boolean;
......@@ -68,7 +67,8 @@ export default class VideoPreview extends Mixins(Filters) {
private close() {
setTimeout(
() => (this.style = { "max-height": "300px", "max-width": "600px" }),
() =>
(this.style = { "max-height": "300px", "max-width": "600px" }),
300
);
this.$emit("update", false);
......
......@@ -59,10 +59,8 @@
<script lang="ts">
import { Component, Prop, Ref, Vue } from "vue-property-decorator";
import { namespace } from "vuex-class";
import * as dto from "../model";
import { unique } from "../utils";
import avatar from "@/customer-service/components/avatar.vue";
import { ChatStore } from "@/customer-service/store/model";
import chat from "@/customer-service/xim/index";
......
......@@ -56,11 +56,11 @@
/>
</div>
</template>
<script lang="ts">
import { EVENTS } from "@/EventConsts";
import startProcessDialog from "@/views/workflow2/components/startProcessDialog.vue";
import { Component, Prop, Ref, Vue } from "vue-property-decorator";
import Chat from "../xim/index";
enum WorkFlowStatus {
......@@ -68,12 +68,8 @@ enum WorkFlowStatus {
"已启动" = 1,
"已完成" = 2,
}
const sdk = Chat.getSdk;
@Component({
components: {
startProcessDialog,
},
})
@Component({ components: { startProcessDialog } })
export default class WorkFlow extends Vue {
@Ref("startProcessDialog")
private readonly startProcessIns!: startProcessDialog;
......@@ -107,7 +103,7 @@ export default class WorkFlow extends Vue {
private flowList = [];
public async created() {
this.flowList = await sdk()
this.flowList = await Chat.getSdk()
.model(this.model_name)
.workflow2()
.queryProcessByAssociateId(+this.id);
......@@ -130,6 +126,7 @@ export default class WorkFlow extends Vue {
}
}
</script>
<style lang="less" scoped>
.workflows {
padding: 10px 30px;
......
......@@ -62,7 +62,6 @@
<script lang="ts">
import { Component, Ref, Vue, Watch } from "vue-property-decorator";
import { namespace } from "vuex-class";
import {
getFileType,
getSvg,
......
import moment from "moment";
import Vue from "vue";
import Component from "vue-class-component";
// Define a super class component
@Component({
filters: {
downloadUrl(time: number) {
const format = {
sameDay: 'HH:mm',
nextDay: 'MM/DD',
nextWeek: 'MM/DD',
lastDay: '昨天HH:mm',
lastWeek: 'MM/DD',
sameElse: 'YYYY.MM.DD',
};
return moment(time).calendar(null, format);
}
},
})
export class Filters extends Vue {
}
......@@ -49,11 +49,6 @@
"debug": "=3.1.0"
}
},
"moment": {
"version": "2.29.1",
"resolved": "http://npm.job.qinqinxiaobao.com/moment/-/moment-2.29.1.tgz",
"integrity": "sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M="
},
"ms": {
"version": "2.0.0",
"resolved": "http://npm.job.qinqinxiaobao.com/ms/-/ms-2.0.0.tgz",
......
......@@ -2,7 +2,6 @@
"dependencies": {
"@types/sha1": "^1.1.2",
"axios": "^0.19.2",
"moment": "^2.29.1",
"qs": "~6.9.3",
"sha1": "^1.1.1",
"vuex-class": "^0.3.2",
......
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