ljr-cli 1.0.0 → 1.0.2
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/demo1.js +39 -0
- package/lib/demo2.js +87 -0
- package/lib/index.js +220 -14
- package/lib/templates/flutter//346/210/221/346/230/257flutter.txt +0 -0
- package/lib/templates/java//346/210/221/346/230/257java.txt +0 -0
- package/lib/templates/monorepo//346/210/221/346/230/257monorepo.txt +0 -0
- package/lib/templates/mysql//346/210/221/346/230/257mysql.txt +0 -0
- package/lib/templates/node//346/210/221/346/230/257node.txt +0 -0
- package/lib/templates/qiankun//346/210/221/346/230/257qiankun.txt +0 -0
- package/lib/templates/react//346/210/221/346/230/257react.txt +0 -0
- package/lib/templates/uni-app//346/210/221/346/230/257uni-app.txt +0 -0
- package/lib/templates/vue2.7.16/.browserslistrc +3 -0
- package/lib/templates/vue2.7.16/.env +4 -0
- package/lib/templates/vue2.7.16/.env.development +7 -0
- package/lib/templates/vue2.7.16/.env.production +7 -0
- package/lib/templates/vue2.7.16/.eslintignore +3 -0
- package/lib/templates/vue2.7.16/.eslintrc.js +21 -0
- package/lib/templates/vue2.7.16/.prettierrc.js +11 -0
- package/lib/templates/vue2.7.16/.vscode/settings.json +10 -0
- package/lib/templates/vue2.7.16/README.md +71 -0
- package/lib/templates/vue2.7.16/babel.config.js +3 -0
- package/lib/templates/vue2.7.16/jsconfig.json +19 -0
- package/lib/templates/vue2.7.16/package.json +41 -0
- package/lib/templates/vue2.7.16/pnpm-lock.yaml +8171 -0
- package/lib/templates/vue2.7.16/public/favicon.svg +14 -0
- package/lib/templates/vue2.7.16/public/index.html +20 -0
- package/lib/templates/vue2.7.16/src/App.vue +14 -0
- package/lib/templates/vue2.7.16/src/api/interface/index.js +6 -0
- package/lib/templates/vue2.7.16/src/api/request.js +121 -0
- package/lib/templates/vue2.7.16/src/api/server/index.js +6 -0
- package/lib/templates/vue2.7.16/src/assets/logo.png +0 -0
- package/lib/templates/vue2.7.16/src/components/README.md +5 -0
- package/lib/templates/vue2.7.16/src/components/baseInfo/index.vue +29 -0
- package/lib/templates/vue2.7.16/src/components/baseInfo/item.vue +64 -0
- package/lib/templates/vue2.7.16/src/components/index.js +14 -0
- package/lib/templates/vue2.7.16/src/components/layout/left-menu-and-top-info.vue +121 -0
- package/lib/templates/vue2.7.16/src/components/pagination/index.vue +52 -0
- package/lib/templates/vue2.7.16/src/css/coverage-style.css +6 -0
- package/lib/templates/vue2.7.16/src/directive/index.js +16 -0
- package/lib/templates/vue2.7.16/src/directive/input-number.js +18 -0
- package/lib/templates/vue2.7.16/src/directive/permission.js +52 -0
- package/lib/templates/vue2.7.16/src/directive/re-click.js +12 -0
- package/lib/templates/vue2.7.16/src/global-config.js +12 -0
- package/lib/templates/vue2.7.16/src/main.js +79 -0
- package/lib/templates/vue2.7.16/src/prototype/README.md +1 -0
- package/lib/templates/vue2.7.16/src/prototype/el-dialog.js +127 -0
- package/lib/templates/vue2.7.16/src/prototype/index.js +53 -0
- package/lib/templates/vue2.7.16/src/router/index.js +257 -0
- package/lib/templates/vue2.7.16/src/store/index.js +50 -0
- package/lib/templates/vue2.7.16/src/store/modules/dd.js +128 -0
- package/lib/templates/vue2.7.16/src/store/modules/permissions.js +24 -0
- package/lib/templates/vue2.7.16/src/views/404.vue +7 -0
- package/lib/templates/vue2.7.16/src/views/Pitfalls//345/206/205/345/255/230/346/272/242/345/207/272/index.vue +56 -0
- package/lib/templates/vue2.7.16/src/views/Pitfalls//345/206/205/345/255/230/346/272/242/345/207/272//351/200/240/346/210/220vue2/345/206/205/345/255/230/346/272/242/345/207/272/347/232/204/345/257/271/350/261/241.js +33518 -0
- package/lib/templates/vue2.7.16/src/views/about.vue +5 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200store/346/225/260/346/215/256/345/255/227/345/205/270/index.vue +85 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/345/274/271/347/252/227/ce.vue +42 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/345/274/271/347/252/227/index.vue +24 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/346/214/207/344/273/244/index.vue +78 -0
- package/lib/templates/vue2.7.16/src/views/demo//350/257/267/346/261/202/347/244/272/344/276/213/index.vue +51 -0
- package/lib/templates/vue2.7.16/src/views/home.vue +3 -0
- package/lib/templates/vue2.7.16/src/views/login.vue +67 -0
- package/lib/templates/vue2.7.16/src/views/template/base-info.vue +29 -0
- package/lib/templates/vue2.7.16/src/views/template/base-info2.vue +56 -0
- package/lib/templates/vue2.7.16/src/views/template/list/ce.vue +58 -0
- package/lib/templates/vue2.7.16/src/views/template/list/index.vue +111 -0
- package/lib/templates/vue2.7.16/src/views/template/list/search.vue +60 -0
- package/lib/templates/vue2.7.16/vue.config.js +26 -0
- package/lib/templates/vue3.5.25-2025.12.4/.editorconfig +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/.gitattributes +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/.prettierrc.json +11 -0
- package/lib/templates/vue3.5.25-2025.12.4/.vscode/extensions.json +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/.vscode/settings.json +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/README.md +93 -0
- package/lib/templates/vue3.5.25-2025.12.4/auto-imports.d.ts +78 -0
- package/lib/templates/vue3.5.25-2025.12.4/components.d.ts +28 -0
- package/lib/templates/vue3.5.25-2025.12.4/env.d.ts +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/eslint.config.ts +32 -0
- package/lib/templates/vue3.5.25-2025.12.4/index.html +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/package.json +47 -0
- package/lib/templates/vue3.5.25-2025.12.4/pnpm-lock.yaml +3515 -0
- package/lib/templates/vue3.5.25-2025.12.4/public/favicon.svg +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/App.vue +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/assets/vue.svg +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/index.ts +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/pinia.ts +10 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/router.ts +10 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/style.ts +9 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/css/coverage-style.css +6 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/directive/index.js +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/directive/rememberScrollPosition.ts +17 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/main.ts +7 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/router/index.ts +20 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/stores/counter.ts +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/views/AboutView.vue +3 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/views/HomeView.vue +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.app.json +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.json +11 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.node.json +19 -0
- package/lib/templates/vue3.5.25-2025.12.4/vite.config.ts +31 -0
- package/lib/templates/wx-miniapp//346/210/221/346/230/257wx-miniapp.txt +0 -0
- package/package.json +16 -3
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-card-container">
|
|
3
|
+
<el-card class="c-width-100per">
|
|
4
|
+
<div slot="header" class="clearfix">
|
|
5
|
+
<span>全局store示例</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="c-mb10">在创建生命周期直接初始化了,如果需要清空请点击按钮</div>
|
|
8
|
+
<div style="text-align: right">
|
|
9
|
+
<el-button type="primary" size="small" @click="printAllDD"> 打印全部数据字典 </el-button>
|
|
10
|
+
<el-button type="danger" size="small" @click="clearAllDD"> 清空全部数据字典 </el-button>
|
|
11
|
+
<el-button type="primary" size="small" @click="printStore"> 打印$store </el-button>
|
|
12
|
+
</div>
|
|
13
|
+
</el-card>
|
|
14
|
+
|
|
15
|
+
<el-card class="c-width-100per">
|
|
16
|
+
<div slot="header" class="clearfix">
|
|
17
|
+
<span>性别的数据字典</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="c-mb10">数据:{{ $store.getters.dd.sex }}</div>
|
|
20
|
+
<div class="c-mb10">编码转换名称:{{ $root.ddCodeToName({ sex: "1" }) }}</div>
|
|
21
|
+
<div class="c-mb10">
|
|
22
|
+
使用在select组件上:
|
|
23
|
+
<el-select v-model="activeCity" placeholder="请选择">
|
|
24
|
+
<el-option v-for="item in $store.getters.dd.sex" :key="item.value" :label="item.label" :value="item.value">
|
|
25
|
+
</el-option>
|
|
26
|
+
</el-select>
|
|
27
|
+
</div>
|
|
28
|
+
<div style="text-align: right">
|
|
29
|
+
<el-button type="primary" size="small" @click="getDD('sex')"> 获取性别数据字典 </el-button>
|
|
30
|
+
</div>
|
|
31
|
+
</el-card>
|
|
32
|
+
|
|
33
|
+
<el-card class="c-width-100per">
|
|
34
|
+
<div slot="header" class="clearfix">
|
|
35
|
+
<span>城市的数据字典</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="c-mb10">数据:{{ $store.getters.dd.citys }}</div>
|
|
38
|
+
<div class="c-mb10">编码转换名称:{{ $root.ddCodeToName({ citys: "5" }) }}</div>
|
|
39
|
+
<div class="c-mb10">
|
|
40
|
+
使用在select组件上:
|
|
41
|
+
<el-select v-model="activeCity" placeholder="请选择">
|
|
42
|
+
<el-option v-for="item in $store.getters.dd.citys" :key="item.value" :label="item.label" :value="item.value">
|
|
43
|
+
</el-option>
|
|
44
|
+
</el-select>
|
|
45
|
+
</div>
|
|
46
|
+
<div style="text-align: right">
|
|
47
|
+
<el-button type="primary" size="small" @click="getDD('citys')"> 获取城市数据字典 </el-button>
|
|
48
|
+
</div>
|
|
49
|
+
</el-card>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
export default {
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
activeSex: "",
|
|
58
|
+
activeCity: "",
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
created() {
|
|
62
|
+
// 使用的页面需要调用一下getDD方法,如果数据字典的code !== null,则不会再次请求
|
|
63
|
+
this.$store.dispatch("getDD", "sex")
|
|
64
|
+
this.$store.dispatch("getDD", "citys")
|
|
65
|
+
},
|
|
66
|
+
methods: {
|
|
67
|
+
/** 清空全部数据字典 */
|
|
68
|
+
clearAllDD() {
|
|
69
|
+
this.$store.commit("CLEAR_DD")
|
|
70
|
+
},
|
|
71
|
+
/** 获取数据字典 */
|
|
72
|
+
getDD(type) {
|
|
73
|
+
this.$store.dispatch("getDD", type)
|
|
74
|
+
},
|
|
75
|
+
/** 打印全部数据字典 */
|
|
76
|
+
printAllDD() {
|
|
77
|
+
console.log("全部数据字典=====>", this.$store.getters.dd)
|
|
78
|
+
},
|
|
79
|
+
/** 打印$store */
|
|
80
|
+
printStore() {
|
|
81
|
+
console.log("$store=====>", this.$store)
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog v-bind="$props" :visible="visible" width="700px" @close="close()">
|
|
3
|
+
<p>111</p>
|
|
4
|
+
<p>111</p>
|
|
5
|
+
<p>111</p>
|
|
6
|
+
<p>111</p>
|
|
7
|
+
<p>111</p>
|
|
8
|
+
<p>111</p>
|
|
9
|
+
<p>111</p>
|
|
10
|
+
<p>111</p>
|
|
11
|
+
<p>111</p>
|
|
12
|
+
<p>111</p>
|
|
13
|
+
<div slot="footer">
|
|
14
|
+
<el-button :loading="loading" :disabled="loading" @click="close()">取消</el-button>
|
|
15
|
+
<el-button :loading="loading" :disabled="loading" type="primary" @click="submit()">确认</el-button>
|
|
16
|
+
</div>
|
|
17
|
+
</el-dialog>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
props: {
|
|
23
|
+
fatherItem: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => {},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
loading: false,
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
created() {
|
|
34
|
+
console.log("fatherItem=====>", this.fatherItem)
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
submit() {
|
|
38
|
+
this.close(true)
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-button type="primary" @click="ce()"> 新增 </el-button>
|
|
4
|
+
<el-button type="primary" @click="ce({ name: '张三', age: 18 })"> 编辑 </el-button>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
methods: {
|
|
11
|
+
ce(row) {
|
|
12
|
+
this.$LDialog(require("./ce.vue"), {
|
|
13
|
+
title: row ? "编辑" : "新增",
|
|
14
|
+
fatherItem: row,
|
|
15
|
+
on: {
|
|
16
|
+
refresh: () => {
|
|
17
|
+
console.log("刷新方法")
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-card-container">
|
|
3
|
+
<el-card class="c-width-100per">
|
|
4
|
+
<div slot="header" class="clearfix">
|
|
5
|
+
<span>当前权限:{{ $store.getters.permissions }}</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="c-mb10">
|
|
8
|
+
<el-alert
|
|
9
|
+
title="权限一般在登录的时候记录,在页面的时候不会做修改,所以这里不需要更新视图,所以更改了权限后,需要刷新页面,这里更改权限后会自动刷新页面"
|
|
10
|
+
type="warning"
|
|
11
|
+
effect="dark"
|
|
12
|
+
:closable="false"
|
|
13
|
+
>
|
|
14
|
+
</el-alert>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="c-mb10">需要有删除权限才显示删除按钮</div>
|
|
17
|
+
<div class="c-mb10">
|
|
18
|
+
<el-button v-permission="['hasDelete']" class="c-ml10" type="danger" size="small"> 删除按钮 </el-button>
|
|
19
|
+
</div>
|
|
20
|
+
<div style="text-align: right">
|
|
21
|
+
<el-button type="primary" size="small" @click="changePermission('setAdminPermissions')">
|
|
22
|
+
设置为管理员权限
|
|
23
|
+
</el-button>
|
|
24
|
+
<el-button type="primary" size="small" @click="changePermission('addDeletePermissions')">
|
|
25
|
+
添加 hasDelete 权限
|
|
26
|
+
</el-button>
|
|
27
|
+
<el-button type="danger" size="small" @click="changePermission('clearPermissions')"> 清空权限 </el-button>
|
|
28
|
+
</div>
|
|
29
|
+
</el-card>
|
|
30
|
+
|
|
31
|
+
<el-card class="c-width-100per">
|
|
32
|
+
<div slot="header" class="clearfix">
|
|
33
|
+
<span>只能输入数字指令</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="c-mb10">
|
|
36
|
+
<el-form ref="form" label-width="80px">
|
|
37
|
+
<el-form-item label="纯数字">
|
|
38
|
+
<el-input v-model="input" v-input-number placeholder="请输入内容"></el-input>
|
|
39
|
+
</el-form-item>
|
|
40
|
+
<el-form-item label="浮点数">
|
|
41
|
+
<el-input v-model="input2" v-input-number.float placeholder="请输入内容"></el-input>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
</el-form>
|
|
44
|
+
</div>
|
|
45
|
+
</el-card>
|
|
46
|
+
|
|
47
|
+
<el-card class="c-width-100per">
|
|
48
|
+
<div slot="header" class="clearfix">
|
|
49
|
+
<span>防止重复点击</span>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="c-mb10">
|
|
52
|
+
<el-button v-re-click:2000 type="primary" size="small" @click="reClick"> 重复点击,输出到控制台 </el-button>
|
|
53
|
+
</div>
|
|
54
|
+
</el-card>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
export default {
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
input: "",
|
|
63
|
+
input2: "",
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
methods: {
|
|
67
|
+
/** 更改权限 */
|
|
68
|
+
changePermission(type) {
|
|
69
|
+
this.$store.commit(type)
|
|
70
|
+
window.location.reload()
|
|
71
|
+
},
|
|
72
|
+
/** 重复点击事件 */
|
|
73
|
+
reClick() {
|
|
74
|
+
console.log("重复点击按钮被点击!")
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
</script>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-card-container">
|
|
3
|
+
<el-card class="c-width-100per">
|
|
4
|
+
<div slot="header" class="clearfix">
|
|
5
|
+
<span>请求示例</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div style="text-align: right">
|
|
8
|
+
<el-button type="danger" size="small" @click="getServerError()"> 请求服务错误 </el-button>
|
|
9
|
+
<el-button type="danger" size="small" @click="getInterfaceError()"> 请求接口错误 </el-button>
|
|
10
|
+
<el-button type="primary" size="small" @click="prototypeInvocation()"> 直接原型.$api请求 </el-button>
|
|
11
|
+
<el-button type="primary" size="small" @click="reqSucceed()"> 请求成功的 </el-button>
|
|
12
|
+
</div>
|
|
13
|
+
</el-card>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import { interfaceError } from "@/api/interface/index.js"
|
|
19
|
+
import { serverError } from "@/api/server/index.js"
|
|
20
|
+
export default {
|
|
21
|
+
data() {
|
|
22
|
+
return {}
|
|
23
|
+
},
|
|
24
|
+
methods: {
|
|
25
|
+
/** 请求服务错误 */
|
|
26
|
+
getServerError() {
|
|
27
|
+
serverError({}).then((res) => {
|
|
28
|
+
console.log("res", res)
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
/** 请求接口错误 */
|
|
32
|
+
getInterfaceError() {
|
|
33
|
+
interfaceError({}).then((res) => {
|
|
34
|
+
console.log("res", res)
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
/** 执行原型调用 */
|
|
38
|
+
prototypeInvocation() {
|
|
39
|
+
this.$api.post("/server/error", {}).then((res) => {
|
|
40
|
+
console.log("res", res)
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
/** 请求成功的 */
|
|
44
|
+
reqSucceed() {
|
|
45
|
+
this.$api.get("/reqSucceed", {}).then((res) => {
|
|
46
|
+
console.log("res", res)
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-card-container" style="padding: 50px">
|
|
3
|
+
<el-card class="c-width-100per">
|
|
4
|
+
<div slot="header" class="clearfix">
|
|
5
|
+
<span>是否需要登录</span>
|
|
6
|
+
<el-button style="float: right" size="small" type="primary" @click="$store.commit('changeNeedLogin')">
|
|
7
|
+
改变是否需要登录
|
|
8
|
+
</el-button>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
{{ $store.state.needLogin }}
|
|
12
|
+
</div>
|
|
13
|
+
</el-card>
|
|
14
|
+
<el-card class="c-width-100per">
|
|
15
|
+
<div slot="header" class="clearfix">
|
|
16
|
+
<span>当前登录状态</span>
|
|
17
|
+
<el-button style="float: right" size="small" type="primary" @click="$store.commit('changeLoginStatus')">
|
|
18
|
+
改变登录状态
|
|
19
|
+
</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
<h3 class="c-mb10">通过 mapState 读取的方式:{{ loginStatus }}</h3>
|
|
23
|
+
<h3 class="c-mb10">通过 $store.state.loginStatus 读取的方式:{{ $store.state.loginStatus }}</h3>
|
|
24
|
+
</div>
|
|
25
|
+
</el-card>
|
|
26
|
+
|
|
27
|
+
<el-card class="c-width-100per">
|
|
28
|
+
<div style="text-align: right">
|
|
29
|
+
<el-button type="primary" size="small" @click="printStore"> 打印$store </el-button>
|
|
30
|
+
</div>
|
|
31
|
+
</el-card>
|
|
32
|
+
|
|
33
|
+
<el-card class="c-width-100per">
|
|
34
|
+
<div style="text-align: right">
|
|
35
|
+
<el-button
|
|
36
|
+
type="primary"
|
|
37
|
+
size="small"
|
|
38
|
+
:disabled="$store.state.needLogin && !$store.state.loginStatus"
|
|
39
|
+
@click="goHome"
|
|
40
|
+
>
|
|
41
|
+
跳转首页
|
|
42
|
+
</el-button>
|
|
43
|
+
</div>
|
|
44
|
+
</el-card>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { mapState } from "vuex"
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
name: "LoginView",
|
|
53
|
+
computed: {
|
|
54
|
+
...mapState(["loginStatus"]),
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
printStore() {
|
|
58
|
+
console.log("$store=====>", this.$store)
|
|
59
|
+
},
|
|
60
|
+
goHome() {
|
|
61
|
+
this.$router.push({
|
|
62
|
+
path: "/",
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="padding: 50px">
|
|
3
|
+
<h1>注意:支持显示隐藏,但是不支持跨列</h1>
|
|
4
|
+
<l-base-info>
|
|
5
|
+
<l-base-info-item label="111" value="value"></l-base-info-item>
|
|
6
|
+
<l-base-info-item label="222" value="value"></l-base-info-item>
|
|
7
|
+
<l-base-info-item label="333" value="value">
|
|
8
|
+
<template #label> 我是333的插槽label </template>
|
|
9
|
+
<template #value> 我是333的插槽value </template>
|
|
10
|
+
</l-base-info-item>
|
|
11
|
+
<l-base-info-item label="444" value="value"></l-base-info-item>
|
|
12
|
+
<l-base-info-item label="555" value="value"></l-base-info-item>
|
|
13
|
+
</l-base-info>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: "baseInfo",
|
|
20
|
+
props: {
|
|
21
|
+
/** 几列,注意:label跟value合起来是一列 */
|
|
22
|
+
column: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: 4,
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="padding: 50px">
|
|
3
|
+
<h1>注意:支持跨列,但是不支持显示隐藏</h1>
|
|
4
|
+
<table class="c-tableData c-text-left">
|
|
5
|
+
<thead>
|
|
6
|
+
<tr>
|
|
7
|
+
<th colspan="8">基础信息</th>
|
|
8
|
+
</tr>
|
|
9
|
+
</thead>
|
|
10
|
+
<tbody>
|
|
11
|
+
<tr>
|
|
12
|
+
<td class="c-width-10per ctdLabel">包名称</td>
|
|
13
|
+
<td class="c-width-15per">
|
|
14
|
+
{{ baseInfo.pkgName }}
|
|
15
|
+
</td>
|
|
16
|
+
<td class="c-width-10per ctdLabel">计划包编码</td>
|
|
17
|
+
<td class="c-width-15per">
|
|
18
|
+
{{ baseInfo.pkgCode }}
|
|
19
|
+
</td>
|
|
20
|
+
<td class="c-width-10per ctdLabel">计划名称</td>
|
|
21
|
+
<td class="c-width-15per">
|
|
22
|
+
{{ baseInfo.planName }}
|
|
23
|
+
</td>
|
|
24
|
+
<td class="c-width-10per ctdLabel">计划编码</td>
|
|
25
|
+
<td class="c-width-15per">
|
|
26
|
+
{{ baseInfo.planCode }}
|
|
27
|
+
</td>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<td class="c-width-10per ctdLabel">跨列</td>
|
|
31
|
+
<td class="c-width-15per" colspan="3">
|
|
32
|
+
{{ baseInfo.pkgName }}
|
|
33
|
+
</td>
|
|
34
|
+
<td class="c-width-10per ctdLabel">计划包编码</td>
|
|
35
|
+
<td class="c-width-15per">
|
|
36
|
+
{{ baseInfo.pkgCode }}
|
|
37
|
+
</td>
|
|
38
|
+
<td class="c-width-10per ctdLabel">计划名称</td>
|
|
39
|
+
<td class="c-width-15per">
|
|
40
|
+
{{ baseInfo.planName }}
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
</tbody>
|
|
44
|
+
</table>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
export default {
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
baseInfo: {},
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog v-bind="$props" :visible="visible" width="500px" @close="close()">
|
|
3
|
+
<el-form ref="form" :model="form" :rules="rules" label-width="60px">
|
|
4
|
+
<el-form-item label="姓名" prop="name">
|
|
5
|
+
<el-input v-model="form.name" placeholder="请输入"></el-input>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
<el-form-item label="地址" prop="address">
|
|
8
|
+
<el-input v-model="form.address" placeholder="请输入"></el-input>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
</el-form>
|
|
11
|
+
<div slot="footer">
|
|
12
|
+
<el-button :loading="loading" :disabled="loading" @click="close()">取消</el-button>
|
|
13
|
+
<el-button :loading="loading" :disabled="loading" type="primary" @click="submit()">确认</el-button>
|
|
14
|
+
</div>
|
|
15
|
+
</el-dialog>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { cloneDeep } from "lodash"
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
props: {
|
|
23
|
+
fatherItem: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => {},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
loading: false,
|
|
31
|
+
form: {
|
|
32
|
+
name: "",
|
|
33
|
+
address: "",
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
name: [{ required: true, message: "请输入", trigger: "change" }],
|
|
37
|
+
address: [{ required: true, message: "请输入", trigger: "change" }],
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
created() {
|
|
42
|
+
if (this.fatherItem) {
|
|
43
|
+
this.form = cloneDeep(this.fatherItem)
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
submit() {
|
|
48
|
+
this.$refs.form.validate((valid) => {
|
|
49
|
+
if (valid) {
|
|
50
|
+
this.close(true)
|
|
51
|
+
} else {
|
|
52
|
+
this.$message.warning("请填写必填项!")
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="loading" class="c-layout">
|
|
3
|
+
<!-- 顶部 -->
|
|
4
|
+
<div class="c-mb20">
|
|
5
|
+
<search v-model="form" @ok="getList(true)"></search>
|
|
6
|
+
<el-divider></el-divider>
|
|
7
|
+
<el-button type="primary" @click="ce()"> 新增 </el-button>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<!-- 表格 -->
|
|
11
|
+
<el-table class="c-layout--flex c-overflow-hidden" :data="tableData" border height="100%">
|
|
12
|
+
<el-table-column type="index" width="50"> </el-table-column>
|
|
13
|
+
<el-table-column prop="name" label="姓名" width="180"> </el-table-column>
|
|
14
|
+
<el-table-column prop="address" label="地址"> </el-table-column>
|
|
15
|
+
<el-table-column prop="date" label="日期" width="180"> </el-table-column>
|
|
16
|
+
<el-table-column fixed="right" label="操作" width="150">
|
|
17
|
+
<template slot-scope="{ row, $index }">
|
|
18
|
+
<el-button type="primary" @click="ce(row)"> 编辑 </el-button>
|
|
19
|
+
<el-button type="danger" @click="del($index)"> 删除 </el-button>
|
|
20
|
+
</template>
|
|
21
|
+
</el-table-column>
|
|
22
|
+
</el-table>
|
|
23
|
+
|
|
24
|
+
<!-- 分页 -->
|
|
25
|
+
<l-pagination
|
|
26
|
+
class="c-mt20"
|
|
27
|
+
style="text-align: right"
|
|
28
|
+
:current-page.sync="page.currentPage"
|
|
29
|
+
:page-size.sync="page.size"
|
|
30
|
+
:total="page.total"
|
|
31
|
+
@change="getList()"
|
|
32
|
+
>
|
|
33
|
+
</l-pagination>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import search from "./search.vue"
|
|
39
|
+
export default {
|
|
40
|
+
components: { search },
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
loading: false,
|
|
44
|
+
form: {
|
|
45
|
+
name: "",
|
|
46
|
+
address: "",
|
|
47
|
+
},
|
|
48
|
+
tableData: [],
|
|
49
|
+
page: {
|
|
50
|
+
currentPage: 1, // 当前页
|
|
51
|
+
size: 20, // 每页条数
|
|
52
|
+
total: 0, // 总条数
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
created() {
|
|
57
|
+
this.getList()
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
/** 新增编辑 */
|
|
61
|
+
ce(row) {
|
|
62
|
+
this.$LDialog(require("./ce.vue"), {
|
|
63
|
+
title: row ? "编辑" : "新增",
|
|
64
|
+
fatherItem: row,
|
|
65
|
+
on: {
|
|
66
|
+
refresh: () => {
|
|
67
|
+
console.log("刷新方法")
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
},
|
|
72
|
+
/** 获取列表 */
|
|
73
|
+
getList(isRefresh = false) {
|
|
74
|
+
if (isRefresh) {
|
|
75
|
+
this.page.currentPage = 1
|
|
76
|
+
}
|
|
77
|
+
const params = {
|
|
78
|
+
page: this.page.currentPage,
|
|
79
|
+
size: this.page.size,
|
|
80
|
+
...this.form,
|
|
81
|
+
}
|
|
82
|
+
this.loading = true
|
|
83
|
+
this.$api
|
|
84
|
+
.get("/getList", params)
|
|
85
|
+
.then((res) => {
|
|
86
|
+
this.tableData = res.data.list
|
|
87
|
+
this.page.total = res.data.total
|
|
88
|
+
})
|
|
89
|
+
.finally(() => {
|
|
90
|
+
this.loading = false
|
|
91
|
+
})
|
|
92
|
+
},
|
|
93
|
+
/** 删除 */
|
|
94
|
+
del(index) {
|
|
95
|
+
this.$confirm("确定删除吗?", "提示", {
|
|
96
|
+
confirmButtonText: "确定",
|
|
97
|
+
cancelButtonText: "取消",
|
|
98
|
+
type: "warning",
|
|
99
|
+
})
|
|
100
|
+
.then(() => {
|
|
101
|
+
this.tableData.splice(index, 1)
|
|
102
|
+
this.$message({
|
|
103
|
+
type: "success",
|
|
104
|
+
message: "删除成功!",
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
.catch(() => {})
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form ref="form" :model="form" label-width="50px">
|
|
3
|
+
<el-row :gutter="20">
|
|
4
|
+
<el-col :span="6">
|
|
5
|
+
<el-form-item label="姓名">
|
|
6
|
+
<el-input v-model="form.name" placeholder="请输入"></el-input>
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</el-col>
|
|
9
|
+
<el-col :span="6">
|
|
10
|
+
<el-form-item label="地址">
|
|
11
|
+
<el-input v-model="form.address" placeholder="请输入"></el-input>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
</el-col>
|
|
14
|
+
<el-col :span="12" style="text-align: right">
|
|
15
|
+
<el-button type="primary" @click="submit()"> 搜索 </el-button>
|
|
16
|
+
<el-button @click="reset()"> 重置 </el-button>
|
|
17
|
+
</el-col>
|
|
18
|
+
</el-row>
|
|
19
|
+
</el-form>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { cloneDeep } from "lodash"
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
props: {
|
|
27
|
+
value: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: () => {},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
sourceValue: cloneDeep(this.value), // 用于重置
|
|
35
|
+
form: cloneDeep(this.value),
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
modelValue: {
|
|
40
|
+
set(val) {
|
|
41
|
+
this.$emit("input", val)
|
|
42
|
+
},
|
|
43
|
+
get() {
|
|
44
|
+
return this.value
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
submit() {
|
|
50
|
+
this.modelValue = cloneDeep(this.form)
|
|
51
|
+
this.$emit("ok", this.form)
|
|
52
|
+
},
|
|
53
|
+
reset() {
|
|
54
|
+
this.form = cloneDeep(this.sourceValue)
|
|
55
|
+
this.modelValue = cloneDeep(this.sourceValue)
|
|
56
|
+
this.$emit("ok", this.form)
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
</script>
|