lw-cdp-ui 1.0.19 → 1.0.21
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/README.md +5 -5
- package/dist/components/lwForm/index.vue +312 -312
- package/dist/components/lwIconSelect/iconSelect.js +288 -288
- package/dist/components/lwIconSelect/index.vue +142 -142
- package/dist/components/lwLayout/components/NavMenu.vue +36 -36
- package/dist/components/lwLayout/components/aside.vue +291 -295
- package/dist/components/lwLayout/components/bu.vue +72 -70
- package/dist/components/lwLayout/components/iframeView.vue +57 -57
- package/dist/components/lwLayout/components/lang.vue +76 -76
- package/dist/components/lwLayout/components/setting.vue +80 -80
- package/dist/components/lwLayout/components/sideM.vue +137 -136
- package/dist/components/lwLayout/components/tags.vue +329 -329
- package/dist/components/lwLayout/components/topbar.vue +70 -70
- package/dist/components/lwLayout/components/userbar.vue +210 -209
- package/dist/components/lwLayout/index.vue +399 -398
- package/dist/components/lwLogin/index.vue +446 -383
- package/dist/components/lwSearch/date/date.vue +110 -110
- package/dist/components/lwSearch/dateRange/dateRange.vue +110 -110
- package/dist/components/lwSearch/dates/dates.vue +366 -366
- package/dist/components/lwSearch/index.vue +636 -636
- package/dist/components/lwSearch/input/input.vue +54 -54
- package/dist/components/lwSearch/locale/en-us.js +10 -10
- package/dist/components/lwSearch/locale/zh-cn.js +10 -10
- package/dist/components/lwSearch/select/select.vue +57 -57
- package/dist/components/lwSvgIcon/index.vue +28 -28
- package/dist/components/lwTable/index.js +425 -425
- package/dist/components/lwTable/index.scss +229 -229
- package/dist/components/lwTable/index.vue +225 -226
- package/dist/components/lwTable/locale/en-US.js +26 -26
- package/dist/components/lwTable/locale/zh-CN.js +26 -26
- package/dist/components/lwTable/useFullscreen.js +73 -73
- package/dist/components/lwTableSelect/index.vue +254 -254
- package/dist/components/lwTableSelect/tableSelect.js +23 -23
- package/dist/components/lwUpload/index.vue +365 -365
- package/dist/en-US-YCjgxjEt.js.map +1 -1
- package/dist/en-us-CziFtIQi.js.map +1 -1
- package/dist/lw-cdp-ui.esm.js +1484 -1459
- package/dist/lw-cdp-ui.esm.js.map +1 -1
- package/dist/lw-cdp-ui.umd.js +9 -9
- package/dist/lw-cdp-ui.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/zh-CN-BdDNsX4e.js.map +1 -1
- package/dist/zh-cn-DJpQp_O7.js.map +1 -1
- package/package.json +45 -45
|
@@ -1,226 +1,225 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="baseTablePage-wrap">
|
|
3
|
-
<el-table ref="multipleTable" column-resizable v-loading="loading" :columns="tableHeaders" :stripe="stripe" :data="tableData" :row-key="rowKey" :hoverable="hoverable" :default-expand-all-rows="defaultExpandAll" :size="tableSize" highlight-current-row :max-height="maxHeight" scrollbar-always-on :scroll="{ x: '100%', y: '100%' }" :virtual-list-props="virtualListProps" @current-change="handleCurrentChange" @selection-change="handleSelectionChange">
|
|
4
|
-
<el-table-column fixed="left" type="selection" width="55" v-if="rowSelection" />
|
|
5
|
-
<el-table-column v-for="t in tableHeaders" :label="t.title" :prop="t.dataIndex" :min-width="t.width" :align="t.align ?? 'center'" :fixed="t.fixed" :sortable="t.sortable" :show-overflow-tooltip="t.tooltip" :key="t">
|
|
6
|
-
<template #default="scope">
|
|
7
|
-
<!-- 操作 -->
|
|
8
|
-
<div v-if="t.operation">
|
|
9
|
-
<div v-if="t.ellipsis">
|
|
10
|
-
<!-- 操作按钮少于3个 -->
|
|
11
|
-
<div v-if="t.operation.length <= 3">
|
|
12
|
-
<span v-for="(o,i) in t.operation" :key="o" v-show="o.isShow ? o.isShow(scope.row) : true">
|
|
13
|
-
<span v-if="i <= 2">
|
|
14
|
-
<el-tooltip v-if="!!o.icon" :content="o.label" placement="top">
|
|
15
|
-
<el-button class="table-button" size="small" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="o.icon" circle></el-button>
|
|
16
|
-
</el-tooltip>
|
|
17
|
-
<el-button class="table-button-2" v-else text size="small" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false">
|
|
18
|
-
{{ o.label }}
|
|
19
|
-
</el-button>
|
|
20
|
-
</span>
|
|
21
|
-
</span>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<!-- 操作按钮多于2个 -->
|
|
25
|
-
<div v-if="t.operation.length > 3">
|
|
26
|
-
<span v-for="(o,i) in t.operation" :key="o">
|
|
27
|
-
<span v-if="i < 3 && (o.isShow ? o.isShow(scope.row) : true)">
|
|
28
|
-
<el-tooltip v-if="!!o.icon" :content="o.label" placement="top">
|
|
29
|
-
<el-button class="table-button" size="mini" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="o.icon" circle></el-button>
|
|
30
|
-
</el-tooltip>
|
|
31
|
-
<el-button class="table-button-2" v-else text size="mini" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false">
|
|
32
|
-
{{ o.label }}
|
|
33
|
-
</el-button>
|
|
34
|
-
</span>
|
|
35
|
-
|
|
36
|
-
</span>
|
|
37
|
-
|
|
38
|
-
<span>
|
|
39
|
-
<!-- @command="(command) => addChildrenHandleCommand(command,data)" -->
|
|
40
|
-
<el-dropdown>
|
|
41
|
-
<el-icon class="icon-more"><el-icon-more /></el-icon>
|
|
42
|
-
<template #dropdown>
|
|
43
|
-
<el-dropdown-menu slot="dropdown">
|
|
44
|
-
<div v-for="(o,i) in t.operation" :key="o">
|
|
45
|
-
<el-dropdown-item command="addNewChildren" v-if="i >= 3 && (o.isShow ? o.isShow(scope.row) : true)" @click="o.clickFun(scope.row, scope.$index, tableData)">{{o.label}}</el-dropdown-item>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
</el-dropdown-menu>
|
|
49
|
-
</template>
|
|
50
|
-
</el-dropdown>
|
|
51
|
-
</span>
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div v-else>
|
|
57
|
-
<span v-for="(o,i) in t.operation" :key="o" v-show="o.isShow ? o.isShow(scope.row) : true">
|
|
58
|
-
<span>
|
|
59
|
-
<el-tooltip v-if="!!o.icon" :content="o.label" placement="top">
|
|
60
|
-
<el-button class="table-button" size="mini" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="o.icon" circle></el-button>
|
|
61
|
-
</el-tooltip>
|
|
62
|
-
<el-button class="table-button-2" v-else text size="small" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false">
|
|
63
|
-
{{ o.label }}
|
|
64
|
-
</el-button>
|
|
65
|
-
</span>
|
|
66
|
-
</span>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<!-- render -->
|
|
72
|
-
<div v-else-if="t.eleRender">
|
|
73
|
-
<span v-html="t.eleRender(scope.row, scope.$index)"></span>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div v-else-if="t.type === 'img'">
|
|
77
|
-
<el-image style="height: 28px" fit="cover" :max-scale="7" :min-scale="0.2" :z-index="99" :preview-teleported="true" :previewSrcList="[scope.row[t.dataIndex]]" :src="scope.row[t.dataIndex] ? scope.row[t.dataIndex] : '/images/empty.jpg'" />
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<!-- 枚举options -->
|
|
81
|
-
<div v-else-if="!t.switch && t.options && t.options.length > 0">
|
|
82
|
-
<template v-if="scope.row.isEdit && t.canEdit">
|
|
83
|
-
<el-select class="select-select number" :value-key="t.editValue || 'code'" v-model="scope.row[t.editSource]" placeholder="" allow-clear allow-search filter-option @change="(val) => {t.callback(val, scope.row)}">
|
|
84
|
-
<el-option :value="item" v-for="item in t.options" :key="item">{{ t.editValue ? item[t.editValue] : item.name }}</el-option>
|
|
85
|
-
</el-select>
|
|
86
|
-
</template>
|
|
87
|
-
<template v-else>
|
|
88
|
-
<span v-for="(item, index) in t.options" :key="item + index">
|
|
89
|
-
<span v-if="scope.row[t.dataIndex] == item[t.editValue || 'code']"><span v-if="item.statusColor" :style="`background-color: ${item.statusColor}; border-radius: 100%; padding: 4px; display: inline-block; margin-right: 5px;`"></span>{{ t.editValue ? item[t.editValue] : item.name }}</span>
|
|
90
|
-
</span>
|
|
91
|
-
</template>
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
<!-- 日期起始 -->
|
|
95
|
-
<div v-else-if="t.type === 'startToEnd'">
|
|
96
|
-
<div style="margin-bottom: 5px">
|
|
97
|
-
<span class="start-span">起</span>
|
|
98
|
-
{{ scope.row[t.dataIndexList[0]] ? dayjs(scope.row[t.dataIndexList[0]]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
99
|
-
</div>
|
|
100
|
-
<div>
|
|
101
|
-
<span class="end-span">止</span>
|
|
102
|
-
{{ scope.row[t.dataIndexList[1]] ? dayjs(scope.row[t.dataIndexList[1]]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<!-- 日期转换 -->
|
|
107
|
-
<div v-else-if="t.dataType">
|
|
108
|
-
{{ $fermitTime(scope.row[t.dataIndex]) }}
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<!-- 开关 -->
|
|
112
|
-
<div v-else-if="t.switch">
|
|
113
|
-
<el-switch :inline-prompt="t.isShowMessage" :active-text="t.isShowMessage ? t.activeText : ''" :inactive-text="t.isShowMessage ? t.inactiveText : ''" style="--el-switch-on-color: #3d3ad9; --el-switch-off-color: #c6c6c6" v-model="scope.row[t.dataIndex]" :active-value="t.activeValue ?? true" :inactive-value="t.inactiveValue ?? false" :disabled="t.disabled ? t.disabled(scope.row) : false" @change="(v) => {t.clickFun(v, scope.row)}" />
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<!-- 视频 -->
|
|
117
|
-
<div v-else-if="t.isVideo">
|
|
118
|
-
<video width="40" :src="scope.row[t.dataIndex]" style="margin: 5px 0" />
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
<!-- 图片 -->
|
|
122
|
-
<div v-else-if="t.pictureCard">
|
|
123
|
-
<el-image width="40" :src="scope.row[t.dataIndex]" style="margin: 5px 0" />
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
<!-- 数组转string -->
|
|
127
|
-
<div v-else-if="t.arrayList">
|
|
128
|
-
<span>{{ scope.row[t.dataIndex] !== null && scope.row[t.dataIndex].length > 0 ? scope.row[t.dataIndex].toString() : '' }}</span>
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
|
-
<!-- 链接跳转 -->
|
|
132
|
-
<span v-else-if="t.skip">
|
|
133
|
-
<el-tooltip v-if="scope.row[t.dataIndex] && scope.row[t.dataIndex].split(',')
|
|
134
|
-
<span :style="`color: ${theme};cursor: pointer;width: 100%;display: inline-block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;`">
|
|
135
|
-
{{ scope.row[t.dataIndex] ? scope.row[t.dataIndex] : '' }}
|
|
136
|
-
</span>
|
|
137
|
-
<template #content>
|
|
138
|
-
<div v-for="(item, index) in scope.row[t.dataIndex].split(',')" :key="index" :style="`color: ${theme}; cursor: pointer`" @click="t.clickFun ? t.clickFun(item, scope.row, scope.$index) : () => {}">
|
|
139
|
-
{{ item }}
|
|
140
|
-
</div>
|
|
141
|
-
</template>
|
|
142
|
-
</el-tooltip>
|
|
143
|
-
|
|
144
|
-
<span v-else>
|
|
145
|
-
<span style="color: var(--el-color-primary); cursor: pointer; text-decoration: underline;" @click="t.clickFun ? t.clickFun(scope.row[t.dataIndex], scope.row, scope.$index) : () => {}">
|
|
146
|
-
{{ (scope.row[t.dataIndex] || scope.row[t.dataIndex] === 0) ? scope.row[t.dataIndex] : '' }}
|
|
147
|
-
</span>
|
|
148
|
-
</span>
|
|
149
|
-
</span>
|
|
150
|
-
|
|
151
|
-
<!-- 进度条 -->
|
|
152
|
-
<span v-else-if="t.isProgress">
|
|
153
|
-
<el-progress :percentage="scope.row[t.dataIndex]" color="#3d3ad9" />
|
|
154
|
-
</span>
|
|
155
|
-
|
|
156
|
-
<!-- 常规渲染 -->
|
|
157
|
-
<div v-else>
|
|
158
|
-
{{ scope.row[t.dataIndex] ? scope.row[t.dataIndex] :scope.row[t.dataIndex] === 0?'0':'' }}
|
|
159
|
-
</div>
|
|
160
|
-
|
|
161
|
-
</template>
|
|
162
|
-
</el-table-column>
|
|
163
|
-
</el-table>
|
|
164
|
-
|
|
165
|
-
<!-- 分页 -->
|
|
166
|
-
<div v-if="isShowPagination" class="pagination-block">
|
|
167
|
-
|
|
168
|
-
<div class="tool-block">
|
|
169
|
-
<template v-if="!hideTool">
|
|
170
|
-
<el-tooltip :content="$t('btn.refresh')">
|
|
171
|
-
<el-icon size="20" @click="refresh"><el-icon-refresh></el-icon-refresh></el-icon>
|
|
172
|
-
</el-tooltip>
|
|
173
|
-
|
|
174
|
-
<el-dropdown @command="handleSelect">
|
|
175
|
-
<span class="dropdown-trigger">
|
|
176
|
-
<el-tooltip :content="$t('lwTable.tools.lineHeightName')">
|
|
177
|
-
<el-icon size="20"><el-icon-set-up></el-icon-set-up></el-icon>
|
|
178
|
-
</el-tooltip>
|
|
179
|
-
</span>
|
|
180
|
-
<template #dropdown>
|
|
181
|
-
<el-dropdown-menu>
|
|
182
|
-
<el-dropdown-item command="mini">{{ $t('lwTable.tools.lineHeight.mini') }}</el-dropdown-item>
|
|
183
|
-
<el-dropdown-item command="small">{{ $t('lwTable.tools.lineHeight.small') }}</el-dropdown-item>
|
|
184
|
-
<el-dropdown-item command="medium">{{ $t('lwTable.tools.lineHeight.medium') }}</el-dropdown-item>
|
|
185
|
-
<el-dropdown-item command="large">{{ $t('lwTable.tools.lineHeight.large') }}</el-dropdown-item>
|
|
186
|
-
</el-dropdown-menu>
|
|
187
|
-
</template>
|
|
188
|
-
</el-dropdown>
|
|
189
|
-
|
|
190
|
-
<el-popover placement="top-start" :title="$t('lwTable.tools.columnsSetting')" :width="400" trigger="hover">
|
|
191
|
-
<template #reference>
|
|
192
|
-
<el-icon size="20"><el-icon-setting></el-icon-setting></el-icon>
|
|
193
|
-
</template>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<el-icon v-if="
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="baseTablePage-wrap">
|
|
3
|
+
<el-table ref="multipleTable" column-resizable v-loading="loading" :columns="tableHeaders" :stripe="stripe" :data="tableData" :row-key="rowKey" :hoverable="hoverable" :default-expand-all-rows="defaultExpandAll" :size="tableSize" highlight-current-row :max-height="maxHeight" scrollbar-always-on :scroll="{ x: '100%', y: '100%' }" :virtual-list-props="virtualListProps" @current-change="handleCurrentChange" @selection-change="handleSelectionChange">
|
|
4
|
+
<el-table-column fixed="left" type="selection" width="55" v-if="rowSelection" />
|
|
5
|
+
<el-table-column v-for="t in tableHeaders" :label="t.title" :prop="t.dataIndex" :min-width="t.width" :align="t.align ?? 'center'" :fixed="t.fixed" :sortable="t.sortable" :show-overflow-tooltip="t.tooltip" :key="t">
|
|
6
|
+
<template #default="scope">
|
|
7
|
+
<!-- 操作 -->
|
|
8
|
+
<div v-if="t.operation">
|
|
9
|
+
<div v-if="t.ellipsis">
|
|
10
|
+
<!-- 操作按钮少于3个 -->
|
|
11
|
+
<div v-if="t.operation.length <= 3">
|
|
12
|
+
<span v-for="(o,i) in t.operation" :key="o" v-show="o.isShow ? o.isShow(scope.row) : true">
|
|
13
|
+
<span v-if="i <= 2">
|
|
14
|
+
<el-tooltip v-if="!!o.icon" :content="o.label" placement="top">
|
|
15
|
+
<el-button class="table-button" size="small" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="o.icon" circle></el-button>
|
|
16
|
+
</el-tooltip>
|
|
17
|
+
<el-button class="table-button-2" v-else text size="small" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false">
|
|
18
|
+
{{ o.label }}
|
|
19
|
+
</el-button>
|
|
20
|
+
</span>
|
|
21
|
+
</span>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- 操作按钮多于2个 -->
|
|
25
|
+
<div v-if="t.operation.length > 3">
|
|
26
|
+
<span v-for="(o,i) in t.operation" :key="o">
|
|
27
|
+
<span v-if="i < 3 && (o.isShow ? o.isShow(scope.row) : true)">
|
|
28
|
+
<el-tooltip v-if="!!o.icon" :content="o.label" placement="top">
|
|
29
|
+
<el-button class="table-button" size="mini" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="o.icon" circle></el-button>
|
|
30
|
+
</el-tooltip>
|
|
31
|
+
<el-button class="table-button-2" v-else text size="mini" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false">
|
|
32
|
+
{{ o.label }}
|
|
33
|
+
</el-button>
|
|
34
|
+
</span>
|
|
35
|
+
|
|
36
|
+
</span>
|
|
37
|
+
|
|
38
|
+
<span>
|
|
39
|
+
<!-- @command="(command) => addChildrenHandleCommand(command,data)" -->
|
|
40
|
+
<el-dropdown>
|
|
41
|
+
<el-icon class="icon-more"><el-icon-more /></el-icon>
|
|
42
|
+
<template #dropdown>
|
|
43
|
+
<el-dropdown-menu slot="dropdown">
|
|
44
|
+
<div v-for="(o,i) in t.operation" :key="o">
|
|
45
|
+
<el-dropdown-item command="addNewChildren" v-if="i >= 3 && (o.isShow ? o.isShow(scope.row) : true)" @click="o.clickFun(scope.row, scope.$index, tableData)">{{o.label}}</el-dropdown-item>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
</el-dropdown-menu>
|
|
49
|
+
</template>
|
|
50
|
+
</el-dropdown>
|
|
51
|
+
</span>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div v-else>
|
|
57
|
+
<span v-for="(o,i) in t.operation" :key="o" v-show="o.isShow ? o.isShow(scope.row) : true">
|
|
58
|
+
<span>
|
|
59
|
+
<el-tooltip v-if="!!o.icon" :content="o.label" placement="top">
|
|
60
|
+
<el-button class="table-button" size="mini" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="o.icon" circle></el-button>
|
|
61
|
+
</el-tooltip>
|
|
62
|
+
<el-button class="table-button-2" v-else text size="small" @click="o.clickFun(scope.row, scope.$index, tableData)" :key="o" :disabled="o.disabled ? o.disabled(scope.row) : false">
|
|
63
|
+
{{ o.label }}
|
|
64
|
+
</el-button>
|
|
65
|
+
</span>
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<!-- render -->
|
|
72
|
+
<div v-else-if="t.eleRender">
|
|
73
|
+
<span v-html="t.eleRender(scope.row, scope.$index)"></span>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div v-else-if="t.type === 'img'">
|
|
77
|
+
<el-image style="height: 28px" fit="cover" :max-scale="7" :min-scale="0.2" :z-index="99" :preview-teleported="true" :previewSrcList="[scope.row[t.dataIndex]]" :src="scope.row[t.dataIndex] ? scope.row[t.dataIndex] : '/images/empty.jpg'" />
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<!-- 枚举options -->
|
|
81
|
+
<div v-else-if="!t.switch && t.options && t.options.length > 0">
|
|
82
|
+
<template v-if="scope.row.isEdit && t.canEdit">
|
|
83
|
+
<el-select class="select-select number" :value-key="t.editValue || 'code'" v-model="scope.row[t.editSource]" placeholder="" allow-clear allow-search filter-option @change="(val) => {t.callback(val, scope.row)}">
|
|
84
|
+
<el-option :value="item" v-for="item in t.options" :key="item">{{ t.editValue ? item[t.editValue] : item.name }}</el-option>
|
|
85
|
+
</el-select>
|
|
86
|
+
</template>
|
|
87
|
+
<template v-else>
|
|
88
|
+
<span v-for="(item, index) in t.options" :key="item + index">
|
|
89
|
+
<span v-if="scope.row[t.dataIndex] == item[t.editValue || 'code']"><span v-if="item.statusColor" :style="`background-color: ${item.statusColor}; border-radius: 100%; padding: 4px; display: inline-block; margin-right: 5px;`"></span>{{ t.editValue ? item[t.editValue] : item.name }}</span>
|
|
90
|
+
</span>
|
|
91
|
+
</template>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<!-- 日期起始 -->
|
|
95
|
+
<div v-else-if="t.type === 'startToEnd'">
|
|
96
|
+
<div style="margin-bottom: 5px">
|
|
97
|
+
<span class="start-span">起</span>
|
|
98
|
+
{{ scope.row[t.dataIndexList[0]] ? dayjs(scope.row[t.dataIndexList[0]]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
99
|
+
</div>
|
|
100
|
+
<div>
|
|
101
|
+
<span class="end-span">止</span>
|
|
102
|
+
{{ scope.row[t.dataIndexList[1]] ? dayjs(scope.row[t.dataIndexList[1]]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<!-- 日期转换 -->
|
|
107
|
+
<div v-else-if="t.dataType">
|
|
108
|
+
{{ $fermitTime(scope.row[t.dataIndex]) }}
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<!-- 开关 -->
|
|
112
|
+
<div v-else-if="t.switch">
|
|
113
|
+
<el-switch :inline-prompt="t.isShowMessage" :active-text="t.isShowMessage ? t.activeText : ''" :inactive-text="t.isShowMessage ? t.inactiveText : ''" style="--el-switch-on-color: #3d3ad9; --el-switch-off-color: #c6c6c6" v-model="scope.row[t.dataIndex]" :active-value="t.activeValue ?? true" :inactive-value="t.inactiveValue ?? false" :disabled="t.disabled ? t.disabled(scope.row) : false" @change="(v) => {t.clickFun(v, scope.row)}" />
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<!-- 视频 -->
|
|
117
|
+
<div v-else-if="t.isVideo">
|
|
118
|
+
<video width="40" :src="scope.row[t.dataIndex]" style="margin: 5px 0" />
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- 图片 -->
|
|
122
|
+
<div v-else-if="t.pictureCard">
|
|
123
|
+
<el-image width="40" :src="scope.row[t.dataIndex]" style="margin: 5px 0" />
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<!-- 数组转string -->
|
|
127
|
+
<div v-else-if="t.arrayList">
|
|
128
|
+
<span>{{ scope.row[t.dataIndex] !== null && scope.row[t.dataIndex].length > 0 ? scope.row[t.dataIndex].toString() : '' }}</span>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<!-- 链接跳转 -->
|
|
132
|
+
<span v-else-if="t.skip">
|
|
133
|
+
<el-tooltip v-if="scope.row[t.dataIndex] && scope.row[t.dataIndex].toString().split(',').length > 1">
|
|
134
|
+
<span :style="`color: ${theme};cursor: pointer;width: 100%;display: inline-block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;`">
|
|
135
|
+
{{ scope.row[t.dataIndex] ? scope.row[t.dataIndex] : '' }}
|
|
136
|
+
</span>
|
|
137
|
+
<template #content>
|
|
138
|
+
<div v-for="(item, index) in scope.row[t.dataIndex].split(',')" :key="index" :style="`color: ${theme}; cursor: pointer`" @click="t.clickFun ? t.clickFun(item, scope.row, scope.$index) : () => {}">
|
|
139
|
+
{{ item }}
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
</el-tooltip>
|
|
143
|
+
|
|
144
|
+
<span v-else>
|
|
145
|
+
<span style="color: var(--el-color-primary); cursor: pointer; text-decoration: underline;" @click="t.clickFun ? t.clickFun(scope.row[t.dataIndex], scope.row, scope.$index) : () => {}">
|
|
146
|
+
{{ (scope.row[t.dataIndex] || scope.row[t.dataIndex] === 0) ? scope.row[t.dataIndex] : '' }}
|
|
147
|
+
</span>
|
|
148
|
+
</span>
|
|
149
|
+
</span>
|
|
150
|
+
|
|
151
|
+
<!-- 进度条 -->
|
|
152
|
+
<span v-else-if="t.isProgress">
|
|
153
|
+
<el-progress :percentage="scope.row[t.dataIndex]" color="#3d3ad9" />
|
|
154
|
+
</span>
|
|
155
|
+
|
|
156
|
+
<!-- 常规渲染 -->
|
|
157
|
+
<div v-else>
|
|
158
|
+
{{ scope.row[t.dataIndex] ? scope.row[t.dataIndex] :scope.row[t.dataIndex] === 0?'0':'' }}
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
</template>
|
|
162
|
+
</el-table-column>
|
|
163
|
+
</el-table>
|
|
164
|
+
|
|
165
|
+
<!-- 分页 -->
|
|
166
|
+
<div v-if="isShowPagination" class="pagination-block">
|
|
167
|
+
|
|
168
|
+
<div class="tool-block">
|
|
169
|
+
<template v-if="!hideTool">
|
|
170
|
+
<el-tooltip :content="$t('btn.refresh')">
|
|
171
|
+
<el-icon size="20" @click="refresh"><el-icon-refresh></el-icon-refresh></el-icon>
|
|
172
|
+
</el-tooltip>
|
|
173
|
+
|
|
174
|
+
<el-dropdown @command="handleSelect">
|
|
175
|
+
<span class="dropdown-trigger">
|
|
176
|
+
<el-tooltip :content="$t('lwTable.tools.lineHeightName')">
|
|
177
|
+
<el-icon size="20"><el-icon-set-up></el-icon-set-up></el-icon>
|
|
178
|
+
</el-tooltip>
|
|
179
|
+
</span>
|
|
180
|
+
<template #dropdown>
|
|
181
|
+
<el-dropdown-menu>
|
|
182
|
+
<el-dropdown-item command="mini">{{ $t('lwTable.tools.lineHeight.mini') }}</el-dropdown-item>
|
|
183
|
+
<el-dropdown-item command="small">{{ $t('lwTable.tools.lineHeight.small') }}</el-dropdown-item>
|
|
184
|
+
<el-dropdown-item command="medium">{{ $t('lwTable.tools.lineHeight.medium') }}</el-dropdown-item>
|
|
185
|
+
<el-dropdown-item command="large">{{ $t('lwTable.tools.lineHeight.large') }}</el-dropdown-item>
|
|
186
|
+
</el-dropdown-menu>
|
|
187
|
+
</template>
|
|
188
|
+
</el-dropdown>
|
|
189
|
+
|
|
190
|
+
<el-popover placement="top-start" :title="$t('lwTable.tools.columnsSetting')" :width="400" trigger="hover">
|
|
191
|
+
<template #reference>
|
|
192
|
+
<el-icon size="20"><el-icon-setting></el-icon-setting></el-icon>
|
|
193
|
+
</template>
|
|
194
|
+
<el-checkbox v-model="allCheck" @change="checkAll">
|
|
195
|
+
{{ $t('lwTable.tools.allCheck') }},{{ $t('lwTable.tools.hasChecked') }}{{ checkedKeys.length }}/{{ treeData.length }}
|
|
196
|
+
</el-checkbox>
|
|
197
|
+
<el-checkbox-group v-model="checkedKeys" @change="treeCheck">
|
|
198
|
+
<el-checkbox v-for="item in treeData" :key="item.key" :label="item.title" :value="item.key">
|
|
199
|
+
{{ item.title }}
|
|
200
|
+
</el-checkbox>
|
|
201
|
+
</el-checkbox-group>
|
|
202
|
+
|
|
203
|
+
<div class="fix-num">
|
|
204
|
+
{{$t('lwTable.tools.table_before')}}
|
|
205
|
+
<el-input-number v-model="fixNum" @change="fixNumChange" :min="0" :max="10" size="small" />
|
|
206
|
+
{{$t('lwTable.tools.column_fixed')}}
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
</el-popover>
|
|
210
|
+
|
|
211
|
+
<el-tooltip :content="isFullscreen ? $t('lwTable.tools.cancel') : $t('lwTable.tools.fullScreen')">
|
|
212
|
+
<el-icon v-if="!isFullscreen" class="icon-fullscreen" @click="tableToggleFullScreen"><el-icon-full-screen /></el-icon>
|
|
213
|
+
<el-icon v-if="isFullscreen" class="icon-fullscreen-exit" @click="tableToggleFullScreen"><el-icon-full-screen /></el-icon>
|
|
214
|
+
</el-tooltip>
|
|
215
|
+
</template>
|
|
216
|
+
</div>
|
|
217
|
+
<el-pagination background small="true" :current-page.sync="parseFloat(searchParams.page).toString() == 'NaN' ? 1 : searchParams.page" :page-size="searchParams.size ? searchParams.size : 10" layout="total, prev, pager, next, sizes, jumper" :total="totalCount" :page-sizes="pageSizes" @size-change="sizeChange" @current-change="currentChange" />
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
</template>
|
|
221
|
+
|
|
222
|
+
<script src="./index.js"></script>
|
|
223
|
+
<style lang="scss" scoped>
|
|
224
|
+
@import "./index.scss";
|
|
225
|
+
</style>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
lwTable: {
|
|
3
|
-
tools: {
|
|
4
|
-
lineHeightName: 'row height',
|
|
5
|
-
lineHeight: {
|
|
6
|
-
mini: 'Compact',
|
|
7
|
-
small: 'Medium',
|
|
8
|
-
medium: 'High',
|
|
9
|
-
large: 'Extra High'
|
|
10
|
-
},
|
|
11
|
-
border: 'Border',
|
|
12
|
-
columnsSetting: 'Column Settings',
|
|
13
|
-
allCheck: 'Select All',
|
|
14
|
-
hasChecked: 'Selected',
|
|
15
|
-
cancel: 'Cancel',
|
|
16
|
-
fullScreen: 'Full Screen',
|
|
17
|
-
table_before: 'Before the table',
|
|
18
|
-
column_fixed: 'Column fixed',
|
|
19
|
-
last_column_fixed: 'Last column fixed',
|
|
20
|
-
please_select: 'Please select...',
|
|
21
|
-
total: 'total',
|
|
22
|
-
recordsPage: 'records Page',
|
|
23
|
-
pages: 'pages'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
lwTable: {
|
|
3
|
+
tools: {
|
|
4
|
+
lineHeightName: 'row height',
|
|
5
|
+
lineHeight: {
|
|
6
|
+
mini: 'Compact',
|
|
7
|
+
small: 'Medium',
|
|
8
|
+
medium: 'High',
|
|
9
|
+
large: 'Extra High'
|
|
10
|
+
},
|
|
11
|
+
border: 'Border',
|
|
12
|
+
columnsSetting: 'Column Settings',
|
|
13
|
+
allCheck: 'Select All',
|
|
14
|
+
hasChecked: 'Selected',
|
|
15
|
+
cancel: 'Cancel',
|
|
16
|
+
fullScreen: 'Full Screen',
|
|
17
|
+
table_before: 'Before the table',
|
|
18
|
+
column_fixed: 'Column fixed',
|
|
19
|
+
last_column_fixed: 'Last column fixed',
|
|
20
|
+
please_select: 'Please select...',
|
|
21
|
+
total: 'total',
|
|
22
|
+
recordsPage: 'records Page',
|
|
23
|
+
pages: 'pages'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
lwTable: {
|
|
3
|
-
tools: {
|
|
4
|
-
lineHeightName: '行高',
|
|
5
|
-
lineHeight: {
|
|
6
|
-
mini: '紧凑',
|
|
7
|
-
small: '中等',
|
|
8
|
-
medium: '高',
|
|
9
|
-
large: '较高'
|
|
10
|
-
},
|
|
11
|
-
border: '边框',
|
|
12
|
-
columnsSetting: '列设置',
|
|
13
|
-
allCheck: '全选',
|
|
14
|
-
hasChecked: '已选',
|
|
15
|
-
cancel: '取消',
|
|
16
|
-
fullScreen: '全屏',
|
|
17
|
-
table_before: '表格前',
|
|
18
|
-
column_fixed: '列固定',
|
|
19
|
-
last_column_fixed: '最后一列固定',
|
|
20
|
-
please_select: '请选择...',
|
|
21
|
-
total: '共',
|
|
22
|
-
recordsPage: '条记录 第',
|
|
23
|
-
pages: '页'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
lwTable: {
|
|
3
|
+
tools: {
|
|
4
|
+
lineHeightName: '行高',
|
|
5
|
+
lineHeight: {
|
|
6
|
+
mini: '紧凑',
|
|
7
|
+
small: '中等',
|
|
8
|
+
medium: '高',
|
|
9
|
+
large: '较高'
|
|
10
|
+
},
|
|
11
|
+
border: '边框',
|
|
12
|
+
columnsSetting: '列设置',
|
|
13
|
+
allCheck: '全选',
|
|
14
|
+
hasChecked: '已选',
|
|
15
|
+
cancel: '取消',
|
|
16
|
+
fullScreen: '全屏',
|
|
17
|
+
table_before: '表格前',
|
|
18
|
+
column_fixed: '列固定',
|
|
19
|
+
last_column_fixed: '最后一列固定',
|
|
20
|
+
please_select: '请选择...',
|
|
21
|
+
total: '共',
|
|
22
|
+
recordsPage: '条记录 第',
|
|
23
|
+
pages: '页'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|