消息
This commit is contained in:
206
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.js
vendored
Normal file
206
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.js
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const TUIKit_components_TUISearch_searchTypeList = require("../search-type-list.js");
|
||||
const TUIKit_components_TUISearch_searchTimeList = require("../search-time-list.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
if (!Math) {
|
||||
(Icon + DatePicker)();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const DatePicker = () => "../../common/DatePicker/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
popupPosition: {
|
||||
type: String,
|
||||
// "bottom" / "aside"
|
||||
default: "bottom"
|
||||
},
|
||||
searchType: {
|
||||
type: String,
|
||||
default: "global",
|
||||
// "global" / "conversation"
|
||||
validator(value) {
|
||||
return ["global", "conversation"].includes(value);
|
||||
}
|
||||
}
|
||||
},
|
||||
emits: ["searchConfigChange", "closeInConversationSearch"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emits = __emit;
|
||||
const searchTypeList = common_vendor.computed(
|
||||
() => (props == null ? void 0 : props.searchType) === "conversation" ? TUIKit_components_TUISearch_searchTypeList.conversationSearchTypeList : TUIKit_components_TUISearch_searchTypeList.globalSearchTypeList
|
||||
);
|
||||
const currentSearchMessageType = common_vendor.ref(TUIKit_components_TUISearch_searchTypeList.searchMessageTypeDefault[props == null ? void 0 : props.searchType]);
|
||||
const currentSearchMessageTime = common_vendor.ref(TUIKit_components_TUISearch_searchTimeList.searchMessageTimeDefault);
|
||||
const isTimeTabsShow = common_vendor.computed(() => {
|
||||
return currentSearchMessageType.value.key !== "contact" && currentSearchMessageType.value.key !== "group";
|
||||
});
|
||||
const datePickerRangeDisplayType = common_vendor.computed(
|
||||
() => TUIKit_utils_env.isPC && props.searchType === "global" && !TUIKit_utils_env.isUniFrameWork ? "two" : "one"
|
||||
);
|
||||
const isDatePickerShow = common_vendor.ref(false);
|
||||
function onCurrentSearchMessageTypeChange(typeObject) {
|
||||
if ((typeObject == null ? void 0 : typeObject.searchType) === (props == null ? void 0 : props.searchType)) {
|
||||
currentSearchMessageType.value = (typeObject == null ? void 0 : typeObject.value) || TUIKit_components_TUISearch_searchTypeList.searchMessageTypeDefault[props == null ? void 0 : props.searchType];
|
||||
}
|
||||
}
|
||||
function onCurrentSearchMessageTimeChange(timeObject) {
|
||||
if ((timeObject == null ? void 0 : timeObject.searchType) === (props == null ? void 0 : props.searchType)) {
|
||||
currentSearchMessageTime.value = (timeObject == null ? void 0 : timeObject.value) || TUIKit_components_TUISearch_searchTimeList.searchMessageTimeDefault;
|
||||
}
|
||||
}
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.SEARCH, {
|
||||
currentSearchMessageType: onCurrentSearchMessageTypeChange,
|
||||
currentSearchMessageTime: onCurrentSearchMessageTimeChange
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.SEARCH, {
|
||||
currentSearchMessageType: onCurrentSearchMessageTypeChange,
|
||||
currentSearchMessageTime: onCurrentSearchMessageTimeChange
|
||||
});
|
||||
});
|
||||
const selectSearchType = (item) => {
|
||||
common_vendor.Jt.update(common_vendor.o.SEARCH, "currentSearchMessageType", {
|
||||
value: item,
|
||||
searchType: props.searchType
|
||||
});
|
||||
};
|
||||
const selectSearchTime = (item) => {
|
||||
if (isDatePickerShow.value && item.key === "all") {
|
||||
isDatePickerShow.value = false;
|
||||
} else {
|
||||
isDatePickerShow.value = false;
|
||||
common_vendor.Jt.update(common_vendor.o.SEARCH, "currentSearchMessageTime", {
|
||||
value: item,
|
||||
searchType: props.searchType
|
||||
});
|
||||
}
|
||||
};
|
||||
const handleSelectAllTimeClicked = () => {
|
||||
var _a;
|
||||
if (((_a = currentSearchMessageTime.value) == null ? void 0 : _a.key) !== "all") {
|
||||
common_vendor.Jt.update(common_vendor.o.SEARCH, "currentSearchMessageTime", {
|
||||
value: TUIKit_components_TUISearch_searchTimeList.searchMessageTimeDefault,
|
||||
searchType: props.searchType
|
||||
});
|
||||
} else {
|
||||
isDatePickerShow.value = true;
|
||||
}
|
||||
};
|
||||
const pickTimePeriod = (time) => {
|
||||
var _a, _b, _c;
|
||||
if (((_a = currentSearchMessageTime.value) == null ? void 0 : _a.key) === "all") {
|
||||
const { startDate, endDate } = time;
|
||||
const timePosition = Number((((_b = endDate == null ? void 0 : endDate.toDate()) == null ? void 0 : _b.getTime()) / 1e3).toFixed(0));
|
||||
const timePeriod = timePosition - Number((((_c = startDate == null ? void 0 : startDate.toDate()) == null ? void 0 : _c.getTime()) / 1e3).toFixed(0));
|
||||
const newSearchMessageTime = {
|
||||
key: currentSearchMessageTime.value.key,
|
||||
label: currentSearchMessageTime.value.label,
|
||||
value: {
|
||||
timePosition,
|
||||
timePeriod
|
||||
}
|
||||
};
|
||||
common_vendor.Jt.update(common_vendor.o.SEARCH, "currentSearchMessageTime", {
|
||||
value: newSearchMessageTime,
|
||||
searchType: props.searchType
|
||||
});
|
||||
}
|
||||
};
|
||||
const clearTimePicker = () => {
|
||||
var _a;
|
||||
isDatePickerShow.value = false;
|
||||
if (((_a = currentSearchMessageTime.value) == null ? void 0 : _a.key) === "all") {
|
||||
common_vendor.Jt.update(common_vendor.o.SEARCH, "currentSearchMessageTime", {
|
||||
value: TUIKit_components_TUISearch_searchTimeList.searchMessageTimeDefault,
|
||||
searchType: props.searchType
|
||||
});
|
||||
}
|
||||
};
|
||||
const closeSearchContainer = () => {
|
||||
emits("closeInConversationSearch");
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: props.searchType === "conversation" && !common_vendor.unref(TUIKit_utils_env.isUniFrameWork)
|
||||
}, props.searchType === "conversation" && !common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? {
|
||||
b: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUISearch.搜索会话内容")),
|
||||
c: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.closeIcon$1),
|
||||
width: "14px",
|
||||
height: "14px"
|
||||
}),
|
||||
d: common_vendor.o$1(closeSearchContainer)
|
||||
} : {}, {
|
||||
e: common_vendor.f(common_vendor.unref(searchTypeList), (tabItem, tabKey, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUISearch.${tabItem.label}`)),
|
||||
b: tabKey,
|
||||
c: common_vendor.n(common_vendor.unref(currentSearchMessageType).key === tabItem.key && "tui-search-tabs-item-selected"),
|
||||
d: common_vendor.o$1(($event) => selectSearchType(tabItem), tabKey)
|
||||
};
|
||||
}),
|
||||
f: common_vendor.unref(isTimeTabsShow)
|
||||
}, common_vendor.unref(isTimeTabsShow) ? {
|
||||
g: common_vendor.f(common_vendor.unref(TUIKit_components_TUISearch_searchTimeList.searchMessageTimeList), (tabItem, tabKey, i0) => {
|
||||
return common_vendor.e({
|
||||
a: tabItem.key === "all"
|
||||
}, tabItem.key === "all" ? common_vendor.e({
|
||||
b: !common_vendor.unref(isDatePickerShow)
|
||||
}, !common_vendor.unref(isDatePickerShow) ? {
|
||||
c: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUISearch.选择时间`) + ": " + common_vendor.unref(common_vendor.Wt).t(`TUISearch.全部`)),
|
||||
d: "0764f731-1-" + i0,
|
||||
e: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.downSVG),
|
||||
width: "14px",
|
||||
height: "14px"
|
||||
}),
|
||||
f: common_vendor.o$1(handleSelectAllTimeClicked, tabKey)
|
||||
} : {}, {
|
||||
g: common_vendor.unref(isDatePickerShow)
|
||||
}, common_vendor.unref(isDatePickerShow) ? {
|
||||
h: common_vendor.o$1(pickTimePeriod, tabKey),
|
||||
i: "0764f731-2-" + i0,
|
||||
j: common_vendor.p({
|
||||
type: "range",
|
||||
rangeTableType: common_vendor.unref(datePickerRangeDisplayType)
|
||||
})
|
||||
} : {}, {
|
||||
k: common_vendor.o$1(() => {
|
||||
}, tabKey),
|
||||
l: common_vendor.unref(isDatePickerShow)
|
||||
}, common_vendor.unref(isDatePickerShow) ? {
|
||||
m: "0764f731-3-" + i0,
|
||||
n: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.closeIcon),
|
||||
width: "14px",
|
||||
height: "14px"
|
||||
}),
|
||||
o: common_vendor.o$1(clearTimePicker, tabKey)
|
||||
} : {}) : {
|
||||
p: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUISearch.${tabItem.label}`))
|
||||
}, {
|
||||
q: tabKey,
|
||||
r: common_vendor.n(common_vendor.unref(currentSearchMessageTime).key === tabItem.key && "tui-search-time-item-selected"),
|
||||
s: common_vendor.o$1(($event) => selectSearchTime(tabItem), tabKey)
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
h: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isPC) && `tui-search-container-${props.popupPosition}`),
|
||||
i: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-search-container-h5-main"),
|
||||
j: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-search-container-h5"),
|
||||
k: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isPC) && `container-${props.popupPosition}`),
|
||||
l: common_vendor.n(`container-${props.searchType}`)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0764f731"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUISearch/search-container/index.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon",
|
||||
"date-picker": "../../common/DatePicker/index"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-0764f731', 'tui-search-container', j, k, l]}}"><view class="{{['data-v-0764f731', h, i]}}"><view wx:if="{{a}}" class="tui-search-header data-v-0764f731"><view class="tui-search-header-title data-v-0764f731">{{b}}</view><view class="tui-search-header-close data-v-0764f731" bindtap="{{d}}"><icon wx:if="{{c}}" class="data-v-0764f731" u-i="0764f731-0" bind:__l="__l" u-p="{{c}}"/></view></view><view class="tui-search-tabs data-v-0764f731"><view wx:for="{{e}}" wx:for-item="tabItem" wx:key="b" class="{{['data-v-0764f731', 'tui-search-tabs-item', tabItem.c]}}" bindtap="{{tabItem.d}}">{{tabItem.a}}</view></view><slot name="input"/><view wx:if="{{f}}" class="tui-search-time data-v-0764f731"><view wx:for="{{g}}" wx:for-item="tabItem" wx:key="q" class="{{['data-v-0764f731', 'tui-search-time-item', tabItem.r]}}" bindtap="{{tabItem.s}}"><view wx:if="{{tabItem.a}}" class="tui-search-time-item-picker data-v-0764f731"><view wx:if="{{tabItem.b}}" class="tui-search-time-item-all data-v-0764f731" catchtap="{{tabItem.f}}">{{tabItem.c}} <icon wx:if="{{tabItem.e}}" class="data-v-0764f731" u-i="{{tabItem.d}}" bind:__l="__l" u-p="{{tabItem.e}}"/></view><view class="data-v-0764f731" catchtap="{{tabItem.k}}"><date-picker wx:if="{{tabItem.g}}" class="data-v-0764f731" bindpick="{{tabItem.h}}" u-i="{{tabItem.i}}" bind:__l="__l" u-p="{{tabItem.j}}"/></view><view wx:if="{{tabItem.l}}" class="tui-search-time-item-close data-v-0764f731" bindtap="{{tabItem.o}}"><icon wx:if="{{tabItem.n}}" class="icon data-v-0764f731" u-i="{{tabItem.m}}" bind:__l="__l" u-p="{{tabItem.n}}"/></view></view><view wx:else class="data-v-0764f731">{{tabItem.p}}</view></view></view><slot name="result"/></view></view>
|
||||
204
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.wxss
vendored
Normal file
204
unpackage/dist/dev/mp-weixin/TUIKit/components/TUISearch/search-container/index.wxss
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
body.data-v-0764f731, div.data-v-0764f731, ul.data-v-0764f731, ol.data-v-0764f731, dt.data-v-0764f731, dd.data-v-0764f731, li.data-v-0764f731, dl.data-v-0764f731, h1.data-v-0764f731, h2.data-v-0764f731, h3.data-v-0764f731, h4.data-v-0764f731, p.data-v-0764f731 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-style: normal;
|
||||
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
|
||||
}
|
||||
ol.data-v-0764f731, ul.data-v-0764f731, li.data-v-0764f731 {
|
||||
list-style: none;
|
||||
}
|
||||
img.data-v-0764f731 {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.data-v-0764f731 {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
.clear.data-v-0764f731 {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
a.data-v-0764f731 {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.data-v-0764f731:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
input.data-v-0764f731, textarea.data-v-0764f731 {
|
||||
-webkit-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
input.data-v-0764f731:focus, input.data-v-0764f731:active, textarea.data-v-0764f731:focus, textarea.data-v-0764f731:active {
|
||||
outline: none;
|
||||
}
|
||||
.chat-aside.data-v-0764f731 {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
box-sizing: border-box;
|
||||
width: 360px !important;
|
||||
border-radius: 8px 0 0 8px;
|
||||
z-index: 9999;
|
||||
max-height: calc(100% - 50px);
|
||||
}
|
||||
.container-bottom.data-v-0764f731 {
|
||||
margin: 0 10px;
|
||||
position: relative;
|
||||
}
|
||||
.container-conversation.data-v-0764f731 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-search-container-bottom.data-v-0764f731 {
|
||||
position: absolute;
|
||||
min-width: 400px;
|
||||
width: -webkit-fit-content;
|
||||
width: fit-content;
|
||||
height: 453px;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: rgba(0, 0, 0, 0.16) 0 3px 6px, rgba(0, 0, 0, 0.23) 0 3px 6px;
|
||||
left: 0;
|
||||
top: -5px;
|
||||
}
|
||||
.tui-search-container-aside.data-v-0764f731 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-search-container .tui-search-header.data-v-0764f731 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px 20px 10px;
|
||||
}
|
||||
.tui-search-container .tui-search-header-title.data-v-0764f731 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 19.6px;
|
||||
font-family: "PingFang SC", sans-serif;
|
||||
}
|
||||
.tui-search-container .tui-search-header-close.data-v-0764f731 {
|
||||
cursor: pointer;
|
||||
}
|
||||
.tui-search-container .tui-search-tabs.data-v-0764f731 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.tui-search-container .tui-search-tabs-item.data-v-0764f731 {
|
||||
padding: 10px 0;
|
||||
margin: 0 10px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tui-search-container .tui-search-tabs-item-selected.data-v-0764f731 {
|
||||
color: #007aff;
|
||||
border-bottom: 2px solid #007aff;
|
||||
}
|
||||
.tui-search-container .tui-search-time.data-v-0764f731 {
|
||||
width: 100%;
|
||||
height: 43px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.tui-search-container .tui-search-time-item.data-v-0764f731 {
|
||||
height: calc(100% - 20px);
|
||||
padding: 5px;
|
||||
margin: 5px;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-search-container .tui-search-time-item-picker.data-v-0764f731 {
|
||||
display: flex;
|
||||
}
|
||||
.tui-search-container .tui-search-time-item-close.data-v-0764f731, .tui-search-container .tui-search-time-item-all.data-v-0764f731 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-search-container .tui-search-time-item-selected.data-v-0764f731 {
|
||||
background-color: rgba(0, 122, 255, 0.2);
|
||||
}
|
||||
.tui-search-container-h5.data-v-0764f731 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-search-container-h5 .tui-search-container-h5-main.data-v-0764f731 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-search-container-h5 .tui-search-container-h5-main .tui-search-tabs .tui-search-tabs-item.data-v-0764f731 {
|
||||
cursor: none;
|
||||
}
|
||||
.tui-search-container-h5 .tui-search-container-h5-main .tui-search-time.data-v-0764f731 {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.tui-search-container-h5 .tui-search-container-h5-main .tui-search-time .tui-search-time-item.data-v-0764f731 {
|
||||
cursor: none;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tui-search-container-h5 .tui-search-container-h5-main .tui-search-time .tui-search-time-item-selected.data-v-0764f731 {
|
||||
background-color: rgba(0, 122, 255, 0.2);
|
||||
}
|
||||
Reference in New Issue
Block a user