From 49dfdd3bf265db28d38167f34e9aabfdd3e8e5db Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 17 十月 2025 10:16:58 +0800
Subject: [PATCH] imagebutton
---
pages/modal/ms_classAttr.vue | 322 ++++++++++++-----------------------------------------
1 files changed, 76 insertions(+), 246 deletions(-)
diff --git a/pages/modal/ms_classAttr.vue b/pages/modal/ms_classAttr.vue
index 61959ae..dafdc53 100644
--- a/pages/modal/ms_classAttr.vue
+++ b/pages/modal/ms_classAttr.vue
@@ -1,5 +1,5 @@
<template>
- <view class="content">
+ <view class="content" :class="largeMode?'large-mode':''">
<!-- 涓绘暟鎹�-->
<view class="v-area" v-for="(classattr,index) in classAttrList">
<div class="class_attr_title" style="display: none;">
@@ -662,13 +662,16 @@
dataObjDelele,
dataObjRunCustomEvent
} from "@/api/index.js"
-
+ import {showInfo,
+ showError,
+ showLoading} from "@/js/Page.js"
export default {
components: {
pickerAddress
},
data() {
return {
+ largeMode: getApp().globalData.largeMode || false,
title: '鏂板',
param: {},
focusField: "",
@@ -707,21 +710,13 @@
this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧
console.log(param);
if (!param.Master_Cls.View_Style) {
- uni.showModal({
- title: "鎻愮ず",
- content: "璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( "璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒")
+
return;
}
if (!param.Master_Cls.View_Style.Name) {
- uni.showModal({
- title: "鎻愮ず",
- content: "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒")
+
return;
}
this.param = param;
@@ -771,25 +766,16 @@
this.subClass_attr_init();
} catch (ex) {
- console.log(ex)
- uni.showModal({
- title: "閿欒1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒1")
+
}
},
scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this;
var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event;
if (!Before_Select_Event) {
- uni.showModal({
- title: "鎻愮ず",
- content: "閫夋嫨鍓嶄簨浠朵负绌猴紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("閫夋嫨鍓嶄簨浠朵负绌猴紒")
+
return;
}
var mast_attr = [];
@@ -799,12 +785,8 @@
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷�) {
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)')
@@ -859,13 +841,7 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( ar.DispName + '涓嶈兘涓虹┖锛�);
return;
}
}
@@ -951,12 +927,8 @@
var $this = this;
var After_Select_Event = $this.param.Scan_Code.After_Select_Event;
if (!After_Select_Event) {
- uni.showModal({
- title: "鎻愮ず",
- content: "閫夋嫨鍚庝簨浠朵负绌猴紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("閫夋嫨鍚庝簨浠朵负绌猴紒")
+
return;
}
var items = $this.check_list.items;
@@ -974,12 +946,8 @@
}
}
if (data.length == 0) {
- uni.showModal({
- title: "鎻愮ず",
- content: "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("鏈�鎷╂暟鎹紒")
+
return;
}
var mast_attr = [];
@@ -989,12 +957,8 @@
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷�) {
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
@@ -1048,22 +1012,13 @@
dataObjDelele(dataInfo).then(success => {
uni.hideLoading();
$this.subPanelList.splice(index, 1);
- uni.showModal({
- title: "鎻愮ず",
- content: "鍒犻櫎鎴愬姛锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("鍒犻櫎鎴愬姛锛�)
+
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: "鎻愮ず9.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒9.1")
});
}
},
@@ -1079,16 +1034,7 @@
return result
} catch (ex) {
// console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: "閿欒1.1",
- content: tip,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒1.1")
return []
};
},
@@ -1108,16 +1054,7 @@
} catch (ex) {
// console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: "閿欒1.2",
- content: tip,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒1.2")
return {}
};
},
@@ -1131,19 +1068,19 @@
//console.log(e.target)
this.focusOldField = `${e.target.dataset['index']}-${e.target.dataset['iindex']}`
getApp().onScan((result) => {
- //console.log(result.decodedata);
+ //console.log(result);
var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']].Value;
// if(!isVal){
- // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata;
+ // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result;
// var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value;
// return;
// }
//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
- if (isVal != result.decodedata) {
+ if (isVal != result) {
this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']]
- .Value = result.decodedata;
+ .Value = result;
uni.hideKeyboard();
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1171,13 +1108,13 @@
mast_attr: req,
inputParamter: [{
attr: 'mast_input_3037',
- value: result.decodedata
+ value: result
}]
}
this.scan_DataObjRunCustomEvent(info, "");
}
- if (result.decodedata) { //绗竴涓緭鍏ユ涓嶄负绌�+ if (result) { //绗竴涓緭鍏ユ涓嶄负绌� //鍒濆鍖栵紝涓嬩釜杈撳叆妗唂ocus灞炴�
const attrs = this.classAttrList[e.target.dataset['index']].Attr || []
var findd = false
@@ -1256,15 +1193,15 @@
subontap(e) { //鎵爜鍔熻兘
//console.log(e.target)
getApp().onScan((result) => {
- //console.log(result.decodedata);
+ //console.log(result);
var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e.target
.dataset[
'iindex']].Value;
//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
- if (isVal != result.decodedata) {
+ if (isVal != result) {
this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']]
- .Value = result.decodedata;
+ .Value = result;
uni.hideKeyboard();
//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1291,7 +1228,7 @@
mast_attr: [],
inputParamter: [{
attr: 'mast_input_3037',
- value: result.decodedata
+ value: result
}]
}
@@ -1303,16 +1240,16 @@
scan_ontap(e) { //鎵爜鍖烘壂鐮佸姛鑳� //console.log(e.target)
getApp().onScan((result) => {
- console.log(result.decodedata);
+ console.log(result);
var isflag = true;
for (var i in this.subPanelList) {
- if (this.subPanelList[i].scanCodeVal == result.decodedata)
+ if (this.subPanelList[i].scanCodeVal == result)
isflag = false;
}
//瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁
if (isflag) {
uni.hideKeyboard();
- this.scanCodeVal = result.decodedata;
+ this.scanCodeVal = result;
var eventid = this.param.Scan_Code.Input_Change_Event.ID;
if (eventid) {
var mast_req = [];
@@ -1787,21 +1724,13 @@
var before_click_button = $this.classAttrList[index].Attr[iindex].before_click_button;
var button_callback = $this.classAttrList[index].Attr[iindex].button_callback;
if (!before_click_button) {
- uni.showModal({
- title: "鎻愮ず",
- content: "before_click_button-event_id涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( "before_click_button-event_id涓虹┖锛�)
+
return;
}
if (!button_callback) {
- uni.showModal({
- title: "鎻愮ず",
- content: "button_callback-event_id涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("button_callback-event_id涓虹┖锛�)
+
return;
}
var data_attr = this.classAttrList[index].Attr[iindex];
@@ -1850,12 +1779,8 @@
},
classAttr_AddRef(e) {
console.log(e.target);
- uni.showModal({
- title: "鎻愮ず",
- content: "姝ゅ姛鑳借繕鏈疄鐜帮紒",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("姝ゅ姛鑳借繕鏈疄鐜帮紒")
+
// var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value];
// this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
},
@@ -1960,13 +1885,7 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( ar.DispName + '涓嶈兘涓虹┖锛�);
return;
}
}
@@ -2002,11 +1921,8 @@
var action = JSON.parse(data.Action);
if (action.ret == '0') {
if (action.result_type == '0') {
- uni.showToast({
- title: action.result,
- icon: "success",
- duration: 3000
- });
+ showInfo( action.result)
+
}
// "{"ret":0, "result_type":0, "result":"鍒涘缓鎴愬姛123123123","info":""}"
}
@@ -2020,12 +1936,7 @@
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: "鎻愮ず",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, )
});
},
class_attr_init() {
@@ -2194,12 +2105,8 @@
// console.log(this.classAttrList);
} else {
- uni.showModal({
- title: "鎻愮ず",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�")
+
}
},
subClass_attr_init() {
@@ -2353,12 +2260,8 @@
console.log(this.subClassAttrList);
} else {
- uni.showModal({
- title: "鎻愮ず",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo( "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�")
+
}
},
ini_DataObjRunCustomEvent(info) {
@@ -2454,12 +2357,8 @@
}
}
} else if (action_type == 'open_select_userdlg') {
- uni.showModal({
- title: "閿欒2.2",
- content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo("open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�)
+
}
}
}
@@ -2467,12 +2366,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: "閿欒2.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒2.1")
});
},
DataObjRunCustomEvent(info, data_attr) {
@@ -2613,12 +2507,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: "閿欒3.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒3.1")
});
},
OKDataObjRunCustomEvent() {
@@ -2710,12 +2599,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: "閿欒4.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒4.1")
});
},
DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) {
@@ -2914,22 +2798,13 @@
}
}
} else {
- uni.showModal({
- title: "鎻愮ず5.2",
- content: '璋冪敤 before_click_button 鑴氭湰杩斿洖绌猴紝event_id' + eventid,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError('璋冪敤 before_click_button 鑴氭湰杩斿洖绌猴紝event_id' + eventid, "閿欒5.2")
+
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: "鎻愮ず5.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒5.1")
});
},
scan_ini_DataObjRunCustomEvent(info) {
@@ -3025,13 +2900,10 @@
}
}
}
- } else if (action_type == 'open_select_userdlg') {
- uni.showModal({
- title: "閿欒6.2",
- content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ }
+ else if (action_type == 'open_select_userdlg') {
+ showInfo("open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�)
+
}
}
}
@@ -3039,12 +2911,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: "閿欒6.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒6.1")
});
},
scan_DataObjRunCustomEvent(info, data_attr) {
@@ -3278,12 +3145,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: "閿欒7.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒7.1")
});
},
scan_OKDataObjRunCustomEvent(eventID) {
@@ -3323,13 +3185,7 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -3366,13 +3222,7 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -3429,12 +3279,8 @@
}).catch(ex => {
// console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: "閿欒8.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒8.1")
+
});
},
scan_TriggerDataObjRunCustomEvent(eventID) {
@@ -3473,13 +3319,7 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -3516,13 +3356,8 @@
if (ar.notempty == true && !ar.Value) {
// if(ar.NotEmpty=='1'){
uni.hideLoading();
- // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
- uni.showModal({
- title: "鎻愮ず",
- content: ar.DispName + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
+
return;
}
}
@@ -3579,12 +3414,7 @@
}).catch(ex => {
// console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: "閿欒8.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: "鍙栨秷"
- });
+ showError(ex, "閿欒8.1")
});
},
formatAttr(attr) {
--
Gitblit v1.9.1