Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
公瑾
/
lucky-draw
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c78ed693
authored
2019-12-27 20:51:55 +0800
by
vito
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复名单导入不能叠加问题
1 parent
a8e64a63
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
134 deletions
src/App.vue
src/components/Tool.vue
src/store/index.js
yarn.lock
src/App.vue
View file @
c78ed69
...
...
@@ -39,22 +39,24 @@
<span
class=
"key"
:style=
"
{
fontSize: list[item]
&&
list[item].name ? '36px' : null,
lineHeight: list[item]
&&
list[item].name ? '80px' : null
fontSize: list[item - 1]
&&
list[item - 1].name ? '36px' : null,
lineHeight:
list[item - 1]
&&
list[item - 1].name ? '80px' : null
}"
v-if="list[item
]
&&
list[item
].name"
v-if="list[item
- 1]
&&
list[item - 1
].name"
>
{{
item
}}
</span>
<span
class=
"cont"
:style=
"
{
fontSize: list[item]
&&
list[item].name ? '36px' : null,
lineHeight: list[item]
&&
list[item].name ? '80px' : null
fontSize: list[item - 1]
&&
list[item - 1].name ? '36px' : null,
lineHeight:
list[item - 1]
&&
list[item - 1].name ? '80px' : null
}"
>
<span
v-if=
"list[item
] && list[item
].name"
>
{{
list
[
item
].
name
}}
<span
v-if=
"list[item
- 1] && list[item - 1
].name"
>
{{
list
[
item
-
1
].
name
}}
</span>
<span
v-else
>
{{
item
}}
...
...
@@ -66,7 +68,12 @@
</transition>
<LotteryConfig
:visible
.
sync=
"showConfig"
@
resetconfig=
"reloadTagCanvas"
/>
<Tool
@
toggle=
"toggle"
@
resetConfig=
"reloadTagCanvas"
:running=
"running"
/>
<Tool
@
toggle=
"toggle"
@
resetConfig=
"reloadTagCanvas"
:running=
"running"
:closeRes=
"closeRes"
/>
<Result
:visible
.
sync=
"showResult"
></Result>
<span
class=
"copy-right"
>
...
...
@@ -134,10 +141,10 @@ export default {
},
datas
()
{
const
datas
=
[];
for
(
let
index
=
0
;
index
<
this
.
config
.
number
;
index
++
)
{
for
(
let
index
=
1
;
index
<=
this
.
config
.
number
;
index
++
)
{
const
listData
=
this
.
list
.
find
(
d
=>
d
.
key
===
index
);
datas
.
push
({
key
:
index
+
1
,
key
:
index
,
name
:
listData
?
listData
.
name
:
''
});
}
...
...
@@ -214,16 +221,23 @@ export default {
reloadTagCanvas
()
{
window
.
TagCanvas
.
Reload
(
'rootcanvas'
);
},
closeRes
()
{
this
.
showRes
=
false
;
},
toggle
(
form
)
{
const
{
speed
,
config
}
=
this
;
if
(
this
.
running
)
{
window
.
TagCanvas
.
SetSpeed
(
'rootcanvas'
,
speed
());
this
.
showRes
=
true
;
this
.
running
=
!
this
.
running
;
this
.
$nextTick
(()
=>
{
this
.
reloadTagCanvas
();
});
}
else
{
this
.
showRes
=
false
;
if
(
!
form
)
{
return
;
}
const
{
number
}
=
config
;
const
{
category
,
mode
,
qty
,
remain
,
allin
}
=
form
;
let
num
=
1
;
...
...
@@ -251,8 +265,8 @@ export default {
});
this
.
result
=
data
;
window
.
TagCanvas
.
SetSpeed
(
'rootcanvas'
,
[
5
,
1
]);
this
.
running
=
!
this
.
running
;
}
this
.
running
=
!
this
.
running
;
}
}
};
...
...
@@ -298,7 +312,7 @@ export default {
animation
:
bounce-in
1.5s
;
}
.bounce-leave-active
{
animation
:
bounce-in
0
.2
s
reverse
;
animation
:
bounce-in
0s
reverse
;
}
}
#main
{
...
...
src/components/Tool.vue
View file @
c78ed69
...
...
@@ -105,7 +105,8 @@ import { clearData, conversionCategoryName } from '@/helper/index';
export
default
{
props
:
{
running
:
Boolean
running
:
Boolean
,
closeRes
:
Function
},
computed
:
{
config
:
{
...
...
@@ -165,7 +166,7 @@ export default {
.
then
(()
=>
{
clearData
();
this
.
$store
.
commit
(
'setClearStore'
);
this
.
closeRes
&&
this
.
closeRes
();
this
.
$message
({
type
:
'success'
,
message
:
'重置成功!'
...
...
@@ -209,9 +210,8 @@ export default {
);
},
startHandler
()
{
if
(
this
.
running
)
{
this
.
$emit
(
'toggle'
);
}
else
{
this
.
$emit
(
'toggle'
);
if
(
!
this
.
running
)
{
this
.
showSetwat
=
true
;
}
},
...
...
@@ -224,7 +224,7 @@ export default {
const
rows
=
listStr
.
split
(
'\n'
);
if
(
rows
&&
rows
.
length
>
0
)
{
rows
.
forEach
(
item
=>
{
const
rowList
=
item
.
split
(
'\t'
);
const
rowList
=
item
.
split
(
/
\t
|
\s
/
);
if
(
rowList
.
length
>=
2
)
{
const
key
=
Number
(
rowList
[
0
].
trim
());
const
name
=
rowList
[
1
].
trim
();
...
...
src/store/index.js
View file @
c78ed69
...
...
@@ -73,9 +73,9 @@ export default new Vuex.Store({
setList
(
state
,
list
)
{
const
arr
=
state
.
list
;
list
.
forEach
(
item
=>
{
const
arrI
tem
=
arr
.
find
(
data
=>
data
.
key
===
item
.
key
);
if
(
arrI
tem
)
{
arr
Item
.
name
==
=
item
.
name
;
const
arrI
ndex
=
arr
.
findIndex
(
data
=>
data
.
key
===
item
.
key
);
if
(
arrI
ndex
>
-
1
)
{
arr
[
arrIndex
].
name
=
item
.
name
;
}
else
{
arr
.
push
(
item
);
}
...
...
yarn.lock
View file @
c78ed69
...
...
@@ -2366,7 +2366,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
dependencies:
ms "2.0.0"
debug@^3.0.0, debug@^3.1.1, debug@^3.2.5
, debug@^3.2.6
:
debug@^3.0.0, debug@^3.1.1, debug@^3.2.5:
version "3.2.6"
resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
dependencies:
...
...
@@ -2397,10 +2397,6 @@ deep-equal@^1.0.1:
object-keys "^1.1.1"
regexp.prototype.flags "^1.2.0"
deep-extend@^0.6.0:
version "0.6.0"
resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
...
...
@@ -2488,10 +2484,6 @@ destroy@~1.0.4:
version "1.0.4"
resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
detect-libc@^1.0.2:
version "1.0.3"
resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
detect-node@^2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c"
...
...
@@ -3231,12 +3223,6 @@ fs-extra@^7.0.1:
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-minipass@^1.2.5:
version "1.2.7"
resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
dependencies:
minipass "^2.6.0"
fs-minipass@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.0.0.tgz#a6415edab02fae4b9e9230bc87ee2e4472003cd1"
...
...
@@ -3682,7 +3668,7 @@ human-signals@^1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
iconv-lite@0.4.24, iconv-lite@^0.4.24
, iconv-lite@^0.4.4
:
iconv-lite@0.4.24, iconv-lite@^0.4.24:
version "0.4.24"
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
dependencies:
...
...
@@ -3702,12 +3688,6 @@ iferr@^0.1.5:
version "0.1.5"
resolved "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
ignore-walk@^3.0.1:
version "3.0.3"
resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37"
dependencies:
minimatch "^3.0.4"
ignore@^3.3.5:
version "3.3.10"
resolved "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
...
...
@@ -3794,10 +3774,6 @@ inherits@2.0.3:
version "2.0.3"
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
ini@~1.3.0:
version "1.3.5"
resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
inquirer@^6.2.2:
version "6.5.2"
resolved "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca"
...
...
@@ -4608,25 +4584,12 @@ minipass-pipeline@^1.2.2:
dependencies:
minipass "^3.0.0"
minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0:
version "2.9.0"
resolved "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
dependencies:
safe-buffer "^5.1.2"
yallist "^3.0.0"
minipass@^3.0.0, minipass@^3.1.1:
version "3.1.1"
resolved "https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz#7607ce778472a185ad6d89082aa2070f79cedcd5"
dependencies:
yallist "^4.0.0"
minizlib@^1.2.1:
version "1.3.3"
resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
dependencies:
minipass "^2.9.0"
mississippi@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022"
...
...
@@ -4725,14 +4688,6 @@ natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
needle@^2.2.1:
version "2.4.0"
resolved "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c"
dependencies:
debug "^3.2.6"
iconv-lite "^0.4.4"
sax "^1.2.4"
negotiator@0.6.2:
version "0.6.2"
resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
...
...
@@ -4808,21 +4763,6 @@ node-libs-browser@^2.2.1:
util "^0.11.0"
vm-browserify "^1.0.1"
node-pre-gyp@*:
version "0.14.0"
resolved "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
dependencies:
detect-libc "^1.0.2"
mkdirp "^0.5.1"
needle "^2.2.1"
nopt "^4.0.1"
npm-packlist "^1.1.6"
npmlog "^4.0.2"
rc "^1.2.7"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^4.4.2"
node-releases@^1.1.42:
version "1.1.44"
resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.44.tgz#cd66438a6eb875e3eb012b6a12e48d9f4326ffd7"
...
...
@@ -4857,13 +4797,6 @@ node-sass@^4.13.0:
dependencies:
abbrev "1"
nopt@^4.0.1:
version "4.0.1"
resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
dependencies:
abbrev "1"
osenv "^0.1.4"
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.5.0:
version "2.5.0"
resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
...
...
@@ -4908,23 +4841,6 @@ normalize-wheel@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45"
npm-bundled@^1.0.1:
version "1.1.1"
resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b"
dependencies:
npm-normalize-package-bin "^1.0.1"
npm-normalize-package-bin@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2"
npm-packlist@^1.1.6:
version "1.4.7"
resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz#9e954365a06b80b18111ea900945af4f88ed4848"
dependencies:
ignore-walk "^3.0.1"
npm-bundled "^1.0.1"
npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
...
...
@@ -4937,7 +4853,7 @@ npm-run-path@^4.0.0:
dependencies:
path-key "^3.0.0"
"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0
, npmlog@^4.0.2
:
"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0:
version "4.1.2"
resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
dependencies:
...
...
@@ -5138,7 +5054,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
osenv@0
, osenv@^0.1.4
:
osenv@0:
version "0.1.5"
resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
dependencies:
...
...
@@ -5872,15 +5788,6 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
rc@^1.2.7:
version "1.2.8"
resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
dependencies:
deep-extend "^0.6.0"
ini "~1.3.0"
minimist "^1.2.0"
strip-json-comments "~2.0.1"
read-pkg-up@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
...
...
@@ -6215,7 +6122,7 @@ sass-loader@^8.0.0:
schema-utils "^2.1.0"
semver "^6.3.0"
sax@
^1.2.4, sax@
~1.2.4:
sax@~1.2.4:
version "1.2.4"
resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
...
...
@@ -6251,7 +6158,7 @@ selfsigned@^1.10.7:
dependencies:
node-forge "0.9.0"
"semver@2 || 3 || 4 || 5", semver@^5.
3.0, semver@^5.
4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
...
...
@@ -6752,7 +6659,7 @@ strip-indent@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68"
strip-json-comments@^2.0.1
, strip-json-comments@~2.0.1
:
strip-json-comments@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
...
...
@@ -6829,18 +6736,6 @@ tar@^2.0.0:
fstream "^1.0.12"
inherits "2"
tar@^4.4.2:
version "4.4.13"
resolved "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
dependencies:
chownr "^1.1.1"
fs-minipass "^1.2.5"
minipass "^2.8.6"
minizlib "^1.2.1"
mkdirp "^0.5.0"
safe-buffer "^5.1.2"
yallist "^3.0.3"
terser-webpack-plugin@^1.4.3:
version "1.4.3"
resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c"
...
...
@@ -7530,7 +7425,7 @@ yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
yallist@^3.0.
0, yallist@^3.0.2, yallist@^3.0.3
:
yallist@^3.0.
2
:
version "3.1.1"
resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
...
...
Please
register
or
sign in
to post a comment