🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@vtx/ember

Package Overview
Dependencies
Maintainers
6
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtx/ember - npm Package Compare versions

Comparing version
2.0.12
to
2.0.13
+25
components/i18n/en.json
{
"nian-fen": "Year",
"qing-xuan-ze": "Please select",
"ri-qi": "Date",
"shi-jian": "Time",
"yue-fen": "Month",
"bu-yun-xu-xuan-ze": "Selection not allowed",
"chao-chu-yun-xu-de-wen-jian-da-xiao": "File size exceeds the limit",
"chao-chu-zui-da-yun-xu-de-wen-jian-ge-shu": "Number of files exceeds the maximum allowed",
"ge-shi-de-wen-jian": "file(s) of this format",
"nin-que-ding-yao-shan-chu-ci-xiang-ma": "Are you sure you want to delete this item?",
"qing-pei-zhi-shang-chuan-di-zhi": "Please configure the upload URL",
"qing-shu-ru-guan-jian-zi": "Please enter a keyword",
"qu-xiao": "Cancel",
"que-ren": "Confirm",
"shang-chuan-shi-bai-qing-zhong-shi": "Upload failed, please try again",
"ti-shi": "Tip",
"xuan-ze-tu-pian": "Select image",
"yi-chu-cheng-gong": "Removed successfully",
"yi-zhong-zhi-yi-chu": "Removal has been cancelled",
"yu-lan-tu-pian-shi-bai": "Failed to preview image",
"zhong-xin-shang-chuan": "Re-upload",
"zan-wu-shu-ju": "No Data",
"dian-ji-zhong-shi": "Tap to retry"
}
import en from './en.json'
import zhCN from './zh-CN.json'
export default {
en,
'zh-Hans': zhCN,
}
{
"nian-fen": "年份",
"qing-xuan-ze": "请选择",
"ri-qi": "日期",
"shi-jian": "时间",
"yue-fen": "月份",
"chao-chu-yun-xu-de-wen-jian-da-xiao": "超出允许的文件大小",
"chao-chu-zui-da-yun-xu-de-wen-jian-ge-shu": "超出最大允许的文件个数",
"nin-que-ding-yao-shan-chu-ci-xiang-ma": "您确定要删除此项吗?",
"qing-pei-zhi-shang-chuan-di-zhi": "请配置上传地址",
"qing-shu-ru-guan-jian-zi": "请输入关键字",
"qu-xiao": "取消",
"que-ren": "确认",
"shang-chuan-shi-bai-qing-zhong-shi": "上传失败,请重试",
"ti-shi": "提示",
"xuan-ze-tu-pian": "选择图片",
"yi-chu-cheng-gong": "移除成功",
"yi-zhong-zhi-yi-chu": "已终止移除",
"yu-lan-tu-pian-shi-bai": "预览图片失败",
"zhong-xin-shang-chuan": "重新上传",
"dian-ji-zhong-shi": "点击重试",
"bu-yun-xu-xuan-ze-fileext-ge-shi-de-wen-jian": "不允许选择{0}格式的文件",
"zan-wu-shu-ju": "暂无数据"
}
import { initVueI18n } from '@dcloudio/uni-i18n'
import messages from '../i18n/index.js'
export default {
data() {
return {}
},
methods: {
toI18n(key) {
return initVueI18n(messages).t(key)
},
}
}
+6
-3

@@ -5,3 +5,3 @@ <template>

<view class="ly-loader ly-flex-center">
<view class="ly-loader-inner">加载中...</view>
<view class="ly-loader-inner">{{ $t('jia-zai-zhong') }}</view>
</view>

@@ -12,3 +12,3 @@ </template>

<view v-if="isEmpty || !visible" class="ly-empty">
{{ emptyText }}
{{ emptyTextI18n }}
</view>

@@ -72,3 +72,3 @@ <view :key="updateKey" class="ly-tree" :class="{ 'is-empty': isEmpty || !visible }" role="tree"

type: String,
default: '暂无数据'
default: ''
},

@@ -225,2 +225,5 @@

return !(this.store.ready && this.ready);
},
emptyTextI18n() {
return this.emptyText ? this.emptyText : this.$t('zan-wu-shu-ju');
}

@@ -227,0 +230,0 @@ },

@@ -1,7 +0,1 @@

// // 所有页面公共样式
// .u-input {
// padding: 0px 7px !important;
// }
// /deep/ uni-input {
// height: 22px !important;
// }
// 所有页面公共样式

@@ -52,4 +52,4 @@ <template>

