leisure-core 0.4.6 → 0.4.7

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/index.js CHANGED
@@ -41,6 +41,7 @@ import LeMpurl from "./le-mpurl/index.js";
41
41
  import { LeHelp, LeHelpDetail } from "./le-help/index.js";
42
42
  import LeDistribution from "./le-distribution/index.js";
43
43
  import LeDistributionCategory from "./le-distribution-category/index.js";
44
+ import LeSelectUser from "./le-select-user/index.js";
44
45
 
45
46
  const components = [
46
47
  LeArea,
@@ -83,6 +84,7 @@ const components = [
83
84
  LeHelpDetail,
84
85
  LeDistribution,
85
86
  LeDistributionCategory,
87
+ LeSelectUser,
86
88
  ];
87
89
 
88
90
  const install = function (Vue) {
@@ -195,4 +197,5 @@ export default {
195
197
  LeHelpDetail,
196
198
  LeDistribution,
197
199
  LeDistributionCategory,
200
+ LeSelectUser,
198
201
  };
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <el-cascader
3
+ ref="elcascader"
3
4
  v-model="value"
4
5
  clearable
5
6
  :props="props"
@@ -37,13 +38,6 @@ export default {
37
38
  };
38
39
  },
39
40
  watch: {
40
- initArea: {
41
- handler(val) {
42
- this.value = val;
43
- },
44
- deep: true,
45
- immediate: true,
46
- },
47
41
  isAny: {
48
42
  handler(val) {
49
43
  this.props.checkStrictly = val;
@@ -51,7 +45,9 @@ export default {
51
45
  immediate: true,
52
46
  },
53
47
  },
54
- mounted() {},
48
+ mounted() {
49
+ this.value = this.initArea;
50
+ },
55
51
  methods: {
56
52
  LoadData(node, resolve) {
57
53
  let nodes = [];
@@ -67,7 +63,12 @@ export default {
67
63
  });
68
64
  },
69
65
  handleChange(currentValue) {
70
- this.$emit("areaChange", JSON.stringify(currentValue));
66
+ let selectValue = {};
67
+ selectValue.code = currentValue;
68
+ if (!selectValue.code || selectValue.code.length <= 0) return;
69
+ let names = this.$refs["elcascader"].getCheckedNodes()[0].pathLabels;
70
+ selectValue.name = names.join("");
71
+ this.$emit("areaChange", selectValue);
71
72
  },
72
73
  },
73
74
  };
@@ -0,0 +1,7 @@
1
+ import LeSelectUser from "./src/main.vue";
2
+
3
+ LeSelectUser.install = function (Vue) {
4
+ Vue.component(LeSelectUser.name, LeSelectUser);
5
+ };
6
+
7
+ export default LeSelectUser;
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <el-select
3
+ v-model="value"
4
+ multiple
5
+ :multiple-limit="limitNum"
6
+ filterable
7
+ remote
8
+ reserve-keyword
9
+ placeholder="请输入用户关键字"
10
+ :remote-method="getUserBack"
11
+ :loading="loading"
12
+ @change="onChange"
13
+ >
14
+ <el-option
15
+ v-for="item in userList"
16
+ :key="item.id"
17
+ :label="item.account + '-' + (item.nick ? item.nick : '')"
18
+ :value="item.id"
19
+ >
20
+ </el-option>
21
+ </el-select>
22
+ </template>
23
+ <script>
24
+ import { listBack } from "@/api/user.js";
25
+ export default {
26
+ name: "le-select-user",
27
+ props: {
28
+ limitNum: {
29
+ type: Number,
30
+ default: 999,
31
+ },
32
+ },
33
+ data() {
34
+ return {
35
+ value: [],
36
+ userList: [],
37
+ loading: false,
38
+ };
39
+ },
40
+ watch: {},
41
+ mounted() {
42
+ this.value = this.initArea;
43
+ },
44
+ methods: {
45
+ getUserBack(comment) {
46
+ this.userList = [];
47
+ let param = {};
48
+ param.comment = comment;
49
+ if (param) {
50
+ this.loading = true;
51
+ listBack(param)
52
+ .then((res) => {
53
+ let data = res.data.data;
54
+ if (data) {
55
+ this.userList = data;
56
+ }
57
+ this.loading = false;
58
+ })
59
+ .catch((err) => {
60
+ console.log(err);
61
+ this.loading = false;
62
+ });
63
+ }
64
+ },
65
+ onChange(value) {
66
+ console.log(value);
67
+ },
68
+ },
69
+ };
70
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",