Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
6169394c
Commit
6169394c
authored
Jul 12, 2023
by
lvzhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3d5f031e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
398 additions
and
1141 deletions
+398
-1141
ruoyi-ui/src/views/system/supplies/index_back.vue
ruoyi-ui/src/views/system/supplies/index_back.vue
+0
-392
ruoyi-ui/src/views/system/supplies/index_back2.vue
ruoyi-ui/src/views/system/supplies/index_back2.vue
+0
-441
ruoyi-ui/src/views/system/supplies/index_template_back.vue
ruoyi-ui/src/views/system/supplies/index_template_back.vue
+0
-308
ruoyi-ui/src/views/system/supplies/rule.vue
ruoyi-ui/src/views/system/supplies/rule.vue
+398
-0
No files found.
ruoyi-ui/src/views/system/supplies/index_back.vue
deleted
100644 → 0
View file @
3d5f031e
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/supplies/index_back2.vue
deleted
100644 → 0
View file @
3d5f031e
This diff is collapsed.
Click to expand it.
ruoyi-ui/src/views/system/supplies/index_template_back.vue
deleted
100644 → 0
View file @
3d5f031e
<
template
>
<div
class=
"hello"
>
<div
style=
"position: absolute; top: 0"
>
<!--保存-->
<el-button
type=
"primary"
@
click=
"saveExcel"
v-has-permi=
"['system:supplies:save']"
>
保存
</el-button>
<!--修改-->
<el-button
type=
"primary"
@
click=
"editExcel"
v-has-permi=
"['system:supplies:edit']"
>
修改
</el-button>
<!--删除-->
<el-button
type=
"primary"
@
click=
"deleteExcel"
v-has-permi=
"['system:supplies:delete']"
>
删除
</el-button>
<!--导出-->
<el-button
type=
"primary"
@
click=
"deriveExcel"
>
导出
</el-button>
<!--导入-->
<input
style=
"font-size: 16px"
type=
"file"
@
change=
"uploadExcel"
/>
<!--导入-->
<input
style=
"font-size: 16px"
type=
"file"
@
change=
"uploadExcel2"
/>
<!--隐藏id-->
<input
style=
"font-size: 16px"
id=
"id"
type=
"text"
value=
''
/>
<a
href=
"javascript:void(0)"
@
click=
"downloadExcel"
>
下载选择的模板
</a>
</div>
<div
id=
"luckysheet"
style=
"margin: 0px;padding: 0px;position: absolute;width: 100%;height: 1000px;left: 0px;top: 150px;bottom: 0px;"
></div>
<div
v-show=
"isMaskShow"
style=
"position: absolute;z-index: 1000000;left: 0px;top: 0px;bottom: 0px;right: 0px;background: rgba(255, 255, 255, 0.8);text-align: center;font-size: 40px;align-items: center;ustify-content: center;display: flex;"
>
Downloading
</div>
</div>
</
template
>
<
script
>
import
$
from
'
jquery
'
import
luckysheet
from
'
luckysheet
'
import
LuckyExcel
from
'
luckyexcel
'
import
axios
from
'
axios
'
;
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
import
{
exportExcel
}
from
'
../../../../public/luckysheet/exportExcel
'
import
{
getToken
}
from
'
../../../utils/auth
'
var
uploadExcel1
;
var
uploadExcel2
;
export
default
{
name
:
'
wzgl
'
,
props
:
{
msg
:
String
},
data
()
{
},
mounted
()
{
// In some cases, you need to use $nextTick
// this.$nextTick(() => {
//
// })
luckysheet
.
create
({
container
:
'
luckysheet
'
,
// 设定DOM容器的id
title
:
'
Luckysheet Demo
'
,
// 设定表格名称
lang
:
'
zh
'
,
// 设定表格语言
plugins
:[
'
chart
'
],
showinfobar
:
false
,
data
:[
{
"
name
"
:
"
Cell
"
,
//工作表名称
"
color
"
:
""
,
//工作表颜色
"
index
"
:
0
,
//工作表索引
"
status
"
:
1
,
//激活状态
"
order
"
:
0
,
//工作表的下标
"
hide
"
:
0
,
//是否隐藏
"
row
"
:
36
,
//行数
"
column
"
:
18
,
//列数
"
defaultRowHeight
"
:
19
,
//自定义行高
"
defaultColWidth
"
:
73
,
//自定义列宽
"
celldata
"
:
[],
//初始化使用的单元格数据
"
config
"
:
{
"
merge
"
:{},
//合并单元格
"
rowlen
"
:{},
//表格行高
"
columnlen
"
:{},
//表格列宽
"
rowhidden
"
:{},
//隐藏行
"
colhidden
"
:{},
//隐藏列
"
borderInfo
"
:{},
//边框
"
authority
"
:{},
//工作表保护
},
"
scrollLeft
"
:
0
,
//左右滚动条位置
"
scrollTop
"
:
315
,
//上下滚动条位置
"
luckysheet_select_save
"
:
[],
//选中的区域
"
calcChain
"
:
[],
//公式链
"
isPivotTable
"
:
false
,
//是否数据透视表
"
pivotTable
"
:{},
//数据透视表设置
"
filter_select
"
:
{},
//筛选范围
"
filter
"
:
null
,
//筛选配置
"
luckysheet_alternateformat_save
"
:
[],
//交替颜色
"
luckysheet_alternateformat_save_modelCustom
"
:
[],
//自定义交替颜色
"
luckysheet_conditionformat_save
"
:
{},
//条件格式
"
frozen
"
:
{},
//冻结行列配置
"
chart
"
:
[],
//图表配置
"
zoomRatio
"
:
1
,
// 缩放比例
"
image
"
:[],
//图片
"
showGridLines
"
:
1
,
//是否显示网格线
"
dataVerification
"
:{}
//数据验证配置
}
]
});
},
methods
:
{
uploadExcel
(
evt
)
{
const
files
=
evt
.
target
.
files
if
(
files
==
null
||
files
.
length
==
0
)
{
alert
(
'
没有文件等待导入
'
)
return
}
let
name
=
files
[
0
].
name
let
suffixArr
=
name
.
split
(
'
.
'
),
suffix
=
suffixArr
[
suffixArr
.
length
-
1
]
if
(
suffix
!=
'
xlsx
'
)
{
alert
(
'
当前仅支持导入xlsx文件
'
)
return
}
LuckyExcel
.
transformExcelToLucky
(
files
[
0
],
function
(
exportJson
,
luckysheetfile
)
{
uploadExcel1
=
exportJson
;
if
(
exportJson
.
sheets
==
null
||
exportJson
.
sheets
.
length
==
0
)
{
alert
(
'
无法读取excel文件的内容,目前不支持xls文件!
'
)
return
}
//赋值
var
ss
=
exportJson
.
sheets
[
0
].
celldata
[
0
].
v
.
v
;
uploadExcel2
.
sheets
[
0
].
celldata
[
0
].
v
.
v
=
ss
;
exportJson
=
uploadExcel2
;
window
.
luckysheet
.
destroy
()
window
.
luckysheet
.
create
({
container
:
'
luckysheet
'
,
//luckysheet is the container id
title
:
exportJson
.
info
.
name
,
lang
:
'
zh
'
,
// 设定表格语言
showinfobar
:
false
,
data
:
exportJson
.
sheets
,
userInfo
:
exportJson
.
info
.
name
.
creator
})
}
)
},
uploadExcel2
(
evt
)
{
const
files
=
evt
.
target
.
files
if
(
files
==
null
||
files
.
length
==
0
)
{
alert
(
'
没有文件等待导入
'
)
return
}
let
name
=
files
[
0
].
name
let
suffixArr
=
name
.
split
(
'
.
'
),
suffix
=
suffixArr
[
suffixArr
.
length
-
1
]
if
(
suffix
!=
'
xlsx
'
)
{
alert
(
'
当前仅支持导入xlsx文件
'
)
return
}
LuckyExcel
.
transformExcelToLucky
(
files
[
0
],
function
(
exportJson
,
luckysheetfile
)
{
uploadExcel2
=
exportJson
;
/*var obj=$.parseJSON(ss);*/
if
(
exportJson
.
sheets
==
null
||
exportJson
.
sheets
.
length
==
0
)
{
alert
(
'
无法读取excel文件的内容,目前不支持xls文件!
'
)
return
}
window
.
luckysheet
.
destroy
()
window
.
luckysheet
.
create
({
container
:
'
luckysheet
'
,
//luckysheet is the container id
title
:
exportJson
.
info
.
name
,
lang
:
'
zh
'
,
// 设定表格语言
showinfobar
:
false
,
data
:
exportJson
.
sheets
,
userInfo
:
exportJson
.
info
.
name
.
creator
})
}
)
},
//查询模板
selectExcel
(
evt
)
{
const
value
=
this
.
selected
const
name
=
evt
.
target
.
options
[
evt
.
target
.
selectedIndex
].
innerText
if
(
value
==
''
)
{
return
}
this
.
isMaskShow
=
true
LuckyExcel
.
transformExcelToLuckyByUrl
(
value
,
name
,
(
exportJson
,
luckysheetfile
)
=>
{
if
(
exportJson
.
sheets
==
null
||
exportJson
.
sheets
.
length
==
0
)
{
alert
(
'
无法读取excel文件的内容,目前不支持xls文件!
'
)
return
}
this
.
isMaskShow
=
false
window
.
luckysheet
.
destroy
()
window
.
luckysheet
.
create
({
container
:
'
luckysheet
'
,
//luckysheet is the container id
title
:
exportJson
.
info
.
name
,
lang
:
'
zh
'
,
// 设定表格语言
showinfobar
:
false
,
data
:
exportJson
.
sheets
,
userInfo
:
exportJson
.
info
.
name
.
creator
})
}
)
},
//下载模板
downloadExcel
()
{
const
value
=
this
.
selected
if
(
value
.
length
==
0
)
{
alert
(
'
请选择一个模板!
'
)
return
}
var
elemIF
=
document
.
getElementById
(
'
Lucky-download-frame
'
)
if
(
elemIF
==
null
)
{
elemIF
=
document
.
createElement
(
'
iframe
'
)
elemIF
.
style
.
display
=
'
none
'
elemIF
.
id
=
'
Lucky-download-frame
'
document
.
body
.
appendChild
(
elemIF
)
}
elemIF
.
src
=
value
},
//导出
deriveExcel
()
{
exportExcel
(
window
.
luckysheet
.
getAllSheets
(),
'
导出
'
)
},
//保存
saveExcel
(){
var
luckysheetfile
=
window
.
luckysheet
.
getLuckysheetfile
();
var
s
=
JSON
.
stringify
(
luckysheetfile
);
// 发ajax请求,用以获取数据
// 发送 POST 请求
axios
({
method
:
'
post
'
,
url
:
process
.
env
.
VUE_APP_BASE_API
+
'
/system/supplies/save
'
,
headers
:{
Authorization
:
"
Bearer
"
+
getToken
(),
},
data
:
{
"
jsons
"
:
s
}
}).
then
(
response
=>
{
//返回数据
alert
(
response
.
data
);
});
},
//修改
editExcel
(){
var
luckysheetfile
=
window
.
luckysheet
.
getLuckysheetfile
();
var
s
=
JSON
.
stringify
(
luckysheetfile
);
// 发ajax请求,用以获取数据
// 发送 POST 请求
axios
({
method
:
'
post
'
,
url
:
process
.
env
.
VUE_APP_BASE_API
+
'
/system/supplies/edit
'
,
headers
:{
Authorization
:
"
Bearer
"
+
getToken
(),
},
data
:
{
"
jsons
"
:
s
}
}).
then
(
response
=>
{
//返回数据
alert
(
response
.
data
);
});
}
}
}
</
script
>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<
style
scoped
>
h3
{
margin
:
40px
0
0
;
}
ul
{
list-style-type
:
none
;
padding
:
0
;
}
li
{
display
:
inline-block
;
margin
:
0
10px
;
}
a
{
color
:
#42b983
;
}
</
style
>
ruoyi-ui/src/views/system/supplies/rule.vue
0 → 100644
View file @
6169394c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment