Skip to content

Commit 1367236

Browse files
author
shangbin
committed
update: 移除所有不支持的el-icon图标
1 parent 5d6d7db commit 1367236

23 files changed

+305
-292
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ npm i
106106
npm run dev
107107
```
108108

109-
运行完成后,就可以访问[http://localhost:8008/](http://localhost:8008/)预览效果了.
109+
运行完成后,就可以访问[http://localhost:9818/](http://localhost:9818/)预览效果了.
110110

111111
## 使用介绍
112112

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
],
1010
"main": "./dist/vcc.umd.min.js",
1111
"scripts": {
12-
"dev": "vite --port 8008",
13-
"serve": "vite --port 8008",
12+
"dev": "vite --port 9818",
13+
"serve": "vite --port 9818",
1414
"build:release": "vite build --base=https://static.imonkey.xueersi.com/vcc3/",
15-
"build": "vue-cli-service build --report --target lib --name vcc './src/components-v2/VCC.vue' && node ./src/script/distClear.js",
15+
"build": "vue-cli-service build --report --target lib --name vcc './src/components-v2/VCC.vue'",
1616
"build:win": "vue-cli-service build --report --target lib --name vcc ./src/components-v2/VCC.vue && node ./src/script/distClear.js",
1717
"compileAndbuild:dev": "npm run compileComponent && vue-cli-service build",
1818
"lint": "vue-cli-service lint",
@@ -22,7 +22,7 @@
2222
"debugParser": "node ./src/test/parserJsCode.js"
2323
},
2424
"dependencies": {
25-
"@element-plus/icons": "0.0.11",
25+
"@element-plus/icons-vue": "^0.2.6",
2626
"@vitejs/plugin-vue": "^1.10.0",
2727
"@vue/compiler-sfc": "^3.2.22",
2828
"ant-design-vue": "^3.0.0-alpha.14",

src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<vcc :initCodeEntity="codeInfoEntity" @updateCodeEntity="onCodeUpdate"></vcc>
2+
<vcc :initCodeEntity="codeInfoEntity" @updateCodeEntity="onCodeUpdate" @onLoadFinish="onLoadFinish"></vcc>
33
</template>
44

55
<script>
@@ -39,6 +39,9 @@ export default {
3939
// 编辑后新的代码结构
4040
// codeRawVueInfo为template对象表示结构
4141
// JSCode为显式输入的JS逻辑
42+
},
43+
onLoadFinish(){
44+
4245
}
4346
}
4447
}

src/components-v2/VCC.vue

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<el-tooltip effect="dark" content="查看实时代码" placement="top-start">
3838
<img class="round-icon" :src="iconCode" alt="" @click="codeDialogVisible = true">
3939
</el-tooltip>
40-
<el-popconfirm confirmButtonText="确认" cancelButtonText="点错了" icon="el-icon-info" iconColor="red"
40+
<el-popconfirm confirmButtonText="确认" cancelButtonText="点错了" iconColor="red"
4141
title="点我将清空所有编辑的内容, 确认吗?" @confirm="clear">
4242
<template #reference>
4343
<img class="round-icon" :src="iconClear" alt="">
@@ -49,7 +49,7 @@
4949
<lc-code :rawCode="code" v-model:codeDialogVisible="codeDialogVisible">
5050
</lc-code>
5151
<code-structure @save="onSaveAttr" @remove="onRemove" ref="codeStructure" v-model="structureVisible"
52-
@reRender="render">
52+
@reRender="render" :initStructure="codeRawVueInfo">
5353
</code-structure>
5454
<CodeEditor v-model:codeDialogVisible="jsDialogVisible" @saveJSCode="saveJSCode" ref="codeEditor"></CodeEditor>
5555
<VueEditor v-model:vueDialogVisible="vueDialogVisible" @codeParseSucess="codeParseSucess"></VueEditor>
@@ -85,7 +85,7 @@ export default {
8585
}
8686
}
8787
},
88-
emits: ['updateCodeEntity'],
88+
emits: ['updateCodeEntity', 'onLoadFinish'],
8989
components: {
9090
RawComponents: defineAsyncComponent(() => import("@/components/RawComponents.vue")),
9191
ToolsBar: defineAsyncComponent(() => import("./ToolsBar")),
@@ -108,7 +108,7 @@ export default {
108108
109109
editMode: true,
110110
111-
codeRawVueInfo: "",
111+
codeRawVueInfo: null,
112112
JSCode: ""
113113
};
114114
},
@@ -135,7 +135,8 @@ export default {
135135
},
136136
computed: {
137137
},
138-
beforeCreate() { },
138+
beforeCreate() {
139+
},
139140
created() {
140141
this.mainPanelProvider = new MainPanelProvider();
141142
},
@@ -155,16 +156,16 @@ export default {
155156
methods: {
156157
convertLogicCode(JSCode) {
157158
try {
158-
const JSCodeInfo = eval(`(function(){return ${JSCode.replace(/\s+/g, "")}})()`);
159-
// 保留JS代码
160-
this.JSCode = JSCode;
161-
if (this.$refs.codeEditor) {
162-
this.$refs.codeEditor.updateLogicCode(JSCode);
163-
}
164-
return JSCodeInfo;
165-
} catch (e) {
166-
console.warn(`外部逻辑代码解析出错,解析的逻辑代码为: ${JSCode}, Error: ${e}`);
159+
const JSCodeInfo = eval(`(function(){return ${JSCode.replace(/\s+/g, "")}})()`);
160+
// 保留JS代码
161+
this.JSCode = JSCode;
162+
if (this.$refs.codeEditor) {
163+
this.$refs.codeEditor.updateLogicCode(JSCode);
167164
}
165+
return JSCodeInfo;
166+
} catch (e) {
167+
console.warn(`外部逻辑代码解析出错,解析的逻辑代码为: ${JSCode}, Error: ${e}`);
168+
}
168169
},
169170
170171
initShortcut() {
@@ -209,7 +210,7 @@ export default {
209210
}).onSelectElement(rawInfo => {
210211
this.currentEditRawInfo = rawInfo;
211212
}).saveJSCodeOnly(this.convertLogicCode(this.initCodeEntity.JSCode ? this.initCodeEntity.JSCode : ''))
212-
.render(this.initCodeEntity.codeStructure ? this.initCodeEntity.codeStructure : this.getFakeData());
213+
.render(this.initCodeEntity.codeStructure ? this.initCodeEntity.codeStructure : this.getFakeData());
213214
},
214215
215216
// 通知父组件

src/components/AttributeInput.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
<el-input v-model="item.key" :placeholder="'key' + index" class="half-width"></el-input>
1515
<div class="split">:</div>
1616
<el-input v-model="item.value" :placeholder="'value' + index" class="half-width" style="flex-grow: 3;"></el-input>
17-
<el-icon @click="deleteItem(index)" style="margin-left: 5px;"><minus /></el-icon>
17+
<el-icon @click="deleteItem(index)" style="margin-left: 5px;"><l-minus /></el-icon>
1818
</div>
1919

2020
<div class="quick-add-root">
2121
快速增加一些属性:
2222
<div style="margin-top: 5px;">
2323
<transition name="el-zoom-in-center">
24-
<el-tag v-if="attributeKeys.indexOf('class') == -1" size="mini" type="success" @click="onClassClick"
24+
<el-tag v-if="attributeKeys.indexOf('class') == -1" size="small" type="success" @click="onClassClick"
2525
effect="dark">Class
2626
</el-tag>
2727
</transition>
2828
<transition name="el-zoom-in-center">
29-
<el-tag v-if="attributeKeys.indexOf('@click') == -1" size="mini" type="success" @click="onEventClick"
29+
<el-tag v-if="attributeKeys.indexOf('@click') == -1" size="small" type="success" @click="onEventClick"
3030
effect="dark">点击事件</el-tag>
3131
</transition>
3232
<transition name="el-zoom-in-center">
33-
<el-tag v-if="!attributeKeys.includes('__text__')" size="mini" type="success" @click="onTextClick"
33+
<el-tag v-if="!attributeKeys.includes('__text__')" size="small" type="success" @click="onTextClick"
3434
effect="dark">文本内容</el-tag>
3535
</transition>
3636
</div>
@@ -52,12 +52,12 @@
5252
</el-tooltip>
5353
<el-tooltip class="item" effect="dark" content="保存属性 ctrl+s" placement="bottom">
5454
<el-button type="success" class="center" @click="save" circle>
55-
<el-icon><refresh /></el-icon>
55+
<el-icon><l-refresh /></el-icon>
5656
</el-button>
5757
</el-tooltip>
5858
<el-tooltip v-if="enableRemoveButton" class="item" effect="dark" content="移除该组件 ctrl+d" placement="bottom">
5959
<el-button type="danger" class="center" @click="remove" circle>
60-
<el-icon><delete /></el-icon>
60+
<el-icon><l-delete /></el-icon>
6161
</el-button>
6262
</el-tooltip>
6363
<el-tooltip v-if="enableBroButton" class="item" effect="dark" content="复制一个兄弟组件 ctrl+c" placement="bottom">
@@ -77,6 +77,7 @@
7777
import { getRawComponentKey, getRawComponentContent } from "@/utils/common";
7878
import { brotherEleEnum, copyBroCode } from "@/libs/bro-ele-config";
7979
import keymaster from "keymaster"
80+
import { store as _store } from "@/libs/store.js";
8081
8182
export default {
8283
props: ['__rawVueInfo__', 'enableRemoveButton', 'shortcutInitMode'],// __rawVueInfo__为当前编辑的原始代码对象, shortcutInitMode快捷键的初始化方式
@@ -197,7 +198,7 @@ export default {
197198
},
198199
copyBro() {
199200
copyBroCode(this.__rawVueInfo__);
200-
this.$store.commit('onDragEnd');
201+
_store.commit('onDragEnd');
201202
},
202203
onShow() {
203204
// 这种方式适用于常规模式下的初始化,因为这个实例初始化后不会被销毁,一直常驻内存。但又不能受到其它实例销毁时的影响,所以需要明确的再次初始化。

src/components/CodeStructure.vue

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<el-drawer v-model="drawer" :with-header="false" size="70%" direction="btt">
3-
<div class="container">
3+
<div class="cs-container">
44

5-
<div style="text-align: center;">组件结构检视图
5+
<div class="center">组件结构检视图
66
<br>
77
<span style="font-size:12px;">Components
88
Structure</span>
@@ -28,12 +28,13 @@
2828
</template>
2929

3030
<script>
31-
import { isObject, getRawComponentKey, getRawComponentContent } from "@/utils/common";
31+
import { getRawComponentContent } from "@/utils/common";
3232
import nestedDraggable from './nested.vue'
3333
import { defineAsyncComponent } from 'vue'
34+
import { store as _store } from "@/libs/store.js";
3435
3536
export default {
36-
props: ['visible'],
37+
props: ['visible', 'initStructure'],
3738
emits: ['onLevelChange', 'remove', 'save', 'update:visible', 'reRender'],
3839
components: {
3940
AttributeInput: defineAsyncComponent(() => import("@/components/AttributeInput.vue")),
@@ -50,6 +51,7 @@ export default {
5051
created() { },
5152
beforeMount() { },
5253
mounted() {
54+
this.updateCode(this.initStructure);
5355
},
5456
beforeUpdate() { },
5557
updated() { },
@@ -70,15 +72,17 @@ export default {
7072
},
7173
7274
updateCode(codeRawInfo) {
73-
this._codeRawInfo = codeRawInfo;
74-
const content = getRawComponentContent(codeRawInfo);
75-
const children = content.__children;
76-
this.treeData = children;
75+
if (codeRawInfo) {
76+
this._codeRawInfo = codeRawInfo;
77+
const content = getRawComponentContent(codeRawInfo);
78+
const children = content.__children;
79+
this.treeData = children;
80+
}
7781
},
7882
7983
},
8084
watch: {
81-
renderCount(){
85+
renderCount() {
8286
// 这里利用了vuedraggable v-model的特性,它会更改对象本身的引用
8387
this.$emit('reRender', this._codeRawInfo);
8488
}
@@ -93,16 +97,16 @@ export default {
9397
}
9498
},
9599
96-
renderCount(){
97-
return this.$store.state.renderCount;
100+
renderCount() {
101+
return _store.state.renderCount;
98102
},
99103
100104
canInitShortcut() {
101105
return this.currentEditRawInfo !== null && this.drawer;
102106
},
103107
currentEditRawInfo() {
104-
if (this.$store.state.currentEditComp) {
105-
const vccData = this.$store.state.currentEditComp.vccData;
108+
if (_store.state.currentEditComp) {
109+
const vccData = _store.state.currentEditComp.vccData;
106110
return window.tree[vccData.lc_id];
107111
} else {
108112
return null;
@@ -116,15 +120,16 @@ export default {
116120
<style scoped>
117121
/* 在此自动生成 */
118122
119-
center {
123+
.center {
120124
padding: 20px;
125+
text-align: center;
121126
}
122127
123128
:v-deep(.el-drawer__body) {
124129
height: 100%;
125130
}
126131
127-
.container {
132+
.cs-container {
128133
height: 100%;
129134
display: flex;
130135
flex-direction: column;

src/components/JSCodeEditorDialog.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
2-
<el-dialog title="JS逻辑编辑" v-model="codeDialogVisible" width="70%" top="10vh" :before-close="handleClose"
3-
:center=true>
2+
<el-dialog title="JS逻辑编辑" v-model="codeDialogVisible" width="70%" top="10vh" :before-close="handleClose" :center=true>
43
<CodeEditor style="max-height: 65vh;" ref="codeEditor" :initCode="code" mode="text/javascript"></CodeEditor>
54

65
<div style="padding: 10px; display:flex;justify-content: flex-end;align-items: center;">
@@ -11,7 +10,12 @@
1110

1211
<div style="margin-left: 5px;">
1312
<el-link href="https://vcc.sahadev.tech/doc/#/improve/logic?id=%e9%80%bb%e8%be%91%e6%a8%a1%e6%9d%bf"
14-
target="_blank" icon="el-icon-question">帮助与说明</el-link>
13+
target="_blank">
14+
<el-icon>
15+
<question-filled />
16+
</el-icon>
17+
帮助与说明
18+
</el-link>
1519
<div style="color: #6c6c6c; font-size:12px; margin-top:5px;">Tips: 建议看一下使用说明</div>
1620
</div>
1721
</div>

src/components/RawComponents.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<nav style="display:flex;">
55
<div :index="index + ''" v-for="(item, index) in iconArray" @click="onSelectElement(index)" :key="item.icon"
66
:class="{'active':currentIndex === index}" class="main-icon-container">
7-
<img v-if="item.enable" :src="item.icon" class="icon">
7+
<img v-if="item.enable" :src="item.icon" class="l-icon">
88
<el-tooltip v-else class="item" effect="dark" content="暂未开放,敬请期待" placement="right">
99
<img :src="item.icon" class="icon" style="width: 34px;height: 34px;">
1010
</el-tooltip>
@@ -23,11 +23,11 @@
2323
</span>
2424
<template #dropdown>
2525
<el-dropdown-menu>
26-
<el-dropdown-item icon="el-icon-circle-check">基础组件数: {{ componentUnitNum }}
26+
<el-dropdown-item>基础组件数: {{ componentUnitNum }}
2727
</el-dropdown-item>
28-
<el-dropdown-item icon="el-icon-document" command="lcg">LCG平台</el-dropdown-item>
29-
<el-dropdown-item icon="el-icon-document" command="help">说明文档</el-dropdown-item>
30-
<el-dropdown-item icon="el-icon-chat-line-round" command="chat">在线沟通</el-dropdown-item>
28+
<el-dropdown-item command="lcg">LCG平台</el-dropdown-item>
29+
<el-dropdown-item command="help">说明文档</el-dropdown-item>
30+
<el-dropdown-item command="chat">在线沟通</el-dropdown-item>
3131
</el-dropdown-menu>
3232
</template>
3333
</el-dropdown>
@@ -38,7 +38,7 @@
3838
<nav v-if="currentSelectBrand.titleArray && currentSelectBrand.titleArray.length > 0">
3939
<div style="margin-bottom:10px;text-align:center;">
4040
<div style="padding:5px;font-size:12px;color:grey;">快速查找需要的</div>
41-
<el-autocomplete class="inline-input" v-model="componentSearch" :fetch-suggestions="querySearch" size="mini"
41+
<el-autocomplete class="inline-input" v-model="componentSearch" :fetch-suggestions="querySearch" size="small"
4242
placeholder="请输入..." @select="handleSelect"></el-autocomplete>
4343
</div>
4444
<div class="dismiss-scroll">
@@ -249,7 +249,7 @@ nav {
249249
}
250250
}
251251
252-
.icon {
252+
.l-icon {
253253
width: 34px;
254254
height: 34px;
255255
border-radius: 5px;

0 commit comments

Comments
 (0)