leisure-core 0.1.0

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 (61) hide show
  1. package/index.js +145 -0
  2. package/le-button/index.js +7 -0
  3. package/le-button/src/main.vue +48 -0
  4. package/le-button-msg/index.js +7 -0
  5. package/le-button-msg/src/main.vue +61 -0
  6. package/le-button-select-media/index.js +7 -0
  7. package/le-button-select-media/src/main.vue +64 -0
  8. package/le-button-upload/index.js +7 -0
  9. package/le-button-upload/src/main.vue +50 -0
  10. package/le-company/index.js +7 -0
  11. package/le-company/src/main.vue +101 -0
  12. package/le-company/src/sub.vue +111 -0
  13. package/le-coupon-give/index.js +7 -0
  14. package/le-coupon-give/src/main.vue +94 -0
  15. package/le-depart/index.js +7 -0
  16. package/le-depart/src/main.vue +162 -0
  17. package/le-dialog-container/index.js +7 -0
  18. package/le-dialog-container/src/main.vue +74 -0
  19. package/le-home/index.js +7 -0
  20. package/le-home/src/main.vue +570 -0
  21. package/le-image/index.js +7 -0
  22. package/le-image/src/main.vue +145 -0
  23. package/le-integral/index.js +7 -0
  24. package/le-integral/src/main.vue +198 -0
  25. package/le-libs/mixins/main.js +37 -0
  26. package/le-login/index.js +7 -0
  27. package/le-login/src/main.vue +181 -0
  28. package/le-media/index.js +7 -0
  29. package/le-media/src/main.vue +267 -0
  30. package/le-media-list/index.js +7 -0
  31. package/le-media-list/src/main.vue +177 -0
  32. package/le-media-upload/index.js +7 -0
  33. package/le-media-upload/src/main.vue +308 -0
  34. package/le-member/index.js +7 -0
  35. package/le-member/src/main.vue +445 -0
  36. package/le-member-level/index.js +7 -0
  37. package/le-member-level/src/main.vue +93 -0
  38. package/le-member-level/src/sub.vue +86 -0
  39. package/le-menu/index.js +7 -0
  40. package/le-menu/src/main.vue +248 -0
  41. package/le-rich-text/index.js +7 -0
  42. package/le-rich-text/src/main.vue +136 -0
  43. package/le-role/index.js +7 -0
  44. package/le-role/src/main.vue +169 -0
  45. package/le-role/src/sub.vue +79 -0
  46. package/le-role-user/index.js +7 -0
  47. package/le-role-user/src/main.vue +158 -0
  48. package/le-role-user/src/sub.vue +90 -0
  49. package/le-theme/common/var.scss +17 -0
  50. package/le-theme/iconfont/iconfont.css +125 -0
  51. package/le-theme/iconfont/iconfont.ttf +0 -0
  52. package/le-theme/iconfont/iconfont.woff +0 -0
  53. package/le-theme/iconfont/iconfont.woff2 +0 -0
  54. package/le-theme/pages/index.css +15 -0
  55. package/le-user/index.js +7 -0
  56. package/le-user/src/add.vue +118 -0
  57. package/le-user/src/main.vue +423 -0
  58. package/le-user/src/sub.vue +214 -0
  59. package/le-user-type/index.js +7 -0
  60. package/le-user-type/src/main.vue +39 -0
  61. package/package.json +51 -0
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <el-form
3
+ ref="formName"
4
+ :model="ruleForm"
5
+ :rules="rules"
6
+ status-icon
7
+ label-width="100px"
8
+ class="demo-ruleForm"
9
+ >
10
+ <el-form-item label="选择优惠券" prop="cid">
11
+ <el-select v-model="ruleForm.cid" placeholder="请选择">
12
+ <el-option
13
+ v-for="coupon in coupons"
14
+ :key="coupon.id"
15
+ :label="coupon.title"
16
+ :value="coupon.id"
17
+ >
18
+ </el-option>
19
+ </el-select>
20
+ </el-form-item>
21
+ <el-form-item v-rfooter>
22
+ <el-button type="info" @click="close()">取消</el-button>
23
+ <el-button type="primary" @click="save">保存</el-button>
24
+ </el-form-item>
25
+ </el-form>
26
+ </template>
27
+ <script>
28
+ import { listAllValid, sendCoupons } from "@/api/coupon";
29
+ export default {
30
+ name: "le-coupon-give",
31
+ props: {
32
+ uid: {
33
+ type: String,
34
+ default: "",
35
+ },
36
+ unionid: {
37
+ type: String,
38
+ default: "",
39
+ },
40
+ },
41
+ data() {
42
+ return {
43
+ coupons: [],
44
+ ruleForm: {
45
+ cid: "",
46
+ },
47
+ rules: {
48
+ cid: [{ required: true, message: "必须选择优惠券", trigger: "blur" }],
49
+ },
50
+ };
51
+ },
52
+ mounted() {
53
+ this.getAllCouponList();
54
+ },
55
+ methods: {
56
+ click(param) {
57
+ this.$emit("click", param);
58
+ },
59
+ getAllCouponList() {
60
+ let param = {};
61
+ param.pageNo = 1;
62
+ listAllValid(param).then((res) => {
63
+ this.coupons = res.data.data.list;
64
+ });
65
+ },
66
+ save() {
67
+ this.$refs.formName.validate((valid) => {
68
+ if (valid) {
69
+ let params = {
70
+ couponId: this.ruleForm.cid,
71
+ uid: this.uid,
72
+ unionid: this.unionid,
73
+ source: "后台赠送优惠券",
74
+ };
75
+ sendCoupons(params)
76
+ .then((res) => {
77
+ this.close();
78
+ this.$message.success(res.data.info);
79
+ })
80
+ .catch((err) => {
81
+ this.$message.success(err);
82
+ });
83
+ } else {
84
+ console.log("error submit!!");
85
+ return false;
86
+ }
87
+ });
88
+ },
89
+ close() {
90
+ this.$emit("close");
91
+ },
92
+ },
93
+ };
94
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeDepart from "./src/main.vue";
2
+
3
+ LeDepart.install = function (Vue) {
4
+ Vue.component(LeDepart.name, LeDepart);
5
+ };
6
+
7
+ export default LeDepart;
@@ -0,0 +1,162 @@
1
+ <template>
2
+ <div class="le-depart-container">
3
+ <el-form :inline="true">
4
+ <el-form-item>
5
+ <el-button type="primary" @click="getdepartList()">查询</el-button>
6
+ <el-button type="primary" @click="adddepart()">新建部门</el-button>
7
+ </el-form-item>
8
+ </el-form>
9
+ <el-table :data="tableData" border row-key="id" stripe style="width: 100%">
10
+ <el-table-column prop="dcode" label="部门编码" align="center">
11
+ </el-table-column>
12
+ <el-table-column prop="dname" label="部门名称" align="center">
13
+ </el-table-column>
14
+ <el-table-column prop="note" label="备注" align="center">
15
+ </el-table-column>
16
+ <el-table-column fixed="right" label="操作" align="center" width="180">
17
+ <template slot-scope="scope">
18
+ <le-button text="编辑" @click="editdepart(scope.row)"></le-button>
19
+ <le-button-msg @click="del(scope.row.id)"></le-button-msg>
20
+ </template>
21
+ </el-table-column>
22
+ </el-table>
23
+ <le-dialog-container
24
+ title="新建/编辑部门"
25
+ :showDialog="showAddPageModal"
26
+ :showFooter="true"
27
+ @close="handleClose"
28
+ @saveData="savedepart"
29
+ >
30
+ <el-form
31
+ :model="ruleForm"
32
+ :rules="rules"
33
+ ref="ruleForm"
34
+ label-width="140px"
35
+ >
36
+ <el-form-item label="部门编码" prop="dcode">
37
+ <el-input v-model="ruleForm.dcode"></el-input>
38
+ </el-form-item>
39
+ <el-form-item label="部门名称" prop="dname">
40
+ <el-input v-model="ruleForm.dname"></el-input>
41
+ </el-form-item>
42
+ <el-form-item label="备注" prop="note">
43
+ <el-input v-model="ruleForm.note"></el-input>
44
+ </el-form-item>
45
+ </el-form>
46
+ </le-dialog-container>
47
+ </div>
48
+ </template>
49
+ <script>
50
+ import {
51
+ departCreate,
52
+ departDel,
53
+ departEdit,
54
+ departList,
55
+ getMaxDepartNo,
56
+ } from "@/api/depart";
57
+ import LeButton from "leisure-ui/le-button/index";
58
+ import LeButtonMsg from "leisure-ui/le-button-msg/index";
59
+ import LeDialogContainer from "leisure-ui/le-dialog-container/index";
60
+ export default {
61
+ name: "le-depart",
62
+ components: {
63
+ LeButton,
64
+ LeButtonMsg,
65
+ LeDialogContainer,
66
+ },
67
+ data() {
68
+ return {
69
+ tableData: [],
70
+ ruleForm: {
71
+ id: "",
72
+ dcode: "",
73
+ dname: "",
74
+ pcode: "",
75
+ note: "",
76
+ },
77
+ rules: {
78
+ dname: [
79
+ { required: true, message: "请输入部门名称", trigger: "blur" },
80
+ { max: 50, message: "长度在 1 到 50个字符", trigger: "blur" },
81
+ ],
82
+ dcode: [
83
+ { required: true, message: "请输入部门编码", trigger: "blur" },
84
+ { min: 2, message: "长度最小是2个字符", trigger: "blur" },
85
+ ],
86
+ note: [{ max: 100, message: "长度在 1 到 100个字符", trigger: "blur" }],
87
+ },
88
+ showAddPageModal: false,
89
+ isEditdepart: false,
90
+ };
91
+ },
92
+ computed: {},
93
+ mounted() {
94
+ this.getdepartList();
95
+ },
96
+ methods: {
97
+ adddepart() {
98
+ this.showAddPageModal = true;
99
+ this.isEditdepart = false;
100
+ getMaxDepartNo().then((res) => {
101
+ this.ruleForm.dcode = res.data.data;
102
+ });
103
+ },
104
+ editdepart(row) {
105
+ this.ruleForm = JSON.parse(JSON.stringify(row));
106
+ this.showAddPageModal = true;
107
+ this.isEditdepart = true;
108
+ },
109
+ savedepart() {
110
+ let params = JSON.parse(JSON.stringify(this.ruleForm));
111
+ this.$refs["ruleForm"].validate((valid) => {
112
+ if (valid) {
113
+ if (this.isEditdepart) {
114
+ departEdit(params).then(() => {
115
+ this.$message.success("修改部门成功~");
116
+ this.getdepartList();
117
+ this.handleClose();
118
+ });
119
+ } else {
120
+ departCreate(params)
121
+ .then(() => {
122
+ this.$message.success("新建部门成功~");
123
+ this.getdepartList();
124
+ this.handleClose();
125
+ })
126
+ .catch((err) => {
127
+ this.$message.error(err);
128
+ });
129
+ }
130
+ } else {
131
+ console.log("error submit!!");
132
+ return false;
133
+ }
134
+ });
135
+ },
136
+ handleClose() {
137
+ this.showAddPageModal = false;
138
+ this.initForm();
139
+ },
140
+ getdepartList() {
141
+ departList().then((res) => {
142
+ this.tableData = res.data.data || [];
143
+ });
144
+ },
145
+ del(id) {
146
+ departDel({
147
+ id: id,
148
+ }).then((response) => {
149
+ this.getdepartList();
150
+ this.$message.success("删除部门成功");
151
+ });
152
+ },
153
+ initForm() {
154
+ this.ruleForm.id = "";
155
+ this.ruleForm.dcode = "";
156
+ this.ruleForm.dname = "";
157
+ this.ruleForm.pcode = "";
158
+ this.ruleForm.note = "";
159
+ },
160
+ },
161
+ };
162
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeDialogContainer from "./src/main.vue";
2
+
3
+ LeDialogContainer.install = function (Vue) {
4
+ Vue.component(LeDialogContainer.name, LeDialogContainer);
5
+ };
6
+
7
+ export default LeDialogContainer;
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <el-dialog
3
+ :width="width"
4
+ :title="title"
5
+ :visible.sync="dialogShow"
6
+ :close-on-click-modal="closeMode"
7
+ append-to-body
8
+ @close="closeDialog"
9
+ v-el-drag-dialog
10
+ >
11
+ <slot v-if="dialogShow" />
12
+ <div slot="footer" v-if="showFooter" class="dialog-footer">
13
+ <template>
14
+ <el-button type="info" @click="closeDialog">关闭</el-button>
15
+ <el-button type="primary" v-if="showSaveBtn" @click="saveData"
16
+ >确 定</el-button
17
+ >
18
+ </template>
19
+ </div>
20
+ </el-dialog>
21
+ </template>
22
+ <script>
23
+ export default {
24
+ name: "le-dialog-container",
25
+ props: {
26
+ showDialog: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ width: {
31
+ type: String,
32
+ default: "60%",
33
+ },
34
+ title: {
35
+ type: String,
36
+ default: "商品详情",
37
+ },
38
+ closeMode: {
39
+ type: Boolean,
40
+ default: false,
41
+ },
42
+ showFooter: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ showSaveBtn: {
47
+ type: Boolean,
48
+ default: true,
49
+ },
50
+ },
51
+ data() {
52
+ return {};
53
+ },
54
+ computed: {
55
+ dialogShow: {
56
+ get() {
57
+ return this.showDialog;
58
+ },
59
+ set(newValue) {
60
+ // this.$emit("close", newValue);
61
+ },
62
+ },
63
+ },
64
+ mounted() {},
65
+ methods: {
66
+ closeDialog(param) {
67
+ this.$emit("close", param);
68
+ },
69
+ saveData() {
70
+ this.$emit("saveData");
71
+ },
72
+ },
73
+ };
74
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeHome from "./src/main.vue";
2
+
3
+ LeHome.install = function (Vue) {
4
+ Vue.component(LeHome.name, LeHome);
5
+ };
6
+
7
+ export default LeHome;