页面改用vue渲染、删除部分错别字词组、增加76个常用词组

master
yutent 2023-02-19 20:21:54 +08:00
parent f883707718
commit 7d7167f4ba
25 changed files with 1008 additions and 864 deletions

2
.gitignore vendored
View File

@ -5,7 +5,7 @@ node_modules
*.sublime-project
*.sublime-workspace
package-lock.json
test.js
._*
.Spotlight-V100

View File

@ -1,96 +0,0 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>关于 - 五笔输入法86版</title>
<meta name="keywords" content="五笔输入法86版">
<meta name="description" content="五笔输入法86版">
<link href="//jscdn.ink/@bytedo/wcui/1.0.12/css/reset-basic.css" rel="stylesheet">
<link rel="stylesheet" href="./css/index.css">
</head>
<body>
<div class="app flex column">
<header class="topbar flex ac noselect">
<div class="wrapper flex asc">
<a class="logo">五笔输入法<span>86版</span></a>
<nav class="navs flex">
<a class="nav" href="./">首页</a>
<a class="nav">简码表</a>
<a class="nav">打字练习</a>
<a class="nav active">关于</a>
</nav>
</div>
</header>
<main class="main flex ac">
<div class="wrapper about">
<h2>更新日志</h2>
<dl class="logs">
<dt class="version">@2022.04.10</dt>
<dd>
<ol>
<li>修复编码生成</li>
<li>删除部分错别字词组</li>
</ol>
</dd>
<dt class="version">@2022.03.22</dt>
<dd>
<ol>
<li>调整gbk大字符集的排序</li>
<li>删除词组`加德满都、嗲嗲、所列、新特`, 增加词组`握草、摆烂、封板`</li>
</ol>
</dd>
<dt class="version">@2022.03.21</dt>
<dd>
<ol>
<li>修复字库字典顺序</li>
<li>增加基础词汇23465个、计算机词汇221个、emoji表情181个、网络热词186个</li>
<li>查询功能支持词组</li>
<li>词库下载功能完成(个人词库暂未支持、拼音反查暂未支持)</li>
</ol>
</dd>
<dt class="version">@2022.03.15</dt>
<dd>
<ol>
<li>增加以下单字【䗪、㳇、㕮、㬊、㿠、䝙、㠇、㮾、㫰、㛹、㧑、㙦、䓨、㳚、䏲、䗖、䃅、㙍、䏡、䓛、䃎、䓬、㽏、䢼、㸌、㛃、㬚、㵐、䢺、䓫、䌹、䐃、㸆、㥄、䂮、㰀、㠓、㭕、䎃、䒤、㴔、㟃、䗴、㻬、䣘、㛚、㳘、㬎、䗛、㑊、㺄、㶲、㙘、䎖、㩼、㹴、䜰、䜮、鿏】</li>
<li>增加以下异型字【𠮷、𠙶、𨭉、𨚕、𠳐、𥕢、𤧛、𣗋、𨱏、𦭜、𨙸、𣸣、𦙶、𨐈、𤩽、𨱑、𨟠、𩾌、𡐓、𦝼、𧿹、𩾃、𨺙、𦰡、𡎚、𨱇、𦈡、𦒍、𣲘、𥻗、𣲗、𤫉、𥔲、𩽾、𠅤、𤞤、𨱔、𥖨、𫍣、𬶍、𫍣、𫘦、𫘜、𬭩、𫇭、𬭬】</li>
</ol>
</dd>
<dt class="version">@2022.03.10</dt>
<dd>
<ol>
<li>完成基础字典生成GB2312(6763)个 + GBK(14295)个</li>
<li>完成基本词组生成</li>
</ol>
</dd>
</dl>
</div>
</main>
<footer class="footer flex ac">
<div class="wrapper flex asc">
<span>&copy;2022, Yutent™.</span>
<span>Power by JavaScript</span>
</div>
</footer>
</div>
</body>
</html>

View File

@ -12,7 +12,7 @@
<script type="importmap">{{importmap}}</script>
</head>
<body>
<div class="app noselect"></div>
<div class="app"></div>
<script src="main.js"></script>
</body>
</html>

View File

@ -6,6 +6,6 @@
"build": "vue-live build"
},
"devDependencies": {
"@bytedo/vue-live": "^0.1.9"
"@bytedo/vue-live": "^0.2.0"
}
}

View File

