arms-app 1.0.73 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/view/5.d +106 -0
  3. package/view/q.d +0 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arms-app",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "一个基于 Express 的 Web 应用1",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/view/5.d ADDED
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <section class="number-input-page">
3
+ <h1>数字输入示例</h1>
4
+ <p>请输入非负数字,最多两位小数:</p>
5
+ <div class="inputs-row">
6
+ <div class="input-item">
7
+ <span class="label">输入框 1:</span>
8
+ <el-input
9
+ v-model="value1"
10
+ placeholder="请输入数值"
11
+ clearable
12
+ @input="handleInput1"
13
+ />
14
+ </div>
15
+ <div class="input-item">
16
+ <span class="label">输入框 2:</span>
17
+ <el-input
18
+ v-model="value2"
19
+ placeholder="请输入数值"
20
+ clearable
21
+ @input="handleInput2"
22
+ />
23
+ </div>
24
+ <el-button type="primary" @click="onSearch">搜索</el-button>
25
+ </div>
26
+ <p class="preview">
27
+ 输入框1:{{ value1 || '(空)' }},
28
+ 输入框2:{{ value2 || '(空)' }}
29
+ </p>
30
+ </section>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+ name: "NumberInputView",
36
+ data() {
37
+ return {
38
+ value1: "",
39
+ value2: "",
40
+ };
41
+ },
42
+ methods: {
43
+ normalizeNumber(val) {
44
+ let v = String(val);
45
+ v = v.replace(/[^\d.]/g, "");
46
+ const dotIndex = v.indexOf(".");
47
+ if (dotIndex !== -1) {
48
+ v =
49
+ v.slice(0, dotIndex + 1) + v.slice(dotIndex + 1).replace(/\./g, "");
50
+ }
51
+ if (v.startsWith(".")) {
52
+ v = "0" + v;
53
+ }
54
+ v = v.replace(/^0+(\d)/, "$1");
55
+ v = v.replace(/^(\d+)(\.\d{0,2}).*$/, "$1$2");
56
+ return v;
57
+ },
58
+ handleInput1(val) {
59
+ this.value1 = this.normalizeNumber(val);
60
+ },
61
+ handleInput2(val) {
62
+ this.value2 = this.normalizeNumber(val);
63
+ },
64
+ onSearch() {
65
+ if (!this.value1 || !this.value2) {
66
+ this.$message.warning("请先输入两个数字");
67
+ return;
68
+ }
69
+ const n1 = parseFloat(this.value1);
70
+ const n2 = parseFloat(this.value2);
71
+ if (Number.isNaN(n1) || Number.isNaN(n2)) {
72
+ this.$message.error("输入的内容不是有效数字");
73
+ return;
74
+ }
75
+ if (n1 > n2) {
76
+ this.$message.error("输入框1的值不能大于输入框2,且输入框2不能小于输入框1");
77
+ return;
78
+ }
79
+ this.$message.success("校验通过");
80
+ },
81
+ },
82
+ };
83
+ </script>
84
+
85
+ <style scoped>
86
+ .number-input-page {
87
+ padding: 24px;
88
+ }
89
+ .preview {
90
+ margin-top: 12px;
91
+ }
92
+ .inputs-row {
93
+ display: flex;
94
+ align-items: center;
95
+ gap: 12px;
96
+ margin-top: 12px;
97
+ }
98
+ .input-item {
99
+ display: flex;
100
+ align-items: center;
101
+ gap: 4px;
102
+ }
103
+ .label {
104
+ white-space: nowrap;
105
+ }
106
+ </style>
package/view/q.d DELETED
@@ -1,16 +0,0 @@
1
- columns: [
2
- { key: "index", label: "序号", width: 60, align: "center", type: "index" },
3
- { key: "medalNo", prop: "medalNo", label: "勋章编号", minWidth: 180 },
4
- { key: "icon", label: "勋章图标", width: 90, align: "center", type: "icon" },
5
- { key: "medalName", prop: "medalName", label: "勋章名称", minWidth: 140 },
6
- { key: "medalObjName", prop: "medalObjName", label: "勋章对象", minWidth: 140 },
7
- { key: "confeMode", prop: "confeMode", label: "发放方式", width: 120, align: "center", type: "confeMode" },
8
- { key: "limitTmFlag", prop: "limitTmFlag", label: "是否限时", width: 100, align: "center", type: "limitTmFlag" },
9
- { key: "wearDurat", prop: "wearDurat", label: "限时时长", width: 120, align: "center", type: "wearDurat" },
10
- { key: "medalQty", prop: "medalQty", label: "发放数量", width: 100, align: "center", type: "medalQty" },
11
- { key: "issuedQty", prop: "issuedQty", label: "已发数量", width: 100, align: "center" },
12
- { key: "createTm", prop: "createTm", label: "创建日期", width: 160, align: "center", type: "createDate" },
13
- { key: "updateTm", prop: "updateTm", label: "更新日期", width: 160, align: "center", type: "updateDate" },
14
- { key: "activaFlag", prop: "activaFlag", label: "启用/停用", width: 120, align: "center", type: "switch" },
15
- { key: "actions", label: "操作", width: 140, align: "center", fixed: "right", type: "actions" }
16
- ],