Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
8136dab8
Commit
8136dab8
authored
Jul 06, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备
parent
ed54b020
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
200 additions
and
9 deletions
+200
-9
src/api/oceanus.js
src/api/oceanus.js
+13
-0
src/components/FormMixin/index.js
src/components/FormMixin/index.js
+10
-1
src/pages/oceanus/category/components/OceanusTree.vue
src/pages/oceanus/category/components/OceanusTree.vue
+41
-0
src/pages/oceanus/category/index.vue
src/pages/oceanus/category/index.vue
+91
-0
src/pages/oceanus/equipment/index.vue
src/pages/oceanus/equipment/index.vue
+7
-0
src/pages/system/view/organization/components/OrganizationTree.vue
.../system/view/organization/components/OrganizationTree.vue
+6
-2
src/pages/system/view/organization/orgmanagement/Org.vue
src/pages/system/view/organization/orgmanagement/Org.vue
+6
-1
src/router/config.js
src/router/config.js
+20
-0
src/utils/index.js
src/utils/index.js
+0
-1
src/utils/requestUtil.js
src/utils/requestUtil.js
+2
-0
vue.config.js
vue.config.js
+4
-4
No files found.
src/api/oceanus.js
0 → 100644
View file @
8136dab8
import
{
delReq
,
getReq
,
postReq
,
putReq
}
from
'
@/utils
'
;
function
getOceanusTreeApi
(
data
)
{
return
getReq
(
'
/oceanus/api/v1/categories
'
,
data
);
}
function
addOceanusTreeApi
(
data
)
{
return
postReq
(
'
/oceanus/api/v1/categories
'
,
data
);
}
export
default
{
getOceanusTree
:
getOceanusTreeApi
,
addOceanusTree
:
addOceanusTreeApi
,
};
src/components/FormMixin/index.js
View file @
8136dab8
...
...
@@ -3,6 +3,7 @@ export default {
return
{
type
:
0
,
form
:
{},
title
:
''
,
};
},
computed
:
{
...
...
@@ -29,7 +30,15 @@ export default {
setData
(
data
,
type
)
{
this
.
form
=
{
...
data
};
this
.
type
=
type
;
console
.
log
(
data
,
type
);
if
(
type
===
0
)
{
this
.
title
=
'
新增
'
;
}
else
if
(
type
===
1
)
{
this
.
title
=
'
编辑
'
;
}
else
if
(
type
===
2
)
{
this
.
title
=
'
查看
'
;
}
else
{
this
.
title
=
''
;
}
},
},
};
src/pages/oceanus/category/components/OceanusTree.vue
0 → 100644
View file @
8136dab8
<
template
>
<Drawer
ref=
"drawerRef"
v-model=
"visible"
:title=
"title"
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"DrawerForm"
></a-form-model>
</Drawer>
</
template
>
<
script
>
import
Drawer
from
'
@/components/table/drawer.vue
'
;
import
FormMixin
from
'
@/components/FormMixin
'
;
import
Api
from
'
@/api/oceanus
'
;
export
default
{
components
:
{
Drawer
},
props
:
{
refresh
:
Function
,
},
mixins
:
[
FormMixin
],
data
()
{
return
{
visible
:
false
,
form
:
{},
rules
:
{
loginId
:
[{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
}],
},
Api
,
};
},
async
mounted
()
{},
methods
:
{
open
()
{
this
.
form
=
{};
this
.
visible
=
true
;
},
async
onSubmit
()
{
this
.
visible
=
false
;
this
.
refresh
&&
this
.
refresh
();
},
},
};
</
script
>
src/pages/oceanus/category/index.vue
0 → 100644
View file @
8136dab8
<
template
>
<a-row
:gutter=
"24"
>
<a-col
:span=
"8"
>
<my-card>
<a-row
:gutter=
"[16, 16]"
>
<a-col
:span=
"24"
>
<a-input-search
placeholder=
"input search text"
style=
"width: 100%"
@
search=
"onSearch"
/>
</a-col>
<a-col
:span=
"24"
>
<a-button-group>
<a-button
type=
"link"
@
click=
"() => view()"
>
新增
</a-button>
<a-button
type=
"link"
>
编辑
</a-button>
<a-button
type=
"link"
>
删除
</a-button>
</a-button-group>
</a-col>
<a-col
:span=
"24"
>
<a-tree
:showLine=
"true"
:treeData=
"treeData"
:replaceFields=
"replaceFields"
:expandedKeys=
"expandedKeys"
@
select=
"onSelect"
@
expand=
"onExpand"
/>
</a-col>
</a-row>
<OceanusTreeDrawer
ref=
"OceanusTreeDrawer"
/>
</my-card>
</a-col>
<a-col
:span=
"16"
>
<my-card></my-card>
</a-col>
</a-row>
</
template
>
<
script
>
import
Api
from
'
@/api/oceanus
'
;
import
{
arrayToTree
}
from
'
@/utils
'
;
import
OceanusTreeDrawer
from
'
./components/OceanusTree.vue
'
;
export
default
{
components
:
{
OceanusTreeDrawer
},
data
()
{
return
{
treeData
:
[],
replaceFields
:
{
title
:
'
categoryName
'
,
key
:
'
categoryId
'
,
children
:
'
children
'
},
selectedKeys
:
[],
expandedKeys
:
[],
};
},
async
mounted
()
{
const
expandedKeys
=
[];
const
data
=
await
Api
.
getOceanusTree
();
const
treeObj
=
new
arrayToTree
({
data
:
data
,
rootValue
:
-
1
,
parentKey
:
'
parentCategoryId
'
,
key
:
'
categoryId
'
,
});
console
.
log
(
treeObj
);
treeObj
.
data
.
map
((
i
)
=>
{
if
(
i
.
children
)
{
expandedKeys
.
push
(
i
.
categoryId
);
}
});
this
.
treeData
=
treeObj
.
treeData
;
this
.
expandedKeys
=
expandedKeys
;
},
methods
:
{
onSearch
(
val
)
{},
onSelect
(
selectedKeys
,
info
)
{
console
.
log
(
'
selected
'
,
selectedKeys
,
info
);
},
onExpand
(
expandedKeys
)
{
this
.
expandedKeys
=
expandedKeys
;
},
async
view
(
data
=
{},
type
=
0
)
{
this
.
$refs
[
'
OceanusTreeDrawer
'
]?.
open
();
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
OceanusTreeDrawer
'
].
setData
({
...
data
},
type
);
});
},
},
};
</
script
>
<
style
scoped
>
</
style
>
src/pages/oceanus/equipment/index.vue
0 → 100644
View file @
8136dab8
<
template
>
<div>
equipment
</div>
</
template
>
<
script
>
export
default
{};
</
script
>
src/pages/system/view/organization/components/OrganizationTree.vue
View file @
8136dab8
...
...
@@ -37,9 +37,13 @@ export default {
};
},
async
mounted
()
{
this
.
rawData
=
await
api
.
getOrganizationList
();
const
rawData
=
await
api
.
getOrganizationList
();
const
newData
=
rawData
.
map
((
i
)
=>
({
...
i
,
selectable
:
i
.
orgType
===
'
DEPARTMENT
'
,
}));
const
newArr
=
new
arrayToTree
({
data
:
this
.
ra
wData
,
data
:
ne
wData
,
rootValue
:
0
,
parentKey
:
'
parentOrgId
'
,
key
:
'
orgId
'
,
...
...
src/pages/system/view/organization/orgmanagement/Org.vue
View file @
8136dab8
...
...
@@ -52,8 +52,13 @@ export default {
});
},
formatData
(
data
)
{
const
newData
=
data
.
map
((
i
)
=>
({
...
i
,
selectable
:
i
.
orgType
===
'
DEPARTMENT
'
,
}));
const
newArr
=
new
arrayToTree
({
data
:
d
ata
,
data
:
newD
ata
,
rootValue
:
0
,
parentKey
:
'
parentOrgId
'
,
key
:
'
orgId
'
,
...
...
src/router/config.js
View file @
8136dab8
...
...
@@ -143,6 +143,26 @@ const hasAuthorityRoutes = [
},
],
},
{
path
:
'
oceanus
'
,
name
:
'
设备管理
'
,
meta
:
{
icon
:
'
control
'
,
},
component
:
PageTemplateView
,
children
:
[
{
path
:
'
category
'
,
name
:
'
分类配置
'
,
component
:
()
=>
import
(
'
@/pages/oceanus/category/index.vue
'
),
},
{
path
:
'
equipment
'
,
name
:
'
设备台账
'
,
component
:
()
=>
import
(
'
@/pages/oceanus/equipment/index.vue
'
),
},
],
},
{
path
:
'
user
'
,
name
:
'
个人中心
'
,
...
...
src/utils/index.js
View file @
8136dab8
...
...
@@ -85,7 +85,6 @@ export function arrayToTree(options) {
const
THISDATA
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
));
for
(
let
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
let
currentElement
=
this
.
data
[
i
];
currentElement
.
selectable
=
currentElement
.
orgType
===
'
DEPARTMENT
'
;
let
tempCurrentElementParent
=
this
.
indexStorage
[
currentElement
[
this
.
parentKey
]];
// 临时变量里面的当前元素的父元素
if
(
tempCurrentElementParent
)
{
// 如果存在父元素
...
...
src/utils/requestUtil.js
View file @
8136dab8
...
...
@@ -11,6 +11,8 @@ axios.defaults.withCredentials = true;
axios
.
defaults
.
xsrfHeaderName
=
xsrfHeaderName
;
axios
.
defaults
.
xsrfCookieName
=
xsrfHeaderName
;
axios
.
defaults
.
baseURL
=
'
/api
'
;
/**
* @param {*} info 提示函数
*/
...
...
vue.config.js
View file @
8136dab8
...
...
@@ -193,14 +193,14 @@ const assetsCDN = {
module
.
exports
=
{
devServer
:
{
proxy
:
{
'
/api
'
:
{
'
/api
/
'
:
{
//此处要与 /services/api.js 中的 API_PROXY_PREFIX 值保持一致
// target: process.env.VUE_APP_API_BASE_URL,
target
:
'
http://platform.kuopu.net:9300
'
,
changeOrigin
:
true
,
//
pathRewrite: {
// '^/api': ''
// }
pathRewrite
:
{
'
^/api/
'
:
''
,
},
},
},
},
...
...
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