w-table-vue 1.0.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.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +55 -0
- package/.jsdoc +25 -0
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +16 -0
- package/dist/w-table-vue.umd.js +7 -0
- package/dist/w-table-vue.umd.js.map +1 -0
- package/docs/examples/app.html +63 -0
- package/docs/examples/app.umd.js +7 -0
- package/docs/examples/app.umd.js.map +1 -0
- package/docs/examples/w-table-edit_default.html +525 -0
- package/docs/examples/w-table-edit_editable.html +528 -0
- package/docs/examples/w-table-edit_editable_checkId.html +529 -0
- package/docs/examples/w-table-edit_editable_checkId_opt.modifyDataWhenSave_save(call cmp. method).html +544 -0
- package/docs/examples/w-table-edit_editable_checkId_successMsgFromAddRow_errorMsgFromAddRow.html +539 -0
- package/docs/examples/w-table-edit_editable_inforPaddingStyle_menuBackgroundColor.html +534 -0
- package/docs/examples/w-table-edit_editable_language_checkId_tooltipAddRow.html +540 -0
- package/docs/examples/w-table-edit_editable_language_textLabelDataName_textPlaceholderDataName.html +535 -0
- package/docs/examples/w-table-edit_editable_no enableInfor.html +529 -0
- package/docs/examples/w-table-edit_editable_no enableMenu.html +529 -0
- package/docs/examples/w-table-edit_editable_opt.beforeAddRow.html +528 -0
- package/docs/examples/w-table-edit_editable_opt.kpConvertKeysWhenUploadData.html +528 -0
- package/docs/examples/w-table-edit_editable_opt.optForUploadData.html +528 -0
- package/docs/examples/w-table-edit_editable_slot btns-right.html +552 -0
- package/docs/examples/w-table-edit_fixIds (fix id).html +529 -0
- package/docs/examples/w-table-edit_hideIds (hide mappingId).html +529 -0
- package/docs/examples/w-table-edit_name_description.html +527 -0
- package/docs/examples/w-table-edit_no enableInfor.html +528 -0
- package/docs/examples/w-table-edit_no enableMenu.html +528 -0
- package/docs/examples/w-table-edit_opt.kpHead.html +527 -0
- package/docs/examples/w-table-edit_removeIdsWhenDownload (remove id, mappingId, order, isActive).html +530 -0
- package/docs/examples/w-table-edit_slot btns-left.html +551 -0
- package/docs/examples/w-table-edit_slot btns-right.html +551 -0
- package/docs/examples/w-table-edit_slot infor (name_description).html +544 -0
- package/docs/examples/w-table-edit_sortColIds (sort by order).html +528 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/index.html +84 -0
- package/docs/module-WTableEdit.html +1486 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/package.json +66 -0
- package/public/index.html +25 -0
- package/script.txt +24 -0
- package/src/App.vue +322 -0
- package/src/AppZoneWTableEdit.vue +740 -0
- package/src/components/WTableEdit.vue +1278 -0
- package/src/components/WTableVue.vue +12 -0
- package/src/components/demolink.vue +105 -0
- package/src/main.js +8 -0
- package/test/all.test.mjs +10 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +5 -0
- package/toolg/cvCasename.mjs +43 -0
- package/toolg/gDistApp.mjs +38 -0
- package/toolg/gDistRollupComps.mjs +23 -0
- package/toolg/gDocExams.mjs +47 -0
- package/toolg/gExtractHtml.mjs +268 -0
- package/toolg/gMergeComps.mjs +75 -0
- package/toolg/modifyReadme.mjs +4 -0
- package/vue.config.js +9 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.pln {
|
|
2
|
+
color: #ddd;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* string content */
|
|
6
|
+
.str {
|
|
7
|
+
color: #61ce3c;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* a keyword */
|
|
11
|
+
.kwd {
|
|
12
|
+
color: #fbde2d;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* a comment */
|
|
16
|
+
.com {
|
|
17
|
+
color: #aeaeae;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* a type name */
|
|
21
|
+
.typ {
|
|
22
|
+
color: #8da6ce;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* a literal value */
|
|
26
|
+
.lit {
|
|
27
|
+
color: #fbde2d;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* punctuation */
|
|
31
|
+
.pun {
|
|
32
|
+
color: #ddd;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* lisp open bracket */
|
|
36
|
+
.opn {
|
|
37
|
+
color: #000000;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* lisp close bracket */
|
|
41
|
+
.clo {
|
|
42
|
+
color: #000000;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* a markup tag name */
|
|
46
|
+
.tag {
|
|
47
|
+
color: #8da6ce;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* a markup attribute name */
|
|
51
|
+
.atn {
|
|
52
|
+
color: #fbde2d;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* a markup attribute value */
|
|
56
|
+
.atv {
|
|
57
|
+
color: #ddd;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* a declaration */
|
|
61
|
+
.dec {
|
|
62
|
+
color: #EF5050;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* a variable name */
|
|
66
|
+
.var {
|
|
67
|
+
color: #c82829;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* a function name */
|
|
71
|
+
.fun {
|
|
72
|
+
color: #4271ae;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Specify class=linenums on a pre to get line numbering */
|
|
76
|
+
ol.linenums {
|
|
77
|
+
margin-top: 0;
|
|
78
|
+
margin-bottom: 0;
|
|
79
|
+
padding-bottom: 2px;
|
|
80
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "w-table-vue",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/w-table-vue.umd.js",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"w-aggrid-vue": "^2.0.68",
|
|
7
|
+
"w-component-vue": "^2.4.83",
|
|
8
|
+
"wsemi": "^1.8.76"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
12
|
+
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
13
|
+
"@vue/cli-service": "^5.0.8",
|
|
14
|
+
"cheerio": "^1.1.2",
|
|
15
|
+
"eslint": "^8.37.0",
|
|
16
|
+
"eslint-config-standard": "^17.1.0",
|
|
17
|
+
"eslint-friendly-formatter": "^4.0.1",
|
|
18
|
+
"eslint-plugin-import": "^2.27.5",
|
|
19
|
+
"eslint-plugin-n": "^16.6.2",
|
|
20
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
21
|
+
"eslint-plugin-vue": "^9.10.0",
|
|
22
|
+
"vue": "^2.7.16",
|
|
23
|
+
"w-package-tools": "^1.1.12"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"serve": "vue-cli-service serve",
|
|
27
|
+
"build": "vue-cli-service build",
|
|
28
|
+
"test": "mocha --parallel --timeout 60000",
|
|
29
|
+
"lint": "vue-cli-service lint",
|
|
30
|
+
"deploy": "gh-pages -d docs"
|
|
31
|
+
},
|
|
32
|
+
"eslintConfig": {
|
|
33
|
+
"root": true,
|
|
34
|
+
"env": {
|
|
35
|
+
"node": true
|
|
36
|
+
},
|
|
37
|
+
"extends": [
|
|
38
|
+
"plugin:vue/essential",
|
|
39
|
+
"eslint:recommended"
|
|
40
|
+
],
|
|
41
|
+
"rules": {},
|
|
42
|
+
"parserOptions": {
|
|
43
|
+
"parser": "babel-eslint"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"postcss": {
|
|
47
|
+
"plugins": {
|
|
48
|
+
"autoprefixer": {}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"browserslist": [
|
|
52
|
+
"> 1%",
|
|
53
|
+
"last 2 versions"
|
|
54
|
+
],
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/yuda-lyu/w-table-vue.git"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"component",
|
|
61
|
+
"vue",
|
|
62
|
+
"table"
|
|
63
|
+
],
|
|
64
|
+
"author": "yuda-lyu(semisphere)",
|
|
65
|
+
"license": "MIT"
|
|
66
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
7
|
+
<title>w-table-vue</title>
|
|
8
|
+
|
|
9
|
+
<!-- @vue-cli動添加@babel/polyfill與vue -->
|
|
10
|
+
|
|
11
|
+
<!-- fontawesome -->
|
|
12
|
+
<link href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css" rel="stylesheet">
|
|
13
|
+
|
|
14
|
+
<!-- mdi font -->
|
|
15
|
+
<link _href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css" rel="stylesheet">
|
|
16
|
+
|
|
17
|
+
</head>
|
|
18
|
+
<body style="font-family:'Microsoft JhengHei','Avenir','Helvetica'; padding:0px; margin:0px;">
|
|
19
|
+
<noscript>
|
|
20
|
+
<strong>We're sorry but w-table-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
21
|
+
</noscript>
|
|
22
|
+
<div id="app"></div>
|
|
23
|
+
<!-- built files will be auto injected -->
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
package/script.txt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#node toolg/addVersion.mjs
|
|
2
|
+
node toolg/modifyReadme.mjs
|
|
3
|
+
|
|
4
|
+
node toolg/cleanFolder.mjs
|
|
5
|
+
./node_modules/.bin/jsdoc -c .jsdoc
|
|
6
|
+
|
|
7
|
+
node toolg/gDistApp.mjs
|
|
8
|
+
|
|
9
|
+
node toolg/gExtractHtml.mjs
|
|
10
|
+
node toolg/gDocExams.mjs
|
|
11
|
+
|
|
12
|
+
node toolg/gMergeComps.mjs
|
|
13
|
+
|
|
14
|
+
node toolg/gDistRollupComps.mjs
|
|
15
|
+
|
|
16
|
+
git add . -A
|
|
17
|
+
git commit -m 'modify: '
|
|
18
|
+
git push origin master:master
|
|
19
|
+
|
|
20
|
+
npm run deploy
|
|
21
|
+
|
|
22
|
+
#npm test
|
|
23
|
+
|
|
24
|
+
#npm publish
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
style=""
|
|
4
|
+
:changeMenus="changeMenus"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<template v-if="!isNarrow">
|
|
9
|
+
<a href="https://github.com/yuda-lyu/w-table-vue" class="github-corner" style="position:fixed; top:0; right:0; border:0; z-index:10000;" aria-label="View source on GitHub" target="_blank" rel="noreferrer noopener">
|
|
10
|
+
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:rgba(0,0,0,0.25); color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg>
|
|
11
|
+
</a>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<div style="background:#f5f5f5;">
|
|
16
|
+
|
|
17
|
+
<div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL1 && cmpsL1.length>0">
|
|
18
|
+
<WListHorizontal
|
|
19
|
+
:items="cmpsL1"
|
|
20
|
+
:itemActive.sync="cmpP1"
|
|
21
|
+
:itemBackgroundColor="'transparent'"
|
|
22
|
+
:itemBackgroundColorHover="'#eee'"
|
|
23
|
+
:itemBackgroundColorActive="'#eee'"
|
|
24
|
+
:keyText="'name'"
|
|
25
|
+
:paddingStyle="{v:12,h:20}"
|
|
26
|
+
@update:itemActive="(v)=>{indP3=0;indP2=0;indP1=getInd(v,cmpsL1)}"
|
|
27
|
+
>
|
|
28
|
+
<template v-slot:item="props">
|
|
29
|
+
<div style="">
|
|
30
|
+
{{kebabCaseFix(props.item.name)}}
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
</WListHorizontal>
|
|
34
|
+
<div style="height:1px; background:#ddd;"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL2 && cmpsL2.length>0">
|
|
39
|
+
<div style="height:3px; background:#fff;"></div>
|
|
40
|
+
<WListHorizontal
|
|
41
|
+
:items="cmpsL2"
|
|
42
|
+
:itemActive.sync="cmpP2"
|
|
43
|
+
:itemBackgroundColor="'transparent'"
|
|
44
|
+
:itemBackgroundColorHover="'#eee'"
|
|
45
|
+
:itemBackgroundColorActive="'#eee'"
|
|
46
|
+
:keyText="'name'"
|
|
47
|
+
:paddingStyle="{v:12,h:20}"
|
|
48
|
+
@update:itemActive="(v)=>{indP3=0;indP2=getInd(v,cmpsL2)}"
|
|
49
|
+
>
|
|
50
|
+
<template v-slot:item="props">
|
|
51
|
+
<div style="">
|
|
52
|
+
{{kebabCaseFix(props.item.name)}}
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
</WListHorizontal>
|
|
56
|
+
<div style="height:1px; background:#ddd;"></div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL3 && cmpsL3.length>0">
|
|
60
|
+
<div style="height:3px; background:#fff;"></div>
|
|
61
|
+
<WListHorizontal
|
|
62
|
+
:items="cmpsL3"
|
|
63
|
+
:itemActive.sync="cmpP3"
|
|
64
|
+
:itemBackgroundColor="'transparent'"
|
|
65
|
+
:itemBackgroundColorHover="'#eee'"
|
|
66
|
+
:itemBackgroundColorActive="'#eee'"
|
|
67
|
+
:keyText="'name'"
|
|
68
|
+
:paddingStyle="{v:12,h:20}"
|
|
69
|
+
@update:itemActive="(v)=>{indP3=getInd(v,cmpsL3)}"
|
|
70
|
+
>
|
|
71
|
+
<template v-slot:item="props">
|
|
72
|
+
<div style="">
|
|
73
|
+
{{kebabCaseFix(props.item.name)}}
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
</WListHorizontal>
|
|
77
|
+
<div style="height:1px; background:#ddd;"></div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<div>
|
|
84
|
+
|
|
85
|
+
<AppZoneWTableEdit v-if="cmpPick==='WTableEdit'"></AppZoneWTableEdit>
|
|
86
|
+
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<script>
|
|
94
|
+
import get from 'lodash-es/get.js'
|
|
95
|
+
import kebabCase from 'lodash-es/kebabCase.js'
|
|
96
|
+
import each from 'lodash-es/each.js'
|
|
97
|
+
// import cloneDeep from 'lodash-es/cloneDeep.js'
|
|
98
|
+
import strright from 'wsemi/src/strright.mjs'
|
|
99
|
+
import strdelright from 'wsemi/src/strdelright.mjs'
|
|
100
|
+
import urlParse from 'wsemi/src/urlParse.mjs'
|
|
101
|
+
import WListHorizontal from 'w-component-vue/src/components/WListHorizontal.vue'
|
|
102
|
+
import AppZoneWTableEdit from './AppZoneWTableEdit.vue'
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
let kebabCaseFix = (c) => {
|
|
106
|
+
let r = kebabCase(c)
|
|
107
|
+
if (strright(r, 3) === '2-d') {
|
|
108
|
+
r = strdelright(r, 3) + '2d'
|
|
109
|
+
}
|
|
110
|
+
return r
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
export default {
|
|
115
|
+
components: {
|
|
116
|
+
WListHorizontal,
|
|
117
|
+
AppZoneWTableEdit,
|
|
118
|
+
},
|
|
119
|
+
data: function() {
|
|
120
|
+
let cmps = [
|
|
121
|
+
{ name: 'WTableEdit', },
|
|
122
|
+
]
|
|
123
|
+
return {
|
|
124
|
+
kebabCaseFix,
|
|
125
|
+
|
|
126
|
+
cmpsL1: cmps,
|
|
127
|
+
indP1: null,
|
|
128
|
+
cmpP1: null,
|
|
129
|
+
|
|
130
|
+
cmpsL2: null,
|
|
131
|
+
indP2: null,
|
|
132
|
+
cmpP2: null,
|
|
133
|
+
|
|
134
|
+
cmpsL3: null,
|
|
135
|
+
indP3: null,
|
|
136
|
+
cmpP3: null,
|
|
137
|
+
|
|
138
|
+
cmpsL4: null,
|
|
139
|
+
|
|
140
|
+
cmpPick: '',
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
mounted: function() {
|
|
145
|
+
let vo = this
|
|
146
|
+
|
|
147
|
+
//default
|
|
148
|
+
vo.indP1 = 0
|
|
149
|
+
vo.indP2 = 0
|
|
150
|
+
vo.indP3 = 0
|
|
151
|
+
|
|
152
|
+
//urlParse, http://localhost:8080/?cmp=w-table-edit
|
|
153
|
+
let p = urlParse(location.href)
|
|
154
|
+
// console.log('p', p)
|
|
155
|
+
|
|
156
|
+
//viewPick
|
|
157
|
+
vo.viewPick(get(p, 'cmp', ''))
|
|
158
|
+
|
|
159
|
+
},
|
|
160
|
+
computed: {
|
|
161
|
+
|
|
162
|
+
changeMenus: function() {
|
|
163
|
+
let vo = this
|
|
164
|
+
vo.modifyMenus(vo.indP1, vo.indP2, vo.indP3)
|
|
165
|
+
return ''
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
isNarrow: function() {
|
|
169
|
+
return window.innerWidth < 1000
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
},
|
|
173
|
+
methods: {
|
|
174
|
+
|
|
175
|
+
modifyMenus: function() {
|
|
176
|
+
let vo = this
|
|
177
|
+
|
|
178
|
+
let cmpPick = ''
|
|
179
|
+
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
|
|
182
|
+
// console.log('call P1')
|
|
183
|
+
vo.cmpP1 = get(vo.cmpsL1, vo.indP1, {})
|
|
184
|
+
vo.cmpsL2 = get(vo.cmpP1, `cmps`, [])
|
|
185
|
+
let _cmpPick = get(vo.cmpP1, `name`, '')
|
|
186
|
+
if (_cmpPick) {
|
|
187
|
+
cmpPick = _cmpPick
|
|
188
|
+
}
|
|
189
|
+
// console.log('vo.cmpP1', cloneDeep(vo.cmpP1))
|
|
190
|
+
// console.log('vo.cmpsL2', cloneDeep(vo.cmpsL2))
|
|
191
|
+
|
|
192
|
+
}, 50)
|
|
193
|
+
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
|
|
196
|
+
// console.log('call P2')
|
|
197
|
+
let cmps = get(vo.cmpP1, `cmps`, [])
|
|
198
|
+
vo.cmpP2 = get(cmps, vo.indP2, {})
|
|
199
|
+
vo.cmpsL3 = get(vo.cmpP2, `cmps`, [])
|
|
200
|
+
let _cmpPick = get(vo.cmpP2, `name`, '')
|
|
201
|
+
if (_cmpPick) {
|
|
202
|
+
cmpPick = _cmpPick
|
|
203
|
+
}
|
|
204
|
+
// console.log('vo.cmpP2', cloneDeep(vo.cmpP2))
|
|
205
|
+
// console.log('vo.cmpsL3', cloneDeep(vo.cmpsL3))
|
|
206
|
+
|
|
207
|
+
}, 100)
|
|
208
|
+
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
|
|
211
|
+
// console.log('call P3')
|
|
212
|
+
let cmps = get(vo.cmpP2, `cmps`, [])
|
|
213
|
+
vo.cmpP3 = get(cmps, vo.indP3, {})
|
|
214
|
+
vo.cmpsL4 = get(vo.cmpP3, `cmps`, [])
|
|
215
|
+
let _cmpPick = get(vo.cmpP3, `name`, '')
|
|
216
|
+
if (_cmpPick) {
|
|
217
|
+
cmpPick = _cmpPick
|
|
218
|
+
}
|
|
219
|
+
// console.log('vo.cmpP3', cloneDeep(vo.cmpP3))
|
|
220
|
+
// console.log('vo.cmpsL4', cloneDeep(vo.cmpsL4))
|
|
221
|
+
|
|
222
|
+
//update
|
|
223
|
+
vo.cmpPick = cmpPick
|
|
224
|
+
// console.log('cmpPick', cmpPick)
|
|
225
|
+
|
|
226
|
+
}, 150)
|
|
227
|
+
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
getInd: function(item, items) {
|
|
231
|
+
// let vo = this
|
|
232
|
+
let ind = -1
|
|
233
|
+
each(items, (v, k) => {
|
|
234
|
+
if (item.name === v.name) {
|
|
235
|
+
ind = k
|
|
236
|
+
return false //跳出
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
return ind
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
viewPick: function(cmpPick) {
|
|
243
|
+
let vo = this
|
|
244
|
+
let _cmpPick = kebabCaseFix(cmpPick)
|
|
245
|
+
let r = ''
|
|
246
|
+
let rs = []
|
|
247
|
+
let ls = []
|
|
248
|
+
let pv = (ts) => {
|
|
249
|
+
each(ts, (v, k) => {
|
|
250
|
+
ls.push(k)
|
|
251
|
+
|
|
252
|
+
//name, _name
|
|
253
|
+
let name = get(v, `name`, '')
|
|
254
|
+
let _name = kebabCaseFix(name)
|
|
255
|
+
|
|
256
|
+
//cmps
|
|
257
|
+
let cmps = get(v, `cmps`, [])
|
|
258
|
+
|
|
259
|
+
//push
|
|
260
|
+
let cls = ls.join('.')
|
|
261
|
+
let b = _name === _cmpPick
|
|
262
|
+
rs.push({
|
|
263
|
+
cls,
|
|
264
|
+
name,
|
|
265
|
+
b,
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
//save
|
|
269
|
+
if (b) {
|
|
270
|
+
r = JSON.parse(JSON.stringify(ls))
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
//遞迴pv
|
|
274
|
+
if (cmps.length > 0) {
|
|
275
|
+
pv(cmps)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
ls.pop()
|
|
279
|
+
})
|
|
280
|
+
}
|
|
281
|
+
pv(vo.cmpsL1)
|
|
282
|
+
// console.log('rs', rs)
|
|
283
|
+
// console.log('r', r)
|
|
284
|
+
vo.indP1 = get(r, 0, 0)
|
|
285
|
+
vo.indP2 = get(r, 1, 0)
|
|
286
|
+
vo.indP3 = get(r, 2, 0)
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
},
|
|
290
|
+
}
|
|
291
|
+
</script>
|
|
292
|
+
|
|
293
|
+
<style>
|
|
294
|
+
.head1 {
|
|
295
|
+
padding: 0px 0px 20px 0px;
|
|
296
|
+
font-size: 2.5rem;
|
|
297
|
+
}
|
|
298
|
+
.bkh { /* 寬 */
|
|
299
|
+
padding:20px;
|
|
300
|
+
}
|
|
301
|
+
@media screen and (max-width:800px){ /* 中 */
|
|
302
|
+
.bkh {
|
|
303
|
+
padding:10px;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
@media screen and (max-width:400px){ /* 窄 */
|
|
307
|
+
.bkh {
|
|
308
|
+
padding:5px;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
.bk { /* 寬 */
|
|
312
|
+
display: inline-block;
|
|
313
|
+
vertical-align: top;
|
|
314
|
+
padding: 0px 80px 60px 0px;
|
|
315
|
+
}
|
|
316
|
+
@media screen and (max-width:1000px){ /* 中窄 */
|
|
317
|
+
.bk {
|
|
318
|
+
display: block;
|
|
319
|
+
padding: 0px 0px 50px 0px;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
</style>
|