init
This commit is contained in:
1 parent
cf854bffbe
commit
101da419dd
59 files changed
-36209
No files matched your search
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
"@vue/app",
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"modules": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
> 1%
|
|
||||||
last 2 versions
|
|
||||||
not ie <= 8
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
env: {
|
|
||||||
node: true
|
|
||||||
},
|
|
||||||
extends: ["plugin:vue/essential", "@vue/prettier"],
|
|
||||||
rules: {
|
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
|
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
|
|
||||||
},
|
|
||||||
parserOptions: {
|
|
||||||
parser: "babel-eslint"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 june
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
Vendored
-10
@@ -1,10 +0,0 @@
|
|||||||
<meta charset="utf-8">
|
|
||||||
<title>index demo</title>
|
|
||||||
<script src="./index.umd.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./index.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
console.log(index)
|
|
||||||
</script>
|
|
||||||
Vendored
-9046
File diff suppressed because it is too large.
Load diff
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-10px) scale(.8);opacity:0}.lemon-tabs{background:#f6f6f6}.lemon-tabs-content{padding:15px}.lemon-tabs-content,.lemon-tabs-content__pane{width:100%;height:100%}.lemon-tabs-nav{display:-webkit-box;display:-ms-flexbox;display:flex;background:#eee}.lemon-tabs-nav__item{line-height:38px;padding:0 15px;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.lemon-tabs-nav__item--active{background:#f6f6f6}.lemon-button{outline:none;line-height:1.499;display:inline-block;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;padding:0 15px;font-size:14px;border-radius:4px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);color:rgba(0,0,0,.65);background-color:#fff;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);text-shadow:0 -1px 0 rgba(0,0,0,.12)}.lemon-button--color-default:hover:not([disabled]){border-color:#666;color:#333}.lemon-button--color-default:active{background-color:#ddd}.lemon-button--color-default[disabled]{cursor:not-allowed;color:#aaa;background:#eee}.lemon-button--color-grey{background:#e1e1e1;border-color:#e1e1e1;color:#666}.lemon-button--color-grey:hover:not([disabled]){border-color:#bbb}.lemon-badge{position:relative;display:inline-block}.lemon-badge__label{border-radius:10px;background:#f5222d;color:#fff;text-align:center;font-size:12px;font-weight:400;white-space:nowrap;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff;z-index:10;position:absolute;-webkit-transform:translateX(50%);transform:translateX(50%);-webkit-transform-origin:100%;transform-origin:100%;display:inline-block;padding:0 4px;height:18px;line-height:17px;min-width:10px;top:-4px;right:6px}.lemon-badge__label--dot{width:10px;height:10px;min-width:auto;padding:0;top:-3px;right:2px}.lemon-avatar{font-variant:tabular-nums;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:inline-block;text-align:center;background:#ccc;color:hsla(0,0%,100%,.7);white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;border-radius:4px}.lemon-avatar--circle{border-radius:50%}.lemon-avatar img{width:100%;height:100%;display:block}.lemon-contact{padding:10px 14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#efefef;text-align:left}.lemon-contact p{margin:0}.lemon-contact--active{background:#bebdbd}.lemon-contact:hover:not(.lemon-contact--active){background:#e3e3e3}.lemon-contact:hover:not(.lemon-contact--active) .el-badge__content{border-color:#ddd}.lemon-contact__avatar{float:left;margin-right:10px}.lemon-contact__avatar img{display:block}.lemon-contact__avatar .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:18px;min-width:18px;top:-4px;right:7px}.lemon-contact__label{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-contact__time{font-size:12px;line-height:18px;padding-left:6px;color:#999;white-space:nowrap}.lemon-contact__name{display:block;width:100%}.lemon-contact__content,.lemon-contact__name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-contact__content{font-size:12px;color:#999;height:18px;line-height:18px;margin-top:1px!important}.lemon-contact__content img{height:14px;display:inline-block;vertical-align:middle;margin:0 1px;position:relative;top:-1px}.lemon-contact--name-center .lemon-contact__label{padding-bottom:0;line-height:38px}.lemon-editor{height:200px;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-diLine truncated
|
|
||||||
Vendored
-9056
File diff suppressed because it is too large.
Load diff
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["index"]=e():t["index"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"01f9":function(t,e,n){"use strict";var r=n("2d00"),i=n("5ca1"),o=n("2aba"),a=n("32e9"),c=n("84f2"),s=n("41a0"),u=n("7f20"),l=n("38fd"),f=n("2b4c")("iterator"),d=!([].keys&&"next"in[].keys()),h="@@iterator",p="keys",v="values",m=function(){return this};t.exports=function(t,e,n,g,b,y,x){s(n,e,g);var _,w,C,S=function(t){if(!d&&t in T)return T[t];switch(t){case p:return function(){return new n(this,t)};case v:return function(){return new n(this,t)}}return function(){return new n(this,t)}},O=e+" Iterator",j=b==v,k=!1,T=t.prototype,I=T[f]||T[h]||b&&T[b],M=I||S(b),E=b?j?S("entries"):M:void 0,P="Array"==e&&T.entries||I;if(P&&(C=l(P.call(new t)),C!==Object.prototype&&C.next&&(u(C,O,!0),r||"function"==typeof C[f]||a(C,f,m))),j&&I&&I.name!==v&&(k=!0,M=function(){return I.call(this)}),r&&!x||!d&&!k&&T[f]||a(T,f,M),c[e]=M,c[O]=m,b)if(_={values:j?M:S(v),keys:y?M:S(p),entries:E},x)for(w in _)w in T||o(T,w,_[w]);else i(i.P+i.F*(d||k),e,_);return _}},"02f4":function(t,e,n){var r=n("4588"),i=n("be13");t.exports=function(t){return function(e,n){var o,a,c=String(i(e)),s=r(n),u=c.length;return s<0||s>=u?t?"":void 0:(o=c.charCodeAt(s),o<55296||o>56319||s+1===u||(a=c.charCodeAt(s+1))<56320||a>57343?t?c.charAt(s):o:t?c.slice(s,s+2):a-56320+(o-55296<<10)+65536)}}},"0390":function(t,e,n){"use strict";var r=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"04f4":function(t,e,n){"use strict";var r=n("26f7"),i=n.n(r);i.a},"07e3":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"0a49":function(t,e,n){var r=n("9b43"),i=n("626a"),o=n("4bf8"),a=n("9def"),c=n("cd1c");t.exports=function(t,e){var n=1==t,s=2==t,u=3==t,l=4==t,f=6==t,d=5==t||f,h=e||c;return function(e,c,p){for(var v,m,g=o(e),b=i(g),y=r(c,p,3),x=a(b.length),_=0,w=n?h(e,x):s?h(e,0):void 0;x>_;_++)if((d||_ in b)&&(v=b[_],m=y(v,_,g),t))if(n)w[_]=m;else if(m)switch(t){case 3:return!0;case 5:return v;case 6:return _;case 2:w.push(v)}else if(l)return!1;return f?-1:u||l?l:w}}},"0af2":function(t,e,n){},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0d58":function(t,e,n){var r=n("ce10"),i=n("e11e");t.exports=Object.keys||function(t){return r(t,i)}},"0e15":function(t,e,n){"use strict";var r=n("9768"),i=n.n(r);i.a},"0fc9":function(t,e,n){var r=n("3a38"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},1021:function(t,e,n){},"107a":function(t,e,n){},1169:function(t,e,n){var r=n("2d95");t.exports=Array.isArray||function(t){return"Array"==r(t)}},1173:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"11e9":function(t,e,n){var r=n("52a7"),i=n("4630"),o=n("6821"),a=n("6a99"),c=n("69a8"),s=n("c69a"),u=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?u:function(t,e){if(t=o(t),e=a(e,!0),s)try{return u(t,e)}catch(n){}if(c(t,e))return i(!r.f.call(t,e),t[e])}},1495:function(t,e,n){var r=n("86cc"),i=n("cb7c"),o=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){i(t);var n,a=o(e),c=a.length,s=0;while(c>s)r.f(t,n=a[s++],e[n]);return t}},"15cf":function(t,e,n){},1654:function(t,e,n){"use strict";var r=n("71c1")(!0);n("30f1")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},1663:function(t,e,n){"use strict";var r=n("e86c"),i=n.n(r);i.a},1691:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"1af6":function(t,e,n){var r=n("63b6");r(r.S,"Array",{isArray:n("9003")})},"1bc3":function(t,eLine truncated
|
|
||||||
-1813
File diff suppressed because it is too large.
Load diff
@@ -1,147 +0,0 @@
|
|||||||
export default [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
displayName: "像梦一样自由",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-2/2020022821001845128.jpg",
|
|
||||||
index: "X",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "你开心吗",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
displayName: "梦醒时分、",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/20211301122243621.jpg",
|
|
||||||
index: "M",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
displayName: "凌云",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/2021129102387841.jpg",
|
|
||||||
index: "L",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
displayName: "小郭",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/2021122135507881.jpg",
|
|
||||||
index: "X",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
displayName: "杨玉泉",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/20211211131598147.jpg",
|
|
||||||
index: "Y",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
displayName: "森系Style",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/2021113104111220.jpg",
|
|
||||||
index: "S",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 7,
|
|
||||||
displayName: "霸王花",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/20211411391666.jpg",
|
|
||||||
index: "B",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "你怎么还不睡呀?",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
displayName: "曾平",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-12/202012291044425822.jpg",
|
|
||||||
index: "Z",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 9,
|
|
||||||
displayName: "淡然",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-12/202012141813343503.jpg",
|
|
||||||
index: "D",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 10,
|
|
||||||
displayName: "叶子。",
|
|
||||||
avatar: "https://p.qqan.com/up/2021-1/20211301122243621.jpg",
|
|
||||||
index: "Y",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 11,
|
|
||||||
displayName: "土豆",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-12/202012111157268739.jpg",
|
|
||||||
index: "T",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 12,
|
|
||||||
displayName: "清沫",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-12/202012415467996.jpg",
|
|
||||||
index: "Q",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 13,
|
|
||||||
displayName: "Lemon-imui交流群",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-11/20201127157109035.jpg",
|
|
||||||
index: "L",
|
|
||||||
isGroup: true,
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "这个咋处理啊?",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 14,
|
|
||||||
displayName: "系统通知",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-6/2020061117234279854.jpg",
|
|
||||||
index: "[1]系統通知",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "宁静致远通过了你的好友请求",
|
|
||||||
renderContainer() {
|
|
||||||
return (
|
|
||||||
<div style="padding:15px;">
|
|
||||||
<div>宁静致远通过了你的好友请求</div>
|
|
||||||
<div>宁静致远通过了你的好友请求</div>
|
|
||||||
<div>宁静致远通过了你的好友请求</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 15,
|
|
||||||
displayName: "宁静致远。",
|
|
||||||
avatar: "https://p.qqan.com/up/2020-6/2020060308522797777.jpg",
|
|
||||||
index: "N",
|
|
||||||
unread: 0,
|
|
||||||
lastSendTime: 1566047865417,
|
|
||||||
lastContent: "",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
export default [
|
|
||||||
{
|
|
||||||
label: "表情",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: "1f600",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f600.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f62c",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f62c.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f601",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f601.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f602",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f602.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f923",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f923.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f973",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f973.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f603",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f603.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f604",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f604.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f605",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f605.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f606",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f606.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f607",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f607.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f609",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f609.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f60a",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f60a.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f642",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f642.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f643",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f643.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1263a",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/263a.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f60b",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f60b.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f60c",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f60c.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f60d",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f60d.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f970",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f970.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f618",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f618.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f617",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f617.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f619",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f619.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f61a",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f61a.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f61c",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f61c.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f92a",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f92a.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f928",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f928.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f9d0",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f9d0.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f61d",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f61d.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f61b",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f61b.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f911",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f911.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f913",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f913.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f60e",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f60e.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f929",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f929.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f921",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f921.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f920",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f920.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f917",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f917.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f60f",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f60f.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f636",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f636.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f610",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f610.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f611",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f611.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f612",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f612.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f644",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f644.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f914",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f914.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f925",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f925.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f92d",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f92d.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f92b",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f92b.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f92c",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f92c.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f92f",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f92f.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f633",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f633.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f61e",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f61e.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f61f",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f61f.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f620",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f620.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f621",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f621.png",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "收藏",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: "1f62c",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f62c.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "1f621",
|
|
||||||
title: "微笑",
|
|
||||||
src: "https://twemoji.maxcdn.com/2/72x72/1f621.png",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
import ContactsData from "./contacts";
|
|
||||||
import UserData from "./user";
|
|
||||||
const generateRandId = () => {
|
|
||||||
return Math.random()
|
|
||||||
.toString(36)
|
|
||||||
.substr(-8);
|
|
||||||
};
|
|
||||||
const getContact = id => {
|
|
||||||
const data = ContactsData.find(contact => contact.id == id);
|
|
||||||
return { id: data.id, avatar: data.avatar, displayName: data.displayName };
|
|
||||||
};
|
|
||||||
export default {
|
|
||||||
1: [
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "问你件事",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: UserData,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "啥子。",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(1),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "为什么",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: UserData,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "你穿了高跟鞋还这么矮",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: UserData,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "因为我矮啊。[!1f600][!1f600][!1f600]",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(1),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "你开心吗",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(1),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
2: [],
|
|
||||||
3: [],
|
|
||||||
4: [],
|
|
||||||
5: [],
|
|
||||||
6: [],
|
|
||||||
7: [],
|
|
||||||
8: [],
|
|
||||||
9: [],
|
|
||||||
10: [],
|
|
||||||
11: [],
|
|
||||||
12: [],
|
|
||||||
13: [
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "我是测试时候看到的",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(4),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "上新版本了,玩玩",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(4),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "项目内没有搞这个",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(4),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "@awesome 最新的,不然哪有这功能",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(5),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "其实是跟你的遮罩层有冲突",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(4),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "自己修改index哈",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: UserData,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "你们升级到最近版了吗?",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(6),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: generateRandId(),
|
|
||||||
status: "succeed",
|
|
||||||
type: "text",
|
|
||||||
sendTime: 1566047865417,
|
|
||||||
content: "wo 现在用的142",
|
|
||||||
toContactId: 1,
|
|
||||||
fromUser: getContact(7),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
14: [],
|
|
||||||
15: [],
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export default {
|
|
||||||
id: 1000,
|
|
||||||
avatar: "https://p.qqan.com/up/2018-4/15244505348390471.jpg",
|
|
||||||
displayName: "野火。",
|
|
||||||
};
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
.lemon-message.lemon-message-voice{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message.lemon-message-voice .lemon-message__content{border:2px solid #000;font-size:12px;cursor:pointer}.lemon-message.lemon-message-voice .lemon-message__content:before{display:none}.slot-group{width:170px;border-left:1px solid #ddd;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;padding:10px}.slot-group .slot-search{margin:5px 0}.slot-group-notice{color:#999;padding:6px 0;font-size:12px}.slot-group-title{font-size:12px}.slot-group-member{font-size:12px;line-height:18px}.slot-group-menu span{display:inline-block;cursor:pointer;color:#888;margin:4px 10px 0 0;border-bottom:2px solid transparent}.slot-group-menu span:hover{color:#000;border-color:#333}.slot-contact-fixedtop{padding:10px;border-bottom:1px solid #ddd}.slot-search{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px;border:1px solid #bbb;padding:5px 10px}::-moz-selection{background:#000;color:#fff}::selection{background:#000;color:#fff}body{font-family:Microsoft YaHei;background:#f6f6f6!important}#app{width:90%;margin:0 auto;padding-bottom:100px}#app .scroll-top{cursor:pointer;position:fixed;bottom:40px;left:50%;border-radius:50%;background:#fff;font-size:18px;overflow:hidden;width:40px;height:40px;line-height:40px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;-webkit-transform:rotate(-45deg) translateX(-50%);transform:rotate(-45deg) translateX(-50%);-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}#app .scroll-top:hover{font-size:22px}a{color:#0c5ed9;text-decoration:none;font-size:12px}.action{margin-top:20px}.action .lemon-button{margin-right:10px;margin-bottom:10px}.link{font-size:14px;margin-top:15px}.link a{margin:0 5px;text-decoration:none;background:#ffba00;border-radius:4px;padding:5px 10px;color:rgba(0,0,0,.8)}.link a,.logo{display:inline-block}.logo{position:relative;margin:60px auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.logo-text{font-size:38px}.logo-sub{font-size:18px;color:#999;font-weight:300}.logo-badge{position:absolute;top:-10px;left:230px;background:#000;border-radius:16px;color:#f9f9f9;font-size:12px;padding:4px 8px}.title{font-size:24px;line-height:26px;border-left:1px solid #ffba00;padding-left:15px;margin-bottom:15px;margin-top:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.table{width:100%;border-radius:10px;background:#fff;border-collapse:collapse}.table tr{cursor:pointer}.table tr:not(.table-head):hover{background:#ffba00!important}.table tr:nth-of-type(2n){background:#f9f9f9}.table th{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999}.table td,.table th{text-align:left;padding:10px 15px;font-size:14px;font-weight:400}.imui-center{margin-bottom:60px}.imui-center .lemon-wrapper{border:1px solid #ddd}.imui-center .lemon-drawer{border:1px solid #ddd;border-left:0}.drawer-content{padding:15px}.more{font-size:12px;line-height:24px;height:24px;position:absolute;top:14px;right:14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#f1f1f1;display:inline-block;border-radius:4px;background:#111;padding:0 8px}.more:active{background:#999}.bar{line-height:30px;background:#fff;margin:15px;color:#666;font-size:12px}.bar,.cover{text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cover{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cover i{font-size:84px;color:#e6e6e6}.cover p{font-size:18px;color:#ddd;line-height:50px}.article-item{line-height:34px;cursor:pointer}.article-item:hover{text-decoration:underline;color:#318efd}pre{background:#fff;border-radius:8px;padding:15px}.lemon-simple .lemon-container{z-index:5}.lemon-simple .lemon-drawer{z-index:4}input#switch[type=checkbox]{height:0;width:0;display:none}label#switch-label{cursor:pointer;text-indent:-9999px;width:34px;height:20px;background:#aaa;display:block;border-radius:100px;position:relative}label#switch-label:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:20px;-webkit-transition:.3s;transition:.3s}input#switch:checked+label{background:#0fd547}input#switch:checked+label:after{left:calc(100% - 2px);-webkit-transform:translateX(-100%);transform:translateX(-100%)}label#switch-label:active:after{width:20px}.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-Line truncated
|
|
||||||
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=favicon.ico><title>Lemon IMUI</title><link href=css/index.296428a2.css rel=preload as=style><link href=js/chunk-vendors.7b679a24.js rel=preload as=script><link href=js/index.d839a334.js rel=preload as=script><link href=css/index.296428a2.css rel=stylesheet></head><body><noscript><strong>We're sorry but flat-im doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.7b679a24.js></script><script src=js/index.d839a334.js></script></body></html>
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"01f9":function(t,e,n){"use strict";var r=n("2d00"),o=n("5ca1"),i=n("2aba"),a=n("32e9"),c=n("84f2"),s=n("41a0"),u=n("7f20"),f=n("38fd"),l=n("2b4c")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",v="keys",h="values",y=function(){return this};t.exports=function(t,e,n,m,g,b,_){s(n,e,m);var x,w,O,A=function(t){if(!p&&t in E)return E[t];switch(t){case v:return function(){return new n(this,t)};case h:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",C=g==h,k=!1,E=t.prototype,j=E[l]||E[d]||g&&E[g],$=j||A(g),T=g?C?A("entries"):$:void 0,P="Array"==e&&E.entries||j;if(P&&(O=f(P.call(new t)),O!==Object.prototype&&O.next&&(u(O,S,!0),r||"function"==typeof O[l]||a(O,l,y))),C&&j&&j.name!==h&&(k=!0,$=function(){return j.call(this)}),r&&!_||!p&&!k&&E[l]||a(E,l,$),c[e]=$,c[S]=y,g)if(x={values:C?$:A(h),keys:b?$:A(v),entries:T},_)for(w in x)w in E||i(E,w,x[w]);else o(o.P+o.F*(p||k),e,x);return x}},"02f4":function(t,e,n){var r=n("4588"),o=n("be13");t.exports=function(t){return function(e,n){var i,a,c=String(o(e)),s=r(n),u=c.length;return s<0||s>=u?t?"":void 0:(i=c.charCodeAt(s),i<55296||i>56319||s+1===u||(a=c.charCodeAt(s+1))<56320||a>57343?t?c.charAt(s):i:t?c.slice(s,s+2):a-56320+(i-55296<<10)+65536)}}},"0390":function(t,e,n){"use strict";var r=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"07e3":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"097d":function(t,e,n){"use strict";var r=n("5ca1"),o=n("8378"),i=n("7726"),a=n("ebd6"),c=n("bcaa");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return c(e,t()).then(function(){return n})}:t,n?function(n){return c(e,t()).then(function(){throw n})}:t)}})},"0a49":function(t,e,n){var r=n("9b43"),o=n("626a"),i=n("4bf8"),a=n("9def"),c=n("cd1c");t.exports=function(t,e){var n=1==t,s=2==t,u=3==t,f=4==t,l=6==t,p=5==t||l,d=e||c;return function(e,c,v){for(var h,y,m=i(e),g=o(m),b=r(c,v,3),_=a(g.length),x=0,w=n?d(e,_):s?d(e,0):void 0;_>x;x++)if((p||x in g)&&(h=g[x],y=b(h,x,m),t))if(n)w[x]=y;else if(y)switch(t){case 3:return!0;case 5:return h;case 6:return x;case 2:w.push(h)}else if(f)return!1;return l?-1:u||f?f:w}}},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0d58":function(t,e,n){var r=n("ce10"),o=n("e11e");t.exports=Object.keys||function(t){return r(t,o)}},"0fc9":function(t,e,n){var r=n("3a38"),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},1169:function(t,e,n){var r=n("2d95");t.exports=Array.isArray||function(t){return"Array"==r(t)}},1173:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"11e9":function(t,e,n){var r=n("52a7"),o=n("4630"),i=n("6821"),a=n("6a99"),c=n("69a8"),s=n("c69a"),u=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?u:function(t,e){if(t=i(t),e=a(e,!0),s)try{return u(t,e)}catch(n){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},1495:function(t,e,n){var r=n("86cc"),o=n("cb7c"),i=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){o(t);var n,a=i(e),c=a.length,s=0;while(c>s)r.f(t,n=a[s++],e[n]);return t}},1654:function(t,e,n){"use strict";var r=n("71c1")(!0);n("30f1")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},1691:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},1991:function(t,e,n){var r,o,i,a=n("9b43"),c=n("31f4"),s=n("fab2"),u=n("230e"),f=n("7726"),l=f.process,p=f.setImmediate,d=f.clearImmediate,v=f.MessageChannel,h=f.Dispatch,y=0,m={},g="onreadystatechange",b=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},_=function(t){b.call(t.data)};p&&d||(p=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return m[++y]=function(){c("function"==typeof t?t:Function(t),e)},r(y),y},d=function(t){delete m[t]},"process"==n("2d95")(l)?r=function(t){l.nextTick(a(b,t,1))}:h&&h.now?r=function(t){h.now(a(b,t,1))}:v?(o=new v,i=o.port2,o.port1.onmessage=_,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",_,!1)):r=g in u("script")?function(t){s.appendChild(u("script"))[g]=function(){s.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:p,clear:d}},"1af6":function(t,e,n){var r=n("63b6");r(r.S,"Array",{isArray:n("9003")})},"1bc3":function(t,e,n){var r=n("f772");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==tLine truncated
|
|
||||||
/*!
|
|
||||||
* Vue.js v2.6.10
|
|
||||||
* (c) 2014-2019 Evan You
|
|
||||||
* Released under the MIT License.
|
|
||||||
*/
|
|
||||||
var n=Object.freeze({});function r(t){return void 0===t||null===t}function o(t){return void 0!==t&&null!==t}function i(t){return!0===t}function a(t){return!1===t}function c(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function s(t){return null!==t&&"object"===typeof t}var u=Object.prototype.toString;function f(t){return"[object Object]"===u.call(t)}function l(t){return"[object RegExp]"===u.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return o(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function v(t){return null==t?"":Array.isArray(t)||f(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function y(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}y("slot,component",!0);var m=y("key,ref,slot,slot-scope,is");function g(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function _(t,e){return b.call(t,e)}function x(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}var w=/-(\w)/g,O=x(function(t){return t.replace(w,function(t,e){return e?e.toUpperCase():""})}),A=x(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),S=/\B([A-Z])/g,C=x(function(t){return t.replace(S,"-$1").toLowerCase()});function k(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function E(t,e){return t.bind(e)}var j=Function.prototype.bind?E:k;function $(t,e){e=e||0;var n=t.length-e,r=new Array(n);while(n--)r[n]=t[n+e];return r}function T(t,e){for(var n in e)t[n]=e[n];return t}function P(t){for(var e={},n=0;n<t.length;n++)t[n]&&T(e,t[n]);return e}function L(t,e,n){}var I=function(t,e,n){return!1},M=function(t){return t};function N(t,e){if(t===e)return!0;var n=s(t),r=s(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every(function(t,n){return N(t,e[n])});if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var a=Object.keys(t),c=Object.keys(e);return a.length===c.length&&a.every(function(n){return N(t[n],e[n])})}catch(u){return!1}}function F(t,e){for(var n=0;n<t.length;n++)if(N(t[n],e))return n;return-1}function D(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}var R="data-server-rendered",V=["component","directive","filter"],U=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],G={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:I,isReservedAttr:I,isUnknownElement:I,getTagNamespace:L,parsePlatformTagName:M,mustUseProp:I,async:!0,_lifecycleHooks:U},H=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function B(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function z(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var W=new RegExp("[^"+H.source+".$_\\d]");function K(t){if(!W.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}var q,X="__proto__"in{},Y="undefined"!==typeof window,J="undefined"!==typeof WXEnvironment&&!!WXEnvironment.platform,Z=J&&WXEnvironment.platform.toLowerCase(),Q=Y&&window.navigator.userAgent.toLowerCase(),tt=Q&&/msie|trident/.test(Q),et=Q&&Q.indexOf("msie 9.0")>0,nt=Q&&Q.indexOf("edge/")>0,rt=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),ot=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),it={}.watch,at=!1;if(Y)try{var ct={};Object.defineProperty(ct,"passive",{get:function(){at=!0}}),window.addEventListener("test-passive",null,ct)}catch(Oa){}var st=function(){return void 0===q&&(q=!Y&&!J&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),q},ut=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ft(t){return"function"===typeof t&&/native code/.test(t.toString())}var lt,pt="undefined"!==typeof Symbol&&ft(Symbol)&&"undefined"!==typeof Reflect&&ft(Reflect.ownKeys);lt="undefined"!==typeof Set&&ft(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var dt=L,vt=0,ht=function(){this.id=vt++,this.subs=[]};ht.prototype.addSub=function(t){this.subs.push(t)},ht.prototype.removeSub=function(t){g(this.subs,t)},ht.prototype.depend=function(){ht.taLine truncated
|
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
(function(t){function e(e){for(var i,r,o=e[0],c=e[1],d=e[2],u=0,m=[];u<o.length;u++)r=o[u],a[r]&&m.push(a[r][0]),a[r]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=c[i]);l&&l(e);while(m.length)m.shift()();return s.push.apply(s,d||[]),n()}function n(){for(var t,e=0;e<s.length;e++){for(var n=s[e],i=!0,o=1;o<n.length;o++){var c=n[o];0!==a[c]&&(i=!1)}i&&(s.splice(e--,1),t=r(r.s=n[0]))}return t}var i={},a={index:0},s=[];function r(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var d=0;d<o.length;d++)e(o[d]);var l=c;s.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("c31f")},"04f4":function(t,e,n){"use strict";var i=n("26f7"),a=n.n(i);a.a},"08dd":function(t,e,n){},"0af2":function(t,e,n){},"0e15":function(t,e,n){"use strict";var i=n("9768"),a=n.n(i);a.a},1021:function(t,e,n){},"107a":function(t,e,n){},"15cf":function(t,e,n){},1663:function(t,e,n){"use strict";var i=n("e86c"),a=n.n(i);a.a},"1e45":function(t,e,n){"use strict";var i=n("83d7"),a=n.n(i);a.a},"26f7":function(t,e,n){},3423:function(t,e,n){"use strict";var i=n("107a"),a=n.n(i);a.a},"428f":function(t,e,n){},"436f":function(t,e,n){"use strict";var i=n("0af2"),a=n.n(i);a.a},"476d":function(t,e,n){"use strict";var i=n("428f"),a=n.n(i);a.a},"49c2":function(t,e,n){"use strict";var i=n("acce"),a=n.n(i);a.a},"4d21":function(t,e,n){"use strict";var i=n("917b"),a=n.n(i);a.a},"6a2b":function(t,e,n){},"6da9":function(t,e,n){},7802:function(t,e,n){},"820e":function(t,e,n){},"83d7":function(t,e,n){},"909e":function(t,e,n){"use strict";var i=n("1021"),a=n.n(i);a.a},"917b":function(t,e,n){},9224:function(t){t.exports={name:"lemon-imui",version:"1.7.4",main:"dist/index.umd.min.js",description:"基于 VUE2.0 的 IM 聊天组件",homepage:"http://june000.gitee.io/lemon-im/",keywords:["vue","im","chat","vueim","vuechat","webim","webchat"],repository:{type:"git",url:"git+https://github.com/fanjyy/lemon-imui.git"},scripts:{serve:"vue-cli-service serve",build:"vue-cli-service build --target lib --name index packages/index.js","build-examples":"vue-cli-service build --dest examples/dist examples/main.js",lint:"vue-cli-service lint"},peerDependencies:{vue:"^2.6.10"},devDependencies:{"@vue/cli-plugin-babel":"^3.6.0","@vue/cli-plugin-eslint":"^3.6.0","@vue/cli-service":"^3.6.0","@vue/eslint-config-prettier":"^4.0.1","babel-eslint":"^10.0.2",eslint:"^5.16.0","eslint-plugin-vue":"^5.2.3",stylus:"^0.54.5","stylus-loader":"^3.0.2","vue-template-compiler":"^2.5.21"},author:"fanjun",license:"MIT"}},9768:function(t,e,n){},9800:function(t,e,n){},"9b01":function(t,e,n){"use strict";var i=n("6da9"),a=n.n(i);a.a},"9c9b":function(t,e,n){"use strict";var i=n("9800"),a=n.n(i);a.a},a215:function(t,e,n){},acce:function(t,e,n){},c31f:function(t,e,n){"use strict";n.r(e);n("cadf"),n("551c"),n("f751"),n("097d");var i=n("2b0e"),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{staticClass:"scroll-top",on:{click:t.scrollToTop}},[t._v("🚀")]),n("div",{staticClass:"logo"},[n("div",{staticClass:"logo-text"},[n("b",[t._v("Lemon")]),t._v(" IMUI"),n("span",{staticClass:"logo-badge"},[t._v(t._s(this.packageData.version))])]),n("div",{staticClass:"logo-sub"},[t._v(t._s(this.packageData.description))]),t._m(0),n("br"),t._m(1),t._m(2)]),n("div",{staticClass:"imui-center"},[n("lemon-imui",{ref:"IMUI",attrs:{user:t.user,contextmenu:t.contextmenu,"contact-contextmenu":t.contactContextmenu,theme:t.theme,"hide-menu":t.hideMenu,"hide-menu-avatar":t.hideMenuAvatar,"hide-message-name":t.hideMessageName,"hide-message-time":t.hideMessageTime},on:{"change-menu":t.handleChangeMenu,"change-contact":t.handleChangeContact,"pull-messages":t.handlePullMessages,"message-click":t.handleMessageClick,"menu-avatar-click":t.handleMenuAvatarClick,send:t.handleSend},scopedSlots:t._u([{key:"cover",fn:function(){return[n("div",{staticClass:"cover"},[n("i",{staticClass:"lemon-icon-message"}),n("p",[n("b",[t._v("自定义封面 Lemon")]),t._v(" IMUI")])])]},proxy:!0},{key:"message-title",fn:function(e){return[n("span",[t._v(t._s(e.displayName))]),n("sLine truncated
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "lemonMessageVoice",
|
|
||||||
inheritAttrs: false,
|
|
||||||
inject: ["IMUI"],
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<lemon-message-basic
|
|
||||||
class="lemon-message-voice"
|
|
||||||
props={{ ...this.$attrs }}
|
|
||||||
scopedSlots={{
|
|
||||||
content: props => {
|
|
||||||
return <span>{props.content} 🔈</span>;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
.lemon-message.lemon-message-voice
|
|
||||||
user-select none
|
|
||||||
.lemon-message__content
|
|
||||||
border 2px solid #000
|
|
||||||
font-size 12px
|
|
||||||
cursor pointer
|
|
||||||
&::before
|
|
||||||
display none
|
|
||||||
</style>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import Vue from "vue";
|
|
||||||
import App from "./App.vue";
|
|
||||||
import LemonIMUI from "../packages";
|
|
||||||
Vue.use(LemonIMUI);
|
|
||||||
|
|
||||||
Vue.config.productionTip = false;
|
|
||||||
|
|
||||||
new Vue({
|
|
||||||
render: h => h(App)
|
|
||||||
}).$mount("#app");
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
<script>
|
|
||||||
import UserData from "../database/user";
|
|
||||||
import ContactsData from "../database/contacts";
|
|
||||||
import MessagesData from "../database/messages";
|
|
||||||
import EmojiData from "../database/emoji";
|
|
||||||
export default {
|
|
||||||
name: "QqImui",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div class="qq-lemon-imui">
|
|
||||||
<lemon-imui
|
|
||||||
class="lemon-slot"
|
|
||||||
user={UserData}
|
|
||||||
width={900}
|
|
||||||
avatar-cricle
|
|
||||||
hide-message-name
|
|
||||||
hide-message-time
|
|
||||||
ref="IMUI"
|
|
||||||
on={{
|
|
||||||
"pull-messages": this.handlePullMessages,
|
|
||||||
"change-contact": this.handleChangeContact,
|
|
||||||
send: this.handleSend,
|
|
||||||
}}
|
|
||||||
scopedSlots={{
|
|
||||||
"message-title": contact => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div style="display:flex;justify-content:space-between">
|
|
||||||
<span>{contact.displayName}</span>
|
|
||||||
<span style="font-size:12px;">
|
|
||||||
<span>打开抽屉:</span>
|
|
||||||
<span
|
|
||||||
class="cursor:pointer;"
|
|
||||||
on-click={() => this.openDrawer("right")}
|
|
||||||
>
|
|
||||||
右侧 |{" "}
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="cursor:pointer;"
|
|
||||||
on-click={() => this.openDrawer("rightInside")}
|
|
||||||
>
|
|
||||||
右侧内部 |{" "}
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="cursor:pointer;"
|
|
||||||
on-click={() => this.openDrawer("center")}
|
|
||||||
>
|
|
||||||
居中
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{contact.isGroup && (
|
|
||||||
<div class="slot-group-menu">
|
|
||||||
<span>聊天</span>
|
|
||||||
<span>公告</span>
|
|
||||||
<span>相册</span>
|
|
||||||
<span>文件</span>
|
|
||||||
<span>活动</span>
|
|
||||||
<span
|
|
||||||
v-lemon-contextmenu_click={[
|
|
||||||
{
|
|
||||||
text: "操作一",
|
|
||||||
click(e, instance, hide) {
|
|
||||||
hide();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "操作二",
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
设置(左键弹出菜单)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
"sidebar-contact-fixedtop": contact => {
|
|
||||||
return (
|
|
||||||
<div class="slot-contact-fixedtop">
|
|
||||||
<input class="slot-search" placeholder="搜索通讯录" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
"message-side": contact => {
|
|
||||||
if (contact.isGroup) {
|
|
||||||
return (
|
|
||||||
<div class="slot-group">
|
|
||||||
<div class="slot-group-title">群通知</div>
|
|
||||||
<div class="slot-group-notice">
|
|
||||||
进群请改备注,格式,工作地点-姓名,请大家配合谢谢
|
|
||||||
</div>
|
|
||||||
<div class="slot-group-title">群成员</div>
|
|
||||||
<div class="slot-group-panel">
|
|
||||||
<input class="slot-search" placeholder="搜索群成员" />
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
<div class="slot-group-member">河南-96-十里青山</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
watch: {},
|
|
||||||
created() {},
|
|
||||||
mounted() {
|
|
||||||
const IMUI = this.$refs.IMUI;
|
|
||||||
IMUI.initContacts(ContactsData);
|
|
||||||
IMUI.initEmoji(EmojiData);
|
|
||||||
IMUI.changeContact(13);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
openDrawer(position) {
|
|
||||||
const IMUI = this.$refs.IMUI;
|
|
||||||
const params = {
|
|
||||||
position,
|
|
||||||
render: contact => {
|
|
||||||
return (
|
|
||||||
<div style="padding:15px">
|
|
||||||
<h5>{contact.displayName}</h5>
|
|
||||||
<span on-click={IMUI.closeDrawer}>关闭抽屉</span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
if (position == "center") {
|
|
||||||
params.width = "50%";
|
|
||||||
params.height = "50%";
|
|
||||||
} else if (position == "rightInside") {
|
|
||||||
params.height = "90%";
|
|
||||||
params.offsetY = "10%";
|
|
||||||
}
|
|
||||||
IMUI.openDrawer(params);
|
|
||||||
},
|
|
||||||
handlePullMessages(contact, next) {
|
|
||||||
const { IMUI } = this.$refs;
|
|
||||||
setTimeout(() => {
|
|
||||||
next(MessagesData[contact.id], true);
|
|
||||||
}, 3000);
|
|
||||||
},
|
|
||||||
handleChangeContact() {},
|
|
||||||
handleSend(message, next, file) {
|
|
||||||
console.log(message, next, file);
|
|
||||||
setTimeout(() => {
|
|
||||||
next();
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
.slot-group
|
|
||||||
width 170px
|
|
||||||
border-left 1px solid #ddd;
|
|
||||||
height 100%
|
|
||||||
box-sizing border-box
|
|
||||||
padding 10px
|
|
||||||
.slot-search
|
|
||||||
margin 5px 0
|
|
||||||
.slot-group-notice
|
|
||||||
color #999
|
|
||||||
padding 6px 0
|
|
||||||
font-size 12px
|
|
||||||
.slot-group-title
|
|
||||||
font-size 12px
|
|
||||||
.slot-group-member
|
|
||||||
font-size 12px
|
|
||||||
line-height 18px
|
|
||||||
.slot-group-menu span
|
|
||||||
display inline-block
|
|
||||||
cursor pointer
|
|
||||||
color #888
|
|
||||||
margin 4px 10px 0 0
|
|
||||||
border-bottom 2px solid transparent;
|
|
||||||
&:hover
|
|
||||||
color #000
|
|
||||||
border-color #333
|
|
||||||
.slot-contact-fixedtop
|
|
||||||
padding 10px
|
|
||||||
border-bottom 1px solid #ddd
|
|
||||||
.slot-search
|
|
||||||
width 100%
|
|
||||||
box-sizing border-box
|
|
||||||
font-size 14px
|
|
||||||
border 1px solid #bbb
|
|
||||||
padding 5px 10px
|
|
||||||
</style>
|
|
||||||
Generated
-11747
File diff suppressed because it is too large.
Load diff
@@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "lemon-imui",
|
|
||||||
"version": "1.7.4",
|
|
||||||
"main": "dist/index.umd.min.js",
|
|
||||||
"description": "基于 VUE2.0 的 IM 聊天组件",
|
|
||||||
"homepage": "http://june000.gitee.io/lemon-im/",
|
|
||||||
"keywords": [
|
|
||||||
"vue",
|
|
||||||
"im",
|
|
||||||
"chat",
|
|
||||||
"vueim",
|
|
||||||
"vuechat",
|
|
||||||
"webim",
|
|
||||||
"webchat"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/fanjyy/lemon-imui.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"serve": "vue-cli-service serve",
|
|
||||||
"build": "vue-cli-service build --target lib --name index packages/index.js",
|
|
||||||
"build-examples": "vue-cli-service build --dest examples/dist examples/main.js",
|
|
||||||
"lint": "vue-cli-service lint"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"vue": "^2.6.10"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@vue/cli-plugin-babel": "^3.6.0",
|
|
||||||
"@vue/cli-plugin-eslint": "^3.6.0",
|
|
||||||
"@vue/cli-service": "^3.6.0",
|
|
||||||
"@vue/eslint-config-prettier": "^4.0.1",
|
|
||||||
"babel-eslint": "^10.0.2",
|
|
||||||
"eslint": "^5.16.0",
|
|
||||||
"eslint-plugin-vue": "^5.2.3",
|
|
||||||
"stylus": "^0.54.5",
|
|
||||||
"stylus-loader": "^3.0.2",
|
|
||||||
"vue-template-compiler": "^2.5.21"
|
|
||||||
},
|
|
||||||
"author": "fanjun",
|
|
||||||
"license": "MIT"
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "LemonAvatar",
|
|
||||||
inject: ["IMUI"],
|
|
||||||
props: {
|
|
||||||
src: String,
|
|
||||||
icon: {
|
|
||||||
type: String,
|
|
||||||
default: "lemon-icon-people",
|
|
||||||
},
|
|
||||||
circle: {
|
|
||||||
type: Boolean,
|
|
||||||
default() {
|
|
||||||
return this.IMUI ? this.IMUI.avatarCricle : false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: Number,
|
|
||||||
default: 32,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
imageFinishLoad: true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<span
|
|
||||||
style={this.style}
|
|
||||||
class={["lemon-avatar", { "lemon-avatar--circle": this.circle }]}
|
|
||||||
on-click={e => this.$emit("click", e)}
|
|
||||||
>
|
|
||||||
{(this.imageFinishLoad || !this.src) && <i class={this.icon} />}
|
|
||||||
<img src={this.src} onLoad={this._handleLoad} />
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
style() {
|
|
||||||
const size = `${this.size}px`;
|
|
||||||
return {
|
|
||||||
width: size,
|
|
||||||
height: size,
|
|
||||||
lineHeight: size,
|
|
||||||
fontSize: `${this.size / 2}px`,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_handleLoad() {
|
|
||||||
this.imageFinishLoad = false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-avatar)
|
|
||||||
font-variant tabular-nums
|
|
||||||
line-height 1.5
|
|
||||||
box-sizing border-box
|
|
||||||
margin 0
|
|
||||||
padding 0
|
|
||||||
list-style none
|
|
||||||
display inline-block
|
|
||||||
text-align center
|
|
||||||
background #ccc
|
|
||||||
color rgba(255,255,255,0.7)
|
|
||||||
white-space nowrap
|
|
||||||
position relative
|
|
||||||
overflow hidden
|
|
||||||
vertical-align middle
|
|
||||||
border-radius 4px
|
|
||||||
+m(circle)
|
|
||||||
border-radius 50%
|
|
||||||
img
|
|
||||||
width 100%
|
|
||||||
height 100%
|
|
||||||
display block
|
|
||||||
</style>
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "LemonBadge",
|
|
||||||
props: {
|
|
||||||
count: [Number, Boolean],
|
|
||||||
overflowCount: {
|
|
||||||
type: Number,
|
|
||||||
default: 99
|
|
||||||
}
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<span class="lemon-badge">
|
|
||||||
{this.$slots.default}
|
|
||||||
{this.count !== 0 && this.count !== undefined && (
|
|
||||||
<span
|
|
||||||
class={[
|
|
||||||
"lemon-badge__label",
|
|
||||||
this.isDot && "lemon-badge__label--dot"
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{this.label}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isDot() {
|
|
||||||
return this.count === true;
|
|
||||||
},
|
|
||||||
label() {
|
|
||||||
if (this.isDot) return "";
|
|
||||||
return this.count > this.overflowCount
|
|
||||||
? `${this.overflowCount}+`
|
|
||||||
: this.count;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-badge)
|
|
||||||
position relative
|
|
||||||
display inline-block
|
|
||||||
+e(label)
|
|
||||||
border-radius 10px
|
|
||||||
background #f5222d
|
|
||||||
color #fff
|
|
||||||
text-align center
|
|
||||||
font-size 12px
|
|
||||||
font-weight normal
|
|
||||||
white-space nowrap
|
|
||||||
box-shadow 0 0 0 1px #fff
|
|
||||||
z-index 10
|
|
||||||
position absolute
|
|
||||||
transform translateX(50%)
|
|
||||||
transform-origin 100%
|
|
||||||
display inline-block
|
|
||||||
padding 0 4px
|
|
||||||
height 18px
|
|
||||||
line-height 17px
|
|
||||||
min-width 10px
|
|
||||||
top -4px
|
|
||||||
right 6px
|
|
||||||
+m(dot)
|
|
||||||
width 10px
|
|
||||||
height 10px
|
|
||||||
min-width auto
|
|
||||||
padding 0
|
|
||||||
top -3px
|
|
||||||
right 2px
|
|
||||||
</style>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "LemonButton",
|
|
||||||
props: {
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
default: "default"
|
|
||||||
},
|
|
||||||
disabled: Boolean
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
class={["lemon-button", `lemon-button--color-${this.color}`]}
|
|
||||||
disabled={this.disabled}
|
|
||||||
type="button"
|
|
||||||
on-click={this._handleClick}
|
|
||||||
>
|
|
||||||
{this.$slots.default}
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_handleClick(e) {
|
|
||||||
this.$emit("click", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-button)
|
|
||||||
outline none
|
|
||||||
line-height 1.499
|
|
||||||
display inline-block
|
|
||||||
font-weight 400
|
|
||||||
text-align center
|
|
||||||
touch-action manipulation
|
|
||||||
cursor pointer
|
|
||||||
background-image none
|
|
||||||
border 1px solid #ddd
|
|
||||||
box-sizing border-box
|
|
||||||
white-space nowrap
|
|
||||||
padding 0 15px
|
|
||||||
font-size 14px
|
|
||||||
border-radius 4px
|
|
||||||
height 32px
|
|
||||||
user-select none
|
|
||||||
transition all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)
|
|
||||||
color rgba(0, 0, 0, 0.65)
|
|
||||||
background-color #fff
|
|
||||||
box-shadow 0 2px 0 rgba(0, 0, 0, 0.015)
|
|
||||||
text-shadow 0 -1px 0 rgba(0, 0, 0, 0.12)
|
|
||||||
+m(color-default)
|
|
||||||
&:hover:not([disabled])
|
|
||||||
border-color #666
|
|
||||||
color #333
|
|
||||||
&:active
|
|
||||||
background-color #ddd
|
|
||||||
&[disabled]
|
|
||||||
cursor not-allowed
|
|
||||||
color #aaa
|
|
||||||
background #eee
|
|
||||||
+m(color-grey)
|
|
||||||
background #e1e1e1
|
|
||||||
border-color #e1e1e1
|
|
||||||
color #666
|
|
||||||
&:hover:not([disabled])
|
|
||||||
border-color #bbb
|
|
||||||
</style>
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { isString, isToday } from "utils/validate";
|
|
||||||
import { timeFormat, useScopedSlot } from "utils";
|
|
||||||
export default {
|
|
||||||
name: "LemonContact",
|
|
||||||
components: {},
|
|
||||||
inject: {
|
|
||||||
IMUI: {
|
|
||||||
from: "IMUI",
|
|
||||||
default() {
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
contact: Object,
|
|
||||||
simple: Boolean,
|
|
||||||
timeFormat: {
|
|
||||||
type: Function,
|
|
||||||
default(val) {
|
|
||||||
return timeFormat(val, isToday(val) ? "h:i" : "y/m/d");
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
class={["lemon-contact", { "lemon-contact--name-center": this.simple }]}
|
|
||||||
title={this.contact.displayName}
|
|
||||||
on-click={e => this._handleClick(e, this.contact)}
|
|
||||||
>
|
|
||||||
{useScopedSlot(
|
|
||||||
this.$scopedSlots.default,
|
|
||||||
this._renderInner(),
|
|
||||||
this.contact,
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
mounted() {},
|
|
||||||
computed: {},
|
|
||||||
watch: {},
|
|
||||||
methods: {
|
|
||||||
_renderInner() {
|
|
||||||
const { contact } = this;
|
|
||||||
return [
|
|
||||||
<lemon-badge
|
|
||||||
count={!this.simple ? contact.unread : 0}
|
|
||||||
class="lemon-contact__avatar"
|
|
||||||
>
|
|
||||||
<lemon-avatar size={40} src={contact.avatar} />
|
|
||||||
</lemon-badge>,
|
|
||||||
<div class="lemon-contact__inner">
|
|
||||||
<p class="lemon-contact__label">
|
|
||||||
<span class="lemon-contact__name">{contact.displayName}</span>
|
|
||||||
{!this.simple && (
|
|
||||||
<span class="lemon-contact__time">
|
|
||||||
{this.timeFormat(contact.lastSendTime)}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
{!this.simple && (
|
|
||||||
<p class="lemon-contact__content">
|
|
||||||
{isString(contact.lastContent) ? (
|
|
||||||
<span domProps={{ innerHTML: contact.lastContent }} />
|
|
||||||
) : (
|
|
||||||
contact.lastContent
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>,
|
|
||||||
];
|
|
||||||
},
|
|
||||||
_handleClick(e, data) {
|
|
||||||
this.$emit("click", data);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-contact)
|
|
||||||
padding 10px 14px
|
|
||||||
cursor pointer
|
|
||||||
user-select none
|
|
||||||
box-sizing border-box
|
|
||||||
overflow hidden
|
|
||||||
background #efefef
|
|
||||||
text-align left
|
|
||||||
p
|
|
||||||
margin 0
|
|
||||||
+m(active)
|
|
||||||
background #bebdbd
|
|
||||||
&:hover:not(.lemon-contact--active)
|
|
||||||
background #e3e3e3
|
|
||||||
.el-badge__content
|
|
||||||
border-color #ddd
|
|
||||||
+e(avatar)
|
|
||||||
float left
|
|
||||||
margin-right 10px
|
|
||||||
img
|
|
||||||
display block
|
|
||||||
.ant-badge-count
|
|
||||||
display inline-block
|
|
||||||
padding 0 4px
|
|
||||||
height 18px
|
|
||||||
line-height 18px
|
|
||||||
min-width 18px
|
|
||||||
top -4px
|
|
||||||
right 7px
|
|
||||||
+e(label)
|
|
||||||
display flex
|
|
||||||
+e(time)
|
|
||||||
font-size 12px
|
|
||||||
line-height 18px
|
|
||||||
padding-left 6px
|
|
||||||
color #999
|
|
||||||
white-space nowrap
|
|
||||||
+e(name)
|
|
||||||
display block
|
|
||||||
width 100%
|
|
||||||
ellipsis()
|
|
||||||
+e(content)
|
|
||||||
font-size 12px
|
|
||||||
color #999
|
|
||||||
height 18px
|
|
||||||
line-height 18px
|
|
||||||
margin-top 1px !important
|
|
||||||
ellipsis()
|
|
||||||
img
|
|
||||||
height 14px
|
|
||||||
display inline-block
|
|
||||||
vertical-align middle
|
|
||||||
margin 0 1px
|
|
||||||
position relative
|
|
||||||
top -1px
|
|
||||||
+m(name-center)
|
|
||||||
+e(label)
|
|
||||||
padding-bottom 0
|
|
||||||
line-height 38px
|
|
||||||
</style>
|
|
||||||
@@ -1,512 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { useScopedSlot, messageToHtml, clearHtmlExcludeImg } from "utils";
|
|
||||||
const command = (command, val) => {
|
|
||||||
document.execCommand(command, false, val);
|
|
||||||
};
|
|
||||||
const selection = window.getSelection();
|
|
||||||
let range;
|
|
||||||
let emojiData = [];
|
|
||||||
let isInitTool = false;
|
|
||||||
export default {
|
|
||||||
name: "LemonEditor",
|
|
||||||
inject: {
|
|
||||||
IMUI: {
|
|
||||||
from: "IMUI",
|
|
||||||
default() {
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
tools: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
sendText: {
|
|
||||||
type: String,
|
|
||||||
default: "发 送",
|
|
||||||
},
|
|
||||||
wrapKey: {
|
|
||||||
type: Function,
|
|
||||||
default: function(e) {
|
|
||||||
return e.keyCode == 13 && e.ctrlKey == false && e.shiftKey == false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sendKey: {
|
|
||||||
type: Function,
|
|
||||||
default(e) {
|
|
||||||
return e.keyCode == 13 && e.ctrlKey === true;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
this.clipboardBlob = null;
|
|
||||||
return {
|
|
||||||
//剪切板图片URL
|
|
||||||
clipboardUrl: "",
|
|
||||||
submitDisabled: true,
|
|
||||||
//proxyTools: [],
|
|
||||||
accept: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.IMUI.$on("change-contact", () => {
|
|
||||||
this.closeClipboardImage();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
const toolLeft = [];
|
|
||||||
const toolRight = [];
|
|
||||||
this.proxyTools.forEach(({ name, title, render, click, isRight }) => {
|
|
||||||
click = click || new Function();
|
|
||||||
const classes = [
|
|
||||||
"lemon-editor__tool-item",
|
|
||||||
{ "lemon-editor__tool-item--right": isRight },
|
|
||||||
];
|
|
||||||
let node;
|
|
||||||
if (name == "emoji") {
|
|
||||||
node =
|
|
||||||
emojiData.length == 0 ? (
|
|
||||||
""
|
|
||||||
) : (
|
|
||||||
<lemon-popover class="lemon-editor__emoji">
|
|
||||||
<template slot="content">{this._renderEmojiTabs()}</template>
|
|
||||||
<div class={classes} title={title}>
|
|
||||||
{render()}
|
|
||||||
</div>
|
|
||||||
</lemon-popover>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
node = (
|
|
||||||
<div class={classes} on-click={click} title={title}>
|
|
||||||
{render()}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (isRight) {
|
|
||||||
toolRight.push(node);
|
|
||||||
} else {
|
|
||||||
toolLeft.push(node);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div class="lemon-editor">
|
|
||||||
{this.clipboardUrl && (
|
|
||||||
<div class="lemon-editor__clipboard-image">
|
|
||||||
<img src={this.clipboardUrl} />
|
|
||||||
<div>
|
|
||||||
<lemon-button
|
|
||||||
style={{ marginRight: "10px" }}
|
|
||||||
on-click={this.closeClipboardImage}
|
|
||||||
color="grey"
|
|
||||||
>
|
|
||||||
取消
|
|
||||||
</lemon-button>
|
|
||||||
<lemon-button on-click={this.sendClipboardImage}>
|
|
||||||
发送图片
|
|
||||||
</lemon-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<input
|
|
||||||
style="display:none"
|
|
||||||
type="file"
|
|
||||||
multiple="multiple"
|
|
||||||
ref="fileInput"
|
|
||||||
accept={this.accept}
|
|
||||||
onChange={this._handleChangeFile}
|
|
||||||
/>
|
|
||||||
<div class="lemon-editor__tool">
|
|
||||||
<div class="lemon-editor__tool-left">{toolLeft}</div>
|
|
||||||
<div class="lemon-editor__tool-right">{toolRight}</div>
|
|
||||||
</div>
|
|
||||||
<div class="lemon-editor__inner">
|
|
||||||
<div
|
|
||||||
class="lemon-editor__input"
|
|
||||||
ref="textarea"
|
|
||||||
contenteditable="true"
|
|
||||||
on-keyup={this._handleKeyup}
|
|
||||||
on-keydown={this._handleKeydown}
|
|
||||||
on-paste={this._handlePaste}
|
|
||||||
on-click={this._handleClick}
|
|
||||||
spellcheck="false"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="lemon-editor__footer">
|
|
||||||
<div class="lemon-editor__tip">
|
|
||||||
{useScopedSlot(
|
|
||||||
this.IMUI.$scopedSlots["editor-footer"],
|
|
||||||
"使用 ctrl + enter 快捷发送消息",
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div class="lemon-editor__submit">
|
|
||||||
<lemon-button
|
|
||||||
disabled={this.submitDisabled}
|
|
||||||
on-click={this._handleSend}
|
|
||||||
>
|
|
||||||
{this.sendText}
|
|
||||||
</lemon-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
proxyTools() {
|
|
||||||
console.log("this.tools", this.tools);
|
|
||||||
if (!this.tools) return [];
|
|
||||||
const defaultTools = [
|
|
||||||
{
|
|
||||||
name: "emoji",
|
|
||||||
title: "表情",
|
|
||||||
click: null,
|
|
||||||
render: menu => {
|
|
||||||
return <i class="lemon-icon-emoji" />;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "uploadFile",
|
|
||||||
title: "文件上传",
|
|
||||||
click: () => this.selectFile("*"),
|
|
||||||
render: menu => {
|
|
||||||
return <i class="lemon-icon-folder" />;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "uploadImage",
|
|
||||||
title: "图片上传",
|
|
||||||
click: () => this.selectFile("image/*"),
|
|
||||||
render: menu => {
|
|
||||||
return <i class="lemon-icon-image" />;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let tools = [];
|
|
||||||
if (Array.isArray(this.tools)) {
|
|
||||||
const indexMap = {
|
|
||||||
emoji: 0,
|
|
||||||
uploadFile: 1,
|
|
||||||
uploadImage: 2,
|
|
||||||
};
|
|
||||||
const indexKeys = Object.keys(indexMap);
|
|
||||||
tools = this.tools.map(item => {
|
|
||||||
if (indexKeys.includes(item.name)) {
|
|
||||||
return {
|
|
||||||
...defaultTools[indexMap[item.name]],
|
|
||||||
...item,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
tools = defaultTools;
|
|
||||||
}
|
|
||||||
return tools;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
closeClipboardImage() {
|
|
||||||
this.clipboardUrl = "";
|
|
||||||
this.clipboardBlob = null;
|
|
||||||
},
|
|
||||||
sendClipboardImage() {
|
|
||||||
if (!this.clipboardBlob) return;
|
|
||||||
this.$emit("upload", this.clipboardBlob);
|
|
||||||
this.closeClipboardImage();
|
|
||||||
},
|
|
||||||
saveRangeToLast() {
|
|
||||||
if (!range) {
|
|
||||||
range = document.createRange();
|
|
||||||
}
|
|
||||||
range.selectNodeContents(textarea.value);
|
|
||||||
range.collapse(false);
|
|
||||||
selection.removeAllRanges();
|
|
||||||
selection.addRange(range);
|
|
||||||
},
|
|
||||||
inertContent(val, toLast = false) {
|
|
||||||
if (toLast) saveRangeToLast();
|
|
||||||
this.focusRange();
|
|
||||||
command("insertHTML", val);
|
|
||||||
this.saveRange();
|
|
||||||
},
|
|
||||||
saveRange() {
|
|
||||||
range = selection.getRangeAt(0);
|
|
||||||
},
|
|
||||||
focusRange() {
|
|
||||||
this.$refs.textarea.focus();
|
|
||||||
if (range) {
|
|
||||||
selection.removeAllRanges();
|
|
||||||
selection.addRange(range);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_handleClick() {
|
|
||||||
this.saveRange();
|
|
||||||
},
|
|
||||||
_renderEmojiTabs() {
|
|
||||||
const renderImageGrid = items => {
|
|
||||||
return items.map(item => (
|
|
||||||
<img
|
|
||||||
src={item.src}
|
|
||||||
title={item.title}
|
|
||||||
class="lemon-editor__emoji-item"
|
|
||||||
on-click={() => this._handleSelectEmoji(item)}
|
|
||||||
/>
|
|
||||||
));
|
|
||||||
};
|
|
||||||
if (emojiData[0].label) {
|
|
||||||
const nodes = emojiData.map((item, index) => {
|
|
||||||
return (
|
|
||||||
<div slot="tab-pane" index={index} tab={item.label}>
|
|
||||||
{renderImageGrid(item.children)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return <lemon-tabs style="width: 412px">{nodes}</lemon-tabs>;
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<div class="lemon-tabs-content" style="width:406px">
|
|
||||||
{renderImageGrid(emojiData)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_handleSelectEmoji(item) {
|
|
||||||
this.inertContent(
|
|
||||||
`<img emoji-name="${item.name}" src="${item.src}"></img>`,
|
|
||||||
);
|
|
||||||
this._checkSubmitDisabled();
|
|
||||||
},
|
|
||||||
async selectFile(accept) {
|
|
||||||
this.accept = accept;
|
|
||||||
await this.$nextTick();
|
|
||||||
this.$refs.fileInput.click();
|
|
||||||
},
|
|
||||||
_handlePaste(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const clipboardData = e.clipboardData || window.clipboardData;
|
|
||||||
const text = clipboardData.getData("Text");
|
|
||||||
if (text) {
|
|
||||||
if (window.clipboardData) {
|
|
||||||
this.$refs.textarea.innerHTML = text;
|
|
||||||
} else {
|
|
||||||
command("insertText", text);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const { blob, blobUrl } = this._getClipboardBlob(clipboardData);
|
|
||||||
this.clipboardBlob = blob;
|
|
||||||
this.clipboardUrl = blobUrl;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_getClipboardBlob(clipboard) {
|
|
||||||
let blob, blobUrl;
|
|
||||||
for (var i = 0; i < clipboard.items.length; ++i) {
|
|
||||||
if (
|
|
||||||
clipboard.items[i].kind == "file" &&
|
|
||||||
clipboard.items[i].type.indexOf("image/") !== -1
|
|
||||||
) {
|
|
||||||
blob = clipboard.items[i].getAsFile();
|
|
||||||
blobUrl = (window.URL || window.webkitURL).createObjectURL(blob);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { blob, blobUrl };
|
|
||||||
},
|
|
||||||
_handleKeyup(e) {
|
|
||||||
this.saveRange();
|
|
||||||
this._checkSubmitDisabled();
|
|
||||||
},
|
|
||||||
_handleKeydown(e) {
|
|
||||||
const ATing = false;
|
|
||||||
if (ATing) {
|
|
||||||
if (e.keyCode == 38 || e.keyCode == 40) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (e.keyCode == 38) {
|
|
||||||
ATSelectedPrev();
|
|
||||||
}
|
|
||||||
if (e.keyCode == 40) {
|
|
||||||
ATSelectedNext();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e.keyCode == 13) {
|
|
||||||
e.preventDefault();
|
|
||||||
ATSelected();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e.keyCode == 37 || e.keyCode == 39) {
|
|
||||||
ATPopupClose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e.keyCode == 13 || (e.keyCode == 13 && e.shiftKey)) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
if (this.wrapKey(e)) {
|
|
||||||
e.preventDefault();
|
|
||||||
command("insertLineBreak");
|
|
||||||
}
|
|
||||||
if (this.at && (e.key == "@" || (e.shiftKey && e.keyCode == 229))) {
|
|
||||||
setTimeout(() => (ATing = true), 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.submitDisabled == false && this.sendKey(e)) {
|
|
||||||
this._handleSend();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getFormatValue() {
|
|
||||||
// return toEmojiName(
|
|
||||||
// this.$refs.textarea.innerHTML
|
|
||||||
// .replace(/<br>|<\/br>/, "")
|
|
||||||
// .replace(/<div>|<p>/g, "\r\n")
|
|
||||||
// .replace(/<\/div>|<\/p>/g, "")
|
|
||||||
// );
|
|
||||||
return this.IMUI.emojiImageToName(this.$refs.textarea.innerHTML);
|
|
||||||
},
|
|
||||||
_checkSubmitDisabled() {
|
|
||||||
this.submitDisabled = !clearHtmlExcludeImg(
|
|
||||||
this.$refs.textarea.innerHTML.trim(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
_handleSend(e) {
|
|
||||||
const text = this.getFormatValue();
|
|
||||||
this.$emit("send", text);
|
|
||||||
this.clear();
|
|
||||||
this._checkSubmitDisabled();
|
|
||||||
},
|
|
||||||
_handleChangeFile(e) {
|
|
||||||
const { fileInput } = this.$refs;
|
|
||||||
Array.from(fileInput.files).forEach(file => {
|
|
||||||
this.$emit("upload", file);
|
|
||||||
});
|
|
||||||
fileInput.value = "";
|
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
this.$refs.textarea.innerHTML = "";
|
|
||||||
},
|
|
||||||
initEmoji(data) {
|
|
||||||
emojiData = data;
|
|
||||||
this.$forceUpdate();
|
|
||||||
},
|
|
||||||
setValue(val) {
|
|
||||||
this.$refs.textarea.innerHTML = this.IMUI.emojiNameToImage(val);
|
|
||||||
this._checkSubmitDisabled();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
gap = 10px;
|
|
||||||
+b(lemon-editor)
|
|
||||||
height 200px
|
|
||||||
position relative
|
|
||||||
flex-column()
|
|
||||||
+e(tool)
|
|
||||||
display flex
|
|
||||||
height 40px
|
|
||||||
align-items center
|
|
||||||
justify-content space-between
|
|
||||||
padding 0 5px
|
|
||||||
+e(tool-left){
|
|
||||||
display flex
|
|
||||||
}
|
|
||||||
+e(tool-right){
|
|
||||||
display flex
|
|
||||||
}
|
|
||||||
+e(tool-item)
|
|
||||||
cursor pointer
|
|
||||||
padding 4px gap
|
|
||||||
height 28px
|
|
||||||
line-height 24px;
|
|
||||||
color #999
|
|
||||||
transition all ease .3s
|
|
||||||
font-size 12px
|
|
||||||
[class^='lemon-icon-']
|
|
||||||
line-height 26px
|
|
||||||
font-size 22px
|
|
||||||
&:hover
|
|
||||||
color #333
|
|
||||||
+m(right){
|
|
||||||
margin-left:auto;
|
|
||||||
}
|
|
||||||
+e(inner)
|
|
||||||
flex 1
|
|
||||||
overflow-x hidden
|
|
||||||
overflow-y auto
|
|
||||||
scrollbar-light()
|
|
||||||
+e(clipboard-image)
|
|
||||||
position absolute
|
|
||||||
top 0
|
|
||||||
left 0
|
|
||||||
width 100%
|
|
||||||
height 100%
|
|
||||||
flex-column()
|
|
||||||
justify-content center
|
|
||||||
align-items center
|
|
||||||
background #f4f4f4
|
|
||||||
z-index 1
|
|
||||||
img
|
|
||||||
max-height 66%
|
|
||||||
max-width 80%
|
|
||||||
background #e9e9e9
|
|
||||||
//box-shadow 0 0 20px rgba(0,0,0,0.15)
|
|
||||||
user-select none
|
|
||||||
cursor pointer
|
|
||||||
border-radius 4px
|
|
||||||
margin-bottom 10px
|
|
||||||
border 3px dashed #ddd !important
|
|
||||||
box-sizing border-box
|
|
||||||
.clipboard-popover-title
|
|
||||||
font-size 14px
|
|
||||||
color #333
|
|
||||||
+e(input)
|
|
||||||
height 100%
|
|
||||||
box-sizing border-box
|
|
||||||
border none
|
|
||||||
outline none
|
|
||||||
padding 0 gap
|
|
||||||
scrollbar-light()
|
|
||||||
p,div
|
|
||||||
margin 0
|
|
||||||
img
|
|
||||||
height 20px
|
|
||||||
padding 0 2px
|
|
||||||
pointer-events none
|
|
||||||
position relative
|
|
||||||
top -1px
|
|
||||||
vertical-align middle
|
|
||||||
+e(footer)
|
|
||||||
display flex
|
|
||||||
height 52px
|
|
||||||
justify-content flex-end
|
|
||||||
padding 0 gap
|
|
||||||
align-items center
|
|
||||||
+e(tip)
|
|
||||||
margin-right 10px
|
|
||||||
font-size 12px
|
|
||||||
color #999
|
|
||||||
user-select none
|
|
||||||
+e(emoji)
|
|
||||||
user-select none
|
|
||||||
.lemon-popover
|
|
||||||
background #f6f6f6
|
|
||||||
.lemon-popover__content
|
|
||||||
padding 0
|
|
||||||
.lemon-popover__arrow
|
|
||||||
background #f6f6f6
|
|
||||||
.lemon-tabs-content
|
|
||||||
box-sizing border-box
|
|
||||||
padding 8px
|
|
||||||
height 200px
|
|
||||||
overflow-x hidden
|
|
||||||
overflow-y auto
|
|
||||||
scrollbar-light()
|
|
||||||
margin-bottom 8px
|
|
||||||
+e(emoji-item)
|
|
||||||
cursor pointer
|
|
||||||
width 22px
|
|
||||||
padding 4px
|
|
||||||
border-radius 4px
|
|
||||||
&:hover
|
|
||||||
background #e9e9e9
|
|
||||||
</style>
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,240 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { useScopedSlot } from "utils";
|
|
||||||
export default {
|
|
||||||
name: "lemonMessageBasic",
|
|
||||||
inject: {
|
|
||||||
IMUI: {
|
|
||||||
from: "IMUI",
|
|
||||||
default() {
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
contextmenu: Array,
|
|
||||||
message: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
timeFormat: {
|
|
||||||
type: Function,
|
|
||||||
default: () => "",
|
|
||||||
},
|
|
||||||
reverse: Boolean,
|
|
||||||
hideName: Boolean,
|
|
||||||
hideTime: Boolean,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
const { fromUser, status, sendTime } = this.message;
|
|
||||||
const hideTitle = this.hideName == true && this.hideTime == true;
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
class={[
|
|
||||||
"lemon-message",
|
|
||||||
`lemon-message--status-${status}`,
|
|
||||||
{
|
|
||||||
"lemon-message--reverse": this.reverse,
|
|
||||||
"lemon-message--hide-title": hideTitle,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<div class="lemon-message__avatar">
|
|
||||||
<lemon-avatar
|
|
||||||
size={36}
|
|
||||||
shape="square"
|
|
||||||
src={fromUser.avatar}
|
|
||||||
on-click={e => {
|
|
||||||
this._emitClick(e, "avatar");
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="lemon-message__inner">
|
|
||||||
<div class="lemon-message__title">
|
|
||||||
{this.hideName == false && (
|
|
||||||
<span
|
|
||||||
on-click={e => {
|
|
||||||
this._emitClick(e, "displayName");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{fromUser.displayName}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{this.hideTime == false && (
|
|
||||||
<span
|
|
||||||
class="lemon-message__time"
|
|
||||||
on-click={e => {
|
|
||||||
this._emitClick(e, "sendTime");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{this.timeFormat(sendTime)}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div class="lemon-message__content-flex">
|
|
||||||
<div
|
|
||||||
v-lemon-contextmenu_message={this.IMUI.contextmenu}
|
|
||||||
class="lemon-message__content"
|
|
||||||
on-click={e => {
|
|
||||||
this._emitClick(e, "content");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{useScopedSlot(this.$scopedSlots["content"], null, this.message)}
|
|
||||||
</div>
|
|
||||||
<div class="lemon-message__content-after">
|
|
||||||
{useScopedSlot(
|
|
||||||
this.IMUI.$scopedSlots["message-after"],
|
|
||||||
null,
|
|
||||||
this.message,
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="lemon-message__status"
|
|
||||||
on-click={e => {
|
|
||||||
this._emitClick(e, "status");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<i class="lemon-icon-loading lemonani-spin" />
|
|
||||||
<i
|
|
||||||
class="lemon-icon-prompt"
|
|
||||||
title="重发消息"
|
|
||||||
style={{
|
|
||||||
color: "#ff2525",
|
|
||||||
cursor: "pointer",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
mounted() {},
|
|
||||||
computed: {},
|
|
||||||
watch: {},
|
|
||||||
methods: {
|
|
||||||
_emitClick(e, key) {
|
|
||||||
this.IMUI.$emit("message-click", e, key, this.message, this.IMUI);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
arrow()
|
|
||||||
content ' '
|
|
||||||
position absolute
|
|
||||||
top 6px
|
|
||||||
width 0
|
|
||||||
height 0
|
|
||||||
border 4px solid transparent
|
|
||||||
+b(lemon-message)
|
|
||||||
display flex
|
|
||||||
padding 10px 0
|
|
||||||
+e(time)
|
|
||||||
color #b9b9b9
|
|
||||||
padding 0 5px
|
|
||||||
+e(inner)
|
|
||||||
position relative
|
|
||||||
+e(avatar)
|
|
||||||
padding-right 10px
|
|
||||||
user-select none
|
|
||||||
.lemon-avatar
|
|
||||||
cursor pointer
|
|
||||||
+e(title)
|
|
||||||
display flex
|
|
||||||
font-size 12px
|
|
||||||
line-height 16px
|
|
||||||
height 16px
|
|
||||||
padding-bottom 4px
|
|
||||||
user-select none
|
|
||||||
color #666
|
|
||||||
+e(content-flex)
|
|
||||||
display flex
|
|
||||||
+e(content)
|
|
||||||
font-size 14px
|
|
||||||
line-height 20px
|
|
||||||
padding 8px 10px
|
|
||||||
background #fff
|
|
||||||
border-radius 4px
|
|
||||||
position relative
|
|
||||||
margin 0
|
|
||||||
img
|
|
||||||
video
|
|
||||||
background #e9e9e9
|
|
||||||
height 100px
|
|
||||||
&:before
|
|
||||||
arrow()
|
|
||||||
left -4px
|
|
||||||
border-left none
|
|
||||||
border-right-color #fff
|
|
||||||
+e(content-after)
|
|
||||||
display block
|
|
||||||
width 48px
|
|
||||||
height 36px
|
|
||||||
padding-left 6px
|
|
||||||
flex none
|
|
||||||
font-size 12px
|
|
||||||
color #aaa
|
|
||||||
overflow hidden
|
|
||||||
visibility hidden
|
|
||||||
+e(status)
|
|
||||||
position absolute
|
|
||||||
top 23px
|
|
||||||
right 20px
|
|
||||||
color #aaa
|
|
||||||
font-size 20px
|
|
||||||
.lemon-icon-loading
|
|
||||||
.lemon-icon-prompt
|
|
||||||
display none
|
|
||||||
+m(status-going)
|
|
||||||
.lemon-icon-loading
|
|
||||||
display inline-block
|
|
||||||
+m(status-failed)
|
|
||||||
.lemon-icon-prompt
|
|
||||||
display inline-block
|
|
||||||
+m(status-succeed)
|
|
||||||
+e(content-after)
|
|
||||||
visibility visible
|
|
||||||
+m(reverse)
|
|
||||||
flex-direction row-reverse
|
|
||||||
+e(content-flex)
|
|
||||||
flex-direction row-reverse
|
|
||||||
+e(content-after)
|
|
||||||
padding-right 6px
|
|
||||||
padding-left 0
|
|
||||||
text-align right
|
|
||||||
+e(title)
|
|
||||||
flex-direction row-reverse
|
|
||||||
+e(status)
|
|
||||||
left 26px
|
|
||||||
right auto
|
|
||||||
+e(content)
|
|
||||||
background #35d863
|
|
||||||
&:before
|
|
||||||
arrow()
|
|
||||||
left auto
|
|
||||||
right -4px
|
|
||||||
border-right none
|
|
||||||
border-left-color #35d863
|
|
||||||
+e(title)
|
|
||||||
text-align right
|
|
||||||
+e(avatar)
|
|
||||||
padding-right 0
|
|
||||||
padding-left 10px
|
|
||||||
+m(hide-title)
|
|
||||||
+e(avatar)
|
|
||||||
padding-top 10px
|
|
||||||
+e(status)
|
|
||||||
top 14px
|
|
||||||
+e(content)
|
|
||||||
position relative
|
|
||||||
top -10px
|
|
||||||
&:before
|
|
||||||
top 14px
|
|
||||||
</style>
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "lemonMessageEvent",
|
|
||||||
inheritAttrs: false,
|
|
||||||
inject: ["IMUI"],
|
|
||||||
render() {
|
|
||||||
const { content } = this.$attrs.message;
|
|
||||||
return (
|
|
||||||
<div class="lemon-message lemon-message-event">
|
|
||||||
<span
|
|
||||||
class="lemon-message-event__content"
|
|
||||||
on-click={e => this._emitClick(e, "content")}
|
|
||||||
>
|
|
||||||
{content}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_emitClick(e, key) {
|
|
||||||
this.IMUI.$emit("message-click", e, key, this.$attrs.message, this.IMUI);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-message-event)
|
|
||||||
+e(content)
|
|
||||||
user-select none
|
|
||||||
display inline-block
|
|
||||||
background #e9e9e9
|
|
||||||
color #aaa
|
|
||||||
font-size 12px
|
|
||||||
margin 0 auto
|
|
||||||
padding 5px 10px
|
|
||||||
border-radius 4px
|
|
||||||
</style>
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { formatByte } from "utils";
|
|
||||||
export default {
|
|
||||||
name: "lemonMessageFile",
|
|
||||||
inheritAttrs: false,
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<lemon-message-basic
|
|
||||||
class="lemon-message-file"
|
|
||||||
props={{ ...this.$attrs }}
|
|
||||||
scopedSlots={{
|
|
||||||
content: props => [
|
|
||||||
<div class="lemon-message-file__inner">
|
|
||||||
<p class="lemon-message-file__name">{props.fileName}</p>
|
|
||||||
<p class="lemon-message-file__byte">
|
|
||||||
{formatByte(props.fileSize)}
|
|
||||||
</p>
|
|
||||||
</div>,
|
|
||||||
<div class="lemon-message-file__sfx">
|
|
||||||
<i class="lemon-icon-attah" />
|
|
||||||
</div>
|
|
||||||
]
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-message-file)
|
|
||||||
+b(lemon-message)
|
|
||||||
+e(content)
|
|
||||||
display flex
|
|
||||||
cursor pointer
|
|
||||||
width 200px
|
|
||||||
background #fff
|
|
||||||
padding 12px 18px
|
|
||||||
overflow hidden
|
|
||||||
p
|
|
||||||
margin 0
|
|
||||||
+e(tip)
|
|
||||||
display none
|
|
||||||
+e(inner)
|
|
||||||
flex 1
|
|
||||||
+e(name)
|
|
||||||
font-size 14px
|
|
||||||
+e(byte)
|
|
||||||
font-size 12px
|
|
||||||
color #aaa
|
|
||||||
+e(sfx)
|
|
||||||
display flex
|
|
||||||
align-items center
|
|
||||||
justify-content center
|
|
||||||
font-weight bold
|
|
||||||
user-select none
|
|
||||||
font-size 34px
|
|
||||||
color #ccc
|
|
||||||
</style>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "lemonMessageImage",
|
|
||||||
inheritAttrs: false,
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<lemon-message-basic
|
|
||||||
class="lemon-message-image"
|
|
||||||
props={{ ...this.$attrs }}
|
|
||||||
scopedSlots={{
|
|
||||||
content: props => <img src={props.content} />
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-message-image)
|
|
||||||
+b(lemon-message)
|
|
||||||
+e(content)
|
|
||||||
padding 0
|
|
||||||
cursor pointer
|
|
||||||
overflow hidden
|
|
||||||
img
|
|
||||||
max-width 100%
|
|
||||||
min-width 100px
|
|
||||||
display block
|
|
||||||
</style>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "lemonMessageText",
|
|
||||||
inheritAttrs: false,
|
|
||||||
inject: ["IMUI"],
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<lemon-message-basic
|
|
||||||
class="lemon-message-text"
|
|
||||||
props={{ ...this.$attrs }}
|
|
||||||
scopedSlots={{
|
|
||||||
content: props => {
|
|
||||||
const content = this.IMUI.emojiNameToImage(props.content);
|
|
||||||
return <span domProps={{ innerHTML: content }} />;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-message-text)
|
|
||||||
+b(lemon-message)
|
|
||||||
+e(content)
|
|
||||||
img
|
|
||||||
width 18px
|
|
||||||
height 18px
|
|
||||||
display inline-block
|
|
||||||
background transparent
|
|
||||||
position relative
|
|
||||||
top -1px
|
|
||||||
padding 0 2px
|
|
||||||
vertical-align middle
|
|
||||||
</style>
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { hoursTimeFormat } from "utils";
|
|
||||||
import { isString } from "utils/validate";
|
|
||||||
import contextmenu from "../directives/contextmenu";
|
|
||||||
export default {
|
|
||||||
name: "LemonMessages",
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
//是否隐藏消息发送人昵称
|
|
||||||
hideName: Boolean,
|
|
||||||
//是否隐藏显示消息时间
|
|
||||||
hideTime: Boolean,
|
|
||||||
reverseUserId: [String, Number],
|
|
||||||
timeRange: {
|
|
||||||
type: Number,
|
|
||||||
default: 1,
|
|
||||||
},
|
|
||||||
timeFormat: {
|
|
||||||
type: Function,
|
|
||||||
default(val) {
|
|
||||||
return hoursTimeFormat(val);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
loadingText: {
|
|
||||||
type: [String, Function],
|
|
||||||
},
|
|
||||||
loadendText: {
|
|
||||||
type: [String, Function],
|
|
||||||
default: "暂无更多消息",
|
|
||||||
},
|
|
||||||
messages: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
this._lockScroll = false;
|
|
||||||
return {
|
|
||||||
_loading: false,
|
|
||||||
_loadend: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div class="lemon-messages" ref="wrap" on-scroll={this._handleScroll}>
|
|
||||||
<div
|
|
||||||
class={[
|
|
||||||
"lemon-messages__load",
|
|
||||||
`lemon-messages__load--${this._loadend ? "end" : "ing"}`,
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<span class="lemon-messages__loadend">
|
|
||||||
{isString(this.loadendText) ? this.loadendText : this.loadendText()}
|
|
||||||
</span>
|
|
||||||
<span class="lemon-messages__loading">
|
|
||||||
{this.loadingText ? (
|
|
||||||
isString(this.loadingText) ? (
|
|
||||||
this.loadingText
|
|
||||||
) : (
|
|
||||||
this.loadingText()
|
|
||||||
)
|
|
||||||
) : (
|
|
||||||
<i class="lemon-icon-loading lemonani-spin" />
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{this.messages.map((message, index) => {
|
|
||||||
const node = [];
|
|
||||||
const tagName = `lemon-message-${message.type}`;
|
|
||||||
const prev = this.messages[index - 1];
|
|
||||||
if (
|
|
||||||
prev &&
|
|
||||||
this.msecRange &&
|
|
||||||
message.sendTime - prev.sendTime > this.msecRange
|
|
||||||
) {
|
|
||||||
node.push(
|
|
||||||
<lemon-message-event
|
|
||||||
attrs={{
|
|
||||||
message: {
|
|
||||||
id: "__time__",
|
|
||||||
type: "event",
|
|
||||||
content: hoursTimeFormat(message.sendTime),
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let attrs;
|
|
||||||
if (message.type == "event") {
|
|
||||||
attrs = { message: message };
|
|
||||||
} else {
|
|
||||||
attrs = {
|
|
||||||
timeFormat: this.timeFormat,
|
|
||||||
message: message,
|
|
||||||
reverse: this.reverseUserId == message.fromUser.id,
|
|
||||||
hideTime: this.hideTime,
|
|
||||||
hideName: this.hideName,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
node.push(<tagName ref="message" refInFor={true} attrs={attrs} />);
|
|
||||||
return node;
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
msecRange() {
|
|
||||||
return this.timeRange * 1000 * 60;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
methods: {
|
|
||||||
loaded() {
|
|
||||||
this._loadend = true;
|
|
||||||
this.$forceUpdate();
|
|
||||||
},
|
|
||||||
resetLoadState() {
|
|
||||||
this._lockScroll = true;
|
|
||||||
this._loading = false;
|
|
||||||
this._loadend = false;
|
|
||||||
setTimeout(() => {
|
|
||||||
this._lockScroll = false;
|
|
||||||
}, 200);
|
|
||||||
},
|
|
||||||
async _handleScroll(e) {
|
|
||||||
if (this._lockScroll) return;
|
|
||||||
const { target } = e;
|
|
||||||
contextmenu.hide();
|
|
||||||
if (
|
|
||||||
target.scrollTop == 0 &&
|
|
||||||
this._loading == false &&
|
|
||||||
this._loadend == false
|
|
||||||
) {
|
|
||||||
this._loading = true;
|
|
||||||
await this.$nextTick();
|
|
||||||
const hst = target.scrollHeight;
|
|
||||||
|
|
||||||
this.$emit("reach-top", async isEnd => {
|
|
||||||
await this.$nextTick();
|
|
||||||
target.scrollTop = target.scrollHeight - hst;
|
|
||||||
this._loading = false;
|
|
||||||
this._loadend = !!isEnd;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async scrollToBottom() {
|
|
||||||
await this.$nextTick();
|
|
||||||
const { wrap } = this.$refs;
|
|
||||||
if (wrap) {
|
|
||||||
wrap.scrollTop = wrap.scrollHeight;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
mounted() {},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-messages)
|
|
||||||
height 400px
|
|
||||||
overflow-x hidden
|
|
||||||
overflow-y auto
|
|
||||||
scrollbar-light()
|
|
||||||
padding 10px 15px
|
|
||||||
+e(time)
|
|
||||||
text-align center
|
|
||||||
font-size 12px
|
|
||||||
+e(load)
|
|
||||||
user-select none
|
|
||||||
font-size 12px
|
|
||||||
text-align center
|
|
||||||
color #999
|
|
||||||
line-height 30px
|
|
||||||
.lemon-messages__loading
|
|
||||||
.lemon-messages__loadend
|
|
||||||
display none
|
|
||||||
+m(ing)
|
|
||||||
.lemon-icon-loading
|
|
||||||
font-size 22px
|
|
||||||
.lemon-messages__loading
|
|
||||||
display block
|
|
||||||
+m(end)
|
|
||||||
.lemon-messages__loadend
|
|
||||||
display block
|
|
||||||
</style>
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
<script>
|
|
||||||
const popoverCloseQueue = [];
|
|
||||||
import contextmenu from "../directives/contextmenu";
|
|
||||||
const triggerEvents = {
|
|
||||||
hover(el) {},
|
|
||||||
focus(el) {
|
|
||||||
el.addEventListener("focus", e => {
|
|
||||||
this.changeVisible();
|
|
||||||
});
|
|
||||||
el.addEventListener("blur", e => {
|
|
||||||
this.changeVisible();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
click(el) {
|
|
||||||
el.addEventListener("click", e => {
|
|
||||||
e.stopPropagation();
|
|
||||||
contextmenu.hide();
|
|
||||||
this.changeVisible();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
contextmenu(el) {
|
|
||||||
el.addEventListener("contextmenu", e => {
|
|
||||||
e.preventDefault();
|
|
||||||
this.changeVisible();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export default {
|
|
||||||
name: "LemonPopover",
|
|
||||||
props: {
|
|
||||||
trigger: {
|
|
||||||
type: String,
|
|
||||||
default: "click",
|
|
||||||
validator(val) {
|
|
||||||
return Object.keys(triggerEvents).includes(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
popoverStyle: {},
|
|
||||||
visible: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
document.addEventListener("click", this._documentClickEvent);
|
|
||||||
popoverCloseQueue.push(this.close);
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
triggerEvents[this.trigger].call(this, this.$slots.default[0].elm);
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<span style="position:relative">
|
|
||||||
<transition name="lemon-slide-top">
|
|
||||||
{this.visible && (
|
|
||||||
<div
|
|
||||||
class="lemon-popover"
|
|
||||||
ref="popover"
|
|
||||||
style={this.popoverStyle}
|
|
||||||
on-click={e => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<div class="lemon-popover__content">{this.$slots.content}</div>
|
|
||||||
<div class="lemon-popover__arrow" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</transition>
|
|
||||||
{this.$slots.default}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
document.removeEventListener("click", this._documentClickEvent);
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
watch: {
|
|
||||||
async visible(val) {
|
|
||||||
if (val) {
|
|
||||||
await this.$nextTick();
|
|
||||||
const defaultEl = this.$slots.default[0].elm;
|
|
||||||
const contentEl = this.$refs.popover;
|
|
||||||
|
|
||||||
this.popoverStyle = {
|
|
||||||
top: `-${contentEl.offsetHeight + 10}px`,
|
|
||||||
left: `${defaultEl.offsetWidth / 2 - contentEl.offsetWidth / 2}px`
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_documentClickEvent(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
if (this.visible) this.close();
|
|
||||||
},
|
|
||||||
changeVisible() {
|
|
||||||
this.visible ? this.close() : this.open();
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.closeAll();
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
closeAll() {
|
|
||||||
popoverCloseQueue.forEach(callback => callback());
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
+b(lemon-popover)
|
|
||||||
border 1px solid #eee
|
|
||||||
border-radius 4px
|
|
||||||
font-size 14px
|
|
||||||
font-variant tabular-nums
|
|
||||||
line-height 1.5
|
|
||||||
color rgba(0, 0, 0, 0.65)
|
|
||||||
z-index 10
|
|
||||||
background-color #fff
|
|
||||||
border-radius 4px
|
|
||||||
box-shadow 0 2px 8px rgba(0, 0, 0, 0.08)
|
|
||||||
position absolute
|
|
||||||
transform-origin 50% 150%
|
|
||||||
+e(content)
|
|
||||||
padding 15px
|
|
||||||
box-sizing border-box
|
|
||||||
position relative
|
|
||||||
z-index 1
|
|
||||||
+e(arrow)
|
|
||||||
left 50%
|
|
||||||
transform translateX(-50%) rotate(45deg)
|
|
||||||
position absolute
|
|
||||||
z-index 0
|
|
||||||
bottom -4px
|
|
||||||
box-shadow 3px 3px 7px rgba(0, 0, 0, 0.07)
|
|
||||||
width 8px
|
|
||||||
height 8px
|
|
||||||
background #fff
|
|
||||||
.lemon-slide-top-leave-active ,.lemon-slide-top-enter-active
|
|
||||||
transition all .2s cubic-bezier(0.645, 0.045, 0.355, 1)
|
|
||||||
.lemon-slide-top-enter, .lemon-slide-top-leave-to
|
|
||||||
transform translateY(-10px) scale(.8)
|
|
||||||
opacity 0
|
|
||||||
</style>
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "LemonTabs",
|
|
||||||
props: {
|
|
||||||
activeIndex: String
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
active: this.activeIndex
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (!this.active) {
|
|
||||||
this.active = this.$slots["tab-pane"][0].data.attrs.index;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
const pane = [];
|
|
||||||
const nav = [];
|
|
||||||
this.$slots["tab-pane"].map(vnode => {
|
|
||||||
const { tab, index } = vnode.data.attrs;
|
|
||||||
pane.push(
|
|
||||||
<div class="lemon-tabs-content__pane" v-show={this.active == index}>
|
|
||||||
{vnode}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
nav.push(
|
|
||||||
<div
|
|
||||||
class={[
|
|
||||||
"lemon-tabs-nav__item",
|
|
||||||
this.active == index && "lemon-tabs-nav__item--active"
|
|
||||||
]}
|
|
||||||
on-click={() => this._handleNavClick(index)}
|
|
||||||
>
|
|
||||||
{tab}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return (
|
|
||||||
<div class="lemon-tabs">
|
|
||||||
<div class="lemon-tabs-content">{pane}</div>
|
|
||||||
<div class="lemon-tabs-nav">{nav}</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_handleNavClick(index) {
|
|
||||||
this.active = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="stylus">
|
|
||||||
@import '~styles/utils/index'
|
|
||||||
pane-color = #f6f6f6
|
|
||||||
+b(lemon-tabs)
|
|
||||||
background pane-color
|
|
||||||
+b(lemon-tabs-content)
|
|
||||||
width 100%
|
|
||||||
height 100%
|
|
||||||
padding 15px
|
|
||||||
+e(pane)
|
|
||||||
//scrollbar-light()
|
|
||||||
//overflow-y auto
|
|
||||||
height 100%
|
|
||||||
width 100%
|
|
||||||
+b(lemon-tabs-nav)
|
|
||||||
display flex
|
|
||||||
background #eee
|
|
||||||
+e(item)
|
|
||||||
line-height 38px
|
|
||||||
padding 0 15px
|
|
||||||
cursor pointer
|
|
||||||
transition all .3s cubic-bezier(0.645, 0.045, 0.355, 1)
|
|
||||||
+m(active)
|
|
||||||
background pane-color
|
|
||||||
</style>
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
// import Vue from "vue";
|
|
||||||
import { isFunction, isEmpty } from "utils/validate";
|
|
||||||
import LemonPopover from "../components/popover.vue";
|
|
||||||
let popover;
|
|
||||||
|
|
||||||
const hidePopover = () => {
|
|
||||||
if (popover) popover.style.display = "none";
|
|
||||||
};
|
|
||||||
const showPopover = () => {
|
|
||||||
if (popover) popover.style.display = "block";
|
|
||||||
};
|
|
||||||
document.addEventListener("click", e => {
|
|
||||||
hidePopover();
|
|
||||||
});
|
|
||||||
export default {
|
|
||||||
hide: hidePopover,
|
|
||||||
bind(el, binding, vnode) {
|
|
||||||
el.addEventListener(
|
|
||||||
binding.modifiers.click ? "click" : "contextmenu",
|
|
||||||
e => {
|
|
||||||
if (isEmpty(binding.value) || !Array.isArray(binding.value)) return;
|
|
||||||
if (binding.modifiers.click) e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
LemonPopover.methods.closeAll();
|
|
||||||
let component;
|
|
||||||
let visibleItems = [];
|
|
||||||
if (binding.modifiers.message) component = vnode.context;
|
|
||||||
else if (binding.modifiers.contact) component = vnode.child;
|
|
||||||
if (!popover) {
|
|
||||||
popover = document.createElement("div");
|
|
||||||
popover.className = "lemon-contextmenu";
|
|
||||||
document.body.appendChild(popover);
|
|
||||||
}
|
|
||||||
popover.innerHTML = binding.value
|
|
||||||
.map(item => {
|
|
||||||
let visible;
|
|
||||||
if (isFunction(item.visible)) {
|
|
||||||
visible = item.visible(component);
|
|
||||||
} else {
|
|
||||||
visible = item.visible === undefined ? true : item.visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (visible) {
|
|
||||||
visibleItems.push(item);
|
|
||||||
const icon = item.icon
|
|
||||||
? `<i class="lemon-contextmenu__icon ${item.icon}"></i>`
|
|
||||||
: "";
|
|
||||||
return `<div style="color:${item.color}" title="${
|
|
||||||
item.text
|
|
||||||
}" class="lemon-contextmenu__item">${icon}<span>${
|
|
||||||
item.text
|
|
||||||
}</span></div>`;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
})
|
|
||||||
.join("");
|
|
||||||
popover.style.top = `${e.pageY}px`;
|
|
||||||
popover.style.left = `${e.pageX}px`;
|
|
||||||
|
|
||||||
popover.childNodes.forEach((node, index) => {
|
|
||||||
const { click, render } = visibleItems[index];
|
|
||||||
node.addEventListener("click", e => {
|
|
||||||
e.stopPropagation();
|
|
||||||
if (isFunction(click)) click(e, component, hidePopover);
|
|
||||||
});
|
|
||||||
|
|
||||||
// if (isFunction(render)) {
|
|
||||||
// const ins = Vue.extend({
|
|
||||||
// render: h => {
|
|
||||||
// return render(h, component, hidePopover);
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// const renderComponent = new ins().$mount();
|
|
||||||
// node.querySelector("span").innerHTML =
|
|
||||||
// renderComponent.$el.outerHTML;
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
|
|
||||||
showPopover();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import Contextmenu from "./directives/contextmenu";
|
|
||||||
import LemonTabs from "./components/tabs";
|
|
||||||
import LemonPopover from "./components/popover";
|
|
||||||
import LemonButton from "./components/button";
|
|
||||||
import LemonBadge from "./components/badge";
|
|
||||||
import LemonAvatar from "./components/avatar";
|
|
||||||
import LemonContact from "./components/contact";
|
|
||||||
import LemonEditor from "./components/editor";
|
|
||||||
import LemonMessages from "./components/messages";
|
|
||||||
import LemonMessageBasic from "./components/message/basic";
|
|
||||||
import LemonMessageText from "./components/message/text";
|
|
||||||
import lemonMessageImage from "./components/message/image";
|
|
||||||
import lemonMessageFile from "./components/message/file";
|
|
||||||
import lemonMessageEvent from "./components/message/event";
|
|
||||||
|
|
||||||
import LemonIMUI from "./components/index";
|
|
||||||
import "./styles/common/index.styl";
|
|
||||||
const version = "1.4.2";
|
|
||||||
const components = [
|
|
||||||
LemonIMUI,
|
|
||||||
LemonContact,
|
|
||||||
LemonMessages,
|
|
||||||
LemonEditor,
|
|
||||||
LemonAvatar,
|
|
||||||
LemonBadge,
|
|
||||||
LemonButton,
|
|
||||||
LemonPopover,
|
|
||||||
LemonTabs,
|
|
||||||
LemonMessageBasic,
|
|
||||||
LemonMessageText,
|
|
||||||
lemonMessageImage,
|
|
||||||
lemonMessageFile,
|
|
||||||
lemonMessageEvent
|
|
||||||
];
|
|
||||||
const install = (Vue) => {
|
|
||||||
Vue.directive("LemonContextmenu", Contextmenu);
|
|
||||||
components.forEach(component => {
|
|
||||||
Vue.component(component.name, component);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
if (typeof window !== "undefined" && window.Vue) {
|
|
||||||
install(window.Vue);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
version,
|
|
||||||
install
|
|
||||||
};
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import {clearHtml } from 'utils';
|
|
||||||
export default {
|
|
||||||
file(message) {
|
|
||||||
return "[文件]";
|
|
||||||
},
|
|
||||||
image(message) {
|
|
||||||
return "[图片]";
|
|
||||||
},
|
|
||||||
text(message) {
|
|
||||||
return this.emojiNameToImage(clearHtml(message.content));
|
|
||||||
},
|
|
||||||
event(message){
|
|
||||||
return '[通知]';
|
|
||||||
},
|
|
||||||
};
|
|
||||||
Vendored
-13
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
.lemonani-spin
|
|
||||||
display inline-block
|
|
||||||
animation lemonani-spin 1s infinite
|
|
||||||
@keyframes lemonani-spin{
|
|
||||||
0%{
|
|
||||||
transform rotate(0deg)
|
|
||||||
}
|
|
||||||
100%{
|
|
||||||
transform rotate(360deg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
// @font-face {
|
|
||||||
// font-family: 'lemon-icons';
|
|
||||||
// src: url('//at.alicdn.com/t/font_1312162_neqltsj20an.eot');
|
|
||||||
// src: url('//at.alicdn.com/t/font_1312162_neqltsj20an.eot?#iefix') format('embedded-opentype'),
|
|
||||||
// url('//at.alicdn.com/t/font_1312162_neqltsj20an.woff2') format('woff2'),
|
|
||||||
// url('//at.alicdn.com/t/font_1312162_neqltsj20an.woff') format('woff'),
|
|
||||||
// url('//at.alicdn.com/t/font_1312162_neqltsj20an.ttf') format('truetype'),
|
|
||||||
// url('//at.alicdn.com/t/font_1312162_neqltsj20an.svg#iconfont') format('svg');
|
|
||||||
// }
|
|
||||||
@font-face {
|
|
||||||
font-family: 'lemon-icons';
|
|
||||||
src:url('../fonts/icon.woff') format('woff');
|
|
||||||
}
|
|
||||||
[class^='lemon-icon-'],
|
|
||||||
[class*=' lemon-icon-']
|
|
||||||
font-family lemon-icons !important
|
|
||||||
speak none
|
|
||||||
font-style normal
|
|
||||||
font-weight 400
|
|
||||||
font-variant normal
|
|
||||||
text-transform none
|
|
||||||
line-height 1
|
|
||||||
vertical-align baseline
|
|
||||||
display inline-block
|
|
||||||
|
|
||||||
.lemon-icon-loading:before
|
|
||||||
content '\e633'
|
|
||||||
.lemon-icon-prompt:before
|
|
||||||
content '\e71b'
|
|
||||||
.lemon-icon-message:before
|
|
||||||
content '\e84a'
|
|
||||||
.lemon-icon-emoji:before
|
|
||||||
content '\e6f6'
|
|
||||||
.lemon-icon-attah:before
|
|
||||||
content '\e7e1'
|
|
||||||
.lemon-icon-image:before
|
|
||||||
content '\e7de'
|
|
||||||
.lemon-icon-folder:before
|
|
||||||
content '\e7d1'
|
|
||||||
.lemon-icon-people:before
|
|
||||||
content '\e715'
|
|
||||||
.lemon-icon-group:before
|
|
||||||
content '\e6ff'
|
|
||||||
.lemon-icon-addressbook:before
|
|
||||||
content '\e6e2'
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
//@import './normalize';
|
|
||||||
@import './animate';
|
|
||||||
@import './icons';
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
html
|
|
||||||
-webkit-tap-highlight-color transparent
|
|
||||||
body
|
|
||||||
margin 0
|
|
||||||
a
|
|
||||||
text-decoration none
|
|
||||||
a
|
|
||||||
input
|
|
||||||
button
|
|
||||||
textarea
|
|
||||||
&:focus
|
|
||||||
outline none
|
|
||||||
ol
|
|
||||||
ul
|
|
||||||
margin 0
|
|
||||||
padding 0
|
|
||||||
list-style none
|
|
||||||
input
|
|
||||||
button
|
|
||||||
textarea
|
|
||||||
font inherit
|
|
||||||
color inherit
|
|
||||||
|
|
||||||
Binary file not shown.
@@ -1,67 +0,0 @@
|
|||||||
// -----------------------------------------------------------------------------
|
|
||||||
// bem-sugar.styl --- Bem mixins for stylus language
|
|
||||||
//
|
|
||||||
// Copyright (c) 2017 Ilya Obuhov
|
|
||||||
//
|
|
||||||
// Author: Ilya Obuhov <iobuhov.mail@gmail.com>
|
|
||||||
// URL: https://github.com/iobuhov/stylus-bem-sugar
|
|
||||||
|
|
||||||
|
|
||||||
e-prefix ?= '__'
|
|
||||||
m-prefix ?= '--'
|
|
||||||
m-delimiter ?= '_'
|
|
||||||
group-store = ()
|
|
||||||
|
|
||||||
str()
|
|
||||||
join('', arguments)
|
|
||||||
|
|
||||||
b(name)
|
|
||||||
.{name}
|
|
||||||
{block}
|
|
||||||
|
|
||||||
group()
|
|
||||||
caller = called-from[0]
|
|
||||||
level = length(called-from) + 1
|
|
||||||
elements = group-store[level]
|
|
||||||
selector = ()
|
|
||||||
parent = null
|
|
||||||
{join(',', elements)}
|
|
||||||
{block}
|
|
||||||
group-store[level] = null
|
|
||||||
|
|
||||||
m(mod, val=null)
|
|
||||||
val = val && m-delimiter + val
|
|
||||||
mod = m-prefix + mod
|
|
||||||
mod = val ? mod + val : mod
|
|
||||||
caller = called-from[0]
|
|
||||||
if caller in ('group')
|
|
||||||
level = length(called-from)
|
|
||||||
mod = str('&', mod)
|
|
||||||
if group-store[level] == null
|
|
||||||
group-store[level] = mod
|
|
||||||
else
|
|
||||||
push(group-store[level], mod)
|
|
||||||
&{mod}
|
|
||||||
{block}
|
|
||||||
|
|
||||||
e(element)
|
|
||||||
element = e-prefix + element
|
|
||||||
caller = called-from[0]
|
|
||||||
gcaller = called-from[1]
|
|
||||||
if caller in ('group')
|
|
||||||
level = length(called-from)
|
|
||||||
if gcaller in ('e' 'm')
|
|
||||||
element = str('& ^[0]', element)
|
|
||||||
else
|
|
||||||
element = str('^[0]', element)
|
|
||||||
if group-store[level] == null
|
|
||||||
group-store[level] = element
|
|
||||||
else
|
|
||||||
push(group-store[level], element)
|
|
||||||
else
|
|
||||||
if caller in ('e' 'm')
|
|
||||||
& ^[0]{element}
|
|
||||||
{block}
|
|
||||||
else
|
|
||||||
&{element}
|
|
||||||
{block}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
flex-column()
|
|
||||||
display flex
|
|
||||||
flex-direction column
|
|
||||||
|
|
||||||
scrollbar-theme($color=#1f252d, $background=#6d6d6d)
|
|
||||||
&::-webkit-scrollbar
|
|
||||||
width 5px
|
|
||||||
height 5px
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-track-piece
|
|
||||||
background-color $background
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb:vertical
|
|
||||||
height 5px
|
|
||||||
background-color $color
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb:horizontal
|
|
||||||
width 5px
|
|
||||||
background-color $background
|
|
||||||
|
|
||||||
scrollbar-dark()
|
|
||||||
scrollbar-theme()
|
|
||||||
|
|
||||||
scrollbar-light()
|
|
||||||
scrollbar-theme(#aaa, transparent)
|
|
||||||
|
|
||||||
|
|
||||||
vertical-center()
|
|
||||||
&::after
|
|
||||||
display inline-block
|
|
||||||
content ''
|
|
||||||
height 100%
|
|
||||||
vertical-align middle
|
|
||||||
|
|
||||||
position-center($type fixed)
|
|
||||||
position $type
|
|
||||||
top 50%
|
|
||||||
left 50%
|
|
||||||
transform translate(-50%, -50%)
|
|
||||||
ellipsis()
|
|
||||||
text-overflow ellipsis
|
|
||||||
overflow hidden
|
|
||||||
white-space nowrap
|
|
||||||
word-break()
|
|
||||||
word-break break-all
|
|
||||||
word-wrap break-word
|
|
||||||
white-space pre-wrap
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
@import './functional';
|
|
||||||
@import './bem';
|
|
||||||
@import './var';
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
//color-primary #2977fa
|
|
||||||
color-primary = #1bc213
|
|
||||||
color-light = #fff
|
|
||||||
/* 头像 */
|
|
||||||
avatar-size = 45px
|
|
||||||
avatar-radius = 50%
|
|
||||||
|
|
||||||
/** 标题 */
|
|
||||||
title-background = color-primary
|
|
||||||
title-color = color-light
|
|
||||||
title-height = 44px
|
|
||||||
/* 气泡 */
|
|
||||||
bubble-background = color-primary
|
|
||||||
bubble-color = color-light
|
|
||||||
bubble-radius = 12px
|
|
||||||
|
|
||||||
bubble-self-background = #e7ebef
|
|
||||||
bubble-self-color = #606d84
|
|
||||||
|
|
||||||
/* 输入框 */
|
|
||||||
editor-textarea-height = 40px
|
|
||||||
editor-textarea-radius = 5px
|
|
||||||
|
|
||||||
editor-submit-disable-color = #bcbcbc
|
|
||||||
editor-submit-disable-background = #ebebeb
|
|
||||||
editor-submit-radius = editor-textarea-radius
|
|
||||||
Vendored
-24
@@ -1,24 +0,0 @@
|
|||||||
export default class MemoryCache {
|
|
||||||
constructor() {
|
|
||||||
this.table = {};
|
|
||||||
}
|
|
||||||
get(key) {
|
|
||||||
return key ? this.table[key] : this.table;
|
|
||||||
}
|
|
||||||
set(key, val) {
|
|
||||||
this.table[key] = val;
|
|
||||||
}
|
|
||||||
// setOnly(key, val) {
|
|
||||||
// if (!this.has(key)) this.set(key, val);
|
|
||||||
// }
|
|
||||||
remove(key) {
|
|
||||||
if (key) {
|
|
||||||
delete this.table[key];
|
|
||||||
} else {
|
|
||||||
this.table = {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
has(key) {
|
|
||||||
return !!this.table[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
export const EMIT_AVATAR_CLICK = "avatar-click";
|
|
||||||
|
|
||||||
export const DEFAULT_MENU_LASTMESSAGES = "messages";
|
|
||||||
export const DEFAULT_MENU_CONTACTS = "contacts";
|
|
||||||
export const DEFAULT_MENUS = [DEFAULT_MENU_LASTMESSAGES, DEFAULT_MENU_CONTACTS];
|
|
||||||
/**
|
|
||||||
* 聊天消息类型
|
|
||||||
*/
|
|
||||||
export const MESSAGE_TYPE = ["voice", "file", "video", "image", "text"];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 聊天消息状态
|
|
||||||
*/
|
|
||||||
export const MESSAGE_STATUS = ["going", "succeed", "failed"];
|
|
||||||
|
|
||||||
export const CONTACT_TYPE = ["many", "single"];
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
import { isPlainObject, isFunction } from "utils/validate";
|
|
||||||
export function messageToHtml() {}
|
|
||||||
export function messageToText() {}
|
|
||||||
/**
|
|
||||||
* 使用某个组件上的作用域插槽
|
|
||||||
* @param {VueComponent} inject
|
|
||||||
* @param {String} slotName
|
|
||||||
* @param {Node} defaultElement
|
|
||||||
* @param {Object} props
|
|
||||||
*/
|
|
||||||
export function useScopedSlot(slot, def, props) {
|
|
||||||
return slot ? slot(props) : def;
|
|
||||||
}
|
|
||||||
export function padZero(val) {
|
|
||||||
return val < 10 ? `0${val}` : val;
|
|
||||||
}
|
|
||||||
export function hoursTimeFormat(t) {
|
|
||||||
const date = new Date(t);
|
|
||||||
const nowDate = new Date();
|
|
||||||
const Y = t => {
|
|
||||||
return t.getFullYear();
|
|
||||||
};
|
|
||||||
const MD = t => {
|
|
||||||
return `${t.getMonth() + 1}-${t.getDate()}`;
|
|
||||||
};
|
|
||||||
const dateY = Y(date);
|
|
||||||
const nowDateY = Y(nowDate);
|
|
||||||
|
|
||||||
let format;
|
|
||||||
if (dateY !== nowDateY) {
|
|
||||||
format = "y年m月d日 h:i";
|
|
||||||
} else if (`${dateY}-${MD(date)}` === `${nowDateY}-${MD(nowDate)}`) {
|
|
||||||
format = "h:i";
|
|
||||||
} else {
|
|
||||||
format = "m月d日 h:i";
|
|
||||||
}
|
|
||||||
return timeFormat(t, format);
|
|
||||||
}
|
|
||||||
export function timeFormat(t, format) {
|
|
||||||
if (!format) format = "y-m-d h:i:s";
|
|
||||||
if (t) t = new Date(t);
|
|
||||||
else t = new Date();
|
|
||||||
const formatArr = [
|
|
||||||
t.getFullYear().toString(),
|
|
||||||
padZero((t.getMonth() + 1).toString()),
|
|
||||||
padZero(t.getDate().toString()),
|
|
||||||
padZero(t.getHours().toString()),
|
|
||||||
padZero(t.getMinutes().toString()),
|
|
||||||
padZero(t.getSeconds().toString()),
|
|
||||||
];
|
|
||||||
const reg = "ymdhis";
|
|
||||||
for (let i = 0; i < formatArr.length; i++) {
|
|
||||||
format = format.replace(reg.charAt(i), formatArr[i]);
|
|
||||||
}
|
|
||||||
return format;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function funCall(event, callback) {
|
|
||||||
if (isFunction(event)) {
|
|
||||||
event(() => {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取数组相交的值组成新数组
|
|
||||||
* @param {Array} a
|
|
||||||
* @param {Array} b
|
|
||||||
*/
|
|
||||||
export function arrayIntersect(a, b) {
|
|
||||||
return a.filter(x => b.includes(x));
|
|
||||||
}
|
|
||||||
//清除字符串内的所有HTML标签
|
|
||||||
export function clearHtml(str) {
|
|
||||||
return str.replace(/<.*?>/gi, "");
|
|
||||||
}
|
|
||||||
//清除字符串内的所有HTML标签,除了IMG
|
|
||||||
export function clearHtmlExcludeImg(str) {
|
|
||||||
return str.replace(/<(?!img).*?>/gi, "");
|
|
||||||
}
|
|
||||||
export function error(text) {
|
|
||||||
throw new Error(text);
|
|
||||||
}
|
|
||||||
export function cloneDeep(obj) {
|
|
||||||
const newobj = { ...obj };
|
|
||||||
for (const key in newobj) {
|
|
||||||
const val = newobj[key];
|
|
||||||
if (isPlainObject(val)) {
|
|
||||||
newobj[key] = cloneDeep(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newobj;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function mergeDeep(o1, o2) {
|
|
||||||
for (const key in o2) {
|
|
||||||
if (isPlainObject(o1[key])) {
|
|
||||||
o1[key] = mergeDeep(o1[key], o2[key]);
|
|
||||||
} else {
|
|
||||||
o1[key] = o2[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return o1;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function formatByte(value) {
|
|
||||||
if (null == value || value == "") {
|
|
||||||
return "0 Bytes";
|
|
||||||
}
|
|
||||||
var unitArr = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
||||||
var index = 0;
|
|
||||||
var srcsize = parseFloat(value);
|
|
||||||
index = Math.floor(Math.log(srcsize) / Math.log(1024));
|
|
||||||
var size = srcsize / Math.pow(1024, index);
|
|
||||||
size = parseFloat(size.toFixed(2));
|
|
||||||
return size + unitArr[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function generateUUID() {
|
|
||||||
var d = new Date().getTime();
|
|
||||||
if (window.performance && typeof window.performance.now === "function") {
|
|
||||||
d += performance.now(); //use high-precision timer if available
|
|
||||||
}
|
|
||||||
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
|
||||||
c,
|
|
||||||
) {
|
|
||||||
var r = (d + Math.random() * 16) % 16 | 0;
|
|
||||||
d = Math.floor(d / 16);
|
|
||||||
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
||||||
});
|
|
||||||
return uuid;
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
export function isPlainObject(obj) {
|
|
||||||
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
||||||
}
|
|
||||||
export function isString(str) {
|
|
||||||
return typeof str == "string";
|
|
||||||
}
|
|
||||||
export function isToday(time) {
|
|
||||||
return new Date().getTime() - time < 86400000;
|
|
||||||
}
|
|
||||||
export function isEmpty(obj) {
|
|
||||||
if (!obj) return true;
|
|
||||||
if (Array.isArray(obj) && obj.length == 0) return true;
|
|
||||||
if (isPlainObject(obj) && Object.values(obj).length == 0) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
export function isUrl(str) {
|
|
||||||
const reg =
|
|
||||||
"^((https|http|ftp|rtsp|mms)?://)" +
|
|
||||||
"?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" + //ftp的user@
|
|
||||||
"(([0-9]{1,3}.){3}[0-9]{1,3}" + // IP形式的URL- 199.194.52.184
|
|
||||||
"|" + // 允许IP和DOMAIN(域名)
|
|
||||||
"([0-9a-z_!~*'()-]+.)*" + // 域名- www.
|
|
||||||
"([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]." + // 二级域名
|
|
||||||
"[a-z]{2,6})" + // first level domain- .com or .museum
|
|
||||||
"(:[0-9]{1,4})?" + // 端口- :80
|
|
||||||
"((/?)|" + // 如果没有文件名,则不需要斜杠
|
|
||||||
"(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
|
|
||||||
return new RegExp(reg).test(str) ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isFunction(val) {
|
|
||||||
return val && typeof val === "function";
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isEng(val) {
|
|
||||||
return /^[A-Za-z]+$/.test(val);
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
plugins: {
|
|
||||||
autoprefixer: {}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
printWidth: 80, // 每行代码长度(默认80)
|
|
||||||
tabWidth: 2, // 每个tab相当于多少个空格(默认2)
|
|
||||||
useTabs: false, // 是否使用tab进行缩进(默认false)
|
|
||||||
singleQuote: false, // 使用单引号(默认false)
|
|
||||||
semi: true, // 声明结尾使用分号(默认true)
|
|
||||||
trailingComma: 'all', // 多行使用拖尾逗号(默认none)
|
|
||||||
bracketSpacing: true, // 对象字面量的大括号间使用空格(默认true)
|
|
||||||
jsxBracketSameLine: false, // 多行JSX中的>放置在最后一行的结尾,而不是另起一行(默认false)
|
|
||||||
arrowParens: 'avoid', // 只有一个参数的箭头函数的参数是否带圆括号(默认avoid)
|
|
||||||
};
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,23 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<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,maximum-scale=1.0, user-scalable=no"
|
|
||||||
/>
|
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
|
||||||
<title>Lemon IMUI</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong
|
|
||||||
>We're sorry but flat-im 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>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
const path = require("path");
|
|
||||||
function resolve(dir) {
|
|
||||||
return path.join(__dirname, "", dir);
|
|
||||||
}
|
|
||||||
module.exports = {
|
|
||||||
pages: {
|
|
||||||
index: {
|
|
||||||
entry: "examples/main.js",
|
|
||||||
template: "public/index.html",
|
|
||||||
filename: "index.html"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
publicPath:'',
|
|
||||||
productionSourceMap:false,
|
|
||||||
configureWebpack: {
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
components: resolve("packages/components"),
|
|
||||||
mixins: resolve("packages/mixins"),
|
|
||||||
styles: resolve("packages/styles"),
|
|
||||||
utils: resolve("packages/utils")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in new issue
Block a user