@ -2428,6 +2428,7 @@
包罗
包罗万象
包茂
包名
包膜
包你
包年
@ -4267,6 +4268,7 @@
边缘人
边远
边寨
边长
边走边
编办
编成
@ -6234,6 +6236,7 @@
不能自拔
不能自已
不能做
不腻
不念旧恶
不宁
不宁唯是
@ -7271,6 +7274,7 @@
踩断
踩过界
踩坏
踩坑
踩雷
踩死
踩踏
@ -8910,6 +8914,7 @@
超凡入圣
超凡脱俗
超负荷
超纲
超高
超高频
超高速
@ -11700,6 +11705,7 @@
传真
传真机
传正
传值
传中
传宗接代
船帮
@ -13326,6 +13332,7 @@
达喀尔
达卡
达拉
达拉崩吧
达拉斯
达赖
达赖喇嘛
@ -14942,6 +14949,7 @@
单就
单句
单据
单卡
单靠
单科
单孔
@ -15669,6 +15677,7 @@
到点
到顶
到访
到付
到该
到港
到过
@ -17757,6 +17766,7 @@
调温
调息
调戏
调校
调笑
调协
调谐
@ -18555,6 +18565,7 @@
冻得
冻饿
冻害
冻鸡
冻僵
冻结
冻裂
@ -19054,6 +19065,7 @@
读数
读诵
读速
读条
读图
读完
读万卷书
@ -20297,6 +20309,7 @@
饿鬼
饿虎扑食
饿坏
饿了
饿了吧
饿了么
饿殍
@ -20791,6 +20804,7 @@
发嗲
发动
发动机
发冻鸡
发抖
发端
发短信
@ -21811,6 +21825,7 @@
方伯
方步
方才
方仓
方差
方成
方城
@ -22047,6 +22062,7 @@
房客
房款
房里
房梁
房门
房内
房奴
@ -24898,6 +24914,7 @@
敢问
敢想
敢言
敢用
敢于
敢作敢当
敢作敢为
@ -27089,6 +27106,7 @@
宫殿
宫斗剧
宫娥
宫格
宫颈
宫颈癌
宫颈糜烂
@ -29598,6 +29616,7 @@
果腹
果敢
果果
果号
果核
果迹
果酱
@ -29866,6 +29885,7 @@
哈喽
哈罗
哈马斯
哈曼
哈密
哈密瓜
哈姆
@ -29910,6 +29930,7 @@
还不错
还不够
还不清
还不如
还不是
还不知道
还差
@ -34209,6 +34230,7 @@
换衣服
换喻
换元
换源
换证
换住
换装
@ -34429,6 +34451,7 @@
黄绿
黄绿色
黄麻
黄码
黄毛
黄毛丫头
黄玫瑰
@ -34463,6 +34486,7 @@
黄山
黄衫
黄鳝
黄少天
黄圣依
黄石
黄书
@ -36711,7 +36735,6 @@
几座
己方
己见
己经
己任
己所不欲
挤挨
@ -37222,6 +37245,7 @@
加上
加上去
加深
加湿
加湿器
加时
加时赛
@ -38606,6 +38630,7 @@
江洋大盗
江阴
江油
江鱼儿
江月
江泽民
江浙
@ -39501,6 +39526,7 @@
教民
教你
教派
教培
教区
教人
教师
@ -42593,6 +42619,7 @@
焗油
菊豆
菊花
菊苣
橘柑
橘红
橘黄
@ -43451,7 +43478,6 @@
卡拉
卡拉奇
卡拉什尼科夫
卡拉OK
卡了
卡勒
卡类
@ -49972,6 +49998,7 @@
灵秀
灵验
灵药
灵耀
灵异
灵隐
灵应
@ -50409,6 +50436,7 @@
流年不利
流年似水
流脓
流拍
流派
流盼
流配
@ -51590,6 +51618,7 @@
乱晃
乱记
乱纪
乱加
乱箭攒心
乱讲
乱叫
@ -52426,6 +52455,7 @@
买了
买辆
买楼
买买买
买卖
买卖合同
买卖双方
@ -52670,6 +52700,7 @@
满腹狐疑
满腹经纶
满腹疑团
满格
满贯
满汉
满汉全席
@ -52874,6 +52905,7 @@
芒鞋
芒种
杧果
盲猜
盲肠
盲从
盲打
@ -54645,6 +54677,7 @@
秒内
秒拍
秒杀
秒删
秒针
秒钟
淼淼
@ -55162,6 +55195,7 @@
明码标价
明媒正娶
明媚
明面
明灭
明敏
明明
@ -57149,6 +57183,7 @@
内镜
内疚
内聚
内卷
内眷
内卡
内刊
@ -59468,6 +59503,7 @@
袍子
跑遍
跑表
跑不掉
跑步
跑步机
跑车
@ -60246,6 +60282,7 @@
屁股
屁滚尿流
屁话
屁民
屁屁
屁事
屁眼
@ -61842,6 +61879,7 @@
奇形怪状
奇秀
奇勋
奇艺
奇异
奇遇
奇缘
@ -63111,6 +63149,7 @@
强杀
强上
强身
强升
强生
强省
强盛
@ -69058,6 +69097,8 @@
傻仔
傻子
唼血
啥的
啥都
啥时
啥时候
啥事
@ -70533,6 +70574,7 @@
涉嫌
涉险过关
涉县
涉政
涉足
赦令
赦免
@ -71022,6 +71064,7 @@
神经元
神经质
神经组织
神剧
神君
神龛
神来
@ -71641,6 +71684,7 @@
声说
声嘶力竭
声讨
声网
声望
声威
声威大震
@ -71961,6 +72005,7 @@
失乐
失礼
失利
失联
失恋
失恋了
失灵
@ -74181,6 +74226,7 @@
受骗
受聘
受其
受奇艺
受气
受气包
受穷
@ -75134,6 +75180,7 @@
双枪
双抢
双亲
双擎
双曲线
双全
双拳
@ -76636,6 +76683,7 @@
松阳
松叶
松一口气
松语
松原
松赞干布
松针
@ -78816,6 +78864,7 @@
套路
套路深
套马
套内
套弄
套牌
套票
@ -78951,6 +79000,7 @@
特殊性
特殊要求
特爽
特斯拉
特提
特为
特务
@ -79090,6 +79140,7 @@
提包
提笔
提笔忘字
提测
提倡
提车
提成
@ -79684,6 +79735,7 @@
天悬地隔
天旋
天旋地转
天选
天崖
天涯
天涯海角
@ -79869,6 +79921,7 @@
填街塞巷
填进
填具
填坑
填空
填料
填列
@ -89339,6 +89392,7 @@
小品
小品文
小平
小屏
小瓶
小坡
小破孩
@ -90031,6 +90085,7 @@
写实
写手
写书
写死
写完
写文章
写下
@ -90540,6 +90595,7 @@
新寡
新官上任
新官上任三把火
新冠
新光
新规
新贵
@ -90591,6 +90647,7 @@
新康
新科
新科技
新客
新课
新课标
新快报
@ -91214,6 +91271,7 @@
形骸
形迹
形迹可疑
形近
形码
形貌
形旁
@ -94094,6 +94152,7 @@
羊羹
羊倌
羊角
羊了
羊毛
羊毛出在羊身上
羊毛衫
@ -94112,6 +94171,7 @@
羊汤
羊头
羊腿
羊驼
羊蝎子
羊羊
羊腰子
@ -94470,6 +94530,7 @@
腰肌劳损
腰际
腰间
腰砍
腰里
腰链
腰牌
@ -94877,6 +94938,7 @@
也别
也不
也不错
也不会
也不可能
也不例外
也不是
@ -95025,6 +95087,7 @@
野叟
野蔌山肴
野塘
野图
野兔
野外
野望
@ -101647,6 +101710,7 @@
砸伤
砸死
砸碎
砸砸乐
砸在
咋办
咋滴
@ -101888,6 +101952,7 @@
在旁
在其
在前
在群里
在任
在日
在商言商
@ -102731,6 +102796,7 @@
窄窄
债多不愁
债户
债基
债家
债款
债利
@ -103491,6 +103557,7 @@
涨滩
涨停
涨停板
涨薪
涨涨
掌班
掌鞭
@ -104927,7 +104994,9 @@
整天
整条
整晚
整行
整形
整型
整修
整训
整夜
@ -107678,6 +107747,7 @@
朱丽叶
朱莉
朱令
朱罗纪
朱门
朱门酒肉臭
朱墨
@ -107881,6 +107951,7 @@
主办方
主办权
主办者
主包
主笔
主编
主表
@ -108631,6 +108702,7 @@
转移话题
转移支付
转义
转译
转引
转印
转用
@ -109696,6 +109768,7 @@
自寻烦恼
自寻死路
自言自语
自研
自业自得
自已
自以为
@ -109819,6 +109892,7 @@
子集
子键
子句
子卷
子爵
子口
子类

