xianniu-ui 0.8.25 → 0.8.27
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/lib/xianniu-ui.common.js +33207 -40222
- package/lib/xianniu-ui.umd.js +33207 -40222
- package/lib/xianniu-ui.umd.min.js +51 -60
- package/package.json +5 -2
- package/packages/city/main.vue +21 -7
- package/packages/search/main.vue +15 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xianniu-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/xianniu-ui.umd.min.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"style": "gulp --gulpfile ./packages/style/gulpfile.js",
|
|
11
11
|
"play": "cross-env NODE_ENV=development PLAY_ENV=true vue-cli-service serve",
|
|
12
12
|
"deploy": "bash deploy.sh",
|
|
13
|
-
"lint": "vue-cli-service lint"
|
|
13
|
+
"lint": "vue-cli-service lint",
|
|
14
|
+
"release": "node ./build/release.js"
|
|
14
15
|
},
|
|
15
16
|
"license": "MIT",
|
|
16
17
|
"files": [
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"eslint-plugin-vue": "^6.2.2",
|
|
49
50
|
"highlight.js": "^9.3.0",
|
|
50
51
|
"html-loader": "^3.0.1",
|
|
52
|
+
"inquirer": "^8.2.6",
|
|
51
53
|
"markdown-it": "^8.4.2",
|
|
52
54
|
"markdown-it-anchor": "^5.3.0",
|
|
53
55
|
"markdown-it-chain": "^1.3.0",
|
|
@@ -56,6 +58,7 @@
|
|
|
56
58
|
"mini-css-extract-plugin": "^0.4.1",
|
|
57
59
|
"sass": "^1.32.6",
|
|
58
60
|
"sass-loader": "^8.0.2",
|
|
61
|
+
"shelljs": "^0.8.5",
|
|
59
62
|
"transliteration": "^1.1.11",
|
|
60
63
|
"vue-template-compiler": "^2.7.14"
|
|
61
64
|
}
|
package/packages/city/main.vue
CHANGED
|
@@ -188,12 +188,9 @@ export default {
|
|
|
188
188
|
return recursive(data);
|
|
189
189
|
},
|
|
190
190
|
// 获取选中
|
|
191
|
-
handleChange(
|
|
191
|
+
handleChange(code) {
|
|
192
192
|
// 返回数组形式 code和label
|
|
193
|
-
const cityName = this.
|
|
194
|
-
const city = this.handleTreeLabel(cityCode, this.cityList, 2);
|
|
195
|
-
const cityCodeLast = cityCode[cityCode.length - 1];
|
|
196
|
-
const cityNameLast = cityName[cityName.length - 1];
|
|
193
|
+
const { city, cityCode, cityName, cityCodeLast, cityNameLast } = this.getRes(code);
|
|
197
194
|
let value = "";
|
|
198
195
|
if (this.valueKey) {
|
|
199
196
|
value = city[city.length - 1];
|
|
@@ -209,6 +206,20 @@ export default {
|
|
|
209
206
|
cityNameLast,
|
|
210
207
|
});
|
|
211
208
|
},
|
|
209
|
+
// 获取结果
|
|
210
|
+
getRes(cityCode) {
|
|
211
|
+
const cityName = this.handleTreeLabel(cityCode, this.cityList);
|
|
212
|
+
const city = this.handleTreeLabel(cityCode, this.cityList, 2);
|
|
213
|
+
const cityCodeLast = cityCode[cityCode.length - 1];
|
|
214
|
+
const cityNameLast = cityName[cityName.length - 1];
|
|
215
|
+
return {
|
|
216
|
+
city,
|
|
217
|
+
cityCode,
|
|
218
|
+
cityName,
|
|
219
|
+
cityCodeLast,
|
|
220
|
+
cityNameLast,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
212
223
|
/**
|
|
213
224
|
* 根据城市code 获取对应的城市
|
|
214
225
|
* @param {Array} val 选中的城市code
|
|
@@ -253,7 +264,9 @@ export default {
|
|
|
253
264
|
const [cityName, ...rest] = nameList;
|
|
254
265
|
const item =
|
|
255
266
|
data &&
|
|
256
|
-
data.find(
|
|
267
|
+
data.find(
|
|
268
|
+
(i) => i.cityName === cityName || cityName.indexOf(i.cityName) > -1
|
|
269
|
+
);
|
|
257
270
|
if (item) {
|
|
258
271
|
return [item.cityCode, ...this.getCity(item.subCitys, rest)];
|
|
259
272
|
} else {
|
|
@@ -270,7 +283,8 @@ export default {
|
|
|
270
283
|
return ZXCITY.includes(item) && idx === 0 ? [item, ...arr] : arr;
|
|
271
284
|
})[0];
|
|
272
285
|
const arr = this.getCity(this.cityList, newarr);
|
|
273
|
-
|
|
286
|
+
const res = this.getRes(arr);
|
|
287
|
+
return { ...res };
|
|
274
288
|
},
|
|
275
289
|
},
|
|
276
290
|
};
|
package/packages/search/main.vue
CHANGED
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
? ['00:00:00', '23:59:59']
|
|
114
114
|
: item.defaultTime
|
|
115
115
|
"
|
|
116
|
-
@on-change="
|
|
116
|
+
@on-change="item.change && item.change($event, item.prop)"
|
|
117
117
|
@on-format="onChangeDateFormat"
|
|
118
118
|
/>
|
|
119
119
|
</el-form-item>
|
|
@@ -244,16 +244,16 @@ export default {
|
|
|
244
244
|
return flag;
|
|
245
245
|
};
|
|
246
246
|
},
|
|
247
|
-
btnLabelWidth(){
|
|
248
|
-
const {lastLabelWidth,labelWidth} = this
|
|
249
|
-
let w = labelWidth
|
|
250
|
-
if(lastLabelWidth!=null){
|
|
251
|
-
w=lastLabelWidth
|
|
252
|
-
} else if(this.form.value.length === 1 || !this.isColl){
|
|
253
|
-
w=0
|
|
247
|
+
btnLabelWidth() {
|
|
248
|
+
const { lastLabelWidth, labelWidth } = this;
|
|
249
|
+
let w = labelWidth;
|
|
250
|
+
if (lastLabelWidth != null) {
|
|
251
|
+
w = lastLabelWidth;
|
|
252
|
+
} else if (this.form.value.length === 1 || !this.isColl) {
|
|
253
|
+
w = 0;
|
|
254
254
|
}
|
|
255
|
-
return w
|
|
256
|
-
}
|
|
255
|
+
return w;
|
|
256
|
+
},
|
|
257
257
|
},
|
|
258
258
|
data() {
|
|
259
259
|
return {
|
|
@@ -315,15 +315,15 @@ export default {
|
|
|
315
315
|
this.$emit("on-search", formValue);
|
|
316
316
|
},
|
|
317
317
|
onReset() {
|
|
318
|
-
this.resetFields()
|
|
318
|
+
this.resetFields();
|
|
319
319
|
this.$emit("on-reset");
|
|
320
320
|
this.$emit("on-search", {});
|
|
321
321
|
},
|
|
322
|
-
onChangeDate() {
|
|
323
|
-
|
|
322
|
+
onChangeDate(val) {
|
|
323
|
+
console.log(val);
|
|
324
324
|
},
|
|
325
|
-
onChangeDateFormat() {
|
|
326
|
-
|
|
325
|
+
onChangeDateFormat(val) {
|
|
326
|
+
console.log(val);
|
|
327
327
|
},
|
|
328
328
|
handleChangeCity({ cityCodeLast: cityCode, cityNameLast: cityName }) {
|
|
329
329
|
this.city = { cityCode, cityName };
|