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.

837 lines
21 KiB

3 weeks ago
  1. <template>
  2. <view class="uni-stat__select">
  3. <span v-if="label" class="uni-label-text hide-on-phone">{{label + ''}}</span>
  4. <view class="uni-stat-box" :class="{'uni-stat__actived': current}">
  5. <view class="uni-select" :class="{'uni-select--disabled':disabled, 'uni-select--wrap': shouldWrap , 'border-default': mode == 'default','border-bottom': mode == 'underline'}">
  6. <view class="uni-select__input-box" @click="toggleSelector" :class="{'uni-select__input-box--wrap': shouldWrap}">
  7. <view v-if="slotSelected" class="slot-content padding-top-bottom" :class="{'uni-select__input-text--wrap': shouldWrap}">
  8. <slot name="selected" :selectedItems="getSelectedItems()"></slot>
  9. </view>
  10. <template v-else>
  11. <view v-if="textShow" class="uni-select__input-text" :class="{'uni-select__input-text--wrap': shouldWrap}">
  12. <view class="padding-top-bottom" :class="'align-'+align">{{textShow}}</view>
  13. </view>
  14. <view v-else class="uni-select__input-text uni-select__input-placeholder" :class="'align-'+align">{{typePlaceholder}}</view>
  15. </template>
  16. <view key="clear-button" v-if="!hideRight && shouldShowClear && clear && !disabled" @click.stop="clearVal">
  17. <uni-icons type="clear" color="#c0c4cc" size="24" />
  18. </view>
  19. <view key="arrow-button" v-else-if="!hideRight">
  20. <uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
  21. </view>
  22. </view>
  23. <view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
  24. <view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
  25. <view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view>
  26. <scroll-view scroll-y="true" class="uni-select__selector-scroll">
  27. <template v-if="slotEmpty && mixinDatacomResData.length === 0">
  28. <view class="uni-select__selector-empty">
  29. <slot name="empty" :empty="emptyTips"></slot>
  30. </view>
  31. </template>
  32. <template v-else>
  33. <view v-if="mixinDatacomResData.length === 0" class="uni-select__selector-empty">
  34. <text>{{emptyTips}}</text>
  35. </view>
  36. </template>
  37. <template v-if="slotOption">
  38. <view v-for="(itemData,index) in mixinDatacomResData" :key="index" @click="change(itemData)">
  39. <slot name="option" :item="itemData" :itemSelected="multiple? getCurrentValues().includes(itemData.value):getCurrentValues() == itemData.value"></slot>
  40. </view>
  41. </template>
  42. <template v-else>
  43. <view v-if="!multiple && mixinDatacomResData.length > 0" class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
  44. @click="change(item)">
  45. <text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
  46. </view>
  47. <view v-if="multiple && mixinDatacomResData.length > 0" >
  48. <checkbox-group @change="checkBoxChange">
  49. <label class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index" >
  50. <checkbox :value="index+''" :checked="getCurrentValues().includes(item.value)" :disabled="item.disable"></checkbox>
  51. <view :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</view>
  52. </label>
  53. </checkbox-group>
  54. </view>
  55. </template>
  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|Array} 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. * @property {Boolean} multiple 是否多选模式
  75. * @property {Boolean} wrap 是否允许选中文本换行显示
  76. * @property {String} placement 弹出位置
  77. * @value top 顶部弹出
  78. * @value bottom 底部弹出default)
  79. * @property {String} align 选择文字的位置
  80. * @value left 显示左侧
  81. * @value center 显示中间
  82. * @value right 显示 右侧
  83. * @property {Boolean} hideRight 是否隐藏右侧按钮
  84. * @property {String} mode 边框样式
  85. * @value default 四周边框
  86. * @value underline 下边框
  87. * @value none 无边框
  88. * @event {Function} change 选中发生变化触发
  89. * @event {Function} open 选择框开启时触发
  90. * @event {Function} close 选择框关闭时触发
  91. * @event {Function} clear 点击清除按钮之后触发
  92. */
  93. export default {
  94. name: "uni-data-select",
  95. mixins: [uniCloud.mixinDatacom || {}],
  96. emits: [
  97. 'open',
  98. 'close',
  99. 'update:modelValue',
  100. 'input',
  101. 'clear',
  102. 'change'
  103. ],
  104. model: {
  105. prop: 'modelValue',
  106. event: 'update:modelValue'
  107. },
  108. options: {
  109. // #ifdef MP-TOUTIAO
  110. virtualHost: false,
  111. // #endif
  112. // #ifndef MP-TOUTIAO
  113. virtualHost: true
  114. // #endif
  115. },
  116. props: {
  117. localdata: {
  118. type: Array,
  119. default () {
  120. return []
  121. }
  122. },
  123. value: {
  124. type: [String, Number, Array],
  125. default: ''
  126. },
  127. modelValue: {
  128. type: [String, Number, Array],
  129. default: ''
  130. },
  131. label: {
  132. type: String,
  133. default: ''
  134. },
  135. placeholder: {
  136. type: String,
  137. default: '请选择'
  138. },
  139. emptyTips: {
  140. type: String,
  141. default: '无选项'
  142. },
  143. clear: {
  144. type: Boolean,
  145. default: true
  146. },
  147. defItem: {
  148. type: Number,
  149. default: 0
  150. },
  151. disabled: {
  152. type: Boolean,
  153. default: false
  154. },
  155. // 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
  156. format: {
  157. type: String,
  158. default: ''
  159. },
  160. placement: {
  161. type: String,
  162. default: 'bottom'
  163. },
  164. multiple: {
  165. type: Boolean,
  166. default: false
  167. },
  168. wrap: {
  169. type: Boolean,
  170. default: false
  171. },
  172. align:{
  173. type: String,
  174. default: "left"
  175. },
  176. hideRight: {
  177. type: Boolean,
  178. default: false
  179. },
  180. mode:{
  181. type: String,
  182. default: 'default'
  183. }
  184. },
  185. data() {
  186. return {
  187. showSelector: false,
  188. current: '',
  189. mixinDatacomResData: [],
  190. apps: [],
  191. channels: [],
  192. cacheKey: "uni-data-select-lastSelectedValue",
  193. };
  194. },
  195. created() {
  196. this.debounceGet = this.debounce(() => {
  197. this.query();
  198. }, 300);
  199. if (this.collection && !this.localdata.length) {
  200. this.debounceGet();
  201. }
  202. },
  203. computed: {
  204. typePlaceholder() {
  205. const text = {
  206. 'opendb-stat-app-versions': '版本',
  207. 'opendb-app-channels': '渠道',
  208. 'opendb-app-list': '应用'
  209. }
  210. const common = this.placeholder
  211. const placeholder = text[this.collection]
  212. return placeholder ?
  213. common + placeholder :
  214. common
  215. },
  216. valueCom() {
  217. if (this.value === '') return this.modelValue
  218. if (this.modelValue === '') return this.value
  219. return this.value
  220. },
  221. textShow() {
  222. // 长文本显示
  223. if (this.multiple) {
  224. const currentValues = this.getCurrentValues();
  225. if (Array.isArray(currentValues) && currentValues.length > 0) {
  226. const selectedItems = this.mixinDatacomResData.filter(item => currentValues.includes(item.value));
  227. return selectedItems.map(item => this.formatItemName(item)).join(', ');
  228. } else {
  229. return ''; // 空数组时返回空字符串,显示占位符
  230. }
  231. } else {
  232. return this.current;
  233. }
  234. },
  235. shouldShowClear() {
  236. if (this.multiple) {
  237. const currentValues = this.getCurrentValues();
  238. return Array.isArray(currentValues) && currentValues.length > 0;
  239. } else {
  240. return !!this.current;
  241. }
  242. },
  243. shouldWrap() {
  244. // 只有在多选模式、开启换行、且有内容时才应用换行样式
  245. return this.multiple && this.wrap && !!this.textShow;
  246. },
  247. getOffsetByPlacement() {
  248. switch (this.placement) {
  249. case 'top':
  250. return "bottom:calc(100% + 12px);";
  251. case 'bottom':
  252. return "top:calc(100% + 12px);";
  253. }
  254. },
  255. slotSelected(){
  256. // #ifdef VUE2
  257. return this.$scopedSlots ? this.$scopedSlots.selected : false
  258. // #endif
  259. // #ifdef VUE3
  260. return this.$slots ? this.$slots.selected : false
  261. // #endif
  262. },
  263. slotEmpty(){
  264. // #ifdef VUE2
  265. return this.$scopedSlots ? this.$scopedSlots.empty : false
  266. // #endif
  267. // #ifdef VUE3
  268. return this.$slots ? this.$slots.empty : false
  269. // #endif
  270. },
  271. slotOption(){
  272. // #ifdef VUE2
  273. return this.$scopedSlots ? this.$scopedSlots.option : false
  274. // #endif
  275. // #ifdef VUE3
  276. return this.$slots ? this.$slots.option : false
  277. // #endif
  278. }
  279. },
  280. watch: {
  281. showSelector:{
  282. handler(val,old){
  283. val ? this.$emit('open') : this.$emit('close')
  284. }
  285. },
  286. localdata: {
  287. immediate: true,
  288. handler(val, old) {
  289. if (Array.isArray(val) && old !== val) {
  290. this.mixinDatacomResData = val
  291. }
  292. }
  293. },
  294. valueCom(val, old) {
  295. this.initDefVal()
  296. },
  297. mixinDatacomResData: {
  298. immediate: true,
  299. handler(val) {
  300. if (val.length) {
  301. this.initDefVal()
  302. }
  303. }
  304. },
  305. },
  306. methods: {
  307. getSelectedItems() {
  308. const currentValues = this.getCurrentValues();
  309. let _minxData = this.mixinDatacomResData
  310. // #ifdef MP-WEIXIN || MP-TOUTIAO
  311. _minxData = JSON.parse(JSON.stringify(this.mixinDatacomResData))
  312. // #endif
  313. if (this.multiple) {
  314. return _minxData.filter(item => currentValues.includes(item.value)) || [];
  315. } else {
  316. return _minxData.filter(item => item.value === currentValues) || [];
  317. }
  318. },
  319. debounce(fn, time = 100) {
  320. let timer = null
  321. return function(...args) {
  322. if (timer) clearTimeout(timer)
  323. timer = setTimeout(() => {
  324. fn.apply(this, args)
  325. }, time)
  326. }
  327. },
  328. // 检查项目是否已选中
  329. isSelected(item) {
  330. if (this.multiple) {
  331. const currentValues = this.getCurrentValues();
  332. return Array.isArray(currentValues) && currentValues.includes(item.value);
  333. } else {
  334. return this.getCurrentValues() === item.value;
  335. }
  336. },
  337. // 获取当前选中的值
  338. getCurrentValues() {
  339. if (this.multiple) {
  340. return Array.isArray(this.valueCom) ? this.valueCom : (this.valueCom ? [this.valueCom] : []);
  341. } else {
  342. return this.valueCom;
  343. }
  344. },
  345. // 执行数据库查询
  346. query() {
  347. this.mixinDatacomEasyGet();
  348. },
  349. // 监听查询条件变更事件
  350. onMixinDatacomPropsChange() {
  351. if (this.collection) {
  352. this.debounceGet();
  353. }
  354. },
  355. initDefVal() {
  356. let defValue = this.multiple ? [] : ''
  357. if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
  358. defValue = this.valueCom
  359. } else {
  360. let strogeValue
  361. if (this.collection) {
  362. strogeValue = this.getCache()
  363. }
  364. if (strogeValue || strogeValue === 0) {
  365. defValue = strogeValue
  366. } else {
  367. let defItem = this.multiple ? [] : ''
  368. if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
  369. defItem = this.multiple ? [this.mixinDatacomResData[this.defItem - 1].value] : this.mixinDatacomResData[this.defItem - 1].value
  370. }
  371. defValue = defItem
  372. }
  373. if (defValue || defValue === 0 || (this.multiple && Array.isArray(defValue) && defValue.length > 0)) {
  374. this.emit(defValue)
  375. }
  376. }
  377. if (this.multiple) {
  378. const selectedValues = Array.isArray(defValue) ? defValue : (defValue ? [defValue] : []);
  379. const selectedItems = this.mixinDatacomResData.filter(item => selectedValues.includes(item.value));
  380. this.current = selectedItems.map(item => this.formatItemName(item));
  381. } else {
  382. const def = this.mixinDatacomResData.find(item => item.value === defValue)
  383. this.current = def ? this.formatItemName(def) : ''
  384. }
  385. },
  386. /**
  387. * @param {[String, Number, Array]} value
  388. * 判断用户给的 value 是否同时为禁用状态
  389. */
  390. isDisabled(value) {
  391. if (Array.isArray(value)) {
  392. // 对于数组,如果任意一个值被禁用,则认为整体被禁用
  393. return value.some(val => {
  394. return this.mixinDatacomResData.some(item => item.value === val && item.disable);
  395. });
  396. } else {
  397. let isDisabled = false;
  398. this.mixinDatacomResData.forEach(item => {
  399. if (item.value === value) {
  400. isDisabled = item.disable
  401. }
  402. })
  403. return isDisabled;
  404. }
  405. },
  406. clearVal() {
  407. const emptyValue = this.multiple ? [] : '';
  408. this.emit(emptyValue)
  409. this.current = this.multiple ? [] : ''
  410. if (this.collection) {
  411. this.removeCache()
  412. }
  413. this.$emit('clear')
  414. },
  415. checkBoxChange(res){
  416. let range = res.detail.value
  417. let currentValues = range && range.length > 0? range.map((item)=>{
  418. const index = parseInt(item, 10);
  419. if (isNaN(index)) {
  420. console.error(`无效索引: ${item}`);
  421. }
  422. if (index < 0 || index >= this.mixinDatacomResData.length) {
  423. console.error(`索引越界: ${index}`);
  424. }
  425. return this.mixinDatacomResData[index].value;
  426. }) : []
  427. const selectedItems = this.mixinDatacomResData.filter(dataItem => currentValues.includes(dataItem.value));
  428. this.current = selectedItems.map(dataItem => this.formatItemName(dataItem));
  429. this.emit(currentValues);
  430. },
  431. change(item) {
  432. if (!item.disable) {
  433. if (this.multiple) {
  434. // 多选模式
  435. let currentValues = this.getCurrentValues();
  436. if (!Array.isArray(currentValues)) {
  437. currentValues = currentValues ? [currentValues] : [];
  438. }
  439. const itemValue = item.value;
  440. const index = currentValues.indexOf(itemValue);
  441. if (index > -1) {
  442. currentValues.splice(index, 1);
  443. } else {
  444. currentValues.push(itemValue);
  445. }
  446. const selectedItems = this.mixinDatacomResData.filter(dataItem => currentValues.includes(dataItem.value));
  447. this.current = selectedItems.map(dataItem => this.formatItemName(dataItem));
  448. this.emit(currentValues);
  449. } else {
  450. // 单选模式
  451. this.showSelector = false
  452. this.current = this.formatItemName(item)
  453. this.emit(item.value)
  454. }
  455. }
  456. },
  457. emit(val) {
  458. this.$emit('input', val)
  459. this.$emit('update:modelValue', val)
  460. this.$emit('change', val)
  461. if (this.collection) {
  462. this.setCache(val);
  463. }
  464. },
  465. toggleSelector() {
  466. if (this.disabled) {
  467. return
  468. }
  469. this.showSelector = !this.showSelector
  470. },
  471. formatItemName(item) {
  472. let {
  473. text,
  474. value,
  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. $uni-primary: #2979ff !default;
  530. $uni-success: #4cd964 !default;
  531. $uni-warning: #f0ad4e !default;
  532. $uni-error: #dd524d !default;
  533. $uni-info: #909399 !default;
  534. /* #ifndef APP-NVUE */
  535. @media screen and (max-width: 500px) {
  536. .hide-on-phone {
  537. display: none;
  538. }
  539. }
  540. /* #endif */
  541. .uni-stat__select {
  542. display: flex;
  543. align-items: center;
  544. // padding: 15px;
  545. /* #ifdef H5 */
  546. cursor: pointer;
  547. /* #endif */
  548. width: 100%;
  549. flex: 1;
  550. box-sizing: border-box;
  551. }
  552. .uni-stat-box {
  553. background-color: #fff;
  554. width: 100%;
  555. flex: 1;
  556. }
  557. .uni-stat__actived {
  558. width: 100%;
  559. flex: 1;
  560. // outline: 1px solid #2979ff;
  561. }
  562. .uni-label-text {
  563. font-size: 14px;
  564. font-weight: bold;
  565. color: $uni-base-color;
  566. margin: auto 0;
  567. margin-right: 5px;
  568. }
  569. .border-bottom {
  570. border-bottom: solid 1px $uni-border-3;
  571. }
  572. .border-default {
  573. border: 1px solid $uni-border-3;
  574. }
  575. .uni-select {
  576. font-size: 14px;
  577. box-sizing: border-box;
  578. border-radius: 4px;
  579. padding: 0 5px;
  580. padding-left: 10px;
  581. position: relative;
  582. /* #ifndef APP-NVUE */
  583. display: flex;
  584. user-select: none;
  585. /* #endif */
  586. flex-direction: row;
  587. align-items: center;
  588. width: 100%;
  589. flex: 1;
  590. min-height: 35px;
  591. &--disabled {
  592. background-color: #f5f7fa;
  593. cursor: not-allowed;
  594. }
  595. &--wrap {
  596. height: auto;
  597. min-height: 35px;
  598. // align-items: flex-start;
  599. }
  600. }
  601. .uni-select__label {
  602. font-size: 16px;
  603. // line-height: 22px;
  604. height: 35px;
  605. padding-right: 10px;
  606. color: $uni-secondary-color;
  607. }
  608. .uni-select__input-box {
  609. // height: 35px;
  610. width: 0px;
  611. position: relative;
  612. /* #ifndef APP-NVUE */
  613. display: flex;
  614. /* #endif */
  615. flex: 1;
  616. flex-direction: row;
  617. align-items: center;
  618. &--wrap {
  619. .uni-select__input-text {
  620. margin-right: 8px;
  621. }
  622. }
  623. .padding-top-bottom {
  624. padding-top: 5px;
  625. padding-bottom: 5px;
  626. }
  627. .slot-content {
  628. width: 100%;
  629. display: flex;
  630. flex-direction: row;
  631. flex-wrap: wrap;
  632. }
  633. }
  634. .uni-select__input {
  635. flex: 1;
  636. font-size: 14px;
  637. height: 22px;
  638. line-height: 22px;
  639. }
  640. .uni-select__input-plac {
  641. font-size: 14px;
  642. color: $uni-secondary-color;
  643. }
  644. .uni-select__selector {
  645. /* #ifndef APP-NVUE */
  646. box-sizing: border-box;
  647. /* #endif */
  648. position: absolute;
  649. left: 0;
  650. width: 100%;
  651. background-color: #FFFFFF;
  652. border: 1px solid #EBEEF5;
  653. border-radius: 6px;
  654. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  655. z-index: 3;
  656. padding: 4px 0;
  657. }
  658. .uni-select__selector-scroll {
  659. /* #ifndef APP-NVUE */
  660. max-height: 200px;
  661. box-sizing: border-box;
  662. /* #endif */
  663. }
  664. /* #ifdef H5 */
  665. @media (min-width: 768px) {
  666. .uni-select__selector-scroll {
  667. max-height: 600px;
  668. }
  669. }
  670. /* #endif */
  671. .uni-select__selector-empty,
  672. .uni-select__selector-item {
  673. /* #ifndef APP-NVUE */
  674. display: flex;
  675. cursor: pointer;
  676. /* #endif */
  677. flex-direction: row;
  678. align-items: center;
  679. line-height: 35px;
  680. font-size: 14px;
  681. /* border-bottom: solid 1px $uni-border-3; */
  682. padding: 0px 10px;
  683. }
  684. .uni-select__selector-item-check {
  685. margin-left: auto;
  686. }
  687. .uni-select__selector-empty:last-child,
  688. .uni-select__selector-item:last-child {
  689. /* #ifndef APP-NVUE */
  690. border-bottom: none;
  691. /* #endif */
  692. }
  693. .uni-select__selector__disabled {
  694. opacity: 0.4;
  695. cursor: default;
  696. }
  697. /* picker 弹出层通用的指示小三角 */
  698. .uni-popper__arrow_bottom,
  699. .uni-popper__arrow_bottom::after,
  700. .uni-popper__arrow_top,
  701. .uni-popper__arrow_top::after {
  702. position: absolute;
  703. display: block;
  704. width: 0;
  705. height: 0;
  706. border-color: transparent;
  707. border-style: solid;
  708. border-width: 6px;
  709. }
  710. .uni-popper__arrow_bottom {
  711. filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
  712. top: -6px;
  713. left: 10%;
  714. margin-right: 3px;
  715. border-top-width: 0;
  716. border-bottom-color: #EBEEF5;
  717. }
  718. .uni-popper__arrow_bottom::after {
  719. content: " ";
  720. top: 1px;
  721. margin-left: -6px;
  722. border-top-width: 0;
  723. border-bottom-color: #fff;
  724. }
  725. .uni-popper__arrow_top {
  726. filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
  727. bottom: -6px;
  728. left: 10%;
  729. margin-right: 3px;
  730. border-bottom-width: 0;
  731. border-top-color: #EBEEF5;
  732. }
  733. .uni-popper__arrow_top::after {
  734. content: " ";
  735. bottom: 1px;
  736. margin-left: -6px;
  737. border-bottom-width: 0;
  738. border-top-color: #fff;
  739. }
  740. .uni-select__input-text {
  741. // width: 280px;
  742. width: 100%;
  743. color: $uni-main-color;
  744. white-space: nowrap;
  745. text-overflow: ellipsis;
  746. -o-text-overflow: ellipsis;
  747. overflow: hidden;
  748. &--wrap {
  749. white-space: normal;
  750. text-overflow: initial;
  751. -o-text-overflow: initial;
  752. overflow: visible;
  753. word-wrap: break-word;
  754. word-break: break-all;
  755. // line-height: 1.5;
  756. }
  757. }
  758. .uni-select__input-placeholder {
  759. color: $uni-base-color;
  760. font-size: 12px;
  761. margin: 1px 0;
  762. }
  763. .uni-select--mask {
  764. position: fixed;
  765. top: 0;
  766. bottom: 0;
  767. right: 0;
  768. left: 0;
  769. z-index: 2;
  770. }
  771. .align-left {
  772. text-align: left;
  773. }
  774. .align-center {
  775. text-align: center;
  776. }
  777. .align-right {
  778. text-align: right;
  779. }
  780. </style>