diff --git a/api/apiT.js b/api/apiT.js
index 39c8386..8b6d18e 100644
--- a/api/apiT.js
+++ b/api/apiT.js
@@ -1,6 +1,6 @@
// const baseUrl = "https://api.collect.hs.hnzhwlkj.club/"; //这里放置url域名32044
// const baseUrl = "https://api.collect.xyh.muzili.top/"; //这里放置url域名32044
-const baseUrl = "https://bsh.info.hb.hnzhwlkj.cn/"; //这里放置url域名32044
+const baseUrl = "https://fdesk.hnxinyouhe.com/"; //这里放置url域名32044
// const baseUrl = "https://114.215.24.240:8106/api/v1/"; //这里放置url域名32044
export function request(options){//封装的requset
let { url,data,method } = options;
@@ -13,7 +13,7 @@ export function request(options){//封装的requset
uni.request({//这里是uniapp网络请求的api
url: baseUrl + url, //仅为示例,并非真实接口地址。
data,
- header:{'content-type': 'application/x-www-form-urlencoded','Fdesk-Auth-Token': 'Bearer ' + uni.getStorageSync('token'),'Fdesk-Language': uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):'zh','Fdesk-Login-Type': 'wechat','Fdesk-System-Code':'wechat'},
+ header:{'Fdesk-Corp-Abbr':uni.getStorageSync('corp_abbr'),'Fdesk-Auth-Token': 'Bearer ' + uni.getStorageSync('token'),'Fdesk-Language': uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):'zh','Fdesk-Login-Type': 'feishu','Fdesk-System-Code':'fdesk','is_mob':1},
method:method||"GET",//默认请求方式是get
success: (res) => {
uni.hideLoading();
diff --git a/manifest.json b/manifest.json
index 8f1a7df..a33f6b4 100644
--- a/manifest.json
+++ b/manifest.json
@@ -5,7 +5,7 @@
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
- "locale" : "en", // 设置默认语言,
+ "locale" : "zh-Hans", // 设置默认语言,
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
diff --git a/pages.json b/pages.json
index 3961dff..e87b8b5 100644
--- a/pages.json
+++ b/pages.json
@@ -3,10 +3,10 @@
// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
- "path": "pages/index/index",
+ "path" : "pages/login/index",
"style" :
{
- "navigationBarTitleText": "首页",
+ "navigationBarTitleText": "登录",
"enablePullDownRefresh": true,
"navigationStyle":"custom",// 去掉微信小程序顶部导航
"app-plus":{
@@ -18,10 +18,10 @@
}
}
},{
- "path" : "pages/login/index",
+ "path": "pages/index/index",
"style" :
{
- "navigationBarTitleText": "登录",
+ "navigationBarTitleText": "首页",
"enablePullDownRefresh": true,
"navigationStyle":"custom",// 去掉微信小程序顶部导航
"app-plus":{
@@ -51,6 +51,15 @@
"navigationStyle":"custom"
}
},
+ {
+ "path" : "pages/borrow/return_edit",
+ "style" :
+ {
+ "navigationBarTitleText": "编辑归还",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
{
"path" : "pages/borrow/borrow_list",
"style" :
@@ -78,6 +87,15 @@
"navigationStyle":"custom"
}
},
+ {
+ "path" : "pages/borrow/borrow_edit",
+ "style" :
+ {
+ "navigationBarTitleText" : "编辑",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
{
"path" : "pages/stock/stock_list",
"style" :
@@ -86,6 +104,69 @@
"enablePullDownRefresh": true,
"navigationStyle":"custom"
}
+ },
+ {
+ "path" : "pages/login/feishu-callback",
+ "style" :
+ {
+ "navigationBarTitleText" : "飞书",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
+ {
+ "path" : "pages/approval/borrow_approval",
+ "style" :
+ {
+ "navigationBarTitleText" : "借用审核",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
+ {
+ "path" : "pages/approval/return_approval",
+ "style" :
+ {
+ "navigationBarTitleText" : "归还审核",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
+ {
+ "path" : "pages/approval/borrow_approval_detils",
+ "style" :
+ {
+ "navigationBarTitleText" : "审核借用",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
+ {
+ "path" : "pages/approval/borrow_approval_detail",
+ "style" :
+ {
+ "navigationBarTitleText" : "审核详情",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
+ {
+ "path" : "pages/approval/return_approval_detils",
+ "style" :
+ {
+ "navigationBarTitleText" : "审核归还",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
+ },
+ {
+ "path" : "pages/approval/return_approval_detail",
+ "style" :
+ {
+ "navigationBarTitleText" : "归还审核详情",
+ "enablePullDownRefresh": true,
+ "navigationStyle":"custom"
+ }
}
],
"subPackages":[],
diff --git a/pages/approval/borrow_approval.vue b/pages/approval/borrow_approval.vue
new file mode 100644
index 0000000..46da02b
--- /dev/null
+++ b/pages/approval/borrow_approval.vue
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+
+
+ {{ tab }}
+
+
+
+
+
+
+
+
+
+ {{ getStatusText(item.status) }}
+
+
+
+
+
+
+
+
+ 申请人: {{ item.applicant_name }}
+ 借用时间: {{ item.use_start_date || '-' }} ~ {{ item.use_end_date || '-' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/approval/borrow_approval_detail.vue b/pages/approval/borrow_approval_detail.vue
new file mode 100644
index 0000000..d5433cc
--- /dev/null
+++ b/pages/approval/borrow_approval_detail.vue
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+ 借用信息
+
+ {{ statusText }}
+
+
+
+ 单号{{ detail.order_no || '-' }}
+ 申请人{{ detail.applicant_name || '-' }}
+
+ 借用时间
+ {{ detail.use_start_date || '-' }} ~ {{ detail.use_end_date || '-' }}
+
+ 借用事由{{ detail.borrow_reason || '-' }}
+
+ 备注
+ {{ detail.remark || '-' }}
+
+
+
+
+
+
+ 物品明细
+
+
+ 暂无物品
+
+
+
+ {{ it.item_name_snap || '-' }}
+ 规格:{{ it.spec_model_snap }}
+
+
+ 申请数量
+ {{ it.request_qty || 0 }}
+
+
+
+
+
+
+
+ 申请附件
+
+
+
+
+
+
+
+
+
+ 审核信息
+
+ 审核人{{ detail.audit_info.handler_name || '-' }}
+ 审核时间{{ detail.audit_info.handle_time || '-' }}
+
+ 审核意见
+ {{ detail.audit_info.handle_remark }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/approval/borrow_approval_detils.vue b/pages/approval/borrow_approval_detils.vue
new file mode 100644
index 0000000..5740973
--- /dev/null
+++ b/pages/approval/borrow_approval_detils.vue
@@ -0,0 +1,450 @@
+
+
+
+
+
+
+
+
+ 借用信息
+
+ {{ statusText }}
+
+
+
+ 单号{{ detail.order_no || '-' }}
+ 申请人{{ detail.applicant_name || '-' }}
+
+ 借用时间
+ {{ detail.use_start_date || '-' }} ~ {{ detail.use_end_date || '-' }}
+
+ 借用事由{{ detail.borrow_reason || '-' }}
+
+ 备注
+ {{ detail.remark || '-' }}
+
+
+
+
+
+
+ 物品明细
+
+
+ 暂无物品
+
+
+
+ {{ it.requisition_item_name }}
+ 规格:{{ it.spec_model_snap }}
+
+
+ 申请数量
+ {{ it.request_qty }}
+
+
+
+
+
+
+
+ 申请附件
+
+
+
+
+
+
+
+
+
+ 审核意见
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/approval/return_approval.vue b/pages/approval/return_approval.vue
new file mode 100644
index 0000000..f74c6fd
--- /dev/null
+++ b/pages/approval/return_approval.vue
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+ {{ tab }}
+
+
+
+
+
+
+
+
+
+ {{ getStatusText(item.status) }}
+
+
+
+
+
+
+
+
+ 申请人: {{ item.apply_user_name }}
+ 归还时间: {{ item.return_at || '-' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/approval/return_approval_detail.vue b/pages/approval/return_approval_detail.vue
new file mode 100644
index 0000000..509c3df
--- /dev/null
+++ b/pages/approval/return_approval_detail.vue
@@ -0,0 +1,308 @@
+
+
+
+
+
+
+
+
+ 归还信息
+
+ {{ statusText }}
+
+
+
+ 申请人{{ detail.apply_user_name || '-' }}
+ 归还时间{{ detail.return_at || '-' }}
+
+ 归还备注
+ {{ detail.apply_remark || '-' }}
+
+
+
+
+
+
+ 归还物品
+
+
+ 暂无物品
+
+
+
+ {{ it.item_name || '-' }}
+ 规格:{{ it.spec_model }}
+
+
+ 归还数量
+ {{ detail.return_qty || 0 }}
+
+
+
+
+
+
+
+ 借用信息
+
+
+ 申请人{{ borrowDetail.applicant_name || '-' }}
+ 借用时间{{ borrowDetail.use_start_date || '-' }} ~ {{ borrowDetail.use_end_date || '-' }}
+
+ 借用事由
+ {{ borrowDetail.borrow_reason || '-' }}
+
+
+
+
+
+
+ 借用物品明细
+
+
+ 暂无物品
+
+
+
+ {{ it.item_name_snap || '-' }}
+ 耗材
+
+
+
+ 数量
+ {{ safeNum(it.request_qty) }}
+
+
+
+
+
+
+
+
+ 审核信息
+
+ 审核人{{ detail.audit_info.handler_name || '-' }}
+ 审核时间{{ detail.audit_info.handle_time || '-' }}
+
+ 审核意见
+ {{ detail.audit_info.handle_remark }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/approval/return_approval_detils.vue b/pages/approval/return_approval_detils.vue
new file mode 100644
index 0000000..32d66c6
--- /dev/null
+++ b/pages/approval/return_approval_detils.vue
@@ -0,0 +1,348 @@
+
+
+
+
+
+
+
+
+ 归还信息
+
+ {{ statusText }}
+
+
+
+ 申请人{{ detail.apply_user_name || '-' }}
+ 归还时间{{ detail.return_at || '-' }}
+
+ 归还备注
+ {{ detail.apply_remark || '-' }}
+
+
+
+
+
+
+ 归还物品
+
+
+ 暂无物品
+
+
+
+ {{ it.item_name }}
+ 规格:{{ it.spec_model }}
+
+
+ 归还数量
+ {{ detail.return_qty || 0 }}
+
+
+
+
+
+
+
+ 审核意见
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/borrow/borrow.vue b/pages/borrow/borrow.vue
index 19e62e4..6e8c4ed 100644
--- a/pages/borrow/borrow.vue
+++ b/pages/borrow/borrow.vue
@@ -1,103 +1,108 @@
-
+
申请人:
- {{ formData.applicant || '犇犇' }}
+ {{ userinfo.name || '犇犇' }}
公司名称:
- {{ formData.companyName || '合塑' }}
+ {{ userinfo.corp_name || '合塑' }}
-
+
-
借用时间
-
- {{ formData.borrowTime || '请选择时间' }}
+
+ {{ formData.use_start_date || '请选择时间' }}
-
+
-
-
+
+
+
计划归还时间
-
- {{ formData.returnTime || '请选择时间' }}
+
+ {{ formData.use_end_date || '请选择时间' }}
-
+
-
-
-
- 物品名称
-
-
-
+
+
+
+ 物品
+
-
-
-
-
- 物品所属公司
-
-
+
+
+
+ 物品 {{ idx + 1 }}
+
+
+
+
+ onItemNameChange(e, idx)">
+
+ {{it.item_name_snap || '请选择物品'}}
+
+
+
+
+
+
+
- 借用事由
+ 借用事由
+
备注
-
+
+
- 附件
-
-
-
+ 附件
+
+
+
+
+
+
+
-
-
+
+
diff --git a/pages/borrow/borrow_list - 副本 (2).vue b/pages/borrow/borrow_list - 副本 (2).vue
index b3f672e..93a07ab 100644
--- a/pages/borrow/borrow_list - 副本 (2).vue
+++ b/pages/borrow/borrow_list - 副本 (2).vue
@@ -223,10 +223,10 @@
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
- top: -5px;
- right: -24px;
- width: 75px;
- height: 37px;
+ top: -4px;
+ right: -32px;
+ width: 100px;
+ height: 47px;
background: #4CAF50;
transform: rotate(45deg);
z-index: 10;
diff --git a/pages/borrow/borrow_list - 副本.vue b/pages/borrow/borrow_list - 副本.vue
index ee34e94..cbd1487 100644
--- a/pages/borrow/borrow_list - 副本.vue
+++ b/pages/borrow/borrow_list - 副本.vue
@@ -221,10 +221,10 @@
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
- top: -5px;
- right: -24px;
- width: 75px;
- height: 37px;
+ top: -4px;
+ right: -32px;
+ width: 100px;
+ height: 47px;
background: #4CAF50;
transform: rotate(45deg);
z-index: 10;
diff --git a/pages/borrow/borrow_list.vue b/pages/borrow/borrow_list.vue
index 7c44228..b29b56d 100644
--- a/pages/borrow/borrow_list.vue
+++ b/pages/borrow/borrow_list.vue
@@ -1,6 +1,6 @@
-
+
@@ -21,9 +21,8 @@
@@ -32,26 +31,29 @@
- {{ item.itemName }}
-
- 申请人: {{ item.applicant }}
- 借用时间: {{ item.borrowTime }}
-
- 公司名称: {{ item.companyName }}
-
-
-
-
+
+
+
+
+ 申请人: {{ item.applicant_name }}
+ 借用时间: {{ item.use_start_date || '-' }} ~ {{ item.use_end_date || '-' }}
+
+
+
+
+
+
+
+
-
-
@@ -61,55 +63,23 @@
\ No newline at end of file
diff --git a/pages/borrow/review.vue b/pages/borrow/review.vue
index 6cd32f7..98c9f1f 100644
--- a/pages/borrow/review.vue
+++ b/pages/borrow/review.vue
@@ -38,7 +38,7 @@
{{ formData.borrowTime || '请选择时间' }}
-
+
@@ -62,7 +62,7 @@
{{ formData.returnTime || '请选择时间' }}
-
+
@@ -127,7 +127,7 @@
{{ formData.returnTime || '请选择时间' }}
-
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index cb7f8a2..6034e75 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -8,6 +8,7 @@
{{listItem.title}}
@@ -31,7 +32,7 @@
备货单
@@ -51,19 +52,21 @@
return {
list: [
{
- title: '备货单审批'
+ title: '备货单审批',
+ url:''
},
{
- title: '备货单审批'
+ title: '借用审批',
+ url:'/pages/approval/borrow_approval'
},
{
- title: '备货单审批'
- },
+ title: '归还审批',
+ url:'/pages/approval/return_approval'
+ }
+ ],
+ list2: [
{
- title: '备货单审批'
- },
- {
- title: '备货单审批'
+ title: '备货单'
}
],
bannerList: [],
@@ -71,11 +74,21 @@
}
},
onLoad() {
- if (!uni.getStorageSync('token')) {}
+ if (uni.getStorageSync('token')) {
+ this.getinfo()
+ }
},
onShow() {
},
methods: {
+ getinfo(){
+ request({
+ url:'common/user/info',
+ method:'get',
+ }).then(res => {
+ this.userinfo=res.data.data.user
+ })
+ },
navTo(url) {
uni.navigateTo({
url: url
diff --git a/pages/login/feishu-callback.vue b/pages/login/feishu-callback.vue
new file mode 100644
index 0000000..fe0a088
--- /dev/null
+++ b/pages/login/feishu-callback.vue
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+ {{ title }}
+ {{ desc }}{{ dots }}
+
+
+
+
+
+
+
+
+ 登录失败
+ {{ errorMsg }}
+
+
+
+
+
+
+
+
+
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 074da0a..65630eb 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -1,263 +1,212 @@
-
-
-
-
- 2025 USED CAR
-
- 河南合塑实业有限公司
-
-
-
-
\ No newline at end of file
+
+ .spinner {
+ width: 88rpx;
+ height: 88rpx;
+ border-radius: 50%;
+ border: 8rpx solid rgba(48, 116, 247, 0.18);
+ border-top-color: rgba(48, 116, 247, 1);
+ animation: spin 0.9s linear infinite;
+ margin-bottom: 24rpx;
+ }
+
+ .text-wrap {
+ text-align: center;
+ }
+
+ .title {
+ display: block;
+ font-size: 34rpx;
+ color: #1f2937;
+ font-weight: 600;
+ margin-bottom: 8rpx;
+ }
+
+ .desc {
+ display: block;
+ font-size: 26rpx;
+ color: #6b7280;
+ }
+
+ .dots {
+ display: inline-block;
+ width: 40rpx; /* 固定宽度避免文字抖动 */
+ text-align: left;
+ }
+
+ .progress {
+ width: 100%;
+ height: 10rpx;
+ border-radius: 999rpx;
+ background: rgba(48, 116, 247, 0.10);
+ overflow: hidden;
+ margin-top: 26rpx;
+ }
+
+ .progress .bar {
+ height: 100%;
+ width: 40%;
+ border-radius: 999rpx;
+ background: rgba(48, 116, 247, 0.55);
+ animation: move 1.1s ease-in-out infinite;
+ }
+
+ @keyframes spin {
+ to { transform: rotate(360deg); }
+ }
+
+ @keyframes move {
+ 0% { transform: translateX(-60%); }
+ 50% { transform: translateX(140%); }
+ 100% { transform: translateX(-60%); }
+ }
+
diff --git a/pages/stock/stock_list.vue b/pages/stock/stock_list.vue
index 5934dd6..796b929 100644
--- a/pages/stock/stock_list.vue
+++ b/pages/stock/stock_list.vue
@@ -222,10 +222,10 @@
// 状态标签(旋转丝带效果)
.status-ribbon {
position: absolute;
- top: -5px;
- right: -24px;
- width: 75px;
- height: 37px;
+ top: -4px;
+ right: -32px;
+ width: 100px;
+ height: 47px;
background: #08A400;
transform: rotate(45deg);
z-index: 10;
diff --git a/uni_modules/uni-data-select/changelog.md b/uni_modules/uni-data-select/changelog.md
index 016e3d2..1681eae 100644
--- a/uni_modules/uni-data-select/changelog.md
+++ b/uni_modules/uni-data-select/changelog.md
@@ -1,3 +1,15 @@
+## 1.1.0(2025-08-19)
+- 新增 插槽 selected empty option
+- 新增 mutiple 属性,支持多选功能
+- 新增 wrap 属性,支持选中的文字超过一行显示
+- 新增 align 属性,支持修改选中的文字显示的位置
+- 新增 hideRight 属性,支持隐藏右侧所有按钮
+- 新增 mode 属性,支持修改边框样式
+- 新增 事件 open close clear
+## 1.0.10(2025-04-14)
+- 修复 清除按钮不展示问题
+## 1.0.9(2025-03-26)
+- 优化 默认背景为白色与整体组件保持风格统一
## 1.0.8(2024-03-28)
- 修复 在vue2下:style动态绑定导致编译失败的bug
## 1.0.7(2024-01-20)
diff --git a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue
index edab65a..ce7dbc9 100644
--- a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue
+++ b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue
@@ -2,30 +2,60 @@
{{label + ':'}}
-
-
- {{textShow}}
- {{typePlaceholder}}
-
+
+
+
+
+
+
+
+
+ {{textShow}}
+
+ {{typePlaceholder}}
+
+
-
+
-
-
-
-
- {{emptyTips}}
-
-
- {{formatItemName(item)}}
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{emptyTips}}
+
+
+
+
+
+
+
+
+
+ {{formatItemName(item)}}
+
+
+
+
+
+
+
+
+
@@ -36,22 +66,56 @@
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
- * @property {String} value 默认值
+ * @property {String|Array} value 默认值,多选时为数组
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @property {Boolean} disabled 是否禁用
+ * @property {Boolean} multiple 是否多选模式
+ * @property {Boolean} wrap 是否允许选中文本换行显示
* @property {String} placement 弹出位置
* @value top 顶部弹出
* @value bottom 底部弹出(default)
+ * @property {String} align 选择文字的位置
+ * @value left 显示左侧
+ * @value center 显示中间
+ * @value right 显示 右侧
+ * @property {Boolean} hideRight 是否隐藏右侧按钮
+ * @property {String} mode 边框样式
+ * @value default 四周边框
+ * @value underline 下边框
+ * @value none 无边框
* @event {Function} change 选中发生变化触发
+ * @event {Function} open 选择框开启时触发
+ * @event {Function} close 选择框关闭时触发
+ * @event {Function} clear 点击清除按钮之后触发
*/
export default {
name: "uni-data-select",
mixins: [uniCloud.mixinDatacom || {}],
+ emits: [
+ 'open',
+ 'close',
+ 'update:modelValue',
+ 'input',
+ 'clear',
+ 'change'
+ ],
+ model: {
+ prop: 'modelValue',
+ event: 'update:modelValue'
+ },
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
props: {
localdata: {
type: Array,
@@ -60,11 +124,11 @@
}
},
value: {
- type: [String, Number],
+ type: [String, Number, Array],
default: ''
},
modelValue: {
- type: [String, Number],
+ type: [String, Number, Array],
default: ''
},
label: {
@@ -99,7 +163,27 @@
placement: {
type: String,
default: 'bottom'
- }
+ },
+ multiple: {
+ type: Boolean,
+ default: false
+ },
+ wrap: {
+ type: Boolean,
+ default: false
+ },
+ align:{
+ type: String,
+ default: "left"
+ },
+ hideRight: {
+ type: Boolean,
+ default: false
+ },
+ mode:{
+ type: String,
+ default: 'default'
+ }
},
data() {
return {
@@ -133,20 +217,35 @@
common
},
valueCom() {
- // #ifdef VUE3
- return this.modelValue;
- // #endif
- // #ifndef VUE3
- return this.value;
- // #endif
+ if (this.value === '') return this.modelValue
+ if (this.modelValue === '') return this.value
+ return this.value
},
textShow() {
// 长文本显示
- let text = this.current;
- if (text.length > 10) {
- return text.slice(0, 25) + '...';
+ if (this.multiple) {
+ const currentValues = this.getCurrentValues();
+ if (Array.isArray(currentValues) && currentValues.length > 0) {
+ const selectedItems = this.mixinDatacomResData.filter(item => currentValues.includes(item.value));
+ return selectedItems.map(item => this.formatItemName(item)).join(', ');
+ } else {
+ return ''; // 空数组时返回空字符串,显示占位符
+ }
+ } else {
+ return this.current;
}
- return text;
+ },
+ shouldShowClear() {
+ if (this.multiple) {
+ const currentValues = this.getCurrentValues();
+ return Array.isArray(currentValues) && currentValues.length > 0;
+ } else {
+ return !!this.current;
+ }
+ },
+ shouldWrap() {
+ // 只有在多选模式、开启换行、且有内容时才应用换行样式
+ return this.multiple && this.wrap && !!this.textShow;
},
getOffsetByPlacement() {
switch (this.placement) {
@@ -155,10 +254,38 @@
case 'bottom':
return "top:calc(100% + 12px);";
}
+ },
+ slotSelected(){
+ // #ifdef VUE2
+ return this.$scopedSlots ? this.$scopedSlots.selected : false
+ // #endif
+ // #ifdef VUE3
+ return this.$slots ? this.$slots.selected : false
+ // #endif
+ },
+ slotEmpty(){
+ // #ifdef VUE2
+ return this.$scopedSlots ? this.$scopedSlots.empty : false
+ // #endif
+ // #ifdef VUE3
+ return this.$slots ? this.$slots.empty : false
+ // #endif
+ },
+ slotOption(){
+ // #ifdef VUE2
+ return this.$scopedSlots ? this.$scopedSlots.option : false
+ // #endif
+ // #ifdef VUE3
+ return this.$slots ? this.$slots.option : false
+ // #endif
}
},
-
watch: {
+ showSelector:{
+ handler(val,old){
+ val ? this.$emit('open') : this.$emit('close')
+ }
+ },
localdata: {
immediate: true,
handler(val, old) {
@@ -178,9 +305,20 @@
}
}
},
-
},
methods: {
+ getSelectedItems() {
+ const currentValues = this.getCurrentValues();
+ let _minxData = this.mixinDatacomResData
+ // #ifdef MP-WEIXIN || MP-TOUTIAO
+ _minxData = JSON.parse(JSON.stringify(this.mixinDatacomResData))
+ // #endif
+ if (this.multiple) {
+ return _minxData.filter(item => currentValues.includes(item.value)) || [];
+ } else {
+ return _minxData.filter(item => item.value === currentValues) || [];
+ }
+ },
debounce(fn, time = 100) {
let timer = null
return function(...args) {
@@ -190,6 +328,23 @@
}, time)
}
},
+ // 检查项目是否已选中
+ isSelected(item) {
+ if (this.multiple) {
+ const currentValues = this.getCurrentValues();
+ return Array.isArray(currentValues) && currentValues.includes(item.value);
+ } else {
+ return this.getCurrentValues() === item.value;
+ }
+ },
+ // 获取当前选中的值
+ getCurrentValues() {
+ if (this.multiple) {
+ return Array.isArray(this.valueCom) ? this.valueCom : (this.valueCom ? [this.valueCom] : []);
+ } else {
+ return this.valueCom;
+ }
+ },
// 执行数据库查询
query() {
this.mixinDatacomEasyGet();
@@ -201,7 +356,7 @@
}
},
initDefVal() {
- let defValue = ''
+ let defValue = this.multiple ? [] : ''
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
defValue = this.valueCom
} else {
@@ -212,47 +367,105 @@
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
- let defItem = ''
+ let defItem = this.multiple ? [] : ''
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
- defItem = this.mixinDatacomResData[this.defItem - 1].value
+ defItem = this.multiple ? [this.mixinDatacomResData[this.defItem - 1].value] : this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
- if (defValue || defValue === 0) {
+ if (defValue || defValue === 0 || (this.multiple && Array.isArray(defValue) && defValue.length > 0)) {
this.emit(defValue)
}
}
- const def = this.mixinDatacomResData.find(item => item.value === defValue)
- this.current = def ? this.formatItemName(def) : ''
+
+ if (this.multiple) {
+ const selectedValues = Array.isArray(defValue) ? defValue : (defValue ? [defValue] : []);
+ const selectedItems = this.mixinDatacomResData.filter(item => selectedValues.includes(item.value));
+ this.current = selectedItems.map(item => this.formatItemName(item));
+ } else {
+ const def = this.mixinDatacomResData.find(item => item.value === defValue)
+ this.current = def ? this.formatItemName(def) : ''
+ }
},
/**
- * @param {[String, Number]} value
+ * @param {[String, Number, Array]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
- let isDisabled = false;
-
- this.mixinDatacomResData.forEach(item => {
- if (item.value === value) {
- isDisabled = item.disable
- }
- })
-
- return isDisabled;
+ if (Array.isArray(value)) {
+ // 对于数组,如果任意一个值被禁用,则认为整体被禁用
+ return value.some(val => {
+ return this.mixinDatacomResData.some(item => item.value === val && item.disable);
+ });
+ } else {
+ let isDisabled = false;
+ this.mixinDatacomResData.forEach(item => {
+ if (item.value === value) {
+ isDisabled = item.disable
+ }
+ })
+ return isDisabled;
+ }
},
-
clearVal() {
- this.emit('')
+ const emptyValue = this.multiple ? [] : '';
+ this.emit(emptyValue)
+ this.current = this.multiple ? [] : ''
if (this.collection) {
this.removeCache()
}
+ this.$emit('clear')
+ },
+ checkBoxChange(res){
+ let range = res.detail.value
+
+ let currentValues = range && range.length > 0? range.map((item)=>{
+ const index = parseInt(item, 10);
+
+ if (isNaN(index)) {
+ console.error(`无效索引: ${item}`);
+ }
+
+ if (index < 0 || index >= this.mixinDatacomResData.length) {
+ console.error(`索引越界: ${index}`);
+ }
+
+ return this.mixinDatacomResData[index].value;
+ }) : []
+ const selectedItems = this.mixinDatacomResData.filter(dataItem => currentValues.includes(dataItem.value));
+ this.current = selectedItems.map(dataItem => this.formatItemName(dataItem));
+
+ this.emit(currentValues);
},
change(item) {
if (!item.disable) {
- this.showSelector = false
- this.current = this.formatItemName(item)
- this.emit(item.value)
+ if (this.multiple) {
+ // 多选模式
+ let currentValues = this.getCurrentValues();
+ if (!Array.isArray(currentValues)) {
+ currentValues = currentValues ? [currentValues] : [];
+ }
+
+ const itemValue = item.value;
+ const index = currentValues.indexOf(itemValue);
+
+ if (index > -1) {
+ currentValues.splice(index, 1);
+ } else {
+ currentValues.push(itemValue);
+ }
+
+ const selectedItems = this.mixinDatacomResData.filter(dataItem => currentValues.includes(dataItem.value));
+ this.current = selectedItems.map(dataItem => this.formatItemName(dataItem));
+
+ this.emit(currentValues);
+ } else {
+ // 单选模式
+ this.showSelector = false
+ this.current = this.formatItemName(item)
+ this.emit(item.value)
+ }
}
},
emit(val) {
@@ -330,6 +543,11 @@
$uni-main-color: #333 !default;
$uni-secondary-color: #909399 !default;
$uni-border-3: #e5e5e5;
+ $uni-primary: #2979ff !default;
+ $uni-success: #4cd964 !default;
+ $uni-warning: #f0ad4e !default;
+ $uni-error: #dd524d !default;
+ $uni-info: #909399 !default;
/* #ifndef APP-NVUE */
@media screen and (max-width: 500px) {
@@ -352,6 +570,7 @@
}
.uni-stat-box {
+ background-color: #fff;
width: 100%;
flex: 1;
}
@@ -370,9 +589,16 @@
margin-right: 5px;
}
+ .border-bottom {
+ border-bottom: solid 1px $uni-border-3;
+ }
+
+ .border-default {
+ border: 1px solid $uni-border-3;
+ }
+
.uni-select {
font-size: 14px;
- border: 1px solid $uni-border-3;
box-sizing: border-box;
border-radius: 4px;
padding: 0 5px;
@@ -384,15 +610,20 @@
/* #endif */
flex-direction: row;
align-items: center;
- border-bottom: solid 1px $uni-border-3;
width: 100%;
flex: 1;
- height: 35px;
+ min-height: 35px;
&--disabled {
background-color: #f5f7fa;
cursor: not-allowed;
}
+
+ &--wrap {
+ height: auto;
+ min-height: 35px;
+ // align-items: flex-start;
+ }
}
.uni-select__label {
@@ -404,7 +635,8 @@
}
.uni-select__input-box {
- height: 35px;
+ // height: 35px;
+ width: 0px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
@@ -412,6 +644,24 @@
flex: 1;
flex-direction: row;
align-items: center;
+
+ &--wrap {
+ .uni-select__input-text {
+ margin-right: 8px;
+ }
+ }
+
+ .padding-top-bottom {
+ padding-top: 5px;
+ padding-bottom: 5px;
+ }
+
+ .slot-content {
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ }
}
.uni-select__input {
@@ -463,15 +713,18 @@
display: flex;
cursor: pointer;
/* #endif */
+ flex-direction: row;
+ align-items: center;
line-height: 35px;
font-size: 14px;
- text-align: center;
/* border-bottom: solid 1px $uni-border-3; */
padding: 0px 10px;
}
- .uni-select__selector-item:hover {
- background-color: #f9f9f9;
+
+
+ .uni-select__selector-item-check {
+ margin-left: auto;
}
.uni-select__selector-empty:last-child,
@@ -490,15 +743,14 @@
.uni-popper__arrow_bottom,
.uni-popper__arrow_bottom::after,
.uni-popper__arrow_top,
- .uni-popper__arrow_top::after,
- {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
- border-width: 6px;
+ .uni-popper__arrow_top::after {
+ position: absolute;
+ display: block;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+ border-width: 6px;
}
.uni-popper__arrow_bottom {
@@ -544,11 +796,22 @@
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
+
+ &--wrap {
+ white-space: normal;
+ text-overflow: initial;
+ -o-text-overflow: initial;
+ overflow: visible;
+ word-wrap: break-word;
+ word-break: break-all;
+ // line-height: 1.5;
+ }
}
.uni-select__input-placeholder {
color: $uni-base-color;
font-size: 12px;
+ margin: 1px 0;
}
.uni-select--mask {
@@ -559,4 +822,17 @@
left: 0;
z-index: 2;
}
+
+ .align-left {
+ text-align: left;
+ }
+
+ .align-center {
+ text-align: center;
+ }
+
+ .align-right {
+ text-align: right;
+ }
+
diff --git a/uni_modules/uni-data-select/package.json b/uni_modules/uni-data-select/package.json
index 5864594..4033502 100644
--- a/uni_modules/uni-data-select/package.json
+++ b/uni_modules/uni-data-select/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器",
- "version": "1.0.8",
+ "version": "1.1.0",
"description": "通过数据驱动的下拉框选择器",
"keywords": [
"uni-ui",
@@ -12,12 +12,14 @@
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
- "HBuilderX": "^3.1.1"
+ "HBuilderX": "^3.1.1",
+ "uni-app": "^4.45",
+ "uni-app-x": ""
},
"directories": {
"example": "../../temps/example_temps"
},
-"dcloudext": {
+ "dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -35,52 +37,70 @@
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
- "type": "component-vue"
+ "type": "component-vue",
+ "darkmode": "x",
+ "i18n": "x",
+ "widescreen": "x"
},
"uni_modules": {
- "dependencies": ["uni-load-more"],
+ "dependencies": [
+ "uni-load-more"
+ ],
"encrypt": [],
"platforms": {
"cloud": {
- "tcb": "y",
- "aliyun": "y",
- "alipay": "n"
+ "tcb": "√",
+ "aliyun": "√",
+ "alipay": "√"
},
"client": {
- "App": {
- "app-vue": "u",
- "app-nvue": "n"
+ "uni-app": {
+ "vue": {
+ "vue2": "√",
+ "vue3": "√"
+ },
+ "web": {
+ "safari": "√",
+ "chrome": "√"
+ },
+ "app": {
+ "vue": "√",
+ "nvue": "-",
+ "android": "√",
+ "ios": "√",
+ "harmony": "√"
+ },
+ "mp": {
+ "weixin": "√",
+ "alipay": "√",
+ "toutiao": "√",
+ "baidu": "-",
+ "kuaishou": "-",
+ "jd": "-",
+ "harmony": "-",
+ "qq": "-",
+ "lark": "-"
+ },
+ "quickapp": {
+ "huawei": "-",
+ "union": "-"
+ }
},
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u",
- "京东": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "y"
+ "uni-app-x": {
+ "web": {
+ "safari": "-",
+ "chrome": "-"
+ },
+ "app": {
+ "android": "-",
+ "ios": "-",
+ "harmony": "-"
+ },
+ "mp": {
+ "weixin": "-"
+ }
}
}
}
}
-}
+}
\ No newline at end of file
diff --git a/uni_modules/uni-load-more/changelog.md b/uni_modules/uni-load-more/changelog.md
index 667abdb..c5750ac 100644
--- a/uni_modules/uni-load-more/changelog.md
+++ b/uni_modules/uni-load-more/changelog.md
@@ -1,9 +1,7 @@
+## 1.3.7(2025-08-20)
+- 修复 微信小程序css警告问题
## 1.3.6(2024-10-15)
- 修复 微信小程序中的getSystemInfo警告
-## 1.3.5(2024-10-12)
-- 修复 微信小程序中的getSystemInfo警告
-## 1.3.4(2024-10-12)
-- 修复 微信小程序中的getSystemInfo警告
## 1.3.3(2022-01-20)
- 新增 showText属性 ,是否显示文本
## 1.3.2(2022-01-19)
diff --git a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
index a203417..0fa17e8 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
+++ b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
@@ -26,7 +26,7 @@
-
+