@ditari/bsui 1.1.48 → 1.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/cjs/layout/Show.vue2.cjs.map +1 -1
- package/dist/cjs/menu/Menu.cjs +6 -1
- package/dist/cjs/menu/Menu.cjs.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/layout/style/index.css +1 -1
- package/dist/css/layout/style/main.css +1 -1
- package/dist/esm/layout/Show.vue2.mjs.map +1 -1
- package/dist/esm/menu/Menu.mjs +6 -1
- package/dist/esm/menu/Menu.mjs.map +1 -1
- package/dist/style/layout/style/main.scss +0 -1
- package/package.json +5 -1
- package/example/index.html +0 -13
- package/example/node_modules/.vite/deps/@ant-design_icons-vue.js +0 -29406
- package/example/node_modules/.vite/deps/@ant-design_icons-vue.js.map +0 -7
- package/example/node_modules/.vite/deps/@vueuse_core.js +0 -8255
- package/example/node_modules/.vite/deps/@vueuse_core.js.map +0 -7
- package/example/node_modules/.vite/deps/_metadata.json +0 -80
- package/example/node_modules/.vite/deps/ant-design-vue.js +0 -62756
- package/example/node_modules/.vite/deps/ant-design-vue.js.map +0 -7
- package/example/node_modules/.vite/deps/axios.js +0 -2126
- package/example/node_modules/.vite/deps/axios.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-5WWUZCGV.js +0 -36
- package/example/node_modules/.vite/deps/chunk-5WWUZCGV.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-D36HXFYL.js +0 -25
- package/example/node_modules/.vite/deps/chunk-D36HXFYL.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-EBDM3ESC.js +0 -161
- package/example/node_modules/.vite/deps/chunk-EBDM3ESC.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-EKNPBJBG.js +0 -3600
- package/example/node_modules/.vite/deps/chunk-EKNPBJBG.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-GK7Q6YQN.js +0 -10796
- package/example/node_modules/.vite/deps/chunk-GK7Q6YQN.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-TDI2FIXO.js +0 -19
- package/example/node_modules/.vite/deps/chunk-TDI2FIXO.js.map +0 -7
- package/example/node_modules/.vite/deps/package.json +0 -3
- package/example/node_modules/.vite/deps/pinia-plugin-persistedstate.js +0 -125
- package/example/node_modules/.vite/deps/pinia-plugin-persistedstate.js.map +0 -7
- package/example/node_modules/.vite/deps/pinia.js +0 -1519
- package/example/node_modules/.vite/deps/pinia.js.map +0 -7
- package/example/node_modules/.vite/deps/vue-request.js +0 -1191
- package/example/node_modules/.vite/deps/vue-request.js.map +0 -7
- package/example/node_modules/.vite/deps/vue-router.js +0 -2667
- package/example/node_modules/.vite/deps/vue-router.js.map +0 -7
- package/example/node_modules/.vite/deps/vue.js +0 -314
- package/example/node_modules/.vite/deps/vue.js.map +0 -7
- package/example/package.json +0 -17
- package/example/src/App.vue +0 -7
- package/example/src/api/list.ts +0 -22
- package/example/src/api/user.ts +0 -13
- package/example/src/components/AppMain.vue +0 -113
- package/example/src/hooks.ts +0 -103
- package/example/src/main.ts +0 -22
- package/example/src/router/form/index.route.ts +0 -23
- package/example/src/router/index.ts +0 -61
- package/example/src/router/table/index.route.ts +0 -39
- package/example/src/views/Demo.vue +0 -49
- package/example/src/views/DemoBk.vue +0 -34
- package/example/src/views/Login.vue +0 -79
- package/example/src/views/form/List.vue +0 -16
- package/example/src/views/form/List2.vue +0 -74
- package/example/src/views/form/QueryFormDemo.vue +0 -49
- package/example/src/views/form/dyn/List.vue +0 -121
- package/example/src/views/table/Add.vue +0 -379
- package/example/src/views/table/Demo.vue +0 -15
- package/example/src/views/table/Demo2.vue +0 -12
- package/example/src/views/table/Edit.vue +0 -10
- package/example/src/views/table/List.vue +0 -415
- package/example/src/views/table/Test.tsx +0 -42
- package/example/src/views/table/TestModal.vue +0 -64
- package/example/src/views/table/WorkStatusRound.vue +0 -31
- package/example/src/views/table/components/AddForm.vue +0 -44
- package/example/src/views/table/hooks.ts +0 -106
- package/example/src/views/task/Todo.vue +0 -6
- package/example/tsconfig.json +0 -16
- package/example/utils/http.ts +0 -107
- package/example/vite-env.d.ts +0 -8
- package/example/vite.config.ts +0 -10
- package/src/_utils/html.ts +0 -17
- package/src/_utils/install.ts +0 -12
- package/src/components.ts +0 -10
- package/src/config/Config.vue +0 -8
- package/src/date/RangePicker.tsx +0 -93
- package/src/date/index.ts +0 -9
- package/src/desensitize/Desensitize.tsx +0 -97
- package/src/desensitize/index.ts +0 -9
- package/src/desensitize/style/index.scss +0 -8
- package/src/dic/DicReplace.tsx +0 -63
- package/src/dic/index.ts +0 -8
- package/src/dic/replace.worker.ts +0 -25
- package/src/form/DQueryForm.tsx +0 -258
- package/src/form/index.ts +0 -9
- package/src/form/style/index.less +0 -0
- package/src/grid/Grid.tsx +0 -83
- package/src/grid/GridItem.tsx +0 -15
- package/src/grid/index.md +0 -4
- package/src/grid/index.ts +0 -16
- package/src/grid/style/index.scss +0 -70
- package/src/index.scss +0 -19
- package/src/index.ts +0 -49
- package/src/json-scheme-render/JsonSchemeRender.tsx +0 -101
- package/src/json-scheme-render/index.ts +0 -9
- package/src/layout/Breadcrumb.vue +0 -39
- package/src/layout/FuckMain.vue +0 -90
- package/src/layout/List.vue +0 -145
- package/src/layout/Main.vue +0 -97
- package/src/layout/NavTabs.vue +0 -129
- package/src/layout/Show.vue +0 -136
- package/src/layout/index.ts +0 -24
- package/src/layout/style/breadcrumb.scss +0 -61
- package/src/layout/style/fuckmain.scss +0 -21
- package/src/layout/style/index.scss +0 -35
- package/src/layout/style/list.scss +0 -26
- package/src/layout/style/main.scss +0 -75
- package/src/layout/style/navtab.scss +0 -146
- package/src/layout/style/show.scss +0 -50
- package/src/menu/Menu.tsx +0 -181
- package/src/menu/style/index.scss +0 -26
- package/src/modal/Modal.tsx +0 -83
- package/src/modal/index.ts +0 -9
- package/src/modal/style/index.scss +0 -74
- package/src/select/Select.vue +0 -177
- package/src/select/dic.worker.ts +0 -32
- package/src/select/index.ts +0 -9
- package/src/table/Field.vue +0 -44
- package/src/table/Table.tsx +0 -515
- package/src/table/index.md +0 -1
- package/src/table/index.ts +0 -9
- package/src/table/interface/table.ts +0 -64
- package/src/table/style/index.scss +0 -10
- package/src/theme/index.ts +0 -1
- package/src/theme/theme.scss +0 -1
- package/src/theme/variable.scss +0 -67
package/src/form/DQueryForm.tsx
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import { defineComponent, onMounted, ref, watch, watchEffect } from "vue";
|
|
2
|
-
import { Form, FormItem, Row, Col, Button, Space } from "ant-design-vue";
|
|
3
|
-
import {
|
|
4
|
-
SearchOutlined,
|
|
5
|
-
ReloadOutlined,
|
|
6
|
-
DoubleRightOutlined
|
|
7
|
-
} from "@ant-design/icons-vue";
|
|
8
|
-
import DJsonSchemeRender from "../json-scheme-render/JsonSchemeRender";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 查询表单渲染
|
|
12
|
-
* 展开,隐藏功能
|
|
13
|
-
*/
|
|
14
|
-
export default defineComponent({
|
|
15
|
-
name: "DQueryForm",
|
|
16
|
-
props: {
|
|
17
|
-
scheme: {
|
|
18
|
-
type: [Array, Object] as unknown as () => any[] | Record<string, any>,
|
|
19
|
-
default: () => []
|
|
20
|
-
},
|
|
21
|
-
model: {
|
|
22
|
-
type: Object as () => Record<string, unknown>,
|
|
23
|
-
default: () => ({})
|
|
24
|
-
},
|
|
25
|
-
labelWidth: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "90px"
|
|
28
|
-
},
|
|
29
|
-
loading: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
emits: ["reset", "query"],
|
|
35
|
-
setup(props, { slots, emit }) {
|
|
36
|
-
// 表单
|
|
37
|
-
const { loading, modelValue, formRef, onQuery, onReset, onKeyup } =
|
|
38
|
-
useForm();
|
|
39
|
-
// 展开
|
|
40
|
-
const { rowRef, actionSpan, onExpend, expendBtnVisible, isExpend } =
|
|
41
|
-
useExpand();
|
|
42
|
-
//渲染操作列
|
|
43
|
-
const { renderAction } = useRender();
|
|
44
|
-
|
|
45
|
-
function useForm() {
|
|
46
|
-
const loading = ref(false);
|
|
47
|
-
const formRef = ref<any>(null);
|
|
48
|
-
const modelValue = ref<any>({});
|
|
49
|
-
|
|
50
|
-
watchEffect(() => {
|
|
51
|
-
modelValue.value = props.model;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
watch(
|
|
55
|
-
() => props.loading,
|
|
56
|
-
(val) => {
|
|
57
|
-
loading.value = val;
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
/// 监听回车事件
|
|
62
|
-
// watch(enterKey, (v) => {
|
|
63
|
-
// if (v) {
|
|
64
|
-
// // 有路由名字会被keepalive进行缓存
|
|
65
|
-
// // 用于判断当前页面是否被激活 因为页面被缓存的时候,页面切换后,回车事件依然会触发
|
|
66
|
-
// const isActive = keepStore.list.some((name) => name === route.name);
|
|
67
|
-
// console.log(route.name);
|
|
68
|
-
// if (!loading.value && isActive) {
|
|
69
|
-
// emit("query", modelValue.value);
|
|
70
|
-
// }
|
|
71
|
-
// //TODO 逻辑有问题
|
|
72
|
-
// if (!route.name) {
|
|
73
|
-
// // 没有路由名字,不会被缓存
|
|
74
|
-
// if (!loading.value) {
|
|
75
|
-
// emit("query", modelValue.value);
|
|
76
|
-
// }
|
|
77
|
-
// } else {
|
|
78
|
-
//
|
|
79
|
-
// }
|
|
80
|
-
// }
|
|
81
|
-
// });
|
|
82
|
-
|
|
83
|
-
const onQuery = () => {
|
|
84
|
-
emit("query", modelValue.value);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const onReset = () => {
|
|
88
|
-
formRef.value?.resetFields();
|
|
89
|
-
emit("reset");
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const onKeyup = (event: any) => {
|
|
93
|
-
if (event.keyCode === 13) {
|
|
94
|
-
if (!loading.value) {
|
|
95
|
-
emit("query", modelValue.value);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
return {
|
|
100
|
-
loading,
|
|
101
|
-
modelValue,
|
|
102
|
-
formRef,
|
|
103
|
-
onQuery,
|
|
104
|
-
onReset,
|
|
105
|
-
onKeyup
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function useRender() {
|
|
110
|
-
/**
|
|
111
|
-
* 操作按钮渲染
|
|
112
|
-
*/
|
|
113
|
-
function renderAction() {
|
|
114
|
-
return (
|
|
115
|
-
<Space>
|
|
116
|
-
<Button
|
|
117
|
-
loading={loading.value}
|
|
118
|
-
type={"primary"}
|
|
119
|
-
shape={"round"}
|
|
120
|
-
onClick={onQuery}
|
|
121
|
-
>
|
|
122
|
-
{{
|
|
123
|
-
default: () => "查询",
|
|
124
|
-
icon: () => <SearchOutlined />
|
|
125
|
-
}}
|
|
126
|
-
</Button>
|
|
127
|
-
<Button disabled={loading.value} shape={"round"} onClick={onReset}>
|
|
128
|
-
{{
|
|
129
|
-
default: () => "重置",
|
|
130
|
-
icon: () => <ReloadOutlined />
|
|
131
|
-
}}
|
|
132
|
-
</Button>
|
|
133
|
-
{expendBtnVisible.value ? (
|
|
134
|
-
<Button onClick={onExpend} shape={"round"}>
|
|
135
|
-
{{
|
|
136
|
-
default: () => (isExpend.value ? "收起" : "展开"),
|
|
137
|
-
icon: () => (
|
|
138
|
-
<DoubleRightOutlined rotate={isExpend.value ? -90 : 90} />
|
|
139
|
-
)
|
|
140
|
-
}}
|
|
141
|
-
</Button>
|
|
142
|
-
) : null}
|
|
143
|
-
</Space>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return {
|
|
148
|
-
renderAction
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function useExpand() {
|
|
153
|
-
// 为24网格布局
|
|
154
|
-
const gridCount = 24;
|
|
155
|
-
// 每列占6个格子
|
|
156
|
-
const colSpan = 6;
|
|
157
|
-
// 每行显示4列
|
|
158
|
-
const colsPerRow = 4;
|
|
159
|
-
// 操作按钮span
|
|
160
|
-
const actionSpan = ref(6);
|
|
161
|
-
// 控制展开或隐藏按钮文本
|
|
162
|
-
const isExpend = ref(false);
|
|
163
|
-
// 控制展开按按钮是否显示
|
|
164
|
-
const expendBtnVisible = ref(false);
|
|
165
|
-
// 行对象
|
|
166
|
-
const rowRef = ref<any>(null);
|
|
167
|
-
|
|
168
|
-
onMounted(() => {
|
|
169
|
-
handleShowOrHidden();
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
function onExpend() {
|
|
173
|
-
isExpend.value = !isExpend.value;
|
|
174
|
-
handleShowOrHidden();
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* 处理隐藏或显示
|
|
179
|
-
*/
|
|
180
|
-
function handleShowOrHidden() {
|
|
181
|
-
const colEl = Array.from(rowRef.value?.$el?.children);
|
|
182
|
-
// col总条数 减掉操作栏按钮的div个数为1
|
|
183
|
-
const colElLen = colEl.length - 1;
|
|
184
|
-
// 已占用的网格数 = col总条数 * 每列占用的网格数
|
|
185
|
-
const occupiedCols = colElLen * colSpan;
|
|
186
|
-
// 总行数 = 总div数 / 每行显示的列数
|
|
187
|
-
const fullRows = Math.ceil(colElLen / colsPerRow);
|
|
188
|
-
// 最后一行的网格数 = 已占用的网格数 % 24
|
|
189
|
-
const lastRowCols = occupiedCols % gridCount;
|
|
190
|
-
// 最后一行剩余的网格数
|
|
191
|
-
const remainingCols = gridCount - lastRowCols;
|
|
192
|
-
|
|
193
|
-
// 网格行大于2才显示展开或隐藏按钮
|
|
194
|
-
if (fullRows > 2) {
|
|
195
|
-
expendBtnVisible.value = true;
|
|
196
|
-
} else {
|
|
197
|
-
// 如果没有大于两行,操作栏占用剩余的宽度
|
|
198
|
-
actionSpan.value = remainingCols;
|
|
199
|
-
}
|
|
200
|
-
// 最后一行的起始索引
|
|
201
|
-
const lastRowStartIndex = colsPerRow * (fullRows - 1) - 1;
|
|
202
|
-
// 只有展开按钮显示时才处理
|
|
203
|
-
if (expendBtnVisible.value) {
|
|
204
|
-
colEl.forEach((col: any, index) => {
|
|
205
|
-
if (index >= lastRowStartIndex) {
|
|
206
|
-
// 最后一个元素不隐藏 是操作按钮的div
|
|
207
|
-
index !== colElLen
|
|
208
|
-
? (col.style.display = !isExpend.value ? "none" : "block")
|
|
209
|
-
: null; // 隐藏元素
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (expendBtnVisible.value) {
|
|
215
|
-
// 如果是展开状态 则操作按钮占用剩余的网格数 否则占用6个网格
|
|
216
|
-
isExpend.value
|
|
217
|
-
? (actionSpan.value = remainingCols)
|
|
218
|
-
: (actionSpan.value = colSpan);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
rowRef,
|
|
224
|
-
actionSpan,
|
|
225
|
-
onExpend,
|
|
226
|
-
expendBtnVisible,
|
|
227
|
-
isExpend
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return () => (
|
|
232
|
-
<div onKeyup={onKeyup}>
|
|
233
|
-
<Form
|
|
234
|
-
ref={formRef}
|
|
235
|
-
colon={false}
|
|
236
|
-
labelCol={{ style: { width: props.labelWidth } }}
|
|
237
|
-
model={modelValue.value}
|
|
238
|
-
>
|
|
239
|
-
<Row ref={rowRef}>
|
|
240
|
-
{slots.default ? (
|
|
241
|
-
slots.default()
|
|
242
|
-
) : (
|
|
243
|
-
<DJsonSchemeRender
|
|
244
|
-
layout={props.scheme}
|
|
245
|
-
value={modelValue.value}
|
|
246
|
-
/>
|
|
247
|
-
)}
|
|
248
|
-
<Col span={actionSpan.value} style={{ textAlign: "right" }}>
|
|
249
|
-
<FormItem>
|
|
250
|
-
{slots.action ? slots.action() : renderAction()}
|
|
251
|
-
</FormItem>
|
|
252
|
-
</Col>
|
|
253
|
-
</Row>
|
|
254
|
-
</Form>
|
|
255
|
-
</div>
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
});
|
package/src/form/index.ts
DELETED
|
File without changes
|
package/src/grid/Grid.tsx
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ref, defineComponent } from "vue";
|
|
2
|
-
import { useResizeObserver } from "@vueuse/core";
|
|
3
|
-
import { storeToRefs } from "pinia";
|
|
4
|
-
|
|
5
|
-
import { useSettingsStore } from "@ditari/store";
|
|
6
|
-
import { prefixName } from "../theme";
|
|
7
|
-
|
|
8
|
-
import GridItem from "./GridItem";
|
|
9
|
-
|
|
10
|
-
//class名称
|
|
11
|
-
const baseClassName = `${prefixName}-grid`;
|
|
12
|
-
|
|
13
|
-
export default defineComponent({
|
|
14
|
-
name: "DGrid",
|
|
15
|
-
props: {
|
|
16
|
-
// css class
|
|
17
|
-
className: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: ""
|
|
20
|
-
},
|
|
21
|
-
// 是否补全空白单元格
|
|
22
|
-
fill: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: true
|
|
25
|
-
},
|
|
26
|
-
grid: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: ""
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
setup(props, { slots }: any) {
|
|
32
|
-
if (!slots.default) {
|
|
33
|
-
return () => <>ok</>;
|
|
34
|
-
}
|
|
35
|
-
// 从store获取网格配置信息
|
|
36
|
-
const store = useSettingsStore();
|
|
37
|
-
// 转换成响应式对象 不使用storeToRefs的对象被解构后失去”响应式“
|
|
38
|
-
const { gridValue } = storeToRefs(store);
|
|
39
|
-
|
|
40
|
-
// 获取单元格个数
|
|
41
|
-
const length =
|
|
42
|
-
slots?.default()[0]?.children.length || slots?.default().length;
|
|
43
|
-
|
|
44
|
-
// 要填充空白的网格数
|
|
45
|
-
const fillGridItems = ref<number[]>([]);
|
|
46
|
-
|
|
47
|
-
gridValue.value.value = props.grid || gridValue.value.value;
|
|
48
|
-
|
|
49
|
-
// 网格列
|
|
50
|
-
const baseStyle = ref<any>({
|
|
51
|
-
"grid-template-columns": gridValue.value?.value ?? ""
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
//监听屏幕尺寸变化,一般只有人工拉大屏幕尺寸才会触发(默认执行一次)
|
|
55
|
-
useResizeObserver(document.body, () => {
|
|
56
|
-
//TODO 检测浏览器是否被缩放
|
|
57
|
-
// TODO 使用store 会存在所有的配置均有一个对象bug
|
|
58
|
-
if (props.grid === "") {
|
|
59
|
-
store.gridMatching();
|
|
60
|
-
}
|
|
61
|
-
baseStyle.value["grid-template-columns"] = gridValue.value?.value ?? "";
|
|
62
|
-
// 获取当前设备匹配到显示的列数配置
|
|
63
|
-
const colCount = gridValue.value?.col;
|
|
64
|
-
// 根据总单元格和显示的列数 计算出总行数
|
|
65
|
-
const rowCount = Math.ceil(length / colCount);
|
|
66
|
-
// 总行数乘以显示的列数减去传入的子标签个数 等于要填充的空白单元格数
|
|
67
|
-
const number = props.fill ? rowCount * colCount - length : 0;
|
|
68
|
-
// 生成一个要填充空白单元格的数组 用于循环空白的单元格
|
|
69
|
-
fillGridItems.value = Array.from({ length: number }, (_, i) => i + 1);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
return () => (
|
|
73
|
-
<>
|
|
74
|
-
<div class={[baseClassName, props.className]} style={baseStyle.value}>
|
|
75
|
-
{slots.default && slots.default(fillGridItems.value)}
|
|
76
|
-
{fillGridItems.value.map((number) => (
|
|
77
|
-
<GridItem key={number}></GridItem>
|
|
78
|
-
))}
|
|
79
|
-
</div>
|
|
80
|
-
</>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
});
|
package/src/grid/GridItem.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { prefixName } from "../theme";
|
|
3
|
-
|
|
4
|
-
//class名称
|
|
5
|
-
const className = `${prefixName}-grid--item`;
|
|
6
|
-
export default defineComponent({
|
|
7
|
-
name: "DGridItem",
|
|
8
|
-
setup(props, { slots }) {
|
|
9
|
-
return () => (
|
|
10
|
-
<>
|
|
11
|
-
<div class={className}>{slots.default && slots.default()}</div>
|
|
12
|
-
</>
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
});
|
package/src/grid/index.md
DELETED
package/src/grid/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { App, Plugin } from "vue";
|
|
2
|
-
import Grid from "./Grid";
|
|
3
|
-
import GridItem from "./GridItem";
|
|
4
|
-
|
|
5
|
-
Grid.install = function (app: App) {
|
|
6
|
-
app.component(Grid.name, Grid);
|
|
7
|
-
app.component(GridItem.name, GridItem);
|
|
8
|
-
return app;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { GridItem };
|
|
12
|
-
|
|
13
|
-
export default Grid as typeof Grid &
|
|
14
|
-
Plugin & {
|
|
15
|
-
readonly Grid: typeof GridItem;
|
|
16
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
@import "../../theme/variable.scss";
|
|
2
|
-
|
|
3
|
-
/*输入框获取焦点时候的影响边框*/
|
|
4
|
-
@mixin input-focus {
|
|
5
|
-
&:focus {
|
|
6
|
-
box-shadow: 0 0 0 $grid-input-border-width $grid-input-focus-border-color;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
.#{$prefix-name}-grid {
|
|
10
|
-
position: relative;
|
|
11
|
-
display: grid;
|
|
12
|
-
|
|
13
|
-
.#{$prefix-name}-grid--item {
|
|
14
|
-
border: $gird-border-width solid $grid-border-color;
|
|
15
|
-
margin-left: -$gird-border-width;
|
|
16
|
-
margin-top: -$gird-border-width;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 网格表单样式
|
|
21
|
-
.#{$prefix-name}-grid-form {
|
|
22
|
-
.ant-form-item {
|
|
23
|
-
margin-bottom: 0;
|
|
24
|
-
height: 100%;
|
|
25
|
-
.ant-form-item-label {
|
|
26
|
-
border-right: $gird-border-width solid $grid-border-color;
|
|
27
|
-
}
|
|
28
|
-
.ant-input,
|
|
29
|
-
.ant-select-selector,
|
|
30
|
-
.ant-input-number {
|
|
31
|
-
border: 0;
|
|
32
|
-
border-radius: 0;
|
|
33
|
-
@include input-focus;
|
|
34
|
-
// 数字输入框要单独处理
|
|
35
|
-
.ant-input-number-input {
|
|
36
|
-
border: 0;
|
|
37
|
-
border-radius: 0;
|
|
38
|
-
@include input-focus;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
.ant-input[disabled] {
|
|
42
|
-
color: #525252;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
.ant-form-item-has-error {
|
|
46
|
-
.ant-input {
|
|
47
|
-
&::placeholder {
|
|
48
|
-
//color: red;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
.ant-form-item-explain {
|
|
52
|
-
display: $gird-error-display;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
.ant-select-focused:not(.ant-select-disabled).ant-select:not(
|
|
56
|
-
.ant-select-customize-input
|
|
57
|
-
)
|
|
58
|
-
.ant-select-selector {
|
|
59
|
-
box-shadow: 0 0 0 $grid-input-border-width $grid-input-focus-border-color;
|
|
60
|
-
}
|
|
61
|
-
.ant-form-item-has-error
|
|
62
|
-
:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus {
|
|
63
|
-
box-shadow: 0 0 0px $grid-input-border-width red;
|
|
64
|
-
border-radius: 0;
|
|
65
|
-
}
|
|
66
|
-
.ant-form-item-has-error
|
|
67
|
-
:not(.ant-input-disabled):not(.ant-input-borderless).ant-input {
|
|
68
|
-
box-shadow: 0 0 0px $grid-input-border-width $grid-input-error-border-color;
|
|
69
|
-
}
|
|
70
|
-
}
|
package/src/index.scss
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
@import "./theme/variable";
|
|
2
|
-
@import "./grid/style";
|
|
3
|
-
@import "./menu/style";
|
|
4
|
-
@import "./layout/style";
|
|
5
|
-
@import "./table/style";
|
|
6
|
-
@import "./desensitize/style";
|
|
7
|
-
@import "./modal/style";
|
|
8
|
-
html,
|
|
9
|
-
body,
|
|
10
|
-
#app {
|
|
11
|
-
height: 100%;
|
|
12
|
-
background: $bg-color;
|
|
13
|
-
&::-webkit-scrollbar {
|
|
14
|
-
width: 0 !important;
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
package/src/index.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { App } from "vue";
|
|
2
|
-
import { createPinia } from "pinia";
|
|
3
|
-
import { createPersistedState } from "pinia-plugin-persistedstate";
|
|
4
|
-
|
|
5
|
-
import * as components from "./components";
|
|
6
|
-
export * from "./components";
|
|
7
|
-
|
|
8
|
-
export interface MenuIcon {
|
|
9
|
-
componentName: string | "nativeHtml";
|
|
10
|
-
type: string;
|
|
11
|
-
}
|
|
12
|
-
export interface Options {
|
|
13
|
-
menuIcon: MenuIcon;
|
|
14
|
-
prop?: string;
|
|
15
|
-
}
|
|
16
|
-
const c: any = components;
|
|
17
|
-
export const install = function (app: App, opts: Options) {
|
|
18
|
-
Object.keys(c).forEach((key) => {
|
|
19
|
-
const component = c[key];
|
|
20
|
-
if (component.install) {
|
|
21
|
-
app.use(component);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
//注册pinia
|
|
25
|
-
const pinia = createPinia();
|
|
26
|
-
//pinia启用持久化
|
|
27
|
-
pinia.use(
|
|
28
|
-
createPersistedState({
|
|
29
|
-
storage: sessionStorage
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
app.use(pinia);
|
|
33
|
-
app.provide("menuIcon", opts.menuIcon || {});
|
|
34
|
-
|
|
35
|
-
// // 创建 Web Worker 连接池实例
|
|
36
|
-
// const workerPool = new WorkerPool(DicWorker, 2); // 这里设置连接池的大小为 5
|
|
37
|
-
// workerPool.initialize();
|
|
38
|
-
// // 注入连接池实例
|
|
39
|
-
// app.provide("dicWorkerPool", workerPool);
|
|
40
|
-
// // 创建 Web Worker 连接池实例
|
|
41
|
-
// const repWorkerPool = new WorkerPool(ReplaceWorker, 2); // 这里设置连接池的大小为 5
|
|
42
|
-
// repWorkerPool.initialize();
|
|
43
|
-
// // 注入连接池实例
|
|
44
|
-
// app.provide("repWorkerPool", repWorkerPool);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default {
|
|
48
|
-
install
|
|
49
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineComponent,
|
|
3
|
-
h,
|
|
4
|
-
resolveComponent,
|
|
5
|
-
Component,
|
|
6
|
-
computed,
|
|
7
|
-
ref
|
|
8
|
-
} from "vue";
|
|
9
|
-
|
|
10
|
-
// 表单元素 tag
|
|
11
|
-
const FORM_TAG = ["a-input", "a-radio", "checkbox", "radio", "textarea"];
|
|
12
|
-
|
|
13
|
-
export default defineComponent({
|
|
14
|
-
name: "DJsonSchemeRender",
|
|
15
|
-
props: {
|
|
16
|
-
layout: {
|
|
17
|
-
type: [Array, Object] as unknown as () => any[] | Record<string, any>,
|
|
18
|
-
default: () => []
|
|
19
|
-
},
|
|
20
|
-
value: {
|
|
21
|
-
type: Object as () => Record<string, unknown>,
|
|
22
|
-
default: () => ({})
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
setup(props, {}) {
|
|
26
|
-
const modelValue = ref<Record<string, unknown>>(props.value);
|
|
27
|
-
const { renderLayout } = useRender();
|
|
28
|
-
// 通过computed计算出渲染的内容
|
|
29
|
-
const render = computed(() => {
|
|
30
|
-
const layout = props.layout;
|
|
31
|
-
return renderLayout(layout);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 渲染组件
|
|
36
|
-
*/
|
|
37
|
-
function useRender() {
|
|
38
|
-
/**
|
|
39
|
-
* 渲染布局
|
|
40
|
-
*/
|
|
41
|
-
const renderLayout = (
|
|
42
|
-
layout: any[] | Record<string, any> | undefined
|
|
43
|
-
) => {
|
|
44
|
-
return _renderComponent(layout);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 渲染组件
|
|
49
|
-
* @param layout
|
|
50
|
-
*/
|
|
51
|
-
function _renderComponent(layout: any): any {
|
|
52
|
-
if (Array.isArray(layout)) {
|
|
53
|
-
return layout.map(_renderComponent);
|
|
54
|
-
} else {
|
|
55
|
-
const { type, props, body } = layout;
|
|
56
|
-
// 子组件
|
|
57
|
-
let children: any = null;
|
|
58
|
-
if (Array.isArray(body)) {
|
|
59
|
-
// 为数组时,遍历渲染
|
|
60
|
-
children = body.map(_renderComponent);
|
|
61
|
-
} else {
|
|
62
|
-
// 为对象时,渲染
|
|
63
|
-
children = body && _renderComponent(body);
|
|
64
|
-
}
|
|
65
|
-
let componentProps = { ...props };
|
|
66
|
-
if (FORM_TAG.includes(type)) {
|
|
67
|
-
componentProps = {
|
|
68
|
-
...componentProps,
|
|
69
|
-
...{
|
|
70
|
-
//disabled: props?.disabled || false,
|
|
71
|
-
value: modelValue.value[props.name],
|
|
72
|
-
"onUpdate:value": (v: any) => {
|
|
73
|
-
modelValue.value[props.name] = v;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (type === "a-form") {
|
|
79
|
-
componentProps = {
|
|
80
|
-
...componentProps,
|
|
81
|
-
...{
|
|
82
|
-
// model: model.value
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const component =
|
|
87
|
-
typeof type === "string" ? resolveComponent(type as string) : type;
|
|
88
|
-
|
|
89
|
-
return h(component as Component, componentProps, {
|
|
90
|
-
default: () => children
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
renderLayout
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return () => <>{render.value}</>;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* 面包屑
|
|
4
|
-
* @author 余老
|
|
5
|
-
*/
|
|
6
|
-
import { computed } from "vue";
|
|
7
|
-
import { useBreadcrumbStore } from "@ditari/store";
|
|
8
|
-
import { prefixName } from "../theme";
|
|
9
|
-
|
|
10
|
-
const store = useBreadcrumbStore();
|
|
11
|
-
const breadCrumbs = computed(() => store.getBreadcrumb);
|
|
12
|
-
//class名称
|
|
13
|
-
const baseClassName = `${prefixName}-breadcrumb`;
|
|
14
|
-
</script>
|
|
15
|
-
<template>
|
|
16
|
-
<div :class="baseClassName">
|
|
17
|
-
<div class="breadcrumb">
|
|
18
|
-
<transition-group name="breadcrumb">
|
|
19
|
-
<div
|
|
20
|
-
v-for="(item, index) in breadCrumbs"
|
|
21
|
-
:key="item.path"
|
|
22
|
-
class="breadcrumb-item"
|
|
23
|
-
>
|
|
24
|
-
<router-link
|
|
25
|
-
v-if="index + 1 !== breadCrumbs.length"
|
|
26
|
-
class="breadcrumb-link"
|
|
27
|
-
:to="{ path: item.path }"
|
|
28
|
-
>
|
|
29
|
-
{{ item.title }}
|
|
30
|
-
</router-link>
|
|
31
|
-
<span v-else class="breadcrumb-link">
|
|
32
|
-
{{ item.title }}
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
</transition-group>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
<style lang="scss"></style>
|