* @event {Function} cancel 点击取消按钮
* @example <u-datetime-picker :show="show" :value="value1" mode="datetime" ></u-datetime-picker>
*/
* @example <u-datetime-picker :show=" show" :value="value1" mode="datetime"></u-datetime-picker>
*/
export default {

@@ -289,3 +289,4 @@ name: 'datetime-picker',

value = this.minDate;
} else if (!isDateMode && !value && this.mode !== 'date' && this.mode !== 'datetime' && this.mode !== 'year-month') {
} else if (!isDateMode && !value && this.mode !== 'date' && this.mode !== 'datetime' && this.mode !==
'year-month') {
// 如果是时间类型,而又没有默认值的话,就用最小时间

@@ -292,0 +293,0 @@ value = `${uni.$u.padZero(this.minHour)}:${uni.$u.padZero(

<template>
<view class="v-date-picker">
<view @click="popup" v-if="input">
<u-input :value="dateValue" :placeholder="inputPlaceholder" :disabled="disabled" :type="inputType"
:border="border" readonly suffixIcon="arrow-down" suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)" :customStyle="style"></u-input>
<u-input
:value="dateValue"
:placeholder="inputPlaceholder"
:disabled="disabled"
:type="inputType"
:border="border"
readonly
suffixIcon="arrow-down"
suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)"
:customStyle="style"
></u-input>
</view>
<vc-datetime-picker :show="show" :mode="modeType" v-model="dateValue" @confirm="confirm" @cancel="show = false"
@close="show = false" :formatter="formatter" :closeOnClickOverlay="true" ref="datetimePicker" :maxDate="maxDate"
:minDate="minDate" :minHour="minHour" :maxHour="maxHour" :maxMinute="maxMinute" :minMinute="minMinute"
:minSecond="minSecond" :maxSecond="maxSecond"></vc-datetime-picker>
<vc-datetime-picker
:show="show"
:mode="modeType"
v-model="dateValue"
@confirm="confirm"
@cancel="show = false"
@close="show = false"
:formatter="formatter"
:closeOnClickOverlay="true"
ref="datetimePicker"
:maxDate="maxDate"
:minDate="minDate"
:minHour="minHour"
:maxHour="maxHour"
:maxMinute="maxMinute"
:minMinute="minMinute"
:minSecond="minSecond"
:maxSecond="maxSecond"
:cancelText="cancelTextI18n"
:confirmText="confirmTextI18n"
></vc-datetime-picker>
</view>

@@ -21,5 +47,7 @@ </template>

*/
import UDatetimePicker from './u-datetime-picker/u-datetime-picker';
import dayjs from 'dayjs';
import i18nMixins from '../mixins/i18n';
import dayjs from 'dayjs';
export default {

@@ -29,2 +57,3 @@ components: {

},
mixins: [i18nMixins],
props: {

@@ -35,3 +64,3 @@ // 选择器类型

default: 'date',
validator: function (value) {
validator: function(value) {
return (

@@ -116,6 +145,12 @@ [

type: Object,
default: () => ({
}),
default: () => ({}),
},
confirmText: {
type: String,
default: '',
},
cancelText: {
type: String,
default: '',
},
},

@@ -140,4 +175,4 @@

...{ pointerEvents: 'none' },
...this.customStyle
}
...this.customStyle,
};
},

@@ -156,13 +191,29 @@ // 文本类型

const suffixs = {
year: '年份',
month: '月份',
['year-month']: '月份',
date: '日期',
datetime: '日期',
time: '时间',
hourMinute: '时间',
year: this.toI18n('nian-fen'),
month: this.toI18n('yue-fen'),
['year-month']: this.toI18n('yue-fen'),
date: this.toI18n('ri-qi'),
datetime: this.toI18n('ri-qi'),
time: this.toI18n('shi-jian'),
hourMinute: this.toI18n('shi-jian'),
};
return `请选择${suffixs[type]}`;
return this.toI18n('qing-xuan-ze') + ` ${suffixs[type]}`;
}
},
confirmTextI18n() {
return this.confirmText ? this.confirmText : this.toI18n('que-ren');
},
cancelTextI18n() {
return this.cancelText ? this.cancelText : this.toI18n('qu-xiao');
},
showTimeTag() {
if (
uni.getStorageSync('locale') === 'en-US' ||
uni.getStorageSync('UNI_LOCALE') === 'e'
) {
return false;
} else {
return true;
}
},
},

@@ -182,7 +233,5 @@

if (!val) {
this.show = true
this.show = true;
}
},
},

@@ -194,3 +243,2 @@ show(show) {

},
},

@@ -200,21 +248,11 @@

formatter(type, value) {
if (type === 'year') {
return `${value}年`;
}
if (type === 'month') {
return `${value}月`;
}
if (type === 'day') {
return `${value}日`;
}
if (type === 'hour') {
return `${value}时`;
}
if (type === 'minute') {
return `${value}分`;
}
if (type === 'second') {
return `${value}秒`;
}
return value;
const suffixs = {
year: '年',
month: '月',
day: '日',
hour: '时',
minute: '分',
second: '秒',
};
return `${value}${this?.showTimeTag ? suffixs[type] : ''}`;
},

@@ -225,3 +263,2 @@ popup() {

// }
this.show = true;

@@ -256,4 +293,5 @@ },

</script>
<style scoped>
pointer-events: none;
<style lang="scss" scoped>
@import '../style/.style.common.scss';
@import '../style/.style.components.scss';
</style>

@@ -56,3 +56,2 @@ <template>

*/
export default {

@@ -59,0 +58,0 @@ name: 'v-dropdown-item',

<template>
<view class="v-multi-select">
<view @click="popup" v-if="input"><u-input type="select" :value="inputValue" :placeholder="placeholder"
:border="border" readonly suffixIcon="arrow-down" suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)" :customStyle="style">
<view v-if="input" @click="popup">
<u-input
type="select"
:value="inputValue"
:placeholder="placeholderI18n"
:border="border"
suffixIcon="arrow-down"
suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)"
readonly
:customStyle="style"
>
</u-input>

@@ -11,20 +20,39 @@ </view>

<view class="v-multi-select-popup_header">
<view style="color: #606266" @click="cancel">取消</view>
<view :style="{ color: confirmColor }" @click="confirm">{{ confirmText }}</view>
<view style="color: #606266" @click="cancel">{{ cancelTextI18n }}</view>
<view :style="{ color: confirmColor }" @click="confirm">{{
confirmTextI18n
}}</view>
</view>
<view class="v-multi-select-popup_content">
<view class="v-multi-select-search">
<u-search v-model="searchText" :action-text="searchPlaceholder" :show-action="false"
:animation="true" shape="square"></u-search>
<u-search
v-model="searchText"
:placeholder="searchPlaceholderI18n"
:show-action="false"
:animation="true"
shape="square"
></u-search>
</view>
<scroll-view scroll-y="true" class="v-multi-select-list">
<u-empty v-if="!list.length" :mode="emptyMode" :margin-top="80"></u-empty>
<u-empty
v-if="!list.length"
:mode="emptyMode"
:margin-top="80"
:text="noDataI18n"
></u-empty>
<view v-for="item in list" :key="item.key">
<view @click="check(item.key)" :class="{
'v-multi-select-list_item': true,
'v-multi-select-list_item--checked': item._checked,
}">
<view
@click="check(item.key)"
:class="{
'v-multi-select-list_item': true,
'v-multi-select-list_item--checked': item._checked,
}"
>
<text>{{ item.value }}</text>
<!-- 选中图标 -->
<u-icon v-if="item._checked" name="checkbox-mark" color="#18b566"></u-icon>
<u-icon
v-if="item._checked"
name="checkbox-mark"
color="#18b566"
></u-icon>
</view>

@@ -38,3 +66,3 @@ </view>

</template>
<script>

@@ -45,4 +73,6 @@ /**

*/
import i18nMixins from '../mixins/i18n';
export default {
name: 'v-multiple-select',
mixins: [i18nMixins],
props: {

@@ -68,3 +98,3 @@ // 选择值

type: String,
default: '请选择',
default: '',
},

@@ -79,3 +109,3 @@ // 文本是否有边框

type: String,
default: '请输入关键字',
default: '',
},

@@ -85,4 +115,8 @@ // 弹出层确认提示文字

type: String,
default: '确认',
default: '',
},
cancelText: {
type: String,
default: '',
},
// 弹出层确认提示文字颜色

@@ -100,5 +134,3 @@ confirmColor: {

type: Object,
default: () => ({
}),
default: () => ({}),
},

@@ -122,11 +154,11 @@ },

...{ pointerEvents: 'none' },
...this.customStyle
}
...this.customStyle,
};
},
// 计算文本框显示的值
inputValue: function () {
inputValue: function() {
const { value, data } = this;
let selectValues = [];
value &&
data.map((item) => {
data.map(item => {
if (value.includes(item.key)) {

@@ -143,11 +175,9 @@ selectValues.push(item.value);

// 根据搜索框内容刷选
const filter = searchText
? data.filter((item) => item.value.includes(searchText))
: data;
const filter = searchText ? data.filter(item => item.value.includes(searchText)) : data;
// 根据checkedKeys判断当前列是否选中
return checkedKeys.length > 0
? filter.map((item) => ({
...item,
_checked: checkedKeys.includes(item.key),
}))
? filter.map(item => ({
...item,
_checked: checkedKeys.includes(item.key),
}))
: filter;

@@ -162,2 +192,19 @@ },

},
placeholderI18n() {
return this.placeholder ? this.placeholder : this.toI18n('qing-xuan-ze');
},
searchPlaceholderI18n() {
return this.searchPlaceholder
? this.searchPlaceholder
: this.toI18n('qing-shu-ru-guan-jian-zi');
},
confirmTextI18n() {
return this.confirmText ? this.confirmText : this.toI18n('que-ren');
},
cancelTextI18n() {
return this.cancelText ? this.cancelText : this.toI18n('qu-xiao');
},
noDataI18n() {
return this.toI18n('zan-wu-shu-ju');
},
},

@@ -187,3 +234,3 @@

if (checkedKeys.includes(key)) {
newCheckedKeys = checkedKeys.filter((item) => item != key);
newCheckedKeys = checkedKeys.filter(item => item != key);
} else {

@@ -232,5 +279,6 @@ newCheckedKeys = [...checkedKeys, key];

</script>
<style lang="scss" scoped>
@import '../style/.style.common.scss';
@import '../style/.style.components.scss';

@@ -293,2 +341,1 @@ .v-multi-select {

</style>

@@ -22,3 +22,3 @@ <template>

>
{{ cancelText }}
{{ cancelTextI18n }}
</view>

@@ -36,3 +36,3 @@ <view class="u-select__header__title">

>
{{ confirmText }}
{{ confirmTextI18n }}
</view>

@@ -45,3 +45,3 @@ </view>

:animation="true"
:placeholder="searchPlaceholder"
:placeholder="searchPlaceholderI18n"
shape="square"

@@ -83,2 +83,3 @@ ></u-search>

<script>
import i18nMixins from '../mixins/i18n';
/**

@@ -109,2 +110,3 @@ * select 列选择器

export default {
mixins: [i18nMixins],
props: {

@@ -177,3 +179,3 @@ // 列数据

type: String,
default: '取消',
default: ''
},

@@ -183,3 +185,3 @@ // 确认按钮的文字

type: String,
default: '确认',
default: ''
},

@@ -189,8 +191,4 @@ // 搜索框placeholder显示值

type: String,
default: '请输入关键字',
default: ''
},
keyName: {
type: String,
default: 'label',
},
itemHeight: {

@@ -253,2 +251,14 @@ type: Number,

},
placeholderI18n() {
return this.placeholder ? this.placeholder : this.toI18n('qing-xuan-ze');
},
searchPlaceholderI18n() {
return this.searchPlaceholder ? this.searchPlaceholder : this.toI18n('qing-shu-ru-guan-jian-zi');
},
confirmTextI18n() {
return this.confirmText ? this.confirmText : this.toI18n('que-ren');
},
cancelTextI18n() {
return this.cancelText ? this.cancelText : this.toI18n('qu-xiao');
},
},

@@ -255,0 +265,0 @@ methods: {

<template>
<view class="v-select">
<view @click="popup" v-if="input">
<u-input :value="inputValue" :placeholder="placeholder" :border="border" :readonly="true" v-if="clearFlag"
:customStyle="style" class="v-select-input">
<view v-if="input" @click="popup">
<u-input
:value="inputValue"
:placeholder="placeholderI18n"
:border="border"
v-if="clearFlag"
readonly
:customStyle="style"
class="v-select-input"
>
<template slot="suffix">
<u-icon v-if="value" size="14" name="close-circle" @click.native.stop="clearValue"></u-icon>
<u-icon
v-if="value"
size="14"
name="close-circle"
@click.native.stop="clearValue"
></u-icon>
</template>
</u-input>
<u-input :value="inputValue" :placeholder="placeholder" :border="border" :readonly="true"
suffixIcon="arrow-down" suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)" :customStyle="style" class="v-select-input">
<u-input
v-else
:value="inputValue"
:placeholder="placeholderI18n"
:border="border"
suffixIcon="arrow-down"
suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)"
readonly
:customStyle="style"
class="v-select-input"
>
</u-input>
</view>
<vc-select :show="show" :data="list" :default-value="selectedValue" :searchPlaceholder="searchPlaceholder"
@confirm="confirm" @close="close" @search="search"></vc-select>
<vc-select
:show="show"
:data="list"
:default-value="selectedValue"
:searchPlaceholder="searchPlaceholderI18n"
@confirm="confirm"
@close="close"
@search="search"
></vc-select>
</view>
</template>
<script>

@@ -27,6 +55,7 @@ /**

*/
import i18nMixins from '../mixins/i18n';
import USelect from './u-select';
export default {
name: 'v-select',
mixins: [i18nMixins],
components: {

@@ -57,3 +86,3 @@ 'vc-select': USelect,

type: String,
default: '请选择',
default: '',
},

@@ -68,3 +97,3 @@ // 文本是否有边框

type: String,
default: '请输入关键字',
default: '',
},

@@ -86,5 +115,5 @@ clearFlag: {

type: Object,
default: () => ({
pointerEvents: 'none'
}),
default() {
return {};
},
},

@@ -97,13 +126,12 @@ },

},
computed: {
style() {
return {
...{},
...this.customStyle
}
...{ pointerEvents: 'none' },
...this.customStyle,
};
},
// 列表数据处理为u-select所需要的数据格式
list: function () {
return this.data?.map((item) => ({
list: function() {
return this.data?.map(item => ({
value: item.key,

@@ -115,12 +143,20 @@ label: item.value,

// 文本框显示文本
inputValue: function () {
inputValue: function() {
const { value, data } = this;
return data.find((item) => item.key === value)?.value || '';
return data.find(item => item.key === value)?.value || '';
},
// 默认选中下标 参考 https://www.uviewui.com/components/select.html default-value
selectedValue: function () {
selectedValue: function() {
const { value, data } = this;
return value ? [data.findIndex((item) => item.key === value)] : [];
return value ? [data.findIndex(item => item.key === value)] : [];
},
placeholderI18n() {
return this.placeholder ? this.placeholder : this.toI18n('qing-xuan-ze');
},
searchPlaceholderI18n() {
return this.searchPlaceholder
? this.searchPlaceholder
: this.toI18n('qing-shu-ru-guan-jian-zi');
},
},

@@ -143,3 +179,3 @@

confirm(e) {
const values = e.map((item) => item.value);
const values = e.map(item => item.value);
this.$emit('change', values.join(','));

@@ -168,7 +204,5 @@ },

if (!val) {
this.show = true
this.show = true;
}
},
},

@@ -180,8 +214,8 @@ show(show) {

},
}
},
};
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
@import '../style/.style.common.scss';
</style>
@import '../style/.style.components.scss';
</style>
<template>
<view class="v-tree-select">
<view @click="popup" v-if="input">
<u-input :value="checkedNodeValue" type="select" :placeholder="placeholder" :border="border" readonly
suffixIcon="arrow-down" suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)" :customStyle="style"></u-input>
<view v-if="input" @click="popup">
<u-input
:value="checkedNodeValue"
type="select"
:placeholder="placeholderI18n"
:border="border"
suffixIcon="arrow-down"
suffixIconStyle="color: #C0C4CC;font-size: 24rpx"
placeholderStyle="color: rgb(192, 196, 204)"
readonly
:customStyle="style"
></u-input>
</view>

@@ -11,14 +19,30 @@ <u-popup :show="show" @close="close" mode="bottom">

<view class="v-tree-select-popup_header">
<view style="color: #606266" @click="cancel">取消</view>
<view :style="{ color: confirmColor }" @click="confirm">{{ confirmText }}</view>
<view style="color: #606266" @click="cancel">{{ cancelTextI18n }}</view>
<view :style="{ color: confirmColor }" @click="confirm">{{
confirmTextI18n
}}</view>
</view>
<scroll-view class="v-tree-select-popup_content" :scroll-y="true">
<view class="v-tree-select-search">
<u-search v-model="searchText" :action-text="searchPlaceholder" :show-action="false"
:animation="true" shape="square"></u-search>
<u-search
v-model="searchText"
:placeholder="searchPlaceholderI18n"
:show-action="false"
:animation="true"
shape="square"
></u-search>
</view>
<ly-tree ref="tree" :tree-data="treeData" :node-key="nodeKey" :props="props"
:showCheckbox="mode === 'multiple'" :showRadio="mode === 'single'" highlightCurrent
:defaultCheckedKeys="value" :filterNodeMethod="filterNodeMethod" @check="handleCheck"
:checkStrictly="checkStrictly"></ly-tree>
<ly-tree
ref="tree"
:tree-data="treeData"
:node-key="nodeKey"
:props="props"
:showCheckbox="mode === 'multiple'"
:showRadio="mode === 'single'"
highlightCurrent
:defaultCheckedKeys="value"
:filterNodeMethod="filterNodeMethod"
@check="handleCheck"
:checkStrictly="checkStrictly"
></ly-tree>
</scroll-view>

@@ -38,7 +62,8 @@ </view>

import { getNodeKey } from './util';
import i18nMixins from '../mixins/i18n';
export default {
name: 'v-tree-select',
mixins: [i18nMixins],
components: {
LyTree
LyTree,
},

@@ -59,3 +84,3 @@

type: String,
default: '请选择',
default: '',
},

@@ -70,3 +95,3 @@ // 文本是否有边框

type: String,
default: '请输入关键字',
default: '',
},

@@ -76,4 +101,8 @@ // 弹出层确认提示文字

type: String,
default: '确认',
default: '',
},
cancelText: {
type: String,
default: '',
},
// 弹出层确认提示文字颜色

@@ -88,3 +117,3 @@ confirmColor: {

default: 'single',
validator: function (value) {
validator: function(value) {
return ['single', 'multiple'].indexOf(value) !== -1;

@@ -116,2 +145,7 @@ },

},
// 是否显示input
input: {
type: Boolean,
default: true,
},
// 在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认为 false

@@ -122,7 +156,2 @@ checkStrictly: {

},
// 是否显示input
input: {
type: Boolean,
default: true,
},
customStyle: {

@@ -162,7 +191,5 @@ type: Object,

if (!val) {
this.show = true
this.show = true;
}
},
},

@@ -180,4 +207,4 @@ show(show) {

...{ pointerEvents: 'none' },
...this.customStyle
}
...this.customStyle,
};
},

@@ -188,3 +215,3 @@ // 选中的节点名称

let vals = [];
value.map((key) => {
value.map(key => {
const { label } = getNodeKey(key, treeData, nodeKey) || {};

@@ -195,8 +222,19 @@ label && vals.push(label);

},
placeholderI18n() {
return this.placeholder ? this.placeholder : this.toI18n('qing-xuan-ze');
},
searchPlaceholderI18n() {
return this.searchPlaceholder
? this.searchPlaceholder
: this.toI18n('qing-shu-ru-guan-jian-zi');
},
confirmTextI18n() {
return this.confirmText ? this.confirmText : this.toI18n('que-ren');
},
cancelTextI18n() {
return this.cancelText ? this.cancelText : this.toI18n('qu-xiao');
},
},
methods: {
close() {
this.show = false;
},
// 弹出选择器

@@ -246,2 +284,3 @@ popup() {

@import '../style/.style.common.scss';
@import '../style/.style.components.scss';

@@ -248,0 +287,0 @@ .v-tree-select {

<template>
<view class="u-upload" v-if="!disabled">
<template v-if="showUploadList">
<view
class="u-list-item u-preview-wrap"
v-for="(item, index) in lists"
:key="index"
:style="{
width: $u.addUnit(width),
height: $u.addUnit(height),
}"
>
<view
v-if="deletable"
class="u-delete-icon"
@tap.stop="deleteItem(index)"
:style="{
background: delBgColor,
}"
>
<view class="u-list-item u-preview-wrap" v-for="(item, index) in lists" :key="index" :style="{
width: $u.addUnit(width),
height: $u.addUnit(height),
}">
<view v-if="deletable" class="u-delete-icon" @tap.stop="deleteItem(index)" :style="{
background: delBgColor,
}">
<u-icon class="u-icon" :name="delIcon" size="20" :color="delColor"></u-icon>
</view>
<u-line-progress
v-if="showProgress && item.progress > 0 && !item.error"
:show-percent="false"
height="16"
class="u-progress"
:percentage="item.progress"
></u-line-progress>
<view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">点击重试</view>
<image
@tap.stop="doPreviewImage(item.url || item.path, index)"
class="u-preview-image"
v-if="!item.isImage"
:src="item.url || item.path"
:mode="imageMode"
></image>
<u-line-progress v-if="showProgress && item.progress > 0 && !item.error" :show-percent="false"
height="16" class="u-progress" :percentage="item.progress"></u-line-progress>
<view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">{{ $t('dian-ji-zhong-shi') }}
</view>
<image @tap.stop="doPreviewImage(item.url || item.path, index)" class="u-preview-image"
v-if="!item.isImage" :src="item.url || item.path" :mode="imageMode"></image>
</view>

@@ -43,14 +24,9 @@ </template>

<slot name="addBtn"></slot>
<view
v-if="!customBtn"
class="u-list-item u-add-wrap"
hover-class="u-add-wrap__hover"
hover-stay-time="150"
<view v-if="!customBtn" class="u-list-item u-add-wrap" hover-class="u-add-wrap__hover" hover-stay-time="150"
:style="{
width: $u.addUnit(width),
height: $u.addUnit(height),
}"
>
}">
<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
<view class="u-add-tips">{{ uploadText }}</view>
<view class="u-add-tips">{{ uploadTextI18n }}</view>
</view>

@@ -101,4 +77,6 @@ </view>

*/
import i18nMixins from '../mixins/i18n';
export default {
name: 'u-upload',
mixins: [i18nMixins],
props: {

@@ -197,3 +175,3 @@ //是否显示组件自带的图片预览功能

type: String,
default: '选择图片',
default: '',
},

@@ -270,3 +248,11 @@ // 是否自动上传

},
mounted() {},
computed: {
uploadTextI18n() {
return this.uploadText || this.toI18n('xuan-ze-tu-pian');
},
retryI18n() {
return this.uploadText || this.toI18n('dian-ji-zhong-shi');
},
},
mounted() { },
data() {

@@ -351,7 +337,7 @@ return {

this.$emit('on-oversize', val, this.lists, this.index);
this.showToast('超出允许的文件大小');
this.showToast(this.toI18n('chao-chu-yun-xu-de-wen-jian-da-xiao'));
} else {
if (maxCount <= lists.length) {
this.$emit('on-exceed', val, this.lists, this.index);
this.showToast('超出最大允许的文件个数');
this.showToast(this.toI18n('chao-chu-zui-da-yun-xu-de-wen-jian-ge-shu'));
return;

@@ -394,3 +380,3 @@ }

uni.showLoading({
title: '重新上传',
title: this.toI18n('zhong-xin-shang-chuan'),
});

@@ -444,3 +430,3 @@ this.uploadFile(index);

if (!this.action) {
this.showToast('请配置上传地址', true);
this.showToast(this.toI18n('qing-pei-zhi-shang-chuan-di-zhi'), true);
return;

@@ -496,3 +482,3 @@ }

this.$emit('on-error', err, index, this.lists, this.index);
this.showToast('上传失败,请重试');
this.showToast(this.toI18n('shang-chuan-shi-bai-qing-zhong-shi'));
},

@@ -502,4 +488,4 @@ // 删除一个图片

uni.showModal({
title: '提示',
content: '您确定要删除此项吗?',
title: this.toI18n('ti-shi'),
content: this.toI18n('nin-que-ding-yao-shan-chu-ci-xiang-ma'),
success: async res => {

@@ -524,7 +510,7 @@ if (res.confirm) {

// 如果进入promise的reject,终止删除操作
this.showToast('已终止移除');
this.showToast(this.toI18n('yi-zhong-zhi-yi-chu'));
});
} else if (beforeResponse === false) {
// 返回false,终止删除
this.showToast('已终止移除');
this.showToast(this.toI18n('yi-zhong-zhi-yi-chu'));
} else {

@@ -552,3 +538,3 @@ // 如果返回true,执行删除操作

this.$emit('on-remove', index, this.lists, this.index);
this.showToast('移除成功');
this.showToast(this.toI18n('yi-chu-cheng-gong'));
},

@@ -575,3 +561,3 @@ // 用户通过ref手动的形式,移除一张图片

uni.showToast({
title: '预览图片失败',
title: this.toI18n('yu-lan-tu-pian-shi-bai'),
icon: 'none',

@@ -602,3 +588,3 @@ });

});
if (!noArrowExt) this.showToast(`不允许选择${fileExt}格式的文件`);
if (!noArrowExt) this.showToast(this.$t('bu-yun-xu-xuan-ze-fileext-ge-shi-de-wen-jian', [fileExt]));
return noArrowExt;

@@ -612,2 +598,3 @@ },

@import '../style/.style.components.scss';
.u-upload {

@@ -618,2 +605,3 @@ @include vue-flex;

}
.u-list-item {

@@ -635,5 +623,7 @@ position: relative;

}
.u-preview-wrap {
border: 1px solid rgb(235, 236, 238);
}
.u-add-wrap {

@@ -644,2 +634,3 @@ flex-direction: column;

}
.u-add-tips {

@@ -649,5 +640,7 @@ margin-top: 20rpx;

}
.u-add-wrap__hover {
background-color: rgb(235, 236, 238);
}
.u-preview-image {

@@ -659,2 +652,3 @@ display: block;

}
.u-delete-icon {

@@ -673,2 +667,3 @@ position: absolute;

}
.u-icon {

@@ -679,2 +674,3 @@ @include vue-flex;

}
.u-progress {

@@ -688,2 +684,3 @@ position: absolute;

}
.u-error-btn {

@@ -690,0 +687,0 @@ position: absolute;

<template>
<view class="v-virtual-select">
<view @click="popup" v-if="input">
<u-input :value="inputValue" :placeholder="placeholder" :border="border" readonly suffixIcon="arrow-down"
:suffixIconStyle="suffixIconStyle" :placeholderStyle="placeholderStyle" :customStyle="style" />
<u-input
:value="inputValue"
:placeholder="placeholderI18n"
:border="border"
suffixIcon="arrow-down"
:suffixIconStyle="suffixIconStyle"
:placeholderStyle="placeholderStyle"
readonly
:customStyle="style"
/>
</view>
<u-popup :closeOnClickOverlay="maskCloseAble" mode="bottom" :popup="false" :show="show" length="auto"
:safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<u-popup
:closeOnClickOverlay="maskCloseAble"
mode="bottom"
:popup="false"
:show="show"
length="auto"
:safeAreaInsetBottom="safeAreaInsetBottom"
@close="close"
:z-index="uZIndex"
>
<view class="v-virtual-select-popup">
<view class="v-virtual-select-popup__header" @touchmove.stop.prevent="">
<view class="v-virtual-select-popup__header__cancel v-virtual-select-popup__header__btn"
:style="{ color: cancelColor }" hover-class="u-hover-class" :hover-stay-time="150" @tap="close">
{{ cancelText }}
<view
class="v-virtual-select-popup__header__cancel v-virtual-select-popup__header__btn"
:style="{ color: cancelColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@tap="close"
>
{{ cancelTextI18n }}
</view>

@@ -18,25 +39,48 @@ <view class="v-virtual-select-popup__header__title">

</view>
<view class="v-virtual-select-popup__header__confirm v-virtual-select-popup__header__btn"
:style="{ color: confirmColor }" hover-class="u-hover-class" :hover-stay-time="150"
@touchmove.stop="" @tap.stop="confirm">
{{ confirmText }}
<view
class="v-virtual-select-popup__header__confirm v-virtual-select-popup__header__btn"
:style="{ color: confirmColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@touchmove.stop=""
@tap.stop="confirm"
>
{{ confirmTextI18n }}
</view>
</view>
<view class="v-virtual-select-popup__search">
<u-search v-model="searchText" :show-action="false" :animation="true" :placeholder="searchPlaceholder"
shape="square"></u-search>
<u-search
v-model="searchText"
:show-action="false"
:animation="true"
:placeholder="searchPlaceholderI18n"
shape="square"
></u-search>
</view>
<view class="v-virtual-select-popup__body">
<z-paging ref="paging" use-virtual-list :use-compatibility-mode="wechat" @query="queryList"
:fixed="false" @innerCellClick="innerCellClick" :extra-data="extraData">
<z-paging
ref="paging"
use-virtual-list
:use-compatibility-mode="wechat"
@query="queryList"
:fixed="false"
@innerCellClick="innerCellClick"
:extra-data="extraData"
>
<template slot="cell" slot-scope="{ item, index }" v-if="!wechat">
<view @click="innerCellClick(item, index)" :class="{
'v-virtual-select-popup__body_item': true,
'v-virtual-select-popup__body_item--checked': checkedKeys.map((item) => item.value).includes(
item.value,
),
}">
<view
@click="innerCellClick(item, index)"
:class="{
'v-virtual-select-popup__body_item': true,
'v-virtual-select-popup__body_item--checked': checkedKeys
.map(item => item.value)
.includes(item.value),
}"
>
{{ item.label }}
<u-icon v-if="checkedKeys.map((item) => item.value).includes(item.value)"
name="checkbox-mark" color="#18b566"></u-icon>
<u-icon
v-if="checkedKeys.map(item => item.value).includes(item.value)"
name="checkbox-mark"
color="#18b566"
></u-icon>
</view>

@@ -52,10 +96,8 @@ </template>

<script>
import i18nMixins from '../mixins/i18n';
export default {
name: 'v-virtual-select',
mixins: [i18nMixins],
components: {},
components: {
},
props: {

@@ -75,3 +117,3 @@ // 选择值

url: '',
method: 'POST'
method: 'POST',
};

@@ -103,3 +145,3 @@ },

page: 'page',
rows: 'rows'
rows: 'rows',
};

@@ -126,3 +168,3 @@ },

type: String,
default: '请选择',
default: '',
},

@@ -137,3 +179,3 @@ // 文本是否有边框

type: String,
default: '请输入关键字',
default: '',
},

@@ -146,3 +188,3 @@ placeholderStyle: {

type: String,
default: 'color:rgb(192, 196, 204);font-size:13px'
default: 'color:rgb(192, 196, 204);font-size:13px',
},

@@ -176,3 +218,3 @@ // "取消"按钮的颜色

type: String,
default: '取消',
default: '',
},

@@ -182,3 +224,3 @@ // 确认按钮的文字

type: String,
default: '确认',
default: '',
},

@@ -203,4 +245,4 @@ // 是否显示input

...{ pointerEvents: 'none' },
...this.customStyle
}
...this.customStyle,
};
},

@@ -210,3 +252,3 @@ // 文本框显示文本

const { value } = this;
return value.map((item) => item.label).join(',');
return value.map(item => item.label).join(',');
},

@@ -218,2 +260,16 @@ uZIndex() {

placeholderI18n() {
return this.placeholder ? this.placeholder : this.toI18n('qing-xuan-ze');
},
searchPlaceholderI18n() {
return this.searchPlaceholder
? this.searchPlaceholder
: this.toI18n('qing-shu-ru-guan-jian-zi');
},
confirmTextI18n() {
return this.confirmText ? this.confirmText : this.toI18n('que-ren');
},
cancelTextI18n() {
return this.cancelText ? this.cancelText : this.toI18n('qu-xiao');
},
},

@@ -233,3 +289,3 @@ data() {

checkedKeys: [],
}
},
};

@@ -268,17 +324,19 @@ },

[this.setPageRows.rows]: pageSize,
},
method: this.requestOption.method || 'POST',
header: {
access_token: uni.getStorageSync('ACCESS_TOKEN').access_token || '782401f7-1c4c-4c48-9f9f-e4b5bed7766a',
Authorization: uni.getStorageSync('ACCESS_TOKEN').access_token ? `bearer ${uni.getStorageSync('ACCESS_TOKEN').access_token}` : 'bearer 782401f7-1c4c-4c48-9f9f-e4b5bed7766a',
access_token:
uni.getStorageSync('ACCESS_TOKEN').access_token,
Authorization: uni.getStorageSync('ACCESS_TOKEN').access_token
? `bearer ${uni.getStorageSync('ACCESS_TOKEN').access_token}`
: 'bearer 782401f7-1c4c-4c48-9f9f-e4b5bed7766a',
},
complete: (res) => {
complete: res => {
if (Array.isArray(res.data.data)) {
const list = res.data.data.map((item) => {
const list = res.data.data.map(item => {
return {
value: item[this.setValueLabel.value],
label: item[this.setValueLabel.label],
}
})
};
});
this.$refs.paging.complete(list);

@@ -288,3 +346,3 @@ } else {

}
}
},
});

@@ -298,4 +356,4 @@ },

if (this.mode == 'multiple') {
if (checkedKeys.map((item) => item.value).includes(p.value)) {
newCheckedKeys = checkedKeys.filter((item) => item.value != p.value);
if (checkedKeys.map(item => item.value).includes(p.value)) {
newCheckedKeys = checkedKeys.filter(item => item.value != p.value);
} else {

@@ -305,7 +363,6 @@ newCheckedKeys = [...checkedKeys, p];

} else {
newCheckedKeys = [p]
newCheckedKeys = [p];
}
this.checkedKeys = newCheckedKeys;
},
},

@@ -322,3 +379,3 @@ watch: {

checkedKeys: newVal,
}
};
},

@@ -333,7 +390,5 @@ searchText(newVal) {

if (!val) {
this.show = true
this.show = true;
}
},
},

@@ -340,0 +395,0 @@ show(show) {

{
"name": "@vtx/ember",
"version": "2.0.12",
"version": "2.0.13",
"description": "uni-app组件库",

@@ -97,8 +97,13 @@ "files": [

"stylelint-order": "^4.0.0",
"vuepress": "^1.8.2",
"vue-fragment": "1.5.1",
"vuepress": "^1.8.2"
},
"dependencies": {
"@vtx/utils": "^1.0.20",
"dayjs": "^1.10.7",
"lodash.clonedeep": "^4.5.0",
"uview-ui": "^2.0.35"
"uview-ui": "^2.0.35",
"vue": "^2.6.11",
"vue-fragment": "1.5.1",
"vue-i18n": "8"
}
}
<template>
<div class="demo-block">
<div class="demo-block__title">{{ title }}</div>
<slot></slot>
</div>
</template>
<script>
export default {
props: {
title: String,
},
};
</script>
<style lang="scss" scoped>
.demo-block {
padding: 0 16px;
&__title {
margin: 0;
padding: 24px 0 16px;
color: rgba(69, 90, 100, 0.6);
font-weight: normal;
font-size: 14px;
line-height: 16px;
}
}
</style>