From 016fe8296e58f28f30bf66fa71bdcd420e9e9d84 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期二, 20 八月 2024 15:55:16 +0800
Subject: [PATCH] test

---
 pages/index/index.vue |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/pages/index/index.vue b/pages/index/index.vue
index d9a6c2a..3338b09 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -16,7 +16,7 @@
 						:style="{'background-color':app.bk_color,'color':app.bk_color}">
 						<i :class="app.img_font_style" :style="{'color':app.txt_color}"></i>
 					</a>
-					<p :data-key="app.id">{{ app.name || app.list_name}}</p>
+					<p :data-key="app.id">{{ app.list_name||  app.name}}</p>
 				</li>
 
 			</ul>
@@ -27,6 +27,7 @@
 
 <script>
 	import Base64 from '../../components/js-base64/base64.js'
+	import utils from "@/js/utils.js"
 	export default {
 		modules: {
 			Base64,
@@ -58,25 +59,29 @@
 
 			if (this.$store.state.areaFunc)
 				this.data = this.$store.state.areaFunc.data;
-			else
-				this.$store.dispatch('areaFunc', {}).then(success => {
+			else {
+				const appType = utils.session.getValue('app_type') || "MES";
+				this.$store.dispatch('areaFunc', {
+					app_type: appType,
+					need_ace:1,
+				}).then(success => {
 					// console.log(success);
 					if (success.code == '00000' || success.err_code == 0) {
 						this.data = success.data;
-						
 						if (success.err_code != undefined) { //鍒ゆ柇鏄惁鏄疢obox3
 							success.result.forEach(async (area, index) => {
 								if (area.client_type == 2) { //鍒ゆ柇绫诲瀷鏄惁鏄疨DA绫诲瀷
+								area.app_type= appType
 									await this.GetFuncTree(index, area);
 								}
 							});
 						}
 					} else {
 						uni.showModal({
-							title:this.translateSys("error"),
+							title: this.translateSys("error"),
 							content: success.msg,
 							showCancel: false,
-							confirmText:this.translateSys("cancel")
+							confirmText: this.translateSys("cancel")
 						});
 					}
 				}).catch(ex => {
@@ -85,33 +90,35 @@
 						title: this.translateSys("error"),
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText:this.translateSys("cancel")
+						confirmText: this.translateSys("cancel")
 					});
 				});
+			}
 
 		},
 		methods: {
 			async GetFuncTree(index, area) { //Mobox3鑾峰彇搴旂敤棰嗗煙鐨勫姛鑳界偣
 				this.data = [];
 				var $this = this;
+
 				var json = {
-					app_type: "MES",
+					app_type: area.app_type,
 					area_id: area.id,
 					area_client_type: area.client_type,
-					need_ace: '0',
+					need_ace:1,
 				};
 				this.$store.dispatch('GetFuncTree', json).then(success => {
 					// console.log(success);
 					if (success.err_code == 0) {
 						if ((success.result || []).length > 0) {
 							$this.data.push(success.result[0]);
-							console.log("onLoad",$this.data )
+							console.log("onLoad", $this.data)
 							this.$store.commit("areaFunc", $this.data);
 						}
 
 					} else {
 						uni.showModal({
-							title:this.translateSys("error"),
+							title: this.translateSys("error"),
 							content: success.msg,
 							showCancel: false,
 							confirmText: this.translateSys("cancel")
@@ -130,7 +137,7 @@
 			appCreate(app) { //鐐瑰嚮鍔熻兘鐐硅烦杞〉闈� 				console.log(app);
 				var paramStr = this.$store.state.OIMoboxSAPI ? app.param : app.Param;
-				var appName = this.$store.state.OIMoboxSAPI ? (app.name || app.list_name) : app.Name;
+				var appName = this.$store.state.OIMoboxSAPI ? (app.list_name || app.name) : app.Name;
 				var defCode = this.$store.state.OIMoboxSAPI ? app.def_code : app.DefCode;
 				var param = "";
 				if (paramStr) {
@@ -139,13 +146,13 @@
 					//mobox3鐨刾aram鏄痓ase64瀛楃涓� 					if (!paramStr.includes('"')) param = Base64.decode(paramStr);
 				}
-		
+
 				if (!param) {
 					uni.showModal({
 						title: this.translateSys("tip"),
-						content:this.translate('tip_no_app_param'),
+						content: this.translate('tip_no_app_param'),
 						showCancel: false,
-						confirmText:this.translateSys("cancel")
+						confirmText: this.translateSys("cancel")
 					});
 					return;
 				}

--
Gitblit v1.9.1