Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopFront
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
newshop
newShopFront
Commits
a96bb8db
Commit
a96bb8db
authored
Dec 25, 2019
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
节点配送优化
parent
26550823
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
349 additions
and
727 deletions
+349
-727
authority.js
src/api/authority.js
+16
-0
delivery.js
src/api/delivery.js
+8
-0
components_use.js
src/core/lazy_lib/components_use.js
+3
-1
main.js
src/main.js
+7
-7
menuList.vue
src/views/authority/menuList.vue
+293
-308
test.vue
src/views/authority/test.vue
+0
-407
distributionManage.vue
src/views/delivery/distributionManage.vue
+22
-4
No files found.
src/api/authority.js
View file @
a96bb8db
...
@@ -34,6 +34,22 @@ export function getMenuDetails (parameter) {
...
@@ -34,6 +34,22 @@ export function getMenuDetails (parameter) {
}
}
})
})
}
}
// 添加权限节点
export
function
addAuthorityNode
(
parameter
)
{
return
axios
({
url
:
'authority/authority-nodes/node-add'
,
method
:
'post'
,
data
:
parameter
})
}
// 修改权限节点
export
function
updateAuthorityNode
(
parameter
)
{
return
axios
({
url
:
'authority/authority-nodes/node-update'
,
method
:
'put'
,
data
:
parameter
})
}
// 获取角色列表
// 获取角色列表
export
function
getRoleList
(
parameter
)
{
export
function
getRoleList
(
parameter
)
{
return
axios
({
return
axios
({
...
...
src/api/delivery.js
View file @
a96bb8db
...
@@ -67,6 +67,14 @@ export function getTransportList(parameter) {
...
@@ -67,6 +67,14 @@ export function getTransportList(parameter) {
params
:
parameter
params
:
parameter
})
})
}
}
// 配送方式开启关闭
export
function
transportMakeUse
(
parameter
)
{
return
axios
({
url
:
'transport/transport-methods/make-use'
,
method
:
'get'
,
params
:
parameter
})
}
//修改配送方式详情
//修改配送方式详情
export
function
modifyDistributionDetail
(
parameter
)
{
export
function
modifyDistributionDetail
(
parameter
)
{
return
axios
({
return
axios
({
...
...
src/core/lazy_lib/components_use.js
View file @
a96bb8db
...
@@ -49,7 +49,8 @@ import {
...
@@ -49,7 +49,8 @@ import {
notification
,
notification
,
Cascader
,
Cascader
,
Collapse
,
Collapse
,
Tree
Tree
,
TreeSelect
}
from
'ant-design-vue'
}
from
'ant-design-vue'
// import VueCropper from 'vue-cropper'
// import VueCropper from 'vue-cropper'
...
@@ -95,6 +96,7 @@ Vue.use(notification)
...
@@ -95,6 +96,7 @@ Vue.use(notification)
Vue
.
use
(
Cascader
)
Vue
.
use
(
Cascader
)
Vue
.
use
(
Collapse
)
Vue
.
use
(
Collapse
)
Vue
.
use
(
Tree
)
Vue
.
use
(
Tree
)
Vue
.
use
(
TreeSelect
)
Vue
.
prototype
.
$confirm
=
Modal
.
confirm
Vue
.
prototype
.
$confirm
=
Modal
.
confirm
Vue
.
prototype
.
$message
=
message
Vue
.
prototype
.
$message
=
message
...
...
src/main.js
View file @
a96bb8db
// with polyfills
// with polyfills
import
'core-js/stable'
import
'core-js/stable'
import
'regenerator-runtime/runtime'
import
'regenerator-runtime/runtime'
import
{
TreeSelect
}
from
"ant-design-vue"
;
import
Vue
from
'vue'
import
Vue
from
'vue'
import
App
from
'./App.vue'
import
App
from
'./App.vue'
import
router
from
'./router'
import
router
from
'./router'
import
store
from
'./store/'
import
store
from
'./store/'
import
{
VueAxios
}
from
'./utils/request'
import
{
VueAxios
}
from
'./utils/request'
import
VueQuillEditor
from
'vue-quill-editor'
//
import VueQuillEditor from 'vue-quill-editor'
import
'quill/dist/quill.core.css'
//
import 'quill/dist/quill.core.css'
import
'quill/dist/quill.snow.css'
//
import 'quill/dist/quill.snow.css'
import
'quill/dist/quill.bubble.css'
//
import 'quill/dist/quill.bubble.css'
import
VueAMap
from
'vue-amap'
;
import
VueAMap
from
'vue-amap'
;
// mock
// mock
...
@@ -26,12 +26,12 @@ import './components/global.less'
...
@@ -26,12 +26,12 @@ import './components/global.less'
import
common
from
'@/static/js/common.js'
import
common
from
'@/static/js/common.js'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
component
(
TreeSelect
)
Vue
.
prototype
.
common
=
common
Vue
.
prototype
.
common
=
common
// mount axios Vue.$http and this.$http
// mount axios Vue.$http and this.$http
Vue
.
use
(
VueAxios
)
Vue
.
use
(
VueAxios
)
Vue
.
use
(
VueQuillEditor
)
//
Vue.use(VueQuillEditor)
Vue
.
use
(
VueAMap
)
Vue
.
use
(
VueAMap
)
VueAMap
.
initAMapApiLoader
({
VueAMap
.
initAMapApiLoader
({
key
:
'your amap key'
,
key
:
'your amap key'
,
...
...
src/views/authority/menuList.vue
View file @
a96bb8db
<
template
>
<
template
>
<div>
<div>
<a-card
style=
"margin-bottom:10px"
>
<a-card
style=
"margin-bottom:10px"
>
<a-form
:form=
"newform"
layout=
"inline"
>
<
!--
<
a-form
:form=
"newform"
layout=
"inline"
>
<a-row
:gutter=
"16"
type=
"flex"
justify=
"start"
>
<a-row
:gutter=
"16"
type=
"flex"
justify=
"start"
>
<a-col
:span=
"6"
>
<a-col
:span=
"6"
>
<a-form-item
label=
"名称:"
>
<a-form-item
label=
"名称:"
>
...
@@ -18,15 +18,15 @@
...
@@ -18,15 +18,15 @@
</a-col>
</a-col>
<a-col
:span=
"6"
>
<a-col
:span=
"6"
>
<a-form-item>
<a-form-item>
<a-input-search
style=
"margin-bottom: 8px"
placeholder=
"Search"
@
change=
"onChange"
/>
<a-input-search
style=
"margin-bottom: 8px"
placeholder=
"Search"
@
change=
"onChange"
/>
-->
<!--
<a-button
type=
"primary"
icon=
"search"
@
click=
"$refs.table.refresh(true)"
>
查询
</a-button>
-->
<!--
<a-button
type=
"primary"
icon=
"search"
@
click=
"$refs.table.refresh(true)"
>
查询
</a-button>
-->
</a-form-item>
<!--
</a-form-item>
</a-col>
</a-col>
</a-row>
</a-row>
</a-form>
</a-form>
-->
<div
class=
"table-operator"
>
<div
class=
"table-operator"
>
<a-button-group>
<a-button-group>
<a-button
type=
'primary'
icon=
'plus'
@
click=
"getMenuClick(1)
"
>
添加节点
</a-button>
<a-button
type=
"primary"
icon=
"plus"
@
click=
"addMenu
"
>
添加节点
</a-button>
</a-button-group>
</a-button-group>
</div>
</div>
<s-table
<s-table
...
@@ -34,16 +34,15 @@
...
@@ -34,16 +34,15 @@
ref=
"table"
ref=
"table"
size=
"default"
size=
"default"
rowKey=
"ID"
rowKey=
"ID"
childrenColumnName
=
"son
"
childrenColumnName
=
"CHILDREN
"
:columns=
"columns"
:columns=
"columns"
:data=
"loadData"
:data=
"loadData"
:showPagination=
"pagination"
:showPagination=
"pagination"
:rowSelection=
"rowSelection"
>
>
<!-- :scroll="
{ x: 1200, y: 300 }" -->
<!-- :scroll="
{ x: 1200, y: 300 }" -->
<span
slot=
"action"
slot-scope=
"text, record"
>
<span
slot=
"action"
slot-scope=
"text, record"
>
<template>
<template>
<a
@
click=
"
getMenuClick(record
)"
>
编辑
</a>
<a
@
click=
"
editMenu(record.ID
)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"remove(record.ID)"
>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"remove(record.ID)"
>
<a>
删除
</a>
<a>
删除
</a>
...
@@ -51,192 +50,116 @@
...
@@ -51,192 +50,116 @@
</
template
>
</
template
>
</span>
</span>
</s-table>
</s-table>
<a-modal
:title=
"modalTitle"
v-model=
"showMenuModal"
:maskClosable=
"false"
@
ok=
"editMenu
()"
>
<a-modal
:title=
"modalTitle"
v-model=
"showMenuModal"
:maskClosable=
"false"
@
ok=
"submit
()"
>
<a-form
:form=
"form"
>
<a-form
:form=
"form"
>
<a-form-item
v-show=
"false"
>
<a-input
type=
"hidden"
v-decorator=
"['ID']"
name=
"ID"
></a-input>
</a-form-item>
<!-- <a-form-item v-show="false">
<a-input type="hidden" v-decorator="['PID']"></a-input>
</a-form-item> -->
<a-form-item
label=
"菜单名称:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-form-item
label=
"菜单名称:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
<a-input
type=
"text"
type=
"text"
v-decorator=
"['TITLE', { rules: [{ message: '请输入菜单名称' }] }]"
>
</a-input>
v-decorator=
"['TITLE', { rules: [{ message: '请输入菜单名称' }] }]"
</a-form-item>
>
<a-form-item
label=
"父菜单:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
</a-input>
<!-- 0=主菜单 -->
</a-form-item>
<a-tree-select
<a-form-item
label=
"菜单地址:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
style=
"width: 300px"
<a-input
:dropdownStyle=
"{ maxHeight: '400px', overflow: 'auto' }"
type=
"text"
placeholder=
"主菜单"
v-decorator=
"['NAME', { rules: [{ message: '请输入菜单地址' }] }]"
treeDefaultExpandAll
>
v-decorator=
"['PID']"
</a-input>
>
</a-form-item>
<a-tree-select-node
:value=
"item1.ID"
<a-form-item
label=
"图标:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
:title=
"item1.TITLE"
<a-input
v-for=
"item1 in listData"
type=
"text"
v-bind:key=
"item1.ID"
v-decorator=
"['ICON', { rules: [{ message: '请输入图标' }] }]"
>
>
<a-tree-select-node
</a-input>
:value=
"item2.ID"
</a-form-item>
:title=
"item2.TITLE"
v-for=
"item2 in item1.CHILDREN"
<a-form-item
label=
"菜单状态:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
v-bind:key=
"item2.ID"
<a-input
>
type=
"text"
<a-tree-select-node
v-decorator=
"['STATUS', { rules: [{ message: '请输入菜单状态' }] }]"
:value=
"item3.ID"
>
:title=
"item3.TITLE"
</a-input>
v-for=
"item3 in item2.CHILDREN"
</a-form-item>
v-bind:key=
"item3.ID"
<a-form-item
label=
"是否为菜单:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['IS_MENU', { rules: [{ message: '请输入是否为菜单' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"是否顶部菜单:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['IS_TOP_MENU', { rules: [{ message: '请输入是否顶部菜单' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"是否默认显示:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['IS_DEFAULT_SHOW', { rules: [{ message: '请输入是否进入默认显示页面' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"描述:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['REMARK']"
placeholder=
"描述"
/>
</a-form-item>
<!-- <a-form-item label="图标:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="text" v-decorator="['ICON']"> </a-input>
</a-form-item> -->
<a-form-item
label=
"菜单排序序号:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"number"
v-decorator=
"['SORT']"
>
</a-input>
</a-form-item>
<a-form-item
label=
"父级菜单ID:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"number"
v-decorator=
"['PID']"
>
</a-input>
</a-form-item>
<a-form-item
label=
"菜单层级:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-radio-group
buttonStyle=
"solid"
:disabled=
"editType == 'update'"
v-model=
"queryParam.LEVEL"
v-decorator=
"[
'LEVEL',
{ rules: [{ required: true, message: '请选择菜单层级等级' }, { validator: makeMenuTypeSafe }] }
]"
>
<a-radio-button
value=
"0"
>
项目
</a-radio-button>
<a-radio-button
value=
"1"
>
模块
</a-radio-button>
<a-radio-button
value=
"2"
>
操作
</a-radio-button>
<a-radio-button
value=
"3"
>
动作
</a-radio-button>
</a-radio-group>
</a-form-item>
<!-- <a-tree
checkable
:replaceFields="modalTree.replaceFields"
:treeData="modalTree.treeData"
v-model="modalTree.checkedKeys"
>
>
<a-tree-select-node
:value=
"item4.ID"
:title=
"item4.TITLE"
v-for=
"item4 in item3.CHILDREN"
v-bind:key=
"item4.ID"
>
</a-tree-select-node>
</a-tree-select-node>
</a-tree-select-node>
</a-tree-select-node>
</a-tree-select>
</a-form-item>
<a-form-item
label=
"菜单地址:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['NAME', { rules: [{ message: '请输入菜单地址' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"图标:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['ICON', { rules: [{ message: '请输入图标' }] }]"
>
</a-input>
</a-form-item>
</a-tree> -->
<a-form-item
label=
"菜单状态:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['STATUS', { rules: [{ message: '请输入菜单状态' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"是否为菜单:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['IS_MENU', { rules: [{ message: '请输入是否为菜单' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"是否顶部菜单:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['IS_TOP_MENU', { rules: [{ message: '请输入是否顶部菜单' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"是否默认显示:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['IS_DEFAULT_SHOW', { rules: [{ message: '请输入是否进入默认显示页面' }] }]"
>
</a-input>
</a-form-item>
<a-form-item
label=
"描述:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"text"
v-decorator=
"['REMARK']"
placeholder=
"描述"
/>
</a-form-item>
<a-form-item
label=
"菜单排序序号:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-input
type=
"number"
v-decorator=
"['SORT']"
>
</a-input>
</a-form-item>
<!-- <a-form-item label="父级菜单ID:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="number" v-decorator="['PID']"> </a-input>
</a-form-item> -->
<a-form-item
label=
"菜单层级:"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
>
<a-radio-group
buttonStyle=
"solid"
:disabled=
"editType == 'update'"
v-decorator=
"[
'LEVEL',
{ rules: [{ required: true, message: '请选择菜单层级等级' }, { validator: makeMenuTypeSafe }] }
]"
>
<a-radio-button
value=
"0"
>
项目
</a-radio-button>
<a-radio-button
value=
"1"
>
模块
</a-radio-button>
<a-radio-button
value=
"2"
>
操作
</a-radio-button>
<a-radio-button
value=
"3"
>
动作
</a-radio-button>
</a-radio-group>
</a-form-item>
</a-form>
</a-form>
</a-modal>
</a-modal>
</a-card>
</a-card>
<!--
<!-- <a-modal v-model="showMenuModal" title="菜单" :maskClosable="false" @ok="editMenu">
<a-form :form="form">
<a-form-item v-show="false">
<a-input type="hidden" v-decorator="['id']"></a-input>
</a-form-item>
<a-form-item v-show="false">
<a-input type="hidden" v-decorator="['pid']"></a-input>
</a-form-item>
<a-form-item label="名称:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="text" v-decorator="['name', { rules: [{ required: true, message: '请输入菜单名' }] }]">
</a-input>
</a-form-item>
<a-form-item label="父菜单:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-tree-select
style="width:100%"
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
:treeData="modalTreeData"
:treeDefaultExpandedKeys="expandedRowKeys"
treeNodeLabelProp="name"
treeNodeFilterProp="id"
@select="parentTreeSelect"
:disabled="modalParams.type == 'B' && editType == 'update'"
v-decorator="['pMenu', { rules: [{ required: false }] }]"
>
</a-tree-select>
</a-form-item>
<a-form-item label="路径:" v-show="modalParams.type != 'B'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input
type="text"
v-decorator="['path', { rules: [{ required: modalParams.type != 'B', message: '请输入菜单路径' }] }]"
>
</a-input>
</a-form-item>
<a-form-item label="组件:" v-show="modalParams.type == 'M'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input
type="text"
v-decorator="['component', { rules: [{ required: modalParams.type == 'M', message: '请输入菜单组件' }] }]"
>
</a-input>
</a-form-item>
<a-form-item label="权限标识:" v-show="modalParams.type != 'D'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input
type="text"
v-decorator="['permName']"
placeholder="权限标识"
/>
</a-form-item>
<a-form-item label="图标:" v-show="modalParams.type != 'B'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="text" v-decorator="['icon']"> </a-input>
</a-form-item>
<a-form-item label="排序:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="number" v-decorator="['sort']"> </a-input>
</a-form-item>
<a-form-item label="类型:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-radio-group
buttonStyle="solid"
:disabled="editType == 'update'"
v-model="modalParams.type"
v-decorator="[
'type',
{ rules: [{ required: true, message: '请选择菜单类型' }, { validator: makeMenuTypeSafe }] }
]"
>
<a-radio-button value="D">目录</a-radio-button>
<a-radio-button value="M">菜单</a-radio-button>
<a-radio-button value="B">按钮</a-radio-button>
</a-radio-group>
</a-form-item>
</a-form>
</a-modal> -->
</div>
</div>
</template>
</template>
<
script
>
<
script
>
// , addMenu, updateMenu, deleteMenu
// import moment from 'moment'
import
moment
from
'moment'
import
{
STable
}
from
'@/components'
import
{
STable
}
from
'@/components'
import
{
getMenuList
,
getMenuDetails
}
from
'@/api/authority'
import
{
getMenuList
,
getMenuDetails
,
addAuthorityNode
,
updateAuthorityNode
}
from
'@/api/authority'
const
rowSelection
=
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
console
.
log
(
`selectedRowKeys:
${
selectedRowKeys
}
`
,
'selectedRows: '
,
selectedRows
);
},
onSelect
:
(
record
,
selected
,
selectedRows
)
=>
{
console
.
log
(
record
,
selected
,
selectedRows
);
},
onSelectAll
:
(
selected
,
selectedRows
,
changeRows
)
=>
{
console
.
log
(
selected
,
selectedRows
,
changeRows
);
},
};
export
default
{
export
default
{
name
:
'authority'
,
name
:
'authority'
,
components
:
{
components
:
{
...
@@ -244,7 +167,6 @@ export default {
...
@@ -244,7 +167,6 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
rowSelection
,
labelCol
:
{
labelCol
:
{
xs
:
{
span
:
5
}
xs
:
{
span
:
5
}
},
},
...
@@ -253,17 +175,18 @@ export default {
...
@@ -253,17 +175,18 @@ export default {
},
},
// 查询参数
// 查询参数
queryParam
:
{
queryParam
:
{
LEVEL
:
'0'
LEVEL
:
'0'
},
},
form
:
this
.
$form
.
createForm
(
this
),
form
:
this
.
$form
.
createForm
(
this
),
newform
:
this
.
$form
.
createForm
(
this
),
// newform: this.$form.createForm(this),
rowSelection
:
{
// rowSelection: {
type
:
'radio'
,
// type: 'radio',
selectedRowKeys
:
[]
// selectedRowKeys: []
},
// },
showMenuModal
:
false
,
showMenuModal
:
false
,
modalTitle
:
'添加角色'
,
//modal标题
modalTitle
:
'添加角色'
,
//modal标题
addoredit
:
1
,
//添加1or编辑0
addoredit
:
1
,
//添加1or编辑0
treeExpandedKeys
:[],
columns
:
[
columns
:
[
{
{
title
:
'菜单名称'
,
title
:
'菜单名称'
,
...
@@ -292,12 +215,12 @@ export default {
...
@@ -292,12 +215,12 @@ export default {
title
:
'节点id'
,
title
:
'节点id'
,
dataIndex
:
'ID'
,
dataIndex
:
'ID'
,
width
:
'8%'
,
width
:
'8%'
,
key
:
'ID'
,
key
:
'ID'
},
},
{
{
title
:
'菜单地址'
,
title
:
'菜单地址'
,
dataIndex
:
'NAME'
,
dataIndex
:
'NAME'
,
width
:
'15%'
,
width
:
'15%'
// width: 200
// width: 200
},
},
{
{
...
@@ -305,7 +228,7 @@ export default {
...
@@ -305,7 +228,7 @@ export default {
width
:
'8%'
,
width
:
'8%'
,
dataIndex
:
'STATUS'
,
dataIndex
:
'STATUS'
,
customRender
:
(
state
,
row
,
index
)
=>
{
customRender
:
(
state
,
row
,
index
)
=>
{
return
<
div
>
{
state
===
0
?
<
a
-
tag
color
=
"red"
>
禁用
<
/a-tag> : <a-tag color="cyan">启用</
a
-
tag
>
}
<
/div
>
return
<
div
>
{
state
===
0
?
<
a
-
tag
color
=
"red"
>
禁用
<
/a-tag> : <a-tag color="cyan">启用</
a
-
tag
>
}
<
/div
>
}
}
// width: 150
// width: 150
},
},
...
@@ -313,11 +236,11 @@ export default {
...
@@ -313,11 +236,11 @@ export default {
title
:
'是否为菜单'
,
title
:
'是否为菜单'
,
width
:
'6%'
,
width
:
'6%'
,
dataIndex
:
'IS_MENU'
,
dataIndex
:
'IS_MENU'
,
customRender
:
(
text
)
=>
{
customRender
:
text
=>
{
if
(
Number
(
text
)
==
0
)
{
if
(
Number
(
text
)
==
0
)
{
return
"否"
return
'否'
}
else
{
}
else
{
return
"是"
return
'是'
}
}
}
}
},
},
...
@@ -325,11 +248,11 @@ export default {
...
@@ -325,11 +248,11 @@ export default {
title
:
'是否顶部菜单'
,
title
:
'是否顶部菜单'
,
width
:
'6%'
,
width
:
'6%'
,
dataIndex
:
'IS_TOP_MENU'
,
dataIndex
:
'IS_TOP_MENU'
,
customRender
:
(
text
)
=>
{
customRender
:
text
=>
{
if
(
Number
(
text
)
==
0
)
{
if
(
Number
(
text
)
==
0
)
{
return
"否"
return
'否'
}
else
{
}
else
{
return
"是"
return
'是'
}
}
}
}
},
},
...
@@ -337,11 +260,11 @@ export default {
...
@@ -337,11 +260,11 @@ export default {
title
:
'是否默认显示'
,
title
:
'是否默认显示'
,
width
:
'6%'
,
width
:
'6%'
,
dataIndex
:
'IS_DEFAULT_SHOW'
,
dataIndex
:
'IS_DEFAULT_SHOW'
,
customRender
:
(
text
)
=>
{
customRender
:
text
=>
{
if
(
Number
(
text
)
==
0
)
{
if
(
Number
(
text
)
==
0
)
{
return
"否"
return
'否'
}
else
{
}
else
{
return
"是"
return
'是'
}
}
}
}
// width: 150
// width: 150
...
@@ -349,43 +272,16 @@ export default {
...
@@ -349,43 +272,16 @@ export default {
{
{
title
:
'描述'
,
title
:
'描述'
,
width
:
'12%'
,
width
:
'12%'
,
dataIndex
:
'REMARK'
,
dataIndex
:
'REMARK'
// width: 90
// width: 90
},
},
// {
// title: '类型',
// dataIndex: 'type',
// customRender: (type, row, index) => {
// return (
//
<
div
>
// {type === 'D' ? (
//
<
a
-
tag
color
=
"blue"
>
目录
<
/a-tag
>
// ) : type === 'M' ? (
//
<
a
-
tag
color
=
"green"
>
菜单
<
/a-tag
>
// ) : (
//
<
a
-
tag
color
=
"volcano"
>
按钮
<
/a-tag
>
// )}
//
<
/div
>
// )
// }
// },
{
{
title
:
'排序'
,
title
:
'排序'
,
width
:
'5%'
,
width
:
'5%'
,
dataIndex
:
'SORT'
,
dataIndex
:
'SORT'
// width: 100
// width: 100
},
},
// {
{
// title: '类型',
//LEVEL:菜单层级等级(类型-0:项目,1:模块,2:操作,3:动作),
// dataIndex: 'LEVEL',
// width: '5%',
// // width: 100
// // customRender: (state, row, index) => {
// // return
<
div
>
{
state
===
0
?
<
a
-
tag
color
=
"cyan"
>
显示
<
/a-tag> : <a-tag color="red">隐藏</
a
-
tag
>
}
<
/div
>
// // }
// },
{
title
:
'类型'
,
title
:
'类型'
,
dataIndex
:
'LEVEL'
,
dataIndex
:
'LEVEL'
,
customRender
:
(
type
,
row
,
index
)
=>
{
customRender
:
(
type
,
row
,
index
)
=>
{
...
@@ -409,7 +305,7 @@ export default {
...
@@ -409,7 +305,7 @@ export default {
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
// fixed: 'right',
// fixed: 'right',
width
:
'15%'
,
width
:
'15%'
,
scopedSlots
:
{
customRender
:
'action'
}
scopedSlots
:
{
customRender
:
'action'
}
}
}
],
],
...
@@ -422,22 +318,28 @@ export default {
...
@@ -422,22 +318,28 @@ export default {
// res.page = res._meta.currentPage
// res.page = res._meta.currentPage
// res.totalPage = res._meta.pageCount
// res.totalPage = res._meta.pageCount
// res.totalCount = res._meta.totalCount
// res.totalCount = res._meta.totalCount
console
.
log
(
res
)
this
.
listData
=
[{
this
.
listData
=
res
ID
:
"0"
,
res
.
data
=
this
.
listData
TITLE
:
"主菜单"
,
return
res
PID
:
"0"
,
}];
this
.
listData
[
0
].
CHILDREN
=
res
;
console
.
log
(
this
.
listData
)
let
resdata
=
{}
resdata
.
data
=
res
return
resdata
})
})
},
},
selectedRowKeys
:
[],
//
selectedRowKeys: [],
selectedRows
:
[],
//
selectedRows: [],
// modalNow: 1,
// modalNow: 1,
// ICON:'',
// ICON:'',
// data: [],
// data: [],
//
modalTreeData: [],
modalTreeData
:
[],
// params: {},
// params: {},
//
modalParams: {
modalParams
:
{
// type: 'M
'
type
:
'0
'
//
},
},
// showMenuModal: false,
// showMenuModal: false,
// tableSelected: {},
// tableSelected: {},
editType
:
''
,
editType
:
''
,
...
@@ -445,62 +347,115 @@ export default {
...
@@ -445,62 +347,115 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
// onExpand(expandedKeys) {
// parentTreeSelect(value, node, extra) {
// this.expandedKeys = expandedKeys;
// this.parentTreeSelected = extra.selectedNodes[0].data.props
// this.autoExpandParent = false;
// },
// },
// initMenuParams() {
getMenuClick
(
value
){
// this.modalParams = {
this
.
showMenuModal
=
true
;
// pMenu: '',
if
(
value
==
1
){
// pid: '',
this
.
addoredit
=
1
;
// type: 'M',
this
.
modalTitle
=
'添加节点'
;
// permName: '',
}
else
{
// name: '',
this
.
addoredit
=
0
;
// path: '',
this
.
modalTitle
=
'编辑节点'
;
// component: '',
this
.
getMenuDetails
(
value
.
ID
)
// icon: ''
}
// }
},
// },
onChange
(
e
)
{
// checkTreeselect(value) {
const
value
=
e
.
target
.
value
;
// if (value == null || value == '') {
const
expandedKeys
=
dataList
// return '0'
.
map
(
item
=>
{
// } else {
if
(
item
.
key
.
indexOf
(
value
)
>
-
1
)
{
// return value.toString()
return
getParentKey
(
item
.
key
,
gData
);
// }
}
// },
return
null
;
addMenu
()
{
this
.
showMenuModal
=
true
this
.
addoredit
=
1
this
.
modalTitle
=
'添加节点'
var
formValue
=
{
NAME
:
''
,
TITLE
:
''
,
ICON
:
''
,
STATUS
:
''
,
IS_MENU
:
''
,
IS_TOP_MENU
:
''
,
IS_DEFAULT_SHOW
:
''
,
REMARK
:
''
,
SORT
:
''
,
LEVEL
:
''
,
PID
:
'0'
,
}
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
formValue
)
})
})
.
filter
((
item
,
i
,
self
)
=>
item
&&
self
.
indexOf
(
item
)
===
i
);
},
Object
.
assign
(
this
,
{
editMenu
(
id
)
{
expandedKeys
,
this
.
showMenuModal
=
true
searchValue
:
value
,
this
.
addoredit
=
0
autoExpandParent
:
true
,
this
.
modalTitle
=
'编辑节点'
});
this
.
getMenuDetails
(
id
)
},
},
// 获取节点详情
// onExpand(expandedKeys) {
getMenuDetails
(
value
){
// this.expandedKeys = expandedKeys;
getMenuDetails
(
value
).
then
(
res
=>
{
// this.autoExpandParent = false;
// this.$nextTick(() => {
// },
// this.modalForm.setFieldsValue(res)
// getMenuClick(value){
// })
// this.showMenuModal=true;
var
formValue
=
{
// if(value==1){
'NAME'
:
res
.
NAME
,
// this.addoredit=1;
'TITLE'
:
res
.
TITLE
,
// this.modalTitle='添加节点';
'ICON'
:
res
.
ICON
,
// }else{
'STATUS'
:
res
.
STATUS
,
// this.addoredit=0;
'IS_MENU'
:
res
.
IS_MENU
,
// this.modalTitle='编辑节点';
'IS_TOP_MENU'
:
res
.
IS_TOP_MENU
,
// this.getMenuDetails(value.ID)
'IS_DEFAULT_SHOW'
:
res
.
IS_DEFAULT_SHOW
,
// }
'REMARK'
:
res
.
REMARK
,
// },
'SORT'
:
res
.
SORT
,
onChange
(
e
)
{
'LEVEL'
:
res
.
LEVEL
,
const
value
=
e
.
target
.
value
}
const
expandedKeys
=
dataList
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
formValue
);})
.
map
(
item
=>
{
console
.
log
(
formValue
)
if
(
item
.
key
.
indexOf
(
value
)
>
-
1
)
{
}).
catch
(
err
=>
{
return
getParentKey
(
item
.
key
,
gData
)
}
return
null
})
.
filter
((
item
,
i
,
self
)
=>
item
&&
self
.
indexOf
(
item
)
===
i
)
Object
.
assign
(
this
,
{
expandedKeys
,
searchValue
:
value
,
autoExpandParent
:
true
})
})
},
},
makeMenuTypeSafe
(
rule
,
value
,
cb
)
{
// 获取节点详情
getMenuDetails
(
value
)
{
getMenuDetails
(
value
)
.
then
(
res
=>
{
// this.$nextTick(() => {
// this.modalForm.setFieldsValue(res)
// })
var
formValue
=
{
NAME
:
res
.
NAME
,
TITLE
:
res
.
TITLE
,
ICON
:
res
.
ICON
,
STATUS
:
res
.
STATUS
,
IS_MENU
:
res
.
IS_MENU
,
IS_TOP_MENU
:
res
.
IS_TOP_MENU
,
IS_DEFAULT_SHOW
:
res
.
IS_DEFAULT_SHOW
,
REMARK
:
res
.
REMARK
,
SORT
:
res
.
SORT
,
LEVEL
:
res
.
LEVEL
,
PID
:
res
.
PID
,
ID
:
res
.
ID
,
}
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
formValue
)
})
console
.
log
(
formValue
)
})
.
catch
(
err
=>
{})
},
makeMenuTypeSafe
(
rule
,
value
,
cb
)
{
var
parentType
=
'0'
var
parentType
=
'0'
// if (this.parentTreeSelected.type) {
// if (this.parentTreeSelected.type) {
// // 用户自己选择父菜单
// // 用户自己选择父菜单
...
@@ -519,8 +474,38 @@ export default {
...
@@ -519,8 +474,38 @@ export default {
}
}
cb
()
cb
()
},
},
}
// 提交
submit
(){
if
(
this
.
addoredit
==
1
){
console
.
log
(
this
)
const
{
form
:
{
validateFields
}
}
=
this
;
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
)
{
const
data
=
Object
.
assign
({
...
values
});
console
.
log
(
values
);
addAuthorityNode
(
data
).
then
(
res
=>
{
this
.
showMenuModal
=
false
;
this
.
$refs
.
table
.
refresh
(
true
)
}).
catch
(
err
=>
{
})
}
})
}
else
{
const
{
form
:
{
validateFields
}
}
=
this
;
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
)
{
const
data
=
Object
.
assign
({
...
values
});
updateAuthorityNode
(
data
).
then
(
res
=>
{
this
.
showMenuModal
=
false
;
this
.
$refs
.
table
.
refresh
(
true
)
}).
catch
(
err
=>
{
})
}
})
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
...
...
src/views/authority/test.vue
deleted
100644 → 0
View file @
26550823
<
template
>
<div>
<a-card
style=
"margin-bottom:10px"
>
<a-form
:form=
"newform"
layout=
"inline"
>
<a-row
:gutter=
"16"
type=
"flex"
justify=
"start"
>
<!--
<a-col
:span=
"6"
>
<a-form-item
label=
"名称:"
>
<a-input
type=
"text"
v-model=
"queryParam.TITLE"
>
</a-input>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"类型:"
>
<a-radio-group>
<a-radio-button
value=
"0"
>
显示
</a-radio-button>
<a-radio-button
value=
"1"
>
禁用
</a-radio-button>
</a-radio-group>
</a-form-item>
</a-col>
-->
<a-col
:span=
"6"
>
<a-form-item>
<a-input-search
style=
"margin-bottom: 8px"
placeholder=
"Search"
@
change=
"onChange"
/>
<!--
<a-button
type=
"primary"
icon=
"search"
@
click=
"$refs.table.refresh(true)"
>
查询
</a-button>
-->
</a-form-item>
</a-col>
</a-row>
</a-form>
<div
class=
"table-operator"
>
<a-button-group>
<a-button
type=
'primary'
icon=
'plus'
@
click=
"getMenuClick()"
>
添加节点
</a-button>
</a-button-group>
</div>
<s-table
style=
"margin-top:10px"
ref=
"table"
size=
"default"
rowKey=
"ID"
childrenColumnName =
"son"
:columns=
"columns"
:data=
"loadData"
:showPagination=
"pagination"
:rowSelection=
"rowSelection"
>
<!-- :scroll="
{ x: 1200, y: 300 }" -->
<span
slot=
"action"
slot-scope=
"text, record"
>
<template>
<a
@
click=
"getMenuClick(record.ID)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"remove(record.ID)"
>
<a>
删除
</a>
</a-popconfirm>
</
template
>
</span>
</s-table>
<a-modal
title=
"菜单"
v-model=
"showMenuModal"
:maskClosable=
"false"
@
ok=
"editMenu()"
>
<a-form
:form=
"form"
>
<!-- <a-tree
checkable
:replaceFields="modalTree.replaceFields"
:treeData="modalTree.treeData"
v-model="modalTree.checkedKeys"
>
</a-tree> -->
</a-form>
</a-modal>
</a-card>
<!--
<!-- <a-modal v-model="showMenuModal" title="菜单" :maskClosable="false" @ok="editMenu">
<a-form :form="form">
<a-form-item v-show="false">
<a-input type="hidden" v-decorator="['id']"></a-input>
</a-form-item>
<a-form-item v-show="false">
<a-input type="hidden" v-decorator="['pid']"></a-input>
</a-form-item>
<a-form-item label="名称:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="text" v-decorator="['name', { rules: [{ required: true, message: '请输入菜单名' }] }]">
</a-input>
</a-form-item>
<a-form-item label="父菜单:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-tree-select
style="width:100%"
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
:treeData="modalTreeData"
:treeDefaultExpandedKeys="expandedRowKeys"
treeNodeLabelProp="name"
treeNodeFilterProp="id"
@select="parentTreeSelect"
:disabled="modalParams.type == 'B' && editType == 'update'"
v-decorator="['pMenu', { rules: [{ required: false }] }]"
>
</a-tree-select>
</a-form-item>
<a-form-item label="路径:" v-show="modalParams.type != 'B'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input
type="text"
v-decorator="['path', { rules: [{ required: modalParams.type != 'B', message: '请输入菜单路径' }] }]"
>
</a-input>
</a-form-item>
<a-form-item label="组件:" v-show="modalParams.type == 'M'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input
type="text"
v-decorator="['component', { rules: [{ required: modalParams.type == 'M', message: '请输入菜单组件' }] }]"
>
</a-input>
</a-form-item>
<a-form-item label="权限标识:" v-show="modalParams.type != 'D'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input
type="text"
v-decorator="['permName']"
placeholder="权限标识"
/>
</a-form-item>
<a-form-item label="图标:" v-show="modalParams.type != 'B'" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="text" v-decorator="['icon']"> </a-input>
</a-form-item>
<a-form-item label="排序:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input type="number" v-decorator="['sort']"> </a-input>
</a-form-item>
<a-form-item label="类型:" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-radio-group
buttonStyle="solid"
:disabled="editType == 'update'"
v-model="modalParams.type"
v-decorator="[
'type',
{ rules: [{ required: true, message: '请选择菜单类型' }, { validator: makeMenuTypeSafe }] }
]"
>
<a-radio-button value="D">目录</a-radio-button>
<a-radio-button value="M">菜单</a-radio-button>
<a-radio-button value="B">按钮</a-radio-button>
</a-radio-group>
</a-form-item>
</a-form>
</a-modal> -->
</div>
</template>
<
script
>
// , addMenu, updateMenu, deleteMenu
import
moment
from
'moment'
import
{
STable
}
from
'@/components'
import
{
getMenuList
,
getMenuDetails
}
from
'@/api/authority'
const
rowSelection
=
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
console
.
log
(
`selectedRowKeys:
${
selectedRowKeys
}
`
,
'selectedRows: '
,
selectedRows
);
},
onSelect
:
(
record
,
selected
,
selectedRows
)
=>
{
console
.
log
(
record
,
selected
,
selectedRows
);
},
onSelectAll
:
(
selected
,
selectedRows
,
changeRows
)
=>
{
console
.
log
(
selected
,
selectedRows
,
changeRows
);
},
};
export
default
{
name
:
'authority'
,
components
:
{
STable
},
data
()
{
return
{
rowSelection
,
labelCol
:
{
xs
:
{
span
:
5
}
},
wrapperCol
:
{
xs
:
{
span
:
17
}
},
// 查询参数
queryParam
:
{},
form
:
this
.
$form
.
createForm
(
this
),
newform
:
this
.
$form
.
createForm
(
this
),
rowSelection
:
{
type
:
'radio'
,
selectedRowKeys
:
[]
},
showMenuModal
:
false
,
addoredit
:
1
,
//添加1or编辑0
columns
:
[
{
title
:
'菜单名称'
,
dataIndex
:
'TITLE'
,
// fixed: 'left',
// width: 200,
width
:
'20%'
,
scopedSlots
:
{
customRender
:
'TITLE'
},
customRender
:
(
value
,
row
,
index
)
=>
{
var
ret
=
[]
// 添加icon
if
(
row
.
ICON
)
{
ret
.
push
(
<
a
-
icon
type
=
{
row
.
ICON
}
style
=
"font-size:14px;padding-right:3px"
/>
)
}
else
{
ret
.
push
(
<
span
style
=
"padding-right:17px"
/>
)
}
return
(
<
span
>
{
ret
}
<
span
>
{
value
}
<
/span
>
<
/span
>
)
}
},
{
title
:
'节点id'
,
dataIndex
:
'ID'
,
width
:
'8%'
,
key
:
'ID'
,
},
{
title
:
'菜单地址'
,
dataIndex
:
'NAME'
,
width
:
'15%'
,
// width: 200
},
{
title
:
'菜单状态'
,
width
:
'8%'
,
dataIndex
:
'STATUS'
,
customRender
:
(
state
,
row
,
index
)
=>
{
return
<
div
>
{
state
===
0
?
<
a
-
tag
color
=
"red"
>
禁用
<
/a-tag> : <a-tag color="cyan">启用</
a
-
tag
>
}
<
/div
>
}
// width: 150
},
{
title
:
'是否为菜单'
,
width
:
'6%'
,
dataIndex
:
'IS_MENU'
,
customRender
:
(
text
)
=>
{
if
(
Number
(
text
)
==
0
){
return
"否"
}
else
{
return
"是"
}
}
},
{
title
:
'是否顶部菜单'
,
width
:
'6%'
,
dataIndex
:
'IS_TOP_MENU'
,
customRender
:
(
text
)
=>
{
if
(
Number
(
text
)
==
0
){
return
"否"
}
else
{
return
"是"
}
}
},
{
title
:
'是否默认显示'
,
width
:
'6%'
,
dataIndex
:
'IS_DEFAULT_SHOW'
,
customRender
:
(
text
)
=>
{
if
(
Number
(
text
)
==
0
){
return
"否"
}
else
{
return
"是"
}
}
// width: 150
},
{
title
:
'描述'
,
width
:
'12%'
,
dataIndex
:
'REMARK'
,
// width: 90
},
// {
// title: '类型',
// dataIndex: 'type',
// customRender: (type, row, index) => {
// return (
//
<
div
>
// {type === 'D' ? (
//
<
a
-
tag
color
=
"blue"
>
目录
<
/a-tag
>
// ) : type === 'M' ? (
//
<
a
-
tag
color
=
"green"
>
菜单
<
/a-tag
>
// ) : (
//
<
a
-
tag
color
=
"volcano"
>
按钮
<
/a-tag
>
// )}
//
<
/div
>
// )
// }
// },
{
title
:
'排序'
,
width
:
'5%'
,
dataIndex
:
'SORT'
,
// width: 100
},
// {
// title: '类型',
//LEVEL:菜单层级等级(类型-0:项目,1:模块,2:操作,3:动作),
// dataIndex: 'LEVEL',
// width: '5%',
// // width: 100
// // customRender: (state, row, index) => {
// // return
<
div
>
{
state
===
0
?
<
a
-
tag
color
=
"cyan"
>
显示
<
/a-tag> : <a-tag color="red">隐藏</
a
-
tag
>
}
<
/div
>
// // }
// },
{
title
:
'类型'
,
dataIndex
:
'LEVEL'
,
customRender
:
(
type
,
row
,
index
)
=>
{
return
(
<
div
>
{
type
===
'0'
?
(
<
a
-
tag
color
=
"blue"
>
项目
<
/a-tag
>
)
:
type
===
'1'
?
(
<
a
-
tag
color
=
"green"
>
模块
<
/a-tag
>
)
:
type
===
'2'
?
(
<
a
-
tag
color
=
"red"
>
操作
<
/a-tag
>
)
:
(
<
a
-
tag
color
=
"volcano"
>
操作
<
/a-tag
>
)}
<
/div
>
)
}
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
// fixed: 'right',
width
:
'15%'
,
scopedSlots
:
{
customRender
:
'action'
}
}
],
listData
:
[],
pagination
:
false
,
// 加载数据方法 必须为 Promise 对象
loadData
:
parameter
=>
{
return
getMenuList
().
then
(
res
=>
{
// res.pageSize = res._meta.perPage
// res.page = res._meta.currentPage
// res.totalPage = res._meta.pageCount
// res.totalCount = res._meta.totalCount
console
.
log
(
res
)
this
.
listData
=
res
res
.
data
=
this
.
listData
return
res
})
},
selectedRowKeys
:
[],
selectedRows
:
[],
// modalNow: 1,
// ICON:'',
// data: [],
// modalTreeData: [],
// params: {},
// modalParams: {
// type: 'M'
// },
// showMenuModal: false,
// tableSelected: {},
// editType: '',
// expandedRowKeys: []
}
},
methods
:
{
// onExpand(expandedKeys) {
// this.expandedKeys = expandedKeys;
// this.autoExpandParent = false;
// },
onChange
(
e
)
{
const
value
=
e
.
target
.
value
;
const
expandedKeys
=
dataList
.
map
(
item
=>
{
if
(
item
.
key
.
indexOf
(
value
)
>
-
1
)
{
return
getParentKey
(
item
.
key
,
gData
);
}
return
null
;
})
.
filter
((
item
,
i
,
self
)
=>
item
&&
self
.
indexOf
(
item
)
===
i
);
Object
.
assign
(
this
,
{
expandedKeys
,
searchValue
:
value
,
autoExpandParent
:
true
,
});
},
getMenuClick
(
ID
=
""
){
this
.
visible
=
true
;
if
(
ID
){
this
.
addoredit
=
1
;
this
.
modalTitle
=
'添加节点'
;
}
else
{
this
.
addoredit
=
0
;
this
.
modalTitle
=
'编辑节点'
;
this
.
getMenuDetails
(
value
.
ID
)
}
},
}
}
</
script
>
<
style
>
.ant-card-body
{
padding
:
10px
;
}
.ant-card-wider-padding
.ant-card-body
{
padding
:
10px
;
}
.ant-table-tbody
>
tr
>
td
{
padding
:
10px
10px
;
}
</
style
>
src/views/delivery/distributionManage.vue
View file @
a96bb8db
...
@@ -15,12 +15,12 @@
...
@@ -15,12 +15,12 @@
:data=
"loadData"
:data=
"loadData"
:showPagination=
"pagination"
:showPagination=
"pagination"
>
>
<span
slot=
"switchAction"
slot-scope=
""
>
<span
slot=
"switchAction"
slot-scope=
"
text, record
"
>
<template>
<template>
<a-row
type=
"flex"
justify=
"start"
align=
"middle"
>
<a-row
type=
"flex"
justify=
"start"
align=
"middle"
>
<a-col><a-switch
checkedChildren=
"开"
unCheckedChildren=
"关"
defaultChecked
/></a-col>
<a-col><a-switch
@
change=
"changeState($event,record.GUID,'1')"
:defaultChecked=
"stateValue(record.POINTS_STATE)"
checkedChildren=
"开"
unCheckedChildren=
"关"
/></a-col>
<a-col><a-divider
type=
"vertical"
/></a-col>
<a-col><a-divider
type=
"vertical"
/></a-col>
<a-col><a-switch
checkedChildren=
"开"
unCheckedChildren=
"关"
defaultChecked
/></a-col>
<a-col><a-switch
@
change=
"changeState($event,record.GUID,'2')"
:defaultChecked=
"stateValue(record.STATE)"
checkedChildren=
"开"
unCheckedChildren=
"关"
/></a-col>
</a-row>
</a-row>
</
template
>
</
template
>
</span>
</span>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
// , addMenu, updateMenu, deleteMenu
// , addMenu, updateMenu, deleteMenu
import
moment
from
'moment'
import
moment
from
'moment'
import
{
STable
}
from
'@/components'
import
{
STable
}
from
'@/components'
import
{
getTransportList
}
from
'@/api/delivery'
import
{
getTransportList
,
transportMakeUse
}
from
'@/api/delivery'
export
default
{
export
default
{
name
:
'delivery'
,
name
:
'delivery'
,
components
:
{
components
:
{
...
@@ -114,6 +114,24 @@ export default {
...
@@ -114,6 +114,24 @@ export default {
}
}
},
},
stateValue
(
value
){
if
(
value
==
'1'
){
return
true
;
}
else
{
return
false
;
}
},
changeState
(
e
,
guid
,
type
){
let
number
=
e
?
'1'
:
'0'
;
let
data
=
{
'GUID'
:
guid
,
'TYPE'
:
type
,
'NUMBER'
:
number
,
}
transportMakeUse
(
data
).
then
(
res
=>
{
console
.
log
(
res
)
})
}
}
}
}
}
</
script
>
</
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