You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zxz-uni-data-select.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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. this.$emit('close')
  440. console.log("close")
  441. if (this.disabled) {
  442. return
  443. }
  444. // if (this.filterable && this.filterInput && this.mixinDatacomResData.findIndex(e => {
  445. // return e[this.dataKey] == this
  446. // .filterInput
  447. // }) < 0) {
  448. // if (!this.multiple) {
  449. // this.filterInput = ""
  450. // }
  451. // }
  452. this.showSelector = !this.showSelector
  453. this.isFocus = this.showSelector
  454. if (this.filterable && this.current && this.showSelector) {
  455. if (!this.multiple) {
  456. this.placeholderOld = this.current
  457. // this.filterInput = ""
  458. }
  459. } else if (this.filterable && !this.current && !this.showSelector) {
  460. if (this.placeholderOld != this.placeholder) {
  461. if (!this.multiple) {
  462. this.current = this.placeholderOld
  463. }
  464. }
  465. }
  466. this.filterInput = ""
  467. },
  468. formatItemName(item) {
  469. if (!item) {
  470. return ""
  471. }
  472. let text = item[this.dataKey]
  473. let value = item[this.dataValue]
  474. let {
  475. channel_code
  476. } = item
  477. channel_code = channel_code ? `(${channel_code})` : ''
  478. if (this.format) {
  479. // 格式化输出
  480. let str = "";
  481. str = this.format;
  482. for (let key in item) {
  483. str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
  484. }
  485. return str;
  486. } else {
  487. return this.collection.indexOf('app-list') > 0 ?
  488. `${text}(${value})` :
  489. (
  490. text ?
  491. text :
  492. `未命名${channel_code}`
  493. )
  494. }
  495. },
  496. // 获取当前加载的数据
  497. getLoadData() {
  498. return this.mixinDatacomResData;
  499. },
  500. // 获取当前缓存key
  501. getCurrentCacheKey() {
  502. return this.collection;
  503. },
  504. // 获取缓存
  505. getCache(name = this.getCurrentCacheKey()) {
  506. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  507. return cacheData[name];
  508. },
  509. // 设置缓存
  510. setCache(value, name = this.getCurrentCacheKey()) {
  511. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  512. cacheData[name] = value;
  513. uni.setStorageSync(this.cacheKey, cacheData);
  514. },
  515. // 删除缓存
  516. removeCache(name = this.getCurrentCacheKey()) {
  517. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  518. delete cacheData[name];
  519. uni.setStorageSync(this.cacheKey, cacheData);
  520. },
  521. }
  522. }
  523. </script>
  524. <style lang="scss">
  525. $uni-base-color: #6a6a6a !default;
  526. $uni-main-color: #333 !default;
  527. $uni-secondary-color: #909399 !default;
  528. $uni-border-3: #e5e5e5;
  529. /* #ifndef APP-NVUE */
  530. @media screen and (max-width: 500px) {
  531. .hide-on-phone {
  532. display: none;
  533. }
  534. }
  535. /* #endif */
  536. .uni-stat__select {
  537. display: flex;
  538. align-items: center;
  539. cursor: pointer;
  540. // width: 100%;
  541. min-width: 400rpx;
  542. flex: 1;
  543. box-sizing: border-box;
  544. }
  545. .uni-stat-box {
  546. width: 100%;
  547. flex: 1;
  548. }
  549. .uni-stat__actived {
  550. width: 100%;
  551. flex: 1;
  552. // outline: 1px solid #2979ff;
  553. }
  554. .uni-label-text {
  555. font-size: 14px;
  556. font-weight: bold;
  557. color: $uni-base-color;
  558. margin: auto 0;
  559. margin-right: 5px;
  560. }
  561. .uni-select {
  562. font-size: 14px;
  563. border: 1px solid $uni-border-3;
  564. box-sizing: border-box;
  565. border-radius: 4px;
  566. padding: 0 5px;
  567. padding-left: 10px;
  568. position: relative;
  569. /* #ifndef APP-NVUE */
  570. display: flex;
  571. user-select: none;
  572. /* #endif */
  573. flex-direction: row;
  574. align-items: center;
  575. border-bottom: solid 1px $uni-border-3;
  576. width: 100%;
  577. flex: 1;
  578. height: 35px;
  579. min-height: 35px;
  580. &--disabled {
  581. background-color: #f5f7fa;
  582. cursor: not-allowed;
  583. }
  584. }
  585. .uni-select__label {
  586. font-size: 16px;
  587. // line-height: 22px;
  588. min-height: 35px;
  589. height: 35px;
  590. padding-right: 10px;
  591. color: $uni-secondary-color;
  592. }
  593. .uni-select__input-box {
  594. width: 100%;
  595. height: 35px;
  596. position: relative;
  597. /* #ifndef APP-NVUE */
  598. display: flex;
  599. /* #endif */
  600. flex: 1;
  601. flex-direction: row;
  602. align-items: center;
  603. .tag-calss {
  604. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  605. font-weight: 400;
  606. -webkit-font-smoothing: antialiased;
  607. -webkit-tap-highlight-color: transparent;
  608. font-size: 12px;
  609. border: 1px solid #d9ecff;
  610. border-radius: 4px;
  611. white-space: nowrap;
  612. height: 24px;
  613. padding: 0 4px 0px 8px;
  614. line-height: 22px;
  615. box-sizing: border-box;
  616. margin: 2px 0 2px 6px;
  617. display: flex;
  618. max-width: 100%;
  619. align-items: center;
  620. background-color: #f4f4f5;
  621. border-color: #e9e9eb;
  622. color: #909399;
  623. .text {
  624. font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  625. font-weight: 400;
  626. -webkit-font-smoothing: antialiased;
  627. -webkit-tap-highlight-color: transparent;
  628. font-size: 12px;
  629. white-space: nowrap;
  630. line-height: 22px;
  631. color: #909399;
  632. overflow: hidden;
  633. text-overflow: ellipsis;
  634. }
  635. }
  636. }
  637. .uni-select__input {
  638. flex: 1;
  639. font-size: 14px;
  640. height: 22px;
  641. line-height: 22px;
  642. }
  643. .uni-select__input-plac {
  644. font-size: 14px;
  645. color: $uni-secondary-color;
  646. }
  647. .uni-select__selector {
  648. /* #ifndef APP-NVUE */
  649. box-sizing: border-box;
  650. /* #endif */
  651. position: absolute;
  652. top: calc(100% + 12px);
  653. left: 0;
  654. width: 100%;
  655. background-color: #FFFFFF;
  656. border: 1px solid #EBEEF5;
  657. border-radius: 6px;
  658. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  659. z-index: 99999;
  660. padding: 4px 0;
  661. }
  662. .uni-select__selector-scroll {
  663. /* #ifndef APP-NVUE */
  664. max-height: 200px;
  665. box-sizing: border-box;
  666. position: absolute;
  667. z-index: 99999;
  668. background-color: white;
  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: 14px;
  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>