@jzt-packages/components 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 +68 -0
- package/src/JztBackTop/index.vue +255 -0
- package/src/JztButtonList/index.vue +88 -0
- package/src/JztChart/index.vue +95 -0
- package/src/JztCharts/index.vue +317 -0
- package/src/JztClassTabs/index.vue +156 -0
- package/src/JztDateSelect/dateSelect.vue +186 -0
- package/src/JztDateSelect/dateType.vue +54 -0
- package/src/JztDateSelect/index.ts +135 -0
- package/src/JztDateSelect/interface/index.ts +13 -0
- package/src/JztDialog/index.vue +249 -0
- package/src/JztEllipsisTooltip/index.vue +61 -0
- package/src/JztEmpty/index.vue +45 -0
- package/src/JztErrorPage/403.vue +30 -0
- package/src/JztErrorPage/404.vue +19 -0
- package/src/JztErrorPage/500.vue +18 -0
- package/src/JztErrorPage/assets/401.png +0 -0
- package/src/JztErrorPage/assets/403.png +0 -0
- package/src/JztErrorPage/assets/404.png +0 -0
- package/src/JztErrorPage/assets/500.png +0 -0
- package/src/JztErrorPage/index.scss +35 -0
- package/src/JztErrorPage/index.vue +35 -0
- package/src/JztFilePreview/components/pdfViewer.vue +221 -0
- package/src/JztFilePreview/hooks/useImageMethod.ts +256 -0
- package/src/JztFilePreview/index.scss +171 -0
- package/src/JztFilePreview/index.vue +68 -0
- package/src/JztFilePreview/interface/index.ts +18 -0
- package/src/JztFilePreview/previewFile.vue +371 -0
- package/src/JztFormGrid/README.md +520 -0
- package/src/JztFormGrid/components/formItem.vue +209 -0
- package/src/JztFormGrid/components/formItemValue.vue +384 -0
- package/src/JztFormGrid/components/showDetailForm.vue +172 -0
- package/src/JztFormGrid/index.scss +60 -0
- package/src/JztFormGrid/index.vue +513 -0
- package/src/JztFormGrid/interface/index.ts +106 -0
- package/src/JztGrid/components/GridItem.vue +68 -0
- package/src/JztGrid/index.vue +179 -0
- package/src/JztGrid/interface/index.ts +6 -0
- package/src/JztImportExcel/assets/delete.png +0 -0
- package/src/JztImportExcel/index.scss +46 -0
- package/src/JztImportExcel/index.vue +430 -0
- package/src/JztImportExcel/interface/index.ts +25 -0
- package/src/JztLabelTitle/index.vue +65 -0
- package/src/JztLeftRightMode/components/CollapseButton.vue +80 -0
- package/src/JztLeftRightMode/components/LeftCard.vue +203 -0
- package/src/JztLeftRightMode/components/LeftLayout.vue +173 -0
- package/src/JztLeftRightMode/components/RightHeader.vue +186 -0
- package/src/JztLeftRightMode/components/RightLayout.vue +235 -0
- package/src/JztLeftRightMode/components/RightTableHeader.vue +43 -0
- package/src/JztLeftRightMode/hooks/useCollapse.ts +17 -0
- package/src/JztLeftRightMode/hooks/useDefaultProps.ts +19 -0
- package/src/JztLeftRightMode/hooks/useLeftLayout.ts +201 -0
- package/src/JztLeftRightMode/hooks/useMode.ts +20 -0
- package/src/JztLeftRightMode/hooks/usePrevNext.ts +60 -0
- package/src/JztLeftRightMode/hooks/useRightLayout.ts +215 -0
- package/src/JztLeftRightMode/hooks/useSlots.ts +15 -0
- package/src/JztLeftRightMode/index.ts +3 -0
- package/src/JztLeftRightMode/index.vue +494 -0
- package/src/JztLeftRightMode/types/index.ts +457 -0
- package/src/JztLoading/fullScreen.ts +45 -0
- package/src/JztLoading/index.scss +67 -0
- package/src/JztLoading/index.vue +18 -0
- package/src/JztLogin/components/LoginFooter.vue +17 -0
- package/src/JztLogin/components/LoginForm.vue +99 -0
- package/src/JztLogin/hooks/useLogin.ts +186 -0
- package/src/JztLogin/index.scss +142 -0
- package/src/JztLogin/index.vue +31 -0
- package/src/JztLogin/interface/index.ts +47 -0
- package/src/JztNumericalRange/index.vue +81 -0
- package/src/JztPageCard/comm/datePicker.vue +151 -0
- package/src/JztPageCard/comm/details.vue +60 -0
- package/src/JztPageCard/comm/export.vue +24 -0
- package/src/JztPageCard/comm/tabs.vue +94 -0
- package/src/JztPageCard/comm/tooltip.vue +31 -0
- package/src/JztPageCard/index.vue +287 -0
- package/src/JztPagination/index.vue +70 -0
- package/src/JztProductInfo/components/imagePreview.vue +275 -0
- package/src/JztProductInfo/components/qxUnique.vue +101 -0
- package/src/JztProductInfo/components/records.vue +265 -0
- package/src/JztProductInfo/hooks/useParams.ts +143 -0
- package/src/JztProductInfo/hooks/useQxUnique.tsx +466 -0
- package/src/JztProductInfo/images/defaultProduct.png +0 -0
- package/src/JztProductInfo/index.ts +116 -0
- package/src/JztProductInfo/index.vue +108 -0
- package/src/JztProductInfo/interface/index.ts +15 -0
- package/src/JztQueryDetailTable/index.scss +100 -0
- package/src/JztQueryDetailTable/index.vue +400 -0
- package/src/JztQueryDetailTable/interface/index.ts +10 -0
- package/src/JztQueryTable/QueryTable /345/212/237/350/203/275.md" +1580 -0
- package/src/JztQueryTable/README.md +567 -0
- package/src/JztQueryTable/components/ColSetting.vue +67 -0
- package/src/JztQueryTable/components/ColumnsSetting.vue +404 -0
- package/src/JztQueryTable/components/ColumnsSetting1.vue +220 -0
- package/src/JztQueryTable/components/DeployToAccountLevelSetting.vue +351 -0
- package/src/JztQueryTable/components/Pagination.vue +54 -0
- package/src/JztQueryTable/components/TableColumn.vue +109 -0
- package/src/JztQueryTable/const.ts +1 -0
- package/src/JztQueryTable/hooks/useQueryTable.ts +194 -0
- package/src/JztQueryTable/hooks/useSelection.ts +47 -0
- package/src/JztQueryTable/hooks/useTableSetting.ts +197 -0
- package/src/JztQueryTable/hooks/useTemplate.ts +127 -0
- package/src/JztQueryTable/index.scss +91 -0
- package/src/JztQueryTable/index.vue +1445 -0
- package/src/JztQueryTable/interface/index.ts +185 -0
- package/src/JztRegionSelect/index.vue +134 -0
- package/src/JztSearchForm/components/SearchFormItem.vue +473 -0
- package/src/JztSearchForm/index.vue +530 -0
- package/src/JztSearchForm/interface/index.ts +100 -0
- package/src/JztSelectFilter/index.scss +63 -0
- package/src/JztSelectFilter/index.vue +110 -0
- package/src/JztSelectTable/index.vue +257 -0
- package/src/JztTable/index.scss +72 -0
- package/src/JztTable/index.vue +353 -0
- package/src/JztTable/interface/index.ts +1 -0
- package/src/JztTime/comm/agencySelect.vue +112 -0
- package/src/JztTime/comm/collapseRow.vue +132 -0
- package/src/JztTime/comm/dateSelect.vue +292 -0
- package/src/JztTime/comm/deptSelect.vue +193 -0
- package/src/JztTime/comm/typeSelect.vue +97 -0
- package/src/JztTime/index.ts +216 -0
- package/src/JztTime/index.vue +303 -0
- package/src/JztTime/interface/index.ts +23 -0
- package/src/JztTreeFilter/index.scss +44 -0
- package/src/JztTreeFilter/index.vue +177 -0
- package/src/JztUploadFile/interface/index.ts +21 -0
- package/src/JztUploadFile/multiple.scss +215 -0
- package/src/JztUploadFile/multiple.vue +318 -0
- package/src/JztUploadFile/single.scss +226 -0
- package/src/JztUploadFile/single.vue +274 -0
- package/src/JztUploadImg/Img.vue +294 -0
- package/src/JztUploadImg/Imgs.vue +411 -0
- package/src/JztUploadImg/index.scss +138 -0
- package/src/JztUploadImg/interface/index.ts +22 -0
- package/src/SelectIcon/index.scss +39 -0
- package/src/SelectIcon/index.vue +106 -0
- package/src/SvgIcon/index.vue +22 -0
- package/src/hooks/useAuthButtons.ts +58 -0
- package/src/hooks/useFormByUserType.ts +90 -0
- package/src/hooks/useTableEvents.ts +30 -0
- package/src/hooks/useUploadFileHook.ts +262 -0
- package/src/index.ts +91 -0
- package/src/typings/global.d.ts +101 -0
- package/src/utils/index.ts +107 -0
- package/src/utils/tree.ts +57 -0
- package/tsconfig.json +45 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-filter">
|
|
3
|
+
<div v-for="item in data" :key="item.key" class="select-filter-item">
|
|
4
|
+
<div class="select-filter-item-title">
|
|
5
|
+
<span>{{ item.title }} :</span>
|
|
6
|
+
</div>
|
|
7
|
+
<span v-if="!item.options.length" class="select-filter-notData">暂无数据 ~</span>
|
|
8
|
+
<el-scrollbar>
|
|
9
|
+
<ul class="select-filter-list">
|
|
10
|
+
<li
|
|
11
|
+
v-for="option in item.options"
|
|
12
|
+
:key="option.value"
|
|
13
|
+
:class="{
|
|
14
|
+
active:
|
|
15
|
+
option.value === selected[item.key] ||
|
|
16
|
+
(Array.isArray(selected[item.key]) && selected[item.key].includes(option.value))
|
|
17
|
+
}"
|
|
18
|
+
@click="select(item, option)"
|
|
19
|
+
>
|
|
20
|
+
<slot :row="option">
|
|
21
|
+
<el-icon v-if="option.icon">
|
|
22
|
+
<component :is="option.icon" />
|
|
23
|
+
</el-icon>
|
|
24
|
+
<span>{{ option.label }}</span>
|
|
25
|
+
</slot>
|
|
26
|
+
</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</el-scrollbar>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts" name="selectFilter">
|
|
34
|
+
import { ref, watch } from 'vue'
|
|
35
|
+
|
|
36
|
+
interface OptionsProps {
|
|
37
|
+
value: string | number
|
|
38
|
+
label: string
|
|
39
|
+
icon?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface SelectDataProps {
|
|
43
|
+
title: string // 列表标题
|
|
44
|
+
key: string // 当前筛选项 key 值
|
|
45
|
+
multiple?: boolean // 是否为多选
|
|
46
|
+
options: OptionsProps[] // 筛选数据
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface SelectFilterProps {
|
|
50
|
+
data?: SelectDataProps[] // 选择的列表数据
|
|
51
|
+
defaultValues?: { [key: string]: any } // 默认值
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const props = withDefaults(defineProps<SelectFilterProps>(), {
|
|
55
|
+
data: () => [],
|
|
56
|
+
defaultValues: () => ({})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// 重新接收默认值
|
|
60
|
+
const selected = ref<{ [key: string]: any }>({})
|
|
61
|
+
watch(
|
|
62
|
+
() => props.defaultValues,
|
|
63
|
+
() => {
|
|
64
|
+
props.data.forEach(item => {
|
|
65
|
+
if (item.multiple) selected.value[item.key] = props.defaultValues[item.key] ?? ['']
|
|
66
|
+
else selected.value[item.key] = props.defaultValues[item.key] ?? ''
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
{ deep: true, immediate: true }
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
// emit
|
|
73
|
+
const emit = defineEmits<{
|
|
74
|
+
change: [value: any]
|
|
75
|
+
}>()
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @description 选择筛选项
|
|
79
|
+
* @param {Object} item 选中的哪项列表
|
|
80
|
+
* @param {Object} option 选中的值
|
|
81
|
+
* @return void
|
|
82
|
+
* */
|
|
83
|
+
const select = (item: SelectDataProps, option: OptionsProps) => {
|
|
84
|
+
if (!item.multiple) {
|
|
85
|
+
// * 单选
|
|
86
|
+
if (selected.value[item.key] !== option.value) selected.value[item.key] = option.value
|
|
87
|
+
} else {
|
|
88
|
+
// * 多选
|
|
89
|
+
// 如果选中的是第一个值,则直接设置
|
|
90
|
+
if (item.options[0].value === option.value) selected.value[item.key] = [option.value]
|
|
91
|
+
// 如果选择的值已经选中了,则删除选中的值
|
|
92
|
+
if (selected.value[item.key].includes(option.value)) {
|
|
93
|
+
let currentIndex = selected.value[item.key].findIndex((s: any) => s === option.value)
|
|
94
|
+
selected.value[item.key].splice(currentIndex, 1)
|
|
95
|
+
// 当全部删光时,把第第一个值选中
|
|
96
|
+
if (selected.value[item.key].length == 0) selected.value[item.key] = [item.options[0].value]
|
|
97
|
+
} else {
|
|
98
|
+
// 未选中点击值的时候,追加选中值
|
|
99
|
+
selected.value[item.key].push(option.value)
|
|
100
|
+
// 单选中全部并且点击到了未选中的值,把第一个值删除掉
|
|
101
|
+
if (selected.value[item.key].includes(item.options[0].value)) selected.value[item.key].splice(0, 1)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
emit('change', selected.value)
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style scoped lang="scss">
|
|
109
|
+
@use './index';
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form>
|
|
3
|
+
<el-popover
|
|
4
|
+
ref="popoverRef"
|
|
5
|
+
:visible="popoverVisible"
|
|
6
|
+
:width="width"
|
|
7
|
+
:teleported="false"
|
|
8
|
+
placement="bottom-start"
|
|
9
|
+
:popper-style="{ maxWidth: 'none', minWidth: minWidth }"
|
|
10
|
+
popper-class="jzt-selected-popover"
|
|
11
|
+
@show="onShowPopover"
|
|
12
|
+
@hide="onHidePopover"
|
|
13
|
+
>
|
|
14
|
+
<template #reference>
|
|
15
|
+
<slot name="reference">
|
|
16
|
+
<el-input
|
|
17
|
+
readonly
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
:placeholder="placeholder"
|
|
20
|
+
:value="selectedNames"
|
|
21
|
+
@click="onOpen"
|
|
22
|
+
class="sle"
|
|
23
|
+
v-click-outside="onClickOutside"
|
|
24
|
+
v-bind="inputProps"
|
|
25
|
+
>
|
|
26
|
+
<!-- <template #append>
|
|
27
|
+
<el-button :icon="Search" />
|
|
28
|
+
</template> -->
|
|
29
|
+
</el-input>
|
|
30
|
+
</slot>
|
|
31
|
+
</template>
|
|
32
|
+
<div class="popover-content flex flex-col">
|
|
33
|
+
<slot>
|
|
34
|
+
<JztQueryTable
|
|
35
|
+
ref="proTableRef"
|
|
36
|
+
:customForm="true"
|
|
37
|
+
:tool-button="queryTableProps?.toolButton ?? false"
|
|
38
|
+
:grid-params="queryTableProps?.gridParams ?? undefined"
|
|
39
|
+
:table-config="tableConfigOptions"
|
|
40
|
+
:request-api="requestApi"
|
|
41
|
+
:request-auto="false"
|
|
42
|
+
v-model:init-param="initParams"
|
|
43
|
+
:tabActiveName="tabActiveName"
|
|
44
|
+
:tabs-list="tabsList"
|
|
45
|
+
:btn-buffix="true"
|
|
46
|
+
:show-query-btn="false"
|
|
47
|
+
:show-reset-btn="false"
|
|
48
|
+
:pagination="queryTableProps?.pagination ?? false"
|
|
49
|
+
@tab-change="tabChange"
|
|
50
|
+
:height="queryTableProps?.tableHeight ?? 220"
|
|
51
|
+
>
|
|
52
|
+
<template #rightBtn>
|
|
53
|
+
<div class="ml15">
|
|
54
|
+
<el-button v-if="isShowQueryBtn" :plain="isShowQueryBtn" type="primary" @click="onSearch">
|
|
55
|
+
查询
|
|
56
|
+
</el-button>
|
|
57
|
+
<el-button v-if="isShowAddBtn" type="primary" @click="onAddHandle">
|
|
58
|
+
{{ addBtnText }}
|
|
59
|
+
</el-button>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
</JztQueryTable>
|
|
63
|
+
</slot>
|
|
64
|
+
</div>
|
|
65
|
+
</el-popover>
|
|
66
|
+
</el-form>
|
|
67
|
+
</template>
|
|
68
|
+
<script setup lang="tsx" name="selectProductPopover">
|
|
69
|
+
import { Search } from '@element-plus/icons-vue'
|
|
70
|
+
import { ElMessage, ClickOutside as vClickOutside } from 'element-plus'
|
|
71
|
+
import { computed, ref, unref } from 'vue'
|
|
72
|
+
import JztQueryTable from '../JztQueryTable/index.vue'
|
|
73
|
+
import type { ProTableInstance } from '../JztQueryTable/interface'
|
|
74
|
+
|
|
75
|
+
interface Props {
|
|
76
|
+
placeholder?: string
|
|
77
|
+
// selectedList?: string[]; // 选中数据
|
|
78
|
+
requestApi: (params: any) => Promise<any> // 请求接口
|
|
79
|
+
tableConfigOptions: any // 表格配置
|
|
80
|
+
initParam?: any // 初始化参数
|
|
81
|
+
rowKey?: string // 表格行唯一标识,
|
|
82
|
+
rowName?: string // 表格行展示key
|
|
83
|
+
tabsList?: Array<{ label: string; value: string | number }> // tab 列表
|
|
84
|
+
tabActiveName?: string
|
|
85
|
+
closeMode?: 'close' | false | 'clear' // close仅关闭,clear关闭并清空 false不自动关闭(自己调方法关闭)
|
|
86
|
+
addBtnText?: string
|
|
87
|
+
width?: string // 宽度(固定)
|
|
88
|
+
minWidth?: string // 最小宽度
|
|
89
|
+
isShowAddBtn?: boolean // 是否显示添加按钮
|
|
90
|
+
disabled?: boolean // 是否禁用
|
|
91
|
+
inputProps?: Object // input属性
|
|
92
|
+
isAutoOpen?: boolean // 是否自动打开弹窗
|
|
93
|
+
// gridParams?: {
|
|
94
|
+
// gridId: string
|
|
95
|
+
// url: string
|
|
96
|
+
// }
|
|
97
|
+
isShowQueryBtn?: boolean // 是否显示查询按钮
|
|
98
|
+
// 传给查询表格的属性
|
|
99
|
+
queryTableProps: {
|
|
100
|
+
pagination?: boolean
|
|
101
|
+
toolButton?: ('refresh' | 'setting' | 'search' | 'fullScreen')[] | boolean
|
|
102
|
+
gridParams?: {
|
|
103
|
+
gridId: string
|
|
104
|
+
url: string
|
|
105
|
+
}
|
|
106
|
+
tableHeight?: number
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
111
|
+
placeholder: '请从下拉表格中选择数据',
|
|
112
|
+
// selectedList: () => [],
|
|
113
|
+
rowKey: 'productCode', // 表格行唯一标识
|
|
114
|
+
rowName: 'productCodeName',
|
|
115
|
+
tabsList: () => [],
|
|
116
|
+
closeMode: 'clear',
|
|
117
|
+
addBtnText: '新增',
|
|
118
|
+
width: '100%',
|
|
119
|
+
minWidth: '800px', // 最小宽度
|
|
120
|
+
isShowAddBtn: true,
|
|
121
|
+
isAutoOpen: true,
|
|
122
|
+
// toolButton: false,
|
|
123
|
+
isShowQueryBtn: true,
|
|
124
|
+
queryTableProps: () => ({
|
|
125
|
+
pagination: true,
|
|
126
|
+
toolButton: false
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
interface Emits {
|
|
130
|
+
// (e: "onShow"): void;
|
|
131
|
+
// (e: "onHide"): void;
|
|
132
|
+
(e: 'addProduct', ids: Array<string> | any): void
|
|
133
|
+
(e: 'tabChange', tab: string | number): void
|
|
134
|
+
(e: 'update:initParam', initParam: any): void
|
|
135
|
+
(e: 'onHide', ids: Array<string> | any): void
|
|
136
|
+
(e: 'onOpen'): void
|
|
137
|
+
(e: 'onHidePopover'): void
|
|
138
|
+
}
|
|
139
|
+
const emits = defineEmits<Emits>()
|
|
140
|
+
|
|
141
|
+
const popoverVisible = ref(false)
|
|
142
|
+
|
|
143
|
+
const initParams = computed({
|
|
144
|
+
get() {
|
|
145
|
+
return props.initParam
|
|
146
|
+
},
|
|
147
|
+
set(val: string) {
|
|
148
|
+
const params = {
|
|
149
|
+
...props.initParam,
|
|
150
|
+
...(props.tabActiveName ? { [props.tabActiveName]: val[props.tabActiveName] } : {})
|
|
151
|
+
}
|
|
152
|
+
emits('update:initParam', params)
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
const popoverRef = ref()
|
|
157
|
+
const proTableRef = ref<ProTableInstance>()
|
|
158
|
+
|
|
159
|
+
const selectedIds = computed(() => {
|
|
160
|
+
return proTableRef.value?.selectedList.map(item => {
|
|
161
|
+
return item[props.rowKey]
|
|
162
|
+
}) as string[]
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
const selectedNames = computed(() => {
|
|
166
|
+
return proTableRef.value?.selectedList.map(item => {
|
|
167
|
+
return item[props.rowName]
|
|
168
|
+
}) as string[]
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
const selectedList = computed(() => {
|
|
172
|
+
return proTableRef.value?.selectedList || []
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
const tabChange = (tabActive: string | number) => {
|
|
176
|
+
emits('tabChange', tabActive)
|
|
177
|
+
// proTableRef.value?.clearSelection();
|
|
178
|
+
}
|
|
179
|
+
const hide = () => {
|
|
180
|
+
emits('onHide', {
|
|
181
|
+
selectedIds: selectedIds.value,
|
|
182
|
+
selectedNames: selectedNames.value,
|
|
183
|
+
selectedList: selectedList.value
|
|
184
|
+
})
|
|
185
|
+
proTableRef.value?.reset()
|
|
186
|
+
}
|
|
187
|
+
// 打开弹窗
|
|
188
|
+
const onAutoOpen = () => {
|
|
189
|
+
popoverVisible.value = true
|
|
190
|
+
}
|
|
191
|
+
const onOpen = () => {
|
|
192
|
+
if (!props.isAutoOpen) {
|
|
193
|
+
emits('onOpen')
|
|
194
|
+
} else {
|
|
195
|
+
onAutoOpen()
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// 手动关闭 popover
|
|
199
|
+
const closePopover = () => {
|
|
200
|
+
popoverVisible.value = false
|
|
201
|
+
hide()
|
|
202
|
+
}
|
|
203
|
+
// 关闭并清空
|
|
204
|
+
const closeClear = () => {
|
|
205
|
+
popoverVisible.value = false
|
|
206
|
+
// popoverRef.value.hide();
|
|
207
|
+
proTableRef.value?.changeTableData(() => [])
|
|
208
|
+
proTableRef.value?.clearSelection()
|
|
209
|
+
hide()
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// 显示时触发
|
|
213
|
+
const onShowPopover = () => {
|
|
214
|
+
onSearch()
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// 关闭时触发
|
|
218
|
+
const onHidePopover = () => {
|
|
219
|
+
emits('onHidePopover')
|
|
220
|
+
// closePopover();
|
|
221
|
+
}
|
|
222
|
+
// 查询
|
|
223
|
+
const onSearch = () => {
|
|
224
|
+
proTableRef.value?.search()
|
|
225
|
+
// proTableRef.value?.searchAndClear();
|
|
226
|
+
}
|
|
227
|
+
// 新增
|
|
228
|
+
const onAddHandle = () => {
|
|
229
|
+
const selectedList = proTableRef.value?.selectedList
|
|
230
|
+
if (!selectedList || !selectedList.length) {
|
|
231
|
+
ElMessage.warning('请选择数据')
|
|
232
|
+
return
|
|
233
|
+
}
|
|
234
|
+
emits('addProduct', {
|
|
235
|
+
selectedIds: selectedIds.value,
|
|
236
|
+
selectedNames: selectedNames.value,
|
|
237
|
+
selectedList
|
|
238
|
+
})
|
|
239
|
+
if (props.closeMode) {
|
|
240
|
+
props.closeMode === 'clear' ? closeClear() : closePopover()
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**点击空白处隐藏 */
|
|
244
|
+
const onClickOutside = (e: any) => {
|
|
245
|
+
if (popoverVisible.value && !unref(popoverRef).popperRef.contentRef.contains(e.target)) {
|
|
246
|
+
closePopover()
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
defineExpose({ closePopover, closeClear, onAutoOpen })
|
|
250
|
+
</script>
|
|
251
|
+
<style lang="scss" scoped>
|
|
252
|
+
:deep(.el-input__inner) {
|
|
253
|
+
overflow: hidden;
|
|
254
|
+
text-overflow: ellipsis;
|
|
255
|
+
white-space: nowrap;
|
|
256
|
+
}
|
|
257
|
+
</style>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.fullscreen-page {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
width: 100vw;
|
|
6
|
+
height: 100vh;
|
|
7
|
+
z-index: 99;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.is-fullHeight.jzt-table-card {
|
|
11
|
+
flex: 1;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
height: 100%;
|
|
15
|
+
|
|
16
|
+
.table-content-box {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 表格 header 样式
|
|
23
|
+
.table-header {
|
|
24
|
+
.header-button-lf,
|
|
25
|
+
.header-button-ri {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
gap: 5px 2px;
|
|
29
|
+
margin-bottom: 2px;
|
|
30
|
+
.el-button:not(.el-input .el-button) {
|
|
31
|
+
margin-left: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.header-button-lf {
|
|
35
|
+
float: left;
|
|
36
|
+
}
|
|
37
|
+
.header-button-ri {
|
|
38
|
+
float: right;
|
|
39
|
+
:deep(.el-button) {
|
|
40
|
+
margin-left: 4px !important;
|
|
41
|
+
}
|
|
42
|
+
// .tool_btn {
|
|
43
|
+
// width: 30px;
|
|
44
|
+
// height: 30px;
|
|
45
|
+
// // margin: 4px 5px 0 0;
|
|
46
|
+
// }
|
|
47
|
+
}
|
|
48
|
+
:deep(.tool_btn.el-button) {
|
|
49
|
+
width: var(--el-component-size);
|
|
50
|
+
// height: 32px;
|
|
51
|
+
// margin: 4px 5px 0 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.el-table {
|
|
56
|
+
margin-top: 8px;
|
|
57
|
+
.el-scrollbar {
|
|
58
|
+
min-height: 150px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// .el-dialog {
|
|
63
|
+
// .table-search {
|
|
64
|
+
// padding-top: 0;
|
|
65
|
+
// margin-bottom: 0;
|
|
66
|
+
// }
|
|
67
|
+
// .spd-card {
|
|
68
|
+
// border: none !important;
|
|
69
|
+
// box-shadow: none !important;
|
|
70
|
+
// padding: 0 10px;
|
|
71
|
+
// }
|
|
72
|
+
// }
|