Commit 05842014 authored by 萌萌哒SAKURA酱's avatar 萌萌哒SAKURA酱

Merge branch 'leng_dev' of https://gitee.ltd/pigx/pigx-ui into sakura_dev

parents e8933196 ebdf00cd
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
<template> <template>
<div id="app"> <div id="app">
<router-view /> <router-view/>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'app', name: 'app',
data () { data() {
return {} return {}
}, },
watch: {}, watch: {},
created () { }, created() {
},
methods: {}, methods: {},
computed: {} computed: {}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
#app { #app {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
</style> </style>
...@@ -32,7 +32,7 @@ export function delObj(id) { ...@@ -32,7 +32,7 @@ export function delObj(id) {
}) })
} }
export function status(id,type) { export function status(id, type) {
return request({ return request({
url: '/act/process/status/' + id + "/" + type, url: '/act/process/status/' + id + "/" + type,
method: 'put' method: 'put'
......
...@@ -27,14 +27,14 @@ export function fetchList(query) { ...@@ -27,14 +27,14 @@ export function fetchList(query) {
export function fetchDetail(id) { export function fetchDetail(id) {
return request({ return request({
url: '/act/task/'+id, url: '/act/task/' + id,
method: 'get' method: 'get'
}) })
} }
export function fetchComment(id) { export function fetchComment(id) {
return request({ return request({
url: '/act/task/comment/'+id, url: '/act/task/comment/' + id,
method: 'get' method: 'get'
}) })
} }
......
...@@ -16,12 +16,14 @@ ...@@ -16,12 +16,14 @@
*/ */
import request from '@/router/axios' import request from '@/router/axios'
export function GetMenu() { export function GetMenu() {
return request({ return request({
url: '/admin/menu', url: '/admin/menu',
method: 'get' method: 'get'
}) })
} }
export function fetchTree(query) { export function fetchTree(query) {
return request({ return request({
url: '/admin/menu/tree', url: '/admin/menu/tree',
......
...@@ -24,6 +24,7 @@ export function fetchList(query) { ...@@ -24,6 +24,7 @@ export function fetchList(query) {
params: query params: query
}) })
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/route', url: '/admin/route',
......
...@@ -26,16 +26,22 @@ export function fetchList(query) { ...@@ -26,16 +26,22 @@ export function fetchList(query) {
} }
export function handleDown(table) { export function handleDown(table) {
request({ return request({
url: '/gen/generator/code', url: '/gen/generator/code',
method: 'post', method: 'post',
data: table, data: table,
responseType: 'arraybuffer' responseType: 'arraybuffer'
}).then((response) => { // 处理返回的文件流 }).then((response) => { // 处理返回的文件流
let blob = new Blob([response.data], { type: 'application/zip' } ) let blob = new Blob([response.data], {type: 'application/zip'})
let link = document.createElement('a') let filename = table.tableName + '.zip'
link.href = window.URL.createObjectURL(blob) let link = document.createElement('a');
link.download = table.tableName + '.zip' link.href = URL.createObjectURL(blob);
link.click() link.download = filename;
document.body.appendChild(link);
link.click();
window.setTimeout(function () {
URL.revokeObjectURL(blob);
document.body.removeChild(link);
}, 0);
}) })
} }
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* Author: lengleng (wangiegie@gmail.com) * Author: lengleng (wangiegie@gmail.com)
*/ */
import request from '@/router/axios' import request from '@/router/axios'
export const loginByUsername = (username, password, code, randomStr) => { export const loginByUsername = (username, password, code, randomStr) => {
var grant_type = 'password' var grant_type = 'password'
var scope = 'server' var scope = 'server'
...@@ -25,7 +26,7 @@ export const loginByUsername = (username, password, code, randomStr) => { ...@@ -25,7 +26,7 @@ export const loginByUsername = (username, password, code, randomStr) => {
'Authorization': 'Basic cGlnOnBpZw==' 'Authorization': 'Basic cGlnOnBpZw=='
}, },
method: 'post', method: 'post',
params: { username, password, randomStr, code, grant_type, scope } params: {username, password, randomStr, code, grant_type, scope}
}) })
} }
...@@ -38,7 +39,7 @@ export const loginByMobile = (mobile, code) => { ...@@ -38,7 +39,7 @@ export const loginByMobile = (mobile, code) => {
'Authorization': 'Basic cGlnOnBpZw==' 'Authorization': 'Basic cGlnOnBpZw=='
}, },
method: 'post', method: 'post',
params: { mobile: 'SMS@' + mobile,code: code, grant_type } params: {mobile: 'SMS@' + mobile, code: code, grant_type}
}) })
} }
...@@ -51,7 +52,7 @@ export const loginBySocial = (state, code) => { ...@@ -51,7 +52,7 @@ export const loginBySocial = (state, code) => {
'Authorization': 'Basic cGlnOnBpZw==' 'Authorization': 'Basic cGlnOnBpZw=='
}, },
method: 'post', method: 'post',
params: { mobile: state + '@' + code, grant_type } params: {mobile: state + '@' + code, grant_type}
}) })
} }
......
...@@ -25,7 +25,7 @@ export const tableOption = { ...@@ -25,7 +25,7 @@ export const tableOption = {
align: 'center', align: 'center',
editBtn: false, editBtn: false,
delBtn: false, delBtn: false,
menuType:'menu', menuType: 'menu',
searchShow: false, searchShow: false,
labelWidth: 120, labelWidth: 120,
column: [{ column: [{
...@@ -46,6 +46,13 @@ export const tableOption = { ...@@ -46,6 +46,13 @@ export const tableOption = {
}, { }, {
label: '模型名称', label: '模型名称',
prop: 'name' prop: 'name'
},
{
label: '描述',
prop: 'desc',
hide: true,
editDisabled: false,
addVisdiplay: true
}, { }, {
label: '版本号', label: '版本号',
prop: 'version', prop: 'version',
......
...@@ -25,7 +25,7 @@ export const tableOption = { ...@@ -25,7 +25,7 @@ export const tableOption = {
'editBtn': false, 'editBtn': false,
'delBtn': false, 'delBtn': false,
'addBtn': false, 'addBtn': false,
menuType:'menu', menuType: 'menu',
'dicUrl': '/admin/dict/type/leave_status', 'dicUrl': '/admin/dict/type/leave_status',
'column': [ 'column': [
{ {
...@@ -49,7 +49,7 @@ export const tableOption = { ...@@ -49,7 +49,7 @@ export const tableOption = {
label: '请假时间', label: '请假时间',
prop: 'leaveTime', prop: 'leaveTime',
type: 'datetime', type: 'datetime',
overHidden:true, overHidden: true,
format: 'yyyy-MM-dd HH:mm', format: 'yyyy-MM-dd HH:mm',
valueFormat: "yyyy-MM-dd hh:mm:ss" valueFormat: "yyyy-MM-dd hh:mm:ss"
}, },
...@@ -57,7 +57,7 @@ export const tableOption = { ...@@ -57,7 +57,7 @@ export const tableOption = {
label: '提交时间', label: '提交时间',
prop: 'createTime', prop: 'createTime',
type: 'datetime', type: 'datetime',
overHidden:true, overHidden: true,
format: 'yyyy-MM-dd HH:mm', format: 'yyyy-MM-dd HH:mm',
editDisabled: true, editDisabled: true,
addVisdiplay: false, addVisdiplay: false,
...@@ -74,11 +74,11 @@ export const tableOption = { ...@@ -74,11 +74,11 @@ export const tableOption = {
{ {
label: '备注', label: '备注',
prop: 'content', prop: 'content',
type:'textarea', type: 'textarea',
overHidden:true, overHidden: true,
minRows:2, minRows: 2,
row:true, row: true,
span:24 span: 24
} }
] ]
} }
...@@ -26,7 +26,7 @@ export const tableOption = { ...@@ -26,7 +26,7 @@ export const tableOption = {
addBtn: false, addBtn: false,
editBtn: false, editBtn: false,
delBtn: false, delBtn: false,
menuType:'menu', menuType: 'menu',
searchShow: false, searchShow: false,
column: [{ column: [{
fixed: true, fixed: true,
......
...@@ -50,8 +50,8 @@ export const tableOption = { ...@@ -50,8 +50,8 @@ export const tableOption = {
export const formOption = { export const formOption = {
submitBtn: false, submitBtn: false,
emptytBtn: false, emptytBtn: false,
row:true, row: true,
span:12, span: 12,
column: [ column: [
{ {
label: "任务编号", label: "任务编号",
...@@ -90,19 +90,19 @@ export const formOption = { ...@@ -90,19 +90,19 @@ export const formOption = {
{ {
label: '事由', label: '事由',
prop: 'content', prop: 'content',
type:'textarea', type: 'textarea',
minRows:2, minRows: 2,
row:true, row: true,
span:24, span: 24,
disabled: true disabled: true
}, },
{ {
label: '批注', label: '批注',
prop: 'comment', prop: 'comment',
type:'textarea', type: 'textarea',
minRows:2, minRows: 2,
row:true, row: true,
span:24, span: 24,
rules: [{ rules: [{
required: true, required: true,
message: "请输入备注", message: "请输入备注",
...@@ -113,25 +113,25 @@ export const formOption = { ...@@ -113,25 +113,25 @@ export const formOption = {
} }
export const taskOption = { export const taskOption = {
menu:false, menu: false,
page:false, page: false,
addBtn:false, addBtn: false,
align:'center', align: 'center',
menuAlign:'center', menuAlign: 'center',
column:[ column: [
{ {
label:'id', label: 'id',
prop:'id', prop: 'id',
hide: true hide: true
}, },
{ {
label:'用户', label: '用户',
prop:'userId' prop: 'userId'
}, },
{ {
label:'批注', label: '批注',
prop:'fullMessage' prop: 'fullMessage'
},{ }, {
label: "操作时间", label: "操作时间",
prop: "time", prop: "time",
type: "datetime", type: "datetime",
......
...@@ -25,16 +25,17 @@ const DIC = { ...@@ -25,16 +25,17 @@ const DIC = {
}] }]
} }
export const tableOption = { export const tableOption = {
'border': true, border: true,
'index': true, index: true,
'indexLabel': '序号', indexLabel: '序号',
'stripe': true, stripe: true,
'menuAlign': 'center', menuAlign: 'center',
'align': 'center', align: 'center',
'editBtn': false, editBtn: false,
'delBtn': false, delBtn: false,
'dic': [], viewBtn: true,
'column': [{ dic: [],
column: [{
width: 150, width: 150,
label: '编号', label: '编号',
prop: 'clientId', prop: 'clientId',
...@@ -46,11 +47,12 @@ export const tableOption = { ...@@ -46,11 +47,12 @@ export const tableOption = {
trigger: 'blur' trigger: 'blur'
}] }]
}, { }, {
width: 300,
label: '密钥', label: '密钥',
prop: 'clientSecret', prop: 'clientSecret',
align: 'center', align: 'center',
sortable: true, sortable: true,
overHidden: true,
width: 120,
rules: [{ rules: [{
required: true, required: true,
message: '请输入clientSecret', message: '请输入clientSecret',
...@@ -71,7 +73,7 @@ export const tableOption = { ...@@ -71,7 +73,7 @@ export const tableOption = {
prop: 'authorizedGrantTypes', prop: 'authorizedGrantTypes',
align: 'center', align: 'center',
width: 150, width: 150,
hide: true, overHidden: true,
rules: [{ rules: [{
required: true, required: true,
message: '请输入授权模式', message: '请输入授权模式',
...@@ -90,22 +92,20 @@ export const tableOption = { ...@@ -90,22 +92,20 @@ export const tableOption = {
width: 150, width: 150,
hide: true hide: true
}, { }, {
label: '请求令牌', label: '令牌时效',
prop: 'accessTokenValidity', prop: 'accessTokenValidity',
align: 'center', align: 'center',
width: 150, width: 80
hide: true
}, { }, {
label: '刷新令牌', label: '刷新时效',
prop: 'refreshTokenValidity', prop: 'refreshTokenValidity',
align: 'center', align: 'center',
width: 150, width: 80
hide: true
}, { }, {
label: '扩展信息', label: '扩展信息',
prop: 'additionalInformation', prop: 'additionalInformation',
align: 'center', align: 'center',
width: 150, width: 80,
hide: true hide: true
}, { }, {
label: '自动放行', label: '自动放行',
...@@ -113,7 +113,7 @@ export const tableOption = { ...@@ -113,7 +113,7 @@ export const tableOption = {
align: 'center', align: 'center',
type: 'radio', type: 'radio',
dicData: DIC.vaild, dicData: DIC.vaild,
width: 150, width: 80,
rules: [{ rules: [{
required: true, required: true,
message: '请选择是否放行', message: '请选择是否放行',
...@@ -123,6 +123,7 @@ export const tableOption = { ...@@ -123,6 +123,7 @@ export const tableOption = {
label: '资源ID', label: '资源ID',
prop: 'resourceIds', prop: 'resourceIds',
align: 'center', align: 'center',
hide: true,
width: 150 width: 150
}] }]
} }
...@@ -15,32 +15,33 @@ ...@@ -15,32 +15,33 @@
* Author: lengleng (wangiegie@gmail.com) * Author: lengleng (wangiegie@gmail.com)
*/ */
export const tableOption = { export const tableOption = {
'border': true, border: true,
'index': true, index: true,
'indexLabel': '序号', indexLabel: '序号',
'stripe': true, stripe: true,
'menuAlign': 'center', menuAlign: 'center',
'menuWidth': 150, menuWidth: 150,
'align': 'center', align: 'center',
'refreshBtn': true, refreshBtn: true,
'showClomnuBtn': false, showClomnuBtn: false,
'searchSize': 'mini', searchSize: 'mini',
'addBtn': false, addBtn: false,
'editBtn': false, editBtn: false,
'delBtn': false, delBtn: false,
'dicUrl': '/admin/dict/type/log_type', viewBtn: true,
dicUrl: '/admin/dict/type/log_type',
props: { props: {
label: 'label', label: 'label',
value: 'value' value: 'value'
}, },
'column': [{ column: [{
label: '类型', label: '类型',
prop: 'type', prop: 'type',
type: 'select', type: 'select',
dicData: 'log_type', dicData: 'log_type',
search: true search: true
}, { }, {
label: '请求接口名称', label: '标题',
prop: 'title' prop: 'title'
}, { }, {
label: 'IP地址', label: 'IP地址',
...@@ -52,9 +53,11 @@ export const tableOption = { ...@@ -52,9 +53,11 @@ export const tableOption = {
label: '客户端', label: '客户端',
prop: 'serviceId' prop: 'serviceId'
}, { }, {
width: 80,
label: '请求时间', label: '请求时间',
prop: 'time' prop: 'time'
}, { }, {
width: 150,
label: '创建时间', label: '创建时间',
prop: 'createTime', prop: 'createTime',
type: 'datetime', type: 'datetime',
......
...@@ -16,16 +16,17 @@ ...@@ -16,16 +16,17 @@
*/ */
export const tableOption = { export const tableOption = {
"border": true, border: true,
"index": true, index: true,
"stripe": true, stripe: true,
"menuAlign": "center", menuAlign: "center",
"align": "center", align: "center",
"editBtn": false, editBtn: false,
"delBtn": false, delBtn: false,
"addBtn": false, addBtn: false,
'dicUrl': '/admin/dict/type/social_type', viewBtn: true,
"column": [{ dicUrl: '/admin/dict/type/social_type',
column: [{
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
hide: true, hide: true,
...@@ -51,6 +52,7 @@ export const tableOption = { ...@@ -51,6 +52,7 @@ export const tableOption = {
{ {
label: 'appId', label: 'appId',
prop: 'appId', prop: 'appId',
overHidden: true,
rules: [{ rules: [{
required: true, required: true,
message: '请输入appId', message: '请输入appId',
...@@ -60,6 +62,7 @@ export const tableOption = { ...@@ -60,6 +62,7 @@ export const tableOption = {
{ {
label: 'appSecret', label: 'appSecret',
prop: 'appSecret', prop: 'appSecret',
overHidden: true,
rules: [{ rules: [{
required: true, required: true,
message: '请输入appSecret', message: '请输入appSecret',
...@@ -69,6 +72,7 @@ export const tableOption = { ...@@ -69,6 +72,7 @@ export const tableOption = {
{ {
label: '回调地址', label: '回调地址',
prop: 'redirectUrl', prop: 'redirectUrl',
hide: true,
rules: [{ rules: [{
required: true, required: true,
message: '请输入回调地址', message: '请输入回调地址',
......
...@@ -25,17 +25,18 @@ const DIC = { ...@@ -25,17 +25,18 @@ const DIC = {
}] }]
} }
export const tableOption = { export const tableOption = {
'border': true, border: true,
'index': true, index: true,
'indexLabel': '序号', indexLabel: '序号',
'stripe': true, stripe: true,
'menuAlign': 'center', menuAlign: 'center',
'align': 'center', align: 'center',
'addBtn': false, viewBtn: true,
'editBtn': false, addBtn: false,
'delBtn': false, editBtn: false,
'dic': [], delBtn: false,
'column': [{ dic: [],
column: [{
label: '用户ID', label: '用户ID',
prop: 'user_id', prop: 'user_id',
align: 'center' align: 'center'
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
* this software without specific prior written permission. * this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com) * Author: lengleng (wangiegie@gmail.com)
*/ */
import { getDetails } from "@/api/admin/user"; import {getDetails} from "@/api/admin/user";
var validateUsername = (rule, value, callback) => { var validateUsername = (rule, value, callback) => {
getDetails(value).then(response => { getDetails(value).then(response => {
if (window.boxType === 'edit') callback() if (window.boxType === 'edit') callback()
...@@ -62,7 +63,7 @@ export const tableOption = { ...@@ -62,7 +63,7 @@ export const tableOption = {
message: "长度在 3 到 20 个字符", message: "长度在 3 到 20 个字符",
trigger: "blur" trigger: "blur"
}, },
{ validator: validateUsername, trigger: 'blur' } {validator: validateUsername, trigger: 'blur'}
] ]
}, { }, {
label: '密码', label: '密码',
...@@ -101,7 +102,7 @@ export const tableOption = { ...@@ -101,7 +102,7 @@ export const tableOption = {
message: "长度在 11 个字符", message: "长度在 11 个字符",
trigger: "blur" trigger: "blur"
}] }]
},{ }, {
label: '角色', label: '角色',
prop: 'role', prop: 'role',
formsolt: true, formsolt: true,
......
...@@ -36,7 +36,7 @@ export const tableOption = { ...@@ -36,7 +36,7 @@ export const tableOption = {
'editBtn': false, 'editBtn': false,
'delBtn': false, 'delBtn': false,
'addBtn': false, 'addBtn': false,
'viewBtn':true, 'viewBtn': true,
'dic': [], 'dic': [],
'column': [ 'column': [
{ {
......
...@@ -43,7 +43,7 @@ export const option = (safe) => { ...@@ -43,7 +43,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -52,7 +52,7 @@ export const option = (safe) => { ...@@ -52,7 +52,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -61,7 +61,7 @@ export const option = (safe) => { ...@@ -61,7 +61,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -70,7 +70,7 @@ export const option = (safe) => { ...@@ -70,7 +70,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -79,7 +79,7 @@ export const option = (safe) => { ...@@ -79,7 +79,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -88,7 +88,7 @@ export const option = (safe) => { ...@@ -88,7 +88,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -97,7 +97,7 @@ export const option = (safe) => { ...@@ -97,7 +97,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -106,7 +106,7 @@ export const option = (safe) => { ...@@ -106,7 +106,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}, { }, {
...@@ -115,7 +115,7 @@ export const option = (safe) => { ...@@ -115,7 +115,7 @@ export const option = (safe) => {
type: 'switch', type: 'switch',
span: 24, span: 24,
dicData: dicData, dicData: dicData,
click: ({ column }) => { click: ({column}) => {
_safe.set(column.prop); _safe.set(column.prop);
} }
}] }]
......
...@@ -3,7 +3,7 @@ export default { ...@@ -3,7 +3,7 @@ export default {
logo: "PigX", logo: "PigX",
indexTitle: 'PigX Pro 快速开发框架', indexTitle: 'PigX Pro 快速开发框架',
whiteList: ["/login", "/404", "/401", "/lock"], //配置无权限可以访问的页面 whiteList: ["/login", "/404", "/401", "/lock"], //配置无权限可以访问的页面
whiteTagList: ["/login", "/404", "/401", "/lock", ], //配置不添加tags页面 ('/advanced-router/mutative-detail/*'——*为通配符) whiteTagList: ["/login", "/404", "/401", "/lock",], //配置不添加tags页面 ('/advanced-router/mutative-detail/*'——*为通配符)
lockPage: '/lock', lockPage: '/lock',
tokenTime: 6000, tokenTime: 6000,
info: { info: {
......
import Vue from 'vue'; import Vue from 'vue';
import store from './store' import store from './store'
Vue.config.errorHandler = function(err, vm, info) {
Vue.config.errorHandler = function (err, vm, info) {
Vue.nextTick(() => { Vue.nextTick(() => {
store.commit('ADD_LOGS', { store.commit('ADD_LOGS', {
......
...@@ -4,6 +4,7 @@ function pluralize(time, label) { ...@@ -4,6 +4,7 @@ function pluralize(time, label) {
} }
return time + label + 's' return time + label + 's'
} }
/** /**
* 日期格式化 * 日期格式化
*/ */
...@@ -31,6 +32,7 @@ export function dateFormat(date) { ...@@ -31,6 +32,7 @@ export function dateFormat(date) {
return ''; return '';
} }
export function timeAgo(time) { export function timeAgo(time) {
const between = Date.now() / 1000 - Number(time) const between = Date.now() / 1000 - Number(time)
if (between < 3600) { if (between < 3600) {
...@@ -104,12 +106,12 @@ export function formatTime(time, option) { ...@@ -104,12 +106,12 @@ export function formatTime(time, option) {
/* 数字 格式化*/ /* 数字 格式化*/
export function nFormatter(num, digits) { export function nFormatter(num, digits) {
const si = [ const si = [
{ value: 1E18, symbol: 'E' }, {value: 1E18, symbol: 'E'},
{ value: 1E15, symbol: 'P' }, {value: 1E15, symbol: 'P'},
{ value: 1E12, symbol: 'T' }, {value: 1E12, symbol: 'T'},
{ value: 1E9, symbol: 'G' }, {value: 1E9, symbol: 'G'},
{ value: 1E6, symbol: 'M' }, {value: 1E6, symbol: 'M'},
{ value: 1E3, symbol: 'k' } {value: 1E3, symbol: 'k'}
] ]
for (let i = 0; i < si.length; i++) { for (let i = 0; i < si.length; i++) {
if (num >= si[i].value) { if (num >= si[i].value) {
......
...@@ -10,32 +10,26 @@ import router from './router/router'; ...@@ -10,32 +10,26 @@ import router from './router/router';
import 'avue-plugin-transfer/packages' //引入avue-plugin-transfer插件 import 'avue-plugin-transfer/packages' //引入avue-plugin-transfer插件
// import 'avue-plugin-ueditor/packages' //引入avue-plugin-ueditor插件(如果要兼容ie自行换掉富文本编辑器,此款插件不兼容ie) // import 'avue-plugin-ueditor/packages' //引入avue-plugin-ueditor插件(如果要兼容ie自行换掉富文本编辑器,此款插件不兼容ie)
import store from './store'; import store from './store';
import { import {loadStyle} from './util/util'
loadStyle
} from './util/util'
import * as urls from '@/config/env'; import * as urls from '@/config/env';
import { import {iconfontUrl, iconfontVersion} from '@/config/env';
iconfontUrl,
iconfontVersion
} from '@/config/env';
import * as filters from './filters' // 全局filter import * as filters from './filters' // 全局filter
import './styles/common.scss'; import './styles/common.scss';
// // 引入avue的包 // // 引入avue的包
import Avue from '@smallwei/avue/lib/index.js'; import Avue from '@smallwei/avue/lib/index.js';
// // 引入avue的样式文件 // // 引入avue的样式文件
import '@smallwei/avue/lib/theme-chalk/index.css'; import '@smallwei/avue/lib/theme-chalk/index.css';
// //源文件包
// import '../packages/index.js';
// import '../packages/theme-chalk/src/index.scss';
import basicContainer from './components/basic-container/main' import basicContainer from './components/basic-container/main'
import VueClipboard from 'vue-clipboard2' import VueClipboard from 'vue-clipboard2'
// 插件 json 展示 // 插件 json 展示
import vueJsonTreeView from 'vue-json-tree-view' import vueJsonTreeView from 'vue-json-tree-view'
// //源文件包
// import '../packages/index.js';
// import '../packages/theme-chalk/src/index.scss';
Vue.use(Avue, { menuType : 'text'}); Vue.use(Avue, {menuType: 'text'});
Vue.use(router) Vue.use(router)
......
...@@ -22,18 +22,21 @@ ...@@ -22,18 +22,21 @@
</div> </div>
</template> </template>
<script> <script>
import { mapGetters, mapState } from "vuex"; import {mapGetters, mapState} from "vuex";
export default {
export default {
name: "lock", name: "lock",
data () { data() {
return { return {
passwd: "", passwd: "",
passwdError: false, passwdError: false,
pass: false pass: false
}; };
}, },
created () { }, created() {
mounted () { }, },
mounted() {
},
computed: { computed: {
...mapState({ ...mapState({
userInfo: state => state.user.userInfo userInfo: state => state.user.userInfo
...@@ -42,18 +45,18 @@ export default { ...@@ -42,18 +45,18 @@ export default {
}, },
props: [], props: [],
methods: { methods: {
handleLogout () { handleLogout() {
this.$confirm("是否退出系统, 是否继续?", "提示", { this.$confirm("是否退出系统, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$store.dispatch("LogOut").then(() => { this.$store.dispatch("LogOut").then(() => {
this.$router.push({ path: "/login" }); this.$router.push({path: "/login"});
}); });
}); });
}, },
handleLogin () { handleLogin() {
if (this.passwd != this.lockPasswd) { if (this.passwd != this.lockPasswd) {
this.passwd = ""; this.passwd = "";
this.$message({ this.$message({
...@@ -69,26 +72,28 @@ export default { ...@@ -69,26 +72,28 @@ export default {
this.pass = true; this.pass = true;
setTimeout(() => { setTimeout(() => {
this.$store.commit("CLEAR_LOCK"); this.$store.commit("CLEAR_LOCK");
this.$router.push({ path: this.$router.$avueRouter.getPath({ src: this.tag.value }) }); this.$router.push({path: this.$router.$avueRouter.getPath({src: this.tag.value})});
}, 1000); }, 1000);
} }
}, },
components: {} components: {}
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.lock-container { .lock-container {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
.title { .title {
margin-bottom: 8px; margin-bottom: 8px;
color: #333; color: #333;
} }
} }
.lock-container::before {
.lock-container::before {
z-index: -999; z-index: -999;
content: ''; content: '';
position: absolute; position: absolute;
...@@ -98,8 +103,9 @@ export default { ...@@ -98,8 +103,9 @@ export default {
height: 100%; height: 100%;
background-image: url('/img/login.png'); background-image: url('/img/login.png');
background-size: cover; background-size: cover;
} }
.lock-form {
.lock-form {
width: 300px; width: 300px;
} }
</style> </style>
...@@ -20,11 +20,10 @@ ...@@ -20,11 +20,10 @@
class="login-select animated fadeIn" class="login-select animated fadeIn"
v-model="active" v-model="active"
@change="handleCommand" @change="handleCommand"
placeholder="请选择租户,不选为默认" placeholder="点击请选择租户"
size="mini" size="mini">
> <el-option label="租户1 用户登录" value="1"></el-option>
<el-option label="租户1" value="1"></el-option> <el-option label="租户2 用户登录" value="2"></el-option>
<el-option label="租户2" value="2"></el-option>
</el-select> </el-select>
</h4> </h4>
<userLogin v-if="activeName==='user'"></userLogin> <userLogin v-if="activeName==='user'"></userLogin>
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-checkbox v-model="checked">记住账号</el-checkbox>
<el-form-item> <el-form-item>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
......
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import {mapGetters} from 'vuex';
export default { export default {
name: 'wel', name: 'wel',
data() { data() {
...@@ -129,6 +130,7 @@ ...@@ -129,6 +130,7 @@
.wel-contailer { .wel-contailer {
position: relative; position: relative;
} }
.banner-text { .banner-text {
position: relative; position: relative;
padding: 0 20px; padding: 0 20px;
...@@ -136,6 +138,7 @@ ...@@ -136,6 +138,7 @@
text-align: center; text-align: center;
color: #333; color: #333;
} }
.banner-img { .banner-img {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -145,6 +148,7 @@ ...@@ -145,6 +148,7 @@
opacity: 0.8; opacity: 0.8;
display: none; display: none;
} }
.actor { .actor {
height: 250px; height: 250px;
overflow: hidden; overflow: hidden;
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
*/ */
import router from './router/router' import router from './router/router'
import store from './store' import store from './store'
import { validatenull } from '@/util/validate' import {validatenull} from '@/util/validate'
import { getToken } from '@/util/auth' import {getToken} from '@/util/auth'
import NProgress from 'nprogress' // progress bar import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style import 'nprogress/nprogress.css' // progress bar style
NProgress.configure({ showSpinner: false }); NProgress.configure({showSpinner: false});
const lockPage = store.getters.website.lockPage; //锁屏页 const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
//缓冲设置 //缓冲设置
...@@ -27,16 +27,16 @@ router.beforeEach((to, from, next) => { ...@@ -27,16 +27,16 @@ router.beforeEach((to, from, next) => {
const meta = to.meta || {}; const meta = to.meta || {};
if (getToken()) { if (getToken()) {
if (store.getters.isLock && to.path != lockPage) { if (store.getters.isLock && to.path != lockPage) {
next({ path: lockPage }) next({path: lockPage})
} else if (to.path === '/login') { } else if (to.path === '/login') {
next({ path: '/' }) next({path: '/'})
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
store.dispatch('GetUserInfo').then(() => { store.dispatch('GetUserInfo').then(() => {
next({...to, replace: true }) next({...to, replace: true})
}).catch(() => { }).catch(() => {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
next({ path: '/login' }) next({path: '/login'})
}) })
}) })
} else { } else {
......
import { import {getStore, removeStore, setStore} from '@/util/store'
setStore,
getStore,
removeStore
} from '@/util/store'
import website from '@/const/website' import website from '@/const/website'
const common = { const common = {
state: { state: {
...@@ -11,24 +8,22 @@ const common = { ...@@ -11,24 +8,22 @@ const common = {
isFullScren: false, isFullScren: false,
isShade: false, isShade: false,
screen: -1, screen: -1,
isLock: getStore({ name: 'isLock' }) || false, isLock: getStore({name: 'isLock'}) || false,
showTag: getStore({ name: 'showTag' }), showTag: getStore({name: 'showTag'}),
showDebug: getStore({ name: 'showDebug' }), showDebug: getStore({name: 'showDebug'}),
showCollapse: getStore({ name: 'showCollapse' }), showCollapse: getStore({name: 'showCollapse'}),
showSearch: getStore({ name: 'showSearch' }), showSearch: getStore({name: 'showSearch'}),
showLock: getStore({ name: 'showLock' }), showLock: getStore({name: 'showLock'}),
showFullScren: getStore({ name: 'showFullScren' }), showFullScren: getStore({name: 'showFullScren'}),
showTheme: getStore({ name: 'showTheme' }), showTheme: getStore({name: 'showTheme'}),
showColor: getStore({ name: 'showColor' }), showColor: getStore({name: 'showColor'}),
showMenu: getStore({ name: 'showMenu' }), showMenu: getStore({name: 'showMenu'}),
theme: getStore({ name: 'theme' }) || '#409EFF', theme: getStore({name: 'theme'}) || '#409EFF',
themeName: getStore({ name: 'themeName' }) || '', themeName: getStore({name: 'themeName'}) || '',
lockPasswd: getStore({ name: 'lockPasswd' }) || '', lockPasswd: getStore({name: 'lockPasswd'}) || '',
website: website, website: website,
}, },
actions: { actions: {},
},
mutations: { mutations: {
SET_SHADE: (state, active) => { SET_SHADE: (state, active) => {
state.isShade = active; state.isShade = active;
......
import { setStore, getStore } from '@/util/store' import {getStore, setStore} from '@/util/store'
import { dateFormat } from '@/filters/' import {dateFormat} from '@/filters/'
import { sendLogs } from '@/api/admin/log' import {sendLogs} from '@/api/admin/log'
const logs = { const logs = {
state: { state: {
logsList: getStore({ name: 'logsList' }) || [], logsList: getStore({name: 'logsList'}) || [],
}, },
actions: { actions: {
//发送错误日志 //发送错误日志
SendLogs({ state, commit }) { SendLogs({state, commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sendLogs(state.logsList).then(() => { sendLogs(state.logsList).then(() => {
commit('CLEAR_LOGS'); commit('CLEAR_LOGS');
...@@ -19,7 +20,7 @@ const logs = { ...@@ -19,7 +20,7 @@ const logs = {
}, },
}, },
mutations: { mutations: {
ADD_LOGS: (state, { type, message, stack, info }) => { ADD_LOGS: (state, {type, message, stack, info}) => {
state.logsList.push(Object.assign({ state.logsList.push(Object.assign({
url: window.location.href, url: window.location.href,
time: dateFormat(new Date()) time: dateFormat(new Date())
...@@ -29,11 +30,11 @@ const logs = { ...@@ -29,11 +30,11 @@ const logs = {
stack, stack,
info: info.toString() info: info.toString()
})) }))
setStore({ name: 'logsList', content: state.logsList }) setStore({name: 'logsList', content: state.logsList})
}, },
CLEAR_LOGS: (state) => { CLEAR_LOGS: (state) => {
state.logsList = []; state.logsList = [];
setStore({ name: 'logsList', content: state.logsList }) setStore({name: 'logsList', content: state.logsList})
} }
} }
......
import { setStore, getStore } from '@/util/store' import {getStore, setStore} from '@/util/store'
import { diff } from '@/util/util' import {diff} from '@/util/util'
import website from '@/const/website' import website from '@/const/website'
const isFirstPage = website.isFirstPage; const isFirstPage = website.isFirstPage;
const tagWel = website.fistPage; const tagWel = website.fistPage;
const tagObj = { const tagObj = {
...@@ -9,8 +10,9 @@ const tagObj = { ...@@ -9,8 +10,9 @@ const tagObj = {
params: '', //标题的路径参数 params: '', //标题的路径参数
query: '', //标题的参数 query: '', //标题的参数
group: [], //分组 group: [], //分组
} }
//处理首个标签
//处理首个标签
function setFistTag(list) { function setFistTag(list) {
if (list.length == 1) { if (list.length == 1) {
list[0].close = false; list[0].close = false;
...@@ -28,37 +30,35 @@ function setFistTag(list) { ...@@ -28,37 +30,35 @@ function setFistTag(list) {
const navs = { const navs = {
state: { state: {
tagList: getStore({ name: 'tagList' }) || [], tagList: getStore({name: 'tagList'}) || [],
tag: getStore({ name: 'tag' }) || tagObj, tag: getStore({name: 'tag'}) || tagObj,
tagWel: tagWel tagWel: tagWel
}, },
actions: { actions: {},
},
mutations: { mutations: {
ADD_TAG: (state, action) => { ADD_TAG: (state, action) => {
state.tag = action; state.tag = action;
setStore({ name: 'tag', content: state.tag, type: 'session' }) setStore({name: 'tag', content: state.tag, type: 'session'})
if (state.tagList.some(ele => diff(ele, action))) return if (state.tagList.some(ele => diff(ele, action))) return
state.tagList.push(action) state.tagList.push(action)
setFistTag(state.tagList); setFistTag(state.tagList);
setStore({ name: 'tagList', content: state.tagList, type: 'session' }) setStore({name: 'tagList', content: state.tagList, type: 'session'})
}, },
DEL_TAG: (state, action) => { DEL_TAG: (state, action) => {
state.tagList = state.tagList.filter(item => { state.tagList = state.tagList.filter(item => {
return !diff(item, action); return !diff(item, action);
}) })
setFistTag(state.tagList); setFistTag(state.tagList);
setStore({ name: 'tagList', content: state.tagList, type: 'session' }) setStore({name: 'tagList', content: state.tagList, type: 'session'})
}, },
DEL_ALL_TAG: (state) => { DEL_ALL_TAG: (state) => {
state.tagList = [state.tagWel]; state.tagList = [state.tagWel];
setStore({ name: 'tagList', content: state.tagList, type: 'session' }) setStore({name: 'tagList', content: state.tagList, type: 'session'})
}, },
DEL_TAG_OTHER: (state) => { DEL_TAG_OTHER: (state) => {
state.tagList = state.tagList.filter(item => item.value === state.tag.value) state.tagList = state.tagList.filter(item => item.value === state.tag.value)
setFistTag(state.tagList); setFistTag(state.tagList);
setStore({ name: 'tagList', content: state.tagList, type: 'session' }) setStore({name: 'tagList', content: state.tagList, type: 'session'})
}, },
} }
} }
......
import { setToken, removeToken } from '@/util/auth' import {removeToken, setToken} from '@/util/auth'
import { setStore, getStore } from '@/util/store' import {getStore, setStore} from '@/util/store'
import { isURL } from '@/util/validate' import {isURL} from '@/util/validate'
import { logout, loginByUsername, loginByMobile, loginBySocial, getUserInfo } from '@/api/login' import {getUserInfo, loginByMobile, loginBySocial, loginByUsername, logout} from '@/api/login'
import { encryption, deepClone } from '@/util/util' import {deepClone, encryption} from '@/util/util'
import webiste from '@/const/website'; import webiste from '@/const/website';
import { GetMenu } from '@/api/admin/menu' import {GetMenu} from '@/api/admin/menu'
function addPath(ele, first) { function addPath(ele, first) {
const propsConfig = webiste.menu.props; const propsConfig = webiste.menu.props;
...@@ -21,11 +21,12 @@ function addPath(ele, first) { ...@@ -21,11 +21,12 @@ function addPath(ele, first) {
} }
ele[propsDefault.children].forEach(child => { ele[propsDefault.children].forEach(child => {
if (!isURL(child[propsDefault.path])) { if (!isURL(child[propsDefault.path])) {
child[propsDefault.path] = `${ele[propsDefault.path]}/${child[propsDefault.path]?child[propsDefault.path]:'index'}` child[propsDefault.path] = `${ele[propsDefault.path]}/${child[propsDefault.path] ? child[propsDefault.path] : 'index'}`
} }
addPath(child); addPath(child);
}) })
} }
const user = { const user = {
state: { state: {
userInfo: {}, userInfo: {},
...@@ -44,7 +45,7 @@ const user = { ...@@ -44,7 +45,7 @@ const user = {
}, },
actions: { actions: {
//根据用户名登录 //根据用户名登录
LoginByUsername({ commit }, userInfo) { LoginByUsername({commit}, userInfo) {
const user = encryption({ const user = encryption({
data: userInfo, data: userInfo,
key: 'pigxpigxpigxpigx', key: 'pigxpigxpigxpigx',
...@@ -64,7 +65,7 @@ const user = { ...@@ -64,7 +65,7 @@ const user = {
}) })
}, },
//根据手机号登录 //根据手机号登录
LoginByPhone({ commit }, userInfo) { LoginByPhone({commit}, userInfo) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
loginByMobile(userInfo.mobile, userInfo.code).then(response => { loginByMobile(userInfo.mobile, userInfo.code).then(response => {
const data = response.data const data = response.data
...@@ -79,7 +80,7 @@ const user = { ...@@ -79,7 +80,7 @@ const user = {
}) })
}, },
// 根据OpenId登录 // 根据OpenId登录
LoginBySocial({ commit }, param) { LoginBySocial({commit}, param) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
loginBySocial(param.state, param.code).then(response => { loginBySocial(param.state, param.code).then(response => {
const data = response.data const data = response.data
...@@ -93,7 +94,7 @@ const user = { ...@@ -93,7 +94,7 @@ const user = {
}) })
}) })
}, },
GetUserInfo({ commit }) { GetUserInfo({commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getUserInfo().then((res) => { getUserInfo().then((res) => {
const data = res.data.data || {}; const data = res.data.data || {};
...@@ -107,7 +108,7 @@ const user = { ...@@ -107,7 +108,7 @@ const user = {
}) })
}, },
//刷新token //刷新token
RefeshToken({ commit }) { RefeshToken({commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout().then(() => { logout().then(() => {
commit('SET_TOKEN', new Date().getTime()); commit('SET_TOKEN', new Date().getTime());
...@@ -119,7 +120,7 @@ const user = { ...@@ -119,7 +120,7 @@ const user = {
}) })
}, },
// 登出 // 登出
LogOut({ commit }) { LogOut({commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout().then(() => { logout().then(() => {
commit('SET_MENU', []) commit('SET_MENU', [])
...@@ -138,7 +139,7 @@ const user = { ...@@ -138,7 +139,7 @@ const user = {
}) })
}, },
//注销session //注销session
FedLogOut({ commit }) { FedLogOut({commit}) {
return new Promise(resolve => { return new Promise(resolve => {
commit('SET_MENU', []) commit('SET_MENU', [])
commit('SET_PERMISSIONS', []) commit('SET_PERMISSIONS', [])
......
export default { export default {
getScreen: function() { getScreen: function () {
var width = document.body.clientWidth; var width = document.body.clientWidth;
if (width >= 1200) { if (width >= 1200) {
return 3; //大屏幕 return 3; //大屏幕
......
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const TokenKey = 'x-access-token' const TokenKey = 'x-access-token'
export function getToken() { export function getToken() {
......
import { import {validatenull} from '@/util/validate';
validatenull
} from '@/util/validate';
/** /**
* 存储localStorage * 存储localStorage
*/ */
...@@ -11,15 +10,15 @@ export const setStore = (params) => { ...@@ -11,15 +10,15 @@ export const setStore = (params) => {
type, type,
} = params; } = params;
let obj = { let obj = {
dataType: typeof(content), dataType: typeof (content),
content: content, content: content,
type: type, type: type,
datetime: new Date().getTime() datetime: new Date().getTime()
} }
if (type) window.sessionStorage.setItem(name, JSON.stringify(obj)); if (type) window.sessionStorage.setItem(name, JSON.stringify(obj));
else window.localStorage.setItem(name, JSON.stringify(obj)); else window.localStorage.setItem(name, JSON.stringify(obj));
} }
/** /**
* 获取localStorage * 获取localStorage
*/ */
...@@ -47,8 +46,8 @@ export const getStore = (params) => { ...@@ -47,8 +46,8 @@ export const getStore = (params) => {
content = obj.content; content = obj.content;
} }
return content; return content;
} }
/** /**
* 删除localStorage * 删除localStorage
*/ */
export const removeStore = params => { export const removeStore = params => {
......
import { validatenull } from './validate' import {validatenull} from './validate'
//表单序列化 //表单序列化
export const serialize = data => { export const serialize = data => {
let list = []; let list = [];
...@@ -77,8 +77,8 @@ export const diff = (obj1, obj2) => { ...@@ -77,8 +77,8 @@ export const diff = (obj1, obj2) => {
} }
} }
return true; return true;
} }
/** /**
* 设置灰度模式 * 设置灰度模式
*/ */
export const toggleGrayMode = (status) => { export const toggleGrayMode = (status) => {
...@@ -147,16 +147,17 @@ export const listenfullscreen = (callback) => { ...@@ -147,16 +147,17 @@ export const listenfullscreen = (callback) => {
function listen() { function listen() {
callback() callback()
} }
document.addEventListener("fullscreenchange", function() {
document.addEventListener("fullscreenchange", function () {
listen(); listen();
}); });
document.addEventListener("mozfullscreenchange", function() { document.addEventListener("mozfullscreenchange", function () {
listen(); listen();
}); });
document.addEventListener("webkitfullscreenchange", function() { document.addEventListener("webkitfullscreenchange", function () {
listen(); listen();
}); });
document.addEventListener("msfullscreenchange", function() { document.addEventListener("msfullscreenchange", function () {
listen(); listen();
}); });
}; };
...@@ -236,19 +237,19 @@ export const loadStyle = url => { ...@@ -236,19 +237,19 @@ export const loadStyle = url => {
export const isObjectValueEqual = (a, b) => { export const isObjectValueEqual = (a, b) => {
let result = true; let result = true;
Object.keys(a).forEach(ele => { Object.keys(a).forEach(ele => {
const type = typeof(a[ele]); const type = typeof (a[ele]);
if (type === 'string' && a[ele] !== b[ele]) result = false; if (type === 'string' && a[ele] !== b[ele]) result = false;
else if (type === 'object' && JSON.stringify(a[ele]) !== JSON.stringify(b[ele])) result = false; else if (type === 'object' && JSON.stringify(a[ele]) !== JSON.stringify(b[ele])) result = false;
}) })
return result; return result;
} }
/** /**
* 根据字典的value显示label * 根据字典的value显示label
*/ */
export const findByvalue = (dic, value) => { export const findByvalue = (dic, value) => {
let result = ''; let result = '';
if (validatenull(dic)) return value; if (validatenull(dic)) return value;
if (typeof(value) == 'string' || typeof(value) == 'number' || typeof(value) == 'boolean') { if (typeof (value) == 'string' || typeof (value) == 'number' || typeof (value) == 'boolean') {
let index = 0; let index = 0;
index = findArray(dic, value); index = findArray(dic, value);
if (index != -1) { if (index != -1) {
......
...@@ -29,6 +29,7 @@ export function isPhone(s) { ...@@ -29,6 +29,7 @@ export function isPhone(s) {
export function isURL(s) { export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s) return /^http[s]?:\/\/.*/.test(s)
} }
export function isvalidUsername(str) { export function isvalidUsername(str) {
const valid_map = ['admin', 'editor'] const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0 return valid_map.indexOf(str.trim()) >= 0
...@@ -57,8 +58,9 @@ export function validatAlphabets(str) { ...@@ -57,8 +58,9 @@ export function validatAlphabets(str) {
const reg = /^[A-Za-z]+$/ const reg = /^[A-Za-z]+$/
return reg.test(str) return reg.test(str)
} }
/*验证pad还是pc*/ /*验证pad还是pc*/
export const vaildatePc = function() { export const vaildatePc = function () {
const userAgentInfo = navigator.userAgent; const userAgentInfo = navigator.userAgent;
const Agents = ["Android", "iPhone", const Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone", "SymbianOS", "Windows Phone",
...@@ -72,8 +74,9 @@ export const vaildatePc = function() { ...@@ -72,8 +74,9 @@ export const vaildatePc = function() {
} }
} }
return flag; return flag;
} }
/**
/**
* validate email * validate email
* @param email * @param email
* @returns {boolean} * @returns {boolean}
...@@ -167,6 +170,7 @@ export function cardid(code) { ...@@ -167,6 +170,7 @@ export function cardid(code) {
list.push(msg); list.push(msg);
return list; return list;
} }
/** /**
* 判断手机号码是否正确 * 判断手机号码是否正确
*/ */
...@@ -193,6 +197,7 @@ export function isvalidatemobile(phone) { ...@@ -193,6 +197,7 @@ export function isvalidatemobile(phone) {
list.push(msg); list.push(msg);
return list; return list;
} }
/** /**
* 判断姓名是否正确 * 判断姓名是否正确
*/ */
...@@ -201,6 +206,7 @@ export function validatename(name) { ...@@ -201,6 +206,7 @@ export function validatename(name) {
if (!regName.test(name)) return false; if (!regName.test(name)) return false;
return true; return true;
} }
/** /**
* 判断是否为整数 * 判断是否为整数
*/ */
...@@ -214,6 +220,7 @@ export function validatenum(num, type) { ...@@ -214,6 +220,7 @@ export function validatenum(num, type) {
} }
return true; return true;
} }
/** /**
* 判断是否为小数 * 判断是否为小数
*/ */
...@@ -227,6 +234,7 @@ export function validatenumord(num, type) { ...@@ -227,6 +234,7 @@ export function validatenumord(num, type) {
} }
return true; return true;
} }
/** /**
* 判断是否为空 * 判断是否为空
*/ */
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<p class="header__title">{{name}}</p> <p class="header__title">{{name}}</p>
<el-button class="header__btn" <el-button class="header__btn"
type="primary" type="primary"
@click="breaks">关闭返回列表</el-button> @click="breaks">关闭返回列表
</el-button>
</div> </div>
</basic-container> </basic-container>
...@@ -17,45 +18,51 @@ ...@@ -17,45 +18,51 @@
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
id: '', id: '',
name: '' name: ''
} }
}, },
created () { created() {
this.id = this.$route.params.id this.id = this.$route.params.id
this.name = this.$route.query.name this.name = this.$route.query.name
}, },
computed: { computed: {
src () { src() {
return `${this.actUrl}${this.id}`; return `${this.actUrl}${this.id}`;
} }
}, },
methods: { methods: {
breaks () { breaks() {
this.$router.$avueRouter.closeTag(); this.$router.$avueRouter.closeTag();
this.$router.push({ path: '/activti/activiti' }) this.$router.push({path: '/activti/activiti'})
}
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header { .execution {
height: 99%;
.header {
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
&__title { &__title {
font-size: 22px; font-size: 22px;
} }
&__btn { &__btn {
position: absolute; position: absolute;
right: 10px; right: 10px;
} }
} }
.main {
.main {
margin: 0 auto; margin: 0 auto;
width: 99%; width: 99%;
height: calc(100% - 100px); height: calc(100% - 100px);
...@@ -63,5 +70,7 @@ export default { ...@@ -63,5 +70,7 @@ export default {
padding: 20px; padding: 20px;
border-radius: 3px; border-radius: 3px;
box-sizing: border-box; box-sizing: border-box;
} }
}
</style> </style>
...@@ -32,13 +32,16 @@ ...@@ -32,13 +32,16 @@
slot="menuBtn"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_model_manage" v-if="permissions.act_model_manage"
@click.native="handleView(scope.row,scope.index)">模型图</el-dropdown-item> @click.native="handleView(scope.row,scope.index)">模型图
</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_model_manage" v-if="permissions.act_model_manage"
@click.native="handleDeploy(scope.row,scope.index)">部署</el-dropdown-item> @click.native="handleDeploy(scope.row,scope.index)">部署
</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_model_manage" v-if="permissions.act_model_manage"
@click.native="handleDel(scope.row,scope.index)">删除</el-dropdown-item> @click.native="handleDel(scope.row,scope.index)">删除
</el-dropdown-item>
</template> </template>
</avue-crud> </avue-crud>
...@@ -47,12 +50,13 @@ ...@@ -47,12 +50,13 @@
</template> </template>
<script> <script>
import { fetchList, delObj, addObj, deploy } from '@/api/activiti/activiti' import {addObj, delObj, deploy, fetchList} from '@/api/activiti/activiti'
import { tableOption } from '@/const/crud/activiti/activiti' import {tableOption} from '@/const/crud/activiti/activiti'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'activiti', name: 'activiti',
data () { data() {
return { return {
tableData: [], tableData: [],
page: { page: {
...@@ -64,14 +68,15 @@ export default { ...@@ -64,14 +68,15 @@ export default {
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created() {
},
mounted: function () {
}, },
mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList (page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
descs: 'create_time', descs: 'create_time',
...@@ -83,7 +88,7 @@ export default { ...@@ -83,7 +88,7 @@ export default {
this.tableLoading = false this.tableLoading = false
}) })
}, },
handleView (row, index) { handleView(row, index) {
const name = `模型id为${row.id}${row.name}流程图`, const name = `模型id为${row.id}${row.name}流程图`,
src = `/activti/detail/${row.id}`; src = `/activti/detail/${row.id}`;
this.$router.push({ this.$router.push({
...@@ -93,7 +98,7 @@ export default { ...@@ -93,7 +98,7 @@ export default {
} }
}) })
}, },
handleDel (row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
handleDeploy: function (row, index) { handleDeploy: function (row, index) {
...@@ -104,16 +109,15 @@ export default { ...@@ -104,16 +109,15 @@ export default {
type: 'warning' type: 'warning'
}).then(function () { }).then(function () {
return deploy(row.id) return deploy(row.id)
}) }).then(data => {
.then(data => {
this.getList(this.page) this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '部署成功', message: '部署成功',
type: 'success' type: 'success'
}) })
}).catch(function (err) {
}) })
.catch(function (err) { })
}, },
rowDel: function (row, index) { rowDel: function (row, index) {
var _this = this var _this = this
...@@ -121,19 +125,17 @@ export default { ...@@ -121,19 +125,17 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function () {
return delObj(row.id) return delObj(row.id)
}) }).then(data => {
.then(data => {
this.getList(this.page) this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}).catch(function (err) {
}) })
.catch(function (err) { })
}, },
/** /**
* @title 数据添加 * @title 数据添加
...@@ -156,17 +158,17 @@ export default { ...@@ -156,17 +158,17 @@ export default {
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange (form) { searchChange(form) {
this.getList(this.page,form) this.getList(this.page, form)
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange() {
this.getList(this.page) this.getList(this.page)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -33,20 +33,24 @@ ...@@ -33,20 +33,24 @@
<el-button type="primary" <el-button type="primary"
@click="handleAdd" @click="handleAdd"
size="small" size="small"
v-if="permissions.act_leavebill_add">新 增</el-button> v-if="permissions.act_leavebill_add">新 增
</el-button>
</template> </template>
<template slot-scope="scope" <template slot-scope="scope"
slot="menuBtn"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_edit && scope.row.state == 0" v-if="permissions.act_leavebill_edit && scope.row.state == 0"
@click.native="handleSubmit(scope.row,scope.index)">提交</el-dropdown-item> @click.native="handleSubmit(scope.row,scope.index)">提交
</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_edit" v-if="permissions.act_leavebill_edit"
@click.native="handleEdit(scope.row,scope.index)">编辑</el-dropdown-item> @click.native="handleEdit(scope.row,scope.index)">编辑
</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_leavebill_del" v-if="permissions.act_leavebill_del"
@click.native="handleDel(scope.row,'suspend')">删除</el-dropdown-item> @click.native="handleDel(scope.row,'suspend')">删除
</el-dropdown-item>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -54,9 +58,10 @@ ...@@ -54,9 +58,10 @@
</template> </template>
<script> <script>
import { fetchList, getObj, addObj, putObj, delObj,submit } from '@/api/activiti/leave-bill' import {addObj, delObj, fetchList, getObj, putObj, submit} from '@/api/activiti/leave-bill'
import { tableOption } from '@/const/crud/activiti/leave-bill' import {tableOption} from '@/const/crud/activiti/leave-bill'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default { export default {
name: 'leave-bill', name: 'leave-bill',
data() { data() {
...@@ -73,12 +78,13 @@ ...@@ -73,12 +78,13 @@
}, },
created() { created() {
}, },
mounted: function() { }, mounted: function () {
},
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList(page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
descs: 'create_time', descs: 'create_time',
...@@ -95,7 +101,7 @@ ...@@ -95,7 +101,7 @@
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
* *
**/ **/
handleAdd: function() { handleAdd: function () {
this.$refs.crud.rowAdd() this.$refs.crud.rowAdd()
}, },
handleEdit(row, index) { handleEdit(row, index) {
...@@ -104,17 +110,15 @@ ...@@ -104,17 +110,15 @@
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function(row, index) { rowDel: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认删除ID为' + row.leaveId, '提示', { this.$confirm('是否确认删除ID为' + row.leaveId, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function() {
return delObj(row.leaveId) return delObj(row.leaveId)
}) }).then(data => {
.then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
...@@ -122,15 +126,14 @@ ...@@ -122,15 +126,14 @@
type: 'success' type: 'success'
}) })
}) })
.catch(function(err) { })
}, },
handleSubmit: function(row, index) { handleSubmit: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认提交ID为' + row.leaveId, '提示', { this.$confirm('是否确认提交ID为' + row.leaveId, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(function() { }).then(function () {
return submit(row.leaveId) return submit(row.leaveId)
}).then(data => { }).then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
...@@ -140,7 +143,7 @@ ...@@ -140,7 +143,7 @@
type: 'success' type: 'success'
}) })
this.getList(this.page) this.getList(this.page)
}).catch(function(err) { }) })
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -149,7 +152,7 @@ ...@@ -149,7 +152,7 @@
* @param done 为表单关闭函数 * @param done 为表单关闭函数
* *
**/ **/
handleUpdate: function(row, index, done) { handleUpdate: function (row, index, done) {
putObj(row).then(data => { putObj(row).then(data => {
this.tableData.splice(index, 1, Object.assign({}, row)) this.tableData.splice(index, 1, Object.assign({}, row))
this.$message({ this.$message({
...@@ -167,7 +170,7 @@ ...@@ -167,7 +170,7 @@
* @param done 为表单关闭函数 * @param done 为表单关闭函数
* *
**/ **/
handleSave: function(row, done) { handleSave: function (row, done) {
addObj(row).then(data => { addObj(row).then(data => {
this.tableData.push(Object.assign({}, row)) this.tableData.push(Object.assign({}, row))
this.$message({ this.$message({
...@@ -184,7 +187,7 @@ ...@@ -184,7 +187,7 @@
*/ */
searchChange(form) { searchChange(form) {
this.page.state = form.state this.page.state = form.state
this.getList(this.page,form) this.getList(this.page, form)
}, },
/** /**
* 刷新回调 * 刷新回调
......
...@@ -34,38 +34,43 @@ ...@@ -34,38 +34,43 @@
divided divided
v-if="permissions.act_process_manage" v-if="permissions.act_process_manage"
@click.native="handlePic(scope.row,scope.index)" @click.native="handlePic(scope.row,scope.index)"
>流程图</el-dropdown-item> >流程图
</el-dropdown-item>
<el-dropdown-item <el-dropdown-item
divided divided
v-if="permissions.act_process_manage && scope.row.suspend" v-if="permissions.act_process_manage && scope.row.suspend"
@click.native="handleStatus(scope.row,'active')" @click.native="handleStatus(scope.row,'active')"
>激活</el-dropdown-item> >激活
</el-dropdown-item>
<el-dropdown-item <el-dropdown-item
divided divided
v-if="permissions.act_process_manage && !scope.row.suspend" v-if="permissions.act_process_manage && !scope.row.suspend"
@click.native="handleStatus(scope.row,'suspend')" @click.native="handleStatus(scope.row,'suspend')"
>失效</el-dropdown-item> >失效
</el-dropdown-item>
<el-dropdown-item <el-dropdown-item
divided divided
v-if="permissions.act_process_manage" v-if="permissions.act_process_manage"
@click.native="handleDel(scope.row,'suspend')" @click.native="handleDel(scope.row,'suspend')"
>删除</el-dropdown-item> >删除
</el-dropdown-item>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
<el-dialog title="流程图" :visible.sync="showPicDialog"> <el-dialog title="流程图" :visible.sync="showPicDialog">
<img :src="actPicUrl" width="100%" style="margin-left:-60px"> <img :src="actPicUrl" width="100%">
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { fetchList, delObj, addObj, status } from "@/api/activiti/process"; import {addObj, delObj, fetchList, status} from "@/api/activiti/process";
import { tableOption } from "@/const/crud/activiti/process"; import {tableOption} from "@/const/crud/activiti/process";
import { mapGetters } from "vuex"; import {mapGetters} from "vuex";
export default {
export default {
name: "process", name: "process",
data() { data() {
return { return {
...@@ -81,8 +86,10 @@ export default { ...@@ -81,8 +86,10 @@ export default {
tableOption: tableOption tableOption: tableOption
}; };
}, },
created() {}, created() {
mounted: function() {}, },
mounted: function () {
},
computed: { computed: {
...mapGetters(["permissions"]) ...mapGetters(["permissions"])
}, },
...@@ -123,11 +130,9 @@ export default { ...@@ -123,11 +130,9 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
} }
) ).then(function () {
.then(function() {
return status(row.processonDefinitionId, type); return status(row.processonDefinitionId, type);
}) }).then(data => {
.then(data => {
this.getList(this.page); this.getList(this.page);
_this.$message({ _this.$message({
showClose: true, showClose: true,
...@@ -135,12 +140,11 @@ export default { ...@@ -135,12 +140,11 @@ export default {
type: "success" type: "success"
}); });
}) })
.catch(function(err) {});
}, },
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index); this.$refs.crud.rowDel(row, index);
}, },
rowDel: function(row, index) { rowDel: function (row, index) {
var _this = this; var _this = this;
this.$confirm( this.$confirm(
'是否确认删除ID为"' + row.deploymentId + '"的模型?', '是否确认删除ID为"' + row.deploymentId + '"的模型?',
...@@ -150,19 +154,17 @@ export default { ...@@ -150,19 +154,17 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
} }
) ).then(function () {
.then(function() {
return delObj(row.deploymentId); return delObj(row.deploymentId);
}) }).then(data => {
.then(data => {
this.getList(this.page); this.getList(this.page);
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: "删除成功", message: "删除成功",
type: "success" type: "success"
}); });
}) }).catch(function (err) {
.catch(function(err) {}); });
}, },
/** /**
* 搜索回调 * 搜索回调
...@@ -177,7 +179,7 @@ export default { ...@@ -177,7 +179,7 @@ export default {
this.getList(this.page); this.getList(this.page);
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -29,13 +29,16 @@ ...@@ -29,13 +29,16 @@
slot="menuBtn"> slot="menuBtn">
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_task_manage" v-if="permissions.act_task_manage"
@click.native="audit(scope.row,scope.index)">审批</el-dropdown-item> @click.native="audit(scope.row,scope.index)">审批
</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_task_manage" v-if="permissions.act_task_manage"
@click.native="comment(scope.row,scope.index)">批注</el-dropdown-item> @click.native="comment(scope.row,scope.index)">批注
</el-dropdown-item>
<el-dropdown-item divided <el-dropdown-item divided
v-if="permissions.act_task_manage" v-if="permissions.act_task_manage"
@click.native="viewPic(scope.row,scope.index)">流程图</el-dropdown-item> @click.native="viewPic(scope.row,scope.index)">流程图
</el-dropdown-item>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -46,7 +49,8 @@ ...@@ -46,7 +49,8 @@
<el-button icon="el-icon-check" <el-button icon="el-icon-check"
v-for="flag in flagList" :key="flag" v-for="flag in flagList" :key="flag"
@click="handleTask(scope.row,flag)" @click="handleTask(scope.row,flag)"
plain>{{flag}}</el-button> plain>{{flag}}
</el-button>
</template> </template>
</avue-form> </avue-form>
</el-dialog> </el-dialog>
...@@ -62,16 +66,17 @@ ...@@ -62,16 +66,17 @@
</template> </template>
<script> <script>
import { fetchList,fetchDetail,doTask,fetchComment} from '@/api/activiti/task' import {doTask, fetchComment, fetchDetail, fetchList} from '@/api/activiti/task'
import { tableOption,formOption,taskOption } from '@/const/crud/activiti/task' import {formOption, tableOption, taskOption} from '@/const/crud/activiti/task'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default { export default {
name: 'task', name: 'task',
data() { data() {
return { return {
actPicUrl:'', actPicUrl: '',
obj: {}, obj: {},
flagList:{}, flagList: {},
showTask: false, showTask: false,
showComment: false, showComment: false,
showPicDialog: false, showPicDialog: false,
...@@ -85,17 +90,18 @@ ...@@ -85,17 +90,18 @@
tableLoading: false, tableLoading: false,
tableOption: tableOption, tableOption: tableOption,
formOption: formOption, formOption: formOption,
taskOption:taskOption, taskOption: taskOption,
} }
}, },
created() { created() {
}, },
mounted: function() { }, mounted: function () {
},
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList(page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -104,9 +110,10 @@ ...@@ -104,9 +110,10 @@
this.tableData = response.data.data.records this.tableData = response.data.data.records
this.page.total = response.data.data.total this.page.total = response.data.data.total
this.tableLoading = false this.tableLoading = false
})}, })
},
audit:function(row, index) { audit: function (row, index) {
fetchDetail(row.taskId).then(response => { fetchDetail(row.taskId).then(response => {
this.obj = response.data.data this.obj = response.data.data
// 根据连线判断下次的流程 // 根据连线判断下次的流程
...@@ -115,34 +122,33 @@ ...@@ -115,34 +122,33 @@
}) })
this.obj = row this.obj = row
}, },
comment:function(row, index) { comment: function (row, index) {
fetchComment(row.taskId).then(response => { fetchComment(row.taskId).then(response => {
this.taskTableData = response.data.data this.taskTableData = response.data.data
}) })
this.showComment = true this.showComment = true
}, },
handleSubmit: function(row, index) { handleSubmit: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认提交ID为' + row.leaveId, '提示', { this.$confirm('是否确认提交ID为' + row.leaveId, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(function() { }).then(function () {
return submit(row.leaveId) return submit(row.leaveId)
}) }).then(data => {
.then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '提交成功', message: '提交成功',
type: 'success' type: 'success'
}) })
}).catch(function (err) {
}) })
.catch(function(err) { })
}, },
handleTask: function(row, result) { handleTask: function (row, result) {
this.obj.taskFlag = result this.obj.taskFlag = result
doTask(this.obj).then(response =>{ doTask(this.obj).then(response => {
this.$message({ this.$message({
showClose: true, showClose: true,
message: '提交成功', message: '提交成功',
...@@ -152,7 +158,7 @@ ...@@ -152,7 +158,7 @@
this.getList(this.page) this.getList(this.page)
}) })
}, },
viewPic: function(row, index) { viewPic: function (row, index) {
this.actPicUrl = `/act/task/view/` + row.taskId this.actPicUrl = `/act/task/view/` + row.taskId
this.showPicDialog = true this.showPicDialog = true
}, },
......
...@@ -35,13 +35,15 @@ ...@@ -35,13 +35,15 @@
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
plain plain
@click="handleEdit(scope.row,scope.index)">编辑</el-button> @click="handleEdit(scope.row,scope.index)">编辑
</el-button>
<el-button type="text" <el-button type="text"
v-if="permissions.sys_client_del" v-if="permissions.sys_client_del"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
plain plain
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -49,10 +51,11 @@ ...@@ -49,10 +51,11 @@
</template> </template>
<script> <script>
import { fetchList, addObj, putObj, delObj } from '@/api/admin/client' import {addObj, delObj, fetchList, putObj} from '@/api/admin/client'
import { tableOption } from '@/const/crud/admin/client' import {tableOption} from '@/const/crud/admin/client'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'client', name: 'client',
data() { data() {
return { return {
...@@ -68,12 +71,13 @@ export default { ...@@ -68,12 +71,13 @@ export default {
}, },
created() { created() {
}, },
mounted: function() { }, mounted: function () {
},
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList(page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -89,7 +93,7 @@ export default { ...@@ -89,7 +93,7 @@ export default {
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
* *
**/ **/
handleAdd: function() { handleAdd: function () {
this.$refs.crud.rowAdd() this.$refs.crud.rowAdd()
}, },
handleEdit(row, index) { handleEdit(row, index) {
...@@ -98,17 +102,15 @@ export default { ...@@ -98,17 +102,15 @@ export default {
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function(row, index) { rowDel: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认删除ID为' + row.clientId, '提示', { this.$confirm('是否确认删除ID为' + row.clientId, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function() {
return delObj(row.clientId) return delObj(row.clientId)
}) }).then(data => {
.then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
...@@ -116,8 +118,8 @@ export default { ...@@ -116,8 +118,8 @@ export default {
type: 'success' type: 'success'
}) })
this.refreshChange() this.refreshChange()
}).catch(function (err) {
}) })
.catch(function(err) { })
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -126,7 +128,7 @@ export default { ...@@ -126,7 +128,7 @@ export default {
* @param done 为表单关闭函数 * @param done 为表单关闭函数
* *
**/ **/
handleUpdate: function(row, index, done) { handleUpdate: function (row, index, done) {
putObj(row).then(data => { putObj(row).then(data => {
this.tableData.splice(index, 1, Object.assign({}, row)) this.tableData.splice(index, 1, Object.assign({}, row))
this.$message({ this.$message({
...@@ -144,7 +146,7 @@ export default { ...@@ -144,7 +146,7 @@ export default {
* @param done 为表单关闭函数 * @param done 为表单关闭函数
* *
**/ **/
handleSave: function(row, done) { handleSave: function (row, done) {
addObj(row).then(data => { addObj(row).then(data => {
this.tableData.push(Object.assign({}, row)) this.tableData.push(Object.assign({}, row))
this.$message({ this.$message({
...@@ -163,7 +165,7 @@ export default { ...@@ -163,7 +165,7 @@ export default {
this.getList(this.page) this.getList(this.page)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -23,15 +23,18 @@ ...@@ -23,15 +23,18 @@
<el-button type="primary" <el-button type="primary"
v-if="deptManager_btn_add" v-if="deptManager_btn_add"
icon="plus" icon="plus"
@click="handlerAdd">添加</el-button> @click="handlerAdd">添加
</el-button>
<el-button type="primary" <el-button type="primary"
v-if="deptManager_btn_edit" v-if="deptManager_btn_edit"
icon="edit" icon="edit"
@click="handlerEdit">编辑</el-button> @click="handlerEdit">编辑
</el-button>
<el-button type="primary" <el-button type="primary"
v-if="deptManager_btn_del" v-if="deptManager_btn_del"
icon="delete" icon="delete"
@click="handleDelete">删除</el-button> @click="handleDelete">删除
</el-button>
</el-button-group> </el-button-group>
</div> </div>
...@@ -84,12 +87,14 @@ ...@@ -84,12 +87,14 @@
</el-form-item> </el-form-item>
<el-form-item v-if="formStatus == 'update'"> <el-form-item v-if="formStatus == 'update'">
<el-button type="primary" <el-button type="primary"
@click="update">更新</el-button> @click="update">更新
</el-button>
<el-button @click="onCancel">取消</el-button> <el-button @click="onCancel">取消</el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="formStatus == 'create'"> <el-form-item v-if="formStatus == 'create'">
<el-button type="primary" <el-button type="primary"
@click="create">保存</el-button> @click="create">保存
</el-button>
<el-button @click="onCancel">取消</el-button> <el-button @click="onCancel">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -101,11 +106,12 @@ ...@@ -101,11 +106,12 @@
</template> </template>
<script> <script>
import { fetchTree, getObj, addObj, delObj, putObj } from '@/api/admin/dept' import {addObj, delObj, fetchTree, getObj, putObj} from '@/api/admin/dept'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'dept', name: 'dept',
data () { data() {
return { return {
list: null, list: null,
total: null, total: null,
...@@ -125,13 +131,13 @@ export default { ...@@ -125,13 +131,13 @@ export default {
}, },
rules: { rules: {
parentId: [ parentId: [
{ required: true, message: '请输入父级节点', trigger: 'blur' } {required: true, message: '请输入父级节点', trigger: 'blur'}
], ],
deptId: [ deptId: [
{ required: true, message: '请输入节点编号', trigger: 'blur' } {required: true, message: '请输入节点编号', trigger: 'blur'}
], ],
name: [ name: [
{ required: true, message: '请输入部门名称', trigger: 'blur' } {required: true, message: '请输入部门名称', trigger: 'blur'}
], ],
}, },
labelPosition: 'right', labelPosition: 'right',
...@@ -147,7 +153,7 @@ export default { ...@@ -147,7 +153,7 @@ export default {
deptManager_btn_del: false deptManager_btn_del: false
} }
}, },
created () { created() {
this.getList() this.getList()
this.deptManager_btn_add = this.permissions['sys_dept_add'] this.deptManager_btn_add = this.permissions['sys_dept_add']
this.deptManager_btn_edit = this.permissions['sys_dept_edit'] this.deptManager_btn_edit = this.permissions['sys_dept_edit']
...@@ -160,16 +166,16 @@ export default { ...@@ -160,16 +166,16 @@ export default {
]) ])
}, },
methods: { methods: {
getList () { getList() {
fetchTree(this.listQuery).then(response => { fetchTree(this.listQuery).then(response => {
this.treeData = response.data.data this.treeData = response.data.data
}) })
}, },
filterNode (value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
getNodeData (data) { getNodeData(data) {
if (!this.formEdit) { if (!this.formEdit) {
this.formStatus = 'update' this.formStatus = 'update'
} }
...@@ -179,18 +185,18 @@ export default { ...@@ -179,18 +185,18 @@ export default {
this.currentId = data.id this.currentId = data.id
this.showElement = true this.showElement = true
}, },
handlerEdit () { handlerEdit() {
if (this.form.deptId) { if (this.form.deptId) {
this.formEdit = false this.formEdit = false
this.formStatus = 'update' this.formStatus = 'update'
} }
}, },
handlerAdd () { handlerAdd() {
this.resetForm() this.resetForm()
this.formEdit = false this.formEdit = false
this.formStatus = 'create' this.formStatus = 'create'
}, },
handleDelete () { handleDelete() {
this.$confirm('此操作将永久删除, 是否继续?', '提示', { this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -209,7 +215,7 @@ export default { ...@@ -209,7 +215,7 @@ export default {
}) })
}) })
}, },
update () { update() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (!valid) return if (!valid) return
putObj(this.form).then(() => { putObj(this.form).then(() => {
...@@ -224,7 +230,7 @@ export default { ...@@ -224,7 +230,7 @@ export default {
}) })
}, },
create () { create() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (!valid) return if (!valid) return
addObj(this.form).then(() => { addObj(this.form).then(() => {
...@@ -238,16 +244,16 @@ export default { ...@@ -238,16 +244,16 @@ export default {
}) })
}) })
}, },
onCancel () { onCancel() {
this.formEdit = true this.formEdit = true
this.formStatus = '' this.formStatus = ''
}, },
resetForm () { resetForm() {
this.form = { this.form = {
parentId: this.currentId, parentId: this.currentId,
} }
} }
} }
} }
</script> </script>
...@@ -35,13 +35,15 @@ ...@@ -35,13 +35,15 @@
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
plain plain
@click="handleEdit(scope.row,scope.index)">编辑</el-button> @click="handleEdit(scope.row,scope.index)">编辑
</el-button>
<el-button type="text" <el-button type="text"
v-if="permissions.sys_dict_del" v-if="permissions.sys_dict_del"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
plain plain
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -49,12 +51,13 @@ ...@@ -49,12 +51,13 @@
</template> </template>
<script> <script>
import { fetchList, addObj, putObj, delObj } from '@/api/admin/dict' import {addObj, delObj, fetchList, putObj} from '@/api/admin/dict'
import { tableOption } from '@/const/crud/admin/dict' import {tableOption} from '@/const/crud/admin/dict'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'dict', name: 'dict',
data () { data() {
return { return {
tableData: [], tableData: [],
page: { page: {
...@@ -66,14 +69,15 @@ export default { ...@@ -66,14 +69,15 @@ export default {
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created() {
},
mounted: function () {
}, },
mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList (page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -92,10 +96,10 @@ export default { ...@@ -92,10 +96,10 @@ export default {
handleAdd: function () { handleAdd: function () {
this.$refs.crud.rowAdd() this.$refs.crud.rowAdd()
}, },
handleEdit (row, index) { handleEdit(row, index) {
this.$refs.crud.rowEdit(row, index) this.$refs.crud.rowEdit(row, index)
}, },
handleDel (row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function (row, index) { rowDel: function (row, index) {
...@@ -104,19 +108,17 @@ export default { ...@@ -104,19 +108,17 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function () {
return delObj(row) return delObj(row)
}) }).then(() => {
.then(() => {
this.getList(this.page) this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}).catch(function () {
}) })
.catch(function () { })
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -155,11 +157,11 @@ export default { ...@@ -155,11 +157,11 @@ export default {
done() done()
}) })
}, },
searchChange (form) { searchChange(form) {
this.getList(this.page,form) this.getList(this.page, form)
}
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
v-if="permissions.sys_log_del" v-if="permissions.sys_log_del"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -41,12 +42,13 @@ ...@@ -41,12 +42,13 @@
</template> </template>
<script> <script>
import { fetchList, delObj } from '@/api/admin/log' import {delObj, fetchList} from '@/api/admin/log'
import { tableOption } from '@/const/crud/admin/log' import {tableOption} from '@/const/crud/admin/log'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'log', name: 'log',
data () { data() {
return { return {
tableData: [], tableData: [],
page: { page: {
...@@ -58,14 +60,15 @@ export default { ...@@ -58,14 +60,15 @@ export default {
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created() {
},
mounted: function () {
}, },
mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList (page, params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
descs: 'create_time', descs: 'create_time',
...@@ -77,7 +80,7 @@ export default { ...@@ -77,7 +80,7 @@ export default {
this.tableLoading = false this.tableLoading = false
}) })
}, },
handleDel (row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function (row, index) { rowDel: function (row, index) {
...@@ -86,34 +89,32 @@ export default { ...@@ -86,34 +89,32 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function () {
return delObj(row.id) return delObj(row.id)
}) }).then(data => {
.then(data => {
this.getList(this.page) this.getList(this.page)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}).catch(function (err) {
}) })
.catch(function (err) { })
}, },
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange (form) { searchChange(form) {
this.getList(this.page, form) this.getList(this.page, form)
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange() {
this.getList(this.page) this.getList(this.page)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -23,15 +23,18 @@ ...@@ -23,15 +23,18 @@
<el-button type="primary" <el-button type="primary"
v-if="menuManager_btn_add" v-if="menuManager_btn_add"
icon="plus" icon="plus"
@click="handlerAdd">添加</el-button> @click="handlerAdd">添加
</el-button>
<el-button type="primary" <el-button type="primary"
v-if="menuManager_btn_edit" v-if="menuManager_btn_edit"
icon="edit" icon="edit"
@click="handlerEdit">编辑</el-button> @click="handlerEdit">编辑
</el-button>
<el-button type="primary" <el-button type="primary"
v-if="menuManager_btn_del" v-if="menuManager_btn_del"
icon="delete" icon="delete"
@click="handleDelete">删除</el-button> @click="handleDelete">删除
</el-button>
</el-button-group> </el-button-group>
</div> </div>
...@@ -96,7 +99,7 @@ ...@@ -96,7 +99,7 @@
<el-option v-for="item in typeOptions" <el-option v-for="item in typeOptions"
:key="item" :key="item"
:label="item | typeFilter" :label="item | typeFilter"
:value="item"> </el-option> :value="item"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="排序" <el-form-item label="排序"
...@@ -130,12 +133,14 @@ ...@@ -130,12 +133,14 @@
</el-form-item> </el-form-item>
<el-form-item v-if="formStatus == 'update'"> <el-form-item v-if="formStatus == 'update'">
<el-button type="primary" <el-button type="primary"
@click="update">更新</el-button> @click="update">更新
</el-button>
<el-button @click="onCancel">取消</el-button> <el-button @click="onCancel">取消</el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="formStatus == 'create'"> <el-form-item v-if="formStatus == 'create'">
<el-button type="primary" <el-button type="primary"
@click="create">保存</el-button> @click="create">保存
</el-button>
<el-button @click="onCancel">取消</el-button> <el-button @click="onCancel">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -147,12 +152,12 @@ ...@@ -147,12 +152,12 @@
</template> </template>
<script> <script>
import { addObj, delObj, fetchTree, getObj, putObj } from '@/api/admin/menu' import {addObj, delObj, fetchTree, getObj, putObj} from '@/api/admin/menu'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default { export default {
name: 'menu', name: 'menu',
data () { data() {
return { return {
list: null, list: null,
total: null, total: null,
...@@ -197,7 +202,7 @@ export default { ...@@ -197,7 +202,7 @@ export default {
} }
}, },
filters: { filters: {
typeFilter (type) { typeFilter(type) {
const typeMap = { const typeMap = {
0: '菜单', 0: '菜单',
1: '按钮' 1: '按钮'
...@@ -205,7 +210,7 @@ export default { ...@@ -205,7 +210,7 @@ export default {
return typeMap[type] return typeMap[type]
} }
}, },
created () { created() {
this.getList() this.getList()
this.menuManager_btn_add = this.permissions['sys_menu_add'] this.menuManager_btn_add = this.permissions['sys_menu_add']
this.menuManager_btn_edit = this.permissions['sys_menu_edit'] this.menuManager_btn_edit = this.permissions['sys_menu_edit']
...@@ -218,17 +223,17 @@ export default { ...@@ -218,17 +223,17 @@ export default {
]) ])
}, },
methods: { methods: {
getList () { getList() {
fetchTree(this.listQuery).then(response => { fetchTree(this.listQuery).then(response => {
this.treeData = response.data.data this.treeData = response.data.data
}) })
}, },
filterNode (value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
nodeExpand (data) { nodeExpand(data) {
let aChildren = data.children let aChildren = data.children
if (aChildren.length > 0) { if (aChildren.length > 0) {
this.oExpandedKey[data.id] = true this.oExpandedKey[data.id] = true
...@@ -236,7 +241,7 @@ export default { ...@@ -236,7 +241,7 @@ export default {
} }
this.setExpandedKeys() this.setExpandedKeys()
}, },
nodeCollapse (data) { nodeCollapse(data) {
this.oExpandedKey[data.id] = false this.oExpandedKey[data.id] = false
// 如果有子节点 // 如果有子节点
this.treeRecursion(this.oTreeNodeChildren[data.id], (oNode) => { this.treeRecursion(this.oTreeNodeChildren[data.id], (oNode) => {
...@@ -244,7 +249,7 @@ export default { ...@@ -244,7 +249,7 @@ export default {
}); });
this.setExpandedKeys() this.setExpandedKeys()
}, },
setExpandedKeys () { setExpandedKeys() {
let oTemp = this.oExpandedKey let oTemp = this.oExpandedKey
this.aExpandedKeys = [] this.aExpandedKeys = []
for (let sKey in oTemp) { for (let sKey in oTemp) {
...@@ -253,7 +258,7 @@ export default { ...@@ -253,7 +258,7 @@ export default {
} }
} }
}, },
treeRecursion (aChildren, fnCallback) { treeRecursion(aChildren, fnCallback) {
if (aChildren) { if (aChildren) {
for (let i = 0; i < aChildren.length; ++i) { for (let i = 0; i < aChildren.length; ++i) {
let oNode = aChildren[i] let oNode = aChildren[i]
...@@ -263,7 +268,7 @@ export default { ...@@ -263,7 +268,7 @@ export default {
} }
}, },
getNodeData (data) { getNodeData(data) {
if (!this.formEdit) { if (!this.formEdit) {
this.formStatus = 'update' this.formStatus = 'update'
} }
...@@ -273,18 +278,18 @@ export default { ...@@ -273,18 +278,18 @@ export default {
this.currentId = data.id this.currentId = data.id
this.showElement = true this.showElement = true
}, },
handlerEdit () { handlerEdit() {
if (this.form.menuId) { if (this.form.menuId) {
this.formEdit = false this.formEdit = false
this.formStatus = 'update' this.formStatus = 'update'
} }
}, },
handlerAdd () { handlerAdd() {
this.resetForm() this.resetForm()
this.formEdit = false this.formEdit = false
this.formStatus = 'create' this.formStatus = 'create'
}, },
handleDelete () { handleDelete() {
this.$confirm('此操作将永久删除, 是否继续?', '提示', { this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -303,7 +308,7 @@ export default { ...@@ -303,7 +308,7 @@ export default {
}) })
}) })
}, },
update () { update() {
putObj(this.form).then(() => { putObj(this.form).then(() => {
this.getList() this.getList()
this.$notify({ this.$notify({
...@@ -314,7 +319,7 @@ export default { ...@@ -314,7 +319,7 @@ export default {
}) })
}) })
}, },
create () { create() {
addObj(this.form).then(() => { addObj(this.form).then(() => {
this.getList() this.getList()
this.$notify({ this.$notify({
...@@ -325,11 +330,11 @@ export default { ...@@ -325,11 +330,11 @@ export default {
}) })
}) })
}, },
onCancel () { onCancel() {
this.formEdit = true this.formEdit = true
this.formStatus = '' this.formStatus = ''
}, },
resetForm () { resetForm() {
this.form = { this.form = {
permission: undefined, permission: undefined,
name: undefined, name: undefined,
...@@ -343,6 +348,6 @@ export default { ...@@ -343,6 +348,6 @@ export default {
} }
} }
} }
} }
</script> </script>
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
@click="handleCreate" @click="handleCreate"
size="small" size="small"
type="primary" type="primary"
icon="el-icon-edit">添加</el-button> icon="el-icon-edit">添加
</el-button>
</template> </template>
<template slot="menu" <template slot="menu"
slot-scope="scope"> slot-scope="scope">
...@@ -80,28 +81,22 @@ ...@@ -80,28 +81,22 @@
<div slot="footer" <div slot="footer"
class="dialog-footer"> class="dialog-footer">
<el-button type="primary" <el-button type="primary"
@click="updatePermession(roleId, roleCode)">更 新</el-button> @click="updatePermession(roleId, roleCode)">更 新
</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {addObj, delObj, fetchList, fetchRoleTree, getObj, permissionUpd, putObj} from '@/api/admin/role'
fetchList, import {fetchTree} from '@/api/admin/menu'
getObj, import {mapGetters} from 'vuex'
addObj, import {tableOption} from '@/const/crud/admin/role'
putObj,
delObj, export default {
permissionUpd,
fetchRoleTree
} from '@/api/admin/role'
import { fetchTree } from '@/api/admin/menu'
import { mapGetters } from 'vuex'
import { tableOption } from '@/const/crud/admin/role'
export default {
name: 'table_role', name: 'table_role',
data () { data() {
return { return {
tableOption: tableOption, tableOption: tableOption,
treeData: [], treeData: [],
...@@ -129,7 +124,7 @@ export default { ...@@ -129,7 +124,7 @@ export default {
roleManager_btn_perm: false roleManager_btn_perm: false
} }
}, },
created () { created() {
this.roleManager_btn_add = this.permissions['sys_role_add'] this.roleManager_btn_add = this.permissions['sys_role_add']
this.roleManager_btn_edit = this.permissions['sys_role_edit'] this.roleManager_btn_edit = this.permissions['sys_role_edit']
this.roleManager_btn_del = this.permissions['sys_role_del'] this.roleManager_btn_del = this.permissions['sys_role_del']
...@@ -139,7 +134,7 @@ export default { ...@@ -139,7 +134,7 @@ export default {
...mapGetters(['elements', 'permissions']) ...mapGetters(['elements', 'permissions'])
}, },
methods: { methods: {
getList (page, params) { getList(page, params) {
this.listLoading = true this.listLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -150,23 +145,23 @@ export default { ...@@ -150,23 +145,23 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
handleRefreshChange () { handleRefreshChange() {
this.getList(this.page) this.getList(this.page)
}, },
handleFilter (param) { handleFilter(param) {
this.page.page = 1; this.page.page = 1;
this.getList(this.page, param); this.getList(this.page, param);
}, },
handleCreate () { handleCreate() {
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
}, },
handleOpenBefore (show, type) { handleOpenBefore(show, type) {
show(); show();
}, },
handleUpdate (row, index) { handleUpdate(row, index) {
this.$refs.crud.rowEdit(row, index); this.$refs.crud.rowEdit(row, index);
}, },
handlePermission (row) { handlePermission(row) {
fetchRoleTree(row.roleId) fetchRoleTree(row.roleId)
.then(response => { .then(response => {
this.checkedKeys = response.data this.checkedKeys = response.data
...@@ -189,7 +184,7 @@ export default { ...@@ -189,7 +184,7 @@ export default {
* @param temp 临时存放节点id的数组 * @param temp 临时存放节点id的数组
* @return 太监节点id数组 * @return 太监节点id数组
*/ */
resolveAllEunuchNodeId (json, idArr, temp) { resolveAllEunuchNodeId(json, idArr, temp) {
for (let i = 0; i < json.length; i++) { for (let i = 0; i < json.length; i++) {
const item = json[i] const item = json[i]
// 存在子节点,递归遍历;不存在子节点,将json的id添加到临时数组中 // 存在子节点,递归遍历;不存在子节点,将json的id添加到临时数组中
...@@ -201,14 +196,14 @@ export default { ...@@ -201,14 +196,14 @@ export default {
} }
return temp return temp
}, },
filterNode (value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
getNodeData (data, done) { getNodeData(data, done) {
done(); done();
}, },
handleDelete (row, index) { handleDelete(row, index) {
delObj(row.roleId).then(response => { delObj(row.roleId).then(response => {
this.list.splice(index, 1); this.list.splice(index, 1);
this.$notify({ this.$notify({
...@@ -219,7 +214,7 @@ export default { ...@@ -219,7 +214,7 @@ export default {
}) })
}) })
}, },
create (row, done, loading) { create(row, done, loading) {
addObj(this.form).then(() => { addObj(this.form).then(() => {
this.getList(this.page) this.getList(this.page)
done(); done();
...@@ -233,7 +228,7 @@ export default { ...@@ -233,7 +228,7 @@ export default {
loading(); loading();
}); });
}, },
update (row, index, done, loading) { update(row, index, done, loading) {
putObj(this.form).then(() => { putObj(this.form).then(() => {
this.getList(this.page) this.getList(this.page)
done(); done();
...@@ -247,7 +242,7 @@ export default { ...@@ -247,7 +242,7 @@ export default {
loading(); loading();
}); });
}, },
updatePermession (roleId, roleCode) { updatePermession(roleId, roleCode) {
this.menuIds = '' this.menuIds = ''
this.menuIds = this.$refs.menuTree.getCheckedKeys().join(',').concat(',').concat(this.$refs.menuTree.getHalfCheckedKeys().join(',')) this.menuIds = this.$refs.menuTree.getCheckedKeys().join(',').concat(',').concat(this.$refs.menuTree.getHalfCheckedKeys().join(','))
permissionUpd(roleId, this.menuIds).then(() => { permissionUpd(roleId, this.menuIds).then(() => {
...@@ -269,5 +264,5 @@ export default { ...@@ -269,5 +264,5 @@ export default {
}) })
} }
} }
} }
</script> </script>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</template> </template>
<script> <script>
import vueJsonEditor from 'vue-json-editor' import vueJsonEditor from 'vue-json-editor'
import {fetchList, putObj, fallback} from '@/api/admin/route' import {fallback, fetchList, putObj} from '@/api/admin/route'
export default { export default {
data() { data() {
...@@ -55,11 +55,11 @@ ...@@ -55,11 +55,11 @@
let result = response.data.data; let result = response.data.data;
for (var i = 0; i < result.length; i++) { for (var i = 0; i < result.length; i++) {
let route = result[i] let route = result[i]
if(route.predicates){ if (route.predicates) {
let predicates = route.predicates let predicates = route.predicates
route.predicates = JSON.parse(predicates) route.predicates = JSON.parse(predicates)
} }
if(route.filters){ if (route.filters) {
let filters = route.filters let filters = route.filters
route.filters = JSON.parse(filters) route.filters = JSON.parse(filters)
} }
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
<el-button type="primary" <el-button type="primary"
@click="handleAdd" @click="handleAdd"
size="small" size="small"
v-if="permissions.generator_syssocialdetails_add">新 增</el-button> v-if="permissions.generator_syssocialdetails_add">新 增
<br /><br /> </el-button>
<br/><br/>
</template> </template>
<template slot-scope="scope" <template slot-scope="scope"
slot="menu"> slot="menu">
...@@ -43,13 +44,15 @@ ...@@ -43,13 +44,15 @@
icon="el-icon-check" icon="el-icon-check"
size="small" size="small"
plain plain
@click="handleEdit(scope.row,scope.index)">编辑</el-button> @click="handleEdit(scope.row,scope.index)">编辑
</el-button>
<el-button type="text" <el-button type="text"
v-if="permissions.generator_syssocialdetails_del" v-if="permissions.generator_syssocialdetails_del"
icon="el-icon-delete" icon="el-icon-delete"
size="small" size="small"
plain plain
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -57,12 +60,13 @@ ...@@ -57,12 +60,13 @@
</template> </template>
<script> <script>
import { fetchList, getObj, addObj, putObj, delObj } from '@/api/admin/sys-social-details' import {addObj, delObj, fetchList, getObj, putObj} from '@/api/admin/sys-social-details'
import { tableOption } from '@/const/crud/admin/sys-social-details' import {tableOption} from '@/const/crud/admin/sys-social-details'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'sys-social-details', name: 'sys-social-details',
data () { data() {
return { return {
tableData: [], tableData: [],
page: { page: {
...@@ -74,14 +78,15 @@ export default { ...@@ -74,14 +78,15 @@ export default {
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created() {
},
mounted: function () {
}, },
mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList (page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -100,10 +105,10 @@ export default { ...@@ -100,10 +105,10 @@ export default {
handleAdd: function () { handleAdd: function () {
this.$refs.crud.rowAdd() this.$refs.crud.rowAdd()
}, },
handleEdit (row, index) { handleEdit(row, index) {
this.$refs.crud.rowEdit(row, index) this.$refs.crud.rowEdit(row, index)
}, },
handleDel (row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function (row, index) { rowDel: function (row, index) {
...@@ -112,11 +117,9 @@ export default { ...@@ -112,11 +117,9 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function () {
return delObj(row.id) return delObj(row.id)
}) }).then(data => {
.then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
...@@ -124,8 +127,8 @@ export default { ...@@ -124,8 +127,8 @@ export default {
type: 'success' type: 'success'
}) })
this.refreshChange() this.refreshChange()
}).catch(function (err) {
}) })
.catch(function (err) { })
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -167,17 +170,17 @@ export default { ...@@ -167,17 +170,17 @@ export default {
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange() {
this.getList(this.page) this.getList(this.page)
}, },
/** /**
* 搜索回调 * 搜索回调
*/ */
searchChange (form) { searchChange(form) {
this.getList(this.page,form) this.getList(this.page, form)
}
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
plain plain
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -41,10 +42,11 @@ ...@@ -41,10 +42,11 @@
</template> </template>
<script> <script>
import { fetchList, delObj } from '@/api/admin/token' import {delObj, fetchList} from '@/api/admin/token'
import { tableOption } from '@/const/crud/admin/token' import {tableOption} from '@/const/crud/admin/token'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'token', name: 'token',
data() { data() {
return { return {
...@@ -60,12 +62,13 @@ export default { ...@@ -60,12 +62,13 @@ export default {
}, },
created() { created() {
}, },
mounted: function() { }, mounted: function () {
},
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList(page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -79,25 +82,23 @@ export default { ...@@ -79,25 +82,23 @@ export default {
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function(row, index) { rowDel: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认删除ID为' + row.token_value, '提示', { this.$confirm('是否确认删除ID为' + row.token_value, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function() {
return delObj(row.token_value) return delObj(row.token_value)
}) }).then(data => {
.then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}).catch(function (err) {
}) })
.catch(function(err) { })
}, },
/** /**
* 刷新回调 * 刷新回调
...@@ -106,7 +107,7 @@ export default { ...@@ -106,7 +107,7 @@ export default {
this.getList(this.page) this.getList(this.page)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
@click="handleCreate" @click="handleCreate"
size="small" size="small"
type="primary" type="primary"
icon="el-icon-edit">添加</el-button> icon="el-icon-edit">添加
</el-button>
</template> </template>
<template slot="username" <template slot="username"
slot-scope="scope"> slot-scope="scope">
...@@ -112,16 +113,17 @@ ...@@ -112,16 +113,17 @@
</template> </template>
<script> <script>
import { fetchList, getObj, addObj, putObj, delObj } from "@/api/admin/user"; import {addObj, delObj, fetchList, getObj, putObj} from "@/api/admin/user";
import { deptRoleList } from "@/api/admin/role"; import {deptRoleList} from "@/api/admin/role";
import { fetchDeptTree } from "@/api/admin/dept"; import {fetchDeptTree} from "@/api/admin/dept";
import { tableOption } from '@/const/crud/admin/user'; import {tableOption} from '@/const/crud/admin/user';
import { mapGetters } from "vuex"; import {mapGetters} from "vuex";
import { constants } from 'fs'; import {constants} from 'fs';
import { connect } from 'tls'; import {connect} from 'tls';
export default {
export default {
name: "table_user", name: "table_user",
data () { data() {
return { return {
treeOption: { treeOption: {
nodeKey: 'id', nodeKey: 'id',
...@@ -161,37 +163,27 @@ export default { ...@@ -161,37 +163,27 @@ export default {
...mapGetters(["permissions"]) ...mapGetters(["permissions"])
}, },
watch: { watch: {
role () { role() {
this.form.role = this.role this.form.role = this.role
} }
}, },
filters: { created() {
statusFilter (status) {
const statusMap = {
0: "有效",
1: "无效",
9: "锁定"
};
return statusMap[status];
}
},
created () {
this.sys_user_add = this.permissions["sys_user_add"]; this.sys_user_add = this.permissions["sys_user_add"];
this.sys_user_edit = this.permissions["sys_user_edit"]; this.sys_user_edit = this.permissions["sys_user_edit"];
this.sys_user_del = this.permissions["sys_user_del"]; this.sys_user_del = this.permissions["sys_user_del"];
this.init(); this.init();
}, },
methods: { methods: {
init () { init() {
fetchDeptTree().then(response => { fetchDeptTree().then(response => {
this.treeData = response.data.data; this.treeData = response.data.data;
}); });
}, },
nodeClick (data) { nodeClick(data) {
this.page.page = 1; this.page.page = 1;
this.getList(this.page, { deptId: data.id }); this.getList(this.page, {deptId: data.id});
}, },
getList (page, params) { getList(page, params) {
this.listLoading = true; this.listLoading = true;
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -202,27 +194,27 @@ export default { ...@@ -202,27 +194,27 @@ export default {
this.listLoading = false; this.listLoading = false;
}); });
}, },
getNodeData (data) { getNodeData(data) {
deptRoleList().then(response => { deptRoleList().then(response => {
this.rolesOptions = response.data.data; this.rolesOptions = response.data.data;
}); });
}, },
handleDept () { handleDept() {
fetchDeptTree().then(response => { fetchDeptTree().then(response => {
this.treeDeptData = response.data.data; this.treeDeptData = response.data.data;
}); });
}, },
handleFilter (param) { handleFilter(param) {
this.page.page = 1; this.page.page = 1;
this.getList(this.page, param); this.getList(this.page, param);
}, },
handleRefreshChange () { handleRefreshChange() {
this.getList(this.page) this.getList(this.page)
}, },
handleCreate () { handleCreate() {
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
}, },
handleOpenBefore (show, type) { handleOpenBefore(show, type) {
window.boxType = type; window.boxType = type;
this.handleDept(); this.handleDept();
if (['edit', 'views'].includes(type)) { if (['edit', 'views'].includes(type)) {
...@@ -238,11 +230,11 @@ export default { ...@@ -238,11 +230,11 @@ export default {
} }
show(); show();
}, },
handleUpdate (row, index) { handleUpdate(row, index) {
this.$refs.crud.rowEdit(row, index); this.$refs.crud.rowEdit(row, index);
this.form.password = undefined this.form.password = undefined
}, },
create (row, done, loading) { create(row, done, loading) {
addObj(this.form).then(() => { addObj(this.form).then(() => {
this.getList(this.page); this.getList(this.page);
done(); done();
...@@ -256,7 +248,7 @@ export default { ...@@ -256,7 +248,7 @@ export default {
loading(); loading();
}); });
}, },
update (row, index, done, loading) { update(row, index, done, loading) {
putObj(this.form).then(() => { putObj(this.form).then(() => {
this.getList(this.page); this.getList(this.page);
done(); done();
...@@ -270,7 +262,7 @@ export default { ...@@ -270,7 +262,7 @@ export default {
loading(); loading();
}); });
}, },
deletes (row, index) { deletes(row, index) {
this.$confirm( this.$confirm(
"此操作将永久删除该用户(用户名:" + row.username + "), 是否继续?", "此操作将永久删除该用户(用户名:" + row.username + "), 是否继续?",
"提示", "提示",
...@@ -301,20 +293,22 @@ export default { ...@@ -301,20 +293,22 @@ export default {
}); });
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.user { .user {
height: 100%; height: 100%;
&__tree { &__tree {
padding-top: 3px; padding-top: 3px;
padding-right: 20px; padding-right: 20px;
} }
&__main { &__main {
.el-card__body { .el-card__body {
padding-top: 0; padding-top: 0;
} }
} }
} }
</style> </style>
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" <el-button type="primary"
@click="submitForm('ruleForm2')">提交</el-button> @click="submitForm('ruleForm2')">提交
</el-button>
<el-button @click="resetForm('ruleForm2')">重置</el-button> <el-button @click="resetForm('ruleForm2')">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -71,17 +72,16 @@ ...@@ -71,17 +72,16 @@
<script> <script>
import { openWindow } from '@/util/util' import {openWindow} from '@/util/util'
import { mapState } from 'vuex' import {mapState} from 'vuex'
import { getToken } from '@/util/auth' import {getToken} from '@/util/auth'
import ElFormItem from 'element-ui/packages/form/src/form-item.vue' import request from '@/router/axios'
import request from '@/router/axios'
export default { export default {
components: { components: {
ElFormItem ElFormItem
}, },
data () { data() {
var validatePass = (rule, value, callback) => { var validatePass = (rule, value, callback) => {
if (this.ruleForm2.password !== '') { if (this.ruleForm2.password !== '') {
if (value === '') { if (value === '') {
...@@ -108,13 +108,13 @@ export default { ...@@ -108,13 +108,13 @@ export default {
newpassword2: '' newpassword2: ''
}, },
rules2: { rules2: {
password: [{ required: true, min: 6, message: '原密码不能为空且不少于6位', trigger: 'change' }], password: [{required: true, min: 6, message: '原密码不能为空且不少于6位', trigger: 'change'}],
newpassword1: [{ required: true, min: 6, message: '新密码不能为空且不少于6位', trigger: 'change' }], newpassword1: [{required: true, min: 6, message: '新密码不能为空且不少于6位', trigger: 'change'}],
newpassword2: [{ required: true, validator: validatePass, trigger: 'blur' }] newpassword2: [{required: true, validator: validatePass, trigger: 'blur'}]
} }
} }
}, },
created () { created() {
this.ruleForm2.username = this.userInfo.username this.ruleForm2.username = this.userInfo.username
}, },
computed: { computed: {
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
}), }),
}, },
methods: { methods: {
submitForm (formName) { submitForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
request({ request({
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
location.reload() // 为了重新实例化vue-router对象 避免bug location.reload() // 为了重新实例化vue-router对象 避免bug
}) })
} else { } else {
this.$router.push({ path: '/' }) this.$router.push({path: '/'})
} }
} else { } else {
this.$notify({ this.$notify({
...@@ -154,8 +154,7 @@ export default { ...@@ -154,8 +154,7 @@ export default {
duration: 2000 duration: 2000
}) })
} }
}) }).catch(() => {
.catch(() => {
this.$notify({ this.$notify({
title: '失败', title: '失败',
message: '修改失败', message: '修改失败',
...@@ -168,22 +167,10 @@ export default { ...@@ -168,22 +167,10 @@ export default {
} }
}) })
}, },
resetForm (formName) { resetForm(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
}, },
toggleShow () { handleClick(thirdpart) {
this.show = !this.show
},
/**
* upload success
*
* [param] jsonData 服务器返回数据,已进行json转码
* [param] field
*/
cropUploadSuccess (jsonData) {
this.$store.commit('SET_AVATAR', jsonData.filename)
},
handleClick (thirdpart) {
let appid, client_id, redirect_uri, url let appid, client_id, redirect_uri, url
redirect_uri = encodeURIComponent(window.location.origin + '/#/authredirect?type=BIND') redirect_uri = encodeURIComponent(window.location.origin + '/#/authredirect?type=BIND')
if (thirdpart === 'wechat') { if (thirdpart === 'wechat') {
...@@ -196,5 +183,5 @@ export default { ...@@ -196,5 +183,5 @@ export default {
openWindow(url, thirdpart, 540, 540) openWindow(url, thirdpart, 540, 540)
} }
} }
} }
</script> </script>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<a :href='props.row.address' <a :href='props.row.address'
target="_blank"> target="_blank">
<img :src="props.row.stars" <img :src="props.row.stars"
alt='star' /> alt='star'/>
</a> </a>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<a :href='scope.row.git' <a :href='scope.row.git'
target="_blank"> target="_blank">
<img :src="scope.row.stars" <img :src="scope.row.stars"
alt='star' /> alt='star'/>
</a> </a>
</template> </template>
<template slot-scope="scope" <template slot-scope="scope"
...@@ -75,17 +75,19 @@ ...@@ -75,17 +75,19 @@
</template> </template>
<script> <script>
import { tableOption } from '@/const/crud/option' import {tableOption} from '@/const/crud/option'
import { tableData } from '@/const/crud/data' import {tableData} from '@/const/crud/data'
export default {
export default {
name: 'crud', name: 'crud',
data () { data() {
return { return {
tableData: tableData, tableData: tableData,
tableOption: tableOption tableOption: tableOption
} }
}, },
mounted: function () { }, mounted: function () {
},
methods: { methods: {
handleDel: function (row, index) { handleDel: function (row, index) {
var _this = this var _this = this
...@@ -102,7 +104,8 @@ export default { ...@@ -102,7 +104,8 @@ export default {
type: 'success' type: 'success'
}) })
}) })
.catch(function (err) { }) .catch(function (err) {
})
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -136,21 +139,23 @@ export default { ...@@ -136,21 +139,23 @@ export default {
done() done()
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-table-expand { .demo-table-expand {
font-size: 0; font-size: 0;
} }
.demo-table-expand label {
.demo-table-expand label {
width: 90px; width: 90px;
color: #99a9bf; color: #99a9bf;
} }
.demo-table-expand .el-form-item {
.demo-table-expand .el-form-item {
margin-right: 0; margin-right: 0;
margin-bottom: 0; margin-bottom: 0;
width: 50%; width: 50%;
} }
</style> </style>
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
icon="el-icon-delete" icon="el-icon-delete"
size="small" size="small"
plain plain
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -43,9 +44,10 @@ ...@@ -43,9 +44,10 @@
</template> </template>
<script> <script>
import { fetchList, getObj, addObj, putObj, delObj } from '@/api/daemon/execution-log' import {addObj, delObj, fetchList, getObj, putObj} from '@/api/daemon/execution-log'
import { tableOption } from '@/const/crud/daemon/execution-log' import {tableOption} from '@/const/crud/daemon/execution-log'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default { export default {
name: 'execution-log', name: 'execution-log',
data() { data() {
...@@ -61,14 +63,15 @@ ...@@ -61,14 +63,15 @@
} }
}, },
created() { created() {
this.page.pageSize=20; this.page.pageSize = 20;
},
mounted: function () {
}, },
mounted: function() { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList(page, params={}) { getList(page, params = {}) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -85,7 +88,7 @@ ...@@ -85,7 +88,7 @@
* @detail 调用crud的handleadd方法即可 * @detail 调用crud的handleadd方法即可
* *
**/ **/
handleAdd: function() { handleAdd: function () {
this.$refs.crud.rowAdd() this.$refs.crud.rowAdd()
}, },
handleEdit(row, index) { handleEdit(row, index) {
...@@ -94,17 +97,15 @@ ...@@ -94,17 +97,15 @@
handleDel(row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function(row, index) { rowDel: function (row, index) {
var _this = this var _this = this
this.$confirm('是否确认删除ID为' + row.id, '提示', { this.$confirm('是否确认删除ID为' + row.id, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function() {
return delObj(row.id) return delObj(row.id)
}) }).then(data => {
.then(data => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
...@@ -112,8 +113,8 @@ ...@@ -112,8 +113,8 @@
type: 'success' type: 'success'
}) })
this.getList(this.page) this.getList(this.page)
}).catch(function (err) {
}) })
.catch(function(err) { })
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -122,7 +123,7 @@ ...@@ -122,7 +123,7 @@
* @param done 为表单关闭函数 * @param done 为表单关闭函数
* *
**/ **/
handleUpdate: function(row, index, done) { handleUpdate: function (row, index, done) {
putObj(row).then(data => { putObj(row).then(data => {
this.tableData.splice(index, 1, Object.assign({}, row)) this.tableData.splice(index, 1, Object.assign({}, row))
this.$message({ this.$message({
...@@ -140,7 +141,7 @@ ...@@ -140,7 +141,7 @@
* @param done 为表单关闭函数 * @param done 为表单关闭函数
* *
**/ **/
handleSave: function(row, done) { handleSave: function (row, done) {
addObj(row).then(data => { addObj(row).then(data => {
this.tableData.push(Object.assign({}, row)) this.tableData.push(Object.assign({}, row))
this.$message({ this.$message({
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
icon="el-icon-delete" icon="el-icon-delete"
size="small" size="small"
plain plain
@click="handleDel(scope.row,scope.index)">删除</el-button> @click="handleDel(scope.row,scope.index)">删除
</el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
...@@ -44,12 +45,13 @@ ...@@ -44,12 +45,13 @@
</template> </template>
<script> <script>
import { fetchList, addObj, putObj, delObj } from '@/api/daemon/status-trace-log' import {addObj, delObj, fetchList, putObj} from '@/api/daemon/status-trace-log'
import { tableOption } from '@/const/crud/daemon/status-trace-log' import {tableOption} from '@/const/crud/daemon/status-trace-log'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
export default {
name: 'status-trace-log', name: 'status-trace-log',
data () { data() {
return { return {
tableData: [], tableData: [],
page: { page: {
...@@ -61,14 +63,15 @@ export default { ...@@ -61,14 +63,15 @@ export default {
tableOption: tableOption tableOption: tableOption
} }
}, },
created () { created() {
},
mounted: function () {
}, },
mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList (page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -87,10 +90,10 @@ export default { ...@@ -87,10 +90,10 @@ export default {
handleAdd: function () { handleAdd: function () {
this.$refs.crud.rowAdd() this.$refs.crud.rowAdd()
}, },
handleEdit (row, index) { handleEdit(row, index) {
this.$refs.crud.rowEdit(row, index) this.$refs.crud.rowEdit(row, index)
}, },
handleDel (row, index) { handleDel(row, index) {
this.$refs.crud.rowDel(row, index) this.$refs.crud.rowDel(row, index)
}, },
rowDel: function (row, index) { rowDel: function (row, index) {
...@@ -99,19 +102,17 @@ export default { ...@@ -99,19 +102,17 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) }).then(function () {
.then(function () {
return delObj(row.clientId) return delObj(row.clientId)
}) }).then(() => {
.then(() => {
_this.tableData.splice(index, 1) _this.tableData.splice(index, 1)
_this.$message({ _this.$message({
showClose: true, showClose: true,
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}).catch(function () {
}) })
.catch(function () { })
}, },
/** /**
* @title 数据更新 * @title 数据更新
...@@ -148,17 +149,17 @@ export default { ...@@ -148,17 +149,17 @@ export default {
done() done()
}) })
}, },
searchChange (form) { searchChange(form) {
this.getList(this.page,form) this.getList(this.page, form)
}, },
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange() {
this.getList(this.page) this.getList(this.page)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -29,24 +29,25 @@ ...@@ -29,24 +29,25 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import {mapGetters} from "vuex";
export default { export default {
name: "dashboard", name: "dashboard",
computed: { computed: {
...mapGetters(["name", "roles"]) ...mapGetters(["name", "roles"])
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.dashboard { .dashboard {
&-container { &-container {
margin: 30px; margin: 30px;
} }
&-text { &-text {
font-size: 30px; font-size: 30px;
line-height: 46px; line-height: 46px;
} }
} }
</style> </style>
...@@ -29,10 +29,12 @@ ...@@ -29,10 +29,12 @@
<template slot-scope="scope" <template slot-scope="scope"
slot="menu"> slot="menu">
<el-button type="text" <el-button type="text"
v-if="permissions.sys_client_del"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
plain plain
@click="handleDown(scope.row,scope.index)">生成</el-button> @click="handleDown(scope.row,scope.index)">生成
</el-button>
</template> </template>
</avue-crud> </avue-crud>
...@@ -53,12 +55,13 @@ ...@@ -53,12 +55,13 @@
</template> </template>
<script> <script>
import { fetchList, handleDown } from '@/api/gen/gen' import {fetchList, handleDown} from '@/api/gen/gen'
import { tableOption, formOption } from '@/const/crud/gen/gen' import {formOption, tableOption} from '@/const/crud/gen/gen'
import { mapGetters } from 'vuex' import {mapGetters} from 'vuex'
export default {
name: 'code-generator', export default {
data () { name: 'client',
data() {
return { return {
tableData: [], tableData: [],
formData: {}, formData: {},
...@@ -73,14 +76,15 @@ export default { ...@@ -73,14 +76,15 @@ export default {
formOption: formOption formOption: formOption
} }
}, },
created () { created() {
},
mounted: function () {
}, },
mounted: function () { },
computed: { computed: {
...mapGetters(['permissions']) ...mapGetters(['permissions'])
}, },
methods: { methods: {
getList (page,params) { getList(page, params) {
this.tableLoading = true this.tableLoading = true
fetchList(Object.assign({ fetchList(Object.assign({
current: page.currentPage, current: page.currentPage,
...@@ -98,19 +102,19 @@ export default { ...@@ -98,19 +102,19 @@ export default {
/** /**
* 刷新回调 * 刷新回调
*/ */
refreshChange () { refreshChange() {
this.getList(this.page) this.getList(this.page)
}, },
searchChange (form) { searchChange(form) {
this.getList(this.page,form) this.getList(this.page, form)
}, },
gen (form) { gen(form) {
handleDown(this.formData).then(response => { handleDown(this.formData).then(() => {
this.box = true this.box = true
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -19,14 +19,15 @@ ...@@ -19,14 +19,15 @@
<div class="execution"> <div class="execution">
<basic-container> <basic-container>
<avue-crud :data="data" <avue-crud :data="data"
:option="option" /> :option="option"/>
</basic-container> </basic-container>
</div> </div>
</template> </template>
<script> <script>
import request from '@/router/axios' import request from '@/router/axios'
export default {
data () { export default {
data() {
return { return {
obj: {}, obj: {},
data: [], data: [],
...@@ -49,7 +50,7 @@ export default { ...@@ -49,7 +50,7 @@ export default {
} }
} }
}, },
created () { created() {
request({ request({
url: '/tx/admin/avueSetting', url: '/tx/admin/avueSetting',
method: 'get' method: 'get'
...@@ -57,5 +58,5 @@ export default { ...@@ -57,5 +58,5 @@ export default {
this.data = resp.data this.data = resp.data
}) })
} }
} }
</script> </script>
...@@ -23,8 +23,9 @@ ...@@ -23,8 +23,9 @@
</div> </div>
</template> </template>
<script> <script>
import request from '@/router/axios' import request from '@/router/axios'
export default {
export default {
data() { data() {
return { return {
obj: {}, obj: {},
...@@ -64,5 +65,5 @@ export default { ...@@ -64,5 +65,5 @@ export default {
this.data = resp.data this.data = resp.data
}) })
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment