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
0e19d11e
Commit
0e19d11e
authored
Nov 13, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.mes123.com/zhouyx/mes-ui
parents
c25fd74e
c0b6424e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
811 additions
and
756 deletions
+811
-756
base.less
assets/css/base.less
+1
-3
iview-reset.less
assets/css/iview-reset.less
+3
-0
process.vue
components/page/import/process.vue
+29
-21
EditGrid.vue
components/page/treeGrid/EditGrid.vue
+67
-241
dataGrid.vue
components/page/treeGrid/dataGrid.vue
+1
-1
userGroup.vue
components/page/userGroup.vue
+0
-3
henq.js
libs/henq.js
+130
-14
api.js
pages/project/plan/api.js
+3
-0
importTemplate.vue
pages/project/plan/importTemplate.vue
+1
-1
index.vue
pages/project/plan/index.vue
+568
-472
index.js
store/index.js
+8
-0
No files found.
assets/css/base.less
View file @
0e19d11e
...
@@ -21,9 +21,7 @@ ul,
...
@@ -21,9 +21,7 @@ ul,
li {
li {
list-style: none;
list-style: none;
}
}
.ivu-drawer-wrap{
z-index: 12000;
}
div::-webkit-scrollbar {
div::-webkit-scrollbar {
width: 10px;
width: 10px;
height: 10px;
height: 10px;
...
...
assets/css/iview-reset.less
View file @
0e19d11e
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
background-color: @primary-color;
background-color: @primary-color;
border-color: @primary-color;
border-color: @primary-color;
}
}
.ivu-drawer-wrap,.tree-drawer{
z-index: 12000;
}
.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child) {
.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child) {
border-right-color: @primary-color;
border-right-color: @primary-color;
...
...
components/page/import/process.vue
View file @
0e19d11e
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<Table
:border=
"true"
:columns=
"columnsImport"
:data=
"excelData"
:height=
"tdHeightExcel"
:no-data-text=
"noDataText"
ref=
"table"
class=
"tableCommon"
v-if=
"tableImport"
></Table>
<Table
:border=
"true"
:columns=
"columnsImport"
:data=
"excelData"
:height=
"tdHeightExcel"
:no-data-text=
"noDataText"
ref=
"table"
class=
"tableCommon"
v-if=
"tableImport"
></Table>
<component
:is=
"detailExcel"
ref=
"comExcel"
@
on-datalength=
"datalength"
/>
<component
:is=
"detailExcel"
ref=
"comExcel"
@
on-datalength=
"datalength"
/>
</div>
</div>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
class=
"footer"
>
<Form
inline
>
<Form
inline
>
<FormItem>
<FormItem>
<Tabs
:animated=
"false"
:value=
"0"
@
on-click=
"sheetClick"
>
<Tabs
:animated=
"false"
:value=
"0"
@
on-click=
"sheetClick"
>
...
@@ -79,11 +79,10 @@ export default {
...
@@ -79,11 +79,10 @@ export default {
tableImport
:
true
,
tableImport
:
true
,
tdHeightExcel
:
""
,
tdHeightExcel
:
""
,
excelData
:
[],
excelData
:
[],
excelDataBack
:
[],
//临时存储原始数据
excelDataBack
:
[],
//临时存储原始数据
,
formatList
:
[
"xlsx"
],
formatList
:
[
"xlsx"
],
columnsImport
:
[],
columnsImport
:
[],
departArr
:
[],
//部门list
departArr
:
[],
//部门list
usersArr
:
[],
sheetNames
:
[],
//excel的表明
sheetNames
:
[],
//excel的表明
workBook
:
{},
workBook
:
{},
openDatas
:
[],
openDatas
:
[],
...
@@ -105,7 +104,7 @@ export default {
...
@@ -105,7 +104,7 @@ export default {
props
:
{
props
:
{
eid
:
Number
,
eid
:
Number
,
data
:
{
data
:
{
// 当作table使用,直接显示数据
// 当作table使用,直接显示数据
,数据里不能用英文逗号',',因为将excel转为数据后是用','分解的
type
:
Array
,
type
:
Array
,
default
:
function
()
{
default
:
function
()
{
return
[];
return
[];
...
@@ -131,12 +130,6 @@ export default {
...
@@ -131,12 +130,6 @@ export default {
this
.
$api
.
get
(
`
${
systemUrl
}
/Department/GetDepartments`
).
then
((
r
)
=>
{
this
.
$api
.
get
(
`
${
systemUrl
}
/Department/GetDepartments`
).
then
((
r
)
=>
{
this
.
departArr
=
r
.
result
.
items
;
this
.
departArr
=
r
.
result
.
items
;
});
});
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
usersArr
=
r
.
result
}
})
//导出对列表头进行预加载end
//导出对列表头进行预加载end
},
},
async
fetch
({
async
fetch
({
...
@@ -279,25 +272,28 @@ export default {
...
@@ -279,25 +272,28 @@ export default {
//人员名称转换为userid,如果查不到此人员,则为空
//人员名称转换为userid,如果查不到此人员,则为空
arrUseName
.
forEach
((
euser
)
=>
{
arrUseName
.
forEach
((
euser
)
=>
{
if
(
eles
[
euser
.
key
]
&&
eles
[
euser
.
key
]
!=
""
&&
eles
[
euser
.
key
]
!=
null
)
{
if
(
eles
[
euser
.
key
]
&&
eles
[
euser
.
key
]
!=
""
&&
eles
[
euser
.
key
]
!=
null
)
{
this
.
usersArr
.
forEach
(
eluser
=>
{
if
(
this
.
$store
.
state
.
userNameMap
.
get
(
eles
[
euser
.
key
]))
{
if
(
eles
[
euser
.
key
]
==
eluser
.
name
)
{
eles
[
euser
.
key
]
=
this
.
$store
.
state
.
userNameMap
.
get
(
eles
[
euser
.
key
]).
id
eles
[
euser
.
key
]
=
eluser
.
id
}
else
{
}
eles
[
euser
.
key
]
=
null
}
)
}
}
}
});
});
//多个名称转换为数组
//多个名称转换为数组
arrUseNames
.
forEach
((
eusers
)
=>
{
arrUseNames
.
forEach
((
eusers
)
=>
{
if
(
eles
[
eusers
.
key
]
&&
eles
[
eusers
.
key
]
!=
""
&&
eles
[
eusers
.
key
]
!=
null
)
{
if
(
eles
[
eusers
.
key
]
&&
eles
[
eusers
.
key
]
!=
""
&&
eles
[
eusers
.
key
]
!=
null
)
{
let
arruserstemp
=
this
.
$u
.
clone
(
eles
[
eusers
.
key
].
split
(
','
)
||
eles
[
eusers
.
key
].
split
(
','
))
var
arruserstemp
=
[]
if
(
eles
[
eusers
.
key
].
indexOf
(
','
)
>
-
1
)
{
arruserstemp
=
eles
[
eusers
.
key
].
split
(
','
)
}
else
{
arruserstemp
=
[
eles
[
eusers
.
key
]]
}
let
tempUserIds
=
[]
let
tempUserIds
=
[]
arruserstemp
.
forEach
(
eltempUsers
=>
{
arruserstemp
.
forEach
(
eltempUsers
=>
{
if
(
this
.
$store
.
state
.
userNameMap
.
get
(
eltempUsers
))
{
tempUserIds
.
push
(
this
.
$store
.
state
.
userNameMap
.
get
(
eltempUsers
).
id
)
}
this
.
usersArr
.
forEach
(
elusers
=>
{
if
(
eltempUsers
==
elusers
.
name
)
{
tempUserIds
.
push
(
elusers
.
id
)
}
})
})
})
eles
[
eusers
.
key
]
=
tempUserIds
eles
[
eusers
.
key
]
=
tempUserIds
}
}
...
@@ -567,5 +563,17 @@ export default {
...
@@ -567,5 +563,17 @@ export default {
text-align: right;
text-align: right;
}
}
}
}
.footer {
.ivu-tabs-tab {
color: #aaa;
}
.ivu-tabs-tab-active,
.ivu-tabs-tab-focused {
color: #fff;
}
}
}
}
</
style
>
</
style
>
components/page/treeGrid/EditGrid.vue
View file @
0e19d11e
This diff is collapsed.
Click to expand it.
components/page/treeGrid/dataGrid.vue
View file @
0e19d11e
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<Button
@
click=
"complexSearch"
type=
"primary"
style=
"margin-left: 10px"
>
查询
</Button>
<Button
@
click=
"complexSearch"
type=
"primary"
style=
"margin-left: 10px"
>
查询
</Button>
</div>
</div>
</Modal>
</Modal>
<Drawer
title=
"列设置"
v-if=
"set"
v-model=
"config"
:scrollable=
"true"
placement=
"left"
:mask=
"false"
>
<Drawer
title=
"列设置"
v-if=
"set"
v-model=
"config"
:scrollable=
"true"
placement=
"left"
:mask=
"false"
class-name=
"tree-drawer"
>
<div
slot=
"header"
>
<div
slot=
"header"
>
列设置
列设置
<a
@
click=
"undoConfig"
class=
"ml50"
>
<a
@
click=
"undoConfig"
class=
"ml50"
>
...
...
components/page/userGroup.vue
View file @
0e19d11e
<
template
>
<
template
>
<div>
<Select
<Select
:placeholder=
"placeholder"
:placeholder=
"placeholder"
v-model=
"name"
v-model=
"name"
...
@@ -7,7 +6,6 @@
...
@@ -7,7 +6,6 @@
:multiple=
"multiple"
:multiple=
"multiple"
clearable
clearable
filterable
filterable
transfer
>
>
<Option
<Option
v-for=
"item in users"
v-for=
"item in users"
...
@@ -30,7 +28,6 @@
...
@@ -30,7 +28,6 @@
</div>
</div>
</Option>
</Option>
</Select>
</Select>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
...
libs/henq.js
View file @
0e19d11e
import
XLSX
from
'xlsx'
;
import
XLSX
from
'xlsx'
;
import
Api
from
'@/plugins/request'
let
henq
=
{};
let
henq
=
{};
let
pdfInfo
=
''
let
pdfInfo
=
''
henq
.
clone
=
(
data
)
=>
{
henq
.
clone
=
(
data
)
=>
{
...
@@ -133,7 +132,7 @@ henq.toTree = (list, rootId, format, parentFiledName) => {
...
@@ -133,7 +132,7 @@ henq.toTree = (list, rootId, format, parentFiledName) => {
function
toTree
(
data
,
parentId
,
level
)
{
function
toTree
(
data
,
parentId
,
level
)
{
let
parents
=
data
.
filter
(
u
=>
{
let
parents
=
data
.
filter
(
u
=>
{
if
(
u
[
upId
]
==
''
)
if
(
u
[
upId
]
==
=
''
)
{
{
u
[
upId
]
=
null
u
[
upId
]
=
null
}
}
...
@@ -337,18 +336,19 @@ henq.readXLSX = (file) => {
...
@@ -337,18 +336,19 @@ henq.readXLSX = (file) => {
}
}
//得到根据value得到对应数据字典的name
//得到根据value得到对应数据字典的name
henq
.
dirName
=
(
code
,
v
)
=>
{
henq
.
dirName
=
(
code
,
v
)
=>
{
var
items
=
""
var
items
=
""
let
i
=
0
let
i
=
0
code
.
forEach
(
ele
=>
{
code
.
forEach
(
ele
=>
{
if
(
ele
.
code
==
v
)
{
if
(
ele
.
code
==
v
)
{
items
=
ele
.
name
items
=
ele
.
name
i
++
i
++
}
});
if
(
i
==
0
)
{
//如果没查到对应的name,则返回默认name
items
=
code
[
0
].
name
}
}
});
return
items
if
(
i
==
0
)
{
//如果没查到对应的name,则返回默认name
items
=
code
[
0
].
name
}
return
items
}
}
//得到根据name得到对应数据字典的code
//得到根据name得到对应数据字典的code
henq
.
dirCode
=
(
code
,
v
)
=>
{
henq
.
dirCode
=
(
code
,
v
)
=>
{
...
@@ -628,6 +628,122 @@ henq.getCurMonth = (val) => {
...
@@ -628,6 +628,122 @@ henq.getCurMonth = (val) => {
}
}
return
m_year
+
'-'
+
m_month
return
m_year
+
'-'
+
m_month
}
}
//获取当天、明天、昨天、本周、上周、本月、上月的日期 end
//获取当天、明天、昨天、本周、上周、本月、上月的日期 end
//导出excel
henq
.
export2excel
=
(
exTitle
,
columns
,
datalist
,
store
)
=>
{
//当前显示数据
let
list
=
henq
.
clone
(
datalist
);
const
tHeader
=
[];
// 设置Excel的表格第一行的标题
const
filterVal
=
[];
//list里对象的属性
var
tempCol
=
[];
var
tempColUser
=
[];
//存放type=user的表头
var
tempColUsers
=
[];
//存放type=users的表头
var
columnsCur
=
henq
.
clone
(
columns
);
//导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur
.
forEach
((
el
)
=>
{
if
(
el
.
export
)
{
if
(
el
.
code
)
{
tempCol
.
push
({
key
:
el
.
key
,
code
:
el
.
code
,
});
//临时存放code数据字典的字段及对应的数据字典code
}
if
(
el
.
type
&&
el
.
type
==
"user"
)
{
tempColUser
.
push
({
key
:
el
.
key
,
code
:
el
.
type
,
});
//临时存放user列
}
if
(
el
.
type
&&
el
.
type
==
"users"
)
{
tempColUsers
.
push
({
key
:
el
.
key
,
code
:
el
.
type
,
});
//临时存放user列
}
tHeader
.
push
(
el
.
title
);
filterVal
.
push
(
el
.
key
);
}
});
list
.
forEach
((
e
)
=>
{
tempCol
.
forEach
((
elem
)
=>
{
if
(
(
e
[
elem
.
key
]
&&
e
[
elem
.
key
]
!=
""
&&
e
[
elem
.
key
]
!=
null
)
||
e
[
elem
.
key
]
==
0
)
{
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let
codeArr
=
[];
let
keyValue
=
e
[
elem
.
key
];
if
(
keyValue
.
length
>
0
&&
(
keyValue
.
indexOf
(
","
)
>
-
1
||
keyValue
.
indexOf
(
","
)
>
-
1
)
)
{
//如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if
(
keyValue
.
indexOf
(
","
)
>
-
1
)
{
codeArr
=
keyValue
.
split
(
","
);
}
if
(
keyValue
.
indexOf
>
-
1
)
{
codeArr
=
keyValue
.
split
(
","
);
}
}
if
(
codeArr
.
length
<=
1
)
{
//对应的数据包含一个数据字典项
e
[
elem
.
key
]
=
henq
.
dirName
(
store
.
getters
.
dictionaryByKey
(
elem
.
code
),
e
[
elem
.
key
]);
}
else
{
//对应的数据包含多个数据字典项
let
codeInfo
=
""
;
codeArr
.
forEach
((
el
)
=>
{
codeInfo
=
codeInfo
+
henq
.
dirName
(
store
.
getters
.
dictionaryByKey
(
elem
.
code
),
el
)
+
","
;
});
e
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
);
}
}
});
//导出username相关信息
tempColUser
.
forEach
((
eluser
)
=>
{
if
(
Array
.
isArray
(
e
[
eluser
.
key
])
&&
e
[
eluser
.
key
].
length
>
0
)
{
let
temUsers
=
henq
.
clone
(
e
[
eluser
.
key
]);
let
temUserName
=
""
;
temUsers
.
forEach
((
u
)
=>
{
temUserName
=
temUserName
+
store
.
getters
.
getUser
(
u
).
name
;
});
e
[
eluser
.
key
]
=
temUserName
;
}
if
(
e
[
eluser
.
key
]
&&
typeof
e
[
eluser
.
key
]
==
"string"
&&
e
[
eluser
.
key
]
!=
""
&&
e
[
eluser
.
key
]
!=
null
)
{
e
[
eluser
.
key
]
=
store
.
getters
.
getUser
(
e
[
eluser
.
key
]).
name
;
}
});
tempColUsers
.
forEach
((
elusers
)
=>
{
if
(
e
[
elusers
.
key
].
length
>
0
)
{
let
temUsers
=
henq
.
clone
(
e
[
elusers
.
key
]);
let
temUserName
=
""
;
temUsers
.
forEach
((
u
)
=>
{
temUserName
=
temUserName
+
store
.
getters
.
getUser
(
u
).
name
+
","
;
});
e
[
elusers
.
key
]
=
temUserName
.
substr
(
0
,
temUserName
.
length
-
1
);
}
});
});
let
nowDate
=
henq
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
henq
.
outExcel
(
exTitle
+
"("
+
nowDate
+
")"
,
tHeader
,
filterVal
,
list
);
}
export
default
henq
;
export
default
henq
;
pages/project/plan/api.js
View file @
0e19d11e
...
@@ -26,6 +26,9 @@ export default {
...
@@ -26,6 +26,9 @@ export default {
}
}
});
});
},
},
batch
(
ids
)
{
return
Api
.
post
(
`
${
material
}
/projectplan/batchdelete`
,
ids
);
},
///projecttemplate/list
///projecttemplate/list
templates
(
params
){
templates
(
params
){
return
Api
.
post
(
`
${
material
}
/projecttemplate/list`
,
params
)
return
Api
.
post
(
`
${
material
}
/projecttemplate/list`
,
params
)
...
...
pages/project/plan/importTemplate.vue
View file @
0e19d11e
...
@@ -142,7 +142,7 @@ export default {
...
@@ -142,7 +142,7 @@ export default {
}).
then
((
r
)
=>
{
}).
then
((
r
)
=>
{
if
(
r
.
success
)
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"导入成功"
);
this
.
$Message
.
success
(
"导入成功"
);
this
.
$emit
(
"on-
load
"
);
this
.
$emit
(
"on-
ok
"
);
}
}
});
});
},
},
...
...
pages/project/plan/index.vue
View file @
0e19d11e
This diff is collapsed.
Click to expand it.
store/index.js
View file @
0e19d11e
...
@@ -5,6 +5,7 @@ export const state = () => ({
...
@@ -5,6 +5,7 @@ export const state = () => ({
counter
:
0
,
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
dictionary
:
new
Map
(),
//所有字典项
userMap
:
new
Map
(),
//所有用户缓存;
userMap
:
new
Map
(),
//所有用户缓存;
userNameMap
:
new
Map
(),
//所有用户名称缓存;
departmentsMap
:
new
Map
(),
//部门缓存;
departmentsMap
:
new
Map
(),
//部门缓存;
userInfo
:
{
userInfo
:
{
userId
:
0
,
userId
:
0
,
...
@@ -69,6 +70,9 @@ export const mutations = {
...
@@ -69,6 +70,9 @@ export const mutations = {
setUsers
(
state
,
users
)
{
setUsers
(
state
,
users
)
{
state
.
userMap
=
users
;
state
.
userMap
=
users
;
},
},
setUserNames
(
state
,
usersNames
)
{
state
.
userNameMap
=
usersNames
;
},
addUser
(
state
,
user
)
{
addUser
(
state
,
user
)
{
state
.
userMap
.
push
(
user
);
state
.
userMap
.
push
(
user
);
},
},
...
@@ -178,10 +182,14 @@ export const actions = {
...
@@ -178,10 +182,14 @@ export const actions = {
let
r
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
let
r
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
umap
=
new
Map
();
var
umap
=
new
Map
();
var
unamemap
=
new
Map
();
r
.
result
.
map
(
u
=>
{
r
.
result
.
map
(
u
=>
{
umap
.
set
(
u
.
id
,
u
);
umap
.
set
(
u
.
id
,
u
);
unamemap
.
set
(
u
.
name
,
u
)
});
});
commit
(
"setUsers"
,
umap
);
commit
(
"setUsers"
,
umap
);
commit
(
"setUserNames"
,
unamemap
);
},
},
async
loadDepartments
({
async
loadDepartments
({
commit
commit
...
...
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