From d01295c254063b3349a86a4474e04a62b284bd19 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 24 三月 2026 16:26:07 +0800
Subject: [PATCH] 一些配置
---
Code/WMS/WIDESEA_WMSClient/src/views/system/PDA.vue | 128 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSClient/src/views/system/PDA.vue b/Code/WMS/WIDESEA_WMSClient/src/views/system/PDA.vue
new file mode 100644
index 0000000..91feef9
--- /dev/null
+++ b/Code/WMS/WIDESEA_WMSClient/src/views/system/PDA.vue
@@ -0,0 +1,128 @@
+锘�<template>
+ <div class="pda-container">
+ <el-card class="pda-card" shadow="hover">
+ <template #header>
+ <div class="card-header">PDA 搴旂敤绠$悊</div>
+ </template>
+
+ <el-form label-width="120px">
+ <el-form-item label="褰撳墠鐗堟湰鍙�">
+ <el-input v-model="clientVersion" placeholder="璇疯緭鍏ュ綋鍓峆DA鐗堟湰鍙�" style="max-width: 280px" />
+ <el-button type="primary" style="margin-left: 10px" @click="checkVersion">妫�鏌ユ洿鏂�</el-button>
+ </el-form-item>
+
+ <el-form-item label="鏈嶅姟绔増鏈粨鏋�">
+ <span>{{ checkResult }}</span>
+ </el-form-item>
+
+ <el-form-item label="涓嬭浇瀹夎鍖�">
+ <el-button type="success" @click="downloadApp">涓嬭浇鏈�鏂� APK</el-button>
+ </el-form-item>
+
+ <el-form-item label="涓婁紶瀹夎鍖�">
+ <el-upload
+ :action="uploadUrl"
+ :headers="uploadHeaders"
+ name="fileInput"
+ :show-file-list="true"
+ :before-upload="beforeUpload"
+ :on-success="onUploadSuccess"
+ :on-error="onUploadError"
+ >
+ <el-button type="warning">涓婁紶鏂� APK</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-form>
+ </el-card>
+ </div>
+</template>
+
+<script>
+import { defineComponent, ref, computed, getCurrentInstance } from "vue";
+import store from "@/store/index";
+import http from "@/api/http";
+
+export default defineComponent({
+ setup() {
+ const clientVersion = ref("");
+ const checkResult = ref("鏈鏌�");
+ const { proxy } = getCurrentInstance();
+
+ // 涓婁紶鍦板潃锛氬鐢ㄥ叏灞� http 鍩虹鍦板潃锛屼繚璇佷笌褰撳墠鐜涓�鑷淬��
+ const uploadUrl = computed(() => `${http.ipAddress}api/PDA/UploadApp`);
+
+ // 涓婁紶閴存潈锛氭部鐢ㄧ幇鏈� token 鏈哄埗锛岄伩鍏嶆帴鍙� 401銆�
+ const uploadHeaders = computed(() => ({
+ Authorization: store.getters.getToken(),
+ }));
+
+ const checkVersion = () => {
+ if (!clientVersion.value) {
+ proxy.$message.warning("璇疯緭鍏ョ増鏈彿");
+ return;
+ }
+
+ http
+ .get(`api/PDA/GetPDAVersion?version=${encodeURIComponent(clientVersion.value)}`, {}, true)
+ .then((res) => {
+ if (!res.status) {
+ checkResult.value = res.message || "妫�鏌ュけ璐�";
+ return;
+ }
+ checkResult.value = res.data ? "闇�瑕佹洿鏂�" : "宸叉槸鏈�鏂扮増鏈�";
+ });
+ };
+
+ const downloadApp = () => {
+ window.open(`${http.ipAddress}api/PDA/DownLoadApp`, "_blank");
+ };
+
+ // 涓婁紶鍓嶆牎楠岋細闄愬埗涓婁紶 apk锛屽噺灏戞棤鏁堣姹傘��
+ const beforeUpload = (file) => {
+ if (!file || !file.name || !file.name.toLowerCase().endsWith(".apk")) {
+ proxy.$message.error("鍙厑璁镐笂浼� .apk 鏂囦欢");
+ return false;
+ }
+ return true;
+ };
+
+ const onUploadSuccess = (response) => {
+ proxy.$message[response && response.status ? "success" : "error"](
+ (response && response.message) || "涓婁紶瀹屾垚"
+ );
+ };
+
+ const onUploadError = () => {
+ proxy.$message.error("涓婁紶澶辫触");
+ };
+
+ return {
+ clientVersion,
+ checkResult,
+ uploadUrl,
+ uploadHeaders,
+ checkVersion,
+ downloadApp,
+ beforeUpload,
+ onUploadSuccess,
+ onUploadError,
+ };
+ },
+});
+</script>
+
+<style lang="less" scoped>
+.pda-container {
+ height: 100%;
+ padding: 12px;
+}
+
+.pda-card {
+ max-width: 920px;
+}
+
+.card-header {
+ font-size: 16px;
+ font-weight: 600;
+}
+</style>
--
Gitblit v1.9.3