leisure-core 0.2.0 → 0.2.1

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
@@ -32,6 +32,7 @@ import LeUpload from "./le-upload/index.js";
32
32
  import LePromotions from "./le-promotions/index.js";
33
33
  import LeCommission from "./le-commission/index.js";
34
34
  import LeMpurl from "./le-mpurl/index.js";
35
+ import { LeHelp, LeHelpDetail } from "./le-help/index.js";
35
36
 
36
37
  const components = [
37
38
  LeButton,
@@ -68,6 +69,8 @@ const components = [
68
69
  LePromotions,
69
70
  LeCommission,
70
71
  LeMpurl,
72
+ LeHelp,
73
+ LeHelpDetail,
71
74
  ];
72
75
 
73
76
  const install = function (Vue) {
@@ -173,4 +176,6 @@ export default {
173
176
  LePromotions,
174
177
  LeCommission,
175
178
  LeMpurl,
179
+ LeHelp,
180
+ LeHelpDetail,
176
181
  };
@@ -0,0 +1,12 @@
1
+ import LeHelp from "./src/main.vue";
2
+ import LeHelpDetail from "./src/detail.vue";
3
+
4
+ LeHelp.install = function (Vue) {
5
+ Vue.component(LeHelp.name, LeHelp);
6
+ };
7
+
8
+ LeHelpDetail.install = function (Vue) {
9
+ Vue.component(LeHelpDetail.name, LeHelpDetail);
10
+ };
11
+
12
+ export { LeHelp, LeHelpDetail };
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div class="le-help">
3
+ <div class="title">{{ title }}</div>
4
+ <div class="comment" v-html="comment"></div>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ export default {
9
+ name: "le-help-detail",
10
+ props: {
11
+ title: {
12
+ type: String,
13
+ default: "",
14
+ },
15
+ comment: {
16
+ type: String,
17
+ default: "",
18
+ },
19
+ },
20
+ methods: {},
21
+ };
22
+ </script>
23
+ <style lang="scss" scoped>
24
+ .le-help {
25
+ display: flex;
26
+ display: -webkit-flex;
27
+ flex-direction: column;
28
+
29
+ .title {
30
+ text-align: center;
31
+ font-weight: bold;
32
+ font-size: 26px;
33
+ }
34
+
35
+ .comment {
36
+ max-height: 650px;
37
+ overflow-y: auto;
38
+ }
39
+ }
40
+ </style>
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <div class="le-depart-container">
3
+ <el-form :inline="true">
4
+ <el-form-item>
5
+ <el-button type="primary" @click="addHelp()">新建</el-button>
6
+ </el-form-item>
7
+ </el-form>
8
+ <el-table :data="tableData" border row-key="id" stripe style="width: 100%">
9
+ <el-table-column prop="type" label="类型" align="center">
10
+ </el-table-column>
11
+ <el-table-column prop="title" label="标题" align="center">
12
+ </el-table-column>
13
+ <el-table-column fixed="right" label="操作" align="center" width="180">
14
+ <template slot-scope="scope">
15
+ <le-button text="编辑" @click="edit(scope.row)"></le-button>
16
+ <le-button-msg @click="del(scope.row.id)"></le-button-msg>
17
+ </template>
18
+ </el-table-column>
19
+ </el-table>
20
+ <le-dialog-container
21
+ title="新建/编辑帮助文档"
22
+ :showDialog="showDialog"
23
+ :showFooter="true"
24
+ @close="handleClose"
25
+ @saveData="savedepart"
26
+ >
27
+ <el-form
28
+ :model="ruleForm"
29
+ :rules="rules"
30
+ ref="ruleForm"
31
+ label-width="140px"
32
+ v-if="showDialog"
33
+ >
34
+ <el-form-item label="类型" prop="type">
35
+ <el-input v-model="ruleForm.type"></el-input>
36
+ </el-form-item>
37
+ <el-form-item label="标题" prop="title">
38
+ <el-input v-model="ruleForm.title"></el-input>
39
+ </el-form-item>
40
+ <el-form-item label="内容" prop="comment">
41
+ <le-editor v-model="ruleForm.comment"></le-editor>
42
+ </el-form-item>
43
+ </el-form>
44
+ </le-dialog-container>
45
+ </div>
46
+ </template>
47
+ <script>
48
+ import { list, edit, del } from "@/api/SystemHelp";
49
+ import { LeEditor } from "leisure-editor";
50
+ export default {
51
+ name: "le-help",
52
+ components: {
53
+ LeEditor,
54
+ },
55
+ data() {
56
+ return {
57
+ tableData: [],
58
+ ruleForm: {
59
+ id: "",
60
+ type: "",
61
+ title: "",
62
+ comment: "",
63
+ },
64
+ rules: {
65
+ type: [
66
+ { required: true, message: "请输入类型", trigger: "blur" },
67
+ { max: 6, message: "长度在 1 到 6个字符", trigger: "blur" },
68
+ ],
69
+ title: [
70
+ { required: true, message: "请输入标题", trigger: "blur" },
71
+ { max: 20, message: "长度在 1 到 20个字符", trigger: "blur" },
72
+ ],
73
+ comment: [{ required: true, message: "请输入类型", trigger: "blur" }],
74
+ },
75
+ showDialog: false,
76
+ };
77
+ },
78
+ computed: {},
79
+ mounted() {
80
+ this.getList();
81
+ },
82
+ methods: {
83
+ addHelp() {
84
+ this.showDialog = true;
85
+ },
86
+ edit(row) {
87
+ this.ruleForm = JSON.parse(JSON.stringify(row));
88
+ this.showDialog = true;
89
+ },
90
+ savedepart() {
91
+ let params = JSON.parse(JSON.stringify(this.ruleForm));
92
+ this.$refs["ruleForm"].validate((valid) => {
93
+ if (valid) {
94
+ edit(params).then(() => {
95
+ this.$message.success("提交成功~");
96
+ this.getList();
97
+ this.handleClose();
98
+ });
99
+ } else {
100
+ console.log("error submit!!");
101
+ return false;
102
+ }
103
+ });
104
+ },
105
+ handleClose() {
106
+ this.showDialog = false;
107
+ this.initForm();
108
+ },
109
+ getList() {
110
+ list().then((res) => {
111
+ this.tableData = res.data.data || [];
112
+ });
113
+ },
114
+ del(id) {
115
+ del({
116
+ id: id,
117
+ }).then((response) => {
118
+ this.getList();
119
+ this.$message.success("删除成功");
120
+ });
121
+ },
122
+ initForm() {
123
+ this.ruleForm.id = "";
124
+ this.ruleForm.type = "";
125
+ this.ruleForm.title = "";
126
+ this.ruleForm.comment = "";
127
+ },
128
+ },
129
+ };
130
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",