zydx-plus 1.19.95 → 1.19.97

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.19.95",
3
+ "version": "1.19.97",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -53,6 +53,11 @@ export default {
53
53
  required: true,
54
54
  },
55
55
  },
56
+ data () {
57
+ return {
58
+ pcatalogIds: ''
59
+ }
60
+ },
56
61
  computed: {
57
62
  targetTree: function () {
58
63
  let that = this;
@@ -109,7 +114,10 @@ export default {
109
114
  },
110
115
  // 点击回调事件
111
116
  clickItem(item) {
117
+ this.getPcatalogIds(item.pcatalogId);
118
+ item["catalogPIds"] = this.pcatalogIds.split("").reverse().join("");
112
119
  this.$emit("clickItem", item);
120
+ this.pcatalogIds = '';
113
121
  },
114
122
  // 递归调用修改状态
115
123
  setIsShowUpDown(item, index) {
@@ -123,6 +131,20 @@ export default {
123
131
  }
124
132
  }
125
133
  },
134
+ // 获取当前节点的父级id
135
+ getPcatalogIds: function (pcatalogId) {
136
+ let that = this
137
+ if (pcatalogId === '-1') {
138
+ that.pcatalogIds += ','
139
+ } else {
140
+ this.treeData.some(function (item) {
141
+ if (item.catalogId === pcatalogId) {
142
+ that.pcatalogIds += ',' + item.catalogId
143
+ that.getPcatalogIds(item.pcatalogId)
144
+ }
145
+ })
146
+ }
147
+ },
126
148
  },
127
149
  };
128
150
  </script>
@@ -134,6 +156,7 @@ export default {
134
156
  text-overflow: ellipsis;
135
157
  padding: 0px 10px;
136
158
  width: 100%;
159
+ box-sizing: border-box;
137
160
  }
138
161
 
139
162
  </style>
@@ -24,6 +24,7 @@ selectItem 传入当前选择的节点,是一个对象
24
24
  class="widthB100 ellipse cursor "
25
25
  :class="menuTitleStyle"
26
26
  @click.stop="clickItem(menuInfo)"
27
+ :title="menuInfo.title"
27
28
  >
28
29
  <template v-if="menuConfig.isCheckBox">
29
30
  <checkBox v-model="menuConfig.checkBoxValue" :value="menuInfo.catalogId"></checkBox>
@@ -15,7 +15,8 @@
15
15
  <div v-if="type === 'radio'">
16
16
  <div class="radio-list" v-for="(item,index) in radioArr" :key="index">
17
17
  <label>
18
- <input type="radio" name="radio" :value="item.value" :checked="item.checked" @change="radioTao(index)" />
18
+ <input type="radio" name="radio" :value="item.value" :checked="item.checked"
19
+ @change="radioTao(index)"/>
19
20
  <span>{{ item.label }}</span>
20
21
  </label>
21
22
  </div>
@@ -23,8 +24,15 @@
23
24
  <div class="tip-img" v-if="type === 'input'">
24
25
  <div class="tip-input" v-for="(item,index) in inputArr" :key="index">
25
26
  <span v-if="item.name">{{ item.name }}</span>
26
- <input v-if="item.type === 'input'" type="text" :placeholder="item.placeholder"
27
- v-model="item.value" :disabled="item.disabled"/>
27
+ <div style="display: inline-block;" v-if="item.type === 'input'">
28
+ <input v-if="!item.number" type="text" :placeholder="item.placeholder"
29
+ v-model="item.value" :disabled="item.disabled"/>
30
+ <div v-else class="number-input">
31
+ <input type="number" @keypress="isNumberKey($event,index)"
32
+ :placeholder="item.placeholder"
33
+ v-model="item.value" :disabled="item.disabled"/>
34
+ </div>
35
+ </div>
28
36
  <div style="display: inline-block;">
29
37
  <Select v-if="item.type === 'select'" :options="item.option"
30
38
  v-model:value="item.selectValue"></Select>
@@ -36,8 +44,11 @@
36
44
  </div>
37
45
  <div v-if="item.type === 'text'" class="text">{{ item.value }}</div>
