zxz-uni-data-select.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. <template>
  2. <view class="uni-stat__select">
  3. <!-- hide-on-phone -->
  4. <span v-if="label" class="uni-label-text">{{label + ':'}}</span>
  5. <view class="uni-stat-box" :class="{'uni-stat__actived': current}">
  6. <view class="uni-select" :style="{height:multiple?'100%':' 35px'}"
  7. :class="{'uni-select--disabled':disabled}">
  8. <view class="uni-select__input-box" :style="{height:multiple?'100%':'35px'}" @click="toggleSelector">
  9. <view class="" style="display: flex;flex-wrap: wrap;width: 100%;" v-if="multiple&&current.length>0">
  10. <view class="tag-calss"
  11. v-for="(item,index) in collapseTags?current.slice(0,collapseTagsNum):current"
  12. :key="item[dataValue]">
  13. <span class="text">{{item[dataKey]}}</span>
  14. <view class="" @click.stop="delItem(item)">
  15. <uni-icons type="clear" style="margin-left: 4px;" color="#c0c4cc" />
  16. </view>
  17. </view>
  18. <view v-if="current.length>collapseTagsNum&&collapseTags" class="tag-calss">
  19. <span class="text">+{{current.length-collapseTagsNum}}</span>
  20. </view>
  21. <input v-if="filterable&&!disabled" @input="inputChange" class="uni-select__input-text"
  22. type="text" style="font-size: 12px;height: 52rpx;margin-left: 6px;width: auto;"
  23. placeholder="请输入" v-model="filterInput">
  24. </view>
  25. <view v-else-if="current&&current.length>0&&!showSelector" class="uni-select__input-text">
  26. {{current}}
  27. </view>
  28. <input v-else-if="filterable&&showSelector" :focus="isFocus" @input="inputChange"
  29. :disabled="disabled" @click.stop="" class="uni-select__input-text" type="text"
  30. style="font-size: 12px;position: absolute;z-index: 1;" :placeholder="placeholderOld"
  31. v-model="filterInput">
  32. <view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
  33. <uni-icons v-if="(current.length>0 && clear&&!disabled)||(currentArr.length>0&&clear&&!disabled)"
  34. type="clear" color="#c0c4cc" size="24" style="position: absolute;right: 0;" @click="clearVal" />
  35. <uni-icons style="right: 0;position: absolute;" v-else :type="showSelector? 'top' : 'bottom'"
  36. size="14" color="#999" />
  37. </view>
  38. <view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
  39. <view class="uni-select__selector" v-if="showSelector">
  40. <view class="uni-popper__arrow"></view>
  41. <scroll-view scroll-y="true" class="uni-select__selector-scroll">
  42. <view class="uni-select__selector-empty" v-if="filterMixinDatacomResData.length === 0">
  43. <span>{{emptyTips}}</span>
  44. </view>
  45. <view v-else :class="['uni-select__selector-item', {'uni-select_selector-item_active' :multiple
  46. && currentArr.includes(item[dataValue])}]"
  47. style="display: flex;justify-content: space-between;align-items: center;"
  48. v-for="(item,index) in filterMixinDatacomResData" :key="index" @click="change(item)">
  49. <span
  50. :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</span>
  51. <uni-icons v-if="multiple&&currentArr.includes(item[dataValue])" type="checkmarkempty"
  52. color="#007aff" />
  53. </view>
  54. </scroll-view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. /**
  62. * DataChecklist 数据选择器
  63. * @description 通过数据渲染的下拉框组件
  64. * @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
  65. * @property {String} value 默认值
  66. * @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
  67. * @property {Boolean} clear 是否可以清空已选项
  68. * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
  69. * @property {String} label 左侧标题
  70. * @property {String} placeholder 输入框的提示文字
  71. * @property {Boolean} disabled 是否禁用
  72. * @event {Function} change 选中发生变化触发
  73. */
  74. export default {
  75. name: "uni-stat-select",
  76. mixins: [uniCloud.mixinDatacom || {}],
  77. props: {
  78. collapseTagsNum: {
  79. type: Number,
  80. default: 1
  81. },
  82. collapseTags: {
  83. type: Boolean,
  84. default: false
  85. },
  86. dataKey: {
  87. type: [String],
  88. default: 'text'
  89. },
  90. dataValue: {
  91. type: [String],
  92. default: 'value'
  93. },
  94. multiple: {
  95. type: Boolean,
  96. default: false
  97. },
  98. filterable: {
  99. type: Boolean,
  100. default: false
  101. },
  102. localdata: {
  103. type: Array,
  104. default () {
  105. return []
  106. }
  107. },
  108. // #ifndef VUE3
  109. value: {
  110. type: [String, Number, Array],
  111. default: ''
  112. },
  113. // #endif
  114. // #ifdef VUE3
  115. modelValue: {
  116. type: [String, Number, Array],
  117. default: ''
  118. },
  119. // #endif
  120. label: {
  121. type: String,
  122. default: ''
  123. },
  124. placeholder: {
  125. type: String,
  126. default: '请选择'
  127. },
  128. emptyTips: {
  129. type: String,
  130. default: '无选项'
  131. },
  132. clear: {
  133. type: Boolean,
  134. default: true
  135. },
  136. defItem: {
  137. type: Number,
  138. default: 0
  139. },
  140. disabled: {
  141. type: Boolean,
  142. default: false
  143. },
  144. // 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
  145. format: {
  146. type: String,
  147. default: ''
  148. },
  149. },
  150. data() {
  151. return {
  152. showSelector: false,
  153. current: [],
  154. mixinDatacomResData: [],
  155. apps: [],
  156. channels: [],
  157. cacheKey: "uni-data-select-lastSelectedValue",
  158. placeholderOld: "",
  159. currentArr: [],
  160. filterInput: "",
  161. isFocus: false
  162. };
  163. },
  164. created() {
  165. if (this.multiple) {
  166. // #ifndef VUE3
  167. this.currentArr = this.value || []
  168. // #endif
  169. // #ifdef VUE3
  170. this.currentArr = this.modelValue || []
  171. // #endif
  172. if (this.current.length > 0) {
  173. this.current = []
  174. }
  175. // #ifndef VUE3
  176. if (this.value && this.value.length > 0 && this.filterMixinDatacomResData.length > 0) {
  177. this.current = this.value.map(item => {
  178. let current = this.mixinDatacomResData.find(e =>
  179. e[this.dataValue] == item
  180. )
  181. return {
  182. ...current
  183. }
  184. })
  185. }
  186. // #endif
  187. // #ifdef VUE3
  188. if (this.modelValue && this.modelValue.length > 0 && this.filterMixinDatacomResData.length > 0) {
  189. this.current = this.modelValue.map(item => {
  190. let current = this.mixinDatacomResData.find(e =>
  191. e[this.dataValue] == item
  192. )
  193. return {
  194. ...current
  195. }
  196. })
  197. }
  198. // #endif
  199. } else {
  200. // #ifndef VUE3
  201. if (this.value || this.value == 0) {
  202. this.current = this.formatItemName(this.filterMixinDatacomResData.find(e =>
  203. e[this.dataValue] == this.value
  204. ))
  205. }
  206. // #endif
  207. // #ifdef VUE3
  208. if (this.modelValue || this.value == 0) {
  209. this.current = this.formatItemName(this.filterMixinDatacomResData.find(e =>
  210. e[this.dataValue] == this.modelValue
  211. ))
  212. }
  213. // #endif
  214. }
  215. this.placeholderOld = this.placeholder
  216. this.debounceGet = this.debounce(() => {
  217. this.query();
  218. }, 300);
  219. if (this.collection && !this.localdata.length) {
  220. this.debounceGet();
  221. }
  222. },
  223. computed: {
  224. filterMixinDatacomResData() {
  225. if (this.filterable && this.filterInput) {
  226. return this.mixinDatacomResData.filter(e => e[this.dataKey].includes(this.filterInput))
  227. } else {
  228. return this.mixinDatacomResData
  229. }
  230. },
  231. typePlaceholder() {
  232. const text = {
  233. 'opendb-stat-app-versions': '版本',
  234. 'opendb-app-channels': '渠道',
  235. 'opendb-app-list': '应用'
  236. }
  237. const common = this.placeholder
  238. const placeholder = text[this.collection]
  239. return placeholder ?
  240. common + placeholder :
  241. common
  242. },
  243. valueCom() {
  244. // #ifdef VUE3
  245. return this.modelValue;
  246. // #endif
  247. // #ifndef VUE3
  248. return this.value;
  249. // #endif
  250. }
  251. },
  252. watch: {
  253. localdata: {
  254. immediate: true,
  255. handler(val, old) {
  256. if (Array.isArray(val) && old !== val) {
  257. this.mixinDatacomResData = val || []
  258. }
  259. }
  260. },
  261. valueCom: {
  262. handler(newVal, oldVal) {
  263. // console.log(newVal, oldVal);
  264. this.initDefVal()
  265. },
  266. deep: true,
  267. immediate: true
  268. },
  269. mixinDatacomResData: {
  270. immediate: true,
  271. handler(val) {
  272. if (val.length) {
  273. this.initDefVal()
  274. }
  275. }
  276. },
  277. },
  278. methods: {
  279. debounce(fn, time = 100) {
  280. let timer = null
  281. return function(...args) {
  282. if (timer) clearTimeout(timer)
  283. timer = setTimeout(() => {
  284. fn.apply(this, args)
  285. }, time)
  286. }
  287. },
  288. // 执行数据库查询
  289. query() {
  290. this.mixinDatacomEasyGet();
  291. },
  292. // 监听查询条件变更事件
  293. onMixinDatacomPropsChange() {
  294. if (this.collection) {
  295. this.debounceGet();
  296. }
  297. },
  298. initDefVal() {
  299. let defValue = ''
  300. if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
  301. defValue = this.valueCom
  302. } else {
  303. let strogeValue
  304. if (this.collection) {
  305. strogeValue = this.getCache()
  306. }
  307. if (strogeValue || strogeValue === 0) {
  308. defValue = strogeValue
  309. } else {
  310. let defItem = ''
  311. if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
  312. defItem = this.mixinDatacomResData[this.defItem - 1][this.dataValue]
  313. }
  314. defValue = defItem
  315. }
  316. if (defValue || defValue === 0) {
  317. this.emit(defValue)
  318. }
  319. }
  320. if (this.multiple) {
  321. const mixinDatacomResData = this.mixinDatacomResData || []
  322. if (!defValue) defValue = []
  323. this.current = defValue.map(item => {
  324. const current = mixinDatacomResData.find(e => {
  325. return e[this.dataValue] == item
  326. })
  327. return {
  328. ...current
  329. }
  330. })
  331. this.currentArr = this.current.map(e => e[this.dataValue])
  332. if (defValue.length < 1) {
  333. this.currentArr = []
  334. }
  335. } else {
  336. const def = this.mixinDatacomResData.find(item => item[this.dataValue] === defValue)
  337. this.current = def ? this.formatItemName(def) : ''
  338. }
  339. },
  340. /**
  341. * @param {[String, Number]} value
  342. * 判断用户给的 value 是否同时为禁用状态
  343. */
  344. isDisabled(value) {
  345. let isDisabled = false;
  346. this.mixinDatacomResData.forEach(item => {
  347. if (item[this.dataValue] === value) {
  348. isDisabled = item.disable
  349. }
  350. })
  351. return isDisabled;
  352. },
  353. inputChange(e) {
  354. this.$emit('inputChange', e.detail.value)
  355. },
  356. clearVal() {
  357. if (this.disabled) {
  358. return
  359. }
  360. if (this.multiple) {
  361. this.current = []
  362. this.currentArr = []
  363. this.emit([])
  364. } else {
  365. this.current = ""
  366. this.currentArr = []
  367. this.emit('')
  368. }
  369. if (this.collection) {
  370. this.removeCache()
  371. }
  372. this.placeholderOld = this.placeholder
  373. this.filterInput = ""
  374. },
  375. change(item) {
  376. if (!item.disable) {
  377. this.showSelector = false
  378. if (this.multiple) {
  379. if (!this.current) {
  380. this.current = []
  381. }
  382. if (!this.currentArr) {
  383. this.currentArr = []
  384. }
  385. if (this.currentArr.includes(item[this.dataValue])) {
  386. let index = this.current.findIndex(e => {
  387. return e[this.dataValue] == item[this.dataValue]
  388. })
  389. this.current.splice(index, 1)
  390. this.currentArr.splice(index, 1)
  391. this.emit(this.current)
  392. } else {
  393. this.current.push(item)
  394. this.currentArr.push(item[this.dataValue])
  395. this.emit(this.current)
  396. }
  397. this.filterInput = ""
  398. } else {
  399. this.current = this.formatItemName(item)
  400. if (this.filterable) {
  401. this.filterInput = item[this.dataKey]
  402. }
  403. this.emit(item[this.dataValue])
  404. }
  405. }
  406. },
  407. delItem(item) {
  408. if (this.disabled) {
  409. return
  410. }
  411. if (this.currentArr.includes(item[this.dataValue])) {
  412. let index = this.current.findIndex(e => {
  413. return e[this.dataValue] == item[this.dataValue]
  414. })
  415. this.current.splice(index, 1)
  416. this.currentArr.splice(index, 1)
  417. this.emit(this.current)
  418. }
  419. },
  420. emit(val) {
  421. if (this.multiple) {
  422. this.$emit('input', this.currentArr)
  423. this.$emit('update:modelValue', this.currentArr)
  424. const currentArr = this.mixinDatacomResData.filter(item => this.currentArr.includes(item[this
  425. .dataValue]))
  426. this.$emit('change', currentArr)
  427. } else {
  428. this.$emit('input', val)
  429. this.$emit('update:modelValue', val)
  430. const current = this.mixinDatacomResData.find(item => val == item[this.dataValue])
  431. console.log(current);
  432. this.$emit('change', current)
  433. }
  434. if (this.collection) {
  435. this.setCache(val);
  436. }
  437. },
  438. toggleSelector() {
  439. if (this.disabled) {
  440. return
  441. }
  442. // if (this.filterable && this.filterInput && this.mixinDatacomResData.findIndex(e => {
  443. // return e[this.dataKey] == this
  444. // .filterInput
  445. // }) < 0) {
  446. // if (!this.multiple) {
  447. // this.filterInput = ""
  448. // }
  449. // }
  450. this.showSelector = !this.showSelector
  451. this.isFocus = this.showSelector
  452. if (this.filterable && this.current && this.showSelector) {
  453. if (!this.multiple) {
  454. this.placeholderOld = this.current
  455. // this.filterInput = ""
  456. }
  457. } else if (this.filterable && !this.current && !this.showSelector) {
  458. if (this.placeholderOld != this.placeholder) {
  459. if (!this.multiple) {
  460. this.current = this.placeholderOld
  461. }
  462. }
  463. }
  464. this.filterInput = ""
  465. },
  466. formatItemName(item) {
  467. if (!item) {
  468. return ""
  469. }
  470. let text = item[this.dataKey]
  471. let value = item[this.dataValue]
  472. let {
  473. channel_code
  474. } = item
  475. channel_code = channel_code ? `(${channel_code})` : ''
  476. if (this.format) {
  477. // 格式化输出
  478. let str = "";
  479. str = this.format;
  480. for (let key in item) {
  481. str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
  482. }
  483. return str;
  484. } else {
  485. return this.collection.indexOf('app-list') > 0 ?
  486. `${text}(${value})` :
  487. (
  488. text ?
  489. text :
  490. `未命名${channel_code}`
  491. )
  492. }
  493. },
  494. // 获取当前加载的数据
  495. getLoadData() {
  496. return this.mixinDatacomResData;
  497. },
  498. // 获取当前缓存key
  499. getCurrentCacheKey() {
  500. return this.collection;
  501. },
  502. // 获取缓存
  503. getCache(name = this.getCurrentCacheKey()) {
  504. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  505. return cacheData[name];
  506. },
  507. // 设置缓存
  508. setCache(value, name = this.getCurrentCacheKey()) {
  509. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  510. cacheData[name] = value;
  511. uni.setStorageSync(this.cacheKey, cacheData);
  512. },
  513. // 删除缓存
  514. removeCache(name = this.getCurrentCacheKey()) {
  515. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  516. delete cacheData[name];
  517. uni.setStorageSync(this.cacheKey, cacheData);
  518. },
  519. }
  520. }
  521. </script>
  522. <style lang="scss">
  523. $uni-base-color: #6a6a6a !default;
  524. $uni-main-color: #333 !default;
  525. $uni-secondary-color: #909399 !default;
  526. $uni-border-3: #e5e5e5;
  527. /* #ifndef APP-NVUE */
  528. @media screen and (max-width: 500px) {
  529. .hide-on-phone {
  530. display: none;
  531. }
  532. }
  533. /* #endif */
  534. .uni-stat__select {
  535. display: flex;
  536. align-items: center;
  537. // padding: 15px;
  538. cursor: pointer;
  539. width: 100%;
  540. flex: 1;
  541. box-sizing: border-box;
  542. background: #F0F8F2;
  543. }
  544. .uni-stat-box {
  545. width: 100%;
  546. flex: 1;
  547. }
  548. .uni-stat__actived {
  549. width: 100%;
  550. flex: 1;
  551. // outline: 1px solid #2979ff;
  552. }
  553. .uni-label-text {
  554. font-size: 14px;
  555. font-weight: bold;
  556. color: $uni-base-color;
  557. margin: auto 0;
  558. margin-right: 5px;
  559. }
  560. .uni-select {
  561. font-size: 14px;
  562. border: 1px solid $uni-border-3;
  563. box-sizing: border-box;
  564. border-radius: 4px;
  565. padding: 0 5px;
  566. padding-left: 10px;
  567. position: relative;
  568. /* #ifndef APP-NVUE */
  569. display: flex;
  570. user-select: none;
  571. /* #endif */
  572. flex-direction: row;
  573. align-items: center;
  574. border-bottom: solid 1px $uni-border-3;
  575. width: 100%;
  576. flex: 1;
  577. height: 35px;
  578. min-height: 35px;
  579. &--disabled {
  580. background-color: #f5f7fa;
  581. cursor: not-allowed;
  582. }
  583. }
  584. .uni-select__label {
  585. font-size: 16px;
  586. // line-height: 22px;
  587. min-height: 35px;
  588. height: 35px;
  589. padding-right: 10px;
  590. color: $uni-secondary-color;
  591. }
  592. .uni-select__input-box {
  593. width: 100%;
  594. height: 35px;
  595. position: relative;
  596. /* #ifndef APP-NVUE */
  597. display: flex;
  598. /* #endif */
  599. flex: 1;
  600. flex-direction: row;
  601. align-items: center;
  602. .tag-calss {
  603. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  604. font-weight: 400;
  605. -webkit-font-smoothing: antialiased;
  606. -webkit-tap-highlight-color: transparent;
  607. font-size: 12px;
  608. border: 1px solid #d9ecff;
  609. border-radius: 4px;
  610. white-space: nowrap;
  611. height: 24px;
  612. padding: 0 4px 0px 8px;
  613. line-height: 22px;
  614. box-sizing: border-box;
  615. margin: 2px 0 2px 6px;
  616. display: flex;
  617. max-width: 100%;
  618. align-items: center;
  619. background-color: #f4f4f5;
  620. border-color: #e9e9eb;
  621. color: #909399;
  622. .text {
  623. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  624. font-weight: 400;
  625. -webkit-font-smoothing: antialiased;
  626. -webkit-tap-highlight-color: transparent;
  627. font-size: 12px;
  628. white-space: nowrap;
  629. line-height: 22px;
  630. color: #909399;
  631. overflow: hidden;
  632. text-overflow: ellipsis;
  633. }
  634. }
  635. }
  636. .uni-select__input {
  637. flex: 1;
  638. font-size: 14px;
  639. height: 22px;
  640. line-height: 22px;
  641. }
  642. .uni-select__input-plac {
  643. font-size: 14px;
  644. color: $uni-secondary-color;
  645. }
  646. .uni-select__selector {
  647. /* #ifndef APP-NVUE */
  648. box-sizing: border-box;
  649. /* #endif */
  650. position: absolute;
  651. top: calc(100% + 12px);
  652. left: 0;
  653. width: 100%;
  654. background-color: #FFFFFF;
  655. border: 1px solid #EBEEF5;
  656. border-radius: 6px;
  657. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  658. z-index: 3;
  659. padding: 4px 0;
  660. }
  661. .uni-select__selector-scroll {
  662. /* #ifndef APP-NVUE */
  663. max-height: 200px;
  664. box-sizing: border-box;
  665. /* #endif */
  666. }
  667. .uni-select__selector-empty,
  668. .uni-select__selector-item {
  669. /* #ifndef APP-NVUE */
  670. display: flex;
  671. cursor: pointer;
  672. /* #endif */
  673. line-height: 35px;
  674. font-size: 12px;
  675. text-align: center;
  676. /* border-bottom: solid 1px $uni-border-3; */
  677. padding: 0px 10px;
  678. }
  679. .uni-select__selector-item:hover {
  680. background-color: #f9f9f9;
  681. }
  682. .uni-select__selector-empty:last-child,
  683. .uni-select__selector-item:last-child {
  684. /* #ifndef APP-NVUE */
  685. border-bottom: none;
  686. /* #endif */
  687. }
  688. .uni-select_selector-item_active {
  689. color: #409eff;
  690. font-weight: bold;
  691. background-color: #f5f7fa;
  692. border-radius: 3px;
  693. }
  694. .uni-select__selector__disabled {
  695. opacity: 0.4;
  696. cursor: default;
  697. }
  698. /* picker 弹出层通用的指示小三角 */
  699. .uni-popper__arrow,
  700. .uni-popper__arrow::after {
  701. position: absolute;
  702. display: block;
  703. width: 0;
  704. height: 0;
  705. border-color: transparent;
  706. border-style: solid;
  707. border-width: 6px;
  708. }
  709. .uni-popper__arrow {
  710. filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
  711. top: -6px;
  712. left: 10%;
  713. margin-right: 3px;
  714. border-top-width: 0;
  715. border-bottom-color: #EBEEF5;
  716. }
  717. .uni-popper__arrow::after {
  718. content: " ";
  719. top: 1px;
  720. margin-left: -6px;
  721. border-top-width: 0;
  722. border-bottom-color: #fff;
  723. }
  724. .uni-select__input-text {
  725. // width: 280px;
  726. width: 90%;
  727. color: $uni-main-color;
  728. white-space: nowrap;
  729. text-overflow: ellipsis;
  730. -o-text-overflow: ellipsis;
  731. overflow: hidden;
  732. }
  733. .uni-select__input-placeholder {
  734. color: $uni-base-color;
  735. font-size: 12px;
  736. }
  737. .uni-select--mask {
  738. position: fixed;
  739. top: 0;
  740. bottom: 0;
  741. right: 0;
  742. left: 0;
  743. }
  744. </style>