提交 b2fe0935 作者: Hao

Initial commit

父级
> 1%
last 2 versions
not dead
not ie 11
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# tokcos-socket-web-ts
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-auto-import
export {}
declare global {
}
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
declare module 'vue' {
export interface GlobalComponents {
AutomaticPrompt: typeof import('./src/components/AutomaticPrompt.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside']
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
ElButton: typeof import('element-plus/es')['ElButton']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElRow: typeof import('element-plus/es')['ElRow']
EmotionComponent: typeof import('./src/components/EmotionComponent.vue')['default']
IndexComponent: typeof import('./src/components/IndexComponent.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "tokcos-socket-web-ts",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@luohc92/vue3-image-viewer": "^1.0.0",
"axios": "^1.6.7",
"core-js": "^3.8.3",
"element-plus": "^2.6.1",
"emoji.json": "^15.1.0",
"unplugin-auto-import": "0.16.1",
"unplugin-vue-components": "^0.25.2",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"typescript": "~4.5.5"
}
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<router-view />
</template>
<style lang="scss">
* {
padding: 0;
margin: 0;
}
html,
body,#app {
width: 100%;
height: 100%;
}
</style>
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
\ No newline at end of file
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
@font-face {
font-family: "iconfont"; /* Project id 2716892 */
src: url('iconfont.woff2?t=1628492942036') format('woff2'),
url('iconfont.woff?t=1628492942036') format('woff'),
url('iconfont.ttf?t=1628492942036') format('truetype');
}
.iconfonts {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-jieshu:before {
content: "\e637";
}
.icon-diannao:before {
content: "\e6ac";
}
.icon-xiaolian:before {
content: "\e631";
}
.icon-zan1:before {
content: "\e600";
}
!function(e){var t,c,n,o,i,l='<svg><symbol id="icon-jieshu" viewBox="0 0 1024 1024"><path d="M522.1 954.6c-52.9 0-104.2-10.4-152.6-30.8-46.7-19.7-88.6-48-124.6-84s-64.3-77.9-84-124.6c-20.4-48.3-30.8-99.7-30.8-152.6 0-68.6 18-136.1 52-195.2 33-57.3 80.3-105.8 136.8-140.1 10.9-6.6 25-3.1 31.6 7.7 6.6 10.9 3.1 25-7.7 31.6-104.4 63.4-166.7 174-166.7 295.9 0 190.8 155.2 346 346 346s346-155.2 346-346c0-127-69.4-243.6-181.1-304.2-11.2-6.1-15.3-20-9.2-31.2 6.1-11.2 20-15.3 31.2-9.2 126.4 68.8 205 200.8 205 344.7 0 52.9-10.4 104.2-30.8 152.6-19.7 46.7-48 88.6-84 124.6s-77.9 64.3-124.6 84c-48.3 20.4-99.6 30.8-152.5 30.8z" ></path><path d="M528.6 607.9c-12.7 0-23-10.3-23-23V114c0-12.7 10.3-23 23-23s23 10.3 23 23v470.9c0 12.7-10.3 23-23 23z" ></path></symbol><symbol id="icon-diannao" viewBox="0 0 1024 1024"><path d="M943.104 80.896H80.896C36.352 80.896 0 117.248 0 161.792v539.136c0 44.544 36.352 80.896 80.896 80.896h403.968v108.032H296.448c-14.848 0-27.136 12.288-27.136 27.136s12.288 27.136 27.136 27.136h431.104c14.848 0 27.136-12.288 27.136-27.136s-12.288-27.136-27.136-27.136h-188.416v-108.032h403.968c44.544 0 80.896-36.352 80.896-80.896V161.792c0-44.544-36.352-80.896-80.896-80.896z m27.136 619.52c0 14.848-12.288 27.136-27.136 27.136H80.896c-14.848 0-27.136-12.288-27.136-27.136V161.792c0-14.848 12.288-27.136 27.136-27.136h862.208c14.848 0 27.136 12.288 27.136 27.136v538.624z" ></path></symbol><symbol id="icon-xiaolian" viewBox="0 0 1024 1024"><path d="M512 938.666667C276.309333 938.666667 85.333333 747.690667 85.333333 512S276.309333 85.333333 512 85.333333s426.666667 190.976 426.666667 426.666667-190.976 426.666667-426.666667 426.666667z m0-800.085334C306.176 138.581333 138.581333 306.176 138.581333 512c0 205.824 167.424 373.248 373.418667 373.248 205.824 0 373.248-167.424 373.248-373.248S717.824 138.581333 512 138.581333z m-1.365333 641.365334h-3.242667c-162.816 0-231.253333-146.944-233.984-153.258667-6.144-13.482667-0.170667-29.184 13.312-35.328 13.482667-5.973333 29.184-0.170667 35.328 13.141333 2.218667 4.949333 57.514667 122.026667 185.514667 122.026667h2.56c136.021333-1.536 190.634667-120.661333 191.146666-121.685333 5.973333-13.482667 21.674667-19.626667 35.157334-13.482667 13.482667 5.973333 19.456 21.674667 13.482666 35.157333-2.730667 6.144-69.461333 151.381333-239.274666 153.429334z m134.314666-294.741334c-29.354667 0-53.248-23.893333-53.248-53.248s23.722667-53.248 53.248-53.248c29.354667 0 53.248 23.893333 53.248 53.248s-23.893333 53.248-53.248 53.248z m-266.752 0c-29.354667 0-53.248-23.893333-53.248-53.248s23.722667-53.248 53.248-53.248c29.354667 0 53.248 23.893333 53.248 53.248s-23.893333 53.248-53.248 53.248z m0 0" fill="" ></path></symbol><symbol id="icon-zan1" viewBox="0 0 1024 1024"><path d="M729.074456 961.131137 414.095691 961.131137c-20.687158 0-37.453007-17.068747-37.453007-38.10383 0-21.064758 16.738219-38.10383 37.453007-38.10383l314.978764 0c2.27174 0 5.650697-0.496304 9.219989-2.921539 3.382027-2.316765 5.111414-5.431709 5.815449-7.609305l135.962601-314.645167c8.654101-19.658735 6.788613-42.11519-4.676509-60.063981-11.520381-17.963117-30.962176-28.688389-52.001351-28.688389l-197.778482-0.054235c-16.57756 0-31.045063-10.988262-35.803437-27.103288-4.650927-16.08842 1.460258-33.459043 15.250332-42.694381 32.125675-21.588691 63.331397-140.283 37.642319-219.082694-14.439874-44.582381-37.642319-43.259246-47.674812-42.694381l-10.9504 0.096191c-14.656815 0-28.447912 5.804193-38.886659 16.363689-10.330276 10.588149-16.008602 24.6494-16.008602 39.647999l0 51.971675c0 60.561307-23.229051 117.509321-65.196885 160.28659-37.181831 37.993313-85.288478 60.835553-137.045259 65.49569l0 413.845493c0 19.798928-7.517207 38.325887-21.255093 52.27662-13.764492 14.034645-32.070416 21.782096-51.324946 21.782096L133.70263 961.13216c-18.685571 0-36.235272-7.444553-49.323359-20.871353-13.168927-13.425777-20.335141-31.293727-20.335141-50.207495L64.04413 475.819986c0-20.719904 7.895831-40.336684 22.309098-55.019081 14.520715-14.710027 33.640168-22.760376 54.029544-22.760376l166.493965 0c39.4812 0 76.472696-15.70161 104.434537-44.128033 27.744901-28.454052 43.185568-66.228377 43.185568-106.467847l0-51.971675c0-35.387975 13.43908-68.585051 37.965683-93.453439 24.580838-24.994254 57.056484-38.737256 91.670839-38.737256l8.760524 0c55.543014-3.226484 99.999528 31.196513 120.768551 94.77555 21.469987 66.186422 15.440667 166.007895-15.198144 236.770542l124.956943 0c46.37726 0.081864 89.265046 23.711028 114.520243 63.290465 25.339108 39.647999 29.313629 89.110527 10.600429 132.286885L813.227064 903.645888c-6.166443 15.909341-17.631566 30.631648-32.829709 41.301661C765.092787 955.560258 747.353774 961.131137 729.074456 961.131137zM138.733203 884.951107l113.465215 0L252.198417 474.123344 140.382772 474.123344 138.733203 884.951107z" fill="#D6CBC5" ></path></symbol></svg>',s=(s=document.getElementsByTagName("script"))[s.length-1].getAttribute("data-injectcss"),d=function(e,t){t.parentNode.insertBefore(e,t)};if(s&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}function a(){i||(i=!0,n())}function m(){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(m,50)}a()}t=function(){var e,t;(t=document.createElement("div")).innerHTML=l,l=null,(e=t.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",t=e,(e=document.body).firstChild?d(t,e.firstChild):e.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),t()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(n=t,o=e.document,i=!1,m(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,a())})}(window);
\ No newline at end of file
{
"id": "2716892",
"name": "qia",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "5050475",
"name": "结束",
"font_class": "jieshu",
"unicode": "e637",
"unicode_decimal": 58935
},
{
"icon_id": "1812545",
"name": "电脑",
"font_class": "diannao",
"unicode": "e6ac",
"unicode_decimal": 59052
},
{
"icon_id": "6480674",
"name": "笑脸",
"font_class": "xiaolian",
"unicode": "e631",
"unicode_decimal": 58929
},
{
"icon_id": "1939759",
"name": "赞",
"font_class": "zan1",
"unicode": "e600",
"unicode_decimal": 58880
}
]
}
// axios.js
import axios from 'axios';
const instance = axios.create({
baseURL: 'https://api.example.com', // 设置基础 URL
timeout: 1000, // 设置请求超时时间
});
instance.interceptors.request.use(
(config:any) => {
// 在发送请求之前做些什么,例如添加 token
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
(error:any) => {
// 对请求错误做些什么
return Promise.reject(error);
}
);
instance.interceptors.response.use(
(response:any) => {
// 对响应数据做点什么
return response.data;
},
(error:any) => {
// 对响应错误做点什么
return Promise.reject(error);
}
);
export default instance;
<template>
<div>
<div class="chat-textarea">
<div class="chat-bar">
<emotion
v-if="showEmotion"
style="position: absolute; top: calc(100% - 465px); background: #fff;"
:height="200"
@emotion="handleEmotion"
/>
<el-icon
style="
cursor: pointer;
margin-left: 20px;
color: #333;
"
@click.stop="showEmotion = true"
>
<i class="iconfonts icon-xiaolian" style=" font-size: 20px;" alt="表情" />
</el-icon>
<el-icon
style="
font-size: 20px;
cursor: pointer;
margin-left: 20px;
color: #333;
"
@click="upfile"
>
<Picture />
</el-icon>
<el-icon
style="
font-size: 20px;
cursor: pointer;
margin-left: 20px;
color: #333;
"
@click="showWord"
>
<InfoFilled />
</el-icon>
</div>
<el-autocomplete
class="autocomplete"
v-model="state"
:fetch-suggestions="querySearchAsync"
placeholder="请输入问题"
@select="handleSelect"
ref="automaticPromptRef"
/>
</div>
</div>
</template>
<script lang="ts" setup>
import Emotion from './IndexComponent.vue'
import { ref, watch, defineEmits, defineExpose } from 'vue'
import axios from 'axios'
const state = ref('')
interface LinkItem {
value: string
link: string
}
const showEmotion = ref<boolean>(false)
const links = ref<LinkItem[]>([])
const handleEmotion = () => {
console.log(1)
}
const upfile = () => {
console.log(2)
}
const showWord = () => {
console.log(3)
}
const loadFromBackend = async (value: string) => {
try {
//输入时候请求后端根据输入值得到提示。 后端返回集合,集合里面对象属性为value和link都是string类型
const response = await axios.get(
`http://localhost:8080/getAutoMsg/${value}`,
)
links.value = response.data
} catch (error) {
console.error(error)
}
}
const querySearchAsync = (queryString: string, cb: (arg: any) => void) => {
const results = queryString
? links.value.filter(createFilter(queryString))
: links.value
cb(results)
}
const createFilter = (queryString: string) => {
return (link: LinkItem) => {
return link.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
}
}
const handleSelect = (value: string) => {
console.log(value)
}
const emit = defineEmits(['updateState'])
watch(state, async (newValue) => {
emit('updateState', newValue)
if (newValue) {
await loadFromBackend(newValue)
} else {
links.value = []
}
})
defineExpose({
setState(res: any) {
state.value = res
},
getState() {
return state.value
},
})
</script>
<style lang="scss">
.chat-bar {
padding: 10px;
display: flex;
align-items: center;
}
.el-autocomplete {
width: 100%;
.el-input {
width: 100%;
}
.el-input__wrapper {
width: 100%;
height: 200px;
align-items: start;
}
}
</style>
<template>
<div class="ly-emotion">
<slot />
</div>
</template>
<script setup>
import * as emoji from 'emoji.json'
// const emoji = require('emoji.json')
const list = emoji.slice(0, 55)
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div
v-for="(line, i) in list"
:key="i"
class="emotion-box-line"
@click.enter="clickHandler(line.char)"
>
{{ line.char }}
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, watch, defineEmits, defineExpose, defineProps } from 'vue'
const list = ref([])
import * as emoji from 'emoji.json'
const getList = () => {
list.value = emoji.slice(0, 50)
list.value.push(emoji[55])
list.value.push(emoji[56])
list.value.push(emoji[57])
list.value.push(emoji[60])
}
const emits = defineEmits(['emotion'])
const clickHandler = (i: number | string) => {
emits('emotion', i)
}
getList()
defineProps({
height: {
type: Number,
default: 200,
},
})
</script>
<style scoped>
.emotion-box {
margin: 0 auto;
width: 250px;
box-sizing: border-box;
padding: 5px;
border: 1px solid #b4b4b4;
overflow: hidden;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
}
.emotion-box-line {
display: flex;
font-size: 21px;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
}
</style>
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/css/reset.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
const app = createApp(App)
app.use(store).use(router).mount("#app");
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component);
}
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";
const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "home",
component: HomeView,
},
{
path: "/login",
name: "login",
component: () =>
import(/* webpackChunkName: "about" */ "../views/loginView.vue"),
},
];
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes,
});
export default router;
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
import { createStore } from 'vuex'
export default createStore({
state: {
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
}
})
export interface LoginFace {
userName: string;
passWord: string;
}
export class LoginData<LoginFace> {
userName = "admin";
passWord = "123456";
}
<template>
<div class="login-box">
<el-form
ref="ruleFormRef"
style="max-width: 450px;"
:model="ruleForm"
:rules="rules"
label-width="auto"
class="form-box"
>
<h2>客服登录</h2>
<el-form-item label="账号" prop="userName" size="large">
<el-input
v-model="ruleForm.userName"
type="userName"
placeholder="请输入账号"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="密码" prop="passWord" size="large">
<el-input
v-model="ruleForm.passWord"
type="password"
autocomplete="off"
placeholder="请输入密码"
/>
</el-form-item>
<el-form-item style="margin: 0px;">
<el-button
class="login-submit"
type="primary"
@click="submitForm(ruleFormRef)"
>
登录
</el-button>
<el-button class="login-reset" @click="resetForm(ruleFormRef)">
重置
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script lang="ts">
import { LoginData } from '../type/Login'
import { reactive, ref } from 'vue'
import type { FormInstance } from 'element-plus'
import { useRouter } from 'vue-router'
export default {
setup() {
const ruleFormRef = ref<FormInstance>()
const ruleForm = reactive(new LoginData())
const router = useRouter()
const rules = reactive({
userName: [
{
required: true,
message: '请输入账号',
trigger: 'blur',
},
],
passWord: [
{
required: true,
message: '请输入密码',
trigger: 'blur',
},
],
})
//重置
const resetForm = (formEl: FormInstance | undefined) => {
ruleForm.userName = ''
ruleForm.passWord = ''
}
//登录
const submitForm = (formEl: FormInstance | undefined) => {
console.log(formEl, 'formEl')
if (!formEl) return
formEl.validate((valid) => {
console.log(valid)
if (valid) {
console.log('submit!')
router.push('/')
} else {
console.log('error submit!')
return false
}
})
}
return { ruleForm, ruleFormRef, rules, resetForm, submitForm }
},
}
</script>
<style lang="scss" scoped>
.login-box {
width: 100%;
height: 100%;
padding-top: 1px;
background: url('../assets/login.jpg') no-repeat;
background-size: 100%;
.form-box {
background: #fff;
.el-input__inner {
height: 40px;
}
h2 {
text-align: center;
margin-bottom: 40px;
font-weight: bolder;
font-size: 20px;
}
margin: 0px auto;
margin-top: 250px;
width: 500px;
text-align: center;
border-radius: 20px;
padding: 40px;
box-shadow: 0px 1px 5px 0 rgba(0, 0, 0, 0.3);
.login-submit,
.login-reset {
width: 48%;
height: 40px;
}
}
}
</style>
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
const { defineConfig } = require('@vue/cli-service')
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
}
})
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论