Browse Source

微信菜单修改

master
hupeng 5 years ago
parent
commit
733e3d9b13
  1. 31
      src/api/YxWechatMenu.js
  2. 8
      src/api/yxCache.js
  3. 2
      src/views/wechat/menu/form.vue
  4. 12
      src/views/wechat/menu/index-bak.vue
  5. 4
      src/views/wechat/menu/index.vue

31
src/api/YxWechatMenu.js

@ -0,0 +1,31 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/YxWechatMenu',
method: 'post',
data
})
}
export function del(key) {
return request({
url: 'api/YxWechatMenu/' + key,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/YxWechatMenu',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/YxWechatMenu',
method: 'get'
})
}

8
src/api/yxCache.js

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function add(data) { export function add(data) {
return request({ return request({
url: 'api/yxCache', url: 'api/YxWechatMenu',
method: 'post', method: 'post',
data data
}) })
@ -10,14 +10,14 @@ export function add(data) {
export function del(key) { export function del(key) {
return request({ return request({
url: 'api/yxCache/' + key, url: 'api/YxWechatMenu/' + key,
method: 'delete' method: 'delete'
}) })
} }
export function edit(data) { export function edit(data) {
return request({ return request({
url: 'api/yxCache', url: 'api/YxWechatMenu',
method: 'put', method: 'put',
data data
}) })
@ -25,7 +25,7 @@ export function edit(data) {
export function get() { export function get() {
return request({ return request({
url: 'api/yxCache', url: 'api/YxWechatMenu',
method: 'get' method: 'get'
}) })
} }

2
src/views/wechat/menu/form.vue

@ -16,7 +16,7 @@
</template> </template>
<script> <script>
import { add, edit } from '@/api/yxCache' import { add, edit } from '@/api/YxWechatMenu'
export default { export default {
props: { props: {
isAdd: { isAdd: {

12
src/views/wechat/menu/index-bak.vue

@ -5,7 +5,7 @@
<!-- 新增 --> <!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;"> <div style="display: inline-block;margin: 0px 2px;">
<el-button <el-button
v-permission="['admin','YXCACHE_ALL','YXCACHE_CREATE']" v-permission="['admin','YxWechatMenu_ALL','YxWechatMenu_CREATE']"
class="filter-item" class="filter-item"
size="mini" size="mini"
type="primary" type="primary"
@ -21,12 +21,12 @@
<el-table-column prop="key" label="key" /> <el-table-column prop="key" label="key" />
<el-table-column prop="result" label="缓存数据" /> <el-table-column prop="result" label="缓存数据" />
<el-table-column prop="addTime" label="缓存时间" /> <el-table-column prop="addTime" label="缓存时间" />
<el-table-column v-if="checkPermission(['admin','YXCACHE_ALL','YXCACHE_EDIT','YXCACHE_DELETE'])" label="操作" width="150px" align="center"> <el-table-column v-if="checkPermission(['admin','YxWechatMenu_ALL','YxWechatMenu_EDIT','YxWechatMenu_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-permission="['admin','YXCACHE_ALL','YXCACHE_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" /> <el-button v-permission="['admin','YxWechatMenu_ALL','YxWechatMenu_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover <el-popover
:ref="scope.row.key" :ref="scope.row.key"
v-permission="['admin','YXCACHE_ALL','YXCACHE_DELETE']" v-permission="['admin','YxWechatMenu_ALL','YxWechatMenu_DELETE']"
placement="top" placement="top"
width="180" width="180"
> >
@ -55,7 +55,7 @@
<script> <script>
import checkPermission from '@/utils/permission' import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud' import initData from '@/mixins/crud'
import { del } from '@/api/yxCache' import { del } from '@/api/YxWechatMenu'
import eForm from './form' import eForm from './form'
export default { export default {
components: { eForm }, components: { eForm },
@ -73,7 +73,7 @@ export default {
methods: { methods: {
checkPermission, checkPermission,
beforeInit() { beforeInit() {
this.url = 'api/yxCache' this.url = 'api/YxWechatMenu'
const sort = 'key,desc' const sort = 'key,desc'
this.params = { page: this.page, size: this.size, sort: sort } this.params = { page: this.page, size: this.size, sort: sort }
return true return true

4
src/views/wechat/menu/index.vue

@ -103,7 +103,7 @@
<script> <script>
import checkPermission from '@/utils/permission' import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud' import initData from '@/mixins/crud'
import { del, add, get } from '@/api/yxCache' import { del, add, get } from '@/api/YxWechatMenu'
import eForm from './form' import eForm from './form'
import { Message } from 'element-ui' import { Message } from 'element-ui'
export default { export default {
@ -129,7 +129,7 @@ export default {
methods: { methods: {
checkPermission, checkPermission,
beforeInit() { beforeInit() {
this.url = 'api/yxCache' this.url = 'api/YxWechatMenu'
const sort = 'key,desc' const sort = 'key,desc'
this.params = { page: this.page, size: this.size, sort: sort } this.params = { page: this.page, size: this.size, sort: sort }
return true return true

Loading…
Cancel
Save