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
package/index.js ADDED
@@ -0,0 +1,145 @@
1
+ import LeDrag from "leisure-js/drag/drag.js";
2
+ import { parseTime, formatMoney } from "leisure-js/common/dformat";
3
+ import LeLogin from "./le-login/index.js";
4
+ import LeHome from "./le-home/index.js";
5
+ import LeButton from "./le-button/index.js";
6
+ import LeButtonMsg from "./le-button-msg/index.js";
7
+ import LeCompany from "./le-company/index.js";
8
+ import LeDialogContainer from "./le-dialog-container/index.js";
9
+ import LeRole from "./le-role/index.js";
10
+ import LeMenu from "./le-menu/index.js";
11
+ import LeRoleUser from "./le-role-user/index.js";
12
+ import LeDepart from "./le-depart/index.js";
13
+ import LeCouponGive from "./le-coupon-give/index.js";
14
+ import LeUser from "./le-user/index.js";
15
+ import LeUserType from "./le-user-type/index.js";
16
+ import LeMedia from "./le-media/index.js";
17
+ import LeIntegral from "./le-integral/index.js";
18
+ import LeMember from "./le-member/index.js";
19
+ import LeMemberLevel from "./le-member-level/index.js";
20
+ import LeMediaUpload from "./le-media-upload/index.js";
21
+ import LeMediaList from "./le-media-list/index.js";
22
+ import LeRichText from "./le-rich-text/index.js";
23
+ import LeButtonUpload from "./le-button-upload/index.js";
24
+ import LeButtonSelectMedia from "./le-button-select-media/index.js";
25
+ import LeImage from "./le-image/index.js";
26
+
27
+ const components = [
28
+ LeButton,
29
+ LeButtonMsg,
30
+ LeCompany,
31
+ LeDialogContainer,
32
+ LeLogin,
33
+ LeHome,
34
+ LeMenu,
35
+ LeRole,
36
+ LeRoleUser,
37
+ LeDepart,
38
+ LeCouponGive,
39
+ LeUser,
40
+ LeUserType,
41
+ LeMedia,
42
+ LeMediaUpload,
43
+ LeIntegral,
44
+ LeMember,
45
+ LeMemberLevel,
46
+ LeMediaList,
47
+ LeRichText,
48
+ LeButtonUpload,
49
+ LeButtonSelectMedia,
50
+ LeImage,
51
+ ];
52
+
53
+ const install = function (Vue) {
54
+ if (install.installed) return;
55
+
56
+ components.forEach((component) => {
57
+ Vue.component(component.name, component);
58
+ });
59
+
60
+ Vue.prototype.parseTime = parseTime;
61
+ Vue.prototype.formatMoney = formatMoney;
62
+
63
+ Vue.directive("permission", {
64
+ inserted: function (el, bindings) {
65
+ let buttons = bindings.value;
66
+ if (buttons && buttons.length > 0) {
67
+ let btnConfigs = JSON.parse(buttons);
68
+ if (btnConfigs && btnConfigs.length > 0) {
69
+ for (let i = 0; i < btnConfigs.length; i++) {
70
+ let btnConfig = btnConfigs[i];
71
+ if (btnConfig.id == el.id && btnConfig.permission == "no") {
72
+ if (!el || !el.parentNode) return;
73
+ el.parentNode.removeChild(el);
74
+ }
75
+ }
76
+ }
77
+ }
78
+ },
79
+ });
80
+
81
+ Vue.directive("el-drag-dialog", LeDrag);
82
+
83
+ // Vue.directive("rtable", {
84
+ // bind(el) {
85
+ // const { componentInstance: $table } = vnode;
86
+ // let tableTop = el.getBoundingClientRect().top;
87
+ // let body = window.innerHeight - tableTop - 90;
88
+ // el.style["max-height"] = `${body}px`;
89
+ // el.style["overflow-y"] = "auto";
90
+ // console.log(el);
91
+ // el.setAttribute("ref", "eltablemain");
92
+ // el.setAttribute(":max-height", "elTableMaxHeight");
93
+ // el.setAttribute(":header-cell-style", "{ 'text-align': 'center' }");
94
+ // el.setAttribute(":cell-style", "{ 'text-align': 'center' }");
95
+ // },
96
+ // });
97
+
98
+ Vue.directive("rfooter", {
99
+ //参数支持"center"
100
+ bind(el, binding, vnode) {
101
+ let param = binding.value;
102
+ if (!param) {
103
+ param = "right";
104
+ }
105
+ el.setAttribute(
106
+ "style",
107
+ `display:flex;display:-webkit-flex;justify-content:${param};margin-bottom:-20px`
108
+ );
109
+ },
110
+ });
111
+ };
112
+
113
+ //判断是否是直接引入文件
114
+ if (typeof window !== "undefined" && window.Vue) {
115
+ window["el-drag-dialog"] = LeDrag;
116
+ install(window.Vue);
117
+ }
118
+
119
+ export default {
120
+ install,
121
+ LeButton,
122
+ LeButtonMsg,
123
+ LeCompany,
124
+ LeDialogContainer,
125
+ LeLogin,
126
+ LeHome,
127
+ LeMenu,
128
+ LeRole,
129
+ LeRoleUser,
130
+ LeDrag,
131
+ LeDepart,
132
+ LeCouponGive,
133
+ LeUser,
134
+ LeUserType,
135
+ LeMedia,
136
+ LeMediaUpload,
137
+ LeIntegral,
138
+ LeMember,
139
+ LeMemberLevel,
140
+ LeMediaList,
141
+ LeRichText,
142
+ LeButtonUpload,
143
+ LeButtonSelectMedia,
144
+ LeImage,
145
+ };
@@ -0,0 +1,7 @@
1
+ import LeButton from "./src/main.vue";
2
+
3
+ LeButton.install = function (Vue) {
4
+ Vue.component(LeButton.name, LeButton);
5
+ };
6
+
7
+ export default LeButton;
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <el-button
3
+ :id="id"
4
+ :type="type"
5
+ :size="size"
6
+ :v-permission="permission"
7
+ @click="click"
8
+ style="margin-left: 2px; margin-right: 2px"
9
+ v-if="disp"
10
+ >{{ text }}</el-button
11
+ >
12
+ </template>
13
+ <script>
14
+ export default {
15
+ name: "le-button",
16
+ props: {
17
+ id: {
18
+ type: String,
19
+ default: "",
20
+ },
21
+ type: {
22
+ type: String,
23
+ default: "primary",
24
+ },
25
+ size: {
26
+ type: String,
27
+ default: "small",
28
+ },
29
+ permission: {
30
+ type: String,
31
+ default: "$route.params.btns",
32
+ },
33
+ text: {
34
+ type: String,
35
+ default: "按钮",
36
+ },
37
+ disp: {
38
+ type: Boolean,
39
+ default: true,
40
+ },
41
+ },
42
+ methods: {
43
+ click(param) {
44
+ this.$emit("click", param);
45
+ },
46
+ },
47
+ };
48
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeButtonMsg from "./src/main.vue";
2
+
3
+ LeButtonMsg.install = function (Vue) {
4
+ Vue.component(LeButtonMsg.name, LeButtonMsg);
5
+ };
6
+
7
+ export default LeButtonMsg;
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <el-popconfirm
3
+ :title="title"
4
+ :id="id"
5
+ @confirm="click"
6
+ :v-permission="permission"
7
+ style="margin-left: 2px; margin-right: 2px"
8
+ v-if="disp"
9
+ >
10
+ <template #reference>
11
+ <el-button :type="type" :size="size"
12
+ ><span v-if="!isDispSlot">{{ text }}</span
13
+ ><slot v-if="isDispSlot"></slot
14
+ ></el-button>
15
+ </template>
16
+ </el-popconfirm>
17
+ </template>
18
+ <script>
19
+ export default {
20
+ name: "le-button-msg",
21
+ props: {
22
+ id: {
23
+ type: String,
24
+ default: "",
25
+ },
26
+ type: {
27
+ type: String,
28
+ default: "primary",
29
+ },
30
+ size: {
31
+ type: String,
32
+ default: "small",
33
+ },
34
+ permission: {
35
+ type: String,
36
+ default: "$route.params.btns",
37
+ },
38
+ text: {
39
+ type: String,
40
+ default: "删除",
41
+ },
42
+ title: {
43
+ type: String,
44
+ default: "该操作不可逆,确定删除?",
45
+ },
46
+ isDispSlot: {
47
+ type: Boolean,
48
+ default: false,
49
+ },
50
+ disp: {
51
+ type: Boolean,
52
+ default: true,
53
+ },
54
+ },
55
+ methods: {
56
+ click(param) {
57
+ this.$emit("click", param);
58
+ },
59
+ },
60
+ };
61
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeButtonSelectMedia from "./src/main.vue";
2
+
3
+ LeButtonSelectMedia.install = function (Vue) {
4
+ Vue.component(LeButtonSelectMedia.name, LeButtonSelectMedia);
5
+ };
6
+
7
+ export default LeButtonSelectMedia;
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div class="le-button-select-media">
3
+ <el-button type="primary" id="btnSelectMedia" @click="onClick"
4
+ >选择素材</el-button
5
+ >
6
+ <le-dialog-container
7
+ :title="title"
8
+ :showDialog="showDialog"
9
+ :width="width"
10
+ @close="closeDialog"
11
+ >
12
+ <le-media-list
13
+ :multiple="multiple"
14
+ ref="selectMedias"
15
+ v-if="showDialog"
16
+ @selectContent="selectContent"
17
+ ></le-media-list>
18
+ </le-dialog-container>
19
+ </div>
20
+ </template>
21
+ <script>
22
+ export default {
23
+ name: "le-button-select-media",
24
+ props: {
25
+ width: {
26
+ type: String,
27
+ default: "70%",
28
+ },
29
+ title: {
30
+ type: String,
31
+ default: "选择素材",
32
+ },
33
+ multiple: {
34
+ type: Boolean,
35
+ default: true,
36
+ },
37
+ },
38
+ data() {
39
+ return {
40
+ showDialog: false,
41
+ };
42
+ },
43
+ methods: {
44
+ onClick() {
45
+ this.showDialog = true;
46
+ },
47
+ closeDialog() {
48
+ this.showDialog = false;
49
+ },
50
+ selectContent(value) {
51
+ this.$emit("selectContent", value);
52
+ if (!this.multiple) {
53
+ this.closeDialog();
54
+ }
55
+ },
56
+ },
57
+ };
58
+ </script>
59
+ <style lang="scss" scoped>
60
+ .le-button-select-media {
61
+ margin-left: 8px;
62
+ margin-right: 8px;
63
+ }
64
+ </style>
@@ -0,0 +1,7 @@
1
+ import LeButtonUpload from "./src/main.vue";
2
+
3
+ LeButtonUpload.install = function (Vue) {
4
+ Vue.component(LeButtonUpload.name, LeButtonUpload);
5
+ };
6
+
7
+ export default LeButtonUpload;
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div>
3
+ <el-button type="primary" id="btnUpload" @click="onClick">{{
4
+ title
5
+ }}</el-button>
6
+ <le-dialog-container
7
+ :title="title"
8
+ :showDialog="showDialog"
9
+ :width="width"
10
+ @close="closeDialog"
11
+ >
12
+ <le-media-upload
13
+ v-if="showDialog"
14
+ @cancel="closeDialog"
15
+ @callMdiaUrl="callMdiaUrl"
16
+ ></le-media-upload>
17
+ </le-dialog-container>
18
+ </div>
19
+ </template>
20
+ <script>
21
+ export default {
22
+ name: "le-button-upload",
23
+ props: {
24
+ width: {
25
+ type: String,
26
+ default: "60%",
27
+ },
28
+ title: {
29
+ type: String,
30
+ default: "上传素材",
31
+ },
32
+ },
33
+ data() {
34
+ return {
35
+ showDialog: false,
36
+ };
37
+ },
38
+ methods: {
39
+ onClick() {
40
+ this.showDialog = true;
41
+ },
42
+ closeDialog() {
43
+ this.showDialog = false;
44
+ },
45
+ callMdiaUrl(param) {
46
+ this.$emit("callMdiaUrl", param);
47
+ },
48
+ },
49
+ };
50
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeCompany from "./src/main.vue";
2
+
3
+ LeCompany.install = function (Vue) {
4
+ Vue.component(LeCompany.name, LeCompany);
5
+ };
6
+
7
+ export default LeCompany;
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <div>
3
+ <el-table :data="tableData" border row-key="id" stripe style="width: 100%">
4
+ <el-table-column prop="name" label="单位名称" width="180">
5
+ </el-table-column>
6
+ <el-table-column prop="title" label="标题"> </el-table-column>
7
+ <el-table-column prop="phone" label="客服电话"> </el-table-column>
8
+ <el-table-column prop="note" label="备注"> </el-table-column>
9
+ <el-table-column
10
+ fixed="right"
11
+ label="操作"
12
+ align="center"
13
+ width="160"
14
+ row
15
+ >
16
+ <template slot-scope="scope">
17
+ <le-button
18
+ id="btnEdit"
19
+ v-permission="$route.params.btns"
20
+ text="编辑"
21
+ :disp="btnEditDisp"
22
+ @click="openEditWindow(scope.row)"
23
+ ></le-button>
24
+ <le-button-msg
25
+ @click="del(scope.row)"
26
+ :disp="btnDelDisp"
27
+ ></le-button-msg>
28
+ </template>
29
+ </el-table-column>
30
+ </el-table>
31
+ <le-dialog-container :showDialog="showDialog" @close="closeDialog">
32
+ <le-company-sub
33
+ @close="closeDialog"
34
+ @rowRefresh="list"
35
+ :rowitem="currentRow"
36
+ ></le-company-sub>
37
+ </le-dialog-container>
38
+ </div>
39
+ </template>
40
+ <script>
41
+ import { list as companylist, del as companyDel } from "@/api/company";
42
+ import LeButton from "leisure-ui/le-button/index";
43
+ import LeButtonMsg from "leisure-ui/le-button-msg/index";
44
+ import LeDialogContainer from "leisure-ui/le-dialog-container/index";
45
+ import LeCompanySub from "./sub.vue";
46
+ export default {
47
+ name: "le-company",
48
+ components: {
49
+ LeButton,
50
+ LeButtonMsg,
51
+ LeDialogContainer,
52
+ LeCompanySub,
53
+ },
54
+ props: {
55
+ btnEditDisp: {
56
+ type: Boolean,
57
+ default: true,
58
+ },
59
+ btnDelDisp: {
60
+ type: Boolean,
61
+ default: true,
62
+ },
63
+ },
64
+ data() {
65
+ return {
66
+ tableData: [],
67
+ showDialog: false,
68
+ currentRow: {},
69
+ };
70
+ },
71
+ computed: {
72
+ judgeIsDispDelButton() {
73
+ return this.$store.getters.userinfo.account == "zcx";
74
+ },
75
+ },
76
+ mounted() {
77
+ this.list();
78
+ },
79
+ methods: {
80
+ list() {
81
+ let params = { cid: this.$store.getters.cid };
82
+ companylist(params).then((res) => {
83
+ this.tableData = res.data.data;
84
+ });
85
+ },
86
+ del(id) {
87
+ companyDel(id).then((response) => {
88
+ this.list();
89
+ this.$message.success(response.data.info);
90
+ });
91
+ },
92
+ openEditWindow(item) {
93
+ this.currentRow = item;
94
+ this.showDialog = true;
95
+ },
96
+ closeDialog() {
97
+ this.showDialog = false;
98
+ },
99
+ },
100
+ };
101
+ </script>
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
3
+ <el-form-item label="单位名称" prop="name">
4
+ <el-input v-model="form.name"></el-input>
5
+ </el-form-item>
6
+ <el-form-item label="系统标题" prop="title">
7
+ <el-input v-model="form.title"></el-input>
8
+ </el-form-item>
9
+ <el-form-item label="电话" prop="phone">
10
+ <el-input v-model="form.phone"></el-input>
11
+ </el-form-item>
12
+ <el-form-item label="备注" prop="note">
13
+ <el-input v-model="form.note"></el-input>
14
+ </el-form-item>
15
+ <el-form-item>
16
+ <el-button type="primary" @click="onSubmit">保存</el-button>
17
+ <el-button @click="close()">取消</el-button>
18
+ </el-form-item>
19
+ </el-form>
20
+ </template>
21
+ <script>
22
+ import { add as companyAdd, edit as companyEdit } from "@/api/company";
23
+ export default {
24
+ name: "le-company-sub",
25
+ props: {
26
+ rowitem: {},
27
+ },
28
+ data() {
29
+ return {
30
+ // btnText: {
31
+ // dispComment: this.$route.params.status == 1 ? "立即创建" : "更新",
32
+ // },
33
+ form: {
34
+ id: "",
35
+ name: "",
36
+ phone: "",
37
+ title: "",
38
+ note: "",
39
+ },
40
+ rules: {
41
+ name: [
42
+ { required: true, message: "请输入单位名称", trigger: "blur" },
43
+ {
44
+ min: 1,
45
+ max: 100,
46
+ message: "长度在 1 到 100 个字符",
47
+ trigger: "blur",
48
+ },
49
+ ],
50
+ title: [
51
+ { required: true, message: "请输入标题名称", trigger: "blur" },
52
+ {
53
+ min: 1,
54
+ max: 100,
55
+ message: "长度在 1 到 100 个字符",
56
+ trigger: "blur",
57
+ },
58
+ ],
59
+ note: [
60
+ {
61
+ max: 200,
62
+ message: "长度在 0 到 200个字符",
63
+ trigger: "blur",
64
+ },
65
+ ],
66
+ },
67
+ };
68
+ },
69
+ watch: {
70
+ rowitem: {
71
+ handler(newValue) {
72
+ this.form = newValue;
73
+ },
74
+ immediate: true,
75
+ },
76
+ },
77
+ mounted() {},
78
+ methods: {
79
+ onSubmit() {
80
+ this.$refs["form"].validate((valid) => {
81
+ if (valid) {
82
+ let param = {
83
+ name: this.form.name,
84
+ note: this.form.note,
85
+ id: this.form.id,
86
+ title: this.form.title,
87
+ phone: this.form.phone,
88
+ };
89
+
90
+ if (this.$route.params.status == 1) {
91
+ companyAdd(param).then((response) => {
92
+ this.$message(response.data.info);
93
+ });
94
+ } else {
95
+ companyEdit(param).then((res) => {
96
+ this.$message(res.data.info);
97
+ this.$emit("rowRefresh");
98
+ this.close();
99
+ });
100
+ }
101
+ } else {
102
+ return false;
103
+ }
104
+ });
105
+ },
106
+ close() {
107
+ this.$emit("close");
108
+ },
109
+ },
110
+ };
111
+ </script>
@@ -0,0 +1,7 @@
1
+ import LeCouponGive from "./src/main.vue";
2
+
3
+ LeCouponGive.install = function (Vue) {
4
+ Vue.component(LeCouponGive.name, LeCouponGive);
5
+ };
6
+
7
+ export default LeCouponGive;