Compare commits
5 Commits
view-ui-pl
...
scrollbar
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dfb189985 | ||
|
|
19cef5bb67 | ||
|
|
2d4dd7f63d | ||
|
|
946343e429 | ||
|
|
aacb2b71fd |
@@ -4,3 +4,5 @@ VUE_APP_BASE_NAME = production
|
|||||||
VUE_APP_BASE_URL = https://flagnote.com
|
VUE_APP_BASE_URL = https://flagnote.com
|
||||||
VUE_APP_NOTE_MAX_COUNT = 131072
|
VUE_APP_NOTE_MAX_COUNT = 131072
|
||||||
VUE_APP_NOTE_MAX_DESC = 128K
|
VUE_APP_NOTE_MAX_DESC = 128K
|
||||||
|
VUE_APP_CDN_PROVIDER = jsdelivr
|
||||||
|
# VUE_APP_CDN_PROVIDER = unpkg
|
||||||
@@ -2,6 +2,14 @@ module.exports = {
|
|||||||
presets: [
|
presets: [
|
||||||
'@vue/cli-plugin-babel/preset',
|
'@vue/cli-plugin-babel/preset',
|
||||||
],
|
],
|
||||||
plugins: [
|
"plugins": [
|
||||||
],
|
[
|
||||||
|
"import",
|
||||||
|
{
|
||||||
|
"libraryName": "view-ui-plus",
|
||||||
|
"libraryDirectory": "src/components"
|
||||||
|
},
|
||||||
|
"view-ui-plus"
|
||||||
|
]
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
</title>
|
</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #dddddd
|
background-color: #dddddd;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
|
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
|
||||||
@@ -32,9 +33,6 @@
|
|||||||
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
|
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
|
||||||
<link rel="stylesheet" type="text/css" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
|
<link rel="stylesheet" type="text/css" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
|
||||||
<% } %>
|
<% } %>
|
||||||
<script>
|
|
||||||
window.wasm_flate_bg_path = "https://cdn.jsdelivr.net/npm/wasm-flate@1.0.2-browser/wasm_flate_bg.wasm"
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body><noscript><strong>Please enable JavaScript to continue.</strong></noscript>
|
<body><noscript><strong>Please enable JavaScript to continue.</strong></noscript>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -54,7 +52,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.noteHeaderShade {
|
.noteHeaderShade {
|
||||||
background: linear-gradient(to top,rgba(255,255,255,0.7),rgba(255,255,255,1));
|
background-color: white;
|
||||||
width:100%;
|
width:100%;
|
||||||
height:40px;
|
height:40px;
|
||||||
border-bottom: dashed #ed4014 1px;
|
border-bottom: dashed #ed4014 1px;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { getStoreKey } from "@/api/lock";
|
|||||||
import storage from "@/libs/storage";
|
import storage from "@/libs/storage";
|
||||||
import { md5, wrap} from "@/libs/secret";
|
import { md5, wrap} from "@/libs/secret";
|
||||||
import NoteConstant from "@/libs/constants";
|
import NoteConstant from "@/libs/constants";
|
||||||
|
import { setStoreText } from "@/libs/noteStorage";
|
||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
|
|
||||||
axios.interceptors.response.use(undefined, (err) => {
|
axios.interceptors.response.use(undefined, (err) => {
|
||||||
@@ -18,7 +19,9 @@ axios.interceptors.response.use(undefined, (err) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export function saveNote(noteForm, secret) {
|
export function saveNote(noteForm,state, secret) {
|
||||||
|
setStoreText(noteForm, state, secret);
|
||||||
|
|
||||||
let storeKey = secret.storeKey;
|
let storeKey = secret.storeKey;
|
||||||
|
|
||||||
let storeInfo = storage.local.getText(storeKey);
|
let storeInfo = storage.local.getText(storeKey);
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import pako from "pako";
|
import pako from "pako";
|
||||||
import {Buffer} from "buffer";
|
import { Buffer } from "buffer";
|
||||||
//import {gzip_encode_raw,gzip_decode_raw} from 'wasm-flate';
|
|
||||||
|
|
||||||
const wasmFlate = window.wasm_bindgen;
|
|
||||||
|
|
||||||
CryptoJS.enc.Uint8Array = {
|
CryptoJS.enc.Uint8Array = {
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +44,7 @@ CryptoJS.enc.Uint8Array = {
|
|||||||
|
|
||||||
export function wrap(text, secretKey) {
|
export function wrap(text, secretKey) {
|
||||||
text = "FLAGNOTE#" + text;
|
text = "FLAGNOTE#" + text;
|
||||||
let ui8ary = noteZip(text);
|
let ui8ary = noteZip(text);
|
||||||
let result = aesEncrypt(convertUint8ArrayToWordArray(ui8ary), secretKey);
|
let result = aesEncrypt(convertUint8ArrayToWordArray(ui8ary), secretKey);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -96,7 +93,7 @@ export function base64Encode(text) {
|
|||||||
|
|
||||||
//base64 decode atob
|
//base64 decode atob
|
||||||
export function base64Decode(text) {
|
export function base64Decode(text) {
|
||||||
return Buffer.from(text,'base64').toString('utf-8');
|
return Buffer.from(text, 'base64').toString('utf-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function noteUnzip(wdary) {
|
export function noteUnzip(wdary) {
|
||||||
@@ -112,29 +109,21 @@ export function noteZip(text) {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function zip(data){
|
export function zip(data) {
|
||||||
if(wasmFlate.__wbindgen_wasm_module){
|
|
||||||
return wasmFlate.gzip_encode_raw(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pako.gzip(data);
|
return pako.gzip(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unzip(data){
|
export function unzip(data) {
|
||||||
if(wasmFlate.__wbindgen_wasm_module){
|
|
||||||
return wasmFlate.gzip_decode_raw(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pako.ungzip(data);
|
return pako.ungzip(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function convertBase64ToHexString(base64) {
|
export function convertBase64ToHexString(base64) {
|
||||||
return CryptoJS.enc.Hex.stringify(CryptoJS.enc.Base64.parse(base64));
|
return CryptoJS.enc.Hex.stringify(CryptoJS.enc.Base64.parse(base64));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function convertHexStringToBase64(hexString) {
|
export function convertHexStringToBase64(hexString) {
|
||||||
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(hexString));
|
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(hexString));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function convertHexStringToUint8Array(hexString) {
|
export function convertHexStringToUint8Array(hexString) {
|
||||||
|
|||||||
29
src/main.js
29
src/main.js
@@ -1,5 +1,5 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import ViewUIPlus from 'view-ui-plus'
|
// import ViewUIPlus from 'view-ui-plus'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
@@ -7,6 +7,9 @@ import VueAxios from 'vue-axios'
|
|||||||
import i18n from './i18n/'
|
import i18n from './i18n/'
|
||||||
import NoteConstant from "@/libs/constants"
|
import NoteConstant from "@/libs/constants"
|
||||||
|
|
||||||
|
import {Layout,Header,Row,Col,Modal,Button,ButtonGroup,Card,Content,Input,Form,WordCount,Footer,Badge,Icon,Tag} from 'view-ui-plus';
|
||||||
|
//import 'view-ui-plus/dist/styles/viewuiplus.css';
|
||||||
|
|
||||||
axios.defaults.baseURL = NoteConstant.servicePath;
|
axios.defaults.baseURL = NoteConstant.servicePath;
|
||||||
const debugFlag = process.env.NODE_ENV !== 'production';
|
const debugFlag = process.env.NODE_ENV !== 'production';
|
||||||
|
|
||||||
@@ -16,14 +19,26 @@ app.config.debug = debugFlag;
|
|||||||
app.config.devtools = debugFlag;
|
app.config.devtools = debugFlag;
|
||||||
app.config.productionTip = debugFlag;
|
app.config.productionTip = debugFlag;
|
||||||
|
|
||||||
|
app.component('Layout', Layout);
|
||||||
|
app.component('Header', Header);
|
||||||
|
app.component('Row', Row);
|
||||||
|
app.component('Col', Col);
|
||||||
|
app.component('Modal', Modal);
|
||||||
|
app.component('Button', Button);
|
||||||
|
app.component('ButtonGroup', ButtonGroup);
|
||||||
|
app.component('Card', Card);
|
||||||
|
app.component('Content', Content);
|
||||||
|
app.component('Input', Input);
|
||||||
|
app.component('Form', Form);
|
||||||
|
app.component('WordCount', WordCount);
|
||||||
|
app.component('Footer', Footer);
|
||||||
|
app.component('Badge', Badge);
|
||||||
|
app.component('Icon', Icon);
|
||||||
|
app.component('Tag', Tag);
|
||||||
|
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
.use(i18n)
|
.use(i18n)
|
||||||
.use(VueAxios, axios)
|
.use(VueAxios, axios)
|
||||||
.use(ViewUIPlus, {
|
|
||||||
i18n: i18n,
|
|
||||||
transfer: true,
|
|
||||||
size: 'large',
|
|
||||||
capture: false,
|
|
||||||
})
|
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
|
|
||||||
|
|||||||
@@ -75,12 +75,11 @@
|
|||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|
||||||
<Header class="header">
|
<div style="position:fixed;z-index:10;width:100%">
|
||||||
<Row>
|
<Header class="header">
|
||||||
<Col :xs="{ span: 24, offset: 0 }" :sm="{ span: 22, offset: 1 }" :md="{ span: 20, offset: 2 }"
|
<Row>
|
||||||
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
<Col :xs="{ span: 24, offset: 0 }" :sm="{ span: 22, offset: 1 }" :md="{ span: 20, offset: 2 }"
|
||||||
|
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
||||||
<Affix :offset-top="0">
|
|
||||||
<div :class="[showHeaderShade ? 'noteHeaderShade' : 'noteHeader']">
|
<div :class="[showHeaderShade ? 'noteHeaderShade' : 'noteHeader']">
|
||||||
|
|
||||||
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/logo.png"
|
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/logo.png"
|
||||||
@@ -124,13 +123,22 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</Affix>
|
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Header>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Content class="content">
|
||||||
</Col>
|
<div>
|
||||||
</Row>
|
<Row>
|
||||||
</Header>
|
<Col :xs="{ span: 24, offset: 0 }" :sm="{ span: 22, offset: 1 }" :md="{ span: 20, offset: 2 }"
|
||||||
|
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
||||||
|
<div class="noteHeader" style="height:40px;border-left: 2px solid #ed4014;"></div>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
</Content>
|
||||||
|
|
||||||
<Content class="content">
|
<Content class="content">
|
||||||
<div style="min-height: 650px;">
|
<div style="min-height: 650px;">
|
||||||
@@ -158,7 +166,7 @@
|
|||||||
<Footer class="layout-footer-center">2023 © flagnote.com</Footer>
|
<Footer class="layout-footer-center">2023 © flagnote.com</Footer>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
<Modal v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
<Modal scrollable v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
||||||
<p style="text-align: center;font-size:medium ;margin-bottom: 20px;">
|
<p style="text-align: center;font-size:medium ;margin-bottom: 20px;">
|
||||||
{{ $t("message.askTodelete") }}
|
{{ $t("message.askTodelete") }}
|
||||||
</p>
|
</p>
|
||||||
@@ -169,7 +177,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal v-model="model.showError" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
<Modal scrollable v-model="model.showError" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
||||||
<p style="text-align: center;font-size:medium ;margin-bottom: 20px;">
|
<p style="text-align: center;font-size:medium ;margin-bottom: 20px;">
|
||||||
{{ errorInfo }}
|
{{ errorInfo }}
|
||||||
</p>
|
</p>
|
||||||
@@ -195,6 +203,7 @@ import { isWeixin } from "@/libs/utils";
|
|||||||
import NoteConstant from "@/libs/constants";
|
import NoteConstant from "@/libs/constants";
|
||||||
import html2canvas from "html2canvas";
|
import html2canvas from "html2canvas";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EditNote',
|
name: 'EditNote',
|
||||||
props: {},
|
props: {},
|
||||||
@@ -298,24 +307,11 @@ export default {
|
|||||||
this.bindCtrlAllEvent();
|
this.bindCtrlAllEvent();
|
||||||
this.bindToTopEvent();
|
this.bindToTopEvent();
|
||||||
|
|
||||||
window.wasm_bindgen(window.wasm_flate_bg_path);
|
if(window.wasm_flate_bg_path){
|
||||||
|
window.wasm_bindgen(window.wasm_flate_bg_path);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const myObserver = new ResizeObserver(entries => {
|
|
||||||
// iterate over the entries, do something.
|
|
||||||
entries.forEach(entry => {
|
|
||||||
let affix = document.querySelector('.ivu-affix');
|
|
||||||
if (affix) {
|
|
||||||
affix.setAttribute("style", "top: 0px; width: " + (entry.contentRect.width + 2) + "px;");
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const someOtherEl = document.querySelector('#wrapper');
|
|
||||||
|
|
||||||
myObserver.observe(someOtherEl);
|
|
||||||
|
|
||||||
window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
@@ -450,7 +446,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
return saveNote(this.noteForm, this.secret);
|
return saveNote(this.noteForm,this.state,this.secret);
|
||||||
},
|
},
|
||||||
validateForm() {
|
validateForm() {
|
||||||
let text = this.noteForm.text;
|
let text = this.noteForm.text;
|
||||||
@@ -602,7 +598,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeunloadHandler() {
|
beforeunloadHandler() {
|
||||||
if(this.state.deleted==0){
|
if (this.state.deleted == 0) {
|
||||||
setStoreText(this.noteForm, this.state, this.secret);
|
setStoreText(this.noteForm, this.state, this.secret);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -162,12 +162,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<Layout>
|
<Layout>
|
||||||
|
<div style="position:fixed;z-index:10;width:100%">
|
||||||
|
<Header class="header">
|
||||||
|
<Row>
|
||||||
|
<Col :xs="{ span: 24, offset: 0 }" :sm="{ span: 22, offset: 1 }" :md="{ span: 20, offset: 2 }"
|
||||||
|
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
||||||
|
|
||||||
<Header class="header">
|
|
||||||
<Row>
|
|
||||||
<Col :xs="{ span: 24, offset: 0 }" :sm="{ span: 22, offset: 1 }" :md="{ span: 20, offset: 2 }"
|
|
||||||
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
|
||||||
<Affix :offset-top="0">
|
|
||||||
<div :class="[showHeaderShade ? 'noteHeaderShade' : 'noteHeader']">
|
<div :class="[showHeaderShade ? 'noteHeaderShade' : 'noteHeader']">
|
||||||
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/logo.png"
|
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/logo.png"
|
||||||
v-on:click="refreshPage()">
|
v-on:click="refreshPage()">
|
||||||
@@ -219,9 +219,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
<Button type="error" icon="md-refresh" style="border-radius: 0px;font-size: 24px;"
|
<Button type="error" icon="md-refresh" style="border-radius: 0px;font-size: 24px;"
|
||||||
@click="refreshPage()"></Button>
|
@click="refreshPage()"></Button>
|
||||||
-->
|
-->
|
||||||
<Button aria-label="crop" v-show="model.showDownloadText" type="error" icon="md-crop"
|
<Button aria-label="crop" v-show="model.showDownloadText" type="error" icon="md-crop"
|
||||||
style="border-radius: 0px;font-size: 24px;" @click="saveImage(); switchMenu();"></Button>
|
style="border-radius: 0px;font-size: 24px;" @click="saveImage(); switchMenu();"></Button>
|
||||||
|
|
||||||
@@ -235,13 +235,25 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</Affix>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Col>
|
|
||||||
</Row>
|
</Col>
|
||||||
</Header>
|
</Row>
|
||||||
|
</Header>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Content class="content">
|
||||||
|
<div>
|
||||||
|
<Row>
|
||||||
|
<Col :xs="{ span: 24, offset: 0 }" :sm="{ span: 22, offset: 1 }" :md="{ span: 20, offset: 2 }"
|
||||||
|
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
||||||
|
<div class="noteHeader" style="height:40px;border-left: 2px solid white;"></div>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
</Content>
|
||||||
|
|
||||||
<Content class="content">
|
<Content class="content">
|
||||||
<div style="min-height: 650px;">
|
<div style="min-height: 650px;">
|
||||||
@@ -250,32 +262,8 @@
|
|||||||
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
|
||||||
<Card :padding="0">
|
<Card :padding="0">
|
||||||
<div ref="html2canvas" id="wrapper" style="border-left: 2px solid white;">
|
<div ref="html2canvas" id="wrapper" style="border-left: 2px solid white;">
|
||||||
<Skeleton :loading="showSkeleton">
|
|
||||||
<template #template>
|
|
||||||
<div style=" padding: 10px; width: 100%; height: 800px;text-align: left;" >
|
|
||||||
<SkeletonItem />
|
|
||||||
<SkeletonItem block width="80%" height="16px" />
|
|
||||||
<SkeletonItem width="80%" height="16px" class="ivu-mr" />
|
|
||||||
<SkeletonItem width="68%" height="16px" class="ivu-mr" />
|
|
||||||
<SkeletonItem width="38%" height="16px" />
|
|
||||||
<SkeletonItem width="88%" height="16px" />
|
|
||||||
<SkeletonItem block width="80%" height="16px" />
|
|
||||||
<SkeletonItem width="80%" height="16px" class="ivu-mr" />
|
|
||||||
<SkeletonItem width="68%" height="16px" class="ivu-mr" />
|
|
||||||
<SkeletonItem width="38%" height="16px" />
|
|
||||||
<SkeletonItem width="88%" height="16px" />
|
|
||||||
<SkeletonItem block width="80%" height="16px" />
|
|
||||||
<SkeletonItem width="80%" height="16px" class="ivu-mr" />
|
|
||||||
<SkeletonItem width="68%" height="16px" class="ivu-mr" />
|
|
||||||
<SkeletonItem width="38%" height="16px" />
|
|
||||||
<SkeletonItem width="88%" height="16px" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<Input element-id="noteText" readonly type="textarea" :border="false" v-model="noteForm.text"
|
<Input element-id="noteText" readonly type="textarea" :border="false" v-model="noteForm.text"
|
||||||
:autosize="{ minRows: 35 }" />
|
:autosize="{ minRows: 35 }" />
|
||||||
</template>
|
|
||||||
</Skeleton>
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
@@ -290,7 +278,7 @@
|
|||||||
|
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
<Modal v-model="model.showShare" width="360" footer-hide class-name="qrmodal" :styles="{ borderRadius: 0 }"
|
<Modal scrollable v-model="model.showShare" width="360" footer-hide class-name="qrmodal" :styles="{ borderRadius: 0 }"
|
||||||
@on-cancel="closeShareModel">
|
@on-cancel="closeShareModel">
|
||||||
<p style="text-align: center; z-index: 1000; position: absolute; top: -2px; left: 0px; width: 100%;">
|
<p style="text-align: center; z-index: 1000; position: absolute; top: -2px; left: 0px; width: 100%;">
|
||||||
<Tag style="border-radius: 0px;" v-show="model.copyTip" color="#ed4014" text="">Url Copied.</Tag>
|
<Tag style="border-radius: 0px;" v-show="model.copyTip" color="#ed4014" text="">Url Copied.</Tag>
|
||||||
@@ -310,7 +298,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal v-model="model.showTtlDelete" width="360" footer-hide class-name="qrmodal" :styles="{ borderRadius: 0 }">
|
<Modal scrollable v-model="model.showTtlDelete" width="360" footer-hide class-name="qrmodal" :styles="{ borderRadius: 0 }">
|
||||||
<p style="text-align: center;font-size:medium ;margin-top:20px;">
|
<p style="text-align: center;font-size:medium ;margin-top:20px;">
|
||||||
{{ $t("content.deleteTip") }}{{ state.ttlDesc }}
|
{{ $t("content.deleteTip") }}{{ state.ttlDesc }}
|
||||||
</p>
|
</p>
|
||||||
@@ -322,7 +310,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
<Modal scrollable v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
||||||
<p style="text-align: center;font-size:medium;margin-bottom: 20px;">
|
<p style="text-align: center;font-size:medium;margin-bottom: 20px;">
|
||||||
{{ $t("message.askTodelete") }}
|
{{ $t("message.askTodelete") }}
|
||||||
</p>
|
</p>
|
||||||
@@ -333,7 +321,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal v-model="model.showError" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
<Modal scrollable v-model="model.showError" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
|
||||||
<p style="text-align: center;font-size:medium ;margin-bottom: 20px;">
|
<p style="text-align: center;font-size:medium ;margin-bottom: 20px;">
|
||||||
{{ errorInfo }}
|
{{ errorInfo }}
|
||||||
</p>
|
</p>
|
||||||
@@ -452,21 +440,6 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
const myObserver = new ResizeObserver(entries => {
|
|
||||||
// iterate over the entries, do something.
|
|
||||||
entries.forEach(entry => {
|
|
||||||
let affix = document.querySelector('.ivu-affix');
|
|
||||||
if (affix) {
|
|
||||||
affix.setAttribute("style", "top: 0px; width: " + (entry.contentRect.width + 2) + "px;");
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const someOtherEl = document.querySelector('#wrapper');
|
|
||||||
myObserver.observe(someOtherEl);
|
|
||||||
|
|
||||||
let qrimg = document.getElementById("qrImg");
|
let qrimg = document.getElementById("qrImg");
|
||||||
let qrurl = "https://flagnote.com/" + this.noteForm.key;
|
let qrurl = "https://flagnote.com/" + this.noteForm.key;
|
||||||
var opts = {
|
var opts = {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const assetsCDN = {
|
|||||||
"crypto-js": "CryptoJS",
|
"crypto-js": "CryptoJS",
|
||||||
'pako': 'pako',
|
'pako': 'pako',
|
||||||
"html2canvas": "html2canvas",
|
"html2canvas": "html2canvas",
|
||||||
'view-ui-plus':'ViewUIPlus',
|
// 'view-ui-plus':'ViewUIPlus',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 通过cdn方式使用
|
// 通过cdn方式使用
|
||||||
@@ -22,9 +22,8 @@ const assetsCDN = {
|
|||||||
'https://cdn.jsdelivr.net/npm/vue-router@4.1.6/dist/vue-router.global.min.js',
|
'https://cdn.jsdelivr.net/npm/vue-router@4.1.6/dist/vue-router.global.min.js',
|
||||||
'https://cdn.jsdelivr.net/npm/crypto-js@4.1.1/crypto-js.min.js',
|
'https://cdn.jsdelivr.net/npm/crypto-js@4.1.1/crypto-js.min.js',
|
||||||
'https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako.min.js',
|
'https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako.min.js',
|
||||||
'https://cdn.jsdelivr.net/npm/view-ui-plus@1.3.10/dist/viewuiplus.min.js',
|
// 'https://cdn.jsdelivr.net/npm/view-ui-plus@1.3.10/dist/viewuiplus.min.js',
|
||||||
|
|
||||||
'https://cdn.jsdelivr.net/npm/wasm-flate@1.0.2-browser/wasm_flate.min.js',
|
|
||||||
'https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js',
|
'https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js',
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -44,28 +43,6 @@ const config = {
|
|||||||
|
|
||||||
config.externals = assetsCDN.externals;
|
config.externals = assetsCDN.externals;
|
||||||
|
|
||||||
// const assetsCDN = {
|
|
||||||
// // 放置需要使用 cdn 的库
|
|
||||||
// externals: {
|
|
||||||
// 'vue': 'Vue',
|
|
||||||
// 'vue-router': 'VueRouter',
|
|
||||||
// "crypto-js": "CryptoJS",
|
|
||||||
// 'pako': 'pako',
|
|
||||||
// "html2canvas": "html2canvas",
|
|
||||||
// 'view-ui-plus':'ViewUIPlus',
|
|
||||||
// },
|
|
||||||
// css: [
|
|
||||||
// // 存放 引用 css文件的地址
|
|
||||||
// '//unpkg.com/element-plus@1.0.2-beta.48/lib/theme-chalk/index.css',
|
|
||||||
// ],
|
|
||||||
// js: [
|
|
||||||
// // 存放 引用 js 文件的地址
|
|
||||||
// '//unpkg.com/vue@3.1.1/dist/vue.global.js',
|
|
||||||
// '//unpkg.com/element-plus@1.0.2-beta.48/lib/index.full.js'
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// 为生产环境修改配置
|
// 为生产环境修改配置
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
@@ -86,7 +63,7 @@ const config = {
|
|||||||
|
|
||||||
new CompressionPlugin({
|
new CompressionPlugin({
|
||||||
algorithm: "gzip", // 使用gzip压缩
|
algorithm: "gzip", // 使用gzip压缩
|
||||||
test: /\.js$|\.html$|\.png$|\.jpg$|\.svg$|\.wasm$|\.css$/, // 匹配文件名
|
test: /\.js$|\.html$|\.png$|\.jpg$|\.svg$|\.css$/, // 匹配文件名
|
||||||
filename: "[path][base].gz[query]", // 压缩后的文件名(保持原文件名,后缀加.gz)
|
filename: "[path][base].gz[query]", // 压缩后的文件名(保持原文件名,后缀加.gz)
|
||||||
minRatio: 1, // 压缩率小于1才会压缩
|
minRatio: 1, // 压缩率小于1才会压缩
|
||||||
threshold: 5120, // 对超过10k的数据压缩
|
threshold: 5120, // 对超过10k的数据压缩
|
||||||
@@ -98,7 +75,6 @@ const config = {
|
|||||||
|
|
||||||
transpileDependencies: false,
|
transpileDependencies: false,
|
||||||
|
|
||||||
|
|
||||||
chainWebpack: (setting) => {
|
chainWebpack: (setting) => {
|
||||||
setting.plugin("html").tap((args) => {
|
setting.plugin("html").tap((args) => {
|
||||||
args[0].cdn = assetsCDN
|
args[0].cdn = assetsCDN
|
||||||
|
|||||||
Reference in New Issue
Block a user