View File

@ -1,63 +1,70 @@
<template>
<header>
<img alt="Vue logo" class="logo" src="/assets/logo.svg" width="125" height="125" />
<div class="wrapper">
<Hello msg="It works!!!" />
<nav>
<router-link to="/">Home</router-link>
<router-link to="/about">About</router-link>
</nav>
</div>
</header>
<Topbar />
<router-view />
<Footer />
</template>
<script>
import Hello from './components/hello.vue'
import Topbar from './components/topbar.vue'
import Footer from './components/footer.vue'
export default {
components: { Hello }
components: { Topbar, Footer }
}
</script>
<style lang="scss">
.app {
padding: 16px;
body {
line-height: 1.5;
font-size: 14px;
color: var(--color-dark-1);
}
a {
color: inherit;
text-decoration: none;
}
wc-switch {
cursor: pointer;
}
header {
.app {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100vh;
}
a {
color: var(--color-teal-1);
transition: 0.2s;
}
a:hover {
color: var(--color-teal-3);
}
nav {
margin-top: 32px;
.flex {
display: flex;
justify-content: center;
a {
margin: 0 16px;
&.wrap {
flex-wrap: wrap;
}
&.column {
flex-direction: column;
}
&.ac {
justify-content: center;
}
&.alc {
align-items: center;
}
&.acc {
justify-content: center;
align-items: center;
}
&.asc {
justify-content: space-between;
align-items: center;
}
}
main {
margin: 32px;
text-align: center;
.wrapper {
width: 1024px;
}
</style>

View File

@ -1,89 +0,0 @@
body {
line-height: 1.5;
font-size: 14px;
color: var(--color-dark-1);
}
a {
color: inherit;
text-decoration: none;
}
wc-switch {
cursor: pointer;
}
.app {
width: 100%;
height: 100vh;
}
.flex {
display: flex;
&.wrap {
flex-wrap: wrap;
}
&.column {
flex-direction: column;
}
&.ac {
justify-content: center;
}
&.alc {
align-items: center;
}
&.acc {
justify-content: center;
align-items: center;
}
&.asc {
justify-content: space-between;
align-items: center;
}
}
.wrapper {
width: 1024px;
}
.topbar {
width: 100%;
height: 64px;
background: #fff;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
.logo {
font-size: 24px;
color: var(--color-red-1);
span {
font-size: 14px;
}
}
.navs {
font-size: 16px;
.nav {
margin-left: 32px;
cursor: pointer;
transition: color 0.2s linear;
&.active,
&:hover {
text-decoration: underline;
color: var(--color-red-1);
}
}
}
}
.footer {
width: 100%;
height: 64px;
border-top: 1px solid var(--color-plain-2);
}

1
src/assets/index.css Normal file
View File

@ -0,0 +1 @@
body{line-height:1.5;font-size:14px;color:var(--color-dark-1)}a{color:inherit;text-decoration:none}wc-switch{cursor:pointer}.app{width:100%;height:100vh}.flex{display:flex}.flex.wrap{flex-wrap:wrap}.flex.column{flex-direction:column}.flex.ac{justify-content:center}.flex.alc{align-items:center}.flex.acc{justify-content:center;align-items:center}.flex.asc{justify-content:space-between;align-items:center}.wrapper{width:1024px}.topbar{width:100%;height:64px;background:#fff;box-shadow:0 6px 12px rgba(0,0,0,.05)}.topbar .logo{font-size:24px;color:var(--color-red-1)}.topbar .logo span{font-size:14px}.topbar .navs{font-size:16px}.topbar .navs .nav{margin-left:32px;cursor:pointer;transition:color .2s linear}.topbar .navs .nav.active,.topbar .navs .nav:hover{text-decoration:underline;color:var(--color-red-1)}.footer{width:100%;height:64px;border-top:1px solid var(--color-plain-2)}.main{overflow:hidden;flex:1}.main .wrapper{height:100%}.main .table-info{width:100%;height:64px}.main .table-info b{color:var(--color-red-1)}.main .table-info .download{margin-left:32px}.main .search{width:100%}.main .search .field{margin-top:16px}.main .search .field.result{line-height:2;font-family:Menlo;word-wrap:break-word;white-space:pre-wrap}.main .search .field.result b{letter-spacing:2px;color:var(--color-blue-1)}.main .search .field wc-input{flex:1}.main .panel{overflow:hidden;flex:1;margin-top:32px}.main .panel .custom-file{position:relative;width:160px}.main .panel .custom-file input{position:absolute;width:100%;height:100%;opacity:0}.main .panel .tips{color:var(--color-orange-3)}.main .panel .scroll-view{overflow:hidden;flex:1}.main .panel .preview{margin-top:16px;font-family:Menlo;word-break:keep-all;white-space:pre-wrap}.github{position:fixed;right:-30px;top:20px;z-index:9;width:120px;height:22px;line-height:22px;text-align:center;color:#fff;background:var(--color-dark-1);transform:rotate(45deg)}.download-layer{width:640px;padding-bottom:64px;background:#fff}.download-layer .field{margin-top:16px;padding:0 16px}.download-layer .field .label{min-width:120px;padding-right:16px;line-height:32px;text-align:right;font-weight:bold;color:var(--color-grey-3)}.download-layer .field .label::after{content:" : "}.download-layer .field .value{line-height:32px}.download-layer .field .tips{margin-left:16px;line-height:32px;color:var(--color-orange-3)}.download-layer .field.ctrol{padding:0 128px;margin-top:64px}@media screen and (max-width: 1024px){.topbar,.main{padding:0 16px}.wrapper{width:100%}.footer .wrapper{flex-direction:column;align-items:center;justify-content:center}}

View File

@ -1,180 +0,0 @@
@import './common.scss';
.main {
overflow: hidden;
flex: 1;
.wrapper {
height: 100%;
}
.table-info {
width: 100%;
height: 64px;
b {
color: var(--color-red-1);
}
.download {
margin-left: 32px;
}
}
.search {
width: 100%;
.field {
margin-top: 16px;
&.result {
line-height: 2;
font-family: Menlo;
word-wrap: break-word;
white-space: pre-wrap;
b {
letter-spacing: 2px;
color: var(--color-blue-1);
}
}
wc-input {
flex: 1;
}
}
}
.panel {
overflow: hidden;
flex: 1;
margin-top: 32px;
.custom-file {
position: relative;
width: 160px;
input {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
}
}
.tips {
color: var(--color-orange-3);
}
.scroll-view {
overflow: hidden;
flex: 1;
}
.preview {
margin-top: 16px;
font-family: Menlo;
word-break: keep-all;
white-space: pre-wrap;
}
}
/* */
.about {
padding: 32px 16px;
h2 {
font-size: 24px;
}
.logs {
.version {
margin-top: 32px;
line-height: 2;
font-weight: bold;
font-size: 18px;
}
dd {
color: var(--color-grey-3);
}
ol {
padding-left: 2em;
list-style: decimal;
}
}
}
}
.github {
position: fixed;
right: -30px;
top: 20px;
z-index: 9;
width: 120px;
height: 22px;
line-height: 22px;
text-align: center;
color: #fff;
background: var(--color-dark-1);
transform: rotate(45deg);
}
.download-layer {
width: 640px;
padding-bottom: 64px;
background: #fff;
.field {
margin-top: 16px;
padding: 0 16px;
.label {
min-width: 120px;
padding-right: 16px;
line-height: 32px;
text-align: right;
font-weight: bold;
color: var(--color-grey-3);
&::after {
content: ' : ';
}
}
.value {
line-height: 32px;
}
.tips {
margin-left: 16px;
line-height: 32px;
color: var(--color-orange-3);
}
&.ctrol {
padding: 0 128px;
margin-top: 64px;
}
}
}
@media screen and (max-width: 1024px) {
.topbar,
.main {
padding: 0 16px;
}
.wrapper {
width: 100%;
}
.footer {
.wrapper {
flex-direction: column;
align-items: center;
justify-content: center;
}
}
}

20
src/components/footer.vue Normal file
View File

@ -0,0 +1,20 @@
<template>
<footer class="footer flex ac">
<div class="wrapper flex asc">
<span>&copy;2022, Yutent.</span>
<span>Power by JavaScript</span>
</div>
</footer>
</template>
<script>
export default {}
</script>
<style scoped>
.footer {
width: 100%;
height: 64px;
border-top: 1px solid var(--color-plain-2);
}
</style>

View File

@ -1,40 +0,0 @@
<template>
<div class="greetings">
<h1 class="green">{{ msg }}</h1>
<h3>
你已经成功运行了一个项目, 项目基于
<a href="//github.com/bytedo/vue-live" target="_blank">Vue-live</a> +
<a href="//vuejs.org" target="_blank">Vue 3</a>.
</h3>
</div>
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<style>
h1 {
font-size: 52px;
}
h3 {
font-size: 1.2rem;
font-weight: normal;
}
.green {
font-family: 'Courier New', Courier, monospace;
color: var(--color-blue-1);
}
.greetings {
text-align: center;
}
</style>

56
src/components/topbar.vue Normal file
View File

@ -0,0 +1,56 @@
<template>
<header class="topbar flex ac noselect">
<div class="wrapper flex asc">
<a class="logo">五笔输入法<span>86</span></a>
<nav class="navs flex">
<router-link class="nav" to="/">首页</router-link>
<router-link class="nav" to="">简码表</router-link>
<router-link class="nav" to="">打字练习</router-link>
<router-link class="nav" to="/about">关于</router-link>
</nav>
</div>
</header>
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<style lang="scss" scoped>
.topbar {
width: 100%;
height: 64px;
background: #fff;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
.logo {
font-size: 24px;
color: var(--color-red-1);
span {
font-size: 14px;
}
}
.navs {
font-size: 16px;
.nav {
margin-left: 32px;
cursor: pointer;
transition: color 0.2s linear;
&.active,
&:hover {
text-decoration: underline;
color: var(--color-red-1);
}
}
}
}
</style>

View File

@ -55,6 +55,7 @@ export function createCode(dict, word) {
let c2 = dict.get(word[1])?.pop()
let c3 = dict.get(word[2])?.pop()
let ce = dict.get(word[word.length - 1])?.pop()
if (c1 && c2 && c3 && ce) {
return c1[0] + c2[0] + c3[0] + ce[0]
} else {
@ -136,7 +137,6 @@ export class Enum {
add(k, v) {
if (this.#dict_k[k]) {
var _v = this.#dict_k[k]
for (let t of _v) {
this.#dict_v[t] = this.#dict_v[t].filter(i => i !== k)
}
@ -153,10 +153,16 @@ export class Enum {
this.#dict_v[t] = [k]
}
}
} else {
if (this.#dict_v[v]) {
if (!this.#dict_v[v].includes(k)) {
this.#dict_v[v].push(k)
}
} else {
this.#dict_v[v] = [k]
}
}
}
remove(k) {
var v = this.#dict_k[k]
@ -176,6 +182,7 @@ export class Enum {
if (this.#dict_k[k]) {
return [...this.#dict_k[k]]
} else if (this.#dict_v[k]) {
console.log(this.#dict_v[k])
return [...this.#dict_v[k]]
}
}

View File

@ -1,385 +0,0 @@
/**
*
* @author yutent<yutent.io@gmail.com>
* @date 2022/03/11 12:03:59
*/
import '//jscdn.ink/anot/2.2.3/anot.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/layer/index.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/input.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/button.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/link.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/radio.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/checkbox.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/switch.js'
import fetch from '//jscdn.ink/@bytedo/fetch/2.1.1/index.js'
import { Enum, saveFile, SString, createCode } from './lib/core.js'
import FIXED_86F from './lib/86_fixed.js'
const VER_86 = '86'
const VER_86F = '86f'
const WB_CODE_NAME = { 1: '一级简码', 2: '二级简码', 3: '三级简码', 4: '四级简码' }
const WB_TABLE_2312 = new Enum()
const WB_TABLE_GBK = new Enum()
const WB_TABLE_GBK_TEMP = new Enum()
const WB_TABLE_86F = new Enum(FIXED_86F)
const WB_WORDS = new Enum()
const WB_DY = new Enum()
const WB_EMOJI = new Enum()
const WB_NET = new Enum()
const WB_CODE = new Enum()
Anot({
$id: 'app',
state: {
gb2312: 0,
gbk: 0,
words: 0,
dy: 0,
emoji: 0,
nethot: 0,
code: 0,
result: '',
filter: {
text: '',
version: VER_86
},
dlOpt: {
pos: 'front',
version: VER_86,
reverse: true,
pinyin: false,
tables: ['2312', 'words']
},
total: 0,
preview: ''
},
watch: {
'dlOpt.tables'() {
this.calculate()
}
},
mounted() {
Promise.all([
fetch('./data/gb2312.txt').then(r => r.text()),
fetch('./data/gbk.txt').then(r => r.text()),
fetch('./data/words.txt').then(r => r.text()),
fetch('./data/dy.txt').then(r => r.text()),
fetch('./data/emoji.txt').then(r => r.text()),
fetch('./data/nethot.txt').then(r => r.text()),
fetch('./data/code.txt').then(r => r.text())
]).then(([gb2312, gbk, words, dy, emoji, nethot, code]) => {
//
gb2312.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_TABLE_2312.add(k, it)
}
})
// 先使用gb2312, 目的是为了词库顺序以gb2312优先
WB_TABLE_GBK_TEMP.concat(WB_TABLE_2312)
gbk.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_TABLE_GBK.add(k, it)
WB_TABLE_GBK_TEMP.add(k, it)
}
})
//
words.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_WORDS.add(k, createCode(WB_TABLE_GBK_TEMP, k))
}
})
dy.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_DY.add(k, it)
}
})
emoji.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_EMOJI.add(k, it)
}
})
nethot.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_NET.add(k, createCode(WB_TABLE_GBK_TEMP, k))
}
})
code.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_CODE.add(k, createCode(WB_TABLE_GBK_TEMP, k))
}
})
this.gb2312 = WB_TABLE_2312.length
this.gbk = WB_TABLE_GBK.length
this.words = WB_WORDS.length
this.dy = WB_DY.length
this.emoji = WB_EMOJI.length
this.nethot = WB_NET.length
this.code = WB_CODE.length
this.calculate()
})
},
methods: {
search() {
var { text, version } = this.filter
var reverse = false
var res, resf
text = text.trim().toLowerCase()
if (!text) {
this.result = ''
return
}
reverse = /^[a-z]{1,4}$/.test(text)
if (!reverse) {
text = text.replace(/[\sa-z]/g, '')
}
text = new SString(text)
if (reverse || text.length === 1) {
console.log(text, text + '')
res = [WB_TABLE_GBK.get(text)]
if (version === VER_86F) {
resf = [WB_TABLE_86F.get(text)]
}
} else {
res = text.split().map(t => WB_TABLE_GBK.get(t))
if (version === VER_86F) {
resf = text.split().map(t => WB_TABLE_86F.get(t))
}
}
if (reverse) {
text = text.toUpperCase()
// 反查时, 直接替换结果
if (resf && resf[0]) {
res = resf
}
if (res[0]) {
res = `${text} 】👉\t${res[0]
.map(
t =>
`${t}(<b>${(resf && resf[0] ? WB_TABLE_86F.get(t) : WB_TABLE_GBK.get(t))
.join('、')
.toUpperCase()}</b>)`
)
.join('\t\t')}`
} else {
res = `${text} 】👉\t无结果, 请检查你的输入是否正确, 如果确认无误, 可以反馈缺失字库。`
}
} else {
if (resf) {
resf.forEach((it, i) => {
if (it) {
res[i] = it
}
})
}
res = res
.map((it, i) => {
if (it) {
return `${text.at(i)} 】👉\t${it
.map(t => `${WB_CODE_NAME[t.length]}: <b>${t.toUpperCase()}</b>`)
.join('\t\t')}`
} else {
return `${text.at(
i
)} 👉\t无结果, 请检查你的输入是否正确, 如果确认无误, 可以反馈缺失字库`
}
})
.join('\n')
// 词库查询
{
let extra =
WB_WORDS.get(text) ||
WB_DY.get(text) ||
WB_EMOJI.get(text) ||
WB_NET.get(text) ||
WB_CODE.get(text)
if (extra) {
let t = extra.shift()
res += `\n\n${'-'.repeat(6)} 词库查询结果 ${'-'.repeat(32)}\n${text} 】👉\t${
WB_CODE_NAME[t.length]
}: <b>${t.toUpperCase()}</b>`
}
}
}
this.result = `${'-'.repeat(6)} 字库查询结果 ${'-'.repeat(32)}\n${res}`
},
calculate() {
var num = this.gb2312
if (this.dlOpt.tables.includes('gbk')) {
num += this.gbk
}
num += this.words
num += this.dy
if (this.dlOpt.tables.includes('emoji')) {
num += this.emoji
}
if (this.dlOpt.tables.includes('nethot')) {
num += this.nethot
}
if (this.dlOpt.tables.includes('code')) {
num += this.code
}
this.total = num
},
fileChange(ev) {
var reader = new FileReader()
var file = ev.target.files[0]
var all = new Set()
var unknow = new Set()
ev.target.value = ''
reader.onload = () => {
let arr = reader.result
.trim()
.split('\n')
.map(_ => _.trim())
for (let it of arr) {
it = it.replace(/[\w\s\t]+/g, '')
all.add(it)
if (!WB_TABLE_GBK.get(it) && !WB_WORDS.get(it) && !WB_DY.get(it)) {
unknow.add(it)
}
}
all = Array.from(all)
unknow = Array.from(unknow)
this.preview =
`${file.name}\n本次上传, 含有 ${arr.length} 个词条(有效词条 ${all.length} 个)。\n` +
`其中字库中已经存在 ${all.length - unknow.length}个, 未存在词条 ${
unknow.length
} , 如下:\n\n${unknow.join('\t')}`
// window.unknow = unknow
// console.log(unknow)
// navigator.clipboard.writeText(Array.from(all).join('\n'))
}
reader.readAsText(file)
},
openDownloadPanel() {
this.$refs.dl.show()
},
closeDownloadPanel() {
this.$refs.dl.close()
},
download() {
var opt = { ...this.dlOpt }
var temp = new Enum()
temp.concat(WB_TABLE_2312)
// 生成反查字库
if (opt.reverse) {
if (opt.tables.includes('gbk')) {
let bin = new Blob([WB_TABLE_GBK_TEMP.toString()], { type: 'text/plain' })
saveFile(bin, 'wb_table_gbk_reverse.txt')
} else {
let bin = new Blob([WB_TABLE_2312.toString()], { type: 'text/plain' })
saveFile(bin, 'wb_table_gb2312_reverse.txt')
}
}
// 默认词库
temp.concat(WB_WORDS)
// emoji表情
if (opt.tables.includes('emoji')) {
temp.concat(WB_EMOJI)
}
// 网络热词
if (opt.tables.includes('nethot')) {
temp.concat(WB_NET)
}
// 计算机术语
if (opt.tables.includes('code')) {
temp.concat(WB_CODE)
}
// gbk 大字符集, 顺序往后调
if (opt.tables.includes('gbk')) {
temp.concat(WB_TABLE_GBK)
}
// 异形字库
if (opt.tables.includes('dy')) {
temp.concat(WB_DY)
}
// 暂未支持
// if (opt.tables.includes('personal')) {
// temp.concat(WB_PERSONAL)
// }
let bin = new Blob([temp.toString(opt.pos === 'front')], { type: 'text/plain' })
saveFile(bin, `wb_table_${opt.pos}.txt`)
this.closeDownloadPanel()
}
}
})

