@ebiz/designer-components 0.0.18-beta.17 → 0.0.18-beta.19
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/package.json +1 -1
- package/src/components/EbizDetailBlock.vue +54 -0
- package/src/index.js +4 -1
package/package.json
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="ebiz-detail-block">
|
3
|
+
<t-row v-for="(item, index) in detailItems" :key="index" class="detail-item">
|
4
|
+
<t-col :span="6" class="label">{{ item.label }}</t-col>
|
5
|
+
<t-col :span="18" class="value">{{ item.value }}</t-col>
|
6
|
+
</t-row>
|
7
|
+
</div>
|
8
|
+
</template>
|
9
|
+
|
10
|
+
<script lang="js" setup>
|
11
|
+
import { computed, toRefs } from 'vue'
|
12
|
+
import { Row as TRow, Col as TCol } from 'tdesign-vue-next'
|
13
|
+
|
14
|
+
const props = defineProps({
|
15
|
+
model: {
|
16
|
+
type: Object,
|
17
|
+
default: () => { }
|
18
|
+
},
|
19
|
+
labelMap: {
|
20
|
+
type: Object,
|
21
|
+
default: () => { }
|
22
|
+
}
|
23
|
+
})
|
24
|
+
|
25
|
+
const { model, labelMap } = toRefs(props)
|
26
|
+
|
27
|
+
const detailItems = computed(() => {
|
28
|
+
return Object.entries(model.value).map(([key, value]) => ({
|
29
|
+
label: labelMap.value[key] || key,
|
30
|
+
value: value || '--'
|
31
|
+
}))
|
32
|
+
})
|
33
|
+
</script>
|
34
|
+
|
35
|
+
<style scoped>
|
36
|
+
.ebiz-detail-block {
|
37
|
+
padding: 16px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.detail-item {
|
41
|
+
margin-bottom: 16px;
|
42
|
+
line-height: 32px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.label {
|
46
|
+
color: #86909C;
|
47
|
+
text-align: right;
|
48
|
+
padding-right: 16px;
|
49
|
+
}
|
50
|
+
|
51
|
+
.value {
|
52
|
+
color: #0A0A0A;
|
53
|
+
}
|
54
|
+
</style>
|
package/src/index.js
CHANGED
@@ -49,6 +49,7 @@ import EbizAlert from "./components/TdesignAlert.vue";
|
|
49
49
|
import EbizDialog from "./components/TdesignDialog.vue";
|
50
50
|
import EbizTable from "./components/EbizTable.vue";
|
51
51
|
import { MessagePlugin as EbizMessage } from 'tdesign-vue-next';
|
52
|
+
import EbizDetailBlock from './components/EbizDetailBlock.vue';
|
52
53
|
|
53
54
|
// 导入简洁数据服务
|
54
55
|
import dataService from "./apiService/simpleDataService";
|
@@ -146,5 +147,7 @@ export {
|
|
146
147
|
// 对话框组件
|
147
148
|
EbizDialog,
|
148
149
|
// 表格组件
|
149
|
-
EbizTable
|
150
|
+
EbizTable,
|
151
|
+
// 详情块组件
|
152
|
+
EbizDetailBlock
|
150
153
|
};
|