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
fukai
vue-gjjs
Commits
adeed262
Commit
adeed262
authored
Jan 10, 2022
by
liushikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务列表按钮
parent
7795d9ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
142 additions
and
107 deletions
+142
-107
common.css
src/assets/css/common.css
+4
-0
IStreamTable.vue
src/components/IStreamTable.vue
+118
-41
Menu.vue
src/views/Business/Sptsel/Menu.vue
+20
-66
No files found.
src/assets/css/common.css
View file @
adeed262
...
...
@@ -286,4 +286,7 @@
.el-date-editor.el-range-editor--small
.el-range-separator
{
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 @
adeed262
...
...
@@ -29,7 +29,44 @@
>
</el-table-column>
<slot></slot>
<el-table-column
fixed=
"right"
width=
"100px"
v-if=
"showButtonFlg"
>
<template
slot=
"header"
>
<c-col
style=
"text-align: left"
><c-button
icon=
"el-icon-s-tools"
@
click=
"clounmSetting"
></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
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=
"cbClass"
: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,9 +117,66 @@ export default {
required
:
false
,
default
:
true
,
},
showButtonFlg
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
}
},
watch
:
{
columns
()
{
this
.
generateColumns
();
}
},
computed
:
{
tableColumns
()
{
tableData
()
{
// return this.list.map((row) => {
// const res = {}
// const vals = row.split("\t");
// for (let i = 0; i
<
vals
.
length
;
i
++
)
{
// res[`${i}`] = vals[i];
// }
// return res;
// });
const
arr
=
[];
for
(
let
i
=
0
;
i
<
this
.
list
.
length
;
i
++
)
{
const
d
=
this
.
list
[
i
];
const
items
=
d
.
split
(
"
\
t"
);
const
it
=
{};
for
(
let
j
=
0
;
j
<
this
.
tableColumns
.
length
;
j
++
)
{
const
column
=
this
.
tableColumns
[
j
];
it
[
column
[
"prop"
]]
=
column
.
children
.
map
((
c
)
=>
items
[
c
[
"idx"
]]
||
" "
)
.
join
(
"
\
n"
);
}
it
[
"IDX"
]
=
i
;
it
[
'INR'
]
=
items
[
0
];
if
(
it
[
'INR'
].
length
<
8
){
it
[
'INR'
]
=
items
[
1
];
}
it
.
srcStr
=
d
;
arr
.
push
(
it
);
}
return
arr
;
},
},
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
=
/
\"([^\"]
*
)\"
/
;
...
...
@@ -119,49 +213,14 @@ export default {
});
}
}
return
columnArr
.
sort
((
a
,
b
)
=>
{
const
arr
=
columnArr
.
sort
((
a
,
b
)
=>
{
return
parseInt
(
a
.
index
)
-
parseInt
(
b
.
index
);
});
},
tableData
()
{
// return this.list.map((row) => {
// const res = {}
// const vals = row.split("\t");
// for (let i = 0; i
<
vals
.
length
;
i
++
)
{
// res[`${i}`] = vals[i];
// }
// return res;
// });
const
arr
=
[];
for
(
let
i
=
0
;
i
<
this
.
list
.
length
;
i
++
)
{
const
d
=
this
.
list
[
i
];
const
items
=
d
.
split
(
"
\
t"
);
const
it
=
{};
for
(
let
j
=
0
;
j
<
this
.
tableColumns
.
length
;
j
++
)
{
const
column
=
this
.
tableColumns
[
j
];
it
[
column
[
"prop"
]]
=
column
.
children
.
map
((
c
)
=>
items
[
c
[
"idx"
]]
||
" "
)
.
join
(
"
\
n"
);
}
it
[
"IDX"
]
=
i
;
it
[
'INR'
]
=
items
[
0
];
if
(
it
[
'INR'
].
length
<
8
){
it
[
'INR'
]
=
items
[
1
];
}
it
.
srcStr
=
d
;
arr
.
push
(
it
);
}
this
.
tableColumnsOrigin
=
arr
;
this
.
tableColumns
=
arr
;
this
.
columnGroup
=
arr
.
map
((
item
)
=>
parseInt
(
item
.
index
));
return
arr
;
},
},
data
()
{
return
{
currentPage
:
1
,
pageSizes
:
[
5
,
10
,
20
,
30
,
40
,
50
,
100
],
pageSize
:
10
,
};
},
methods
:
{
sizeChange
(
size
)
{
this
.
pageSize
=
size
;
},
...
...
@@ -192,7 +251,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
>
...
...
src/views/Business/Sptsel/Menu.vue
View file @
adeed262
...
...
@@ -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,36 +485,17 @@ 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
>
...
...
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