From 37ff5e49c0e7c5b63e7e8e137058366244f826c1 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 05 七月 2024 14:56:01 +0800
Subject: [PATCH] 5601功能点和多语言
---
pages/modal/5601.vue | 272 +++++++++++++++++++++++++++++-------------------------
1 files changed, 145 insertions(+), 127 deletions(-)
diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue
index bf5a6c4..4135249 100644
--- a/pages/modal/5601.vue
+++ b/pages/modal/5601.vue
@@ -1,54 +1,53 @@
<template>
<view class="uni-page-modal-5601">
<!-- 琛ㄥご鏍峰紡 -->
- <view class="view-header">
- <view v-for="(item,index) in head_styledef.form.items" :key="index">
+
+ <uni-forms ref="baseForm" label-align="right">
+ <view v-for="(item,index) in head_styledef.form.items" :key="index" class="v-head-style">
<!-- 鏅�甯冨眬 -->
- <view v-if="item.name != 'Layout'" class="v-headStyle">
- <text class="txt_title" :style="{'width':item.labelWidth+'px'}">{{item.label}}锛�/text>
- <uni-data-picker class="dv_select" v-if="item.name=='Select'"
- :class="item.disabled?'input-disabled':''" v-model="item.value" :localdata="item.dict"
- @change="onEnterChange(item)" :readonly="item.disabled" :clear-icon="false"
- :popup-title="item.label"></uni-data-picker>
+ <uni-forms-item v-if="item.name != 'Layout'" :label="item.label +'锛� "
+ :label-width="item.labelWidth+'px'">
+ <uni-data-picker v-if="item.name=='Select'" :class="item.disabled?'input-disabled':''"
+ v-model="item.value" :localdata="item.dict" @change="onEnterChange(item)"
+ :readonly="item.disabled" :clear-icon="false" :popup-title="item.label"></uni-data-picker>
<view class="input-wrapper" v-if="item.name=='Input' || item.name=='InputNumber'">
<text v-if="item.setting.prefix" class="uni-icon" :class="[item.setting.prefix]"
@click="onEnterChange(item)"></text>
<input class="uni-input" :class="item.disabled?'input-disabled':''"
+ :style="{'padding-left':item.setting.prefix?0 : '8rpx','right':item.setting.suffix?0 : '8rpx'}"
:type="item.name=='Input'?'text':'number'" v-model="item.value" :disabled="item.disabled"
- :placeholder="item.placeholder"
- :style="{'width':item.setting.prefix && item.setting.suffix?'78%':item.setting.prefix || item.setting.suffix?'87%':'96%'}"
- :focus="focusFieldId == item.fieldId" @focus="ontap(item)"
+ :placeholder="item.placeholder" :focus="focusFieldId == item.fieldId" @focus="ontap(item)"
@keyup.enter="onEnterChange(item)" @blur="onEnterChange(item)" />
<text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]"
- @click="onEnterChange(item)"></text>
+ @click="onEnterChange(item)"></text>
</view>
- </view>
+ </uni-forms-item>
<!-- 鏍呮牸甯冨眬 -->
- <uni-row v-else class="v-headStyle" :gutter="item.setting.gutter">
+ <uni-row v-else :gutter="item.setting.gutter">
<uni-col
:span=" item.setting.spanList && item.setting.spanList[key - 1]? item.setting.spanList[key - 1] : 24 / item.setting.col"
v-for="(col,key) in item.setting.colList">
- <text class="txt_title" :style="{'width':col.labelWidth+'px'}">{{col.label}}锛�/text>
- <uni-data-picker class="dv_select" v-if="col.name=='Select'"
- :class="col.disabled?'input-disabled':''" v-model="col.value" :localdata="col.dict"
- @change="onEnterChange(item)" :readonly="col.disabled" :clear-icon="false"
- :popup-title="col.label"></uni-data-picker>
- <view class="input-wrapper" v-if="col.name=='Input' || col.name=='InputNumber'">
- <text v-if="col.setting.prefix" class="uni-icon" :class="[col.setting.prefix]"
- @click="onEnterChange(item)"></text>
- <input class="uni-input" :class="col.disabled?'input-disabled':''"
- :type="col.name=='Input'?'text':'number'" v-model="col.value" :disabled="col.disabled"
- :placeholder="col.placeholder"
- :style="{'width':col.setting.prefix && col.setting.suffix?'78%':col.setting.prefix || col.setting.suffix?'87%':'96%'}"
- :focus="focusFieldId == col.fieldId" @focus="ontap(item)"
- @keyup.enter="onEnterChange(item)" @blur="onEnterChange(item)" />
- <text v-if="col.setting.suffix" class="uni-icon" :class="[col.setting.suffix]"
- @click="onEnterChange(item)"></text>
- </view>
+ <uni-forms-item :label="col.label +'锛�" :label-width="col.labelWidth+'px'">
+ <uni-data-picker v-if="col.name=='Select'" :class="col.disabled?'input-disabled':''"
+ v-model="col.value" :localdata="col.dict" @change="onEnterChange(item)"
+ :readonly="col.disabled" :clear-icon="false" :popup-title="col.label"></uni-data-picker>
+ <view class="input-wrapper" v-if="col.name=='Input' || col.name=='InputNumber'">
+ <text v-if="col.setting.prefix" class="uni-icon" :class="[col.setting.prefix]"
+ @click="onEnterChange(col)"></text>
+ <input class="uni-input" :class="col.disabled?'input-disabled':''"
+ :style="{'padding-left':col.setting.prefix?0 : '8px','right':col.setting.suffix?0 : '8px'}"
+ :type="col.name=='Input'?'text':'number'" v-model="col.value"
+ :disabled="col.disabled" :placeholder="col.placeholder"
+ :focus="focusFieldId == col.fieldId" @focus="ontap(col)"
+ @keyup.enter="onEnterChange(col)" @blur="onEnterChange(col)" />
+ <text v-if="col.setting.suffix" class="uni-icon" :class="[col.setting.suffix]"
+ @click="onEnterChange(col)"></text>
+ </view>
+ </uni-forms-item>
</uni-col>
</uni-row>
</view>
- </view>
+ </uni-forms>
<view class="view-content">
<!-- 鐮佺洏瀛愮晫闈�-->
<view v-if="param.Show_Welcom_Page==false" class="uni-panel-content">
@@ -109,13 +108,15 @@
</checkbox-group>
<!-- <button type="primary" @click="savaItem(ii)" v-if="param.Sub_Page[0].OK_Button==true">淇濆瓨</Button> -->
<button type="warn" @tap="delItem(pageData,ii)"
- v-if="pageData.Del_Button==true">鍒犻櫎</button>
+ v-if="pageData.Del_Button==true">{{translateSys('delete')}}</button>
</div>
</div>
</view>
<view class="view-bottom" v-if="pageData.OK_Button==true">
- <button type="default" @tap="cancel" class="btn_cancel">鍙栨秷</button>
- <button type="primary" @tap="ok(pageData)" class="btn_add">纭畾</button>
+ <button type="default" @tap="cancel"
+ class="btn_cancel">{{translateSys('cancel')}}</button>
+ <button type="primary" @tap="ok(pageData)"
+ class="btn_add">{{translateSys('ok')}}</button>
</view>
</view>
</swiper-item>
@@ -144,7 +145,7 @@
},
data() {
return {
- title: '鐮佺洏',
+ title: this.translateSys("inventory"),
ClsID: '',
param: {},
focusFieldId: "",
@@ -177,7 +178,7 @@
},
},
onLoad(options) {
- console.log(options);
+ console.log(options.titlename,options);
uni.setNavigationBarTitle({
title: options.titlename
}); //璁剧疆椤堕儴鏍囬
@@ -189,10 +190,10 @@
this.loadData()
} else {
uni.showModal({
- title: "閿欒",
- content: "鏈缃富鏁版嵁绫�,
+ title: this.translateSys("error"),
+ content: this.translate("tip_no_master_class"),
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
},
@@ -307,19 +308,19 @@
})
} else {
uni.showModal({
- title: "閿欒1",
+ title: this.translateSys("error") + "1",
content: ret.err_msg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}).catch(ex => {
// console.log(ex);
uni.showModal({
- title: "閿欒1.1",
+ title: this.translateSys("error") + "1.1",
content: ex.errMsg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
});
@@ -365,19 +366,19 @@
} else {
return {}
uni.showModal({
- title: "閿欒2",
+ title: this.translateSys("error") + "2",
content: ret.err_msg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}).catch(ex => {
// console.log(ex);
uni.showModal({
- title: "閿欒2.1",
+ title: this.translateSys("error") + "2.1",
content: ex.errMsg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
return {}
});
@@ -412,19 +413,19 @@
formItem.dict = list;
} else {
uni.showModal({
- title: "閿欒3.1",
+ title: this.translateSys("error") + "3.1",
content: success.err_msg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}).catch(ex => {
// console.log(ex);
uni.showModal({
- title: "閿欒3",
+ title: this.translateSys("error") + "3",
content: ex.errMsg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
});
},
@@ -646,26 +647,27 @@
var tip = result.err_info ? typeof result.err_info == 'string' ? result
.err_info : result.err_info.join('<br/>') : '';
if (result.ret == 801) uni.showModal({
- title: '鎻愮ず',
+ title: this.translateSys('tip'),
content: tip,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
else uni.showModal({
- title: '鎻愮ず',
- content: tip + ',鎻愮ず:' + result.ret,
+ title: this.translateSys('tip'),
+ content: tip + ',' + this.translateSys('tip') + ':' + result
+ .ret,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
return false;
} else {
var tip = result.info ? typeof result.info == 'string' ? result.info :
result.info.join('<br/>') : '';
if (tip) uni.showModal({
- title: '鎻愮ず',
+ title: this.translateSys('tip'),
content: tip,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
if (result.result_type == 0 && result.action) {
@@ -686,9 +688,15 @@
pageData && pageData.DefList.length > 0
) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹� uni.showModal({
- title: '鎻愮ず',
- content: '绯荤粺妫�祴鍒版湁' + value.page_name +
- '涓殑璐у搧锛岀户缁搷浣滀細娓呯┖锛屾槸鍚︾户缁紵',
+ title: this.translateSys('tip'),
+ content: this.translate(
+ "are_you_sure_clear_first") +
+ this.translateSys(
+ "quotation_mark_left") + value
+ .page_name + this.translateSys(
+ "sys.quotation_mark_right") +
+ this.translate(
+ "are_you_sure_clear_last"),
success: function(res) {
if (res.confirm) {
if (pageData)
@@ -867,10 +875,10 @@
if (result.info) {
uni.showModal({
- title: "閿欒4.3",
+ title: this.translateSys("error") + "4.3",
content: result.info,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}
@@ -878,29 +886,31 @@
}
} else {
uni.showModal({
- title: "閿欒4",
+ title: this.translateSys("error") + "4",
content: ret.err_msg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}).catch(ex => {
// console.log(ex);
uni.showModal({
- title: "閿欒4.1",
+ title: this.translateSys("error") + "4.1",
content: ex.errMsg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
});
}
} catch (ex) {
var tip = typeof ex == "string" ? ex : ex.message;
uni.showModal({
- title: "閿欒4.2",
- content: "鎵ц鈥滃唴瀹瑰彉鍖栧悗鈥濅簨浠跺け璐ワ細" + tip,
+ title: this.translateSys("error") + "4.2",
+ content: this.translate('execute_after_change_event_failed') + this.translateSys(
+ "comma") +
+ this.translate('reason') + this.translateSys("colon") + tip,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
},
@@ -1233,10 +1243,16 @@
var $this = this;
if (pageData.DefList.length == 0) {
uni.showModal({
- title: "鎻愮ず",
- content: "娌℃湁" + pageData.Name + "鐨勬暟鎹紒",
+ title: this.translateSys("tip"),
+ content: this.translate(
+ "page.tip_no_data_first") +
+ this.translateSys(
+ "quotation_mark_left") + pageData.Name + this.translateSys(
+ "sys.quotation_mark_right") +
+ this.translate(
+ "page.tip_no_data_last"),
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
return false;
}
@@ -1363,16 +1379,16 @@
.err_info == 'string' ? result.err_info :
result.err_info.join('<br/>') : '';
if (result.ret == 801) uni.showModal({
- title: '鎻愮ず',
+ title: this.translateSys('tip'),
content: tip,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
else uni.showModal({
- title: '鎻愮ず',
- content: tip + ',鎻愮ず:' + result.ret,
+ title: this.translateSys('tip'),
+ content: tip + ',' + this.translateSys('tip') + ':' + result.ret,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
return false;
} else {
@@ -1380,14 +1396,14 @@
'string' ? result.info : result.info
.join('<br/>') : '';
if (tip) uni.showModal({
- title: '鎻愮ず',
+ title: this.translateSys('tip'),
content: tip,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
if (result.result_type == 0) {
if (result.action) {
- // uni.showModal({title:"鎻愮ず",content:JSON.stringify(result.action),showCancel:false,confirmText:"鍙栨秷"});
+ // uni.showModal({title:this.translateSys("tip"),content:JSON.stringify(result.action),showCancel:false,confirmText:this.translateSys("cancel")});
result.action.forEach(item => {
if (item.action_type ==
@@ -1421,10 +1437,10 @@
});
uni.showModal({
- title: "鎻愮ず",
- content: pageParam.Name + "鎴愬姛",
+ title: this.translateSys("tip"),
+ content:this.translate('execute_event_success'),
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
} else if (item.action_type ==
"remove_subtable_page_row"
@@ -1520,29 +1536,31 @@
if (result.info) {
uni.showModal({
- title: "鎻愮ず",
+ title: this.translateSys("tip"),
content: result.info,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}
}
} else {
uni.showModal({
- title: "閿欒8",
+ title: this.translateSys("error") + "8",
content: res.err_msg,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
}
}).catch(ex => {
var tip = typeof ex == "string" ? ex : ex.errMsg;
uni.showModal({
- title: "閿欒8.1",
- content: "鎵ц鈥滅‘瀹氬悗鈥濅簨浠跺け璐ワ細" + tip,
+ title: this.translateSys("error") + "8.1",
+ content: this.translate("execute_after_ok_event_failed") + this.translateSys(
+ "comma") +
+ tip,
showCancel: false,
- confirmText: "鍙栨秷"
+ confirmText: this.translateSys("cancel")
});
});
},
@@ -1552,6 +1570,14 @@
delta: 1 //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
});
},
+ translate(t) {
+ if (typeof this.$t == "function") return this.$t(`page.${t}`)
+ else return t;
+ },
+ translateSys(t) {
+ if (typeof this.$t == "function") return this.$t(`sys.${t}`)
+ else return t;
+ },
},
};
</script>
@@ -1560,54 +1586,46 @@
.uni-page-modal-5601 {
display: flex;
- height: 100vh;
- width: 750rpx;
+ height: calc(100vh - 30rpx);
+ width: 720rpx;
flex-direction: column !important;
+ padding: 15rpx;
.view-header {
display: flex;
width: 100%;
flex-direction: column;
- margin-top: 15rpx;
}
- .v-headStyle {
- width: 100%;
- margin-bottom: 10rpx;
+ .v-head-style {
+ width: 98%;
- .txt_title {
- font-size: 28rpx;
- text-align: right;
- display: inline-block;
- vertical-align: 12px;
- }
-
- input {
- display: inline-block;
- width: 85%;
- height: 40rpx;
- line-height: 40rpx;
- background: #FFF;
- border-radius: 0 !important;
- color: #2d8cf0;
- padding: 10rpx 8rpx 12rpx;
- font-size: 28rpx;
- font-family: inherit;
- box-shadow: none !important;
- transition-duration: 0.1s;
- margin-bottom: 10rpx;
- }
-
- input::-webkit-input-placeholder {
- font-size: 28rpx;
+ .uni-form-item {
+ margin-bottom: 15rpx;
}
.input-wrapper {
border: 1px solid #d5d5d5;
- display: inline-block;
- width: 65%;
- line-height: 22rpx;
- margin-bottom: 10rpx;
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+
+ .uni-input {
+ flex: 1;
+ padding: 12rpx 8rpx;
+ // height: 40rpx;
+ // line-height: 40rpx;
+ }
+
+ .uni-icon {
+ padding: 8rpx;
+ font-size: 32rpx;
+ color: rgb(192, 196, 204);
+ }
+ }
+
+ .input-wrapper:hover {
+ border: 1px solid rgb(41, 121, 255);
}
}
--
Gitblit v1.9.1