Commit f9d23d22 authored by 刘弈臻's avatar 刘弈臻

前端页面

parent 72ac9948
package com.govmade.modules.system.controller;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -43,6 +44,13 @@ public class MenuController extends AbstractController {
return R.ok().put("page", page);
}
@GetMapping("/menuList")
public R queryMenuList() {
List<MenuEntity> queryMenuList=menuService.queryMenuList();
return R.ok().put("data", queryMenuList);
}
/**
* 保存或更新菜单
......
package com.govmade.modules.system.controller;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -19,6 +20,8 @@ import com.govmade.modules.basic.controller.AbstractController;
import com.govmade.modules.system.entity.ModuleEntity;
import com.govmade.modules.system.service.ModuleService;
import io.swagger.annotations.ApiOperation;
/**
* 系统管理 - 模块设置
*
......@@ -42,6 +45,12 @@ public class ModuleController extends AbstractController{
return R.ok().put("page", page);
}
@GetMapping("moduleList")
public R moduleList() {
List<ModuleEntity> modulelist = moduleService.queryModuleList();
return R.ok().put("data", modulelist);
}
/**
* 保存或更新模块
*/
......@@ -71,5 +80,5 @@ public class ModuleController extends AbstractController{
moduleService.deleteBatch(ids);
return R.ok();
}
}
......@@ -31,4 +31,9 @@ public interface MenuDao extends BaseMapper<MenuEntity> {
* 查询树形数据
*/
List<MenuEntity> listTree(@Param("params") Map<String, Object> params);
/**
* 查询菜单列表
*/
List<MenuEntity> menuList();
}
package com.govmade.modules.system.service;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -18,7 +19,9 @@ import com.govmade.modules.system.entity.MenuEntity;
*/
public interface MenuService extends IService<MenuEntity> {
/**
* 菜单树形结构
*/
PageTreeUtils queryPage(Map<String, Object> params);
/**
......@@ -37,4 +40,9 @@ public interface MenuService extends IService<MenuEntity> {
* 删除菜单
*/
void deleteBatch(Set<Long> ids);
/**
* 菜单列表
*/
List<MenuEntity> queryMenuList();
}
package com.govmade.modules.system.service;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -34,4 +35,9 @@ public interface ModuleService extends IService<ModuleEntity>{
*模块查重
*/
Integer checkModule(String name);
/**
* 模块列表
*/
List<ModuleEntity> queryModuleList();
}
......@@ -58,18 +58,16 @@ public class MenuServiceImpl extends ServiceImpl<MenuDao, MenuEntity> implements
}
}
return mList;
}
}
/**
* 获取所有菜单列表
* 获取侧边菜单列表
*/
private List<MenuEntity> queryAll(List<Long> menuIdList){
//查询根菜单列表
//List<MenuEntity> menuList = queryListParentId(0L, menuIdList);
//递归获取子菜单
// getMenuTreeList(menuList, menuIdList);
return null;
@Override
public List<MenuEntity> queryMenuList(){
List<MenuEntity> menuList=this.baseMapper.menuList();
List<MenuEntity> list=buildAreaTree(menuList,0L);
return list;
}
@Override
......
package com.govmade.modules.system.service.impl;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -38,6 +39,12 @@ public class ModuleServiceImpl extends ServiceImpl<ModuleDao, ModuleEntity> impl
}
@Override
public List<ModuleEntity> queryModuleList(){
return super.selectList(new EntityWrapper<ModuleEntity>().eq("state", 1));
}
@Override
public void save(ModuleEntity module) {
super.insertOrUpdate(module);
}
......
......@@ -36,5 +36,23 @@
)
ORDER BY id
</select>
<select id="menuList" resultType="MenuEntity">
SELECT * FROM system_menus a
WHERE a.type IN (0,1)
AND a.state =1
</select>
</mapper>
\ No newline at end of file
This diff is collapsed.
var kDialog = Vue.extend({
template:
'<el-dialog' +
' :append-to-body="appendToBody"' +
' :title="title"' +
' :width="newWidth"' +
' :modal="modal"' +
' :show-close="showClose"' +
' :close-on-press-escape="closeOnPressEscape"' +
' :close-on-click-modal="closeOnClickModal"' +
' :lock-scroll="lockScroll"' +
' :visible.sync="dialogVisible"' +
' :before-close="beforeCloseHandle"' +
' @open="openDialogHandle"' +
' @close="closeDialogHandle">' +
' <div class="dialog-body" :style="bodyStyle" ref="dialogBody">' +
' <slot></slot>' +
' </div>' +
' <div slot="footer" class="dialog-footer" v-if="isBtnGroup">' +
' <el-button' +
' v-for="(item, index) in btnGroup"' +
' :key="item.name"' +
' :type="btnTypes[index]"' +
' @click="clickHandle(item.fn)">' +
' {{item.name}}' +
' </el-button>' +
' </div>' +
'</el-dialog>',
data () {
return {
dialogVisible: false,
btnTypes: ['', 'primary', 'warning', 'info', 'success', 'danger']
}
},
props: {
// Dialog 的标题
title: {
type: String,
default: '提示'
},
// Dialog 的宽度 dialog大小:large, middle, small, mini
width: {
type: String,
default: '50%'
},
// 是否为全屏 Dialog
fullscreen: {
type: Boolean,
default: false
},
// 是否需要遮罩层
modal: {
type: Boolean,
default: true
},
// 是否在 Dialog 出现时将 body 滚动锁定
lockScroll: {
type: Boolean,
default: true
},
// 是否可以通过点击 modal 关闭 Dialog
closeOnClickModal: {
type: Boolean,
default: false
},
// 是否可以通过按下 ESC 关闭 Dialog
closeOnPressEscape: {
type: Boolean,
default: false
},
// 是否显示关闭按钮
showClose: {
type: Boolean,
default: true
},
// 是否需要按钮组
isBtnGroup: {
type: Boolean,
default: false
},
// 按钮组
btnGroup: {
type: Array,
default () {
return [
{
name: '取消',
fn: 'cancel-handle'
},
{
name: '确认',
fn: 'confirm-handle'
}
]
}
},
// body自定义样式
bodyStyle: {
type: Object,
default () {
return {}
}
},
appendToBody: {
type: Boolean,
default: false
}
},
computed: {
newWidth () {
var self = this
var size = [{name: 'large', width: '80%'}, {name: 'middle', width: '65%'}, {name: 'small', width: '50%'}, {name: 'mini', width: '30%'}]
var data = size.filter(function(item) {
return item.name === self.width
});
return data.length === 0 ? this.width : data[0].width
}
},
methods: {
open () {
this.dialogVisible = true
},
close () {
this.dialogVisible = false
},
// 关闭前的回调,会暂停 Dialog 的关闭
beforeCloseHandle (done) {
this.$emit('before-close-handle', done)
this.close()
},
// Dialog 打开的回调
openDialogHandle () {
this.$emit('open-dialog-handle')
},
// Dialog 关闭的回调
closeDialogHandle () {
var self = this
setTimeout(function () {
self.$refs.dialogBody.scrollTo(0, 0)
}, 100)
this.$emit('close-dialog-handle')
this.close()
},
// 自定义方法
clickHandle (fn) {
this.$emit(fn)
}
}
})
Vue.component('kDialog', kDialog)
var kDetail = Vue.extend({
template:
'<el-form' +
' :label-width="labelWidth"' +
' class="detail-form">' +
' <template v-for="item in currentProps">' +
' <el-form-item' +
' :label="item.label"' +
' v-if="!isArray(item) && item.inputType === \'tree\' && item.show == null ? true : item.show"' +
' :key="item.prop">' +
' <el-tree' +
' :ref="item.prop + \'Tree\'"' +
' :check-strictly="item.checkStrictly || false"' +
' :data="item.options"' +
' show-checkbox' +
' default-expand-all' +
' node-key="id"' +
' highlight-current' +
' :props="item.defaultProps || treeDefaultProps">' +
' </el-tree>' +
' </el-form-item>' +
' <el-form-item' +
' :label="item.label"' +
' v-else-if="!isArray(item) && item.show == null ? true : item.show"' +
' :key="item.prop">' +
' <span class="ellipsis text">' +
' {{(data[data[item.prop + detailName] != null ? item.prop + detailName : item.prop])}}' +
' </span>' +
' </el-form-item>' +
' <el-form-item' +
' class="moreStyle"' +
' :label="item[0].label"' +
' v-else-if="isArray(item) && item.show == null ? true : item.show"' +
' :key="item[0].prop">' +
' <el-col' +
' :span="12"' +
' v-for="result in item"' +
' :key="result.prop">' +
' <span class="ellipsis text" v-if="result.show == null ? true : item.show">' +
' {{(data[data[result.prop + detailName] != null ? result.prop + detailName : result.prop])}}' +
' </span>' +
' </el-col>' +
' </el-form-item>' +
' </template>' +
'</el-form>',
data () {
return {
treeDefaultProps: {
children: 'children',
label: 'label'
},
currentProps: []
}
},
props: {
labelWidth: {
type: String,
default: '100px'
},
props: {
type: Array,
default () {
return []
}
},
data: {
type: Object,
default () {
return {}
}
},
detailName: {
type: String,
default: 'ForShow'
}
},
watch: {
props: {
handler (newVal) {
this.currentProps = clonedeep(newVal)
this.currentProps.forEach(function (item) {
if (item.inputType === 'tree') {
item.options = toggleDisabled(item.options, true)
}
})
},
immediate: true
}
},
methods: {
isArray (val) {
return isArray(val)
},
// 初始化tree
initTree (prop, val) {
prop = prop + 'Tree'
val = val || []
this.$refs[prop][0].setCheckedKeys(val)
},
// 打开弹窗记录数据tree
openInitTree (prop) {
let val = []
if (this.data[prop]) {
val = this.data[prop]
}
this.initTree(prop, val)
}
}
})
Vue.component('kDetail', kDetail)
This diff is collapsed.
var kLogDetail = Vue.extend({
template:
'<el-form :label-width="labelWidth" class="klogdetail detail-form">' +
'<el-form-item :label="item.split(\':\')[0]" v-for="item in data" :key="item">' +
'<span class="ellipsis">' +
'{{item.split(\':\')[1] || \'\'}}' +
'</span>' +
'</el-form-item>' +
'</el-form>',
data () {
return {
}
},
props: {
data: {
type: Array,
default: []
},
labelWidth: {
type: String,
default: '100'
}
}
})
Vue.component('kLogDetail', kLogDetail)
var subMenu = Vue.extend({
template:
'<el-submenu' +
' v-if="menu.children && menu.children.length >= 1"' +
' :index="menu.id">' +
' <template slot="title">' +
' <i class="iconfont" :class="menu.icon"></i>' +
' <span>{{ menu.name }}</span>' +
' </template>' +
' <sub-menu @current-menu="currentMenu"' +
' v-for="subMenu in menu.children"' +
' :key="subMenu.id"' +
' :menu="subMenu">' +
' </sub-menu>' +
'</el-submenu>' +
'<el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu)">' +
' <i class="iconfont" :class="menu.icon"></i>' +
' <span>{{ menu.name }}</span>' +
'</el-menu-item>',
props: {
menu: {
type: Object
}
},
data () {
return {
}
},
methods: {
// 菜单切换
gotoRouteHandle (menu) {
var name = menu.name
var path = menu.path
var id = menu.id
if (isArray(tabList)) {
if (tabList.length > 0) {
if (this.hasTab(id)) {
this.$emit('current-menu', tabList, id, true)
} else {
tabList.push(menu)
this.$emit('current-menu', tabList, id)
}
} else {
this.$emit('current-menu', [menu], id)
}
}
},
hasTab (id) {
var isTab = false
for (var i = 0, len = tabList.length; i < len; i++) {
if (tabList[i].id === id) {
isTab = true
break
}
}
return isTab
},
currentMenu (tabList, id, status) {
this.$emit('current-menu', tabList, id, status)
}
}
})
Vue.component('subMenu', subMenu)
var kTab = Vue.extend({
template:
'<el-tabs type="border-card" class="tab">' +
'<el-tab-pane :label="item.label" v-for="item in data" :key="item.label">' +
'<el-row :gutter="10">' +
'<el-col :span="8" v-for="item1 in item.data" :key="item1.id" class="item ellipsis">' +
'<span style="cursor: pointer;" @click="click(item1)">{{ item1[name] + count(item1.count) }}</span>' +
'</el-col>' +
'</el-row>' +
'</el-tab-pane>' +
'</el-tabs>',
props: {
data: {
type: Array
},
name: {
type: String,
default: 'nameCn'
}
},
data () {
return {
}
},
mounted () {
},
methods: {
count (val) {
if (!val) {
return ''
}
return '(' + val + ')'
},
click (item) {
this.$emit('open-table', item)
}
}
})
Vue.component('kTab', kTab)
This diff is collapsed.
这是首页吗
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="public/js/lib/element-ui/index.css">
<link rel="stylesheet" href="public/css/common.css">
<title></title>
</head>
<body>
<div id="app" v-loading.fullscreen.lock="fullscreenLoading">
<!-- 头部 -->
<div class="main-header" :class="{'mini-show': sidebarFold}">
<h1 class="logo-wrapper pull-left">
<a href="./sysIndex.html" class="logo-brand-lg">
<img src="public/img/logo.png" alt="logo">
<span v-text="'数据基因'"></span>
</a>
<a href="./sysIndex.html" class="logo-brand-mini">
<img src="public/img/logo.png" alt="logo">
</a>
</h1>
<div class="header-body">
<div class="menu-bar" @click="sidebarFold = !sidebarFold">
<i class="iconfont" :class="menuIcon"></i>
</div>
<ul class="header-nav pull-right">
<li class="item avatar pull-left">
<el-dropdown>
<span class="el-dropdown-link">
<span class="avatar-img"><img src="public/img/logo1.png" alt="avatar"></span>
<span class="name" v-text="username"></span>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<a href="" v-text="'修改密码'"></a>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
<li class="item pull-left count">
<el-dropdown>
<span class="el-dropdown-link">
<el-badge :value="infoData.all" class="item-badge">
<i class="iconfont icon-youjian3"></i>
</el-badge>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<a href="#">
<span v-text="'目录共'"></span><span class="red" v-text="infoData.count"></span><span v-text="'条代办'"></span>
</a>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
<li class="item pull-left">
<i class="iconfont icon-shezhi1"></i>
</li>
<li class="item pull-left" @click="logout">
<i class="iconfont icon-icon1"></i>
</li>
</ul>
</div>
</div>
<!-- 头部 -->
<!-- 菜单 -->
<aside class="main-nav" :class="{'mini-show': sidebarFold}">
<template v-if="!sidebarFold">
<el-menu :default-active="defaultActive">
<sub-menu
v-for="menu in menuList"
:key="menu.id"
:menu="menu"
@current-menu="currentMenu">
</sub-menu>
</el-menu>
</template>
<template v-else>
<nav class="mini-nav-wrapper">
<a :href="item.path" :key="item.id" v-for="item in mainIndexList">
<i class="iconfont" :class="item.remarks"></i>
</a>
</nav>
</template>
</aside>
<!-- 菜单 -->
<!-- 主体 -->
<div class="main-content" :class="{'mini-show': sidebarFold}">
<div class="main-wrapper" :class="{'has-tab': tabList.length > 0}">
<el-tabs
v-show="tabList.length > 0"
v-model="mainTabsActiveName"
:closable="true"
type="card"
class="main-tab"
@tab-click="selectedTabHandle"
@tab-remove="removeTabHandle">
<el-tab-pane
:key="item.id"
v-for="item in tabList"
:label="item.name"
:name="item.id"
>
<el-card class="box-card">
<iframe :src="item.url" width="100%" height="100%" frameborder="0" scrolling="yes" :style="{ 'min-height': (documentClientHeight - 75) + 'px' }">
</iframe>
</el-card>
</el-tab-pane>
</el-tabs>
<el-card class="box-card" v-show="tabList.length === 0">
<iframe
:src="mainPath"
:style="siteContentViewHeight"
width="100%" height="100%" frameborder="0" scrolling="yes">
</iframe>
</el-card>
</div>
</div>
<!-- 主体 -->
</div>
<script src="public/js/lib/jquery.min.js"></script>
<script src="public/js/lib/vue.min.js"></script>
<script src="public/js/lib/element-ui/index.js"></script>
<script src="component/menu/subMenu.js"></script>
<script src="public/js/util/index.js"></script>
<script>
var headerHeight = 55
var tabHeight = 40
var paddingHeight = 15
var app = new Vue({
el: '#app',
data: function() {
return {
// tab最大个数
maxLengthTabMenu: 5,
loginSrc: '',
// 主页面高度
documentClientHeight: 300,
// 是否启动loading
fullscreenLoading: false,
// 选中目录
defaultActive: '',
// 菜单
menuList: [],
// 最大菜单数量
maxMenu: 5,
// 主菜单
mainIndexList: [],
// 菜单收缩
sidebarFold: false,
// tab菜单
tabList: [],
// tab 显示页面
mainTabsActiveName: 1,
// 用户名
username: 'username',
// 主页面路劲
mainPath: 'page/system/user/index.html',
// 代办
infoData: {
all: 0,
count: 0
}
}
},
computed: {
siteContentViewHeight: function() {
var height = this.documentClientHeight - headerHeight + 20
return { minHeight: height + 'px' }
},
menuIcon: function() {
return this.sidebarFold ? 'icon-liebiaozhankai' : 'icon-liebiaoshouqi'
}
},
created: function() {
this.resetDocumentClientHeight()
this.getMenuData()
this.getMenuIndex()
},
watch: {
tabList: {
handler (newVal) {
if (newVal.length > this.maxLengthTabMenu) {
newVal.shift()
this.tabList = newVal
}
},
deep: true
}
},
methods: {
// 菜单数据
getMenuData: function() {
this.fullscreenLoading = true
var self = this
api({
url: '/system/menu/menuList',
type: 'get',
successFuc: function (res) {
self.menuList = res.data
self.fullscreenLoading = false
menuList = self.menuList
}
})
},
// 主菜单数据
getMenuIndex: function() {
var self = this
api({
url: '/system/module/moduleList',
type: 'get',
successFuc: function (res) {
self.mainIndexList = res.data
}
})
},
// 退出
logout: function() {
var self = this
this.$confirm('确定进行[退出]操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
removeCookie('token')
window.location.href = self.loginSrc;
console.log('退出')
}).catch(function() {})
},
// 重置窗口可视高度
resetDocumentClientHeight: function() {
console.log()
var self = this
this.documentClientHeight = document.documentElement['clientHeight'] - 25
window.onresize = function() {
self.documentClientHeight = document.documentElement['clientHeight'] - 25
}
},
// tabs, 选中tab
selectedTabHandle: function (tab) {
},
// tabs, 删除tab
removeTabHandle: function (targetName) {
var self = this
this.tabList = this.tabList.filter(function (item) {
return item.id !== targetName
})
if (targetName === this.mainTabsActiveName) {
if (this.tabList.length > 0) {
this.mainTabsActiveName = this.tabList[this.tabList.length - 1].id
}
}
tabList = this.tabList
},
currentMenu: function (data, id, status) {
console.log(data, id, status)
this.tabList = data
this.defaultActive = id + ''
this.mainTabsActiveName = id
defaultActive = this.defaultActive
tabList = this.tabList
if (status) {
var iframe = $('#pane-' + id + ' iframe')
iframe.attr('src', iframe.attr('src'))
}
},
setMaxMenu: function() {
this.mainIndexList.pop()
}
}
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="public/js/lib/element-ui/index.css">
<link rel="stylesheet" href="public/css/common.css">
<link rel="stylesheet" href="public/css/common/login.css">
<title>登录页</title>
</head>
<body>
<div id="app">
<div class="login-container main-container">
<div class="main-wrapper">
<h1 class="main-logo login-logo">
<img src="public/img/logo-login.png" alt="logo">
<span>数据指挥控制中心</span>
</h1>
<div class="main-slogan">
<h2>
<span>为数据管理赋权</span><span>数据应用赋能</span><span>数据资产赋值</span>
</h2>
<p>规范编辑 / 智能管理 / 关联应用 / 共享开放</p>
</div>
<div class="login-box">
<p class="error" v-text="errorMsg"></p>
<el-form ref="form"
:model="dataForm"
:rules="dataRule"
status-icon
@keyup.enter.native="dataFormSubmit()"
label-width="0">
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="请输入用户名"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password" placeholder="请输入密码"></el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha" placeholder="请输入验证码"></el-input>
</el-col>
<el-col :span="6">
<img :src="captchaPath" alt="aptcha">
</el-col>
</el-row>
</el-form-item>
<el-button type="primary" class="btn-block" :disabled="btnDisabled" @click="dataFormSubmit()"><span v-text="'登录'"></span></el-button>
</el-form>
</div>
<footer class="copyright" v-text="'国脉海洋信息发展有限公司 版权所有'"></footer>
</div>
</div>
</div>
<script src="public/js/lib/jquery.min.js"></script>
<script src="public/js/lib/vue.min.js"></script>
<script src="public/js/lib/element-ui/index.js"></script>
<script src="public/js/util/index.js"></script>
<script>
var app = new Vue({
el: '#app',
data: function() {
return {
errorMsg: '',
btnDisabled: false,
dataForm: {
userName: '',
password: '',
captcha: ''
},
dataRule: {
userName: [
{ required: true, message: '帐号不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
captcha: [
{ required: true, message: '验证码不能为空', trigger: 'blur' }
]
},
captchaPath: ''
}
},
methods: {
// 提交表单
dataFormSubmit: function() {
this.errorMsg = ''
this.$refs.form.validate(function(valid) {
if (valid) {
this.btnDisabled = true
console.log('验证通过')
api({
url: '',
type: 'post',
data: this.dataForm,
successFuc: function(data) {
this.btnDisabled = false
setCookie('token', data.token)
},
failFuc: function(res) {
this.errorMsg = data.msg
this.dataForm.password = ''
this.dataForm.captcha = ''
this.btnDisabled = false
}
})
} else {
console.log('验证不通过')
return false
}
})
}
}
})
</script>
</body>
</html>
var matter = [{
matterName: '', // 事项名称
matterCode: '', // 事项代码
matterType: '' // 事项类型
}]
// 服务对象
var varviceObject = [{
value: 0,
label: '自然人'
}, {
value: 1,
label: '机关'
}, {
value: 2,
label: '事业单位'
}, {
value: 3,
label: '企业'
}, {
value: 4,
label: '社会团体'
}, {
value: 5,
label: '其他组织'
}]
// 行使层级
var exerciseLevel = [{
value: 0,
label: '国家级'
}, {
value: 1,
label: '省级'
}, {
value: 2,
label: '市级'
}, {
value: 3,
label: '县级(市、区)'
}, {
value: 4,
label: '乡级(镇、街道)'
}, {
value: 5,
label: '村级(社区)'
}]
// 行使类型
var exerciseType = [{
value: 0,
label: '本级保留'
}, {
value: 1,
label: '上级委托'
}, {
value: 2,
label: '审核转报'
}]
// 实施主体性质
var subjectProperty = [{
value: 0,
label: '法定机关'
}, {
value: 1,
label: '授权组织'
}, {
value: 2,
label: '受委托组织'
}]
// 联办机构列表
var JointAgencyList = [{
value: 0,
label: '工商行政管理局'
}, {
value: 1,
label: '安全生产监督管理局'
}]
// 是否存在联办机构
var hasJointAgency = [{
value: 0,
label: '不存在'
}, {
value: 1,
label: '存在'
}]
let tableList = [
{
'id': 7,
'createBy': null,
'createName': null,
'createDate': null,
'updateBy': null,
'updateName': null,
'updateDate': null,
'remarks': '备注7',
'state': 1,
'deptId': 49,
'deptName': '市民政局',
'auditDept': 0,
'sysId': 1,
'sysName': null,
'code': 'G32657',
'nameCn': '低保对象医疗费结算',
'nameEn': 'dbdxylfjs',
'deptCode': '600000018',
'summary': '摘要7',
'formatType1': 1,
'formatType1ForShow': 11,
'formatType2ForShow': 32,
'buttMode': 1,
'classify': '2',
'areaId': null,
'topicClassify': '',
'classifyValue': null,
'topicClassifyValue': null,
'tbName': 'drs_info7',
'updateFrequency': 1,
'releaseDate': '2018-03-30',
'auditState': 2,
'states': null,
'reason': '111',
'isAuthorize': null,
'eleList': [
{
'id': 1695,
'createBy': null,
'createName': null,
'createDate': null,
'updateBy': null,
'updateName': null,
'updateDate': null,
'remarks': '备注7',
'state': 1,
'nameCn': '性别',
'nameEn': 'infotype7',
'infoId': 7,
'infoName': null,
'dataType': 1,
'length': '80',
'decimals': '2',
'areaId': null,
'deptId': 49,
'deptName': null,
'shareType': 1,
'shareCondition': '条件7',
'shareMode1': 1,
'shareMode2': 1,
'isOpen': 0,
'openCondition': '条件7',
'auditState': 2,
'comparResult': null,
'isClean': null,
'poolId': null,
'count': null,
'colId': null,
'source': null
}
],
'labelList': [],
'tableId': null,
'ids': null,
'count': null,
'auditBy': 1,
'auditByName': null,
'submitBy': 1,
'submitByName': null,
'sort': 99999,
'downDate': null,
'historyId': 0,
'labelId': null
}
]
var dataList1 = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
dataList1.push(Mock.mock({
'id': '@increment',
'count': '@increment',
'nameCn': '@name'
}))
}
var dataList2 = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
dataList2.push(Mock.mock({
'id': '@increment',
'count': '@increment',
'nameCn': '@name'
}))
}
var dataList3 = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
dataList3.push(Mock.mock({
'id': '@increment',
'count': '@increment',
'nameCn': '@name'
}))
}
function depart () {
return {
// isOpen: false,
url: '/catalog/resourcesCatalog/depart',
type: 'get',
data: {
code: 0,
msg: 'success',
data: dataList1
}
}
}
function classify () {
return {
// isOpen: false,
url: '/catalog/resourcesCatalog/classify',
type: 'get',
data: {
code: 0,
msg: 'success',
data: dataList2
}
}
}
function topicClassify () {
return {
// isOpen: false,
url: '/catalog/resourcesCatalog/topicClassify',
type: 'get',
data: {
code: 0,
msg: 'success',
data: dataList3
}
}
}
function table () {
return {
// isOpen: false,
url: '/catalog/resourcesCatalog/table',
type: 'get',
data: {
code: 0,
msg: 'success',
data: tableList
}
}
}
fnCreate([depart, classify, topicClassify, table], false)
var menuList = [
{
'id': 11,
'name': '系统配置',
'icon': 'icon-shezhi1',
'children': [
{'id': 12, 'name': '菜单管理', 'icon': 'icon-daiban', 'path': '../system/menu/index.html'},
{'id': 16, 'name': '字典管理', 'icon': 'icon-daiban', 'path': '../system/dictionary/index.html'},
{'id': 17, 'name': '行政区划', 'icon': 'icon-jiaoseguanli', 'path': '../system/compartment/index.html'},
{'id': 18, 'name': '参数配置', 'icon': 'icon-jiaoseguanli', 'path': '../system/parame/index.html'},
{'id': 19, 'name': '定时任务管理', 'icon': 'icon-jiaoseguanli', 'path': '../system/time/index.html'},
{'id': 20, 'name': '机构管理', 'icon': 'icon-jiaoseguanli', 'path': '../system/department/index.html'},
{'id': 21, 'name': '角色管理', 'icon': 'icon-jiaoseguanli', 'path': '../system/role/index.html'},
{'id': 22, 'name': '用户管理', 'icon': 'icon-yonghuguanli', 'path': '../system/user/index.html'}
]
},
{
'id': 14,
'name': '系统监控',
'icon': 'icon-plus-datareport',
'children': [
{'id': 15, 'name': '操作日志', 'icon': 'icon-IDCjifang', 'path': '../system/log/index.html'}
]
}
]
function menu () {
return {
url: '/menu',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': menuList
}
}
}
fnCreate([menu], false)
const navList = [
{'id': '1', 'name': '资产普查', 'remarks': 'icon-jianchajihua', 'path': './main.html'},
{'id': '2', 'name': '数据目录', 'remarks': 'icon-mulu1', 'path': './main.html'},
{'id': '3', 'name': '业务事项', 'remarks': 'icon-yewu', 'path': './main.html'},
{'id': '4', 'name': '数源认责', 'remarks': 'icon-duijie', 'path': './main.html'},
{'id': '5', 'name': '数据治理', 'remarks': 'icon-biaozhun', 'path': './main.html'},
{'id': '6', 'name': '数据标签', 'remarks': 'icon-biaoqian', 'path': './main.html'},
{'id': '7', 'name': '服务注册', 'remarks': 'icon-zhuce', 'path': './main.html'},
{'id': '8', 'name': '信息采集', 'remarks': 'icon-xinxicaiji', 'path': './main.html'},
{'id': '9', 'name': '项目管理', 'remarks': 'icon-xiangmu', 'path': './main.html'},
{'id': '10', 'name': '系统配置', 'remarks': 'icon-kaohejilu', 'path': './main.html'}
]
function nav () {
return {
url: '/nav',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': navList
}
}
}
fnCreate([nav], false)
/**
* 创建mock模拟数据
* @param {*} mod 模块
* @param {*} isOpen 是否开启?
*/
function fnCreate (mod, isOpen) {
if (isOpen) {
for (var key in mod) {
(function (res) {
if (res.isOpen !== false) {
Mock.mock(new RegExp(res.url), res.type, function (opts) {
opts['data'] = opts.body ? JSON.parse(opts.body) : null
delete opts.body
console.log('\n')
console.log('%cmock拦截, 请求: ', 'color:blue', opts)
console.log('%cmock拦截, 响应: ', 'color:blue', res.data)
return res.data
})
}
})(mod[key]() || {})
}
} else {
for (var key in mod) {
(function (res) {
Mock.mock('http://123.com' + res.url, res.type, res.data)
})(mod[key]() || {})
}
}
}
var dataList = [
{
'id': 2,
'name': '西安市',
'code': '610100000000',
'comLevel': 2,
'parentId': 0,
'parentName': '顶级菜单',
'sort': 1,
'state': 1,
'level': 1,
'children': [
{
'id': 3,
'name': '未央区',
'code': '610112000000',
'comLevel': 3,
'parentId': 1,
'parentName': '西安市',
'sort': 2,
'state': 1,
'children': [],
'level': 2
}
]
}
]
// 所属行政区划
var areaNameList = [
{
'id': 1,
'name': '西安市',
'code': '610100000000',
'comLevel': 2,
'parentId': 0,
'parentName': '顶级菜单',
'sort': 1,
'state': 1
},
{
'id': 2,
'name': '未央区',
'code': '610112000000',
'comLevel': 3,
'parentId': 1,
'parentName': '西安市',
'sort': 2,
'state': 1
}
]
function list () {
return {
// isOpen: false,
url: '/sys/compartment/list',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'count': dataList.length,
'data': dataList
}
}
}
function areaName () {
return {
// isOpen: false,
url: '/sys/compartment/areaName',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': areaNameList
}
}
}
// 区划级别
function comLevel () {
return {
// isOpen: false,
url: '/sys/compartment/comLevel',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': [
{
id: 1,
label: '省级'
},
{
id: 2,
label: '市级'
},
{
id: 3,
label: '区级'
},
{
id: 4,
label: '街道级'
},
{
id: 5,
label: '村居级'
}
]
}
}
}
fnCreate([list, areaName, comLevel], false)
// 生成数据列表
var dataList = [
{
'id': 1,
'name': '市纪委',
'parentId': 0,
'parentName': '顶级菜单',
'code': '600000019',
'areaId': 1,
'areaName': '西安市',
'level': 0,
'type': 1,
'typeForShow': '行政机关',
'sort': 19
},
{
'id': 2,
'name': '市民政局',
'parentName': '顶级菜单',
'parentId': 0,
'code': '600000018',
'areaId': 1,
'areaName': '西安市',
'level': 0,
'type': 1,
'typeForShow': '行政机关',
'sort': 18
}
]
function list () {
return {
url: '/sys/department/list',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'count': dataList.length,
'data': dataList
}
}
}
// 机构类别
function typeList () {
return {
url: '/sys/department/type',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': [
{
id: 1,
label: '行政机关'
},
{
id: 2,
label: '事业单位'
},
{
id: 3,
label: '社会团体'
},
{
id: 4,
label: '其他组织机构'
}
]
}
}
}
fnCreate([list, typeList], false)
var dataList = [
{
'id': 1,
'remarks': '',
'state': 1,
'parentId': 0,
'name': '是否显示',
'value': 'show_hide',
'type': 1,
'sort': 1,
'level': 1,
'children': [
{
'id': 11,
'remarks': '',
'state': 1,
'parentId': 1,
'name': '显示',
'value': '1',
'type': 2,
'sort': 11,
'level': 2
}
]
}
]
// 获取菜单列表
// sysDictionaryList
function list () {
return {
// isOpen: false,
url: '/sys/dictionary/list',
type: 'get',
data: {
code: 0,
msg: 'success',
count: 20,
data: dataList
}
}
}
// 类型
function getVal () {
return {
// isOpen: false,
url: '/sys/dictionary/type',
type: 'get',
data: {
code: 0,
msg: 'success',
data: [
{
id: 1,
label: '字典'
},
{
id: 2,
label: '字典项'
}
]
}
}
}
fnCreate([list, getVal], false)
// 生成数据列表
var dataList = [
{
'id': 2275,
'username': '系统管理员',
'operation': '编辑',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:52:06',
'content': '编辑 ',
'module': '系统配置',
'menu': '机构管理',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'id;;',
'fieldLog': null,
'objId': null
},
{
'id': 2274,
'username': '系统管理员',
'operation': '编辑',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:49:40',
'content': '编辑 ',
'module': '系统配置',
'menu': '机构管理',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'id;;',
'fieldLog': null,
'objId': null
},
{
'id': 2272,
'username': '系统管理员',
'operation': '新增',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:22:02',
'content': '新增 1. 父级机构 532. parentName 行政审批局3. 名称 公共事务部4. 机构编码 600000101035. 排序 226. 机构类型 17. 所属行政区划 158. compartmentName 高新区',
'module': '系统配置',
'menu': '机构管理',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'parentId;;parentName;;name;;code;;sort;;type;;compartmentId;;compartmentName;;',
'fieldLog': null,
'objId': null
},
{
'id': 2271,
'username': '系统管理员',
'operation': '删除',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:21:39',
'content': '删除 id 为[51]',
'module': '系统配置',
'menu': '机构管理',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': '',
'fieldLog': null,
'objId': null
},
{
'id': 2270,
'username': '系统管理员',
'operation': '新增',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:21:16',
'content': '新增 1. 父级机构 532. parentName 行政审批局3. 名称 公共事务部4. 机构编码 600000101035. 排序 226. 机构类型 17. compartmentName ',
'module': '系统配置',
'menu': '机构管理',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'parentId;;parentName;;name;;code;;sort;;type;;compartmentName;;',
'fieldLog': null,
'objId': null
},
{
'id': 2268,
'username': '工信部',
'operation': '编辑',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:17:23',
'content': '编辑 ',
'module': '我的资产',
'menu': '信息系统',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'id;;',
'fieldLog': null,
'objId': null
},
{
'id': 2267,
'username': '工信部',
'operation': '编辑',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:16:23',
'content': '编辑 1. 排序 1 => 7',
'module': '我的资产',
'menu': '信息系统',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'id;;sort;;',
'fieldLog': null,
'objId': null
},
{
'id': 2266,
'username': '工信部',
'operation': '新增',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:15:48',
'content': '新增 1. 信息系统名称 门户网站2. 归属部门 523. deptName 14. 业务功能 15. 建设级别 16. 使用对象 1037. 网络环境 18. 系统服务器 127.0.0.19. 系统访问地址 https://baidu.com10. 数据库名称 111. 数据库版本 112. 数据库类型 113. 数据规模 114. 系统数据对接方式 115. 数据更新频率 616. 排序 1',
'module': '我的资产',
'menu': '信息系统',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'name;;deptId;;deptName;;businessFunction;;buildLevel;;useObject;;network_envir;;ip;;path;;dbName;;dbVersion;;dbType;;dataScale;;butt_mode;;updateFrequency;;sort;;',
'fieldLog': null,
'objId': null
},
{
'id': 2265,
'username': '系统管理员',
'operation': '新增',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:14:55',
'content': '新增 1. 父级机构 02. parentName 上级机构3. 名称 行政审批局4. 机构编码 6000001015. 排序 216. 机构类型 17. 所属行政区划 158. compartmentName 高新区',
'module': '系统配置',
'menu': '机构管理',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'parentId;;parentName;;name;;code;;sort;;type;;compartmentId;;compartmentName;;',
'fieldLog': null,
'objId': null
},
{
'id': 2264,
'username': '系统管理员',
'operation': '编辑',
'method': null,
'params': null,
'ip': null,
'createDate': '2018-07-10 11:13:50',
'content': '编辑 1. 排序 1 => 7',
'module': '我的资产',
'menu': '信息系统',
'newValues': '父级机构:0;名称:行政审批局;机构编码:600000101;排序:21;机构类型:1;所属行政区划:15',
'oldValues': '父级机构:;名称:;机构编码:;排序:;机构类型:;所属行政区划:',
'paramValues': 'id;;sort;;',
'fieldLog': null,
'objId': null
}
]
// 获取日志列表
function list () {
return {
// isOpen: false,
url: '/sys/log/list',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'count': 20,
'data': dataList
}
}
}
fnCreate([list], false)
// 生成数据列表
var dataList = [
{
'id': 2,
'name': '系统管理',
'icon': 'icon-houtaiguanli',
'parentName': '顶级菜单',
'parentId': 0,
'type': 1,
'sort': 1,
'permission': '11',
'level': 1,
'url': '/sys',
'moduleType': 1,
'children': [
{
'id': 3,
'name': '菜单管理',
'icon': 'icon-dianziqianzhang',
'parentName': '系统管理',
'parentId': 2,
'type': 1,
'sort': 2,
'permission': '11',
'level': 2,
'url': '/sys',
'moduleType': 1,
'children': [
{
'id': 8,
'name': '菜单新增',
'icon': 'add',
'parentName': '菜单管理',
'parentId': 3,
'type': 2,
'sort': 4,
'permission': 'sys:menu:add',
'url': '/sys',
'moduleType': 1,
'level': 3
},
{
'id': 9,
'name': '菜单删除',
'icon': 'delete',
'parentName': '菜单管理',
'parentId': 3,
'type': 2,
'sort': 5,
'permission': 'sys:menu:delete',
'url': '/sys',
'moduleType': 1,
'level': 3
}
]
},
{
'id': 4,
'name': '角色管理',
'icon': 'icon-jiaoseguanli',
'parentName': '系统管理',
'parentId': 2,
'type': 1,
'sort': 3,
'permission': '11',
'level': 2,
'url': '/sys',
'moduleType': 1,
'children': [
{
'id': 10,
'name': '菜单删除',
'icon': 'delete',
'parentName': '角色管理',
'parentId': 4,
'type': 2,
'sort': 6,
'permission': 'sys:role:delete',
'url': '/sys',
'moduleType': 1,
'level': 3
}
]
}
]
},
{
'id': 6,
'name': '系统监控',
'icon': 'icon-jiankong',
'parentName': '顶级菜单',
'parentId': 0,
'type': 0,
'sort': 7,
'permission': '11',
'level': 1,
'url': '/sys',
'moduleType': 1,
'children': [
{
'id': 7,
'name': '操作日志',
'icon': 'icon-IDCjifang',
'parentName': '系统监控',
'parentId': 6,
'type': 1,
'sort': 8,
'permission': '11',
'level': 2,
'url': '/sys',
'moduleType': 1,
'children': [
{
'id': 11,
'name': '菜单删除',
'icon': 'delete',
'parentName': '操作日志',
'parentId': 7,
'type': 1,
'sort': '9',
'permission': 'sys:log:delete',
'url': '/sys',
'moduleType': 1,
'level': 3
}
]
}
]
}
]
// 上级菜单
function parentId () {
return {
url: '/sys/menu/parentId',
type: 'get',
data: {
code: 0,
msg: 'success',
data: [
{
id: 1,
label: '顶级菜单',
children: [
{
id: 2,
label: '系统配置',
children: [
{
id: 3,
label: '菜单管理'
},
{
id: 4,
label: '角色管理'
},
{
id: 5,
label: '用户管理'
}
]
},
{
id: 6,
label: '系统监控',
children: [
{
id: 7,
label: '操作日志'
}
]
}
]
}
]
}
}
}
// 类型
function type () {
return {
url: '/sys/menu/type',
type: 'get',
data: {
code: 0,
msg: 'success',
data: [{id: 1, label: '菜单', value: '1'}, {id: 2, label: '按钮', value: '2'}, {id: 3, label: '目录', value: '3'}]
}
}
}
// 所属模块
function moduleType () {
return {
url: '/sys/menu/moduleType',
type: 'get',
data: {
code: 0,
msg: 'success',
data: [{id: 1, label: '模块1', value: '1'}, {id: 2, label: '模块2', value: '2'}]
}
}
}
// 获取菜单列表
function list () {
return {
url: '/sys/menu/list',
type: 'get',
data: {
code: 0,
msg: 'success',
data: dataList
}
}
}
fnCreate([list, parentId, type, moduleType], false)
function list () {
return {
// isOpen: false,
url: '/sys/parame/list',
type: 'get',
data: {
code: 0,
msg: 'success',
data: {
logo: 'logo',
isGateway: 1,
themeStyle: 1
}
}
}
}
// 获取菜单列表
function skin () {
return {
// isOpen: false,
url: '/sys/parame/skin',
type: 'get',
data: {
code: 0,
msg: 'success',
data: [
{
id: 1,
label: '默认主题'
},
{
id: 2,
label: '蓝色主题'
}
]
}
}
}
fnCreate([list, skin], false)
// 生成数据列表
var dataList = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
dataList.push(Mock.mock({
'id': '@increment',
'name': '@name',
'remark': '@csentence',
'menuIds': [3, 8, 9],
'createTime': '@datetime'
}))
}
// 获取角色列表
function roleList () {
return {
// isOpen: false,
url: '/sys/role/roleList',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'count': dataList.length,
'data': dataList
}
}
}
// 获取角色列表, 根据当前用户
function select () {
return {
// isOpen: false,
url: '/sys/role/select',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'list': dataList
}
}
}
// 获取角色信息
function info () {
return {
// isOpen: false,
url: '/sys/role/info',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'role': dataList[0]
}
}
}
// 添加角色
function add () {
return {
// isOpen: false,
url: '/sys/role/save',
type: 'post',
data: {
'msg': 'success',
'code': 0
}
}
}
// 修改角色
function update () {
return {
// isOpen: false,
url: '/sys/role/update',
type: 'post',
data: {
'msg': 'success',
'code': 0
}
}
}
// 删除角色
function del () {
return {
// isOpen: false,
url: '/sys/role/delete',
type: 'post',
data: {
'msg': 'success',
'code': 0
}
}
}
fnCreate([roleList, select, info, add, update, del], false)
var dataList = [
{
'id': 7,
'beanName': 'quartzTask',
'methodName': 'deleteFile',
'params': '',
'cronExpression': '0 0 11 1/1 * ? ',
'status': 1,
'statusForShow': '暂停',
'remark': '每天早上11点执行',
'createTime': '2018-07-04 16:16:21'
},
{
'id': 6,
'beanName': 'quartzTask',
'methodName': 'run',
'params': '',
'cronExpression': '0/5 * * * * ? ',
'status': 1,
'statusForShow': '暂停',
'remark': '每5秒执行一次',
'createTime': '2018-06-28 11:59:43'
},
{
'id': 4,
'beanName': 'quartzTask',
'methodName': 'targetDown',
'params': '',
'cronExpression': '0 0 0 * * ?',
'status': 1,
'statusForShow': '暂停',
'remark': '指标过期自动下线(每天零时执行)',
'createTime': '2018-06-13 16:10:56'
},
{
'id': 3,
'beanName': 'quartzTask',
'methodName': 'infoDown',
'params': '',
'cronExpression': '0 0 9,17 1/1 * ? ',
'status': 1,
'statusForShow': '暂停',
'remark': '每天早上9点、17点执行',
'createTime': '2018-06-08 09:15:50'
},
{
'id': 2,
'beanName': 'testTask',
'methodName': 'test2',
'params': '',
'cronExpression': '0 0 11 1/1 * ? ',
'status': 1,
'statusForShow': '暂停',
'remark': '每天早上11执行',
'createTime': '2017-06-03 14:55:56'
},
{
'id': 1,
'beanName': 'testTask',
'methodName': 'test',
'params': 'para',
'cronExpression': '0 0 10 1/1 * ? ',
'status': 1,
'statusForShow': '暂停',
'remark': '每天早上10点执行',
'createTime': '2017-06-01 23:16:46'
}
]
function list () {
return {
// isOpen: false,
url: '/sys/time/list',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'count': dataList.length,
'data': dataList
}
}
}
fnCreate([list], false)
// 生成数据列表
var dataList = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
dataList.push(Mock.mock({
'id': '@increment',
'username': '@name',
'email': '@email',
'roleId': 1,
'roleIdForShow': '姓名',
'deptName': 1,
'deptNameForShow': '姓名1',
'realname': Mock.Random.word(),
'telephone': 12345678901,
'companyControl': [5, 8]
}))
}
var roleList = [
{
id: 1,
label: '姓名',
value: '1'
},
{
id: 2,
label: '年龄',
value: '2'
}
]
var deptNameList = [
{
id: 1,
label: '姓名1',
value: '1'
},
{
id: 2,
label: '姓名2',
value: '2'
},
{
id: 3,
label: '姓名3',
value: '3'
}
]
var treeList = [
{
id: 1,
label: '一级 1',
children: [
{
id: 4,
label: '二级 1-1',
children: [
{
id: 9,
label: '三级 1-1-1'
},
{
id: 10,
label: '三级 1-1-2'
}
]
}
]
},
{
id: 2,
label: '一级 2',
children: [
{
id: 5,
label: '二级 2-1'
},
{
id: 6,
label: '二级 2-2'
}
]
},
{
id: 3,
label: '一级 3',
children: [
{
id: 7,
label: '二级 3-1'
},
{
id: 8,
label: '二级 3-2'
}
]
}
]
function list () {
return {
// isOpen: false,
url: '/sys/user/list',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'count': dataList.length,
'data': dataList
}
}
}
// 选择角色数据
function getRole () {
return {
// isOpen: false,
url: '/sys/user/role',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': roleList
}
}
}
// 所属单位数据
function getDeptName () {
return {
// isOpen: false,
url: '/sys/user/deptName',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': deptNameList
}
}
}
// 管理部门数据
function getTree () {
return {
// isOpen: false,
url: '/sys/user/companyControl',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'data': treeList
}
}
}
fnCreate([list, getRole, getDeptName, getTree], false)
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title></title>
</head>
<body>
<div id="app" >
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../js/util/index.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app'
})
</script>
</body>
</html>
var dataElementDialog = {
data: function () {
return {
props2: [
{
label: '中文名称',
prop: 'nameCn'
},
{
label: '英文名称',
prop: 'nameEn'
},
{
label: '数据类型',
prop: 'dataType'
},
{
label: '数据长度',
prop: 'length'
},
{
label: '小数位',
prop: 'decimals'
},
{
label: '共享类型',
prop: 'shareType'
},
{
label: '共享条件',
prop: 'shareCondition'
},
{
label: '共享方式',
prop: 'shareMode1'
},
{
label: '是否向全社会开放',
prop: 'isOpen'
}
],
formData2: {},
dialogVisible2: false
}
},
created: function () {
this.init()
},
methods: {
init: function () {
},
openDialogHandle2: function () {
},
closeDialogHandle2: function () {
},
detailHandle: function (index, row) {
this.$emit('detailData', row)
}
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title>资源目录</title>
</head>
<body>
<div id="app" class="container">
<k-tab :data="data" @open-table="openTable" v-show="visibility"></k-tab>
<div v-show="!visibility">
<el-button @click="back" class="back-btn" v-text="'返回'"></el-button>
<k-table
@size-change-handle="sizeChangeHandle"
@current-change-handle="currentChangeHandle"
@detail-handle="detailHandle"
:table="table"/>
</div>
<k-dialog
ref="resourcesDialog"
:dialog-visible="dialogVisible"
:title="title1"
:width="'65%'"
:is-btn-group="false"
@close-dialog-handle="closeDialogHandle"
@open-dialog-handle="openDialogHandle"
>
<k-detail
label-width="110px"
class="detail"
:props="props"
:data="formData"
/>
<k-table @data-element-detail-handle="dataElementDetailHandle" :table="resourceTable"/>
</k-dialog>
<k-dialog
ref="dataElementDialog"
:dialog-visible="dialogVisible2"
title="信息项详情"
:width="'65%'"
:is-btn-group="false"
@close-dialog-handle="closeDialogHandle2"
@open-dialog-handle="openDialogHandle2"
>
<k-detail
label-width="130px"
class="detail"
:props="props2"
:data="formData2"
/>
</k-dialog>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../component/tab/tab.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/page/catalog/resourcesCatalog/resourcesDialog.js"></script>
<script src="../../../js/page/catalog/resourcesCatalog/dataElementDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/catalog/resourcesCatalog/index.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, resourcesDialog, dataElementDialog],
data: function() {
return {
data: [{
label: '部门类',
data: []
}, {
label: '基础资源分类',
data: []
}, {
label: '主题资源分类',
data: []
}],
table: {
loading: false,
// table数据
data: [],
// table 表头
tr: [{
prop: 'code',
label: '信息资源编码'
}, {
prop: 'nameCn',
label: '信息资源名称'
}],
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 100,
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
label: '详情',
id: 1,
fn: 'detail-handle',
permission: ''
}]
},
pagination: {
total: 10,
page: 1,
limit: 10
}
},
formData: {},
visibility: true,
dataElementData: {}
}
},
created: function() {
this.getDepart()
this.getClassify()
this.getTopicClassify()
},
methods: {
// 部门类
getDepart: function() {
var self = this;
api({
url: '/catalog/resourcesCatalog/depart',
method: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.data[0].data = res.data
}
}
});
},
// 基础资源分类
getClassify: function() {
var self = this;
api({
url: '/catalog/resourcesCatalog/classify',
method: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.data[1].data = res.data
}
}
});
},
// 主题资源分类
getTopicClassify: function() {
var self = this;
api({
url: '/catalog/resourcesCatalog/topicClassify',
method: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.data[2].data = res.data
}
}
});
},
getTableData: function(data) {
let self = this;
api({
url: '/catalog/resourcesCatalog/table',
method: 'get',
// data: data,
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.table.data = res.data
}
}
});
},
openTable: function(item) {
console.log(item)
if (item.count) {
this.getTableData({deptId: item.id})
}
// console.log(item)
this.visibility = !this.visibility
},
// 返回
back: function() {
this.visibility = !this.visibility
},
currentChangeHandle: function(val) {
this.pagination.page = val
// this.getTableData(this.pagination)
console.log('currentChangeHandle', val)
},
sizeChangeHandle: function(val) {
this.pagination.limit = val
// this.getTableData(this.pagination)
console.log('sizeChangeHandle', val)
},
detailHandle: function(index, row) {
this.formData = row
this.title1 = CONFIG.DETAIL
this.$refs.resourcesDialog.open()
},
getChildDetailData: function(row) {
this.dataElementData = row
this.$refs.dataElementDialog.open()
}
}
})
</script>
</body>
</html>
var resourcesDialog = {
data: function () {
return {
dialogVisible: false,
isBtnGroup: false,
props: [
{
label: '信息资源编码',
prop: 'code'
},
{
label: '信息资源名称',
prop: 'nameCn'
},
{
label: '信息资源英文名',
prop: 'nameEn'
},
{
label: '所属系统',
prop: 'sysId'
},
{
label: '信息资源提供方',
prop: 'deptName'
},
{
label: '摘要',
prop: 'summary'
},
[
{
label: '格式分类',
prop: 'formatType1'
},
{
label: '格式分类',
prop: 'formatType2'
}
],
{
label: '基础资源分类',
prop: 'classify'
},
{
label: '主题资源分类',
prop: 'topicClassify'
},
{
label: '数据表英文名称',
prop: 'tbName'
},
{
label: '更新频率',
prop: 'updateFrequency'
},
{
label: '对接方式',
prop: 'buttMode'
},
{
label: '提交日期',
prop: 'releaseDate'
},
{
label: '排序',
prop: 'sort'
}
],
resourceTable: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
prop: 'nameCn',
label: '信息项名称'
}
],
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 100,
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
label: '详情',
id: 1,
fn: 'data-element-detail-handle',
permission: ''
}]
},
pagination: {
hasPagination: false
}
}
}
},
watch: {
formData: {
handler: function (newVal) {
if (newVal.eleList) {
this.resourceTable.data = newVal.eleList
}
},
deep: true
}
},
methods: {
openDialogHandle: function () {
this.$refs.resourcesDialog.open()
},
closeDialogHandle: function () {
this.$refs.resourcesDialog.close()
},
dataElementDetailHandle: function (index, row) {
this.$emit('detailData', row)
}
}
}
.el-input.el-input--suffix .el-input__inner {
text-align: center;
}
.container {
padding: 10px;
}
#administrativeLicensingTable {
padding: 30px 0px 0px 0px;
}
.mainDialogContent {
display: block;
margin: 0 auto;
text-align: center;
width: 80%;
height: 100%;
color: #FF0036;
font-weight: 700;
}
.step {
width: 1100px;
margin: 0 auto;
}
.el-select {
display: block;
}
.el-input-number {
width: 100%;
}
.rows {
padding: 5px 0px;
}
.rows.title {
font-size: 1.1rem;
text-align: center;
font-weight: bold;
color: #333333;
}
.rows-subset {
padding: 0px 0px 10px 0px;
}
.text-r {
text-align: right;
line-height: 40px;
font-size: 0.85rem;
}
.text-c {
text-align: center;
line-height: 40px;
}
.step-header, .step-footer {
width: 1200px;
height: 70px;
margin: 0 auto;
}
.m-r10 {
margin-right: 10px;
}
.step-header .lside {
width: 80%;
float: left;
}
.step-header .rside {
width: 20%;
float: left;
text-align: right;
}
.step-header .rside .btn {
font-size: 0.95rem;
padding-right: 0px;
}
.lineH1 {
line-height: 1
}
.upload-list-box {
position: relative;
height: 38px;
width: calc(100% - 20px);
border-radius: 5px;
border: 1px #409EFF dotted;
}
.special-btn {
width: 100%;
}
.special-box-s1 {
padding: 10px;
border: 1px #409EFF dotted;
border-radius: 5px;
font-size: 0.9rem;
}
.special-box-s1 .title {
font-size: 0.85rem;
}
.special-procedure-item {
margin: 10px 10px 0px 10px;
}
.upload-file-box {
width: 80%;
margin: 0 auto;
text-align: center;
}
\ No newline at end of file
const COMPARTMENT = '添加子级行政区划'
var compartmentDialog = {
data: function () {
return {
form: {
parentId: '',
parentName: '',
id: '',
name: '',
comLevel: '',
code: '',
sort: ''
},
props: [
{
label: '上级菜单',
prop: 'parentName',
defaultProp: 'parentId',
inputType: 'inputTree',
defaultProps: {
children: 'children',
label: 'name'
}
},
{
label: '区划名称',
prop: 'name',
inputType: 'input'
},
{
label: '区划代码',
prop: 'code',
inputType: 'input'
},
{
label: '区划级别',
prop: 'comLevel',
inputType: 'select'
},
{
label: '排序',
prop: 'sort',
inputType: 'input'
}
],
rules: {
name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
code: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
comLevel: [
{ required: true, message: '不能为空', trigger: 'change' }
],
sort: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
created: function () {
this.init()
},
methods: {
init: function () {
this.getComLevel()
this.getParentName()
},
getParentName: function () {
let self = this
api({
url: '/sys/compartment/list',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.setOptions('parentName', self.props, res.data)
}
}
})
},
// 类型
getComLevel: function (data = {}) {
var self = this
api({
url: '/sys/compartment/comLevel',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.setOptions('comLevel', self.props, res.data)
}
}
})
},
// Dialog 打开的回调
openDialogHandle: function () {
var self = this
this.$nextTick(function () {
if (self.title1 === COMPARTMENT) {
self.$set(self.props[0], 'reference', false)
}
if (self.title1 === CONFIG.EDIT || self.title1 === CONFIG.ADD || self.title1 === COMPARTMENT) {
self.clearValidate('compartmentForm')
}
if (self.title1 === CONFIG.EDIT) {
self.validate('compartmentForm')
}
})
},
// Dialog 关闭的回调
closeDialogHandle: function () {
if (this.title1 === CONFIG.EDIT || this.title1 === CONFIG.ADD) {
this.clearForm('compartmentForm')
}
if (this.title1 === COMPARTMENT) {
this.props[0].reference = true
}
},
// 确定
confirmHandle: function () {
this.$refs.compartmentForm.submitHandle()
},
submitHandle: function (data) {
this.close('compartmentDialog')
},
// 取消
cancelHandle: function () {
this.close('compartmentDialog')
}
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title>行政区划</title>
</head>
<body>
<div id="app" class="container">
<div class="menu-manage" :style="{ 'min-height': (documentClientHeight - 115) + 'px' }">
<div class="header-layout">
<el-form :inline="true">
<el-form-item>
<el-input v-model="searchContent.name" placeholder="请输入行政区划名称"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchContent.code" placeholder="请输入行政区划代码"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="searchHandle" icon="el-icon-search"><span v-text="'搜索'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addHandle" icon="el-icon-plus"><span v-text="'新增'"></span></el-button>
</el-form-item>
</el-form>
</div>
<div class="body-layout">
<k-table
@size-change-handle="sizeChangeHandle"
@current-change-handle="currentChangeHandle"
@edit-handle="editHandle"
@delete-handle="deleteHandle"
@children-handle="childrenHandle"
:table="tableTree"/>
</div>
<!-- 新增修改详情 -->
<k-dialog
ref="compartmentDialog"
:title="title1"
:width="'middle'"
:is-btn-group="isBtnGroup"
@close-dialog-handle="closeDialogHandle"
@open-dialog-handle="openDialogHandle"
@cancel-handle="cancelHandle"
@confirm-handle="confirmHandle"
>
<template>
<k-form
@submit-handle="submitHandle"
ref="compartmentForm"
:form="form"
:form-props="props"
:rules="rules"
:data="formData"
/>
</template>
</k-dialog>
</div>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../js/icon.js"></script>
<script src="../../../js/page/system/compartment/compartmentDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/compartment.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, compartmentDialog],
data: function() {
return {
searchContent: {
name: '',
code: ''
},
tableTree: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
prop: 'name',
label: '区划名称',
width: 400
},
{
prop: 'code',
label: '区划代码'
},
{
prop: 'sort',
label: '排序'
}
],
hasSelect: false,
tree: {
treeKey: 'name'
},
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 150,
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
label: '子级',
id: 1,
fn: 'children-handle',
permission: ''
}, {
label: '编辑',
id: 2,
fn: 'edit-handle',
permission: ''
}, {
label: '删除',
id: 3,
fn: 'delete-handle',
permission: ''
}]
},
pagination: {
hasPagination: true,
total: 0
}
},
pagination: {
page: 1,
limit: 10
},
formData: {}
}
},
created: function() {
this.getTableTreeData()
},
methods: {
// 搜索
searchHandle: function() {
var data = {name: this.searchContent.name, code: this.searchContent.code}
this.getTableTreeData(data)
},
// 新增
addHandle: function() {
this.title1 = CONFIG.ADD
this.open('compartmentDialog')
},
// 添加子级
childrenHandle: function(index, row) {
var data = clonedeep(row)
var childData = {
parentId: data.id,
parentName: data.name
}
this.formData = childData
this.title1 = '添加子级行政区划'
this.open('compartmentDialog')
console.log('子级', index, row)
},
// 编辑
editHandle: function(index, row) {
this.formData = clonedeep(row)
this.title1 = CONFIG.EDIT
this.open('compartmentDialog')
console.log('编辑', index, row)
},
// 删除
deleteHandle: function(index, row) {
this.$confirm('确定要删除吗').then(function () {
console.log('删除', index, row)
}).catch(function () {})
},
// 获取tabletree数据
getTableTreeData: function(data) {
let self = this;
var data = $.extend(true, data, this.pagination)
this.tableTree.loading = true
console.log(data)
api({
url: '/sys/compartment/list',
type: 'get',
// data: data,
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
var expand = self.tableTree.tree && $.type(self.tableTree.tree.expand) === 'boolean' ? self.tableTree.tree.expand : false
self.tableTree.data = treeDataTranslate(res.data, expand)
self.tableTree.pagination.total = res.count
self.tableTree.loading = false
}
}
})
},
currentChangeHandle: function(val) {
this.pagination.page = val
this.getTableTreeData(this.pagination)
console.log('currentChangeHandle', val)
},
sizeChangeHandle: function(val) {
this.pagination.limit = val
this.getTableTreeData(this.pagination)
console.log('sizeChangeHandle', val)
}
}
})
</script>
</body>
</html>
const departmentDialog = {
data: function () {
return {
form: {
id: '',
name: '',
parentId: '',
parentName: '',
code: '',
areaId: '',
areaName: '',
level: '',
type: '',
sort: ''
},
conpanyControl: [],
props: [
{
label: '上级机构',
prop: 'parentName',
defaultProp: 'parentId',
inputType: 'inputTree',
defaultProps: {
children: 'children',
label: 'name'
},
visible: false
},
{
label: '名称',
prop: 'name',
inputType: 'input'
},
{
label: '所属行政区划',
prop: 'areaName',
defaultProp: 'areaId',
inputType: 'inputTree',
defaultProps: {
children: 'children',
label: 'name'
},
visible: false
},
{
label: '机构类别',
prop: 'type',
inputType: 'select',
options: []
},
{
label: '机构编码',
prop: 'code',
inputType: 'input'
},
{
label: '排序',
prop: 'sort',
inputType: 'input'
}
],
rules: {
parentName: [
{ required: true, message: '不能为空', trigger: 'change' }
],
name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
areaName: [
{ required: true, message: '不能为空', trigger: 'change' }
],
type: [
{ required: true, message: '不能为空', trigger: 'change' }
],
code: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
watch: {
parentIdOptions: {
handler: function (newVal) {
if (newVal && newVal.length > 0) {
this.setOptions('parentName', this.props, newVal)
}
},
immediate: true
}
},
created: function () {
this.getOrganizationType()
this.getCompartmentList()
},
methods: {
// 机构类别
getOrganizationType: function (data) {
var self = this
api({
url: '/sys/department/type',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.setOptions('type', self.props, res.data)
}
}
})
},
// 所属行政区划
getCompartmentList: function (data) {
var self = this
api({
url: '/sys/compartment/areaName',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.setOptions('areaName', self.props, res.data)
}
}
})
},
// Dialog 打开的回调
openDialogHandle: function () {
var self = this
this.$nextTick(function () {
if (self.title1 === CONFIG.EDIT || self.title1 === CONFIG.ADD) {
self.clearValidate('departmentForm')
}
if (self.title1 === CONFIG.EDIT) {
self.validate('departmentForm')
}
})
},
// Dialog 关闭的回调
closeDialogHandle: function () {
var self = this
this.$nextTick(function () {
if (self.title1 === CONFIG.EDIT || self.title1 === CONFIG.ADD) {
self.clearForm('departmentForm')
}
})
},
// 确定
confirmHandle: function () {
this.$refs.departmentForm.submitHandle()
},
submitHandle: function (data) {
this.close('departmentDialog')
},
cancelHandle: function () {
this.close('departmentDialog')
}
}
}
This diff is collapsed.
var ADDCHILD = '添加字典项'
var dictionaryDialog = {
data: function () {
return {
isBtnGroup: false,
searchContent: {
name: ''
},
form: {
parentId: '',
id: '',
name: '',
value: '',
type: '',
sort: ''
},
props: [{
label: '字典名称',
prop: 'name',
inputType: 'input'
},
{
label: '字典值',
prop: 'value',
inputType: 'input'
},
{
label: '类型',
prop: 'type',
inputType: 'select'
},
{
label: '排序',
prop: 'sort',
inputType: 'input'
}
],
rules: {
value: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '不能为空', trigger: 'change' }
],
sort: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
created: function () {
this.getType()
},
methods: {
// 类型
getType: function (data) {
var self = this
api({
url: '/sys/dictionary/type',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.setOptions('type', self.props, res.data)
}
}
})
},
// Dialog 打开的回调
openDialogHandle: function () {
var self = this
this.$nextTick(function () {
if (self.title1 === CONFIG.ADDCHILD || self.title1 === CONFIG.EDIT || self.title1 === CONFIG.ADD) {
self.clearValidate('dictionaryForm')
}
if (self.title1 === CONFIG.EDIT) {
self.validate('dictionaryForm')
}
})
},
// Dialog 关闭的回调
closeDialogHandle: function () {
if (this.title1 === CONFIG.DICTIONARY || this.title1 === CONFIG.EDIT || this.title1 === CONFIG.ADD) {
this.clearForm('dictionaryForm')
}
},
// 确定
confirmHandle: function () {
this.$refs.dictionaryForm.submitHandle()
},
submitHandle: function (data) {
this.close('dictionaryDialog')
},
cancelHandle: function () {
this.close('dictionaryDialog')
}
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title>字典管理</title>
</head>
<body>
<div id="app" class="container">
<div class="header-layout">
<el-form :inline="true">
<el-form-item>
<el-input v-model="searchContent.name" placeholder="请输入字典名称"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="searchHandle" icon="el-icon-search"><span v-text="'搜索'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addHandle" icon="el-icon-plus"><span v-text="'新增'"></span></el-button>
</el-form-item>
</el-form>
</div>
<div class="body-layout">
<k-table
@size-change-handle="sizeChangeHandle"
@current-change-handle="currentChangeHandle"
@edit-handle="editHandle"
@delete-handle="deleteHandle"
@dictionary-children-handle="dictionaryChildrenHandle"
:table="tableTree"/>
</div>
<!-- 弹窗组件 -->
<div>
<k-dialog
ref="dictionaryDialog"
:title="title1"
:is-btn-group="true"
:width="width"
@close-dialog-handle="closeDialogHandle"
@open-dialog-handle="openDialogHandle"
@cancel-handle="cancelHandle"
@confirm-handle="confirmHandle"
>
<template>
<k-form
@submit-handle="submitHandle"
ref="dictionaryForm"
:form="form"
:form-props="props"
:rules="rules"
:data="formData"
/>
</template>
</k-dialog>
</div>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/page/system/dictionary/dictionaryDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/dictionary.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, dictionaryDialog],
data: function() {
return {
width: 'middle',
searchContent: {
name: ''
},
tableTree: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
prop: 'name',
label: '菜单名称',
width: 400
},
{
prop: 'value',
label: '字典值'
},
{
prop: 'sort',
label: '排序'
}
],
hasSelect: false,
tree: {
hasTree: true,
treeKey: 'name',
expand: false,
checkStrictly: true
},
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 150,
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
label: '字典项',
id: 1,
fn: 'dictionary-children-handle',
permission: ''
}, {
label: '编辑',
id: 2,
fn: 'edit-handle',
permission: ''
}, {
label: '删除',
id: 3,
fn: 'delete-handle',
permission: ''
}]
},
pagination: {
hasPagination: true,
total: 0
}
},
pagination: {
page: 1,
limit: 10
},
formData: {}
}
},
created: function() {
this.getTableTreeData()
},
methods: {
searchHandle: function() {
this.getTableTreeData(this.searchContent)
},
// 新增
addHandle: function() {
this.title1 = CONFIG.ADD
this.open('dictionaryDialog')
},
// 添加子级
dictionaryChildrenHandle: function(index, row) {
var data = clonedeep(row)
var childData = {
parentId: data.id
}
this.formData = childData
this.title1 = '添加字典项'
this.open('dictionaryDialog')
console.log('字典项', index, row)
},
// 编辑
editHandle: function(index, row) {
this.formData = clonedeep(row)
this.title1 = CONFIG.EDIT
this.open('dictionaryDialog')
console.log('编辑', index, row)
},
// 删除
deleteHandle: function(index, row) {
this.$confirm('确定要删除吗').then(function () {
console.log('删除', index, row)
}).catch(function () {})
},
// 获取tabletree数据
getTableTreeData: function(data) {
var self = this;
var data = $.extend(true, data, this.pagination)
console.log(data)
this.tableTree.loading = true
api({
url: '/sys/dictionary/list',
type: 'get',
successFuc: function(res) {
var expand = self.tableTree.tree && $.type(self.tableTree.tree.expand) ? self.tableTree.tree.expand : false
self.tableTree.data = treeDataTranslate(res.data, expand)
self.tableTree.pagination.total = res.count
self.tableTree.loading = false
}
})
},
currentChangeHandle: function(val) {
this.pagination.page = val
this.getTableTreeData(this.pagination)
console.log('currentChangeHandle', val)
},
sizeChangeHandle: function(val) {
this.pagination.limit = val
this.getTableTreeData(this.pagination)
console.log('sizeChangeHandle', val)
},
openDialog: function() {
this.title1 = '详情'
this.open('dictionaryDialog')
}
}
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title></title>
</head>
<body>
<div id="app" class="container">
<div class="header-layout">
<el-form :inline="true">
<el-form-item>
<el-input v-model="searchContent.title" placeholder="请输入菜单名称"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="searchHandle" icon="el-icon-search"><span v-text="'搜索'"></span></el-button>
</el-form-item>
</el-form>
</div>
<div class="body-layout">
<k-table
@size-change-handle="sizeChangeHandle"
@current-change-handle="currentChangeHandle"
@detail-handle="detailHandle"
:table="table"/>
</div>
<!-- 新增修改详情 -->
<k-dialog
ref="logDialog"
:dialog-visible="dialogVisible"
:title="title"
:width="'65%'"
@before-close-handle="beforeCloseHandle"
>
<el-row>
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class="text-center" v-text="'操作数据前'"></span>
</div>
<k-log-detail :data="formData.old" />
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span class="text-center" v-text="'操作数据后'"></span>
</div>
<k-log-detail :data="formData.new" />
</el-card>
</el-col>
</el-row>
</k-dialog>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../component/form/logDetail.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/page/system/log/logDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/log.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, logDialog],
data: function() {
return {
queryData: [],
dialogVisible: false,
searchContent: {
title: ''
},
table: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
label: '模块',
prop: 'module'
},
{
label: '菜单',
prop: 'menu'
},
{
label: '操作人',
prop: 'username'
},
{
label: '操作时间',
prop: 'createDate'
},
{
label: '日志类型',
prop: 'operation'
}
],
hasSelect: true,
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 50,
type: 'text',
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
type: '',
label: '详情',
id: 1,
fn: 'detail-handle',
permission: ''
}]
},
pagination: {
hasPagination: true,
total: 0
}
},
pagination: {
page: 1,
limit: 10
},
formData: {},
title: ''
}
},
created: function() {
this.getTableData()
},
methods: {
// 获取table数据
getTableData: function(data) {
data = this.pagination
this.table.loading = true
var self = this;
api({
url: '/sys/log/list',
type: 'get',
successFuc: function(res) {
if (res.code === CONFIG.SUCCESS) {
console.log(res.data)
self.table.data = res.data
self.table.pagination.total = res.count
self.table.loading = false
}
}
})
},
// 详情
detailHandle: function(index, row) {
console.log(index, row)
const newDate = row.newValues.split(';')
const oldDate = row.oldValues.split(';')
console.log('new Data: ', newDate)
this.formData.new = newDate
console.log(this.formData.new)
this.formData.old = oldDate
console.log(this.formData)
this.title = '详情'
this.$refs.logDialog.open()
},
currentChangeHandle: function(val) {
this.pagination.page = val
this.getTableData(this.pagination)
console.log('currentChangeHandle', val)
},
sizeChangeHandle: function(val) {
this.pagination.limit = val
this.getTableData(this.pagination)
console.log('sizeChangeHandle', val)
}
}
})
</script>
</body>
</html>
var logDialog = {
data: function () {
return {
dialogVisible: false
}
},
methods: {
open: function () {
this.dialogVisible = true
},
beforeCloseHandle: function () {
this.dialogVisible = false
}
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<link rel="stylesheet" href="../../../css/common/system.css">
<title></title>
</head>
<body>
<div id="app" class="container">
<div class="header-layout">
<el-form :inline="true">
<el-form-item>
<el-input v-model="searchContent.realname" placeholder="请输入登录名"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="searchHandle" icon="el-icon-search"><span v-text="'搜索'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addHandle" icon="el-icon-plus"><span v-text="'新增'"></span></el-button>
</el-form-item>
</el-form>
</div>
<div class="body-layout">
<!-- 表格 -->
<k-table
@detail-handle="detailHandle"
@edit-handle="editHandle"
@delete-handle="deleteHandle"
@add-child-handle="addChildHandle"
:table="tableTree"/>
<!-- 表格结束 -->
</div>
<!-- 新增修改详情弹窗 -->
<k-dialog
ref="menuDialog"
:title="title1"
:width="width"
:is-btn-group="isBtnGroup"
@close-dialog-handle="closeDialogHandle"
@open-dialog-handle="openDialogHandle"
@confirm-handle="confirmHandle"
@cancel-handle="cancelHandle"
>
<template v-if="title1 === '详情'">
<k-detail
v-if="title1 === '详情'"
:props="props"
:data="formData"
/>
</template>
<template v-else>
<k-form
@submit-handle="submitHandle"
ref="menuForm"
:form="form"
:form-props="props"
:rules="rules"
:data="formData"
:other-data="otherData">
<div slot="iconForm">
<el-popover
v-model="iconVisible"
placement="top-start"
width="400"
trigger="click">
<div class="max-height">
<el-button
@click="iconChangeHandle(item)"
size="mini"
v-for="(item, index) in icons"
:key="index" >
<i class="iconfont" :class="item"></i>
</el-button>
</div>
<el-input v-model="otherData.icon" readonly slot="reference"></el-input>
</el-popover>
</div>
</k-form>
</template>
</k-dialog>
<!-- 新增修改详情弹窗结束 -->
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../js/icon.js"></script>
<script src="../../../js/page/system/menu/menuDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/menu.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, menuDialog],
data: function() {
return {
width: 'middle',
searchContent: {
realname: ''
},
tableTree: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
prop: 'name',
label: '菜单名称',
width: '400px'
},
{
prop: 'sort',
label: '排序'
}
],
hasSelect: true,
tree: {
hasTree: true,
treeKey: 'name',
expand: false,
checkStrictly: true
},
// 操作
operation: {
label: '操作',
width: 250,
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
label: '子级',
id: 4,
fn: 'add-child-handle',
permission: ''
}, {
label: '详情',
id: 1,
fn: 'detail-handle',
permission: ''
}, {
label: '编辑',
id: 2,
fn: 'edit-handle',
permission: ''
}, {
label: '删除',
id: 3,
fn: 'delete-handle',
permission: ''
}]
},
pagination: {
total: 2
}
},
formData: {}
}
},
created: function() {
this.getTableTreeData()
},
methods: {
// 获取tabletree数据
getTableTreeData: function(data) {
var self = this
var data = $.extend(true, data, this.pagination)
console.log(data)
this.tableTree.loading = true
api({
url: '/sys/menu/list',
type: 'get',
successFuc: function (res) {
var expand = self.tableTree.tree && $.type(self.tableTree.tree.expand) === 'boolean' ? self.tableTree.tree.expand : false
self.tableTree.data = treeDataTranslate(res.data, expand)
self.tableTree.pagination.total = res.count
self.tableTree.loading = false
}
})
},
searchHandle: function() {
this.getTableTreeData(this.searchContent)
},
// 新增
addHandle: function() {
this.title1 = CONFIG.ADD
this.open('menuDialog')
},
// 详情
detailHandle: function(index, row) {
this.formData = clonedeep(row)
this.title1 = CONFIG.DETAIL
this.open('menuDialog')
console.log('详情', index, row)
},
// 添加子级
addChildHandle: function(index, row) {
var data = clonedeep(row)
var childData = {
parentId: data.id,
parentName: data.name
}
this.formData = childData
this.title1 = '添加子级菜单'
this.open('menuDialog')
console.log('添加子级菜单', index, row)
},
// 编辑
editHandle: function(index, row) {
this.formData = clonedeep(row)
this.title1 = CONFIG.EDIT
this.open('menuDialog')
console.log('编辑', index, row)
},
// 删除
deleteHandle: function(index, row) {
this.$confirm('确定要删除吗').then(function () {
console.log('删除', index, row)
}).catch(function () {})
}
}
})
</script>
</body>
</html>
const ADDCHILD = '添加子级菜单'
var menuDialog = {
data: function () {
return {
iconVisible: false,
otherData: {
icon: ''
},
form: {
id: '',
parentName: '',
parentId: '',
name: '',
icon: '',
url: '',
type: '',
moduleType: '',
permission: '',
sort: ''
},
props: [
{
label: '上级菜单',
prop: 'parentName',
defaultProp: 'parentId',
inputType: 'inputTree',
visible: false
},
{
label: '名称',
prop: 'name',
inputType: 'input'
},
{
label: '图标',
prop: 'icon',
inputType: 'other'
},
{
label: '链接',
prop: 'url',
inputType: 'input'
},
{
label: '类型',
prop: 'type',
inputType: 'select'
},
{
label: '所属模块',
prop: 'moduleType',
inputType: 'select'
},
{
label: '权限规则',
prop: 'permission',
inputType: 'input'
},
{
label: '排序',
prop: 'sort',
inputType: 'input'
}
],
rules: {
parentName: [
{ required: true, message: '不能为空', trigger: 'change' }
],
name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
icon: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '不能为空', trigger: 'change' }
],
moduleType: [
{ required: true, message: '不能为空', trigger: 'change' }
],
permission: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
computed: {
icons: function () {
return icons
}
},
created: function () {
this.getModuleType()
this.getParentId()
this.getType()
},
methods: {
// 类型
getType: function () {
var self = this
api({
url: '/sys/menu/type',
type: 'get',
successFuc: function (res) {
self.setOptions('type', self.props, res.data)
}
})
},
// 所属模块
getModuleType: function () {
var self = this
api({
url: '/sys/menu/moduleType',
type: 'get',
successFuc: function (res) {
console.log('moduleType', res)
self.setOptions('moduleType', self.props, res.data)
}
})
},
// 上级菜单
getParentId: function () {
var self = this
api({
url: '/sys/menu/parentId',
type: 'get',
successFuc: function (res) {
self.setOptions('parentName', self.props, res.data)
}
})
},
// Dialog 打开的回调
openDialogHandle: function () {
var self = this
this.$nextTick(function () {
if (self.title1 === CONFIG.ADDCHILD) {
self.$set(self.otherData, 'icon', '')
self.$set(self.props[0], 'reference', false)
} else {
if (self.title1 === CONFIG.EDIT) {
self.$set(self.otherData, 'icon', self.formData.icon)
} else if (self.title1 === CONFIG.ADD) {
self.$set(self.otherData, 'icon', '')
}
}
if (self.title1 === CONFIG.ADD || self.title1 === ADDCHILD) {
self.clearValidate('menuForm')
}
if (self.title1 === CONFIG.EDIT) {
self.validate('menuForm')
}
})
},
// Dialog 关闭的回调
closeDialogHandle: function () {
if (this.title1 === CONFIG.EDIT || this.title1 === CONFIG.ADD || this.title1 === ADDCHILD) {
this.clearForm('menuForm')
}
if (this.title1 === ADDCHILD) {
this.$set(this.props[0], 'reference', true)
}
},
// 确定
confirmHandle: function () {
this.$refs.menuForm.submitHandle()
},
submitHandle: function (data) {
this.close('menuDialog')
},
iconChangeHandle: function (icon) {
this.$set(this.otherData, 'icon', icon)
this.iconVisible = false
},
// 取消
cancelHandle: function () {
this.close('menuDialog')
}
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title>参数配置</title>
</head>
<body>
<div id="app" class="container">
<el-row class="parame">
<el-col :span="14" :offset="4">
<el-form :model="formData" :rules="rules" ref="ruleForm" label-width="100px" class="rule-form">
<el-form-item label="logo" prop="logo">
<el-input v-model="formData.logo"></el-input>
</el-form-item>
<el-form-item label="是否门户" prop="isGateway">
<el-select v-model="formData.isGateway" class="db">
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="主题风格" prop="themeStyle">
<el-select v-model="formData.themeStyle" class="db">
<el-option v-for="item in skins" :key="item.id" :label="item.label" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit" v-text="'立即创建'"></el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../js/util/index.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/parame.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
data: function () {
return {
formData: {
logo: '',
isGateway: '',
themeStyle: ''
},
rules: {
logo: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
isGateway: [
{ required: true, message: '不能为空', trigger: 'change' }
],
themeStyle: [
{ required: true, message: '不能为空', trigger: 'change' }
]
},
skins: [],
documentClientHeight: document.clientHeight,
}
},
created: function () {
this.getData()
this.getSkin()
},
methods: {
onSubmit: function () {
let data = clonedeep(this.formData)
this.$refs.ruleForm.validate((valid) => {
if (valid) {
console.log('submit!', data)
} else {
return false
}
})
},
getSkin: function () {
var self = this
api({
url: '/sys/parame/skin',
type: 'get',
successFuc: function (res) {
self.skins = res.data
}
})
},
getData: function () {
var self = this
api({
url: '/sys/parame/list',
type: 'get',
successFuc: function (res) {
self.formData = res.data
}
})
}
}
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title>角色管理</title>
</head>
<body>
<div id="app" class="container">
<div class="header-layout">
<el-form :inline="true">
<el-form-item>
<el-input v-model="searchContent.name" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="searchHandle" icon="el-icon-search"><span v-text="'搜索'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addHandle" icon="el-icon-plus"><span v-text="'新增'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="danger" @click="deleteQueryHandle" icon="el-icon-delete"><span v-text="'批量删除'"></span></el-button>
</el-form-item>
</el-form>
</div>
<div class="body-layout">
<k-table @selection-change-handle="selectionChangeHandle" @size-change-handle="sizeChangeHandle" @current-change-handle="currentChangeHandle"
@detail-handle="detailHandle" @edit-handle="editHandle" @delete-handle="deleteHandle" @repeat-password-handle="repeatPasswordHandle"
:table="table" />
</div>
<!-- 新增修改详情 -->
<k-dialog ref="roleDialog" :title="title1" :width="width" :is-btn-group="isBtnGroup" @close-dialog-handle="closeDialogHandle"
@open-dialog-handle="openDialogHandle" @cancel-handle="cancelHandle" @confirm-handle="confirmHandle">
<template v-if="title1 === '详情'">
<k-detail ref="roleDetail" :props="props" :data="formData" />
</template>
<template v-else>
<k-form @submit-handle="submitHandle" ref="roleForm" :form="form" :form-props="props" :rules="rules" :data="formData" />
</template>
</k-dialog>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../js/icon.js"></script>
<script src="../../../js/page/system/role/roleDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/role.js"></script>
<script src="../../../mock/system/menu.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, roleDialog],
data: function () {
return {
width: 'middle',
searchContent: {
name: ''
},
table: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
prop: 'name',
label: '角色名称'
},
{
prop: 'remark',
label: '描述'
}
],
hasSelect: true,
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 190,
type: 'text',
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
type: '',
label: '详情',
id: 1,
fn: 'detail-handle',
permission: 'sys:role:info'
}, {
type: 'warning',
label: '编辑',
id: 2,
fn: 'edit-handle',
permission: 'sys:role:update'
}, {
type: 'danger',
label: '删除',
id: 3,
fn: 'delete-handle',
permission: 'sys:role:delete'
}, {
type: 'danger',
label: '重置密码',
id: 3,
fn: 'repeat-password-handle',
permission: 'sys:role:update'
}]
},
pagination: {
hasPagination: true
}
},
pagination: {
page: 1,
limit: 10
},
formData: {},
title: '',
}
},
created: function () {
this.getTableData()
},
methods: {
// 添加操作
addHandle: function () {
this.resetFormData()
this.title1 = CONFIG.ADD
this.open('roleDialog')
},
searchHandle: function () {
this.getTableData(this.searchContent)
},
// 获取table数据
getTableData: function (data) {
var self = this;
var data = $.extend(true, data, this.pagination)
console.log(data)
this.table.loading = true
api({
url: '/sys/role/roleList',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.table.data = res.data
self.table.pagination.total = res.count
self.table.loading = false
}
}
})
},
// 详情
detailHandle: function (index, row) {
this.formData = clonedeep(row)
this.title1 = CONFIG.DETAIL
this.open('roleDialog')
console.log('详情', index, row)
},
// 编辑
editHandle: function (index, row) {
this.formData = clonedeep(row)
this.title1 = CONFIG.EDIT
this.open('roleDialog')
console.log('编辑', index, row)
},
// 删除
deleteHandle: function (index, row) {
this.$confirm('确定要删除吗').then(function () {
console.log('删除', index, row)
}).catch(function () { })
},
// 重置密码
repeatPasswordHandle: function (index, row) {
this.$confirm('重置密码').then(function () {
console.log('重置密码', index, row)
}).catch(function () { })
},
// table checkbox选择
selectionChangeHandle: function (val) {
this.queryData = val
},
currentChangeHandle: function (val) {
this.pagination.page = val
this.getTableData(this.pagination)
console.log('currentChangeHandle', val)
},
sizeChangeHandle: function (val) {
this.pagination.limit = val
this.getTableData(this.pagination)
console.log('sizeChangeHandle', val)
},
// 初始化数据
resetFormData: function () {
this.formData = resetObject(this.formData)
}
}
})
</script>
</body>
</html>
var roleDialog = {
data () {
return {
form: {
id: '',
name: '',
remark: '',
menuIds: []
},
props: [
{
label: '角色名称',
prop: 'name',
inputType: 'input'
},
{
label: '描述',
prop: 'remark',
inputType: 'textarea'
},
{
label: '角色授权',
prop: 'menuIds',
inputType: 'tree',
defaultProps: {
children: 'children',
label: 'name'
}
}
],
rules: {
name: [
{ required: true, message: '不能为空', trigger: 'change' }
],
prop: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
created: function () {
this.getMenuList()
},
methods: {
getMenuList: function () {
let self = this
api({
url: '/sys/menu/list',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.setOptions('menuIds', self.props, res.data)
}
}
})
},
// Dialog 打开的回调
openDialogHandle: function () {
var self = this
this.$nextTick(function () {
if (self.title1 === CONFIG.DETAIL) {
self.$refs.roleDetail.openInitTree('menuIds')
} else {
self.$refs.roleForm.openInitTree('menuIds')
}
if (self.title1 === CONFIG.EDIT || self.title1 === CONFIG.ADD) {
self.clearValidate('roleForm')
}
if (self.title1 === CONFIG.EDIT) {
self.validate('roleForm')
}
})
},
// Dialog 关闭的回调
closeDialogHandle: function () {
if (this.title1 === CONFIG.EDIT || this.title1 === CONFIG.ADD) {
this.clearForm('roleForm')
this.$refs.roleForm.clearTree('menuIds')
}
},
// 确定
confirmHandle: function () {
this.$refs.roleForm.submitHandle()
},
submitHandle: function () {
this.close('roleDialog')
},
// 取消
cancelHandle: function () {
this.close('roleDialog')
}
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/lib/element-ui/index.css">
<link rel="stylesheet" href="../../../css/common.css">
<title></title>
</head>
<body>
<div id="app" class="container">
<div class="header-layout">
<el-form :inline="true">
<el-form-item>
<el-input v-model="searchContent.beanName" placeholder="bean名称"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="searchHandle" icon="el-icon-search"><span v-text="'搜索'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addHandle" icon="el-icon-plus"><span v-text="'新增'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button type="danger" @click="deleteQueryHandle" icon="el-icon-delete"><span v-text="'批量删除'"></span></el-button>
</el-form-item>
<el-form-item>
<el-button @click="stopHandle" type="info" icon="el-icon-bell">
<span v-text="'暂停'"></span>
</el-button>
</el-form-item>
<el-form-item>
<el-button @click="replyHandle" type="warning" icon="el-icon-news">
<span v-text="'回复'"></span>
</el-button>
</el-form-item>
<el-form-item>
<el-button @click="implementHandle" type="success" icon="el-icon-phone">
<span v-text="'立即执行'"></span>
</el-button>
</el-form-item>
</el-form>
</div>
<div class="body-layout">
<k-table @selection-change-handle="selectionChangeHandle" @size-change-handle="sizeChangeHandle" @current-change-handle="currentChangeHandle"
@detail-handle="detailHandle" @edit-handle="editHandle" @delete-handle="deleteHandle" :table="table" />
</div>
<!-- 新增修改详情 -->
<k-dialog
ref="timeDialog"
:title="title1"
width="middle"
:is-btn-group="title === '详情' ? false : true"
@close-dialog-handle="closeDialogHandle"
@open-dialog-handle="openDialogHandle"
@cancel-handle="cancelHandle"
@confirm-handle="confirmHandle"
>
<template v-if="title === '详情'">
<k-detail :props="props" :data="formData" />
</template>
<template v-else>
<k-form @submit-handle="submitHandle" ref="timeForm" :form="form" :form-props="props" :rules="rules" :data="formData" />
</template>
</k-dialog>
</div>
<script src="../../../js/lib/jquery.min.js"></script>
<script src="../../../js/lib/vue.min.js"></script>
<script src="../../../js/lib/element-ui/index.js"></script>
<script src="../../../js/util/index.js"></script>
<script src="../../../component/common/index.js"></script>
<script src="../../../js/mixin/common.js"></script>
<script src="../../../js/page/system/time/timeDialog.js"></script>
<!-- 数据处理 -->
<script src="../../../js/lib/mock.js"></script>
<script src="../../../mock/index.js"></script>
<script src="../../../mock/system/time.js"></script>
<!-- 数据处理 -->
<script>
var app = new Vue({
el: '#app',
mixins: [commonMixin, timeDialog],
data: function () {
return {
searchContent: {
beanName: ''
},
table: {
loading: false,
// table数据
data: [],
// table 表头
tr: [
{
prop: 'beanName',
label: 'bean名称'
},
{
prop: 'methodName',
label: '方法名称'
},
{
prop: 'params',
label: '参数'
},
{
prop: 'cronExpression',
label: 'cron表达式'
},
{
prop: 'statusForShow',
label: '状态'
}
],
hasSelect: true,
// 操作
operation: {
hasOperation: true,
label: '操作',
width: 200,
type: 'text',
minWidth: '',
// danger-红色 warning-黄色 primary-蓝色 success-绿色 info-灰色 默认-白色
data: [{
type: 'warning',
label: '详情',
id: 1,
fn: 'detail-handle',
permission: 'sys:user:info'
}, {
type: 'warning',
label: '编辑',
id: 2,
fn: 'edit-handle',
permission: 'sys:user:update'
}, {
type: 'danger',
label: '删除',
id: 3,
fn: 'delete-handle',
permission: 'sys:user:delete'
}]
},
pagination: {
hasPagination: true,
total: 144
}
},
pagination: {
page: 1,
limit: 10
},
formData: {},
title: ''
}
},
created: function () {
this.getTableData()
},
methods: {
searchHandle: function () {
this.getTableData(this.searchContent)
},
// 添加操作
addHandle: function () {
this.resetFormData()
this.title = CONFIG.ADD
this.open('timeDialog')
},
// 获取table数据
getTableData: function (data) {
let self = this;
var data = $.extend(true, data, this.pagination)
console.log(data)
this.table.loading = true
api({
url: '/sys/time/list',
type: 'get',
successFuc: function (res) {
if (res.code === CONFIG.SUCCESS) {
self.table.data = res.data
self.table.pagination.total = res.count
self.table.loading = false
}
}
})
},
// 详情
detailHandle: function (index, row) {
this.formData = clonedeep(row)
this.title = CONFIG.DETAIL
this.open('timeDialog')
console.log('详情', index, row)
},
// 编辑
editHandle: function (index, row) {
this.formData = clonedeep(row)
this.title = CONFIG.EDIT
this.open('timeDialog')
console.log('编辑', index, row)
},
// 删除
deleteHandle: function (index, row) {
this.$confirm('确定要删除吗').then(function () {
console.log('删除', index, row)
}).catch(function () { })
},
// table checkbox选择
selectionChangeHandle: function (ids, val) {
console.log(ids, val)
this.queryData = ids
},
currentChangeHandle: function (val) {
this.pagination.page = val
this.getTableData(this.pagination)
console.log('currentChangeHandle', val)
},
sizeChangeHandle: function (val) {
this.pagination.limit = val
this.getTableData(this.pagination)
console.log('sizeChangeHandle', val)
},
// 初始化数据
resetFormData: function () {
this.formData = resetObject(this.formData)
},
// 立即执行
implementHandle: function () {
var self = this
if (this.queryData.length > 0) {
this.$confirm('确定要立即执行吗').then(function () {
console.log('立即执行成功', self.queryData)
}).catch(function () { })
} else {
this.warningHandle('未选择不能立即执行,请选择后操作')
}
},
// 回复
replyHandle: function () {
var self = this
if (this.queryData.length > 0) {
this.$confirm('确定要回复吗').then(function () {
console.log('回复成功', self.queryData)
}).catch(function () { })
} else {
this.warningHandle('未选择不能回复,请选择后操作')
}
},
// 暂停
stopHandle: function () {
var self = this
if (this.queryData.length > 0) {
this.$confirm('确定要暂停吗').then(function () {
console.log('暂停成功', self.queryData)
}).catch(function () { })
} else {
this.warningHandle('未选择不能暂停,请选择后操作')
}
}
}
})
</script>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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