zxz-uni-data-select.vue 19 KB

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