ysy 2 년 전
부모
커밋
f11771f410
6개의 변경된 파일270개의 추가작업 그리고 238개의 파일을 삭제
  1. 13 0
      api/common.js
  2. 4 1
      api/pda/common.js
  3. 15 5
      pages/center/about/about.vue
  4. 8 7
      pages/center/center.vue
  5. 9 8
      pages/index/index.vue
  6. 221 217
      pages/login/login.vue

+ 13 - 0
api/common.js

@@ -24,3 +24,16 @@ export async function getLoginUser(data) {
   }
   return Promise.reject(res.message);
 }
+
+// 公司名称
+
+export async function usName() {
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/mes/us/indexName`,
+	);
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
+

+ 4 - 1
api/pda/common.js

@@ -20,7 +20,7 @@ export async function getByCode(code) {
 
 // 查询菜单列表
 
-export async function getResourcesTree(code) {
+export async function getResourcesTree() {
 	const data = await get(
 		Vue.prototype.apiUrl + `/system/resources/getResourcesTreePDA`,
 	);
@@ -31,3 +31,6 @@ export async function getResourcesTree(code) {
 }
 
 
+
+
+

+ 15 - 5
pages/center/about/about.vue

@@ -6,9 +6,9 @@
       left-icon="back"
       @clickLeft="back"
     >
-      <!-- <view class="title">关于株洲硬质合金集团型材分公司</view> -->
-	   <view class="title">关于湖南碳谷新材料有限公司</view>
-	    <!-- <view class="title">关于株洲索尔切削刀具有限公司</view> -->
+
+	   <view class="title">关于{{ gstitle}}</view>
+	   
 
     </uni-nav-bar>
 
@@ -28,16 +28,26 @@
 </template>
 
 <script>
+	import { usName } from '@/api/common'
 export default {
   data () {
     return {
-      currentVersion: ''
+      currentVersion: '',
+	  gstitle: null,
     }
   },
   created () {
+	  this.getUsName()
     this.currentVersion = plus?.runtime.version
+	
   },
-  methods: {}
+  methods: {
+	  getUsName() {
+		  usName().then(res => {
+			  this.gstitle = res
+		  })
+	  },
+  }
 }
 </script>
 

+ 8 - 7
pages/center/center.vue

@@ -4,8 +4,8 @@
       <view class="logo-content">
         <image :src="src1" model="aspectFit "></image>
         <view class="user_name">
-          <view>{{ userInfo.name || 'username' }}</view>
-          <view>{{ userInfo.role && userInfo.role.name }}</view>
+          <view>{{ userInfo.name  }}</view>
+          <view>{{ userInfo.groupName }}</view>
         </view>
         <uni-icons
           class="tuichu"
@@ -20,9 +20,10 @@
       <view class="tab-data">
         <label class="tab-lable">我的任务</label>
         <view class="tab-content">
+			  <!-- @click="onDataOrderTab(index)" -->
           <label
             :class="{ 'data-action': DataOrderType == index }"
-            @click="onDataOrderTab(index)"
+          
             v-for="(item, index) in taskList"
             >{{ item.name }}</label
           >
@@ -90,7 +91,7 @@ export default {
   onLoad () {
     this.userInfo = uni.getStorageSync('userInfo')
     console.log(this.userInfo)
-    this.getdata()
+    // this.getdata()
   },
   methods: {
     click (name) {
@@ -130,9 +131,9 @@ export default {
       })
     },
     goAbout () {
-      uni.navigateTo({
-        url: './about/about'
-      })
+      // uni.navigateTo({
+      //   url: './about/about'
+      // })
     },
     gomiss () {
       uni.navigateTo({

+ 9 - 8
pages/index/index.vue

@@ -4,7 +4,7 @@
 
 		</uni-nav-bar>
 		<view>
-			<CellTip title="生产管理" v-if='productionList.lengt > 0'></CellTip>
+			<CellTip title="生产管理" v-if='productionList.length > 0'></CellTip>
 			<view class="nav">
 				<view class="nav-content">
 					<view class="nav-item" v-for="(item) in productionList" :key="item.link_url"
@@ -314,16 +314,17 @@
 		},
 		methods: {
 			getTree() {
-				let _list = uni.getStorageSync('treeList') || [];
+				let _list = uni.getStorageSync('treeList');
 				let list = JSON.parse(_list) || []
-				console.log(list)
+			
 
 				if (list && list.length > 0) {
-					list[0].children.forEach(f => {
-						if (f.path == "productionManage") {
-							this.productionList = f.children
-
-						}
+					list.forEach(f => {
+					if (f.path == "productionManage") {
+						this.productionList = f.children
+						
+					
+					}
 					})
 				}
 			},

+ 221 - 217
pages/login/login.vue

@@ -1,225 +1,229 @@
 <template>
-  <view class="content">
-    <uni-icons
-      class="setting"
-      type="gear"
-      @click="handleServerSettings"
-      size="50"
-      color="#fff"
-    ></uni-icons>
-    <view class="login-title">
-      <label>智慧工厂信息化系统</label>
-      <!-- <text>株洲硬质合金集团型材分公司</text> -->
-	  <text>湖南碳谷新材料有限公司</text>
-	   <!-- <text >株洲索尔切削刀具有限公司</text> -->
-	  
-    </view>
-    <view>
-      <view class="login-content">
-        <view>
-          <view class="form">
-            <view class="login-input">
-              <label class="icon-lable"></label>
-              <input
-                name="input"
-                v-model="userInfo.username"
-                placeholder="请输入账号"
-              />
-            </view>
-            <view class="login-input">
-              <label class="icon-lable2"></label>
-              <input
-                class=""
-                name="input"
-                password
-                v-model="userInfo.passwd"
-                placeholder="请输入密码"
-              />
-            </view>
-            <button @click="submit">登录</button>
-            <view class="password-memo">
-              <checkbox-group @change="checkboxChange">
-                <label>
-                  <checkbox value="1" :checked="isMemo" />
-                  记住密码
-                </label>
-              </checkbox-group>
-            </view>
-          </view>
-        </view>
-      </view>
-    </view>
-    <ServerSetting ref="serverSettingRef" @setServerStatus="setServerStatus" />
-  </view>
+	<view class="content">
+		<uni-icons class="setting" type="gear" @click="handleServerSettings" size="50" color="#fff"></uni-icons>
+		<view class="login-title">
+			<label>智慧工厂信息化系统</label>
+
+			<text>{{ gstitle}}</text>
+
+
+		</view>
+		<view>
+			<view class="login-content">
+				<view>
+					<view class="form">
+						<view class="login-input">
+							<label class="icon-lable"></label>
+							<input name="input" v-model="userInfo.username" placeholder="请输入账号" />
+						</view>
+						<view class="login-input">
+							<label class="icon-lable2"></label>
+							<input class="" name="input" password v-model="userInfo.passwd" placeholder="请输入密码" />
+						</view>
+						<button @click="submit">登录</button>
+						<view class="password-memo">
+							<checkbox-group @change="checkboxChange">
+								<label>
+									<checkbox value="1" :checked="isMemo" />
+									记住密码
+								</label>
+							</checkbox-group>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<ServerSetting ref="serverSettingRef" @setServerStatus="setServerStatus" />
+	</view>
 </template>
 
 <script>
-import { postJ } from "@/utils/api.js";
-import { login } from "@/api/common.js";
-import { getResourcesTree } from '@/api/pda/common.js'
-import {
-  setMemo,
-  isMemo,
-  removeMemo,
-  setPassword,
-  getPassword,
-} from "@/utils/passwordMemo.js";
-import ServerSetting from "@/components/ServerSetting/index";
-
-export default {
-  components: { ServerSetting },
-  data() {
-    return {
-      userInfo: {
-        username: "",
-        passwd: "",
-      },
-      isMemo: isMemo(),
-      loginDisabled: false,
-    };
-  },
-  onLoad() {
-    if (this.isMemo) {
-      const userInfo = getPassword();
-      if (userInfo?.username) this.userInfo = userInfo;
-    }
-  },
-  mounted() {
-    // #ifdef APP-PLUS
-    this.$nextTick(() => {
-      this.$refs.serverSettingRef && this.$refs.serverSettingRef.serverCheck();
-    });
-    // #endif
-    // uni.reLaunch({
-    //           url: "/pages/home/home",
-    //         });
-
-  },
-  methods: {
-    setServerStatus(val) {
-      this.loginDisabled = !val;
-    },
-    //登录
-    // submit() {
-    //   // #ifdef APP-PLUS
-    //   if (!this.apiUrl) {
-    //     this.$refs.serverSettingRef.open();
-    //     return;
-    //   }
-    //   // #endif
-
-    //   const params = {
-    //     loginName: this.userInfo.username,
-    //     loginPwd: this.userInfo.passwd,
-    //   };
-
-    //   login(params)
-    //     .then((res) => {
-    //       if (this.isMemo) {
-    //         setPassword(this.userInfo);
-    //       }
-    //       let data = res.data;
-    //       uni.setStorageSync("token", data.token);
-    //       uni.setStorageSync("userInfo", data);
-    //       uni.showToast({
-    //         title: "登录成功",
-    //         icon: "success",
-    //         duration: 2000,
-    //       });
-    //       setTimeout(() => {
-    //         uni.reLaunch({
-    //           url: "/pages/home/home",
-    //         });
-    //       }, 2000);
-    //     })
-    //     .catch((err) => {
-    //       console.log(err, 222);
-    //       uni.showToast({
-    //         title: err.message || err,
-    //         icon: "none",
-    //         duration: 2000,
-    //       });
-    //     });
-    // },
-    //登录
-    submit() {
-      // #ifdef APP-PLUS
-      if (!this.apiUrl) {
-        this.$refs.serverSettingRef.open();
-        return;
-      }
-      // #endif
-
-     let param = {
-		 loginName: this.userInfo.username,
-		 loginPwd: this.userInfo.passwd
-	 }
-
-
-      postJ(this.apiUrl + "/main/user/login",param)
-        .then((res) => {
-
-          if (this.isMemo) {
-            setPassword(this.userInfo);
-          }
-
-          console.log(res);
-          let data = res.data;
-          uni.setStorageSync("token", data.token);
-          uni.setStorageSync("userInfo", data.info);
-          uni.showToast({
-            title: "登录成功",
-            icon: "success",
-            duration: 2000,
-          });
-		  this.getTree()
-          setTimeout(() => {
-            uni.reLaunch({
-              url: "/pages/home/home",
-            });
-          }, 2000);
-        })
-        .catch((err) => {
-          uni.showToast({
-            title: err.message,
-            icon: "none",
-            duration: 2000,
-          });
-        });
-    },
-    handleServerSettings() {
-      this.$refs.serverSettingRef.open();
-    },
-    checkboxChange(e) {
-      this.isMemo = e.detail.value[0] === "1";
-      if (this.isMemo) {
-        setMemo();
-      } else {
-        removeMemo();
-      }
-    },
-	
-	getTree() {
-		getResourcesTree().then(res => {
-			console.log(res)
-			if(res.length == 0) {
-				uni.showToast({
-					title: '您还未配置权限',
-					icon: 'none'
-				})
+	import {
+		postJ
+	} from "@/utils/api.js";
+	import {
+		login,
+		usName
+	} from "@/api/common.js";
+	import {
+		getResourcesTree
+	} from '@/api/pda/common.js'
+
+	import {
+		setMemo,
+		isMemo,
+		removeMemo,
+		setPassword,
+		getPassword,
+	} from "@/utils/passwordMemo.js";
+	import ServerSetting from "@/components/ServerSetting/index";
+
+	export default {
+		components: {
+			ServerSetting
+		},
+		data() {
+			return {
+				userInfo: {
+					username: "",
+					passwd: "",
+				},
+				isMemo: isMemo(),
+				loginDisabled: false,
+				
+				gstitle: null,
+			};
+		},
+		onLoad() {
+			if (this.isMemo) {
+				const userInfo = getPassword();
+				if (userInfo?.username) this.userInfo = userInfo;
 			}
-			let List  = JSON.stringify(res || [])
-			 uni.setStorageSync("treeList", List);
-			 
-			 
-			
-	
-		})
-	},
-  },
-};
+
+			this.getUsName()
+		},
+		mounted() {
+			// #ifdef APP-PLUS
+			this.$nextTick(() => {
+				this.$refs.serverSettingRef && this.$refs.serverSettingRef.serverCheck();
+			});
+			// #endif
+			// uni.reLaunch({
+			//           url: "/pages/home/home",
+			//         });
+
+		},
+		methods: {
+
+			getUsName() {
+				usName().then(res => {
+					this.gstitle = res
+				})
+			},
+			setServerStatus(val) {
+				this.loginDisabled = !val;
+			},
+			//登录
+			// submit() {
+			//   // #ifdef APP-PLUS
+			//   if (!this.apiUrl) {
+			//     this.$refs.serverSettingRef.open();
+			//     return;
+			//   }
+			//   // #endif
+
+			//   const params = {
+			//     loginName: this.userInfo.username,
+			//     loginPwd: this.userInfo.passwd,
+			//   };
+
+			//   login(params)
+			//     .then((res) => {
+			//       if (this.isMemo) {
+			//         setPassword(this.userInfo);
+			//       }
+			//       let data = res.data;
+			//       uni.setStorageSync("token", data.token);
+			//       uni.setStorageSync("userInfo", data);
+			//       uni.showToast({
+			//         title: "登录成功",
+			//         icon: "success",
+			//         duration: 2000,
+			//       });
+			//       setTimeout(() => {
+			//         uni.reLaunch({
+			//           url: "/pages/home/home",
+			//         });
+			//       }, 2000);
+			//     })
+			//     .catch((err) => {
+			//       console.log(err, 222);
+			//       uni.showToast({
+			//         title: err.message || err,
+			//         icon: "none",
+			//         duration: 2000,
+			//       });
+			//     });
+			// },
+			//登录
+			submit() {
+				// #ifdef APP-PLUS
+				if (!this.apiUrl) {
+					this.$refs.serverSettingRef.open();
+					return;
+				}
+				// #endif
+
+				let param = {
+					loginName: this.userInfo.username,
+					loginPwd: this.userInfo.passwd
+				}
+
+
+				postJ(this.apiUrl + "/main/user/login", param)
+					.then((res) => {
+
+						if (this.isMemo) {
+							setPassword(this.userInfo);
+						}
+
+						console.log(res);
+						let data = res.data;
+						uni.setStorageSync("token", data.token);
+						uni.setStorageSync("userInfo", data);
+						uni.showToast({
+							title: "登录成功",
+							icon: "success",
+							duration: 2000,
+						});
+						this.getTree()
+						setTimeout(() => {
+							uni.reLaunch({
+								url: "/pages/home/home",
+							});
+						}, 2000);
+					})
+					.catch((err) => {
+						uni.showToast({
+							title: err.message,
+							icon: "none",
+							duration: 2000,
+						});
+					});
+			},
+			handleServerSettings() {
+				this.$refs.serverSettingRef.open();
+			},
+			checkboxChange(e) {
+				this.isMemo = e.detail.value[0] === "1";
+				if (this.isMemo) {
+					setMemo();
+				} else {
+					removeMemo();
+				}
+			},
+
+			getTree() {
+				getResourcesTree().then(res => {
+					console.log(res)
+					if (res.length == 0) {
+						uni.showToast({
+							title: '您还未配置权限',
+							icon: 'none'
+						})
+					}
+					let List = JSON.stringify(res || [])
+					uni.setStorageSync("treeList", List);
+
+
+
+
+				})
+			},
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-@import "login.scss";
-</style>
+	@import "login.scss";
+</style>