Skip to content

Commit

Permalink
Merge pull request #941 from chat2db/dev
Browse files Browse the repository at this point in the history
iconfont
  • Loading branch information
shanhexi authored Dec 8, 2023
2 parents 3e692f6 + 196ab50 commit a9ac15a
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 156 deletions.
4 changes: 2 additions & 2 deletions chat2db-client/.umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export default defineConfig({
// }],
links: [{ rel: 'icon', type: 'image/ico', sizes: '32x32', href: '/static/front/logo.ico' }],
headScripts: [
`if (localStorage.getItem('app-local-storage-versions') !== 'v3') {
`if (localStorage.getItem('app-local-storage-versions') !== 'v4') {
localStorage.clear();
localStorage.setItem('app-local-storage-versions', 'v3');
localStorage.setItem('app-local-storage-versions', 'v4');
}`,
`if (window.electronApi) { window.electronApi.startServerForSpawn() }`,
// `if ("serviceWorker" in navigator) {
Expand Down
167 changes: 72 additions & 95 deletions chat2db-client/src/assets/font/demo_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" targ
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">

<li class="dib">
<span class="icon iconfont">&#xe726;</span>
<div class="name">加号</div>
<div class="code-name">&amp;#xe726;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xec6b;</span>
<div class="name">列表</div>
<div class="code-name">&amp;#xec6b;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe65d;</span>
<div class="name">减去</div>
<div class="code-name">&amp;#xe65d;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe669;</span>
<div class="name">database</div>
Expand Down Expand Up @@ -108,30 +126,6 @@ <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" targ
<div class="code-name">&amp;#xe691;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe678;</span>
<div class="name">电话_填充</div>
<div class="code-name">&amp;#xe678;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe672;</span>
<div class="name">邮箱</div>
<div class="code-name">&amp;#xe672;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe65d;</span>
<div class="name">微信</div>
<div class="code-name">&amp;#xe65d;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xeaa8;</span>
<div class="name">谷歌</div>
<div class="code-name">&amp;#xeaa8;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#x100be;</span>
<div class="name">下箭头-copy</div>
Expand Down Expand Up @@ -1236,9 +1230,9 @@ <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</co
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1700381336886') format('woff2'),
url('iconfont.woff?t=1700381336886') format('woff'),
url('iconfont.ttf?t=1700381336886') format('truetype');
src: url('iconfont.woff2?t=1702019801419') format('woff2'),
url('iconfont.woff?t=1702019801419') format('woff'),
url('iconfont.ttf?t=1702019801419') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
Expand All @@ -1264,6 +1258,33 @@ <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面
<div class="content font-class">
<ul class="icon_lists dib-box">

<li class="dib">
<span class="icon iconfont icon-jiahao"></span>
<div class="name">
加号
</div>
<div class="code-name">.icon-jiahao
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-liebiao"></span>
<div class="name">
列表
</div>
<div class="code-name">.icon-liebiao
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-jianqu"></span>
<div class="name">
减去
</div>
<div class="code-name">.icon-jianqu
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-database"></span>
<div class="name">
Expand Down Expand Up @@ -1345,42 +1366,6 @@ <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-dianhuatianchong"></span>
<div class="name">
电话_填充
</div>
<div class="code-name">.icon-dianhuatianchong
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-youxiang"></span>
<div class="name">
邮箱
</div>
<div class="code-name">.icon-youxiang
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-weixin"></span>
<div class="name">
微信
</div>
<div class="code-name">.icon-weixin
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-google"></span>
<div class="name">
谷歌
</div>
<div class="code-name">.icon-google
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-xiajiantou1-copy"></span>
<div class="name">
Expand Down Expand Up @@ -3037,6 +3022,30 @@ <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h
<div class="content symbol">
<ul class="icon_lists dib-box">

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jiahao"></use>
</svg>
<div class="name">加号</div>
<div class="code-name">#icon-jiahao</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-liebiao"></use>
</svg>
<div class="name">列表</div>
<div class="code-name">#icon-liebiao</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jianqu"></use>
</svg>
<div class="name">减去</div>
<div class="code-name">#icon-jianqu</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-database"></use>
Expand Down Expand Up @@ -3109,38 +3118,6 @@ <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h
<div class="code-name">#icon-moxing-miaobian</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-dianhuatianchong"></use>
</svg>
<div class="name">电话_填充</div>
<div class="code-name">#icon-dianhuatianchong</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-youxiang"></use>
</svg>
<div class="name">邮箱</div>
<div class="code-name">#icon-youxiang</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-weixin"></use>
</svg>
<div class="name">微信</div>
<div class="code-name">#icon-weixin</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-google"></use>
</svg>
<div class="name">谷歌</div>
<div class="code-name">#icon-google</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xiajiantou1-copy"></use>
Expand Down
34 changes: 15 additions & 19 deletions chat2db-client/src/assets/font/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3633546 */
src: url('iconfont.woff2?t=1700381336886') format('woff2'),
url('iconfont.woff?t=1700381336886') format('woff'),
url('iconfont.ttf?t=1700381336886') format('truetype');
src: url('iconfont.woff2?t=1702019801419') format('woff2'),
url('iconfont.woff?t=1702019801419') format('woff'),
url('iconfont.ttf?t=1702019801419') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,18 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-jiahao:before {
content: "\e726";
}

.icon-liebiao:before {
content: "\ec6b";
}

.icon-jianqu:before {
content: "\e65d";
}

.icon-database:before {
content: "\e669";
}
Expand Down Expand Up @@ -49,22 +61,6 @@
content: "\e691";
}

.icon-dianhuatianchong:before {
content: "\e678";
}

.icon-youxiang:before {
content: "\e672";
}

.icon-weixin:before {
content: "\e65d";
}

.icon-google:before {
content: "\eaa8";
}

.icon-xiajiantou1-copy:before {
content: "\100be";
}
Expand Down
2 changes: 1 addition & 1 deletion chat2db-client/src/assets/font/iconfont.js

Large diffs are not rendered by default.

49 changes: 21 additions & 28 deletions chat2db-client/src/assets/font/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "577312",
"name": "加号",
"font_class": "jiahao",
"unicode": "e726",
"unicode_decimal": 59174
},
{
"icon_id": "5961366",
"name": "列表",
"font_class": "liebiao",
"unicode": "ec6b",
"unicode_decimal": 60523
},
{
"icon_id": "6318169",
"name": "减去",
"font_class": "jianqu",
"unicode": "e65d",
"unicode_decimal": 58973
},
{
"icon_id": "5729483",
"name": "database",
Expand Down Expand Up @@ -68,34 +89,6 @@
"unicode": "e691",
"unicode_decimal": 59025
},
{
"icon_id": "145699",
"name": "电话_填充",
"font_class": "dianhuatianchong",
"unicode": "e678",
"unicode_decimal": 59000
},
{
"icon_id": "3483765",
"name": "邮箱",
"font_class": "youxiang",
"unicode": "e672",
"unicode_decimal": 58994
},
{
"icon_id": "15933094",
"name": "微信",
"font_class": "weixin",
"unicode": "e65d",
"unicode_decimal": 58973
},
{
"icon_id": "19447816",
"name": "谷歌",
"font_class": "google",
"unicode": "eaa8",
"unicode_decimal": 60072
},
{
"icon_id": "37968169",
"name": "下箭头-copy",
Expand Down
Binary file modified chat2db-client/src/assets/font/iconfont.ttf
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion chat2db-client/src/blocks/DatabaseTableEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export default memo((props: IProps) => {
});
}
// 保存成功后,刷新左侧树
submitCallback();
submitCallback?.();
};

return (
Expand Down
Loading

0 comments on commit a9ac15a

Please sign in to comment.