38
46
  <div v-if="item.type === 'code'" class="ph-code">
39
- <input type="text" v-model="item.value" :placeholder="item.placeholder" />
40
- <button ref="tipID" @click="item.codeTap($refs.tipID[0],inputArr)">{{ item.butVal }}</button>
47
+ <input type="text" v-model="item.value" :placeholder="item.placeholder"/>
48
+ <button ref="tipID" @click="item.codeTap($refs.tipID[0],inputArr)">{{
49
+ item.butVal
50
+ }}
51
+ </button>
41
52
  </div>
42
53
  </div>
43
54
  </div>
@@ -55,6 +66,20 @@
55
66
  <script>
56
67
  import Select from '../../select/src/select.vue'
57
68
  import Calendar from '../../calendar/src/Calendar'
69
+ function isNumberKey(evt) {
70
+ var charCode = (evt.which) ? evt.which : event.keyCode;
71
+ if (charCode === 46) {
72
+ // Check if the text already contains a decimal point
73
+ return evt.target.value.indexOf('.') === -1;
74
+ } else if (charCode > 31 && (charCode < 48 || charCode > 57))
75
+ return false;
76
+
77
+ // Check if the first character is zero
78
+ return !(evt.target.value === '' && String.fromCharCode(charCode) === '0');
79
+
80
+
81
+ }
82
+
58
83
 
59
84
  export default {
60
85
  name: 'zydx-tip-box',
@@ -110,7 +135,31 @@ export default {
110
135
  }
111
136
  },
112
137
  methods: {
113
- radioTao(index){
138
+ isNumberKey(evt,index) {
139
+ const charCode = (evt.which) ? evt.which : event.keyCode;
140
+ if (charCode === 46) {
141
+ if (this.inputArr[index].value.indexOf('.') !== -1)
142
+ evt.preventDefault();
143
+ else
144
+ return true;
145
+ } else if (charCode > 31 && (charCode < 48 || charCode > 57))
146
+ evt.preventDefault();
147
+
148
+ if (this.valueState(this.inputArr[index].value) && String.fromCharCode(charCode) === '0')
149
+ evt.preventDefault();
150
+ // 判断是否有小数点
151
+ if(this.inputArr[index].value === undefined) return true
152
+ if (this.inputArr[index].value.indexOf('.') !== -1) {
153
+ // 判断小数点的位数
154
+ if (this.inputArr[index].value.split('.')[1].length >= 1) {
155
+ evt.preventDefault();
156
+ }
157
+ }
158
+ },
159
+ valueState(v) {
160
+ return v === '' || v === undefined || v === null;
161
+ },
162
+ radioTao(index) {
114
163
  this.radioArr.forEach(item => {
115
164
  item.checked = false
116
165
  })
@@ -100,6 +100,7 @@ font-size: 12px;
100
100
  line-height: 30px;
101
101
  padding-right: 10px;
102
102
  text-align: right;
103
+ float: left;
103
104
  }
104
105
  .tip-input input{
105
106
  width: 211px;
@@ -167,4 +168,21 @@ font-size: 12px;
167
168
  top: 12px;
168
169
  left: 20px;
169
170
  z-index: 1;
171
+ }
172
+ .number-input{
173
+ width: 211px;
174
+ height: 32px;
175
+ box-sizing: border-box;
176
+ font-size: 16px;
177
+ outline: none;
178
+ border: 1px solid #ccc;
179
+ border-radius: 3px;
180
+ box-shadow: 0 1px 0 1px rgb(0 0 0 / 4%);
181
+ overflow: hidden;
182
+ }
183
+ .number-input>input{
184
+ border: 0 !important;
185
+ box-shadow: none !important;
186
+ height: 30px !important;
187
+ width: 240px !important;
170
188
  }
package/src/index.js CHANGED
@@ -57,7 +57,7 @@ function install(app) {
57
57
  }
58
58
 
59
59
  export default {
60
- version: '1.19.95',
60
+ version: '1.19.97',
61
61
  install,
62
62
  Calendar,
63
63
  Message,