Skip to content

Commit 9fa1c73

Browse files
committed
代码优化
1 parent 509719a commit 9fa1c73

File tree

22 files changed

+57
-283
lines changed

22 files changed

+57
-283
lines changed

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"tabWidth": 4,
33
"useTabs": true,
44
"semi": true,
5-
"jsxBracketSameLine": true,
65
"singleQuote": false,
76
"printWidth": 100,
87
"trailingComma": "none"

build/plugins/cool.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,25 @@ const handler = {
5353
return d;
5454
});
5555

56-
const d = {
56+
const d: any = {
5757
table: {
5858
label,
5959
dict: list
6060
},
6161
form: {
6262
label,
63-
value: list[0]?.value,
6463
component: {
6564
name: "",
6665
options: list
6766
}
6867
}
6968
};
7069

70+
// 默认值
71+
if (list[0]) {
72+
d.form.value = list[0].value;
73+
}
74+
7175
// 匹配组件
7276
d.form.component.name = arr.length > 4 ? "el-select" : "el-radio-group";
7377

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "front-next",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"scripts": {
55
"dev": "vite --host",
66
"build": "vite build",
@@ -13,20 +13,15 @@
1313
"array.prototype.flat": "^1.2.4",
1414
"axios": "^0.21.1",
1515
"clipboard": "^2.0.8",
16-
"clone-deep": "^4.0.1",
1716
"codemirror": "^5.62.0",
1817
"core-js": "^3.6.5",
1918
"echarts": "^5.0.2",
2019
"element-plus": "^1.1.0-beta.20",
2120
"file-saver": "^2.0.5",
22-
"glob": "^7.1.6",
2321
"js-beautify": "^1.13.5",
24-
"merge": "^2.1.1",
25-
"merge-deep": "^3.0.3",
2622
"mitt": "^2.1.0",
2723
"mockjs": "^1.1.0",
2824
"nprogress": "^0.2.0",
29-
"qrcode": "^1.4.4",
3025
"quill": "^1.3.7",
3126
"socket.io-client": "^4.1.2",
3227
"store": "^2.0.12",

src/assets/css/element.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ $--colors: (
2323
);
2424

2525
@forward "element-plus/theme-chalk/src/common/var.scss" with (
26-
$colors: $--colors,
26+
$colors: $--colors
2727
);
2828

29-
3029
:export {
3130
colorPrimary: $color-primary;
3231
colorSuccess: $color-success;

src/cool/core/service/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ function useEps() {
129129
});
130130
}
131131

132-
console.log(service);
133-
134132
return res;
135133
})
136134
.catch((err: string) => {

src/cool/modules/base/components/dept/move.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export default defineComponent({
9797
border: "1px solid #eee",
9898
borderRadius: "3px",
9999
padding: "2px"
100-
}}>
100+
}}
101+
>
101102
<el-tree
102103
data={ctx.list}
103104
props={{
@@ -107,7 +108,8 @@ export default defineComponent({
107108
highlight-current
108109
onNodeClick={(e: any) => {
109110
scope["dept"] = e;
110-
}}></el-tree>
111+
}}
112+
></el-tree>
111113
</div>
112114
);
113115
}

src/cool/modules/base/components/dept/tree.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
</template>
6262

6363
<script lang="ts">
64-
import { defineComponent, inject, onMounted, ref } from "vue";
64+
import { defineComponent, onMounted, ref } from "vue";
6565
import { ElMessage, ElMessageBox } from "element-plus";
6666
import { ContextMenu } from "@cool-vue/crud";
6767
import { useCool } from "/@/cool";
@@ -84,7 +84,7 @@ export default defineComponent({
8484
emits: ["list-change", "row-click", "user-add"],
8585
8686
setup(props, { emit }) {
87-
const { refs, setRefs } = useCool();
87+
const { refs, setRefs, service } = useCool();
8888
8989
// 树形列表
9090
const list = ref<any[]>([]);
@@ -95,9 +95,6 @@ export default defineComponent({
9595
// 是否能拖动
9696
const isDrag = ref<boolean>(false);
9797
98-
// 请求服务
99-
const service = inject<any>("service");
100-
10198
// 允许托的规则
10299
function allowDrag({ data }: any) {
103100
return data.parentId;

src/cool/modules/base/components/menu/quick.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
<script lang="ts">
88
import { defineComponent } from "vue";
9-
import { useModule } from "/@/cool";
109
import { last, isEmpty } from "/@/cool/utils";
1110
import { ElMessage } from "element-plus";
12-
import { useCool } from "/@/cool/core";
11+
import { useCool } from "/@/cool";
1312
1413
export default defineComponent({
1514
name: "cl-menu-quick",

src/cool/modules/base/components/menu/slider/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ export default defineComponent({
110110
background-color="transparent"
111111
collapse-transition={false}
112112
collapse={ctx.browser.isMini ? false : ctx.menuCollapse}
113-
onSelect={ctx.toView}>
113+
onSelect={ctx.toView}
114+
>
114115
{children}
115116
</el-menu>
116117
</div>

src/cool/modules/base/components/menu/tree.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
</template>
3939

4040
<script lang="ts">
41-
import { computed, defineComponent, inject, onMounted, ref, watch } from "vue";
41+
import { computed, defineComponent, onMounted, ref, watch } from "vue";
42+
import { useCool } from "/@/cool";
4243
import { deepTree } from "/@/cool/utils";
4344
4445
export default defineComponent({
@@ -52,7 +53,7 @@ export default defineComponent({
5253
5354
setup(props, { emit }) {
5455
// 请求服务
55-
const service = inject<any>("service");
56+
const { service } = useCool();
5657
5758
// 关键字
5859
const keyword = ref<string>("");

0 commit comments

Comments
 (0)