Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
5ce7025c
Commit
5ce7025c
authored
May 14, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok
parent
3b288b5f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
56 deletions
+69
-56
files.vue
components/page/files.vue
+2
-1
inputFile.vue
components/page/inputFile.vue
+62
-52
add.vue
pages/technology/details/routingqccard/add.vue
+2
-1
index.vue
pages/technology/details/routingqccard/index.vue
+1
-0
iview.js
plugins/iview.js
+2
-2
No files found.
components/page/files.vue
View file @
5ce7025c
...
...
@@ -36,6 +36,7 @@
</div>
</
template
>
<
script
>
import
util
from
'@/libs/util'
;
export
default
{
name
:
"files"
,
model
:
{
...
...
@@ -185,7 +186,7 @@ export default {
this
.
postUrl
=
fileUrl
+
"/upload/?token=Bearer "
+
window
.
sessionStorage
.
getItem
(
"token"
)
+
util
.
cookies
.
get
(
'token'
)
+
"&"
+
this
.
convertObj
(
this
.
parms
);
//是否显示上传按钮
...
...
components/page/inputFile.vue
View file @
5ce7025c
<!--一次只能上传一个文件 -->
<
template
>
<div>
<Input
v-model=
"newName"
style=
"height:30px;width:240px;float:left"
placeholder=
"请选择上传文件"
disabled
/>
<Input
v-model=
"newName"
placeholder=
"请选择上传文件"
>
<Button
v-if=
"view"
icon=
"ios-eye"
slot=
"prepend"
>
</Button>
<Button
type=
"primary"
icon=
"ios-cloud-upload-outline"
slot=
"append"
@
click=
"handler"
>
上传
</Button>
</Input>
<Upload
v-model=
"name"
:action=
"postUrl"
...
...
@@ -16,36 +19,37 @@
:files=
"files"
:on-progress=
"onProgress"
>
<Button
icon=
"ios-cloud-upload-outline"
>
上传文件
</Button>
<Button
v-show=
"1==2"
type=
"primary"
ref=
"upload"
>
上传
</Button>
</Upload>
<Progress
:percent=
"per"
:stroke-width=
"5"
v-show=
"vshowPro"
/>
<Progress
:percent=
"per"
:stroke-width=
"5"
v-show=
"vshowPro"
/>
</div>
</
template
>
<
script
>
import
util
from
"@/libs/util"
;
export
default
{
name
:
'inputFile'
,
name
:
"inputFile"
,
model
:
{
prop
:
'value'
,
event
:
'on-change'
prop
:
"value"
,
event
:
"on-change"
},
data
()
{
return
{
file
:
null
,
name
:
this
.
value
,
downUrl
:
fileUrlDown
,
fileUrlPath
:
''
,
fileUrlPath
:
""
,
nameList
:
[],
postUrl
:
fileUrl
+
'/upload/?token=Bearer '
+
window
.
sessionStorage
.
getItem
(
'token'
)
+
'&'
+
"/upload/?token=Bearer "
+
util
.
cookies
.
get
(
"token"
)
+
"&"
+
this
.
parms
,
formatList
:
[
'png'
,
'jpg'
,
'gif'
],
newName
:
''
,
formatList
:
[
"png"
,
"jpg"
,
"gif"
],
newName
:
""
,
per
:
0
,
vshowPro
:
false
}
}
;
},
created
()
{},
props
:
{
...
...
@@ -60,55 +64,58 @@ export default {
},
parms
:
{
type
:
String
,
default
:
''
default
:
""
}
},
methods
:
{
onProgress
(
event
,
file
,
fileList
)
{
this
.
per
=
0
this
.
vshowPro
=
true
this
.
per
=
0
;
this
.
vshowPro
=
true
;
},
handler
()
{
this
.
$refs
.
upload
.
$el
.
click
();
},
// change(event) {
// this.$emit('on-change', event.target.value)
// },
//上传成功文件
uploadSuccess
(
response
,
file
,
fileList
)
{
this
.
per
=
60
this
.
vshowPro
=
true
const
hbaseFileList
=
[]
const
filesList
=
[]
this
.
per
=
60
;
this
.
vshowPro
=
true
;
const
hbaseFileList
=
[]
;
const
filesList
=
[]
;
if
(
file
.
response
.
status
==
0
)
{
let
objImag
=
{}
objImag
.
fileName
=
file
.
response
.
data
.
fileName
objImag
.
filePath
=
file
.
response
.
data
.
downloadPath
filesList
.
push
(
objImag
)
this
.
newName
=
file
.
response
.
data
.
fileName
this
.
$emit
(
'on-change'
,
JSON
.
stringify
(
filesList
))
this
.
per
=
100
let
objImag
=
{}
;
objImag
.
fileName
=
file
.
response
.
data
.
fileName
;
objImag
.
filePath
=
file
.
response
.
data
.
downloadPath
;
filesList
.
push
(
objImag
)
;
this
.
newName
=
file
.
response
.
data
.
downloadPath
;
this
.
$emit
(
"on-change"
,
JSON
.
stringify
(
filesList
));
this
.
per
=
100
;
setTimeout
(()
=>
{
this
.
per
=
0
this
.
vshowPro
=
false
},
2000
)
this
.
per
=
0
;
this
.
vshowPro
=
false
;
},
2000
)
;
}
else
{
this
.
$Message
.
error
(
'上传失败,请重新上传!'
)
this
.
$Message
.
error
(
"上传失败,请重新上传!"
);
}
},
//上传文件失败
uploadError
(
response
,
file
,
fileList
)
{
this
.
$Message
.
error
(
'上传失败,请重新上传!'
)
this
.
$Message
.
error
(
"上传失败,请重新上传!"
);
},
//文件大小验证返回
onExceededSize
(
file
,
fileList
)
{
if
(
Object
.
keys
(
file
).
length
==
0
)
{
this
.
$Message
.
error
(
'上传文件不能大于'
+
this
.
maxSize
+
'k,请重新上传!'
)
"上传文件不能大于"
+
this
.
maxSize
+
"k,请重新上传!"
)
;
}
},
//文件格式验证
onFormatError
(
file
,
fileList
)
{
if
(
Object
.
keys
(
file
).
length
==
0
)
{
this
.
$Message
.
error
(
'上传文件格式不正确,请重新上传!'
)
this
.
$Message
.
error
(
"上传文件格式不正确,请重新上传!"
);
}
},
//删除上传
...
...
@@ -116,36 +123,39 @@ export default {
formatL
()
{
if
(
this
.
files
)
{
this
.
formatList
=
[
'pdf'
,
'docx'
,
'doc'
,
'xls'
,
'xlsx'
,
'txt'
,
'png'
,
'jpg'
,
'gif'
,
'zip'
,
'rar'
]
"pdf"
,
"docx"
,
"doc"
,
"xls"
,
"xlsx"
,
"txt"
,
"png"
,
"jpg"
,
"gif"
,
"zip"
,
"rar"
]
;
}
return
this
.
formatList
return
this
.
formatList
;
}
},
mounted
()
{
this
.
formatL
()
this
.
formatL
()
;
},
computed
:
{
nativeInputValue
()
{
return
this
.
value
===
null
||
this
.
value
===
undefined
?
''
:
this
.
value
return
this
.
value
===
null
||
this
.
value
===
undefined
?
""
:
this
.
value
;
},
view
(){
return
true
}
},
watch
:
{
value
(
v
)
{
this
.
name
=
v
this
.
name
=
v
;
}
}
}
}
;
</
script
>
<
style
lang=
"less"
>
</
style
>
\ No newline at end of file
pages/technology/details/routingqccard/add.vue
View file @
5ce7025c
...
...
@@ -112,7 +112,8 @@
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('qualityTemplateName')"
prop=
"qualityTemplateName"
>
<files
ref=
"refFile"
:parms=
"parms"
files
singleFile
/>
<!--
<files
ref=
"refFile"
:parms=
"parms"
files
singleFile
/>
-->
<InputFile
v-model=
"entity.qualityTemplateName"
/>
</FormItem>
</Col>
<!--
...
...
pages/technology/details/routingqccard/index.vue
View file @
5ce7025c
...
...
@@ -7,6 +7,7 @@
<Input
placeholder=
"请输入检测要求/标准指标"
v-model=
"easySearch.keys.value"
v-width=
"200"
/>
</FormItem>
<FormItem>
...
...
plugins/iview.js
View file @
5ce7025c
...
...
@@ -32,7 +32,7 @@ import clipboard from 'clipboard';
import
radioButton
from
'@/components/page/radioButton.vue'
import
InputIcon
from
'@/components/page/inputIcon.vue'
import
checkBoxButton
from
'@/components/page/checkBoxButton.vue'
import
i
nputFile
from
'@/components/page/inputFile.vue'
import
I
nputFile
from
'@/components/page/inputFile.vue'
import
imgUploadFile
from
'@/components/page/imgUploadFile.vue'
import
files
from
'@/components/page/files.vue'
import
FilesList
from
'@/components/page/filesList.vue'
...
...
@@ -74,7 +74,7 @@ Vue.component("State", State)
Vue
.
component
(
"Dictionary"
,
Dictionary
)
Vue
.
component
(
"radioButton"
,
radioButton
)
Vue
.
component
(
"checkBoxButton"
,
checkBoxButton
)
Vue
.
component
(
"
inputFile"
,
i
nputFile
)
Vue
.
component
(
"
InputFile"
,
I
nputFile
)
Vue
.
component
(
"imgUploadFile"
,
imgUploadFile
)
Vue
.
component
(
"InputIcon"
,
InputIcon
)
Vue
.
component
(
"files"
,
files
)
...
...
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