@ctzy-web-client/plugin-component-vue 1.0.0
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 +43 -0
- package/src/advance-select/advance-operation.vue +44 -0
- package/src/advance-select/advance-option.vue +115 -0
- package/src/advance-select/advance-select.vue +343 -0
- package/src/advance-select/events-helpers.js +40 -0
- package/src/advance-select/index.js +13 -0
- package/src/advance-select/use-advance-option.js +58 -0
- package/src/advance-select/use-advance-select.js +142 -0
- package/src/application-slot/application-slot.js +70 -0
- package/src/application-slot/breadcrumb-item.vue +12 -0
- package/src/application-slot/header-tools-item.vue +12 -0
- package/src/application-slot/index.js +17 -0
- package/src/breadcrumb-select/breadcrumb-select.vue +97 -0
- package/src/breadcrumb-select/index.js +6 -0
- package/src/components.js +39 -0
- package/src/contextmenu/contextmenu-item.vue +13 -0
- package/src/contextmenu/contextmenu.vue +56 -0
- package/src/contextmenu/index.js +11 -0
- package/src/contextmenu/use-contextmenu.js +117 -0
- package/src/data-form/data-form-item.vue +49 -0
- package/src/data-form/data-form.vue +212 -0
- package/src/data-form/dynamic-component.js +24 -0
- package/src/data-form/form-components/Blots/AtBlot.js +32 -0
- package/src/data-form/form-components/bwa-date-picker.vue +43 -0
- package/src/data-form/form-components/bwa-date-time-picker.vue +49 -0
- package/src/data-form/form-components/bwa-input-float.vue +41 -0
- package/src/data-form/form-components/bwa-input-integer.vue +58 -0
- package/src/data-form/form-components/bwa-input.vue +32 -0
- package/src/data-form/form-components/bwa-multi-select.vue +27 -0
- package/src/data-form/form-components/bwa-rich-text-tinymce.vue +561 -0
- package/src/data-form/form-components/bwa-rich-text.vue +395 -0
- package/src/data-form/form-components/bwa-select.vue +67 -0
- package/src/data-form/form-components/bwa-textarea.vue +28 -0
- package/src/data-form/form-components/bwa-upload.vue +145 -0
- package/src/data-form/form-components/bwa-user-multi-select.vue +25 -0
- package/src/data-form/form-components/bwa-user-select.vue +81 -0
- package/src/data-form/index.js +35 -0
- package/src/data-table/data-column-view.vue +131 -0
- package/src/data-table/data-table-card.vue +81 -0
- package/src/data-table/data-table-column.vue +52 -0
- package/src/data-table/data-table.vue +426 -0
- package/src/data-table/dynamic-component.js +58 -0
- package/src/data-table/index.js +13 -0
- package/src/data-table/use-datatable-drag.js +156 -0
- package/src/datatable-settings/datatable-settings.vue +323 -0
- package/src/datatable-settings/index.js +6 -0
- package/src/date-range/date-picker.vue +115 -0
- package/src/date-range/date-range.vue +202 -0
- package/src/date-range/index.js +6 -0
- package/src/drag-list/constants.js +1 -0
- package/src/drag-list/drag-item.vue +46 -0
- package/src/drag-list/drag-list.vue +50 -0
- package/src/drag-list/index.js +6 -0
- package/src/drag-list/use-drag-list.js +209 -0
- package/src/dragable/constants.js +3 -0
- package/src/dragable/dragable-item.vue +19 -0
- package/src/dragable/dragable-operation.vue +28 -0
- package/src/dragable/dragable.vue +26 -0
- package/src/dragable/index.js +14 -0
- package/src/dragable/use-dragable.js +227 -0
- package/src/filter-panel/conditions/condition.js +35 -0
- package/src/filter-panel/conditions/date-range-condition.vue +35 -0
- package/src/filter-panel/conditions/department-condition/data.json +29537 -0
- package/src/filter-panel/conditions/department-condition/department-condition.vue +92 -0
- package/src/filter-panel/conditions/department-condition/department-node.vue +52 -0
- package/src/filter-panel/conditions/index.js +22 -0
- package/src/filter-panel/conditions/input-condition.vue +63 -0
- package/src/filter-panel/conditions/multi-user-condition.vue +56 -0
- package/src/filter-panel/conditions/multiple-menu-condition.vue +45 -0
- package/src/filter-panel/conditions/single-menu-condition.vue +58 -0
- package/src/filter-panel/conditions/single-user-condition.vue +56 -0
- package/src/filter-panel/filter-panel-item.vue +46 -0
- package/src/filter-panel/filter-panel.vue +149 -0
- package/src/filter-panel/index.js +17 -0
- package/src/filter-panel/use-filter-panel-item.js +59 -0
- package/src/filter-panel/use-filter-panel.js +203 -0
- package/src/hooks/use-data/index.js +234 -0
- package/src/index.js +48 -0
- package/src/layout/index.js +6 -0
- package/src/layout/layout.vue +74 -0
- package/src/make-installer.js +36 -0
- package/src/math/Rectangle.js +28 -0
- package/src/menu/index.js +6 -0
- package/src/menu/menu-item.vue +41 -0
- package/src/menu/menu.vue +53 -0
- package/src/panel/index.js +6 -0
- package/src/panel/panel.vue +42 -0
- package/src/panel-tabs/index.js +6 -0
- package/src/panel-tabs/panel-tabs.js +92 -0
- package/src/pct-filter-panel/index.js +10 -0
- package/src/pct-filter-panel/pct-compents/index.js +10 -0
- package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +63 -0
- package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +60 -0
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +177 -0
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue +142 -0
- package/src/pct-filter-panel/pct-filter-panel-item.vue +46 -0
- package/src/pct-filter-panel/pct-filter-panel.vue +201 -0
- package/src/pct-filter-panel/use-filter-panel-item.js +61 -0
- package/src/pct-filter-panel/use-filter-panel.js +206 -0
- package/src/plugins.js +3 -0
- package/src/progress/index.js +8 -0
- package/src/progress/progress-item.vue +81 -0
- package/src/progress/progress.vue +58 -0
- package/src/progress/use-progress.js +66 -0
- package/src/utils/db.js +8 -0
- package/src/utils.js +263 -0
- package/src/where-filter-panel/index.js +0 -0
- package/src/where-filter-panel/use-where-filter-panel.js +28 -0
- package/src/where-filter-panel/where-filter-panel.vue +9 -0
- package/style/advance-select.scss +316 -0
- package/style/breadcrumb-select.scss +80 -0
- package/style/common/var.scss +240 -0
- package/style/common.scss +48 -0
- package/style/contextmenu.scss +58 -0
- package/style/data-form.scss +35 -0
- package/style/data-table.scss +81 -0
- package/style/datatable-settings.scss +125 -0
- package/style/date-range.scss +136 -0
- package/style/department-condition.scss +39 -0
- package/style/drag-list.scss +68 -0
- package/style/dragable.scss +8 -0
- package/style/filter-panel.scss +199 -0
- package/style/index.scss +22 -0
- package/style/input-condition.scss +30 -0
- package/style/layout.scss +70 -0
- package/style/menu.scss +184 -0
- package/style/mixins/_var.scss +21 -0
- package/style/mixins/config.scss +4 -0
- package/style/mixins/function.scss +62 -0
- package/style/mixins/mixins.scss +88 -0
- package/style/panel-tabs.scss +60 -0
- package/style/panel.scss +110 -0
- package/style/pct-filter-panel.scss +306 -0
- package/style/progress.scss +122 -0
- package/style/rich-text.scss +30 -0
- package/style/theme/theme.scss +161 -0
- package/style/theme/var.scss +34 -0
- package/style/var.scss +21 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BwaSelect
|
|
3
|
+
v-bind="attrs"
|
|
4
|
+
v-model="modelValue"
|
|
5
|
+
:loading="loading"
|
|
6
|
+
remote
|
|
7
|
+
filterable
|
|
8
|
+
clearable
|
|
9
|
+
:remote-method="handleRemote"
|
|
10
|
+
:options="options"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { useService } from 'web-base-client-vue';
|
|
16
|
+
import { useAttrs, ref, unref, computed } from 'vue';
|
|
17
|
+
import BwaSelect from './bwa-select.vue';
|
|
18
|
+
import { ElMessage } from 'element-plus';
|
|
19
|
+
|
|
20
|
+
defineOptions({
|
|
21
|
+
name: 'BwaUserSelect',
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
modelValue: null,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const emit = defineEmits(['update:modelValue']);
|
|
30
|
+
|
|
31
|
+
const attrs = useAttrs();
|
|
32
|
+
|
|
33
|
+
const userService = useService('UserService');
|
|
34
|
+
|
|
35
|
+
const loading = ref(false);
|
|
36
|
+
|
|
37
|
+
const modelValue = computed({
|
|
38
|
+
get: () => props.modelValue,
|
|
39
|
+
set: (v) => {
|
|
40
|
+
emit('update:modelValue', v);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const options = ref([]);
|
|
45
|
+
|
|
46
|
+
const loadOptions = async (query, userIds = []) => {
|
|
47
|
+
const _userService = unref(userService);
|
|
48
|
+
|
|
49
|
+
if (!_userService) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
loading.value = true;
|
|
55
|
+
const userListResult = await _userService.getUserList({
|
|
56
|
+
name: query,
|
|
57
|
+
userIds,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (userListResult.code != 0) {
|
|
61
|
+
ElMessage.error(userListResult.msg);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
options.value = userListResult.data;
|
|
66
|
+
} finally {
|
|
67
|
+
loading.value = false;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const handleRemote = loadOptions;
|
|
72
|
+
|
|
73
|
+
loadOptions(
|
|
74
|
+
'',
|
|
75
|
+
Array.isArray(unref(modelValue))
|
|
76
|
+
? unref(modelValue)
|
|
77
|
+
: unref(modelValue)
|
|
78
|
+
? [unref(modelValue)]
|
|
79
|
+
: []
|
|
80
|
+
);
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { withInstall } from 'element-plus/es/utils/vue/install';
|
|
2
|
+
import DataForm from './data-form.vue';
|
|
3
|
+
import DataFormItem from './data-form-item.vue';
|
|
4
|
+
|
|
5
|
+
import DatePicker from './form-components/bwa-date-picker.vue';
|
|
6
|
+
import DateTimePicker from './form-components/bwa-date-time-picker.vue';
|
|
7
|
+
import InputInteger from './form-components/bwa-input-integer.vue';
|
|
8
|
+
import InputFloat from './form-components/bwa-input-float.vue';
|
|
9
|
+
import Input from './form-components/bwa-input.vue';
|
|
10
|
+
import Select from './form-components/bwa-select.vue';
|
|
11
|
+
import MultiSelect from './form-components/bwa-multi-select.vue';
|
|
12
|
+
import Textarea from './form-components/bwa-textarea.vue';
|
|
13
|
+
import UserSelect from './form-components/bwa-user-select.vue';
|
|
14
|
+
import UserMultiSelect from './form-components/bwa-user-multi-select.vue';
|
|
15
|
+
import Upload from './form-components/bwa-upload.vue';
|
|
16
|
+
import RichText from './form-components/bwa-rich-text.vue';
|
|
17
|
+
|
|
18
|
+
export const BwaDataForm = withInstall(DataForm, {
|
|
19
|
+
DataFormItem,
|
|
20
|
+
DatePicker,
|
|
21
|
+
DateTimePicker,
|
|
22
|
+
InputInteger,
|
|
23
|
+
InputFloat,
|
|
24
|
+
Input,
|
|
25
|
+
Select,
|
|
26
|
+
MultiSelect,
|
|
27
|
+
Textarea,
|
|
28
|
+
UserSelect,
|
|
29
|
+
UserMultiSelect,
|
|
30
|
+
Upload,
|
|
31
|
+
RichText,
|
|
32
|
+
});
|
|
33
|
+
export const BwaDataFormItem = withInstall(DataFormItem);
|
|
34
|
+
|
|
35
|
+
export default BwaDataForm;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span :class="[ns.b(), { nowrap: nowrap }, align]">
|
|
3
|
+
<template v-if="viewType == 'html'">
|
|
4
|
+
<span v-html="viewValue"></span>
|
|
5
|
+
</template>
|
|
6
|
+
<template v-else-if="viewType == 'image'">
|
|
7
|
+
<el-image
|
|
8
|
+
class="image"
|
|
9
|
+
:style="{ width: '100%', minHeight: '50px' }"
|
|
10
|
+
:z-index="999"
|
|
11
|
+
:preview-teleported="true"
|
|
12
|
+
:preview-src-list="[viewValue]"
|
|
13
|
+
fit="cover"
|
|
14
|
+
:src="viewValue"
|
|
15
|
+
:hide-on-click-modal="true"
|
|
16
|
+
>
|
|
17
|
+
<template #placeholder>
|
|
18
|
+
<el-icon :size="50"><PictureFilled /></el-icon>
|
|
19
|
+
</template>
|
|
20
|
+
<template #error>
|
|
21
|
+
<el-icon :size="50"><PictureFilled /></el-icon>
|
|
22
|
+
</template>
|
|
23
|
+
</el-image>
|
|
24
|
+
</template>
|
|
25
|
+
<template v-else :title="value" :class="ns.e('text')">
|
|
26
|
+
{{ viewValue }}
|
|
27
|
+
</template>
|
|
28
|
+
<div v-if="copy" class="copy-btn" @click="copyHandle(viewValue)">复制</div>
|
|
29
|
+
</span>
|
|
30
|
+
</template>
|
|
31
|
+
<script>
|
|
32
|
+
import { computed } from 'vue';
|
|
33
|
+
import { func, str, useNamespace } from 'web-base-client-vue';
|
|
34
|
+
import { PictureFilled } from '@element-plus/icons';
|
|
35
|
+
import { ElMessage } from 'element-plus';
|
|
36
|
+
export default {
|
|
37
|
+
name: 'BwaDataColumnView',
|
|
38
|
+
props: {
|
|
39
|
+
value: [String, Boolean, Number, Object, Array],
|
|
40
|
+
type: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'string',
|
|
43
|
+
},
|
|
44
|
+
template: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: '',
|
|
47
|
+
},
|
|
48
|
+
//格式化规则
|
|
49
|
+
rule: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '',
|
|
52
|
+
},
|
|
53
|
+
align: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '',
|
|
56
|
+
},
|
|
57
|
+
nowrap: {
|
|
58
|
+
type: [Boolean, String],
|
|
59
|
+
default: true,
|
|
60
|
+
},
|
|
61
|
+
copy: {
|
|
62
|
+
type: [Boolean, String],
|
|
63
|
+
default: false,
|
|
64
|
+
},
|
|
65
|
+
defaultValue: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '-',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
emits: ['update:modelValue'],
|
|
71
|
+
components: { PictureFilled },
|
|
72
|
+
setup(props) {
|
|
73
|
+
const ns = useNamespace('column-view');
|
|
74
|
+
|
|
75
|
+
//显示类型
|
|
76
|
+
const viewType = computed(() => props.type.toLocaleLowerCase());
|
|
77
|
+
|
|
78
|
+
//显示的值
|
|
79
|
+
const viewValue = computed(() => {
|
|
80
|
+
//值 主要是要先转成字符串处理
|
|
81
|
+
let value = props.value === 0 ? '0' : props.value ? props.value + '' : '';
|
|
82
|
+
let type = viewType.value;
|
|
83
|
+
|
|
84
|
+
if (['number', 'string'].includes(type)) {
|
|
85
|
+
//是否追加...
|
|
86
|
+
let isAppendChar = false;
|
|
87
|
+
|
|
88
|
+
if (type === 'string' && props.rule && value) {
|
|
89
|
+
isAppendChar = value.length > props.rule.replace('s:', '') * 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
value = props.rule ? str.formatByRule(value, props.rule) : value;
|
|
93
|
+
value = value || props.defaultValue;
|
|
94
|
+
|
|
95
|
+
if (isAppendChar) {
|
|
96
|
+
value += '...';
|
|
97
|
+
}
|
|
98
|
+
} else if (type === 'date') {
|
|
99
|
+
value = value
|
|
100
|
+
? func.formatDate(new Date(value), props.rule || 'yyyy-MM-dd')
|
|
101
|
+
: props.defaultValue;
|
|
102
|
+
} else if (type === 'html') {
|
|
103
|
+
value = value
|
|
104
|
+
? value.replace(/[\r\n|\r|\n]/g, '<br/>')
|
|
105
|
+
: props.defaultValue;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//存在字符串模板的时候
|
|
109
|
+
if (props.template) {
|
|
110
|
+
value = props.template.replace('${value}', value);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return value;
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
//拷贝
|
|
117
|
+
const copyHandle = (text) => {
|
|
118
|
+
let input = document.createElement('input');
|
|
119
|
+
input.value = text;
|
|
120
|
+
document.body.appendChild(input);
|
|
121
|
+
input.select();
|
|
122
|
+
input.setSelectionRange(0, input.value.length),
|
|
123
|
+
document.execCommand('Copy');
|
|
124
|
+
document.body.removeChild(input);
|
|
125
|
+
ElMessage.info('复制成功!');
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return { ns, viewType, viewValue, copyHandle };
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card :class="ns.b('card')" v-loading="!dataTable.ready">
|
|
3
|
+
<template #header v-if="$slots.header">
|
|
4
|
+
<slot name="header" :dataTable="dataTable"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
<el-table
|
|
7
|
+
class="content"
|
|
8
|
+
height="100%"
|
|
9
|
+
ref="elTable"
|
|
10
|
+
:data="dataTable.data"
|
|
11
|
+
:row-key="dataTable.primaryKey"
|
|
12
|
+
show-header
|
|
13
|
+
stripe
|
|
14
|
+
>
|
|
15
|
+
<el-table-column type="index" width="60" align="center" label="编号" />
|
|
16
|
+
<slot name="table-columns" :dataTable="dataTable">
|
|
17
|
+
<el-table-column
|
|
18
|
+
v-for="item in dataTable.getDisplayColumns()"
|
|
19
|
+
:column-key="item.attrName"
|
|
20
|
+
:key="item.attrName"
|
|
21
|
+
:label="item.title"
|
|
22
|
+
:prop="item.attrName"
|
|
23
|
+
:min-width="item.width"
|
|
24
|
+
:align="item.align"
|
|
25
|
+
>
|
|
26
|
+
<template #default="{ row, $index }">
|
|
27
|
+
<slot
|
|
28
|
+
:name="'table-col-' + item.attrName"
|
|
29
|
+
:row="row"
|
|
30
|
+
:index="$index"
|
|
31
|
+
:column="item"
|
|
32
|
+
:dataTable="dataTable"
|
|
33
|
+
>
|
|
34
|
+
<DynamicComponent :column="item" :record="row" />
|
|
35
|
+
</slot>
|
|
36
|
+
</template>
|
|
37
|
+
</el-table-column>
|
|
38
|
+
</slot>
|
|
39
|
+
<template #append>
|
|
40
|
+
<slot name="table-append" :dataTable="dataTable"></slot>
|
|
41
|
+
</template>
|
|
42
|
+
</el-table>
|
|
43
|
+
<div :class="ns.be('card', 'footer')">
|
|
44
|
+
<div class="left">
|
|
45
|
+
<div class="pagination-info">
|
|
46
|
+
共<b>{{ dataTable.totalRecCount }}</b
|
|
47
|
+
>条记录 | 当前第<b>{{ dataTable.pageNum }}</b
|
|
48
|
+
>页
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="right">
|
|
52
|
+
<el-pagination
|
|
53
|
+
:hide-on-single-page="true"
|
|
54
|
+
:currentPage="dataTable.pageNum"
|
|
55
|
+
@current-change="dataTable.pageTo($event)"
|
|
56
|
+
:page-size="dataTable.pageSize"
|
|
57
|
+
background
|
|
58
|
+
layout="prev, pager, next, jumper"
|
|
59
|
+
:total="dataTable.totalRecCount"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</el-card>
|
|
64
|
+
</template>
|
|
65
|
+
<script>
|
|
66
|
+
import { inject } from 'vue';
|
|
67
|
+
import { dataTableKey, useNamespace } from 'web-base-client-vue';
|
|
68
|
+
import DynamicComponent from './dynamic-component.js';
|
|
69
|
+
export default {
|
|
70
|
+
name: 'BwaDataTableCard',
|
|
71
|
+
components: { DynamicComponent },
|
|
72
|
+
setup() {
|
|
73
|
+
//创建dataTable
|
|
74
|
+
const dataTable = inject(dataTableKey);
|
|
75
|
+
|
|
76
|
+
const ns = useNamespace('datatable');
|
|
77
|
+
|
|
78
|
+
return { dataTable, ns };
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElTableColumn
|
|
3
|
+
:align="align"
|
|
4
|
+
:show-overflow-tooltip="showOverflowTooltip"
|
|
5
|
+
v-bind="attrs"
|
|
6
|
+
>
|
|
7
|
+
<template #header="{ column, $index }">
|
|
8
|
+
<slot name="header" :column="column" :$index="$index">{{ column.label }}</slot>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<template #default="{ row, $index }">
|
|
12
|
+
<slot
|
|
13
|
+
v-if="$index !== -1"
|
|
14
|
+
:row="row"
|
|
15
|
+
:index="$index"
|
|
16
|
+
:column="column"
|
|
17
|
+
:dataTable="dataTable"
|
|
18
|
+
>
|
|
19
|
+
</slot>
|
|
20
|
+
</template>
|
|
21
|
+
</ElTableColumn>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup>
|
|
25
|
+
import { ElTableColumn } from 'element-plus';
|
|
26
|
+
import { inject, useAttrs } from 'vue';
|
|
27
|
+
import { dataTableKey } from 'web-base-client-vue';
|
|
28
|
+
|
|
29
|
+
defineOptions({ name: 'BwaDataTableColumn' });
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
name: {
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
align: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'center',
|
|
38
|
+
},
|
|
39
|
+
showOverflowTooltip: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const attrs = useAttrs();
|
|
46
|
+
|
|
47
|
+
const dataTable = inject(dataTableKey);
|
|
48
|
+
|
|
49
|
+
const column =
|
|
50
|
+
dataTable.displayColumns.find((column) => column.attrName === props.name) ??
|
|
51
|
+
null;
|
|
52
|
+
</script>
|