Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
Overview
Overview
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
zhouqian
vue-gjjs
Commits
e2fc8ee0
Commit
e2fc8ee0
authored
Jan 10, 2022
by
liuxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://192.168.0.110:11080/fukai/vue-gjjs
parents
e502cfd5
a183bef4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
157 additions
and
116 deletions
+157
-116
common.css
src/assets/css/common.css
+4
-0
IStreamTable.vue
src/components/IStreamTable.vue
+133
-41
Menu.vue
src/views/Business/Sptsel/Menu.vue
+20
-75
No files found.
src/assets/css/common.css
View file @
e2fc8ee0
...
...
@@ -287,3 +287,6 @@
line-height
:
16px
;
font-size
:
12px
;
}
.el-table--border
td
.lastColumn
{
border-right
:
0
!important
;
}
\ No newline at end of file
src/components/IStreamTable.vue
View file @
e2fc8ee0
...
...
@@ -29,7 +29,46 @@
>
</el-table-column>
<slot></slot>
<el-table-column
fixed=
"right"
width=
"48px"
v-if=
"showButtonFlg"
class-name=
"buttonColumn"
>
<template
slot=
"header"
>
<c-col
style=
"text-align: left"
><c-button
icon=
"el-icon-s-tools"
@
click=
"clounmSetting"
style=
"padding:0 7px"
></c-button
></c-col>
</
template
>
</el-table-column>
</el-table>
<el-dialog
class=
"showColumnDialog"
:visible
.
sync=
"setColumnFlg"
:title=
"'自定义列属性'"
appenD-to-body
>
<el-form-item
label-width=
"0"
>
<el-checkbox-group
v-model=
"columnGroup"
@
change=
"handleColumnChange"
>
<el-checkbox
class=
"selectColumnClass"
v-for=
"item in tableColumnsOrigin"
:key=
"item.label"
:label=
"parseInt(item.index)"
>
{{ item.label }}
</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<span
slot=
"footer"
>
<el-checkbox
class=
"selectAllClass"
:indeterminate=
"columnGroup.length > 0 && columnGroup.length < tableColumnsOrigin.length"
v-model=
"selectAll"
@
change=
"setAll"
>
全选
</el-checkbox
>
<el-button
type=
"primary"
@
click=
"saveColumnEvent"
>
保存
</el-button>
</span>
</el-dialog>
<c-col
:span=
"16"
>
<el-pagination
v-if=
"paginationShow"
...
...
@@ -80,49 +119,18 @@ export default {
required
:
false
,
default
:
true
,
},
},
computed
:
{
tableColumns
()
{
const
columnArr
=
[];
const
lines
=
this
.
columns
;
const
etyReg
=
/
\"([^\"]
*
)\"
/
;
const
obj
=
{};
for
(
let
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
const
line
=
lines
[
i
];
if
(
etyReg
.
test
(
line
))
{
const
gs
=
line
.
match
(
etyReg
);
const
columnName
=
gs
[
1
];
const
newLine
=
line
.
replace
(
gs
[
0
],
"_"
);
const
colPropArr
=
newLine
.
split
(
" "
);
const
positionArr
=
colPropArr
[
1
].
split
(
":"
);
if
(
!
obj
[
positionArr
[
0
]])
{
obj
[
positionArr
[
0
]]
=
[];
}
obj
[
positionArr
[
0
]].
push
({
idx
:
colPropArr
[
0
],
prop
:
columnName
,
width
:
colPropArr
[
3
]
+
'px'
,
});
}
}
for
(
const
k
in
obj
)
{
if
(
Object
.
hasOwnProperty
.
call
(
obj
,
k
))
{
const
o
=
obj
[
k
];
const
tableColumn
=
o
.
map
((
item
)
=>
item
.
prop
).
join
(
"
\
n"
);
columnArr
.
push
({
prop
:
tableColumn
,
label
:
tableColumn
,
width
:
o
[
0
].
width
,
// width: "auto",
index
:
k
,
children
:
o
,
});
showButtonFlg
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
}
},
watch
:
{
columns
()
{
this
.
generateColumns
();
}
return
columnArr
.
sort
((
a
,
b
)
=>
{
return
parseInt
(
a
.
index
)
-
parseInt
(
b
.
index
);
});
},
computed
:
{
tableData
()
{
// return this.list.map((row) => {
// const res = {}
...
...
@@ -156,12 +164,65 @@ export default {
},
data
()
{
return
{
tableColumnsOrigin
:
[],
tableColumns
:
[],
currentPage
:
1
,
pageSizes
:
[
5
,
10
,
20
,
30
,
40
,
50
,
100
],
pageSize
:
10
,
selectAll
:
true
,
columnGroup
:
[],
setColumnFlg
:
false
};
},
mounted
()
{
this
.
generateColumns
();
},
methods
:
{
generateColumns
()
{
const
columnArr
=
[];
const
lines
=
this
.
columns
;
const
etyReg
=
/
\"([^\"]
*
)\"
/
;
const
obj
=
{};
for
(
let
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
const
line
=
lines
[
i
];
if
(
etyReg
.
test
(
line
))
{
const
gs
=
line
.
match
(
etyReg
);
const
columnName
=
gs
[
1
];
const
newLine
=
line
.
replace
(
gs
[
0
],
"_"
);
const
colPropArr
=
newLine
.
split
(
" "
);
const
positionArr
=
colPropArr
[
1
].
split
(
":"
);
if
(
!
obj
[
positionArr
[
0
]])
{
obj
[
positionArr
[
0
]]
=
[];
}
obj
[
positionArr
[
0
]].
push
({
idx
:
colPropArr
[
0
],
prop
:
columnName
,
width
:
colPropArr
[
3
]
+
'px'
,
});
}
}
for
(
const
k
in
obj
)
{
if
(
Object
.
hasOwnProperty
.
call
(
obj
,
k
))
{
const
o
=
obj
[
k
];
const
tableColumn
=
o
.
map
((
item
)
=>
item
.
prop
).
join
(
"
\
n"
);
columnArr
.
push
({
prop
:
tableColumn
,
label
:
tableColumn
,
width
:
o
[
0
].
width
,
// width: "auto",
index
:
k
,
children
:
o
,
});
}
}
const
arr
=
columnArr
.
sort
((
a
,
b
)
=>
{
return
parseInt
(
a
.
index
)
-
parseInt
(
b
.
index
);
});
this
.
tableColumnsOrigin
=
arr
;
this
.
tableColumns
=
arr
;
this
.
columnGroup
=
arr
.
map
((
item
)
=>
parseInt
(
item
.
index
));
return
arr
;
},
sizeChange
(
size
)
{
this
.
pageSize
=
size
;
},
...
...
@@ -192,7 +253,25 @@ export default {
this
.
$refs
.
table
.
setCurrentRow
(
row
);
this
.
$emit
(
"chooseRowEvent"
,
row
);
},
clounmSetting
()
{
this
.
setColumnFlg
=
true
;
},
saveColumnEvent
()
{
this
.
setColumnFlg
=
false
;
const
arr
=
this
.
columnGroup
.
map
(
idx
=>
parseInt
(
idx
));
arr
.
sort
((
a
,
b
)
=>
a
-
b
);
this
.
columnGroup
=
arr
;
this
.
tableColumns
=
this
.
columnGroup
.
map
(
(
index
)
=>
this
.
tableColumnsOrigin
[
parseInt
(
index
)
-
1
]
);
},
setAll
(
val
)
{
this
.
columnGroup
=
val
?
this
.
tableColumnsOrigin
.
map
((
item
)
=>
parseInt
(
item
.
index
))
:
[];
},
handleColumnChange
()
{
this
.
selectAll
=
this
.
tableColumnsOrigin
.
length
===
this
.
columnGroup
.
length
;
},
}
};
</
script
>
...
...
@@ -217,8 +296,20 @@ export default {
.el-table
.success-row
{
background
:
#f0f9eb
;
}
.selectColumnClass
.el-checkbox__label
{
width
:
60px
;
font-size
:
13px
;
}
.selectAllClass
.el-checkbox__label
{
width
:
30px
;
font-size
:
13px
;
padding-left
:
5px
;
}
.eContainer-table-block
.el-table
.cell
{
white-space
:
pre-wrap
;
}
.el-table.buttonColumn
th
>
.cell
{
padding-left
:
0
;
padding-right
:
0
;
}
</
style
>
\ No newline at end of file
src/views/Business/Sptsel/Menu.vue
View file @
e2fc8ee0
...
...
@@ -295,19 +295,20 @@
<c-col
:span=
"24"
>
<c-istream-table
:list=
"stmData.data"
:columns=
"saveColumnFlg ? stmData.columns : saveColumns"
:columns=
"stmData.columns"
:showButtonFlg=
"true"
>
<el-table-column
fixed=
"right"
prop=
"op"
label=
"操作"
width=
"165px"
>
<el-table-column
fixed=
"right"
prop=
"op"
label=
"操作"
width=
"165px"
class-name=
"lastColumn"
>
<
template
slot=
"header"
>
<c-col
:span=
"11"
style=
"text-align: left"
<c-col
style=
"text-align: left"
><span>
操作
</span></c-col
>
<
c-col
:span=
"12"
style=
"text-align: right"
<
!--
<c-col
style=
"text-align: right"
><c-button
icon=
"el-icon-s-tools"
@
click=
"clounmSetting"
></c-button
></c-col>
></c-col>
-->
</
template
>
<
template
slot-scope=
"scope"
>
<c-button
style=
"margin-left: 0"
size=
"small"
@
click=
"onDetails"
...
...
@@ -338,33 +339,7 @@
</c-col>
</el-row>
<el-dialog
class=
"showColumnDialog"
:visible
.
sync=
"setColumnFlg"
:title=
"'自定义列属性'"
appenD-to-body
>
<el-form-item
label-width=
"0"
>
<el-checkbox-group
v-model=
"columnGroup"
@
change=
"handleColumnChange"
>
<el-checkbox
v-for=
"item in setColumn"
:key=
"item.label"
:label=
"item.index"
>
{{ item.label }}
</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<span
slot=
"footer"
>
<el-checkbox
class=
"cbClass"
:indeterminate=
"isIndeterminate"
v-model=
"selectAll"
@
change=
"setAll"
>
全选
</el-checkbox
>
<el-button
type=
"primary"
@
click=
"saveColumnEvent"
>
保存
</el-button>
</span>
</el-dialog>
<!-- <el-row style="margin-top: 2rem">
<c-col :span="23">
<el-card class="box-card">
...
...
@@ -440,15 +415,14 @@ export default {
mixins
:
[
CommonProcess
],
data
()
{
return
{
saveColumns
:
[],
//
saveColumns: [],
sourceModel
:
[],
sourceData
:
[],
initdialog
:
false
,
detailDialog
:
false
,
setColumnFlg
:
false
,
saveColumnFlg
:
true
,
selectAll
:
true
,
isIndeterminate
:
false
,
// setColumnFlg: false,
// saveColumnFlg: true,
transactionStatus
:
{
busiNo
:
""
,
modTimes
:
0
,
...
...
@@ -457,8 +431,7 @@ export default {
earnCount
:
0
,
earnAmt
:
0
,
},
setColumn
:
[],
columnGroup
:
[],
// setColumn: [],
stmData
:
{
columns
:
[
'4 1 "交易代码" 70 '
,
...
...
@@ -512,49 +485,21 @@ export default {
this
.
model
[
element
]
=
"t"
;
});
},
clounmSetting
()
{
this
.
setColumnFlg
=
true
;
},
saveColumnEvent
()
{
this
.
setColumnFlg
=
false
;
this
.
saveColumnFlg
=
false
;
this
.
saveColumns
=
this
.
columnGroup
.
map
(
(
index
)
=>
this
.
stmData
.
columns
[
index
]
);
},
setAll
(
val
)
{
this
.
columnGroup
=
val
?
this
.
setColumn
.
map
((
item
)
=>
item
.
index
)
:
[];
this
.
isIndeterminate
=
false
;
},
handleColumnChange
()
{
this
.
selectAll
=
this
.
setColumn
.
length
===
this
.
columnGroup
.
length
;
this
.
isIndeterminate
=
this
.
columnGroup
.
length
>
0
&&
this
.
columnGroup
.
length
<
this
.
setColumn
.
length
;
},
...
Event
,
},
created
:
function
()
{
this
.
setColumn
=
this
.
stmData
.
columns
.
map
((
item
,
index
)
=>
{
let
begIdx
=
item
.
indexOf
(
'"'
);
let
endIdx
=
item
.
indexOf
(
'"'
,
begIdx
+
1
);
let
label
=
item
.
substring
(
begIdx
+
1
,
endIdx
);
return
{
label
,
value
:
true
,
index
};
});
this
.
columnGroup
=
this
.
setColumn
.
map
((
item
)
=>
item
.
index
);
//
this.setColumn = this.stmData.columns.map((item, index) => {
//
let begIdx = item.indexOf('"');
//
let endIdx = item.indexOf('"', begIdx + 1);
//
let label = item.substring(begIdx + 1, endIdx);
//
return { label, value: true, index };
//
});
//
this.columnGroup = this.setColumn.map((item) => item.index);
},
};
</
script
>
<
style
scoped
>
.el-checkbox
>>>
.el-checkbox__label
{
width
:
60px
;
font-size
:
13px
;
}
.cbClass
>>>
.el-checkbox__label
{
width
:
30px
;
font-size
:
13px
;
padding-left
:
5px
;
}
.showColumnDialog
>>>
.el-dialog__body
{
padding-bottom
:
10px
;
}
...
...
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