ci-plus 1.0.1
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 +8 -0
- package/index.ts +13 -0
- package/package.json +44 -0
- package/script/build/index.ts +32 -0
- package/script/publish/index.ts +7 -0
- package/script/utils/delpath.ts +30 -0
- package/script/utils/paths.ts +7 -0
- package/script/utils/run.ts +15 -0
- package/src/button/button.vue +41 -0
- package/src/button/index.ts +4 -0
- package/src/button/style/index.less +35 -0
- package/src/buttons/buttons.vue +18 -0
- package/src/buttons/index.ts +4 -0
- package/src/ccapp/ccapp.vue +27 -0
- package/src/ccapp/index.ts +4 -0
- package/src/components.d.ts +18 -0
- package/src/dailog/dialog.vue +266 -0
- package/src/dailog/index.ts +4 -0
- package/src/dailog/style/index.less +69 -0
- package/src/icon/icon.vue +7 -0
- package/src/icon/index.ts +4 -0
- package/src/icon/style/index.less +3 -0
- package/src/index.ts +5 -0
- package/src/sortableTable/headButtons.vue +25 -0
- package/src/sortableTable/headerCheckBox.vue +74 -0
- package/src/sortableTable/headerInput.vue +148 -0
- package/src/sortableTable/headerRange.vue +108 -0
- package/src/sortableTable/headerSelectV2.vue +178 -0
- package/src/sortableTable/sortableTable.ts +4 -0
- package/src/sortableTable/sortableTable.vue +221 -0
- package/src/sortableTable/sortableTableDialog.vue +109 -0
- package/src/sortableTable/utils/dataOpt.ts +65 -0
- package/src/sortableTable/utils/dateShortcuts.ts +72 -0
- package/src/sortableTable/utils/filter.vue +30 -0
- package/src/sortableTable/utils/filterIcon.vue +8 -0
- package/src/sortableTable/utils/headerPopover.vue +92 -0
- package/src/sortableTable/utils/index.d.ts +11 -0
- package/src/sortableTable/utils/interface.ts +52 -0
- package/src/sortableTable/utils/removeParamsFilters.ts +9 -0
- package/src/sortableTable/utils/sortableTableColumnCell.vue +91 -0
- package/src/sortableTable/utils/sortableTableColumnCell2.vue +72 -0
- package/src/sortableTable/utils/sortableTableDragItem.vue +164 -0
- package/src/sortableTable/utils/sortableTableDragItem2.vue +144 -0
- package/src/sortableTable/utils/sortableTableTs.ts +9 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/withinstall/index.ts +12 -0
- package/vite.config.ts +76 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- /*
|
|
2
|
+
* @module headButtons
|
|
3
|
+
* @author : 卖女孩的小火柴
|
|
4
|
+
* @description : 表头按钮组件
|
|
5
|
+
* @version : 1.0.0
|
|
6
|
+
* @since : 创建时间 2023-12-26 14:18:14
|
|
7
|
+
*/ -->
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="cl-buttons">
|
|
11
|
+
<div>
|
|
12
|
+
<slot name="left"></slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div>
|
|
15
|
+
<slot name="right"></slot>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.cl-buttons {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
padding: 5px 10px;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: flex; align-items: center; justify-content: center">
|
|
3
|
+
<span>{{ text }}</span>
|
|
4
|
+
<header-popover
|
|
5
|
+
:width="width"
|
|
6
|
+
:trigger="trigger"
|
|
7
|
+
@confirm="confirm"
|
|
8
|
+
@clear="clear"
|
|
9
|
+
@close="close"
|
|
10
|
+
@open="open"
|
|
11
|
+
>
|
|
12
|
+
<template #reference="{ toggle }">
|
|
13
|
+
<filter-icon-vue
|
|
14
|
+
@click="toggle"
|
|
15
|
+
:color="value ? 'cadetblue' : ''"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
<el-checkbox-group v-model="value">
|
|
19
|
+
<el-checkbox
|
|
20
|
+
v-for="v in choices"
|
|
21
|
+
:key="v.value"
|
|
22
|
+
:label="v.label"
|
|
23
|
+
:disable="v.disable"
|
|
24
|
+
/>
|
|
25
|
+
</el-checkbox-group>
|
|
26
|
+
</header-popover>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import { computed, ref } from 'vue'
|
|
32
|
+
import headerPopover from './utils/headerPopover.vue'
|
|
33
|
+
import filterIconVue from './utils/filterIcon.vue'
|
|
34
|
+
import { TooltipTriggerType } from 'element-plus'
|
|
35
|
+
const props = defineProps<{
|
|
36
|
+
text?: string
|
|
37
|
+
initValue?: string
|
|
38
|
+
choices?: { label: string; value: any; disable?: boolean }[]
|
|
39
|
+
width?: number
|
|
40
|
+
trigger?: TooltipTriggerType
|
|
41
|
+
}>()
|
|
42
|
+
const emits = defineEmits(['change', 'open'])
|
|
43
|
+
const initValue = computed(() => {
|
|
44
|
+
return props.initValue ? JSON.parse(props.initValue) : []
|
|
45
|
+
})
|
|
46
|
+
const value = ref<string[]>(initValue.value)
|
|
47
|
+
const choice = computed(() => {
|
|
48
|
+
const tem = {} as Record<string, any>
|
|
49
|
+
if (props.choices) props.choices.forEach((v) => (tem[v.label] = v.value))
|
|
50
|
+
return tem
|
|
51
|
+
})
|
|
52
|
+
const confirm = () => {
|
|
53
|
+
const ret = [] as any[]
|
|
54
|
+
value.value.forEach((v) => {
|
|
55
|
+
if (choice.value.hasOwnProperty(v)) ret.push(choice.value[v])
|
|
56
|
+
})
|
|
57
|
+
emits('change', JSON.stringify(ret))
|
|
58
|
+
}
|
|
59
|
+
const clear = () => {
|
|
60
|
+
const go = initValue.value.length
|
|
61
|
+
value.value = []
|
|
62
|
+
if (go) confirm()
|
|
63
|
+
}
|
|
64
|
+
const close = () => {
|
|
65
|
+
if (value.value !== initValue.value) {
|
|
66
|
+
value.value = initValue.value
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const open = () => {
|
|
70
|
+
emits('open')
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<!-- @format -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div style="display: flex; align-items: center; justify-content: center">
|
|
5
|
+
<span>{{ text }}</span>
|
|
6
|
+
<header-popover
|
|
7
|
+
:width="width"
|
|
8
|
+
:trigger="trigger"
|
|
9
|
+
@confirm="confirm"
|
|
10
|
+
@clear="clear"
|
|
11
|
+
@close="close"
|
|
12
|
+
@open="open"
|
|
13
|
+
>
|
|
14
|
+
<template #reference="{ toggle }">
|
|
15
|
+
<!-- <filter-icon-vue @click="toggle" :color="value ? 'cadetblue' : ''" /> -->
|
|
16
|
+
<svg-icon
|
|
17
|
+
name="mysearch"
|
|
18
|
+
size="15"
|
|
19
|
+
:color="value ? '#2C93FF' : ''"
|
|
20
|
+
@click="toggle"
|
|
21
|
+
></svg-icon>
|
|
22
|
+
</template>
|
|
23
|
+
<template #default="{ closeF }">
|
|
24
|
+
<el-select
|
|
25
|
+
v-model="operator"
|
|
26
|
+
class="m-2 input-select"
|
|
27
|
+
placeholder="请选择查询类型"
|
|
28
|
+
size="default"
|
|
29
|
+
clearable
|
|
30
|
+
>
|
|
31
|
+
<el-option
|
|
32
|
+
v-for="item in options"
|
|
33
|
+
:key="item.value"
|
|
34
|
+
:label="item.label"
|
|
35
|
+
:value="item.value"
|
|
36
|
+
/>
|
|
37
|
+
</el-select>
|
|
38
|
+
<el-input
|
|
39
|
+
v-if="!type || type === 'text'"
|
|
40
|
+
v-model="value"
|
|
41
|
+
:placeholder="placeholder"
|
|
42
|
+
@keydown.enter="confirm(closeF)"
|
|
43
|
+
clearable
|
|
44
|
+
/>
|
|
45
|
+
<el-input
|
|
46
|
+
v-else-if="type === 'number'"
|
|
47
|
+
v-model.number="value"
|
|
48
|
+
:placeholder="placeholder"
|
|
49
|
+
@keydown.enter="confirm(closeF)"
|
|
50
|
+
clearable
|
|
51
|
+
/>
|
|
52
|
+
</template>
|
|
53
|
+
</header-popover>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script setup lang="ts">
|
|
58
|
+
import SvgIcon from '@/components/SvgIcon.vue'
|
|
59
|
+
import { computed, ref } from 'vue'
|
|
60
|
+
import headerPopover from './utils/headerPopover.vue'
|
|
61
|
+
import filterIconVue from './utils/filterIcon.vue'
|
|
62
|
+
import { TooltipTriggerType } from 'element-plus'
|
|
63
|
+
import { useWeighingStore } from '@/store/Weighing'
|
|
64
|
+
import { storeToRefs } from 'pinia'
|
|
65
|
+
import { removeParamsFilters } from './utils/removeParamsFilters'
|
|
66
|
+
const store = useWeighingStore()
|
|
67
|
+
|
|
68
|
+
const { params } = storeToRefs(store)
|
|
69
|
+
|
|
70
|
+
const props = defineProps<{
|
|
71
|
+
text?: string
|
|
72
|
+
placeholder?: string
|
|
73
|
+
initValue?: string | number
|
|
74
|
+
type?: 'text' | 'number'
|
|
75
|
+
width?: number
|
|
76
|
+
trigger?: TooltipTriggerType
|
|
77
|
+
column?: string
|
|
78
|
+
}>()
|
|
79
|
+
const emits = defineEmits(['change', 'open'])
|
|
80
|
+
const initValue = computed(() => {
|
|
81
|
+
if (props.type === 'text') return String(props.initValue) || void 0
|
|
82
|
+
return Number(props.initValue) || void 0
|
|
83
|
+
})
|
|
84
|
+
const value = ref<string | number | undefined>(initValue.value)
|
|
85
|
+
|
|
86
|
+
// 返回面板数据
|
|
87
|
+
const confirm = (closeF?: Function) => {
|
|
88
|
+
console.log('当前的params', params)
|
|
89
|
+
// if (value.value) {
|
|
90
|
+
emits('change', {
|
|
91
|
+
value: value.value,
|
|
92
|
+
operator: operator.value,
|
|
93
|
+
column: props.column,
|
|
94
|
+
})
|
|
95
|
+
closeF && closeF()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 清除按钮:清空输入框和发送请求
|
|
99
|
+
const clear = () => {
|
|
100
|
+
console.log('执行清除')
|
|
101
|
+
const go =
|
|
102
|
+
initValue.value !== void 0 &&
|
|
103
|
+
initValue.value !== null &&
|
|
104
|
+
initValue.value !== ''
|
|
105
|
+
// 清除输入框数据
|
|
106
|
+
value.value = void 0
|
|
107
|
+
operator.value = void 0
|
|
108
|
+
// 清除缓存的数据
|
|
109
|
+
removeParamsFilters(store.params.filters, props.column)
|
|
110
|
+
if (go) confirm()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// 关闭面板
|
|
114
|
+
const close = () => {
|
|
115
|
+
console.log('关闭面板123', value.value, initValue.value, store.params.filters)
|
|
116
|
+
// if (value.value !== initValue.value) {
|
|
117
|
+
// value.value = initValue.value
|
|
118
|
+
// }
|
|
119
|
+
}
|
|
120
|
+
const open = () => {
|
|
121
|
+
emits('open')
|
|
122
|
+
}
|
|
123
|
+
const operator = ref('')
|
|
124
|
+
const options = ref([
|
|
125
|
+
{
|
|
126
|
+
value: 'like',
|
|
127
|
+
label: '包含',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
value: '=',
|
|
131
|
+
label: '等于',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: '>',
|
|
135
|
+
label: '大于',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
value: '<',
|
|
139
|
+
label: '小于',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
value: '<>',
|
|
143
|
+
label: '不等于',
|
|
144
|
+
},
|
|
145
|
+
])
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: flex; align-items: center; justify-content: center">
|
|
3
|
+
<span>{{ text }}</span>
|
|
4
|
+
<header-popover
|
|
5
|
+
:width="width"
|
|
6
|
+
:trigger="trigger"
|
|
7
|
+
@confirm="confirm"
|
|
8
|
+
@clear="clear"
|
|
9
|
+
@close="close"
|
|
10
|
+
@open="open"
|
|
11
|
+
>
|
|
12
|
+
<template #reference="{ toggle }">
|
|
13
|
+
<filter-icon-vue
|
|
14
|
+
@click="toggle"
|
|
15
|
+
:color="left || right ? 'cadetblue' : ''"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
<template v-if="!type || type === 'default'">
|
|
19
|
+
<el-input
|
|
20
|
+
style="width: 100%"
|
|
21
|
+
v-model="left"
|
|
22
|
+
:placeholder="placeholder"
|
|
23
|
+
@keydown.enter="confirm"
|
|
24
|
+
clearable
|
|
25
|
+
/>
|
|
26
|
+
~
|
|
27
|
+
<el-input
|
|
28
|
+
style="width: 100%"
|
|
29
|
+
v-model="right"
|
|
30
|
+
:placeholder="rightProp?.placeholder ?? placeholder"
|
|
31
|
+
@keydown.enter="confirm"
|
|
32
|
+
clearable
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
<template v-else-if="type === 'date'">
|
|
36
|
+
<el-date-picker
|
|
37
|
+
style="width: 100%"
|
|
38
|
+
v-model="left"
|
|
39
|
+
type="date"
|
|
40
|
+
:placeholder="placeholder"
|
|
41
|
+
:shortcuts="shortcuts as any"
|
|
42
|
+
:value-format="valueFormat || 'YYYY-MM-DD'"
|
|
43
|
+
/>
|
|
44
|
+
~
|
|
45
|
+
<el-date-picker
|
|
46
|
+
style="width: 100%"
|
|
47
|
+
v-model="right"
|
|
48
|
+
type="date"
|
|
49
|
+
:placeholder="rightProp?.placeholder ?? placeholder"
|
|
50
|
+
:shortcuts="(rightProp?.shortcuts ?? shortcuts) as any"
|
|
51
|
+
:value-format="rightProp?.valueFormat || valueFormat || 'YYYY-MM-DD'"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
54
|
+
</header-popover>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import { computed, ref } from 'vue'
|
|
60
|
+
import headerPopover from './utils/headerPopover.vue'
|
|
61
|
+
import filterIconVue from './utils/filterIcon.vue'
|
|
62
|
+
import { TooltipTriggerType } from 'element-plus'
|
|
63
|
+
import { Shortcuts } from './utils/dateShortcuts'
|
|
64
|
+
type InputConfig = {
|
|
65
|
+
placeholder?: string
|
|
66
|
+
shortcuts?: Shortcuts
|
|
67
|
+
valueFormat?: string
|
|
68
|
+
}
|
|
69
|
+
const prop = defineProps<{
|
|
70
|
+
text?: string
|
|
71
|
+
rightProp?: InputConfig
|
|
72
|
+
placeholder?: InputConfig['placeholder']
|
|
73
|
+
shortcuts?: InputConfig['shortcuts']
|
|
74
|
+
valueFormat?: InputConfig['valueFormat']
|
|
75
|
+
initValue?: string
|
|
76
|
+
type?: 'default' | 'date' | 'dateTime'
|
|
77
|
+
width?: number
|
|
78
|
+
trigger?: TooltipTriggerType
|
|
79
|
+
}>()
|
|
80
|
+
const emits = defineEmits(['change', 'open'])
|
|
81
|
+
const initValue = computed(() => {
|
|
82
|
+
return prop.initValue ? JSON.parse(prop.initValue) : []
|
|
83
|
+
})
|
|
84
|
+
const left = ref<string | undefined>(initValue.value[0])
|
|
85
|
+
const right = ref<string | undefined>(initValue.value[1])
|
|
86
|
+
const confirm = () => {
|
|
87
|
+
emits('change', JSON.stringify([left.value ?? '', right.value ?? '']))
|
|
88
|
+
}
|
|
89
|
+
const clear = () => {
|
|
90
|
+
const go = initValue.value.length && (left.value || right.value)
|
|
91
|
+
left.value = void 0
|
|
92
|
+
right.value = void 0
|
|
93
|
+
if (go) confirm()
|
|
94
|
+
}
|
|
95
|
+
const close = () => {
|
|
96
|
+
if (left.value !== initValue.value[0]) {
|
|
97
|
+
left.value = initValue.value[0]
|
|
98
|
+
}
|
|
99
|
+
if (right.value !== initValue.value[1]) {
|
|
100
|
+
right.value = initValue.value[1]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const open = () => {
|
|
104
|
+
emits('open')
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<!-- @format -->
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div style="display: flex; align-items: center; justify-content: center">
|
|
5
|
+
<span>{{ text }}</span>
|
|
6
|
+
<header-popover
|
|
7
|
+
:width="width"
|
|
8
|
+
:trigger="trigger"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
@confirm="confirm"
|
|
11
|
+
@clear="clear"
|
|
12
|
+
@close="close"
|
|
13
|
+
@open="open"
|
|
14
|
+
>
|
|
15
|
+
<template #reference="{ toggle }">
|
|
16
|
+
<!-- <filter-icon-vue @click="toggle" :color="value ? 'cadetblue' : ''" /> -->
|
|
17
|
+
<svg-icon
|
|
18
|
+
name="mysearch"
|
|
19
|
+
size="15"
|
|
20
|
+
:color="value ? '#2C93FF' : ''"
|
|
21
|
+
@click="toggle"
|
|
22
|
+
></svg-icon>
|
|
23
|
+
</template>
|
|
24
|
+
<template #default>
|
|
25
|
+
<el-select-v2
|
|
26
|
+
v-model="value"
|
|
27
|
+
:placeholder="placeholder"
|
|
28
|
+
:options="options"
|
|
29
|
+
filterable
|
|
30
|
+
clearable
|
|
31
|
+
:multiple="multiple"
|
|
32
|
+
:collapse-tags-tooltip="multiple"
|
|
33
|
+
:collapse-tags="multiple"
|
|
34
|
+
:props="props"
|
|
35
|
+
:style="{ width: '95%' }"
|
|
36
|
+
>
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</el-select-v2>
|
|
39
|
+
</template>
|
|
40
|
+
</header-popover>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import SvgIcon from '@/components/SvgIcon.vue'
|
|
45
|
+
import { computed, ref } from 'vue'
|
|
46
|
+
import headerPopover from './utils/headerPopover.vue'
|
|
47
|
+
import filterIconVue from './utils/filterIcon.vue'
|
|
48
|
+
import { Props } from 'element-plus/es/components/select-v2/src/useProps'
|
|
49
|
+
import { TooltipTriggerType } from 'element-plus'
|
|
50
|
+
import { useWeighingStore } from '@/store/Weighing'
|
|
51
|
+
import { removeParamsFilters } from './utils/removeParamsFilters'
|
|
52
|
+
const store = useWeighingStore()
|
|
53
|
+
|
|
54
|
+
type SelectType = string | number | undefined | (number | string)[]
|
|
55
|
+
const prop = defineProps<{
|
|
56
|
+
text?: string
|
|
57
|
+
placeholder?: string
|
|
58
|
+
initValue?: string | number
|
|
59
|
+
width?: number
|
|
60
|
+
trigger?: TooltipTriggerType
|
|
61
|
+
valueNumber?: boolean
|
|
62
|
+
// 如果使用内置获取数据方法
|
|
63
|
+
retData?: () => Promise<any[]>
|
|
64
|
+
error?: (msg: any) => void
|
|
65
|
+
finally?: () => void
|
|
66
|
+
props?: Props
|
|
67
|
+
multiple?: boolean
|
|
68
|
+
column: string // 列名称
|
|
69
|
+
}>()
|
|
70
|
+
const emits = defineEmits(['change', 'open'])
|
|
71
|
+
const initValue = computed<SelectType>(() => {
|
|
72
|
+
if (prop.multiple) {
|
|
73
|
+
const tem = prop.initValue ? JSON.parse(prop.initValue as string) : []
|
|
74
|
+
if (prop.valueNumber) tem.map(Number)
|
|
75
|
+
return tem
|
|
76
|
+
}
|
|
77
|
+
if (prop.valueNumber) return Number(prop.initValue)
|
|
78
|
+
return prop.initValue
|
|
79
|
+
})
|
|
80
|
+
console.log('888initValue', initValue)
|
|
81
|
+
const value = ref<SelectType>(initValue.value)
|
|
82
|
+
const loading = ref(false)
|
|
83
|
+
const options = ref<any[]>([])
|
|
84
|
+
const operator = ref<string>('=')
|
|
85
|
+
// @ts-nocheck
|
|
86
|
+
const confirm = () => {
|
|
87
|
+
let filters = {
|
|
88
|
+
value: prop.multiple
|
|
89
|
+
? // @ts-expect-error
|
|
90
|
+
value.value && value.value.length > 0
|
|
91
|
+
? JSON.stringify(value.value)
|
|
92
|
+
: null
|
|
93
|
+
: value.value,
|
|
94
|
+
operator: prop.multiple ? 'in' : '=', // 查询类型:单选为=,多选为in
|
|
95
|
+
column: prop.column, // 列名称
|
|
96
|
+
}
|
|
97
|
+
// 有值才执行确定函数
|
|
98
|
+
console.log('value.value', value.value)
|
|
99
|
+
// @ts-expect-error
|
|
100
|
+
if (prop.multiple && value.value.length > 0) {
|
|
101
|
+
emits('change', filters)
|
|
102
|
+
} else {
|
|
103
|
+
console.log('请选择数据')
|
|
104
|
+
}
|
|
105
|
+
if (!prop.multiple && value.value) {
|
|
106
|
+
emits('change', filters)
|
|
107
|
+
} else {
|
|
108
|
+
console.log('请选择数据')
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// 清除函数:清空value 和发送空请求
|
|
113
|
+
const clear = () => {
|
|
114
|
+
let go =
|
|
115
|
+
initValue.value !== void 0 &&
|
|
116
|
+
initValue.value !== null &&
|
|
117
|
+
initValue.value !== ''
|
|
118
|
+
if (prop.multiple) go = go && (initValue.value as any[]).length > 0
|
|
119
|
+
value.value = initValue as any
|
|
120
|
+
emits('change', {
|
|
121
|
+
value: prop.multiple ? [] : '',
|
|
122
|
+
operator: prop.multiple ? 'in' : '=', // 查询类型:单选为=,多选为in
|
|
123
|
+
column: prop.column, // 列名称
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
// 清除缓存的数据
|
|
127
|
+
removeParamsFilters(store.params.filters, prop.column)
|
|
128
|
+
if (go) confirm()
|
|
129
|
+
|
|
130
|
+
// value.value = initValue as any
|
|
131
|
+
// emits('change', {
|
|
132
|
+
// value: prop.multiple ? [] : '',
|
|
133
|
+
// operator: prop.multiple ? 'in' : '=', // 查询类型:单选为=,多选为in
|
|
134
|
+
// column: prop.column, // 列名称
|
|
135
|
+
// })
|
|
136
|
+
|
|
137
|
+
// console.log('清除后的值', value.value)
|
|
138
|
+
}
|
|
139
|
+
const close = () => {
|
|
140
|
+
// if (prop.multiple) {
|
|
141
|
+
// if ((value.value as any[]).length !== (initValue.value as any[]).length) {
|
|
142
|
+
// value.value = initValue.value
|
|
143
|
+
// } else {
|
|
144
|
+
// for (let i = 0; i < (value.value as any[]).length; i++) {
|
|
145
|
+
// const v = (value.value as any[])[i]
|
|
146
|
+
// if (!(initValue.value as any[]).includes(v)) {
|
|
147
|
+
// value.value = initValue.value
|
|
148
|
+
// break
|
|
149
|
+
// }
|
|
150
|
+
// }
|
|
151
|
+
// }
|
|
152
|
+
// } else {
|
|
153
|
+
// if (value.value !== initValue.value) {
|
|
154
|
+
// value.value = initValue.value
|
|
155
|
+
// }
|
|
156
|
+
// }
|
|
157
|
+
// console.log('关闭面板V2', value.value, initValue.value, store.params.filters)
|
|
158
|
+
console.log('关闭面板V2', store.params.filters)
|
|
159
|
+
}
|
|
160
|
+
const open = () => {
|
|
161
|
+
if (prop.retData) {
|
|
162
|
+
loading.value = true
|
|
163
|
+
prop
|
|
164
|
+
.retData()
|
|
165
|
+
.then((val) => {
|
|
166
|
+
options.value = val
|
|
167
|
+
})
|
|
168
|
+
.catch(prop.error)
|
|
169
|
+
.finally(() => {
|
|
170
|
+
prop.finally?.()
|
|
171
|
+
loading.value = false
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
emits('open')
|
|
175
|
+
}
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<style scoped lang="scss"></style>
|