diff --git a/src/utils/Url.ts b/src/utils/Url.ts index c942176..d32fdcf 100644 --- a/src/utils/Url.ts +++ b/src/utils/Url.ts @@ -13,6 +13,7 @@ export default class Url { static readonly SHOW_MENU : string = "show-menu/%d"; static readonly ALLOT_NODE_GROUP : string = "allot-node-group/%d"; static readonly ALLOT_MENU : string = "allot-menu/%d"; + static readonly UPDATE_NICKNAME : string = "update-nickname"; // TODO 菜单 static readonly MENUS : string = "menu"; @@ -42,6 +43,7 @@ export default class Url { static readonly DELETE_APPLY : string = "apply/%d"; static readonly APPLY_PASS : string = "apply/pass/%d"; static readonly APPLY_NO_PASS : string = "apply/no-pass/%d"; + static readonly EXECUTE_APPLY : string = "apply/execute/%d"; } diff --git a/src/views/home/Common/Types.ts b/src/views/home/Common/Types.ts index bc2509c..14de89f 100644 --- a/src/views/home/Common/Types.ts +++ b/src/views/home/Common/Types.ts @@ -28,6 +28,16 @@ export interface NodeGroupInterface{ name ?: string; } +export interface ApplyInterface{ + id : number; + item_id : number; + reason : string; + send_account : string; + state : number; + unikey : string; + execute_state ?: number; +} + export interface ElTreeDataInterface { id : number; label : string; diff --git a/src/views/home/pages/apply/apply.ts b/src/views/home/pages/apply/apply.ts index 8adcd47..014fe84 100644 --- a/src/views/home/pages/apply/apply.ts +++ b/src/views/home/pages/apply/apply.ts @@ -35,6 +35,9 @@ export default class Apply extends HomeParent { public showApplyDialog:boolean = false; public DataDetail:any=[]; public columns: TableColumn[] = [{ + title: "unikey", + key: "unikey" + },{ title: "申请者", key: "creator_account" }, { diff --git a/src/views/home/pages/audit/audit.ts b/src/views/home/pages/audit/audit.ts index b06799f..55535f3 100644 --- a/src/views/home/pages/audit/audit.ts +++ b/src/views/home/pages/audit/audit.ts @@ -24,7 +24,10 @@ export default class Audit extends HomeParent { public Data = [] public showApplyDialog:boolean = false; public DataDetail:any=[]; - public columns: TableColumn[] = [ { + public columns: TableColumn[] = [{ + title: "unikey", + key: "unikey" + }, { title: "申请者", key: "creator_account" }, { diff --git a/src/views/home/pages/execute/execute.ts b/src/views/home/pages/execute/execute.ts index 1281e1b..587c9b1 100644 --- a/src/views/home/pages/execute/execute.ts +++ b/src/views/home/pages/execute/execute.ts @@ -7,7 +7,7 @@ import { Mutation } from "vuex-class"; import HomeParent from "@/views/home/Common/HomeParent"; -import { ElTreeDataInterface, } from "@/views/home/Common/Types"; +import { ElTreeDataInterface, ApplyInterface } from "@/views/home/Common/Types"; import CustomPage from "@/components/page.vue"; import {Form, TableColumn} from "view-design"; import {Message, Tree} from "element-ui"; @@ -21,10 +21,13 @@ import {Request} from "@/utils/Request"; export default class Execute extends HomeParent { name: string = "execute"; - public Data = [] + public Data:ApplyInterface[] = [] public showApplyDialog:boolean = false; public DataDetail:any=[]; public columns: TableColumn[] = [ { + title: "unikey", + key: "unikey" + },{ title: "申请者", key: "creator_account" }, { @@ -40,9 +43,13 @@ export default class Execute extends HomeParent { title: "审核时间", key: "audit_time" }, { - title: "状态", + title: "审核状态", slot: "state", align: 'center', + }, { + title: "执行状态", + slot: "execute_state", + align: 'center', }, { title: "操作", slot: "operation", @@ -90,7 +97,19 @@ export default class Execute extends HomeParent { } public execute(row){ - + if (row.execute_state){ + this.error('无法再次执行') + return + } + let url : string = this.$sprintf(Url.EXECUTE_APPLY, row.id); + Request('get', url).then((res:any)=>{ + if (res.code == 200){ + this._getData(); + this.success() + }else { + this.error(res.message) + } + }) } private async _getData() { diff --git a/src/views/home/pages/execute/execute.vue b/src/views/home/pages/execute/execute.vue index 29153a9..acee979 100644 --- a/src/views/home/pages/execute/execute.vue +++ b/src/views/home/pages/execute/execute.vue @@ -9,6 +9,14 @@ 未通过 + + + 执行中... + 执行成功 + 执行失败 + 未执行 + + diff --git a/src/views/home/pages/layout/layout.ts b/src/views/home/pages/layout/layout.ts index 21d5e2f..98c8fce 100644 --- a/src/views/home/pages/layout/layout.ts +++ b/src/views/home/pages/layout/layout.ts @@ -68,9 +68,41 @@ export default class Layout extends HomeParent { }) } } - public async updateName(){ - const res:any = await Request('get','home') - // console.log(res) + public updateName(){ + let self = this; + this.$Modal.confirm({ + title:"修改昵称", + render: function(h) { + return h('Input', { + props: { + value: self.$store.getters.user.name, + autofocus: true, + placeholder: 'Please enter your name...' + }, + on: { + input: (val) => { + this.value = val; + } + } + }) + }, + onOk :function() { + self.onVisibleChange(true) + if (!this.value || this.value == self.$store.getters.user.name || this.value == '') { + return; + } + let data = {nickname:this.value}; + Request('get', Url.UPDATE_NICKNAME,data).then((res:any)=>{ + if (res.code == 200){ + self.success() + }else { + self.error(res.message) + } + }) + } + }) + + } @@ -93,23 +125,6 @@ export default class Layout extends HomeParent { private _getMyMenu() { - // this.myMenus = [ - // {id:1,name:'用户管理',url:'/user',children:[ - // {id:2,name:'用户',url:'/user',children:[]}, - // {id:3,name:'权限',url:'/node',children:[]}, - // {id:4,name:'权限组',url:'/node-group',children:[]}, - // {id:5,name:'菜单',url:'/menu',children:[]}, - // ]}, - // {id:6,name:'metamask',url:'/table',children:[ - // {id:7,name:'nft',url:'/nft',children:[]}, - // {id:8,name:'mint',url:'/mint',children:[]}, - // ]}, - // {id:9,name:'CEBG',url:'/table',children:[ - // {id:10,name:'apply',url:'/apply',children:[]}, - // {id:11,name:'audit',url:'/audit',children:[]}, - // {id:12,name:'execute',url:'/execute',children:[]}, - // ]} - // ] Request('get', Url.MY_MENU).then((res:any)=>{ if (res.code == 200){ this.myMenus = this._parseTreeData(res.data); diff --git a/src/views/home/pages/user/user.ts b/src/views/home/pages/user/user.ts index 1dbc8ed..be0c66c 100644 --- a/src/views/home/pages/user/user.ts +++ b/src/views/home/pages/user/user.ts @@ -153,54 +153,11 @@ export default class Users extends HomeParent { }) } - - - public modalClose () { this.checkMenuDefault = [] this.checkNodeDefault = [] } - public enabledUser(row : UserInterface) : void { - this._saveUser(row); - } - - public disableUser(row : UserInterface) : void { - this.$Modal.confirm({ - title : "禁用", - content : "确认要删禁用该用户吗?", - loading : true, - onOk : () => { - this.$Modal.remove(); - if (row.id === this.UserInfo.id) { - this.error("不能禁用自己"); - return; - } - this._saveUser(row); - } - }) - - } - - - - - private _saveUser(user : UserInterface) { - // let url : string = this.$sprintf(Url.DISABLE_USER, user.id); - // let method : Function = this.$http.delete; - // if (user.deleted_at) { - // url = this.$sprintf(Url.ENABLE_USER, user.id); - // method = this.$http.get; - // } - // method.call(this.$http, url).then(res => { - // this.success(); - // this._getData(); - // this.stopLoading(); - // }).catch(msg => { - // this.error(msg); - // this.stopLoading(); - // }) - } private async _getData() { const res:any = await Request('get', Url.USER,this.search) diff --git a/src/views/home/pages/user/user.vue b/src/views/home/pages/user/user.vue index 0d45d1a..1e50beb 100644 --- a/src/views/home/pages/user/user.vue +++ b/src/views/home/pages/user/user.vue @@ -8,8 +8,6 @@ :total="total" :columns="columns"> - - 权限 菜单