View File

@ -1,5 +1,12 @@
import { createApp } from 'vue'
import '//jscdn.ink/@bytedo/wcui/1.0.12/layer/index.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/input.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/button.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/link.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/radio.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/checkbox.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/switch.js'
import App from './app.vue'
import router from './router'
@ -8,4 +15,3 @@ import store from './store'
const app = createApp(App)
app.use(router).use(store).mount('.app')

View File

@ -1,9 +1,9 @@
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
import Home from './views/home.vue'
import About from './views/about.vue'
const router = createRouter({
history: createWebHistory(),
history: createWebHashHistory(),
routes: [
{
path: '/',
@ -13,11 +13,9 @@ const router = createRouter({
{
path: '/about',
name: 'about',
component: () => import('./views/about.vue')
component: About
}
]
})
export default router

View File

@ -1,18 +1,107 @@
<template>
<main class="main flex ac">
<div class="wrapper about">
<h2>更新日志</h2>
<dl class="logs">
<template v-for="it in list">
<dt class="version">{{ it.date }}</dt>
<dd>
<ol>
<li v-for="log in it.logs">{{ log }}</li>
</ol>
</dd>
</template>
</dl>
</div>
</main>
</template>
<script>
export default {
data(){
data() {
return {
content: '这是关于我们页面'
list: [
{
date: '2023.02.19',
logs: ['页面改用vue渲染', '删除部分错别字词组、增加76个常用词组']
},
{
date: '2022.04.10',
logs: ['修复编码生成', '删除部分错别字词组']
},
{
date: '2022.03.22',
logs: [
'调整gbk大字符集的排序',
'删除词组`加德满都、嗲嗲、所列、新特`, 增加词组`握草、摆烂、封板`'
]
},
{
date: '2022.03.21',
logs: [
'修复字库字典顺序',
'增加基础词汇23465个、计算机词汇221个、emoji表情181个、网络热词186个',
'查询功能支持词组',
'词库下载功能完成(个人词库暂未支持、拼音反查暂未支持)'
]
},
{
date: '2022.03.15',
logs: [
'增加以下单字【䗪、㳇、㕮、㬊、㿠、䝙、㠇、㮾、㫰、㛹、㧑、㙦、䓨、㳚、䏲、䗖、䃅、㙍、䏡、䓛、䃎、䓬、㽏、䢼、㸌、㛃、㬚、㵐、䢺、䓫、䌹、䐃、㸆、㥄、䂮、㰀、㠓、㭕、䎃、䒤、㴔、㟃、䗴、㻬、䣘、㛚、㳘、㬎、䗛、㑊、㺄、㶲、㙘、䎖、㩼、㹴、䜰、䜮、鿏】',
'增加以下异型字【𠮷、𠙶、𨭉、𨚕、𠳐、𥕢、𤧛、𣗋、𨱏、𦭜、𨙸、𣸣、𦙶、𨐈、𤩽、𨱑、𨟠、𩾌、𡐓、𦝼、𧿹、𩾃、𨺙、𦰡、𡎚、𨱇、𦈡、𦒍、𣲘、𥻗、𣲗、𤫉、𥔲、𩽾、𠅤、𤞤、𨱔、𥖨、𫍣、𬶍、𫍣、𫘦、𫘜、𬭩、𫇭、𬭬】'
]
},
{
date: '2022.03.10',
logs: [
'完成基础字典生成GB2312(6763)个 + GBK(14295)个',
'完成基本词组生成'
]
}
]
}
},
mounted() {
document.title = '关于 - 五笔输入法86版'
}
}
</script>
<template>
<main>
<h1>{{content}}</h1>
<cite>当前vue-live版本: v{{$store.version}}</cite>
</main>
</template>
<style lang="scss" scoped>
.main {
overflow: hidden;
flex: 1;
.about {
padding: 32px 16px;
h2 {
font-size: 24px;
}
.logs {
.version {
margin-top: 32px;
line-height: 2;
font-weight: bold;
font-size: 18px;
&::before {
color: var(--color-red-1);
content: '@ ';
}
}
dd {
color: var(--color-grey-3);
}
ol {
padding-left: 2em;
list-style: decimal;
}
}
}
}
</style>

View File

@ -1,17 +1,690 @@
<template>
<main class="main flex ac">
<div class="wrapper flex column">
<header class="table-info flex alc wrap">
现有单字GB2312(
<b>{{ gb2312 }}</b> ) + GBK(<b>{{ gbk }}</b> ) 异形字<b>{{
dy
}}</b>
词组<b>{{ words }}</b> 网络热词<b>{{ nethot }}</b>
计算机术语<b>{{ code }}</b> emoji<b>{{ emoji }}</b> !
<wc-link
class="download"
type="primary"
underline
@click="openDownloadPanel"
>下载词库</wc-link
>
</header>
<div class="search">
<section class="field flex alc">
<wc-input
placeholder="输入汉字或五笔编码查询"
v-model="filter.text"
@submit="search"
/>
</section>
<section class="field flex alc">
<wc-radio-group v-model="filter.version" @change="search">
<wc-radio value="86">86</wc-radio>
<wc-radio value="86f" type="danger">86修正版</wc-radio>
</wc-radio-group>
</section>
<section class="field result" v-html="result"></section>
</div>
<div class="panel flex column">
<div class="form">
<wc-button class="custom-file" icon="plus">
<input type="file" @change="fileChange" />
上传个人词库
</wc-button>
<span class="tips"
>(仅需要中文即可, 程序会自动生成五笔编码, 词组一行一个)</span
>
</div>
<wc-scroll class="scroll-view">
<div class="preview">{{ preview }}</div>
</wc-scroll>
</div>
</div>
</main>
<a href="//github.com/yutent/wb-table" class="github" target="__target"
>GitHub</a
>
<wc-layer ref="dl" title="下载选项" mask mask-close>
<div class="download-layer">
<section class="field flex">
<span class="label">编码版本</span>
<wc-radio-group v-model="dlOpt.version" @change="search">
<wc-radio value="86">86</wc-radio>
<wc-radio value="86f" type="danger">86修正版</wc-radio>
</wc-radio-group>
</section>
<section class="field flex">
<span class="label">词库选择</span>
<wc-checkbox-group v-model="dlOpt.tables">
<wc-checkbox readonly value="2312">GB2312</wc-checkbox>
<wc-checkbox value="gbk">GBK</wc-checkbox>
<wc-checkbox readonly value="words">词组库</wc-checkbox>
<wc-checkbox value="dy">异形字库</wc-checkbox>
<wc-checkbox value="emoji">emoji</wc-checkbox>
<wc-checkbox value="nethot">网络热词</wc-checkbox>
<wc-checkbox value="code">计算机术语</wc-checkbox>
<wc-checkbox value="personal" type="info"
>个人词库(自主上传的)</wc-checkbox
>
</wc-checkbox-group>
</section>
<section class="field flex">
<span class="label">词库编码位置</span>
<wc-radio-group v-model="dlOpt.pos">
<wc-radio value="front">编码前置</wc-radio>
<wc-radio value="back">编码后置</wc-radio>
</wc-radio-group>
<span class="tips">(编码前置时, 自动聚合词组)</span>
</section>
<section class="field flex">
<span class="label">生成反查字库</span>
<wc-switch v-model="dlOpt.reverse"></wc-switch>
<span class="tips">(输入法支持拼音反查五笔编码时, 请勾选)</span>
</section>
<section class="field flex">
<span class="label">是否生成拼音</span>
<wc-switch v-model="dlOpt.pinyin" disabled></wc-switch>
<span class="tips"
>(输入法支持临时拼音时, 请勾选)(功能暂未支持,
多单字词库生成中...)</span
>
</section>
<section class="field flex">
<span class="label">总计</span>
<span class="value">{{ total }} </span>
</section>
<section class="field flex asc ctrol">
<wc-button @click="closeDownloadPanel"></wc-button>
<wc-button type="primary" @click="download"></wc-button>
</section>
</div>
</wc-layer>
</template>
<script>
import { Enum, saveFile, SString, createCode } from '@/lib/core.js'
import FIXED_86F from '@/lib/86_fixed.js'
const VER_86 = '86'
const VER_86F = '86f'
const WB_CODE_NAME = {
1: '一级简码',
2: '二级简码',
3: '三级简码',
4: '四级简码'
}
const WB_TABLE_2312 = new Enum()
const WB_TABLE_GBK = new Enum()
const WB_TABLE_GBK_TEMP = new Enum()
const WB_TABLE_86F = new Enum(FIXED_86F)
const WB_WORDS = new Enum()
const WB_DY = new Enum()
const WB_EMOJI = new Enum()
const WB_NET = new Enum()
const WB_CODE = new Enum()
export default {
data(){
data() {
return {
content: '欢迎访问~~ 这是首页'
gb2312: 0,
gbk: 0,
words: 0,
dy: 0,
emoji: 0,
nethot: 0,
code: 0,
result: '',
filter: {
text: '',
version: VER_86
},
dlOpt: {
pos: 'front',
version: VER_86,
reverse: true,
pinyin: false,
tables: ['2312', 'words']
},
total: 0,
preview: ''
}
},
watch: {
'dlOpt.tables'() {
this.calculate()
}
},
mounted() {
document.title = '五笔输入法86版'
Promise.all([
fetch('/wb-table/data/gb2312.txt').then(r => r.text()),
fetch('/wb-table/data/gbk.txt').then(r => r.text()),
fetch('/wb-table/data/words.txt').then(r => r.text()),
fetch('/wb-table/data/dy.txt').then(r => r.text()),
fetch('/wb-table/data/emoji.txt').then(r => r.text()),
fetch('/wb-table/data/nethot.txt').then(r => r.text()),
fetch('/wb-table/data/code.txt').then(r => r.text())
]).then(([gb2312, gbk, words, dy, emoji, nethot, code]) => {
//
gb2312.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_TABLE_2312.add(k, it)
}
})
// 使gb2312, gb2312
WB_TABLE_GBK_TEMP.concat(WB_TABLE_2312)
gbk.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_TABLE_GBK.add(k, it)
WB_TABLE_GBK_TEMP.add(k, it)
}
})
dy.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_DY.add(k, it)
WB_TABLE_GBK_TEMP.add(k, it)
}
})
emoji.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_EMOJI.add(k, it)
}
})
//
words.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_WORDS.add(k, createCode(WB_TABLE_GBK_TEMP, k))
}
})
nethot.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_NET.add(k, createCode(WB_TABLE_GBK_TEMP, k))
}
})
code.split('\n').forEach(it => {
it = it.split(' ')
let k = it.shift()
if (k) {
WB_CODE.add(k, createCode(WB_TABLE_GBK_TEMP, k))
}
})
this.gb2312 = WB_TABLE_2312.length
this.gbk = WB_TABLE_GBK.length
this.words = WB_WORDS.length
this.dy = WB_DY.length
this.emoji = WB_EMOJI.length
this.nethot = WB_NET.length
this.code = WB_CODE.length
window.WB_WORDS = WB_WORDS
this.calculate()
})
},
methods: {
search() {
var { text, version } = this.filter
var reverse = false
var res, resf
text = text.trim().toLowerCase()
if (!text) {
this.result = ''
return
}
//
reverse = /^[a-z]{1,4}$/.test(text)
if (!reverse) {
text = text.replace(/[\sa-z]/g, '')
}
text = new SString(text)
if (reverse || text.length === 1) {
res = [WB_TABLE_GBK_TEMP.get(text)]
if (version === VER_86F) {
resf = [WB_TABLE_86F.get(text)]
}
} else {
res = text.split().map(t => WB_TABLE_GBK_TEMP.get(t))
if (version === VER_86F) {
resf = text.split().map(t => WB_TABLE_86F.get(t))
}
}
if (reverse) {
// text = text.toUpperCase()
// ,
if (resf && resf[0]) {
res = resf
}
if (res[0]) {
res = `${text.toUpperCase()} 】👉\t${res[0]
.map(
t =>
`${t}(<b>${(resf && resf[0]
? WB_TABLE_86F.get(t)
: WB_TABLE_GBK_TEMP.get(t)
)
.join('、')
.toUpperCase()}</b>)`
)
.join('\t\t')}`
} else {
res = `${text.toUpperCase()} 】👉\t无结果, 请检查你的输入是否正确, 如果确认无误, 可以反馈缺失字库。`
}
//
{
let extra = WB_WORDS.get(text)
.concat(
WB_DY.get(text),
WB_EMOJI.get(text),
WB_NET.get(text),
WB_CODE.get(text)
)
.filter(it => it)
if (extra.length) {
res += `\n\n${'-'.repeat(6)} 词库查询结果 ${'-'.repeat(32)}\n`
while (extra.length) {
let t = extra.shift()
res += `${text} 】👉\t${
WB_CODE_NAME[t.length]
}: <b>${t.toUpperCase()}</b>\n`
}
}
}
} else {
if (resf) {
resf.forEach((it, i) => {
if (it) {
res[i] = it
}
})
}
res = res
.map((it, i) => {
if (it) {
return `${text.at(i)} 】👉\t${it
.map(
t => `${WB_CODE_NAME[t.length]}: <b>${t.toUpperCase()}</b>`
)
.join('\t\t')}`
} else {
return `${text.at(
i
)} 👉\t无结果, 请检查你的输入是否正确, 如果确认无误, 可以反馈缺失字库`
}
})
.join('\n')
//
{
let extra =
WB_WORDS.get(text) ||
WB_DY.get(text) ||
WB_EMOJI.get(text) ||
WB_NET.get(text) ||
WB_CODE.get(text)
if (extra) {
let t = extra.shift()
res += `\n\n${'-'.repeat(6)} 词库查询结果 ${'-'.repeat(
32
)}\n ${text} 👉\t${
WB_CODE_NAME[t.length]
}: <b>${t.toUpperCase()}</b>`
}
}
}
this.result = `${'-'.repeat(6)} 字库查询结果 ${'-'.repeat(32)}\n${res}`
},
calculate() {
var num = this.gb2312
if (this.dlOpt.tables.includes('gbk')) {
num += this.gbk
}
num += this.words
num += this.dy
if (this.dlOpt.tables.includes('emoji')) {
num += this.emoji
}
if (this.dlOpt.tables.includes('nethot')) {
num += this.nethot
}
if (this.dlOpt.tables.includes('code')) {
num += this.code
}
this.total = num
},
fileChange(ev) {
var reader = new FileReader()
var file = ev.target.files[0]
var all = new Set()
var unknow = new Set()
ev.target.value = ''
reader.onload = () => {
let arr = reader.result
.trim()
.split('\n')
.map(_ => _.trim())
for (let it of arr) {
it = it.replace(/[\w\s\t]+/g, '')
all.add(it)
if (
!WB_TABLE_GBK_TEMP.get(it) &&
!WB_WORDS.get(it) &&
!WB_DY.get(it)
) {
unknow.add(it)
}
}
all = Array.from(all)
unknow = Array.from(unknow)
this.preview =
`${file.name}\n本次上传, 含有 ${arr.length} 个词条(有效词条 ${all.length} 个)。\n` +
`其中字库中已经存在 ${all.length - unknow.length}个, 未存在词条 ${
unknow.length
} , 如下:\n\n${unknow.join('\t')}`
// window.unknow = unknow
// console.log(unknow)
// navigator.clipboard.writeText(Array.from(all).join('\n'))
}
reader.readAsText(file)
},
openDownloadPanel() {
this.$refs.dl.show()
},
closeDownloadPanel() {
this.$refs.dl.close()
},
download() {
var opt = { ...this.dlOpt }
var temp = new Enum()
temp.concat(WB_TABLE_2312)
//
if (opt.reverse) {
if (opt.tables.includes('gbk')) {
let bin = new Blob([WB_TABLE_GBK_TEMP.toString()], {
type: 'text/plain'
})
saveFile(bin, 'wb_table_gbk_reverse.txt')
} else {
let bin = new Blob([WB_TABLE_2312.toString()], { type: 'text/plain' })
saveFile(bin, 'wb_table_gb2312_reverse.txt')
}
}
//
temp.concat(WB_WORDS)
// emoji
if (opt.tables.includes('emoji')) {
temp.concat(WB_EMOJI)
}
//
if (opt.tables.includes('nethot')) {
temp.concat(WB_NET)
}
//
if (opt.tables.includes('code')) {
temp.concat(WB_CODE)
}
// gbk ,
if (opt.tables.includes('gbk')) {
temp.concat(WB_TABLE_GBK)
}
//
if (opt.tables.includes('dy')) {
temp.concat(WB_DY)
}
//
// if (opt.tables.includes('personal')) {
// temp.concat(WB_PERSONAL)
// }
let bin = new Blob([temp.toString(opt.pos === 'front')], {
type: 'text/plain'
})
saveFile(bin, `wb_table_${opt.pos}.txt`)
this.closeDownloadPanel()
}
}
}
</script>
<template>
<main>
<h1>{{content}}</h1>
</main>
</template>
<style lang="scss" scoped>
.main {
overflow: hidden;
flex: 1;
.wrapper {
height: 100%;
}
.table-info {
width: 100%;
height: 64px;
b {
color: var(--color-red-1);
}
.download {
margin-left: 32px;
}
}
.search {
width: 100%;
.field {
margin-top: 16px;
&.result {
line-height: 2;
font-family: Menlo;
word-wrap: break-word;
white-space: pre-wrap;
b {
letter-spacing: 2px;
color: var(--color-blue-1);
}
}
wc-input {
flex: 1;
}
}
}
.panel {
overflow: hidden;
flex: 1;
margin-top: 32px;
.custom-file {
position: relative;
width: 160px;
input {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
}
}
.tips {
color: var(--color-orange-3);
}
.scroll-view {
overflow: hidden;
flex: 1;
}
.preview {
margin-top: 16px;
font-family: Menlo;
word-break: keep-all;
white-space: pre-wrap;
}
}
}
.github {
position: fixed;
right: -30px;
top: 20px;
z-index: 9;
width: 120px;
height: 22px;
line-height: 22px;
text-align: center;
color: #fff;
background: var(--color-dark-1);
transform: rotate(45deg);
}
.download-layer {
width: 640px;
padding-bottom: 64px;
background: #fff;
.field {
margin-top: 16px;
padding: 0 16px;
.label {
min-width: 120px;
padding-right: 16px;
line-height: 32px;
text-align: right;
font-weight: bold;
color: var(--color-grey-3);
&::after {
content: ' : ';
}
}
.value {
line-height: 32px;
}
.tips {
margin-left: 16px;
line-height: 32px;
color: var(--color-orange-3);
}
&.ctrol {
padding: 0 128px;
margin-top: 64px;
}
}
}
@media screen and (max-width: 1024px) {
.topbar,
.main {
padding: 0 16px;
}
.wrapper {
width: 100%;
}
.footer {
.wrapper {
flex-direction: column;
align-items: center;
justify-content: center;
}
}
}
</style>

View File

@ -1,6 +1,7 @@
import { resolve } from 'path'
export default {
base: '/wb-table/',
devServer: {
port: 8080,
domain: '',
@ -18,7 +19,9 @@ export default {
// 这里的resolve可将相对路径转为绝对路径
// 如果传入的路径已经是绝对路径的, 可不需要resolve
entry: resolve('./src/main.js'),
title: 'vue-live 应用示例'
title: '五笔输入法86版',
keywords: '五笔输入法86版',
description: '五笔输入法86版'
}
},
// 以下cdn地址, 可自行修改为适合的