cwg-complex-search.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. <template>
  2. <view class="complex-search">
  3. <!-- PC/平板端:直接显示表单 -->
  4. <cwg-match-media :min-width="991">
  5. <view class="search-bar search-form">
  6. <view v-for="(row, rowIndex) in displayRows" :key="rowIndex" class="form-row">
  7. <view v-for="field in row" :key="field.key" class="form-item">
  8. <view class="search-bar">
  9. <!-- 根据字段类型渲染不同组件 -->
  10. <template v-if="field.type === 'input'">
  11. <uni-easyinput v-model="formData[field.key]" :placeholder="field.placeholder || '请输入'"
  12. clearable />
  13. </template>
  14. <template v-else-if="field.type === 'select'">
  15. <cwg-combox v-model:value="formData[field.key]" :options="field.options"
  16. :placeholder="field.placeholder || t('.placeholder.choose')"
  17. :clearable="field.clearable || false"
  18. @change="(e) => field.onChange?.(e) || handleSearch()" />
  19. </template>
  20. <template v-else-if="field.type === 'date'">
  21. <uni-datetime-picker :start="dateLimit.start" :end="dateLimit.end"
  22. v-model="formData[field.key]" type="date"
  23. :placeholder="field.placeholder || t('.placeholder.chooseDate')"
  24. @change="handleDateChange" />
  25. </template>
  26. <template v-else-if="field.type === 'daterange'">
  27. <uni-datetime-picker class="cursor-pointer" :start="dateLimit.start"
  28. :end="dateLimit.end" v-model="formData[field.key]" type="daterange"
  29. :placeholder="field.placeholder || '请选择日期范围'"
  30. :startPlaceholder="t('placeholder.Start')" :endPlaceholder="t('placeholder.End')"
  31. @change="handleDateChange" :data-tooltip="field.placeholder" data-placement="top" />
  32. </template>
  33. <template v-else-if="field.type === 'picker'">
  34. <uni-data-picker class="cursor-pointer" style="min-width: 100px"
  35. v-model="formData[field.key]" :localdata="field.options"
  36. :popup-title="field.popupTitle || t('State.All')"
  37. :map="field.map || { value: 'value', text: 'label' }"
  38. @change="(e) => field.onChange?.(e)"
  39. @nodeclick="(node) => field.onNodeClick?.(node)" :data-tooltip="field.placeholder"
  40. data-placement="top" />
  41. </template>
  42. <template v-else-if="field.type === 'number'">
  43. <uni-easyinput v-model="formData[field.key]" type="number"
  44. :placeholder="field.placeholder || '请输入数字'" />
  45. </template>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="form-actions">
  50. <button hover-class="" v-if="hasMoreFields" class="search-btn" @click="toggleShowAll">
  51. <text>{{ showAllFields ? t('vu.Btn.Hide') : t('vu.Btn.More') }}</text>
  52. </button>
  53. <button hover-class="" class="search-btn" @click="handleSearch" v-t="'Btn.Search'" />
  54. </view>
  55. </view>
  56. </cwg-match-media>
  57. <cwg-match-media :max-width="991">
  58. <!-- 移动端:只显示筛选按钮,点击弹出底部抽屉 -->
  59. <view class="mobile-filter">
  60. <view v-if="dateField" class="mobile-date-wrapper">
  61. <uni-datetime-picker class="cursor-pointer" :start="dateLimit.start" :end="dateLimit.end"
  62. v-model="formData[dateField.key]" :type="dateField.type === 'daterange' ? 'daterange' : 'date'"
  63. :placeholder="dateField.placeholder || (dateField.type === 'daterange' ? '选择日期范围' : '选择日期')"
  64. :startPlaceholder="t('placeholder.Start')" :endPlaceholder="t('placeholder.End')"
  65. @change="handleDateChange" />
  66. </view>
  67. <view v-else class="mobile-date-wrapper"></view>
  68. <button hover-class="" v-if="nonDateField?.length" class="filter-chip" @click="openFilterPopup">
  69. <cwg-icon name="cwg-filter" :size="14" color="#141d22" />
  70. <text class="filter-label" v-t="'Documentary.tradingCenter.item3'" />
  71. </button>
  72. </view>
  73. </cwg-match-media>
  74. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :showFooters="true"
  75. :title="t('Documentary.tradingCenter.item3')" class="search-dialog">
  76. <scroll-view scroll-y class="drawer-content" style="overflow: visible;">
  77. <view v-for="field in nonDateField" :key="field.key" class="filter-item">
  78. <view class="label">{{ field.label }}</view>
  79. <view class="control">
  80. <template v-if="field.type === 'input'">
  81. <uni-easyinput v-model="tempFormData[field.key]" :placeholder="field.placeholder || '请输入'"
  82. clearable />
  83. </template>
  84. <template v-else-if="field.type === 'select'">
  85. <cwg-combox v-model:value="tempFormData[field.key]" :options="field.options"
  86. :placeholder="field.placeholder || '请选择'" :clearable="false" :placement="'bottom'"
  87. v-if="shouldUseSelect(field)" />
  88. <view class="chip-group" v-else>
  89. <view class="chip-list">
  90. <view v-for="opt in field.options" :key="opt.value" class="chip" :class="{
  91. 'chip-filled': tempFormData[field.key] === opt.value,
  92. 'chip-outlined': tempFormData[field.key] !== opt.value
  93. }" @click="selectChip(field.key, opt.value)">
  94. {{ opt.text }}
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <template v-else-if="field.type === 'number'">
  100. <uni-easyinput v-model="tempFormData[field.key]" type="number"
  101. :placeholder="field.placeholder || '请输入数字'" clearable />
  102. </template>
  103. <template v-else-if="field.type === 'picker'">
  104. <uni-data-picker class="cursor-pointer" v-model="tempFormData[field.key]"
  105. :localdata="field.options" :popup-title="field.popupTitle || t('State.All')"
  106. :map="field.map || { value: 'value', text: 'label' }"
  107. @change="(e) => field.onChange?.(e)" @nodeclick="(node) => field.onNodeClick?.(node)" />
  108. </template>
  109. </view>
  110. <view v-if="nonDateField.length == 1" style="height: 25vh;" />
  111. </view>
  112. </scroll-view>
  113. <template #footer>
  114. <!-- <button hover-class="" class="reset-btn" @click="resetTempForm" v-t="'Documentary.tradingCenter.item4'" /> -->
  115. <button hover-class="" class="search-btn" @click="applyFilter" v-t="'Btn.Search'" />
  116. </template>
  117. </cwg-popup>
  118. </view>
  119. </template>
  120. <script setup>
  121. import { ref, computed, watch, onMounted, nextTick, onUnmounted } from 'vue'
  122. import { useI18n } from 'vue-i18n'
  123. import { isRouteOnTop } from '@/utils/pageActive'
  124. const { t } = useI18n()
  125. const props = defineProps({
  126. // 字段配置列表,每个字段包含: key, label, type, options(可选), placeholder(可选)
  127. fields: {
  128. type: Array,
  129. required: true
  130. },
  131. // 每行显示的字段数(PC端),默认3个
  132. columns: {
  133. type: Number,
  134. default: 1
  135. },
  136. // 不设置默认数据
  137. noData: {
  138. type: Boolean,
  139. default: false
  140. },
  141. // 表单初始值 / v-model 绑定值
  142. modelValue: {
  143. type: Object,
  144. default: () => ({})
  145. }
  146. })
  147. const emit = defineEmits(['update:modelValue', 'search', 'reset'])
  148. // 时间选择器限制:今天,近一年
  149. const dateLimit = computed(() => {
  150. const now = new Date()
  151. // 结束日期 = 今天
  152. const endDate = new Date(now)
  153. // 开始日期 = 今天 - 365天
  154. const startDate = new Date(now)
  155. startDate.setDate(startDate.getDate() - 365)
  156. const format = (d) => {
  157. const y = d.getFullYear()
  158. const m = String(d.getMonth() + 1).padStart(2, '0')
  159. const d2 = String(d.getDate()).padStart(2, '0')
  160. return `${y}-${m}-${d2}`
  161. }
  162. return {
  163. start: '',
  164. end: format(endDate)
  165. }
  166. })
  167. // 获取日期字段的默认值(当前月范围:月初 ~ 今天)
  168. const getDefaultDateValue = (field) => {
  169. const now = new Date()
  170. const year = now.getFullYear()
  171. const month = now.getMonth()
  172. // 本月1号
  173. const firstDay = new Date(year, month, 1)
  174. // 今天
  175. const today = new Date()
  176. const formatDate = (date) => {
  177. const y = date.getFullYear()
  178. const m = String(date.getMonth() + 1).padStart(2, '0')
  179. const d = String(date.getDate()).padStart(2, '0')
  180. return `${y}-${m}-${d}`
  181. }
  182. if (field.type === 'daterange') {
  183. return [formatDate(firstDay), formatDate(today)]
  184. } else if (field.type === 'date') {
  185. return formatDate(today)
  186. }
  187. return ''
  188. }
  189. // 表单数据(PC端)
  190. const formData = ref({})
  191. // 移动端临时数据
  192. const tempFormData = ref({})
  193. // 移动端弹窗是否可见
  194. const visible = ref(false)
  195. // 是否显示所有字段
  196. const showAllFields = ref(false)
  197. // 将字段按列数分组(仅用于PC布局)
  198. const formRows = computed(() => {
  199. const rows = []
  200. for (let i = 0; i < props.fields.length; i += props.columns) {
  201. rows.push(props.fields.slice(i, i + props.columns))
  202. }
  203. return rows
  204. })
  205. const winWidth = computed(() => {
  206. console.log(window.innerWidth)
  207. return window.innerWidth
  208. })
  209. // 显示的行(根据 showAllFields 决定)
  210. const displayRows = computed(() => {
  211. if (showAllFields.value) {
  212. return formRows.value
  213. }
  214. // 默认只显示第一行
  215. return winWidth.value > 1500 ? formRows.value.slice(0, 4) : formRows.value.slice(0, 3)
  216. })
  217. // 是否有更多字段可以展开
  218. const hasMoreFields = computed(() => {
  219. return formRows.value.length > (winWidth.value > 1500 ? 4 : 3)
  220. })
  221. // 切换显示/隐藏状态
  222. const toggleShowAll = () => {
  223. showAllFields.value = !showAllFields.value
  224. }
  225. const selectChip = (key, value) => {
  226. // 如果点击的是当前已选中的项,可以保持不变,也可以置空(根据需求)
  227. // 此处保持选中该项,不提供取消功能(符合常见筛选行为)
  228. tempFormData.value[key] = value
  229. }
  230. // 初始化表单数据
  231. const initFormData = () => {
  232. const initial = {}
  233. if (!props.noData) {
  234. props.fields.forEach(field => {
  235. // 1. 优先使用外部传入的 modelValue(如果值不为 null 或 undefined)
  236. if (props.modelValue && props.modelValue[field.key] != null) {
  237. initial[field.key] = props.modelValue[field.key]
  238. }
  239. // 2. 其次使用字段配置的 defaultValue
  240. else if (field.defaultValue !== undefined) {
  241. initial[field.key] = field.defaultValue
  242. return
  243. }
  244. // 3. 日期字段特殊处理:默认当前月(即使 modelValue 中存在但为 null/undefined)
  245. else if (field.type === 'date' || field.type === 'daterange') {
  246. initial[field.key] = getDefaultDateValue(field)
  247. }
  248. // 4. select 类型字段如果没有默认值,默认置空,不强制选第一个
  249. else if (field.type === 'select') {
  250. initial[field.key] = null
  251. }
  252. // 5. 其他字段默认为空字符串
  253. else {
  254. initial[field.key] = ''
  255. }
  256. })
  257. }
  258. formData.value = initial
  259. tempFormData.value = JSON.parse(JSON.stringify(initial))
  260. handleSearch()
  261. }
  262. // 获取第一个日期或日期范围字段(用于移动端顶部快捷显示)
  263. const dateField = computed(() => {
  264. return props.fields.find(field => field.type === 'date' || field.type === 'daterange')
  265. })
  266. // 判断字段是否应该使用下拉选择器(用于排序和渲染)
  267. const shouldUseSelect = (field) => {
  268. if (!field.options) return false
  269. return field.options.length > 10 || field.isSelect === true
  270. }
  271. const handleDateChange = (value) => {
  272. formData.value[dateField.value.key] = value
  273. tempFormData.value[dateField.value.key] = value
  274. // 日期变化时自动触发搜索
  275. handleSearch()
  276. }
  277. // 排序:输入框 + 下拉选择器 → 前面;Chip 选择器 → 后面
  278. const nonDateField = computed(() => {
  279. const filtered = props.fields.filter(field => field.type !== 'date' && field.type !== 'daterange')
  280. const priorityFields = []
  281. const otherFields = []
  282. filtered.forEach(field => {
  283. if (field.type === 'input' || field.type === 'number') {
  284. priorityFields.push(field)
  285. }
  286. else if (field.type === 'select') {
  287. if (shouldUseSelect(field)) {
  288. priorityFields.push(field)
  289. } else {
  290. otherFields.push(field)
  291. }
  292. }
  293. else if (field.type === 'picker') {
  294. priorityFields.push(field)
  295. }
  296. else {
  297. otherFields.push(field)
  298. }
  299. })
  300. return [...priorityFields, ...otherFields]
  301. })
  302. const clonePlain = (val) => JSON.parse(JSON.stringify(val ?? {}))
  303. const isEqual = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {})
  304. /** 所属页面 route,离开栈顶后不再 emit search */
  305. const ownerPageRoute = ref('')
  306. /** 仅字段结构变化时重新初始化(语言切换改 label 不触发) */
  307. const getFieldsSignature = (fields) => {
  308. console.log(fields)
  309. if (!fields?.length) return ''
  310. return JSON.stringify(
  311. fields.filter(Boolean).map((field) => ({
  312. key: field.key,
  313. type: field.type,
  314. defaultValue: field.defaultValue,
  315. optionsLength: Array.isArray(field.options) ? field.options.length : 0,
  316. optionValues: Array.isArray(field.options)
  317. ? field.options.map((o) => o?.value ?? o?.text ?? o)
  318. : undefined,
  319. }))
  320. )
  321. }
  322. let fieldsSignature = ''
  323. // 监听外部 modelValue 变化
  324. watch(() => props.modelValue, (newVal) => {
  325. if (!newVal) return
  326. const incoming = clonePlain(newVal)
  327. const next = { ...formData.value }
  328. props.fields.forEach(field => {
  329. if (incoming[field.key] != null) {
  330. next[field.key] = incoming[field.key]
  331. } else if (field.type === 'date' || field.type === 'daterange') {
  332. next[field.key] = getDefaultDateValue(field)
  333. }
  334. })
  335. if (isEqual(next, formData.value)) return
  336. formData.value = next
  337. tempFormData.value = clonePlain(next)
  338. }, { deep: true, immediate: true })
  339. // 监听内部 formData 变化,同步到外部
  340. watch(formData, (newVal) => {
  341. const outgoing = clonePlain(newVal)
  342. if (isEqual(outgoing, props.modelValue)) return
  343. emit('update:modelValue', outgoing)
  344. }, { deep: true })
  345. // 重置表单(清空所有字段)
  346. const resetForm = () => {
  347. const empty = {}
  348. props.fields.forEach(field => {
  349. // 有默认值 → 用默认值
  350. if (field.defaultValue !== undefined) {
  351. empty[field.key] = field.defaultValue
  352. }
  353. // 日期字段 → 用默认日期
  354. else if (field.type === 'date' || field.type === 'daterange') {
  355. empty[field.key] = getDefaultDateValue(field)
  356. }
  357. // select 类型字段如果没有默认值,置空
  358. else if (field.type === 'select') {
  359. empty[field.key] = null
  360. }
  361. // 无默认值 → 清空
  362. else {
  363. empty[field.key] = ''
  364. }
  365. })
  366. formData.value = empty
  367. tempFormData.value = JSON.parse(JSON.stringify(empty)) // 👈 加这行
  368. nextTick(() => {
  369. tempFormData.value = { ...empty }
  370. formData.value = { ...empty }
  371. nextTick(() => {
  372. if (dateField.value) {
  373. handleDateChange(formData.value[dateField.value.key])
  374. }
  375. })
  376. })
  377. emit('reset', empty)
  378. }
  379. // 触发查询
  380. const handleSearch = () => {
  381. if (!isRouteOnTop(ownerPageRoute.value)) return
  382. emit('search', { ...formData.value })
  383. }
  384. // 移动端:打开弹窗
  385. const openFilterPopup = () => {
  386. // 复制当前表单数据到临时对象
  387. tempFormData.value = JSON.parse(JSON.stringify(formData.value))
  388. visible.value = true
  389. }
  390. const closePopup = () => {
  391. visible.value = false
  392. }
  393. const resetTempForm = () => {
  394. const empty = {}
  395. props.fields.forEach(field => {
  396. // 有默认值 → 用默认值
  397. if (field.defaultValue !== undefined) {
  398. empty[field.key] = field.defaultValue
  399. }
  400. // 日期字段 → 用默认日期
  401. else if (field.type === 'date' || field.type === 'daterange') {
  402. empty[field.key] = getDefaultDateValue(field)
  403. }
  404. // select 类型字段如果没有默认值,置空
  405. else if (field.type === 'select') {
  406. empty[field.key] = null
  407. }
  408. // 无默认值 → 清空
  409. else {
  410. empty[field.key] = ''
  411. }
  412. })
  413. tempFormData.value = empty
  414. formData.value = JSON.parse(JSON.stringify(empty)) // 👈 加这行
  415. // 👇 强制日期组件刷新选中状态
  416. nextTick(() => {
  417. formData.value = { ...empty }
  418. tempFormData.value = { ...empty }
  419. nextTick(() => {
  420. if (dateField.value) {
  421. handleDateChange(formData.value[dateField.value.key])
  422. }
  423. handleSearch()
  424. })
  425. })
  426. }
  427. const applyFilter = () => {
  428. // 将临时数据同步到正式表单
  429. formData.value = JSON.parse(JSON.stringify(tempFormData.value))
  430. closePopup()
  431. handleSearch()
  432. }
  433. // 仅 fields 结构变化时重新初始化
  434. watch(
  435. () => props.fields,
  436. (fields) => {
  437. const nextSig = getFieldsSignature(fields)
  438. if (nextSig === fieldsSignature) return
  439. fieldsSignature = nextSig
  440. initFormData()
  441. },
  442. { deep: false }
  443. )
  444. onMounted(() => {
  445. const pages = getCurrentPages()
  446. ownerPageRoute.value = pages[pages.length - 1]?.route || ''
  447. fieldsSignature = getFieldsSignature(props.fields)
  448. initFormData()
  449. })
  450. </script>
  451. <style lang="scss" scoped>
  452. @import "@/uni.scss";
  453. .complex-search {
  454. width: 100%;
  455. }
  456. .search-bar {
  457. .cwg-combox,
  458. .uni-easyinput {
  459. width: px2rpx(240) !important;
  460. flex: none;
  461. }
  462. :deep(.uni-easyinput__content) {
  463. height: px2rpx(35) !important;
  464. min-height: px2rpx(35) !important;
  465. }
  466. :deep(.uni-easyinput__content-input) {
  467. height: px2rpx(35) !important;
  468. }
  469. .uni-date {
  470. width: px2rpx(250) !important;
  471. flex: none;
  472. }
  473. .form-actions {
  474. display: flex;
  475. justify-content: flex-end;
  476. align-items: center;
  477. gap: px2rpx(10);
  478. .reset-btn,
  479. .search-btn {
  480. background-color: var(--btn-color);
  481. height: px2rpx(35);
  482. min-height: px2rpx(35);
  483. line-height: px2rpx(35);
  484. padding: 0 px2rpx(16);
  485. margin: 0;
  486. box-sizing: border-box;
  487. font-size: px2rpx(14);
  488. }
  489. .toggle-btn {
  490. display: inline-flex;
  491. align-items: center;
  492. gap: px2rpx(4);
  493. background: transparent;
  494. border: none;
  495. color: #666;
  496. font-size: px2rpx(14);
  497. line-height: px2rpx(35);
  498. padding: 0 px2rpx(12);
  499. cursor: pointer;
  500. &::after {
  501. border: none;
  502. }
  503. &:active {
  504. opacity: 0.7;
  505. }
  506. }
  507. }
  508. }
  509. .mobile-filter {
  510. margin-bottom: px2rpx(10);
  511. display: flex;
  512. align-items: center;
  513. justify-content: center;
  514. gap: px2rpx(12);
  515. .mobile-date-wrapper {
  516. flex: 1;
  517. }
  518. .filter-chip {
  519. display: inline-flex;
  520. align-items: center;
  521. justify-content: center;
  522. gap: px2rpx(12);
  523. background-color: #ffffff;
  524. border: 1px solid #e5e5e5;
  525. border-radius: px2rpx(4);
  526. padding: px2rpx(0) px2rpx(8);
  527. font-size: px2rpx(16);
  528. font-weight: 500;
  529. color: var(--bs-emphasis-color);
  530. line-height: px2rpx(35);
  531. transition: all 0.2s ease;
  532. box-shadow: none;
  533. .iconfont,
  534. .uni-icons {
  535. font-size: 32rpx;
  536. color: var(--bs-emphasis-color);
  537. }
  538. /* 按下反馈效果 */
  539. &:active {
  540. transform: scale(0.96);
  541. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  542. /* 轻量点击背景色 */
  543. border-color: #b9bfc7;
  544. }
  545. &::after {
  546. border: none;
  547. }
  548. }
  549. }
  550. /* 弹窗整体优化 */
  551. .drawer-content {
  552. padding: px2rpx(20);
  553. border-radius: px2rpx(16);
  554. //min-height: 40vh;
  555. box-sizing: border-box;
  556. .label {
  557. font-size: px2rpx(18);
  558. font-weight: 600;
  559. color: #2c3e50;
  560. margin-bottom: px2rpx(20);
  561. letter-spacing: px2rpx(1);
  562. }
  563. :deep(.uni-scroll-view) {
  564. //min-height: px2rpx(200);
  565. }
  566. :deep(.uni-scroll-view-content) {
  567. display: flex;
  568. flex-direction: column;
  569. gap: px2rpx(20);
  570. overflow: visible;
  571. }
  572. :deep(uni-button) {
  573. line-height: px2rpx(35);
  574. }
  575. /* ========== Chip 胶囊样式 (移动端筛选弹窗) ========== */
  576. .chip-group {
  577. margin-bottom: px2rpx(20);
  578. .chip-list {
  579. display: flex;
  580. flex-wrap: wrap;
  581. gap: px2rpx(16);
  582. }
  583. .chip {
  584. display: inline-flex;
  585. align-items: center;
  586. justify-content: center;
  587. padding: px2rpx(4) px2rpx(12);
  588. border-radius: px2rpx(64);
  589. font-size: px2rpx(14);
  590. font-weight: 500;
  591. transition: all 0.2s ease;
  592. background-color: #ffffff;
  593. border: px2rpx(1) solid #d1d5db;
  594. color: var(--bs-emphasis-color);
  595. cursor: pointer;
  596. &:active {
  597. transform: scale(0.96);
  598. }
  599. /* 填充样式(选中) */
  600. &.chip-filled {
  601. background-color: #cf1322;
  602. border-color: #cf1322;
  603. color: #ffffff;
  604. }
  605. /* 轮廓样式(未选中) */
  606. &.chip-outlined {
  607. background-color: #ffffff;
  608. border-color: #d1d5db;
  609. color: var(--bs-emphasis-color);
  610. }
  611. }
  612. }
  613. }
  614. .search-dialog {
  615. .search-btn {
  616. color: var(--btn-color);
  617. }
  618. }
  619. </style>