diff --git a/package.json b/package.json
index 2aa79fa..e4595b0 100644
--- a/package.json
+++ b/package.json
@@ -11,11 +11,24 @@
"build:all": "pnpm -r build",
"lint": "pnpm -r lint"
},
- "keywords": ["monorepo", "vue3", "vant", "大屏", "h5"],
+ "keywords": [
+ "monorepo",
+ "vue3",
+ "vant",
+ "大屏",
+ "h5"
+ ],
"author": "",
"license": "MIT",
"engines": {
"node": ">=16.0.0",
"pnpm": ">=8.0.0"
+ },
+ "dependencies": {
+ "dayjs": "^1.11.18",
+ "vant": "^4.9.21"
+ },
+ "devDependencies": {
+ "@vant/auto-import-resolver": "^1.3.0"
}
}
diff --git a/packages/mobile/src/views/EquipmentManagement.vue b/packages/mobile/src/views/EquipmentManagement.vue
index f8651e6..814f121 100644
--- a/packages/mobile/src/views/EquipmentManagement.vue
+++ b/packages/mobile/src/views/EquipmentManagement.vue
@@ -45,7 +45,7 @@
添加设备
-
+
-
+
+
+ 设备信息
+
+
+
+
+ {{ form.deviceName.length }}/20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
@@ -81,6 +260,80 @@ const handleAddDevice = () => {
const onPopupClose = () => {
showPopup.value = false;
};
+
+const form = ref({
+ deviceName: "",
+ category: "",
+ type: "",
+ model: "",
+ lon: "",
+ lat: "",
+ admin: "",
+ operator: "",
+ time: "",
+});
+const showCategoryPicker = ref(false);
+const showTypePicker = ref(false);
+
+const categoryOptions = [
+ { text: "分类1", value: "分类1" },
+ { text: "分类2", value: "分类2" },
+ { text: "分类3", value: "分类3" },
+];
+const typeOptions = [
+ { text: "分类1", value: "分类1" },
+ { text: "分类2", value: "分类2" },
+ { text: "分类3", value: "分类3" },
+];
+
+const onCategoryConfirm = (value) => {
+ form.value.category = value.selectedValues[0];
+ showCategoryPicker.value = false;
+};
+const onTypeConfirm = (value) => {
+ form.value.type = value.selectedValues[0];
+ showTypePicker.value = false;
+};
+// 设备管理员
+const showAdminPicker = ref(false);
+const adminOptions = [
+ { text: "管理员1", value: "管理员1" },
+ { text: "管理员2", value: "管理员2" },
+ { text: "管理员3", value: "管理员3" },
+];
+const onAdminConfirm = (value) => {
+ form.value.admin = value.selectedValues[0];
+ showAdminPicker.value = false;
+};
+// 操作员
+const showOperatorPicker = ref(false);
+const operatorOptions = [
+ { text: "操作员1", value: "操作员1" },
+ { text: "操作员2", value: "操作员2" },
+ { text: "操作员3", value: "操作员3" },
+];
+const operatorConfirm = (value) => {
+ form.value.operator = value.selectedValues[0];
+ showOperatorPicker.value = false;
+};
+
+// 购置日期
+const showTimePicker = ref(false);
+const currentDate = ref([
+ new Date().getFullYear(),
+ new Date().getMonth() + 1,
+ new Date().getDate(),
+]);
+// 添加日期确认处理
+const onDateConfirm = ({ selectedValues }) => {
+ form.value.time = selectedValues.join("-");
+ showTimePicker.value = false;
+};
+
+const handleSubmit = () => {
+ showToast("提交成功");
+ showPopup.value = false;
+};
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 71adefd..1ddc3af 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6,7 +6,18 @@ settings:
importers:
- .: {}
+ .:
+ dependencies:
+ dayjs:
+ specifier: ^1.11.18
+ version: 1.11.18
+ vant:
+ specifier: ^4.9.21
+ version: 4.9.21(vue@3.5.22)
+ devDependencies:
+ '@vant/auto-import-resolver':
+ specifier: ^1.3.0
+ version: 1.3.0
packages/mobile:
dependencies:
@@ -471,6 +482,9 @@ packages:
'@types/estree@1.0.8':
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
+ '@vant/auto-import-resolver@1.3.0':
+ resolution: {integrity: sha512-lJyWtCyFizR4bHZvMiNMF3w+WTFTUWAvka1eqTnPK9ticUcKTCOx6qEmHcm8JPb3g1t3GaD2W3MnHkBp/nHamw==}
+
'@vant/popperjs@1.3.0':
resolution: {integrity: sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==}
@@ -578,6 +592,9 @@ packages:
csstype@3.1.3:
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
+ dayjs@1.11.18:
+ resolution: {integrity: sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==}
+
debug@4.4.3:
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
engines: {node: '>=6.0'}
@@ -1278,6 +1295,8 @@ snapshots:
'@types/estree@1.0.8': {}
+ '@vant/auto-import-resolver@1.3.0': {}
+
'@vant/popperjs@1.3.0': {}
'@vant/use@1.6.0(vue@3.5.22)':
@@ -1411,6 +1430,8 @@ snapshots:
csstype@3.1.3: {}
+ dayjs@1.11.18: {}
+
debug@4.4.3:
dependencies:
ms: 2.1.3