Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zghywpc-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
zghywpc-vue
Commits
a8ddbc49
Commit
a8ddbc49
authored
Oct 22, 2024
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
录入调整。定制修改密码。样式属性调整
parent
cecda52d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
343 additions
and
274 deletions
+343
-274
Navbar.vue
src/layout/components/Navbar.vue
+254
-217
edit.vue
src/views/jyfkgl/ywsjlr/edit.vue
+34
-17
index.vue
src/views/jyfkgl/ywsjlr/index.vue
+1
-1
edit.vue
src/views/sbjxgl/sbjxxx/edit.vue
+54
-39
No files found.
src/layout/components/Navbar.vue
View file @
a8ddbc49
This diff is collapsed.
Click to expand it.
src/views/jyfkgl/ywsjlr/edit.vue
View file @
a8ddbc49
<
template
>
<
template
>
<RelDialog
@
getForm=
'getForm'
width=
"50%"
:type=
'type'
:editApp=
'editApp'
:app=
'app'
:buttonApp=
'buttonApp'
>
<RelDialog
:changeAddParams=
'changeAddParams'
:changeEditParams=
'changeEditParams'
@
getForm=
'getForm'
width=
"50%"
:type=
'type'
:editApp=
'editApp'
:app=
'app'
:buttonApp=
'buttonApp'
>
<el-form
slot=
"form"
ref=
"form"
:model=
"form"
label-width=
"120px"
:rules=
"rules"
>
<el-form
slot=
"form"
ref=
"form"
:model=
"form"
label-width=
"120px"
:rules=
"rules"
>
<el-row
:gutter=
"20"
:app=
"this"
>
<el-row
:gutter=
"20"
:app=
"this"
>
<EditColItem
:required=
"item.required||false"
:readonly=
"item.readonly?true:false "
<EditColItem
:required=
"item.required||false"
:readonly=
"item.readonly?true:false "
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<el-form-item
label=
"异物图片"
>
<el-form-item
label=
"异物图片"
>
<el-upload
ref=
"upload"
:headers=
'
{
<el-upload
ref=
"upload"
:headers=
'
{
Gtoken
Gtoken
}' :action="`${baseurl}/
ywxxgl/uywsjlr/attachment/upload
`" list-type="picture-card"
}' :action="`${baseurl}/
attachment/upload/tmp
`" list-type="picture-card"
:on-preview="handlePictureCardPreview" :on-success='success' :on-remove="handleRemove" :data="{
:on-preview="handlePictureCardPreview" :on-success='success' :on-remove="handleRemove" :data="{
groupid:'',
groupid:'',
folder:'uywsjlr'
folder:'uywsjlr'
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
mixins
:
[
editMixin
],
mixins
:
[
editMixin
],
data
()
{
data
()
{
return
{
return
{
attachmentList
:[],
showList
:[],
showList
:[],
baseurl
:
baseurl
,
baseurl
:
baseurl
,
Gtoken
:
Gtoken
,
Gtoken
:
Gtoken
,
...
@@ -131,15 +132,40 @@
...
@@ -131,15 +132,40 @@
}
}
},
},
methods
:
{
methods
:
{
changeEditParams
(
params
){
let
attachments
=
[]
this
.
attachmentList
.
forEach
(
item
=>
{
attachments
.
push
({
id
:
item
})
})
this
.
showList
.
forEach
(
item
=>
{
attachments
.
push
({
id
:
item
.
id
})
})
params
.
attachments
=
attachments
},
changeAddParams
(
params
){
let
attachments
=
[]
this
.
attachmentList
.
forEach
(
item
=>
{
attachments
.
push
({
id
:
item
})
})
params
.
attachments
=
attachments
},
handleRemove
(
file
,
fileList
)
{
handleRemove
(
file
,
fileList
)
{
let
attachmentList
=
[]
let
attachmentList
=
[]
fileList
.
forEach
(
item
=>
{
fileList
.
forEach
(
item
=>
{
if
(
item
.
status
==
'success'
)
{
if
(
item
.
status
==
'success'
)
{
attachmentList
.
push
(
item
.
response
.
data
.
id
)
attachmentList
.
push
(
item
.
response
.
data
.
records
.
id
)
}
}
})
})
this
.
form
.
attachmentList
=
attachmentList
this
.
attachmentList
=
attachmentList
console
.
log
(
this
.
form
.
attachmentList
)
console
.
log
(
this
.
attachmentList
)
},
},
handlePictureCardPreview
(
file
)
{
handlePictureCardPreview
(
file
)
{
...
@@ -153,11 +179,11 @@
...
@@ -153,11 +179,11 @@
let
attachmentList
=
[]
let
attachmentList
=
[]
fileList
.
forEach
(
item
=>
{
fileList
.
forEach
(
item
=>
{
if
(
item
.
status
==
'success'
)
{
if
(
item
.
status
==
'success'
)
{
attachmentList
.
push
(
item
.
response
.
data
.
id
)
attachmentList
.
push
(
item
.
response
.
data
.
records
.
id
)
}
}
})
})
this
.
form
.
attachmentList
=
attachmentList
this
.
attachmentList
=
attachmentList
}
else
{
}
else
{
const
delIndex
=
fileList
.
findIndex
(
item
=>
item
.
uid
===
file
.
uid
);
const
delIndex
=
fileList
.
findIndex
(
item
=>
item
.
uid
===
file
.
uid
);
...
@@ -173,16 +199,7 @@
...
@@ -173,16 +199,7 @@
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
$post
(
'ywxxgl/uywsjlr/attachment/delete'
,
{
this
.
showList
.
splice
(
index
,
1
)
id
:
[
id
]
}).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
showList
.
splice
(
index
,
1
)
this
.
$success
(
'操作成功'
)
}
})
})
})
},
},
...
...
src/views/jyfkgl/ywsjlr/index.vue
View file @
a8ddbc49
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</
template
>
</
template
>
<
template
#
toolbar=
"ctx"
>
<
template
#
toolbar=
"ctx"
>
<
AttachFileShow
:app=
'ctx.basePage'
></AttachFileShow
>
<
!--
<AttachFileShow
:app=
'ctx.basePage'
></AttachFileShow>
--
>
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!--
<el-button
@
click=
"demo(ctx.basePage)"
size=
'mini'
type=
"primary"
>
示例按钮
</el-button>
-->
<!--
<el-button
@
click=
"demo(ctx.basePage)"
size=
'mini'
type=
"primary"
>
示例按钮
</el-button>
-->
</
template
>
</
template
>
...
...
src/views/sbjxgl/sbjxxx/edit.vue
View file @
a8ddbc49
...
@@ -54,14 +54,12 @@
...
@@ -54,14 +54,12 @@
}'
:data=
"{
}'
:data=
"{
groupid:'',
groupid:'',
folder:'usbjx'
folder:'usbjx'
}"
class=
"upload-demo"
:action=
"`${baseurl}/
jxgl/usbjx/attachment/upload
`"
}"
class=
"upload-demo"
:action=
"`${baseurl}/
attachment/upload/tmp
`"
:on-success=
'success'
:on-remove=
"handleRemove"
:file-list=
"fileList"
>
:on-success=
'success'
:on-remove=
"handleRemove"
:file-list=
"fileList"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
</el-upload>
</el-upload>
</div>
</div>
</div>
</div>
<div
v-if=
"type!='add'"
>
<div
v-if=
"type!='add'"
>
<span
style=
"line-height: 40px;font-size: 12px;font-weight: 700;color: #666;"
>
附件列表
</span>
<span
style=
"line-height: 40px;font-size: 12px;font-weight: 700;color: #666;"
>
附件列表
</span>
<div
class=
"download padding-10"
>
<div
class=
"download padding-10"
>
...
@@ -93,7 +91,7 @@
...
@@ -93,7 +91,7 @@
{{item.name}}
{{item.name}}
</div>
</div>
<div
class=
"size"
>
<div
class=
"size"
>
{{
item.size
}}
{{
sizeFormatter(item.size)
}}
</div>
</div>
<div
class=
"down"
>
<div
class=
"down"
>
<el-button
@
click=
"download(item)"
size=
"mini"
type=
"success"
>
下载文件
</el-button>
<el-button
@
click=
"download(item)"
size=
"mini"
type=
"success"
>
下载文件
</el-button>
...
@@ -164,21 +162,11 @@
...
@@ -164,21 +162,11 @@
},
},
data
()
{
data
()
{
return
{
return
{
form
:
{
attachmentList
:[],
attachmentList
:
[]
},
Gtoken
:
Gtoken
,
Gtoken
:
Gtoken
,
baseurl
:
baseurl
,
baseurl
:
baseurl
,
fileList
:
[],
fileList
:
[],
downList
:
[{
downList
:
[
name
:
'测试1'
,
size
:
'200kb'
,
},
{
name
:
'测试2'
,
size
:
'2030kb'
,
}
],
],
showDialog
:
false
,
showDialog
:
false
,
DialogWidth
:
'40vw'
,
DialogWidth
:
'40vw'
,
...
@@ -323,6 +311,14 @@
...
@@ -323,6 +311,14 @@
}
}
},
},
methods
:
{
methods
:
{
sizeFormatter
(
bytes
){
if
(
bytes
===
0
)
return
'0 B'
;
var
k
=
1000
,
// or 1024
sizes
=
[
'B'
,
'KB'
,
'MB'
,
'GB'
,
'TB'
,
'PB'
,
'EB'
,
'ZB'
,
'YB'
],
i
=
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
k
));
return
(
bytes
/
Math
.
pow
(
k
,
i
)).
toPrecision
(
3
)
+
' '
+
sizes
[
i
];
},
download
(
item
){
download
(
item
){
let
url
=
`jxgl/usbjx/attachment/download/
${
item
.
id
}
`
let
url
=
`jxgl/usbjx/attachment/download/
${
item
.
id
}
`
this
.
$cDownload
(
url
,
{},
item
.
name
)
this
.
$cDownload
(
url
,
{},
item
.
name
)
...
@@ -333,24 +329,17 @@
...
@@ -333,24 +329,17 @@
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
$post
(
'jxgl/usbjx/attachment/delete'
,
{
this
.
downList
.
splice
(
index
,
1
)
id
:
[
id
]
}).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
downList
.
splice
(
index
,
1
)
this
.
$success
(
'操作成功'
)
}
})
})
})
},
},
handleRemove
(
file
,
fileList
)
{
handleRemove
(
file
,
fileList
)
{
let
attachmentList
=
[]
let
attachmentList
=
[]
fileList
.
forEach
(
item
=>
{
fileList
.
forEach
(
item
=>
{
if
(
item
.
status
==
'success'
)
{
if
(
item
.
status
==
'success'
)
{
attachmentList
.
push
(
item
.
response
.
data
.
id
)
attachmentList
.
push
(
item
.
response
.
data
.
records
.
id
)
}
}
})
})
this
.
form
.
attachmentList
=
attachmentList
this
.
attachmentList
=
attachmentList
},
},
success
(
res
,
file
,
fileList
)
{
success
(
res
,
file
,
fileList
)
{
...
@@ -362,10 +351,10 @@
...
@@ -362,10 +351,10 @@
let
attachmentList
=
[]
let
attachmentList
=
[]
fileList
.
forEach
(
item
=>
{
fileList
.
forEach
(
item
=>
{
if
(
item
.
status
==
'success'
)
{
if
(
item
.
status
==
'success'
)
{
attachmentList
.
push
(
item
.
response
.
data
.
id
)
attachmentList
.
push
(
item
.
response
.
data
.
records
.
id
)
}
}
})
})
this
.
form
.
attachmentList
=
attachmentList
this
.
attachmentList
=
attachmentList
}
else
{
}
else
{
const
delIndex
=
fileList
.
findIndex
(
item
=>
item
.
uid
===
file
.
uid
);
const
delIndex
=
fileList
.
findIndex
(
item
=>
item
.
uid
===
file
.
uid
);
if
(
delIndex
!==
-
1
)
{
if
(
delIndex
!==
-
1
)
{
...
@@ -380,18 +369,19 @@
...
@@ -380,18 +369,19 @@
groupid
:
form
.
id
,
groupid
:
form
.
id
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
res
.
data
.
records
.
forEach
(
item
=>
{
res
.
data
.
records
.
forEach
(
item
=>
{
autoAttachDownload
({},
'jxgl/usbjx'
,
item
.
id
).
then
(
res
=>
{
this
.
downList
.
push
(
item
)
let
blob
=
new
Blob
([
res
],
{
// autoAttachDownload({}, 'jxgl/usbjx', item.id).then(res => {
type
:
'application/'
+
item
.
type
+
';charset=UTF-8'
,
// let blob = new Blob([res], {
});
// type: 'application/' + item.type + ';charset=UTF-8',
let
url
=
URL
.
createObjectURL
(
blob
)
// });
let
uitem
=
{
// let url = URL.createObjectURL(blob)
url
,
// let uitem = {
id
:
item
.
id
// url,
}
// id: item.id
this
.
downList
.
push
(
uitem
)
// }
// this.downList.push(uitem)
})
//
})
...
@@ -427,7 +417,14 @@
...
@@ -427,7 +417,14 @@
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
this
.
type
==
'add'
)
{
if
(
this
.
type
==
'add'
)
{
let
attachments
=
[]
this
.
attachmentList
.
forEach
(
item
=>
{
attachments
.
push
({
id
:
item
})
})
let
params
=
{
let
params
=
{
attachments
,
details
:
[{
details
:
[{
id
:
'U_JXGJ'
,
id
:
'U_JXGJ'
,
records
:
[...
this
.
editTableData1
]
||
[]
records
:
[...
this
.
editTableData1
]
||
[]
...
@@ -448,6 +445,7 @@
...
@@ -448,6 +445,7 @@
this
.
$success
(
'添加成功'
)
this
.
$success
(
'添加成功'
)
this
.
$refs
.
reldialog
.
closeAll
()
this
.
$refs
.
reldialog
.
closeAll
()
let
newData
=
this
.
form
let
newData
=
this
.
form
newData
.
id
=
res
.
data
.
id
this
.
app
.
$refs
.
TablePager
.
tableData
.
unshift
(
newData
)
this
.
app
.
$refs
.
TablePager
.
tableData
.
unshift
(
newData
)
/* 总数据++ */
/* 总数据++ */
this
.
app
.
$refs
.
TablePager
.
total
+=
1
this
.
app
.
$refs
.
TablePager
.
total
+=
1
...
@@ -458,8 +456,25 @@
...
@@ -458,8 +456,25 @@
}
}
})
})
}
else
if
(
this
.
type
==
'edit'
){
}
else
if
(
this
.
type
==
'edit'
){
/* 修改的时候先拿去加载的文件list
和上传的list 混合然后上传
*/
let
attachments
=
[]
this
.
attachmentList
.
forEach
(
item
=>
{
attachments
.
push
({
id
:
item
})
})
this
.
downList
.
forEach
(
item
=>
{
attachments
.
push
({
id
:
item
})
})
let
params
=
{
let
params
=
{
attachments
,
details
:
[{
details
:
[{
id
:
'U_JXGJ'
,
id
:
'U_JXGJ'
,
records
:
[...
this
.
editTableData1
]
||
[]
records
:
[...
this
.
editTableData1
]
||
[]
...
...
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