Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
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
mes-ui
Commits
7713359e
Commit
7713359e
authored
Jan 19, 2024
by
hiyonx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sap input提交
parent
887a43fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
13 deletions
+67
-13
index.vue
src/components/ElInputAll/index.vue
+49
-0
index.vue
src/components/ElInputMoney/index.vue
+0
-10
main.js
src/main.js
+5
-1
ruoyi.js
src/utils/ruoyi.js
+13
-2
No files found.
src/components/ElInputAll/index.vue
0 → 100644
View file @
7713359e
<
template
>
<div
class=
"el-input-all"
>
<el-input
v-if=
"item.dataType === 1"
v-model=
"value"
:placeholder=
"'请输入' + item.name"
clearable
:disabled=
"!!item.relationField"
/>
<el-input-number
v-if=
"item.dataType === 2"
v-model=
"value"
:placeholder=
"'请输入' + item.name"
clearable
:disabled=
"!!item.relationField"
/>
<el-input-money
v-if=
"item.dataType === 3"
v-model=
"value"
:placeholder=
"'请输入' + item.name"
clearable
:disabled=
"!!item.relationField"
/>
<el-date-picker
v-if=
"item.dataType === 4"
v-model=
"value"
:placeholder=
"'请选择' + item.name"
clearable
:disabled=
"!!item.relationField"
type=
"date"
/>
<el-time-picker
v-if=
"item.dataType === 5"
v-model=
"value"
:placeholder=
"'请选择' + item.name"
clearable
:disabled=
"!!item.relationField"
/>
<el-date-picker
v-if=
"item.dataType === 6"
v-model=
"value"
:placeholder=
"'请选择' + item.name"
clearable
:disabled=
"!!item.relationField"
type=
"datetime"
/>
<el-select
v-if=
"item.dataType === 7"
v-model=
"value"
:placeholder=
"'请选择' + item.name"
clearable
filterable
:disabled=
"!!item.relationField"
>
<el-option
v-for=
"option in item.dictDataList"
:key=
"option.id"
:value=
"option.value"
:label=
"option.name"
/>
</el-select>
</div>
</
template
>
<
script
>
export
default
{
name
:
'ElInputAll'
,
model
:
{
prop
:
'val'
,
event
:
'update'
,
},
props
:
{
val
:
{
type
:
[
Number
,
String
,
Date
,
Array
,
Object
]},
item
:
{
type
:
Object
,
required
:
true
},
},
computed
:
{
value
:
{
get
()
{
return
this
.
val
},
set
(
val
)
{
this
.
$emit
(
'update'
,
val
)
}
}
},
data
()
{
return
{}
},
methods
:
{},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/ElInputMoney/index.vue
View file @
7713359e
...
...
@@ -67,16 +67,6 @@ export default {
this
.
money
=
this
.
formatMoney
(
this
.
value
*
this
.
unit
);
}
},
/**
* 格式化金钱
*/
formatMoney
(
val
)
{
if
(
val
===
''
||
val
==
null
)
return
null
let
str
=
(
+
val
).
toFixed
(
2
);
let
intSum
=
str
.
substring
(
0
,
str
.
indexOf
(
"."
)).
replace
(
/
\B(?=(?:\d{3})
+$
)
/g
,
','
);
//取到整数部分
let
dot
=
str
.
substring
(
str
.
length
,
str
.
indexOf
(
"."
))
//取到小数部分搜索
return
'¥ '
+
intSum
+
dot
;
},
}
}
</
script
>
...
...
src/main.js
View file @
7713359e
...
...
@@ -18,7 +18,7 @@ import './assets/icons' // icon
import
'./permission'
// permission control
import
{
getDicts
}
from
"@/api/system/dict/data"
;
import
{
getConfigKey
}
from
"@/api/system/config"
;
import
{
parseTime
,
resetForm
,
addDateRange
,
selectDictLabel
,
selectDictLabels
,
handleTree
}
from
"@/utils/ruoyi"
;
import
{
parseTime
,
resetForm
,
addDateRange
,
selectDictLabel
,
selectDictLabels
,
handleTree
,
formatMoney
}
from
"@/utils/ruoyi"
;
import
PageTitle
from
'@/components/Page/PageTitle.vue'
...
...
@@ -31,6 +31,8 @@ import RightToolbar from "@/components/RightToolbar"
import
Editor
from
"@/components/Editor"
// 金钱输入框
import
ElInputMoney
from
"@/components/ElInputMoney"
// sap输入框
import
ElInputAll
from
"@/components/ElInputAll"
// 文件上传组件
import
FileUpload
from
"@/components/FileUpload"
// 图片上传组件
...
...
@@ -56,6 +58,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue
.
prototype
.
selectDictLabels
=
selectDictLabels
Vue
.
prototype
.
download
=
download
Vue
.
prototype
.
handleTree
=
handleTree
Vue
.
prototype
.
formatMoney
=
formatMoney
// 全局组件挂载
Vue
.
component
(
'PageWrapper'
,
PageWrapper
)
...
...
@@ -65,6 +68,7 @@ Vue.component('Pagination', Pagination)
Vue
.
component
(
'RightToolbar'
,
RightToolbar
)
Vue
.
component
(
'Editor'
,
Editor
)
Vue
.
component
(
'ElInputMoney'
,
ElInputMoney
)
Vue
.
component
(
'ElInputAll'
,
ElInputAll
)
Vue
.
component
(
'FileUpload'
,
FileUpload
)
Vue
.
component
(
'ImageUpload'
,
ImageUpload
)
Vue
.
component
(
'ImagePreview'
,
ImagePreview
)
...
...
src/utils/ruoyi.js
View file @
7713359e
...
...
@@ -68,7 +68,7 @@ export function addDateRange(params, dateRange, propName) {
return
search
;
}
// 回显数据字典
// 回显数据字典
export
function
selectDictLabel
(
datas
,
value
)
{
if
(
value
===
undefined
)
{
return
""
;
...
...
@@ -233,4 +233,15 @@ export async function blobValidate(data) {
}
catch
(
error
)
{
return
true
;
}
}
\ No newline at end of file
}
/**
* 格式化金钱
*/
export
function
formatMoney
(
val
,
prefix
=
'¥ '
)
{
if
(
val
===
''
||
val
==
null
)
return
null
let
str
=
Number
(
val
).
toFixed
(
2
);
let
intSum
=
str
.
substring
(
0
,
str
.
indexOf
(
"."
)).
replace
(
/
\B(?=(?:\d{3})
+$
)
/g
,
','
);
//取到整数部分
let
dot
=
str
.
substring
(
str
.
length
,
str
.
indexOf
(
"."
))
//取到小数部分搜索
return
prefix
+
intSum
+
dot
;
}
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