@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,185 @@
|
|
|
1
|
+
import { VNode, ComponentPublicInstance, Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
|
|
4
|
+
import { ProTableProps } from '../index.vue'
|
|
5
|
+
import QueryTable from '../index.vue'
|
|
6
|
+
|
|
7
|
+
import { SearchProps, QueryItemsProps } from '../../JztSearchForm/interface/index'
|
|
8
|
+
|
|
9
|
+
export type { SearchProps, QueryItemsProps } from '../../JztSearchForm/interface/index'
|
|
10
|
+
|
|
11
|
+
export interface EnumProps {
|
|
12
|
+
label?: string // 选项框显示的文字
|
|
13
|
+
value?: string | number | boolean | any[] // 选项框值
|
|
14
|
+
// strValue?: string // 选项框值
|
|
15
|
+
// boolValue?: boolean // 选项框值
|
|
16
|
+
// strBoolValue?: string // 选项框值
|
|
17
|
+
disabled?: boolean // 是否禁用此选项
|
|
18
|
+
tagType?: string // 当 tag 为 true 时,此选择会指定 tag 显示类型
|
|
19
|
+
children?: EnumProps[] // 为树形选择时,可以通过 children 属性指定子选项
|
|
20
|
+
[key: string]: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type TypeProps = 'index' | 'selection' | 'radio' | 'expand' | 'sort'
|
|
24
|
+
|
|
25
|
+
export type FieldNamesProps = {
|
|
26
|
+
label: string
|
|
27
|
+
value: string
|
|
28
|
+
children?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type RenderScope<T> = {
|
|
32
|
+
row: T
|
|
33
|
+
$index: number
|
|
34
|
+
column: TableColumnCtx<T>
|
|
35
|
+
[key: string]: any
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type HeaderRenderScope<T> = {
|
|
39
|
+
$index: number
|
|
40
|
+
column: TableColumnCtx<T>
|
|
41
|
+
[key: string]: any
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ColumnProps<T = Record<string, any>>
|
|
45
|
+
extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader' | 'formatter'>> {
|
|
46
|
+
type?: TypeProps // 列类型
|
|
47
|
+
tag?: boolean | Ref<boolean> // 是否是标签展示
|
|
48
|
+
isShow?: boolean | Ref<boolean> // 是否显示在表格当中
|
|
49
|
+
hidden?: boolean | Ref<boolean> // 不允许设置(仅用于列配置的接口)
|
|
50
|
+
isSetShow?: boolean | Ref<boolean> // 不允许设置(仅用于列配置的接口)
|
|
51
|
+
// isHide?: boolean | Ref<boolean> // 是否隐藏在表格当中
|
|
52
|
+
isSetting?: boolean | Ref<boolean> // 是否在 ColSetting 中可配置
|
|
53
|
+
search?: SearchProps | undefined // 搜索项配置
|
|
54
|
+
enum?: EnumProps[] | Ref<EnumProps[]> | ((params?: any) => Promise<any>) // 枚举字典
|
|
55
|
+
isFilterEnum?: boolean | Ref<boolean> // 当前单元格值是否根据 enum 格式化(示例:enum 只作为搜索项数据)
|
|
56
|
+
fieldNames?: FieldNamesProps // 指定 label && value && children 的 key 值
|
|
57
|
+
headerRender?: (scope: HeaderRenderScope<T>) => VNode // 自定义表头内容渲染(tsx语法)
|
|
58
|
+
render?: (scope: RenderScope<T>) => VNode | string // 自定义单元格内容渲染(tsx语法)
|
|
59
|
+
_children?: ColumnProps<T>[] // 多级表头
|
|
60
|
+
btnLList?: TopButtonProps[] // 操作列
|
|
61
|
+
formatter?: (scope: RenderScope<T>) => VNode | string | number // 单元格格式化数据
|
|
62
|
+
isUnderline?: boolean | Ref<boolean> // 是否需要下划线link样式
|
|
63
|
+
fun?: (scope: any) => any /** 点击函数 */
|
|
64
|
+
decimal?: number | 'numDecimal'| 'countDecimal' // 保留几位小数 numDecimal是金额配置,countDecimal是数量配置 读取配置
|
|
65
|
+
isPerMille?: boolean | Ref<boolean> // 是否使用千分号分割
|
|
66
|
+
selectable?: (row: any, index: number) => boolean /** 仅多选、单选时有效,某行是否可选择 */
|
|
67
|
+
/** 禁用函数 */
|
|
68
|
+
// disabledFn?: Function // 多选 单选 时可使用禁用
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ProTableInstance = Omit<
|
|
72
|
+
InstanceType<typeof QueryTable>,
|
|
73
|
+
keyof ComponentPublicInstance | keyof ProTableProps
|
|
74
|
+
>
|
|
75
|
+
|
|
76
|
+
export interface TopButtonProps {
|
|
77
|
+
id?: string
|
|
78
|
+
/** 按钮文字 */
|
|
79
|
+
text?: string
|
|
80
|
+
/** 按钮类型 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text' (deprecated) */
|
|
81
|
+
type?: '' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
|
|
82
|
+
/** 权限字符*/
|
|
83
|
+
hasPerm?: string
|
|
84
|
+
/** 是否loading,默认 `false` */
|
|
85
|
+
loading?: boolean
|
|
86
|
+
icon?: string
|
|
87
|
+
/** 是否为朴素按钮,默认 `false` */
|
|
88
|
+
plain?: boolean
|
|
89
|
+
/** 是否显示文字按钮背景颜色,默认 `false` */
|
|
90
|
+
bg?: boolean
|
|
91
|
+
/** 是否为链接按钮,默认 `false` */
|
|
92
|
+
link?: boolean
|
|
93
|
+
/** 是否为圆角按钮,默认 `false` */
|
|
94
|
+
round?: boolean
|
|
95
|
+
/** 是否为圆形按钮,默认 `false` */
|
|
96
|
+
circle?: boolean
|
|
97
|
+
/** 点击函数 */
|
|
98
|
+
fun?: Function
|
|
99
|
+
/** 隐藏函数 */
|
|
100
|
+
hideFun?: Function
|
|
101
|
+
render?: any
|
|
102
|
+
/** 禁用 */
|
|
103
|
+
disabled?: boolean
|
|
104
|
+
/** 禁用函数 */
|
|
105
|
+
disabledFn?: Function
|
|
106
|
+
// [key?: string]: any;
|
|
107
|
+
// 表格操作--插槽
|
|
108
|
+
slotName?: string
|
|
109
|
+
// 二次提示内容
|
|
110
|
+
secondConfirm?: string
|
|
111
|
+
// 按钮显示红点或者数字
|
|
112
|
+
badgeProps?: {
|
|
113
|
+
show?: boolean // 是否展示Badge
|
|
114
|
+
isDot?: boolean // 是否显示小圆点
|
|
115
|
+
value?: string | number // 如果显示数字,则设置此属性
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export interface ColumnConfigProps {
|
|
119
|
+
layout: string | ['selection', 'radio', 'index', 'expand', 'sort'] // (selection, radio, index, expand, sort) 逗号分隔 组件布局
|
|
120
|
+
selectionProps?: ColumnProps
|
|
121
|
+
radioProps?: ColumnProps
|
|
122
|
+
indexProps?: ColumnProps
|
|
123
|
+
expandProps?: ColumnProps
|
|
124
|
+
sortProps?: ColumnProps
|
|
125
|
+
}
|
|
126
|
+
export interface TableConfigProps<Q = any, C = Record<string, any>> {
|
|
127
|
+
queryItems?: QueryItemsProps<Q>[]
|
|
128
|
+
columns: ColumnProps<C>[]
|
|
129
|
+
topList?: TopButtonProps[]
|
|
130
|
+
}
|
|
131
|
+
export interface TabsProps{
|
|
132
|
+
label: string
|
|
133
|
+
value: string | number
|
|
134
|
+
isFold?:boolean // 是否超过99 显示99+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface tabsListProps {
|
|
138
|
+
label: string
|
|
139
|
+
value: string | number
|
|
140
|
+
|
|
141
|
+
tabCount?: number | string
|
|
142
|
+
gridId?: string
|
|
143
|
+
leftRender?: () => VNode | string
|
|
144
|
+
rightRender?: () => VNode | string
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 分页
|
|
148
|
+
export interface PageableProps {
|
|
149
|
+
pageIndex: number
|
|
150
|
+
pageSize: number
|
|
151
|
+
total?: number
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export namespace Table {
|
|
155
|
+
export interface Pageable {
|
|
156
|
+
pageIndex: number
|
|
157
|
+
pageSize: number
|
|
158
|
+
total: number
|
|
159
|
+
}
|
|
160
|
+
export interface StateProps {
|
|
161
|
+
tableData: any[]
|
|
162
|
+
pageable: Pageable
|
|
163
|
+
searchParam: {
|
|
164
|
+
[key: string]: any
|
|
165
|
+
}
|
|
166
|
+
searchInitParam: {
|
|
167
|
+
[key: string]: any
|
|
168
|
+
}
|
|
169
|
+
totalParam: {
|
|
170
|
+
[key: string]: any
|
|
171
|
+
}
|
|
172
|
+
icon?: {
|
|
173
|
+
[key: string]: any
|
|
174
|
+
}
|
|
175
|
+
requestAuto: boolean
|
|
176
|
+
// initParams?: {
|
|
177
|
+
// [key: string]: any
|
|
178
|
+
// }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export interface GridParams {
|
|
182
|
+
gridId: string
|
|
183
|
+
url: string
|
|
184
|
+
}
|
|
185
|
+
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="regionSelect-range">
|
|
3
|
+
<el-select
|
|
4
|
+
v-model="searchParam[field1]"
|
|
5
|
+
filterable
|
|
6
|
+
clearable
|
|
7
|
+
placeholder="省"
|
|
8
|
+
style="flex: 1; margin-right: 5px"
|
|
9
|
+
@change="changeProvince"
|
|
10
|
+
>
|
|
11
|
+
<el-option v-for="item in provinceList" :key="item" :label="item" :value="item" />
|
|
12
|
+
</el-select>
|
|
13
|
+
<el-select
|
|
14
|
+
v-model="searchParam[field2]"
|
|
15
|
+
filterable
|
|
16
|
+
clearable
|
|
17
|
+
placeholder="市"
|
|
18
|
+
style="flex: 1; margin-right: 5px"
|
|
19
|
+
@change="changeCity"
|
|
20
|
+
>
|
|
21
|
+
<el-option v-for="item in cityList" :key="item" :label="item" :value="item" />
|
|
22
|
+
</el-select>
|
|
23
|
+
<el-select v-model="searchParam[field3]" filterable clearable placeholder="区" style="flex: 1">
|
|
24
|
+
<el-option v-for="item in areaList" :key="item" :label="item" :value="item" />
|
|
25
|
+
</el-select>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { defineProps, onMounted, ref, watch, watchEffect } from 'vue'
|
|
30
|
+
import { getProvince, getCity, getArea } from '@jzt-spd/utils/commonApi'
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
queryItem: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => {}
|
|
35
|
+
},
|
|
36
|
+
searchParam: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => {}
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
const field1 = ref(props.queryItem?.fields[0] || 'province')
|
|
46
|
+
const field2 = ref(props.queryItem?.fields[1] || 'city')
|
|
47
|
+
const field3 = ref(props.queryItem?.fields[2] || 'area')
|
|
48
|
+
|
|
49
|
+
const provinceList = ref([])
|
|
50
|
+
const cityList = ref([])
|
|
51
|
+
const areaList = ref([])
|
|
52
|
+
|
|
53
|
+
watch(
|
|
54
|
+
() => props.searchParam?.[field1.value],
|
|
55
|
+
value => {
|
|
56
|
+
// 数据编辑的时候,自动查询省市区
|
|
57
|
+
if (!value) return
|
|
58
|
+
changeProvince(value, true)
|
|
59
|
+
},
|
|
60
|
+
{ deep: true }
|
|
61
|
+
)
|
|
62
|
+
watch(
|
|
63
|
+
() => props.searchParam?.[field2.value],
|
|
64
|
+
value => {
|
|
65
|
+
// 数据编辑的时候,自动查询省市区
|
|
66
|
+
if (!value) return
|
|
67
|
+
changeCity(value, true)
|
|
68
|
+
},
|
|
69
|
+
{ deep: true }
|
|
70
|
+
)
|
|
71
|
+
// 获取省数据
|
|
72
|
+
const getProvinceFn = async () => {
|
|
73
|
+
try {
|
|
74
|
+
const res = await getProvince()
|
|
75
|
+
if (!res.result) {
|
|
76
|
+
provinceList.value = []
|
|
77
|
+
}
|
|
78
|
+
provinceList.value = JSON.parse(res.result)
|
|
79
|
+
} catch (error) {
|
|
80
|
+
provinceList.value = []
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// 省数据变动时,清空市与区数据,并重新查询市数据
|
|
84
|
+
const changeProvince = async (val, noClear: boolean = false) => {
|
|
85
|
+
if (!noClear) {
|
|
86
|
+
props.searchParam[field2.value] = ''
|
|
87
|
+
props.searchParam[field3.value] = ''
|
|
88
|
+
cityList.value = []
|
|
89
|
+
areaList.value = []
|
|
90
|
+
}
|
|
91
|
+
if (!val) return
|
|
92
|
+
try {
|
|
93
|
+
const res = await getCity({
|
|
94
|
+
ProvinceName: val
|
|
95
|
+
})
|
|
96
|
+
if (!res.result) {
|
|
97
|
+
cityList.value = []
|
|
98
|
+
}
|
|
99
|
+
cityList.value = JSON.parse(res.result)
|
|
100
|
+
} catch (error) {
|
|
101
|
+
cityList.value = []
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// 市数据变动时,清空区数据,并重新查询区数据
|
|
105
|
+
const changeCity = async (val, noClear: boolean = false) => {
|
|
106
|
+
if (!noClear) {
|
|
107
|
+
props.searchParam[field3.value] = ''
|
|
108
|
+
areaList.value = []
|
|
109
|
+
}
|
|
110
|
+
if (!val) return
|
|
111
|
+
try {
|
|
112
|
+
const res = await getArea({
|
|
113
|
+
CityName: val
|
|
114
|
+
})
|
|
115
|
+
if (!res.result) {
|
|
116
|
+
areaList.value = []
|
|
117
|
+
}
|
|
118
|
+
areaList.value = JSON.parse(res.result)
|
|
119
|
+
} catch (error) {
|
|
120
|
+
areaList.value = []
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
onMounted(() => {
|
|
124
|
+
getProvinceFn()
|
|
125
|
+
})
|
|
126
|
+
</script>
|
|
127
|
+
<style lang="scss" scoped>
|
|
128
|
+
.regionSelect-range {
|
|
129
|
+
display: flex;
|
|
130
|
+
justify-content: flex-start;
|
|
131
|
+
align-items: center;
|
|
132
|
+
padding: 0;
|
|
133
|
+
}
|
|
134
|
+
</style>
|