mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-04 04:45:28 +08:00
Jeecg-Boot 2.2.0 版本发布 | 重磅升级
This commit is contained in:
@ -94,6 +94,7 @@
|
||||
import RouteView from "@/components/layouts/RouteView"
|
||||
import { AppPage, ArticlePage, ProjectPage } from './page'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getFileAccessHttpUrl } from '@/api/manage';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -133,7 +134,7 @@
|
||||
methods: {
|
||||
...mapGetters(["nickname", "avatar"]),
|
||||
getAvatar(){
|
||||
return window._CONFIG['staticDomainURL']+"/"+this.avatar();
|
||||
return getFileAccessHttpUrl(this.avatar());
|
||||
},
|
||||
getTeams() {
|
||||
this.$http.get('/api/workplace/teams')
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
import PageLayout from '@/components/page/PageLayout'
|
||||
import HeadInfo from '@/components/tools/HeadInfo'
|
||||
import Radar from '@/components/chart/Radar'
|
||||
import { getRoleList, getServiceList } from "@/api/manage"
|
||||
import { getRoleList, getServiceList, getFileAccessHttpUrl } from "@/api/manage"
|
||||
|
||||
const DataSet = require('@antv/data-set')
|
||||
|
||||
@ -185,7 +185,7 @@
|
||||
},
|
||||
created() {
|
||||
this.user = this.userInfo
|
||||
this.avatar = window._CONFIG['staticDomainURL'] +"/"+ this.userInfo.avatar
|
||||
this.avatar = getFileAccessHttpUrl(this.userInfo.avatar)
|
||||
console.log('this.avatar :'+ this.avatar)
|
||||
|
||||
getRoleList().then(res => {
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<div style="float: left;width:104px;height:104px;margin-right: 10px;margin: 0 8px 8px 0;">
|
||||
<div
|
||||
style="width: 100%;height: 100%;position: relative;padding: 8px;border: 1px solid #d9d9d9;border-radius: 4px;">
|
||||
<img style="width: 100%;" :src="fileDetail.imgUrl" :preview="dataSource[0].key">
|
||||
<img style="width: 100%;" :src="fileDetail.imgUrl" :preview="dataSource[0].key">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,37 +65,33 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: '电子档补扫页面',
|
||||
description: '图片预览页面',
|
||||
spinning:false,
|
||||
//数据集
|
||||
dataSource: [{
|
||||
key:0,
|
||||
fileDetails:[
|
||||
{
|
||||
imgUrl:"https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2735633715,2749454924&fm=27&gp=0.jpg"
|
||||
imgUrl:"https://static.jeecg.com/upload/test/3a4490d5d1cd495b826e528537a47cc1.jpg"
|
||||
},
|
||||
{
|
||||
imgUrl:"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3967239004,1951414302&fm=27&gp=0.jpg"
|
||||
},
|
||||
{
|
||||
imgUrl:"https://ss0.bdstatic.com/6Ox1bjeh1BF3odCf/it/u=3660968530,985748925&fm=191&app=48&size=h300&n=0&g=4n&f=JPEG?sec=1853310920&t=5e64af964be378c6c2a3b0acc65dfe24"
|
||||
imgUrl:"https://static.jeecg.com/upload/test/8f22cd945be44388bacbf0b88cf86cfa.png"
|
||||
}
|
||||
]
|
||||
},{
|
||||
key:1,
|
||||
fileDetails:[
|
||||
{
|
||||
imgUrl:"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=889120611,3801177793&fm=27&gp=0.jpg"
|
||||
imgUrl:"https://static.jeecg.com/upload/test/u27356337152749454924fm27gp0_1588149731821.jpg"
|
||||
},
|
||||
{
|
||||
imgUrl:"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2445468140,2491956848&fm=27&gp=0.jpg"
|
||||
imgUrl:"https://static.jeecg.com/upload/test/1_1588149743473.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
],
|
||||
url: {
|
||||
},
|
||||
|
||||
url: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@ -42,11 +42,11 @@
|
||||
spinning: false,
|
||||
//数据集
|
||||
dataSource: [
|
||||
{id:'000',sort: 0,filePath: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2735633715,2749454924&fm=27&gp=0.jpg'},
|
||||
{id:'111',sort: 1,filePath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3967239004,1951414302&fm=27&gp=0.jpg'},
|
||||
{id:'222',sort: 2,filePath: 'https://ss0.bdstatic.com/6Ox1bjeh1BF3odCf/it/u=3660968530,985748925&fm=191&app=48&size=h300&n=0&g=4n&f=JPEG?sec=1853310920&t=5e64af964be378c6c2a3b0acc65dfe24'},
|
||||
{id:'333',sort: 3,filePath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=889120611,3801177793&fm=27&gp=0.jpg'},
|
||||
{id:'444',sort: 4,filePath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2445468140,2491956848&fm=27&gp=0.jpg'}
|
||||
{id:'000',sort: 0,filePath: 'https://static.jeecg.com/upload/test/1_1588149743473.jpg'},
|
||||
{id:'111',sort: 1,filePath: 'https://static.jeecg.com/upload/test/u27356337152749454924fm27gp0_1588149731821.jpg'},
|
||||
{id:'222',sort: 2,filePath: 'https://static.jeecg.com/upload/test/u24454681402491956848fm27gp0_1588149712663.jpg'},
|
||||
{id:'333',sort: 3,filePath: 'https://static.jeecg.com/upload/test/8f22cd945be44388bacbf0b88cf86cfa.png'},
|
||||
{id:'444',sort: 4,filePath: 'https://static.jeecg.com/upload/test/u8891206113801177793fm27gp0_1588149704459.jpg'}
|
||||
],
|
||||
oldDateSource:[],
|
||||
newDateSource:[],
|
||||
|
||||
@ -50,11 +50,11 @@
|
||||
children: [{
|
||||
title: '1页',
|
||||
key: '0-0-0',
|
||||
imgUrl:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2735633715,2749454924&fm=27&gp=0.jpg'
|
||||
imgUrl:'https://static.jeecg.com/upload/test/1_1588149743473.jpg'
|
||||
}, {
|
||||
title: '2页',
|
||||
key: '0-0-1',
|
||||
imgUrl:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3967239004,1951414302&fm=27&gp=0.jpg'
|
||||
imgUrl:'https://static.jeecg.com/upload/test/u27356337152749454924fm27gp0_1588149731821.jpg'
|
||||
}]
|
||||
},{
|
||||
title: '第二页',
|
||||
@ -62,11 +62,11 @@
|
||||
children: [{
|
||||
title: '1页',
|
||||
key: '0-1-0',
|
||||
imgUrl:'https://ss0.bdstatic.com/6Ox1bjeh1BF3odCf/it/u=3660968530,985748925&fm=191&app=48&size=h300&n=0&g=4n&f=JPEG?sec=1853310920&t=5e64af964be378c6c2a3b0acc65dfe24'
|
||||
imgUrl:'https://static.jeecg.com/upload/test/u24454681402491956848fm27gp0_1588149712663.jpg'
|
||||
}, {
|
||||
title: '2页',
|
||||
key: '0-1-1',
|
||||
imgUrl:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=889120611,3801177793&fm=27&gp=0.jpg'
|
||||
imgUrl:'https://static.jeecg.com/upload/test/u8891206113801177793fm27gp0_1588149704459.jpg'
|
||||
}]
|
||||
},{
|
||||
title: '第三页',
|
||||
@ -74,7 +74,7 @@
|
||||
children: [{
|
||||
title: '1页',
|
||||
key: '0-2-0',
|
||||
imgUrl:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2445468140,2491956848&fm=27&gp=0.jpg'
|
||||
imgUrl:'https://static.jeecg.com/upload/test/1374962_1587621329085.jpg'
|
||||
}]
|
||||
}],
|
||||
selectedKeys:[],
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
<a-tabs defaultActiveKey="1">
|
||||
<a-tab-pane tab="response" key="1">
|
||||
<textarea style="width:100%;font-size: 16px;font-weight:500" :rows="10" v-html="resultJson" readonly>
|
||||
<textarea style="width:100%;font-size: 16px;font-weight:500" :rows="10" v-html="resultJson" readOnly>
|
||||
</textarea>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="用户名">
|
||||
<j-input placeholder="请输入名称模糊查询" v-model="queryParam.name"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="年龄">
|
||||
<!-- <a-input placeholder="请输入名称查询" v-model="queryParam.age"></a-input>-->
|
||||
<a-input placeholder="最小年龄" type="ge" v-model="queryParam.age_begin" style="width:calc(50% - 15px);"></a-input>
|
||||
@ -20,7 +20,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="生日">
|
||||
<a-range-picker v-model="queryParam.birthdayRange"
|
||||
format="YYYY-MM-DD"
|
||||
@ -28,56 +28,42 @@
|
||||
@change="onBirthdayChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="性别">
|
||||
<j-dict-select-tag v-model="queryParam.sex" placeholder="请选择性别" dictCode="sex"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="选择用户">
|
||||
<j-dict-select-tag v-model="queryParam.id" placeholder="请选择用户" dictCode="demo,name,id"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</a-col>
|
||||
</span>
|
||||
<a-col :md="6" :sm="24">
|
||||
|
||||
<!-- <template v-if="superQueryFlag">
|
||||
<a-tooltip title="已有高级查询条件生效!">
|
||||
<button :disabled="false" class="ant-btn ant-btn-primary" @click="superQuery">
|
||||
<a-icon type="appstore" theme="twoTone" spin="true"></a-icon>
|
||||
<span>高级查询</span>
|
||||
</button>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-button v-else type="primary" @click="superQuery" icon="filter">高级查询</a-button>
|
||||
-->
|
||||
<!-- 高级查询区域 -->
|
||||
<j-super-query :fieldList="fieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
|
||||
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin-top: 5px">
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button type="primary" icon="plus" @click="jump">创建单据</a-button>
|
||||
<a-button type="primary" icon="plus" @click="onetomany">一对多</a-button>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('demo')">导出</a-button>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('单表示例')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<!-- 高级查询区域 -->
|
||||
<j-super-query :fieldList="fieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel">
|
||||
@ -112,7 +98,7 @@
|
||||
</a-row>
|
||||
</a-checkbox-group>
|
||||
</template>
|
||||
<a><a-icon type="setting" />自定义列</a>
|
||||
<a><a-icon type="setting" />设置</a>
|
||||
</a-popover>
|
||||
</span>
|
||||
</div>
|
||||
@ -178,25 +164,27 @@
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue';
|
||||
import JInput from '@/components/jeecg/JInput.vue';
|
||||
import JeecgDemoTabsModal from './modules/JeecgDemoTabsModal'
|
||||
import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
|
||||
import {initDictOptions, filterDictText,filterDictTextByCache} from '@/components/dict/JDictSelectUtil'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import Vue from 'vue'
|
||||
import { filterObj } from '@/utils/util';
|
||||
|
||||
//高级查询modal需要参数
|
||||
const superQueryFieldList=[{
|
||||
type:"date",
|
||||
value:"birthday",
|
||||
text:"生日"
|
||||
},{
|
||||
type:"string",
|
||||
value:"name",
|
||||
text:"用户名"
|
||||
},{
|
||||
type:"int",
|
||||
value:"age",
|
||||
text:"年龄"
|
||||
}]
|
||||
const superQueryFieldList=[
|
||||
{
|
||||
type: "string",
|
||||
value: "name",
|
||||
text: "用户名"
|
||||
}, {
|
||||
type: "int",
|
||||
value: "age",
|
||||
text: "年龄"
|
||||
}, {
|
||||
type: "date",
|
||||
value: "birthday",
|
||||
text: "生日"
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: "JeecgDemoList",
|
||||
mixins:[JeecgListMixin],
|
||||
@ -208,7 +196,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: '用户管理页面',
|
||||
description: '单表示例列表',
|
||||
//字典数组缓存
|
||||
sexDictOptions: [],
|
||||
importExcelUrl:`${window._CONFIG['domianURL']}/test/jeecgDemo/importExcel`,
|
||||
@ -249,7 +237,7 @@
|
||||
dataIndex: 'sex',
|
||||
customRender: (text) => {
|
||||
//字典值替换通用方法
|
||||
return filterDictText(this.sexDictOptions, text);
|
||||
return filterDictTextByCache('sex', text);
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -293,12 +281,11 @@
|
||||
},
|
||||
methods: {
|
||||
getQueryParams(){
|
||||
console.log(this.queryParam.birthdayRange)
|
||||
|
||||
//高级查询器
|
||||
let sqp = {}
|
||||
if(this.superQueryParams){
|
||||
sqp['superQueryParams']=encodeURI(this.superQueryParams)
|
||||
sqp['superQueryMatchType'] = this.superQueryMatchType
|
||||
}
|
||||
var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
|
||||
|
||||
@ -380,38 +367,5 @@
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.ant-card-body .table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.ant-table-tbody .ant-table-row td {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.anty-row-operator button {
|
||||
margin: 0 5px
|
||||
}
|
||||
|
||||
.ant-btn-danger {
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
}
|
||||
/** Button按钮间距 */
|
||||
.ant-btn {
|
||||
margin-left: 3px
|
||||
}
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
(暂无材料,点击右侧"选择文件"或"扫描上传"上传文件)
|
||||
(暂无材料,点击"选择文件"或"扫描上传"上传文件)
|
||||
</template>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height:100%">
|
||||
<a-card :bordered="false" style="height:100%;padding-bottom:200px; ">
|
||||
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" :form="form">
|
||||
@ -10,7 +10,7 @@
|
||||
<a-col :span="12">
|
||||
<a-form-item label="性别">
|
||||
<j-dict-select-tag v-model="formData.sex" title="性别" dictCode="sex" placeholder="请选择性别"/>
|
||||
<!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>-->
|
||||
<!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>-->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.sex}}</a-col>
|
||||
@ -36,6 +36,47 @@
|
||||
<a-col :span="12">选中值:{{ formData.user2}}</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
<!-- 字典搜索 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="字典搜索(同步)">
|
||||
<j-search-select-tag placeholder="请做出你的选择" v-model="formData.searchValue" :dictOptions="searchOptions">
|
||||
</j-search-select-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.searchValue}}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 字典搜索 异步加载 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="字典搜索(异步)">
|
||||
<j-search-select-tag
|
||||
placeholder="请做出你的选择"
|
||||
v-model="formData.asyncSelectValue"
|
||||
dict="sys_depart,depart_name,id"
|
||||
:async="true">
|
||||
</j-search-select-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.asyncSelectValue}}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JMultiSelectTag -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="字典下拉(多选)">
|
||||
<j-multi-select-tag
|
||||
v-model="formData.selMuti"
|
||||
dictCode="sex"
|
||||
placeholder="请选择">
|
||||
</j-multi-select-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">多选组合(v-model):{{ formData.selMuti }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 部门选择控件 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
@ -79,12 +120,22 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择角色">
|
||||
<j-select-role v-model="formData.selectRole"/>
|
||||
<j-select-role v-model="formData.selectRole" @change="changeMe"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.selectRole}}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 职务选择 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择职务">
|
||||
<j-select-position v-model="formData.selectPosition" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.selectPosition}}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JCheckbox -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
@ -142,16 +193,6 @@
|
||||
<a-col :span="12">过长剪切:{{ jellipsis.value }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JGraphicCode -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="验证码">
|
||||
<j-graphic-code @success="generateCode"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">验证码:{{ jgraphicCode.value }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JSlider -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
@ -200,16 +241,10 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JSuperQuery 高级查询 -->
|
||||
<!-- JTreeSelect 树组件 -->
|
||||
<!-- JTreeTable 树列表 -->
|
||||
<!-- JUpload.上传组件 -->
|
||||
<!-- JImportModal 导入组件 -->
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="树字典">
|
||||
<j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="A01" />
|
||||
<j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="B01" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中的值(v-model):{{ formData.treeDict }}</a-col>
|
||||
@ -227,7 +262,7 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :spapn="12">选中的值(v-model):{{ formData.treeSelect }}</a-col>
|
||||
<a-col :span="12">选中的值(v-model):{{ formData.treeSelect }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="24">
|
||||
@ -243,7 +278,17 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :spapn="12">选中的值(v-model):{{ formData.treeSelectMultiple }}</a-col>
|
||||
<a-col :span="12">选中的值(v-model):{{ formData.treeSelectMultiple }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 分类字典树 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="分类字典树">
|
||||
<j-category-select v-model="formData.selectCategory" pcode="A01"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中的值(v-model):{{ formData.selectCategory }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- VueCron -->
|
||||
@ -267,19 +312,38 @@
|
||||
<a-col :span="12">
|
||||
<a-form-item label="高级查询(自定义按钮)">
|
||||
<j-super-query :fieldList="superQuery.fieldList">
|
||||
<!-- 直接在内部写一个按钮即可,点击事件自动添加 -->
|
||||
<a-button type="primary" ghost icon="clock-circle">高级查询</a-button>
|
||||
<!--
|
||||
v-slot:button 可以更高自由的定制按钮
|
||||
参数介绍:
|
||||
isActive: 是否是激活状态(已有高级查询条件生效)
|
||||
isMobile: 当前是否是移动端,可针对移动端展示不同的样式
|
||||
open: 打开弹窗,一个方法,可绑定点击事件
|
||||
reset: 重置所有查询条件,一个方法,可绑定点击事件
|
||||
-->
|
||||
<template v-slot:button="{isActive,isMobile,open,reset}">
|
||||
<!-- 定义的是普通状态下的按钮 -->
|
||||
<a-button v-if="!isActive" type="primary" ghost icon="clock-circle" @click="open()">高级查询</a-button>
|
||||
<!-- 定义的当有高级查询条件生效状态下的按钮 -->
|
||||
<a-button-group v-else>
|
||||
<a-button type="primary" ghost @click="open()">
|
||||
<a-icon type="plus-circle" spin/>
|
||||
<span>高级查询</span>
|
||||
</a-button>
|
||||
<a-button v-if="isMobile" type="primary" ghost icon="delete" @click="reset()"/>
|
||||
</a-button-group>
|
||||
</template>
|
||||
</j-super-query>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="图片上传">
|
||||
<j-image-upload v-model="imgList"></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :spapn="12">选中的值(v-model):{{ imgList }}</a-col>
|
||||
<a-col :span="12">选中的值(v-model):{{ imgList }}</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24" style="margin-top: 65px;margin-bottom:50px;">
|
||||
<a-col :span="12">
|
||||
@ -287,12 +351,80 @@
|
||||
<j-upload v-model="fileList"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :spapn="12">
|
||||
<a-col :span="12">
|
||||
选中的值(v-model):
|
||||
<j-ellipsis :value="fileList" :length="30" v-if="fileList.length>0"/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 特殊查询组件 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="特殊查询组件">
|
||||
<a-row>
|
||||
<a-col :span="16">
|
||||
<j-input v-model="formData.jInput" :type="jInput.type"/>
|
||||
</a-col>
|
||||
<a-col :span="3" style="text-align: right;" >查询类型:</a-col>
|
||||
<a-col :span="5">
|
||||
<a-select v-model="jInput.type" :options="jInput.options"></a-select>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">输入的值(v-model):{{ formData.jInput }}</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="15">
|
||||
<a-form-item label="MarkdownEditor" style="min-height: 300px">
|
||||
<j-markdown-editor v-model="content"></j-markdown-editor>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="9">
|
||||
输入的值(v-model):{{ content }}
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 省市县级联 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="省市县级联">
|
||||
<j-area-linkage v-model="formData.areaLinkage1" type="cascader"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">输入的值(v-model):{{ formData.areaLinkage1 }}</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
<!-- 省市县级联 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="省市县级联">
|
||||
<j-area-linkage v-model="formData.areaLinkage2" type="select"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">输入的值(v-model):{{ formData.areaLinkage2 }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 功能示例:关闭当前页面 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="功能示例:关闭当前页面">
|
||||
<a-button type="primary" @click="handleCloseCurrentPage">点击关闭当前页面</a-button>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JPopup示例 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="JPopup示例">
|
||||
<j-popup v-model="formData.jPopup" code="demo" field="name" orgFields="name" destFields="name"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选择的值(v-model):{{ formData.jPopup }}</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
@ -311,7 +443,6 @@
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
import JEllipsis from '@/components/jeecg/JEllipsis'
|
||||
import JGraphicCode from '@/components/jeecg/JGraphicCode'
|
||||
import JSlider from '@/components/jeecg/JSlider'
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import JTreeDict from "../../components/jeecg/JTreeDict.vue";
|
||||
@ -320,10 +451,23 @@
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery'
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
import JSelectPosition from '@comp/jeecgbiz/JSelectPosition'
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
import JMultiSelectTag from '@comp/dict/JMultiSelectTag'
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
|
||||
export default {
|
||||
name: 'SelectDemo',
|
||||
inject:['closeCurrent'],
|
||||
components: {
|
||||
JMarkdownEditor,
|
||||
JAreaLinkage,
|
||||
JInput,
|
||||
JCategorySelect,
|
||||
JSelectPosition,
|
||||
JImageUpload,
|
||||
JUpload,
|
||||
JTreeDict,
|
||||
@ -334,14 +478,19 @@
|
||||
JSelectRole,
|
||||
JCheckbox,
|
||||
JCodeEditor,
|
||||
JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple,
|
||||
JCron, JTreeSelect, JSuperQuery
|
||||
JDate, JEditor, JEllipsis, JSlider, JSelectMultiple,
|
||||
JCron, JTreeSelect, JSuperQuery, JMultiSelectTag,
|
||||
JSearchSelectTag
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
selectedDepUsers: '',
|
||||
formData: {},
|
||||
formData: {
|
||||
areaLinkage1: '110105',
|
||||
areaLinkage2: '140221',
|
||||
sex: 1
|
||||
},
|
||||
form: this.$form.createForm(this),
|
||||
departId: '4f1765520d6346f9bd9c79e2479e5b12,57197590443c44f083d42ae24ef26a2c',
|
||||
userIds: 'admin',
|
||||
@ -370,9 +519,6 @@ sayHi('hello, world!')`
|
||||
jellipsis: {
|
||||
value: '这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。'
|
||||
},
|
||||
jgraphicCode: {
|
||||
value: ''
|
||||
},
|
||||
jslider: {
|
||||
value: false
|
||||
},
|
||||
@ -396,11 +542,41 @@ sayHi('hello, world!')`
|
||||
fieldList: [
|
||||
{ type: 'input', value: 'name', text: '姓名', },
|
||||
{ type: 'select', value: 'sex', text: '性别', dictCode: 'sex' },
|
||||
{ type: 'number', value: 'age', text: '年龄', }
|
||||
{ type: 'number', value: 'age', text: '年龄', },
|
||||
{
|
||||
type: 'select', value: 'hobby', text: '爱好',
|
||||
options: [
|
||||
{ label: '音乐', value: '1' },
|
||||
{ label: '游戏', value: '2' },
|
||||
{ label: '电影', value: '3' },
|
||||
{ label: '读书', value: '4' },
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
fileList:[],
|
||||
imgList:[],
|
||||
jInput: {
|
||||
type: 'like',
|
||||
options: [
|
||||
{ value: 'like', label: '模糊(like)' },
|
||||
{ value: 'ne', label: '不等于(ne)' },
|
||||
{ value: 'ge', label: '大于等于(ge)' },
|
||||
{ value: 'le', label: '小于等于(le)' },
|
||||
],
|
||||
},
|
||||
content: '',
|
||||
searchOptions:[{
|
||||
text:"选项一",
|
||||
value:"1"
|
||||
},{
|
||||
text:"选项二",
|
||||
value:"2"
|
||||
},{
|
||||
text:"选项三",
|
||||
value:"3"
|
||||
}],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -419,6 +595,9 @@ sayHi('hello, world!')`
|
||||
getDepartIdValue() {
|
||||
return this.form.getFieldValue('departId')
|
||||
},
|
||||
changeMe() {
|
||||
console.log('you so ... , change Me')
|
||||
},
|
||||
selectOK: function(data) {
|
||||
this.selectList = data
|
||||
},
|
||||
@ -437,9 +616,6 @@ sayHi('hello, world!')`
|
||||
onSearchDepUserCallBack(selectedDepUsers) {
|
||||
this.selectedDepUsers = selectedDepUsers
|
||||
},
|
||||
generateCode(value) {
|
||||
this.jgraphicCode.value = value.toLowerCase()
|
||||
},
|
||||
handleJSliderSuccess(value) {
|
||||
this.jslider.value = value
|
||||
},
|
||||
@ -447,7 +623,14 @@ sayHi('hello, world!')`
|
||||
this.$nextTick(() => {
|
||||
this.form.cronExpression = data;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
handleCloseCurrentPage() {
|
||||
// 注意:以下代码必须存在
|
||||
// inject:['closeCurrent'],
|
||||
this.closeCurrent()
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
export default {
|
||||
props: ['sex','name'],
|
||||
data () {
|
||||
return {
|
||||
formLayout: 'horizontal',
|
||||
@ -63,11 +64,25 @@
|
||||
},
|
||||
},
|
||||
created (){
|
||||
console.log('============= online href common props ============= ');
|
||||
console.log('props sex: ',this.sex);
|
||||
console.log('props name: ',this.name);
|
||||
|
||||
getAction('/api/area').then((res) => {
|
||||
console.log("------------")
|
||||
console.log(res)
|
||||
this.areaOptions = res;
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
immediate: true,
|
||||
handler() {
|
||||
console.log('============= online href $route props ============= ');
|
||||
let sex = this.$route.query.sex
|
||||
console.log('$route sex: ', sex);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -25,7 +25,7 @@
|
||||
@selectRowChange="handleSelectRowChange">
|
||||
|
||||
<template v-slot:action="props">
|
||||
<a @click="handleDelete(props)">{{ props.text }}</a>
|
||||
<a @click="handleDelete(props)">删除</a>
|
||||
</template>
|
||||
|
||||
</j-editable-table>
|
||||
@ -154,6 +154,8 @@
|
||||
type: FormTypes.inputNumber,
|
||||
defaultValue: 32,
|
||||
placeholder: '${title}',
|
||||
// 是否是统计列,只有 inputNumber 才能设置统计列
|
||||
statistics: true,
|
||||
validateRules: [{ required: true, message: '请输入${title}' }]
|
||||
},
|
||||
{
|
||||
@ -166,6 +168,15 @@
|
||||
placeholder: '请选择${title}',
|
||||
validateRules: [{ required: true, message: '请选择${title}' }]
|
||||
},
|
||||
{
|
||||
title: '数字',
|
||||
key: 'money',
|
||||
width: '320px',
|
||||
type: FormTypes.inputNumber,
|
||||
defaultValue: '100.32',
|
||||
placeholder: '请选择${title}',
|
||||
validateRules: [{ required: true, message: '请选择${title}' }]
|
||||
},
|
||||
{
|
||||
title: '可以为空',
|
||||
key: 'isNull',
|
||||
@ -175,6 +186,16 @@
|
||||
customValue: ['Y', 'N'], // true ,false
|
||||
defaultChecked: false
|
||||
},
|
||||
{
|
||||
type: FormTypes.popup,
|
||||
key: 'popup',
|
||||
title: 'JPopup',
|
||||
width: '180px',
|
||||
popupCode: 'demo',
|
||||
field: 'name',
|
||||
orgFields: 'name',
|
||||
destFields: 'name'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
@ -182,7 +203,6 @@
|
||||
width: '100px',
|
||||
type: FormTypes.slot,
|
||||
slotName: 'action',
|
||||
defaultValue: '删除'
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
@ -624,7 +624,7 @@
|
||||
}
|
||||
},
|
||||
callback (key) {
|
||||
console.log(key)
|
||||
//console.log(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,7 +160,6 @@
|
||||
add: "/test/order/addCustomer",
|
||||
edit: "/test/order/editCustomer",
|
||||
fileUpload: window._CONFIG['domianURL'] + "/sys/common/upload",
|
||||
imgerver: window._CONFIG['staticDomainURL'],
|
||||
getOrderCustomerList: "/test/order/listOrderCustomerByMainId",
|
||||
},
|
||||
validatorRules: {
|
||||
@ -246,7 +245,11 @@
|
||||
let formData = Object.assign(this.model, values);
|
||||
console.log(formData);
|
||||
formData.orderId = this.orderId;
|
||||
formData.idcardPic = this.fileList;
|
||||
if(this.fileList != '') {
|
||||
formData.idcardPic = this.fileList;
|
||||
}else{
|
||||
formData.idcardPic = '';
|
||||
}
|
||||
httpAction(httpurl, formData, method).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
@ -278,36 +281,6 @@
|
||||
callback("您的身份证号码格式不正确!");
|
||||
}
|
||||
},
|
||||
handleChange(info) {
|
||||
this.fileList = info.fileList;
|
||||
if (info.file.status === 'uploading') {
|
||||
return
|
||||
}
|
||||
if (info.file.status === 'done') {
|
||||
var response = info.file.response;
|
||||
if (!response.success) {
|
||||
this.$message.warning(response.message);
|
||||
}
|
||||
}
|
||||
},
|
||||
handlePicCancel() {
|
||||
this.previewVisible = false
|
||||
this.previewImage=''
|
||||
},
|
||||
handlePicView(url){
|
||||
this.previewImage = this.url.imgerver + "/" + url
|
||||
this.previewVisible = true
|
||||
},
|
||||
handlePreview(file) {
|
||||
this.previewImage = file.url || file.thumbUrl
|
||||
this.previewVisible = true
|
||||
},
|
||||
getIdCardView(url) {
|
||||
// let pics = this.model.idcardPic.split(",");
|
||||
//let pics_len = pics.length;
|
||||
// 显示上传的最后一个图片
|
||||
return this.url.imgerver + "/" + url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,391 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="表名">
|
||||
<a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="doCgformButton" type="primary" icon="highlight">自定义按钮</a-button>
|
||||
<a-button @click="doEnhanceJs" type="primary" icon="strikethrough">JS增强</a-button>
|
||||
<a-button @click="doEnhanceSql" type="primary" icon="filter">SQL增强</a-button>
|
||||
<a-button @click="doEnhanceJava" type="primary" icon="tool">Java增强</a-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel">
|
||||
<a-icon type="delete"/>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button> 批量操作
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i>
|
||||
已选择
|
||||
<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
|
||||
项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
<template slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多
|
||||
<a-icon type="down"/>
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a @click="goPageOnline(record)">功能测试</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a @click="handleOnlineUrlShow(record)">配置地址</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a @click="handleRemoveRecord(record.id)">移除</a>
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
|
||||
<template slot="dbsync" slot-scope="text">
|
||||
<span v-if="text==='Y'" style="color:limegreen">已同步</span>
|
||||
<span v-if="text==='N'" style="color:red">未同步</span>
|
||||
</template>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<onl-cgform-head-modal ref="modalForm" @ok="modalFormOk" :action-button="false"></onl-cgform-head-modal>
|
||||
|
||||
<!-- 提示online报表链接 -->
|
||||
<a-modal
|
||||
:title="onlineUrlTitle"
|
||||
:visible="onlineUrlVisible"
|
||||
@cancel="handleOnlineUrlClose">
|
||||
<template slot="footer">
|
||||
<a-button @click="handleOnlineUrlClose">关闭</a-button>
|
||||
<a-button type="primary" class="copy-this-text" :data-clipboard-text="onlineUrl" @click="onCopyUrl">复制</a-button>
|
||||
</template>
|
||||
<p>{{ onlineUrl }}</p>
|
||||
</a-modal>
|
||||
|
||||
<enhance-js ref="ehjs"></enhance-js>
|
||||
<enhance-sql ref="ehsql"></enhance-sql>
|
||||
<enhance-java ref="ehjava"></enhance-java>
|
||||
<trans-db2-online ref="transd2o" @ok="transOk"></trans-db2-online>
|
||||
|
||||
<onl-cgform-button-list ref="btnList"></onl-cgform-button-list>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deleteAction, postAction,getAction } from '@/api/manage'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import Clipboard from 'clipboard'
|
||||
import { filterObj } from '@/utils/util';
|
||||
|
||||
export default {
|
||||
name: 'OnlCgformHeadList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: 'Online表单视图',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function(t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '视图表名',
|
||||
align: 'center',
|
||||
dataIndex: 'tableName'
|
||||
},
|
||||
{
|
||||
title: '视图表描述',
|
||||
align: 'center',
|
||||
dataIndex: 'tableTxt'
|
||||
},
|
||||
{
|
||||
title: '原表版本',
|
||||
align: 'center',
|
||||
dataIndex: 'tableVersion'
|
||||
},
|
||||
{
|
||||
title: '视图版本',
|
||||
align: 'center',
|
||||
dataIndex: 'copyVersion'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/online/cgform/head/list',
|
||||
delete: '/online/cgform/head/delete',
|
||||
deleteBatch: '/online/cgform/head/deleteBatch',
|
||||
removeRecord: '/online/cgform/head/removeRecord',
|
||||
},
|
||||
tableTypeDictOptions: [],
|
||||
sexDictOptions: [],
|
||||
syncModalVisible: false,
|
||||
syncFormId: '',
|
||||
synMethod: 'normal',
|
||||
syncLoading: false,
|
||||
onlineUrlTitle: '',
|
||||
onlineUrlVisible: false,
|
||||
onlineUrl: '',
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
physicId:""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route'() {
|
||||
this.loadData()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getQueryParams() {
|
||||
//获取查询条件
|
||||
var param = Object.assign({}, this.queryParam, this.isorter ,this.filters);
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
param.copyType = 1;
|
||||
param.physicId = this.physicId;
|
||||
return filterObj(param);
|
||||
},
|
||||
|
||||
loadData(arg) {
|
||||
if(!this.$route.params.code){
|
||||
return false
|
||||
}
|
||||
this.physicId = this.$route.params.code
|
||||
if(!this.url.list){
|
||||
this.$message.error("请设置url.list属性!")
|
||||
return
|
||||
}
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1;
|
||||
}
|
||||
var params = this.getQueryParams();//查询条件
|
||||
this.loading = true;
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records;
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
if(res.code===510){
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
|
||||
goPageOnline(rd) {
|
||||
if(rd.isTree=='Y'){
|
||||
this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
|
||||
}else{
|
||||
this.$router.push({ path: '/online/cgformList/' + rd.id })
|
||||
}
|
||||
},
|
||||
handleOnlineUrlClose() {
|
||||
this.onlineUrlTitle = ''
|
||||
this.onlineUrlVisible = false
|
||||
},
|
||||
handleOnlineUrlShow(record) {
|
||||
if(record.isTree=='Y'){
|
||||
this.onlineUrl = `/online/cgformTreeList/${record.id}`
|
||||
}else{
|
||||
this.onlineUrl = `/online/cgformList/${record.id}`
|
||||
}
|
||||
this.onlineUrlVisible = true
|
||||
this.onlineUrlTitle = '菜单链接[' + record.tableTxt + ']'
|
||||
},
|
||||
handleRemoveRecord(id) {
|
||||
let that = this
|
||||
this.$confirm({
|
||||
title: '确认要移除此记录?',
|
||||
onOk() {
|
||||
deleteAction(that.url.removeRecord, { id: id }).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success('移除成功')
|
||||
that.loadData()
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
}
|
||||
})
|
||||
},
|
||||
doEnhanceJs() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.ehjs.show(this.selectedRowKeys[0])
|
||||
},
|
||||
doEnhanceSql() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.ehsql.show(this.selectedRowKeys[0])
|
||||
},
|
||||
doEnhanceJava() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.ehjava.show(this.selectedRowKeys[0])
|
||||
},
|
||||
doCgformButton() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.btnList.show(this.selectedRowKeys[0])
|
||||
|
||||
//this.$router.push({ path: '/online/cgformButton/' + this.selectedRowKeys[0] })
|
||||
},
|
||||
importOnlineForm() {
|
||||
this.$refs.transd2o.show()
|
||||
},
|
||||
transOk() {
|
||||
this.loadData()
|
||||
},
|
||||
onSelectChange(keys, rows) {
|
||||
this.selectedRowKeys = keys
|
||||
this.selectedRows = rows
|
||||
},
|
||||
onCopyUrl(){
|
||||
var clipboard = new Clipboard('.copy-this-text')
|
||||
clipboard.on('success', () => {
|
||||
clipboard.destroy()
|
||||
this.$message.success('复制成功')
|
||||
this.handleOnlineUrlClose()
|
||||
})
|
||||
clipboard.on('error', () => {
|
||||
this.$message.error('该浏览器不支持自动复制')
|
||||
clipboard.destroy()
|
||||
})
|
||||
},
|
||||
showMyCopyInfo(id){
|
||||
console.log("查看复制表单的信息",id)
|
||||
},
|
||||
copyConfig(id){
|
||||
postAction(`${this.url.copyOnline}?code=${id}`).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success("复制成功")
|
||||
this.loadData()
|
||||
}else{
|
||||
this.$message.error("复制失败>>"+res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
<style lang="less">
|
||||
.ant-card-body .table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.ant-table-tbody .ant-table-row td {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.anty-row-operator button {
|
||||
margin: 0 5px
|
||||
}
|
||||
|
||||
.ant-btn-danger {
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
}
|
||||
|
||||
.valid-error-cust{
|
||||
.ant-select-selection{
|
||||
border:2px solid #f5222d;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,493 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="表名">
|
||||
<a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="表类型">
|
||||
<j-dict-select-tag dictCode="cgform_table_type" v-model="queryParam.tableType"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="表描述">
|
||||
<a-input placeholder="请输入表描述" v-model="queryParam.tableTxt"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button @click="doCgformButton" type="primary" icon="highlight">自定义按钮</a-button>
|
||||
<a-button @click="doEnhanceJs" type="primary" icon="strikethrough">JS增强</a-button>
|
||||
<a-button @click="doEnhanceSql" type="primary" icon="filter">SQL增强</a-button>
|
||||
<a-button @click="doEnhanceJava" type="primary" icon="tool">Java增强</a-button>
|
||||
<a-button @click="importOnlineForm" type="primary" icon="database">从数据库导入表单</a-button>
|
||||
<a-button @click="goGenerateCode" type="primary" icon="database">代码生成</a-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel">
|
||||
<a-icon type="delete"/>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button> 批量操作
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i>
|
||||
已选择
|
||||
<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
|
||||
项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
<template slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多
|
||||
<a-icon type="down"/>
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item v-if="record.isDbSynch!='Y'">
|
||||
<a @click="openSyncModal(record.id)">同步数据库</a>
|
||||
</a-menu-item>
|
||||
|
||||
<template v-if="record.isDbSynch=='Y' && record.tableType !== 3">
|
||||
<a-menu-item>
|
||||
<a @click="goPageOnline(record)">功能测试</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a @click="handleOnlineUrlShow(record)">配置地址</a>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
|
||||
<a-menu-item>
|
||||
<a @click="copyConfig(record.id)">复制视图</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item v-if="record.hascopy==1">
|
||||
<a @click="showMyCopyInfo(record.id)">配置视图</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a @click="handleRemoveRecord(record.id)">移除</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
|
||||
<template slot="dbsync" slot-scope="text">
|
||||
<span v-if="text==='Y'" style="color:limegreen">已同步</span>
|
||||
<span v-if="text==='N'" style="color:red">未同步</span>
|
||||
</template>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<onl-cgform-head-modal ref="modalForm" @ok="modalFormOk"></onl-cgform-head-modal>
|
||||
|
||||
<!-- 同步数据库提示框 -->
|
||||
<a-modal
|
||||
:width="500"
|
||||
:height="300"
|
||||
title="同步数据库"
|
||||
:visible="syncModalVisible"
|
||||
@cancel="handleCancleDbSync"
|
||||
style="top:5%;height: 95%;">
|
||||
<template slot="footer">
|
||||
<a-button @click="handleCancleDbSync">关闭</a-button>
|
||||
<a-button type="primary" :loading="syncLoading" @click="handleDbSync">
|
||||
确定
|
||||
</a-button>
|
||||
</template>
|
||||
<a-radio-group v-model="synMethod">
|
||||
<a-radio style="display: block;width: 30px;height: 30px" value="normal">普通同步(保留表数据)</a-radio>
|
||||
<a-radio style="display: block;width: 30px;height: 30px" value="force">强制同步(删除表,重新生成)</a-radio>
|
||||
</a-radio-group>
|
||||
</a-modal>
|
||||
|
||||
<!-- 提示online报表链接 -->
|
||||
<a-modal
|
||||
:title="onlineUrlTitle"
|
||||
:visible="onlineUrlVisible"
|
||||
@cancel="handleOnlineUrlClose">
|
||||
<template slot="footer">
|
||||
<a-button @click="handleOnlineUrlClose">关闭</a-button>
|
||||
<a-button type="primary" class="copy-this-text" :data-clipboard-text="onlineUrl" @click="onCopyUrl">复制</a-button>
|
||||
</template>
|
||||
<p>{{ onlineUrl }}</p>
|
||||
</a-modal>
|
||||
|
||||
<enhance-js ref="ehjs"></enhance-js>
|
||||
<enhance-sql ref="ehsql"></enhance-sql>
|
||||
<enhance-java ref="ehjava"></enhance-java>
|
||||
<trans-db2-online ref="transd2o" @ok="transOk"></trans-db2-online>
|
||||
<code-generator ref="cg"></code-generator>
|
||||
|
||||
<onl-cgform-button-list ref="btnList"></onl-cgform-button-list>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
|
||||
import { deleteAction, postAction } from '@/api/manage'
|
||||
import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import Clipboard from 'clipboard'
|
||||
import { filterObj } from '@/utils/util';
|
||||
|
||||
export default {
|
||||
name: 'OnlCgformHeadList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
JDictSelectTag,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: 'Online表单开发管理页面',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function(t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '表类型',
|
||||
align: 'center',
|
||||
dataIndex: 'tableType',
|
||||
customRender: (text, record) => {
|
||||
let tbTypeText = filterDictText(this.tableTypeDictOptions, `${text}`)
|
||||
if(record.isTree === 'Y'){
|
||||
tbTypeText+='(树)'
|
||||
}
|
||||
return tbTypeText;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '表名',
|
||||
align: 'center',
|
||||
dataIndex: 'tableName'
|
||||
},
|
||||
{
|
||||
title: '表描述',
|
||||
align: 'center',
|
||||
dataIndex: 'tableTxt'
|
||||
},
|
||||
{
|
||||
title: '版本',
|
||||
align: 'center',
|
||||
dataIndex: 'tableVersion'
|
||||
},
|
||||
|
||||
{
|
||||
title: '同步数据库状态',
|
||||
align: 'center',
|
||||
dataIndex: 'isDbSynch',
|
||||
scopedSlots: { customRender: 'dbsync' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/online/cgform/head/list',
|
||||
delete: '/online/cgform/head/delete',
|
||||
deleteBatch: '/online/cgform/head/deleteBatch',
|
||||
doDbSynch: '/online/cgform/api/doDbSynch/',
|
||||
removeRecord: '/online/cgform/head/removeRecord',
|
||||
copyOnline: '/online/cgform/head/copyOnline'
|
||||
},
|
||||
tableTypeDictOptions: [],
|
||||
sexDictOptions: [],
|
||||
syncModalVisible: false,
|
||||
syncFormId: '',
|
||||
synMethod: 'normal',
|
||||
syncLoading: false,
|
||||
onlineUrlTitle: '',
|
||||
onlineUrlVisible: false,
|
||||
onlineUrl: '',
|
||||
selectedRowKeys: [],
|
||||
selectedRows: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//初始化字典 - 表类型
|
||||
initDictOptions('cgform_table_type').then((res) => {
|
||||
if (res.success) {
|
||||
this.tableTypeDictOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doDbSynch(id) {
|
||||
postAction(this.url.doDbSynch + id, { synMethod: '1' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
getQueryParams() {
|
||||
//获取查询条件
|
||||
var param = Object.assign({}, this.queryParam, this.isorter ,this.filters);
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
param.copyType = 0;
|
||||
return filterObj(param);
|
||||
},
|
||||
handleCancleDbSync() {
|
||||
this.syncModalVisible = false
|
||||
},
|
||||
handleDbSync() {
|
||||
this.syncLoading = true
|
||||
postAction(this.url.doDbSynch + this.syncFormId + '/' + this.synMethod).then((res) => {
|
||||
this.syncModalVisible = false
|
||||
this.syncLoading = false
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
setTimeout(()=>{
|
||||
if(this.syncLoading){
|
||||
this.syncModalVisible = false
|
||||
this.syncLoading = false
|
||||
this.$message.success("网络延迟,已自动刷新!")
|
||||
this.loadData()
|
||||
}
|
||||
},10000)
|
||||
},
|
||||
openSyncModal(id) {
|
||||
this.syncModalVisible = true
|
||||
this.syncLoading = false
|
||||
this.syncFormId = id
|
||||
},
|
||||
goPageOnline(rd) {
|
||||
if(rd.themeTemplate === 'erp'){
|
||||
this.$router.push({ path: '/online/cgformErpList/' + rd.id })
|
||||
}else{
|
||||
if(rd.isTree=='Y'){
|
||||
this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
|
||||
}else{
|
||||
this.$router.push({ path: '/online/cgformList/' + rd.id })
|
||||
}
|
||||
}
|
||||
},
|
||||
handleOnlineUrlClose() {
|
||||
this.onlineUrlTitle = ''
|
||||
this.onlineUrlVisible = false
|
||||
},
|
||||
handleOnlineUrlShow(record) {
|
||||
if(record.isTree=='Y'){
|
||||
this.onlineUrl = `/online/cgformTreeList/${record.id}`
|
||||
}else{
|
||||
this.onlineUrl = `/online/cgformList/${record.id}`
|
||||
}
|
||||
this.onlineUrlVisible = true
|
||||
this.onlineUrlTitle = '菜单链接[' + record.tableTxt + ']'
|
||||
},
|
||||
handleRemoveRecord(id) {
|
||||
let that = this
|
||||
this.$confirm({
|
||||
title: '确认要移除此记录?',
|
||||
onOk() {
|
||||
deleteAction(that.url.removeRecord, { id: id }).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success('移除成功')
|
||||
that.loadData()
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
}
|
||||
})
|
||||
},
|
||||
doEnhanceJs() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.ehjs.show(this.selectedRowKeys[0])
|
||||
},
|
||||
doEnhanceSql() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.ehsql.show(this.selectedRowKeys[0])
|
||||
},
|
||||
doEnhanceJava() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.ehjava.show(this.selectedRowKeys[0])
|
||||
},
|
||||
doCgformButton() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
this.$refs.btnList.show(this.selectedRowKeys[0])
|
||||
|
||||
//this.$router.push({ path: '/online/cgformButton/' + this.selectedRowKeys[0] })
|
||||
},
|
||||
importOnlineForm() {
|
||||
this.$refs.transd2o.show()
|
||||
},
|
||||
transOk() {
|
||||
this.loadData()
|
||||
},
|
||||
goGenerateCode() {
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length != 1) {
|
||||
this.$message.warning('请先选中一条记录')
|
||||
return
|
||||
}
|
||||
let row = this.selectedRows[0]
|
||||
if (!row.isDbSynch || row.isDbSynch == 'N') {
|
||||
this.$message.warning('请先同步数据库!')
|
||||
return
|
||||
}
|
||||
if (row.tableType == 3) {
|
||||
this.$message.warning('请选中该表对应的主表生成代码')
|
||||
return
|
||||
}
|
||||
this.$refs.cg.show(this.selectedRowKeys[0])
|
||||
},
|
||||
onSelectChange(keys, rows) {
|
||||
this.selectedRowKeys = keys
|
||||
this.selectedRows = rows
|
||||
},
|
||||
onCopyUrl(){
|
||||
var clipboard = new Clipboard('.copy-this-text')
|
||||
clipboard.on('success', () => {
|
||||
clipboard.destroy()
|
||||
this.$message.success('复制成功')
|
||||
this.handleOnlineUrlClose()
|
||||
})
|
||||
clipboard.on('error', () => {
|
||||
this.$message.error('该浏览器不支持自动复制')
|
||||
clipboard.destroy()
|
||||
})
|
||||
},
|
||||
showMyCopyInfo(id){
|
||||
this.$router.push({ path: '/online/copyform/' + id })
|
||||
},
|
||||
copyConfig(id){
|
||||
postAction(`${this.url.copyOnline}?code=${id}`).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success("复制成功")
|
||||
this.loadData()
|
||||
}else{
|
||||
this.$message.error("复制失败>>"+res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
<style lang="less">
|
||||
.ant-card-body .table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.ant-table-tbody .ant-table-row td {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.anty-row-operator button {
|
||||
margin: 0 5px
|
||||
}
|
||||
|
||||
.ant-btn-danger {
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
}
|
||||
|
||||
.valid-error-cust{
|
||||
.ant-select-selection{
|
||||
border:2px solid #f5222d;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,41 +0,0 @@
|
||||
/**
|
||||
* online 自定义按钮表达式处理类
|
||||
*/
|
||||
export default class ButtonExpHandler {
|
||||
/**
|
||||
* 构造器
|
||||
* @param express
|
||||
*/
|
||||
constructor(express,record) {
|
||||
this._express = express;
|
||||
this._record = record;
|
||||
}
|
||||
|
||||
get show() {
|
||||
if(!this._express || this._express==''){
|
||||
return true;
|
||||
}
|
||||
let arr = this._express.split('#');
|
||||
//获取字段值
|
||||
let fieldValue = this._record[arr[0]];
|
||||
//获取表达式
|
||||
let exp = arr[1].toLowerCase();
|
||||
//判断表达式
|
||||
if(exp === 'eq'){
|
||||
return fieldValue == arr[2];
|
||||
}else if(exp === 'ne'){
|
||||
return !(fieldValue == arr[2]);
|
||||
}else if(exp === 'empty'){
|
||||
if(arr[2]==='true' || arr[2]===true){
|
||||
return !fieldValue || fieldValue=='';
|
||||
}else{
|
||||
return fieldValue && fieldValue.length>0
|
||||
}
|
||||
}else if(exp === 'in'){
|
||||
let arr2 = arr[2].split(',');
|
||||
return arr2.indexOf(String(fieldValue))>=0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,827 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchByquery">
|
||||
<a-row :gutter="24" v-if="queryInfo && queryInfo.length>0">
|
||||
<template v-for="(item,index) in queryInfo">
|
||||
<template v-if=" item.hidden==='1' ">
|
||||
<a-col v-if="item.view=='datetime'" :md="12" :sm="16" :key=" 'query'+index " v-show="toggleSearchStatus">
|
||||
<online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
|
||||
</a-col>
|
||||
<a-col v-else :md="6" :sm="8" :key=" 'query'+index " v-show="toggleSearchStatus">
|
||||
<online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-col v-if="item.view=='datetime'" :md="12" :sm="16" :key=" 'query'+index ">
|
||||
<online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
|
||||
</a-col>
|
||||
<a-col v-else :md="6" :sm="8" :key=" 'query'+index ">
|
||||
<online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchByquery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</span>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button v-if="buttonSwitch.add" @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button v-if="buttonSwitch.import" @click="handleImportXls" type="primary" icon="upload">导入</a-button>
|
||||
<a-button v-if="buttonSwitch.export" @click="handleExportXls" type="primary" icon="download">导出</a-button>
|
||||
<template v-if="cgButtonList && cgButtonList.length>0" v-for="(item,index) in cgButtonList">
|
||||
<a-button
|
||||
v-if=" item.optType=='js' "
|
||||
:key=" 'cgbtn'+index "
|
||||
@click="cgButtonJsHandler(item.buttonCode)"
|
||||
type="primary"
|
||||
:icon="item.buttonIcon">
|
||||
{{ item.buttonName }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-else-if=" item.optType=='action' "
|
||||
:key=" 'cgbtn'+index "
|
||||
@click="cgButtonActionHandler(item.buttonCode)"
|
||||
type="primary"
|
||||
:icon="item.buttonIcon">
|
||||
{{ item.buttonName }}
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<!-- 高级查询 -->
|
||||
<j-super-query
|
||||
ref="superQuery"
|
||||
:fieldList="superQuery.fieldList"
|
||||
:saveCode="$route.fullPath"
|
||||
:loading="table.loading"
|
||||
@handleSuperQuery="handleSuperQuery"/>
|
||||
|
||||
<a-button
|
||||
v-if="buttonSwitch.batch_delete"
|
||||
@click="handleDelBatch"
|
||||
v-show="table.selectedRowKeys.length > 0"
|
||||
ghost
|
||||
type="primary"
|
||||
icon="delete">批量删除</a-button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i>
|
||||
已选择 <a style="font-weight: 600">{{ table.selectedRowKeys.length }}</a>项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="cgformAutoList"
|
||||
bordered
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="table.columns"
|
||||
:dataSource="table.dataSource"
|
||||
:pagination="table.pagination"
|
||||
:loading="table.loading"
|
||||
:rowSelection="rowSelectionConfig"
|
||||
@change="handleTableChange"
|
||||
:scroll="table.scroll"
|
||||
style="min-height: 300px">
|
||||
|
||||
<!-- 支持链接href跳转 -->
|
||||
<template
|
||||
v-for="field of fieldHrefSlots"
|
||||
:slot="field.slotName"
|
||||
slot-scope="text, record"
|
||||
>
|
||||
<a @click="handleClickFieldHref(field,record)">{{ text }}</a>
|
||||
</template>
|
||||
|
||||
|
||||
<template slot="dateSlot" slot-scope="text">
|
||||
<span>{{ getFormatDate(text) }}</span>
|
||||
</template>
|
||||
|
||||
<template slot="htmlSlot" slot-scope="text">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
|
||||
<template slot="imgSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
||||
</template>
|
||||
|
||||
<template slot="fileSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button
|
||||
v-else
|
||||
:ghost="true"
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="downloadRowFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<template v-if="hasBpmStatus">
|
||||
<template v-if="record.bpm_status == '1'||record.bpm_status == ''|| record.bpm_status == null">
|
||||
<template v-if="buttonSwitch.update">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical"/>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="buttonSwitch.update">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical"/>
|
||||
</template>
|
||||
</template>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
更多 <a-icon type="down" />
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item v-if="buttonSwitch.detail">
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<template v-if="hasBpmStatus">
|
||||
<template v-if="record.bpm_status == '1'||record.bpm_status == ''|| record.bpm_status == null">
|
||||
<a-menu-item v-if="buttonSwitch.delete">
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-menu-item v-if="buttonSwitch.delete">
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
<template v-if="cgButtonLinkList && cgButtonLinkList.length>0" v-for="(btnItem,btnIndex) in cgButtonLinkList">
|
||||
<a-menu-item :key=" 'cgbtnLink'+btnIndex " v-if="showLinkButton(btnItem,record)">
|
||||
<a href="javascript:void(0);" @click="cgButtonLinkHandler(record,btnItem.buttonCode,btnItem.optType)">
|
||||
<a-icon v-if="btnItem.buttonIcon" :type="btnItem.buttonIcon" />
|
||||
{{ btnItem.buttonName }}
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
<onl-cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code" @schema="handleGetSchema" />
|
||||
|
||||
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
|
||||
|
||||
<!-- 跳转Href的动态组件方式 -->
|
||||
<a-modal v-bind="hrefComponent.model" v-on="hrefComponent.on">
|
||||
<component :is="hrefComponent.is" v-bind="hrefComponent.params"/>
|
||||
</a-modal>
|
||||
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { HrefJump } from '@/mixins/OnlAutoListMixin'
|
||||
import { postAction,getAction,deleteAction,downFile } from '@/api/manage'
|
||||
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
|
||||
import { cloneObject, filterObj } from '@/utils/util'
|
||||
import JImportModal from '@/components/jeecg/JImportModal'
|
||||
import JSuperQuery from '@comp/jeecg/JSuperQuery'
|
||||
import ButtonExpHandler from './ButtonExpHandler'
|
||||
|
||||
export default {
|
||||
name: 'OnlCgFormAutoList',
|
||||
mixins: [HrefJump],
|
||||
components: {
|
||||
JSuperQuery,
|
||||
JImportModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
code: '',
|
||||
description: '在线报表功能测试页面',
|
||||
currentTableName:"",
|
||||
url: {
|
||||
getQueryInfo:'/online/cgform/api/getQueryInfo/',
|
||||
getColumns: '/online/cgform/api/getColumns/',
|
||||
getData: '/online/cgform/api/getData/',
|
||||
optPre:"/online/cgform/api/form/",
|
||||
exportXls:'/online/cgform/api/exportXls/',
|
||||
buttonAction:'/online/cgform/api/doButton',
|
||||
},
|
||||
flowCodePre:"onl_",
|
||||
isorter:{
|
||||
column: 'createTime',
|
||||
order: 'desc',
|
||||
},
|
||||
//dictOptions:{fieldName:[]}
|
||||
dictOptions:{
|
||||
|
||||
},
|
||||
cgButtonLinkList:[],
|
||||
cgButtonList:[],
|
||||
queryInfo:[],
|
||||
// 查询参数,多个页面的查询参数用 code 作为键来区分
|
||||
queryParamsMap: {},
|
||||
toggleSearchStatus:false,
|
||||
table: {
|
||||
loading: true,
|
||||
scroll:{x:false},
|
||||
// 表头
|
||||
columns: [],
|
||||
//数据集
|
||||
dataSource: [],
|
||||
// 选择器
|
||||
selectedRowKeys: [],
|
||||
selectionRows: [],
|
||||
// 分页参数
|
||||
pagination: {
|
||||
|
||||
}
|
||||
},
|
||||
metaPagination:{
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
},
|
||||
actionColumn:{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
fixed:"right",
|
||||
align:"center",
|
||||
width:150
|
||||
},
|
||||
formTemplate:"99",
|
||||
EnhanceJS:'',
|
||||
hideColumns:[],
|
||||
buttonSwitch:{
|
||||
add:true,
|
||||
update:true,
|
||||
delete:true,
|
||||
batch_delete:true,
|
||||
import:true,
|
||||
export:true,
|
||||
detail:true
|
||||
},
|
||||
hasBpmStatus:false,
|
||||
checkboxFlag:false,
|
||||
// 高级查询
|
||||
superQuery: {
|
||||
// 字段列表
|
||||
fieldList: [],
|
||||
// 查询参数
|
||||
params: '',
|
||||
// 查询条件拼接方式 'and' or 'or'
|
||||
matchType: 'and'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initAutoList();
|
||||
},
|
||||
mounted(){
|
||||
this.cgButtonJsHandler('mounted')
|
||||
},
|
||||
watch: {
|
||||
'$route'() {
|
||||
// 刷新参数放到这里去触发,就可以刷新相同界面了
|
||||
this.initAutoList()
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
rowSelectionConfig:function() {
|
||||
if(!this.checkboxFlag){
|
||||
return null
|
||||
}
|
||||
return {
|
||||
fixed:true,
|
||||
selectedRowKeys:this.table.selectedRowKeys,
|
||||
onChange: this.handleChangeInTableSelect
|
||||
}
|
||||
},
|
||||
queryParam: {
|
||||
get() {
|
||||
return this.queryParamsMap[this.code]
|
||||
},
|
||||
set(newVal) {
|
||||
this.$set(this.queryParamsMap, this.code, newVal)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasBpmStatusFilter(){
|
||||
var columnObjs = this.table.columns;
|
||||
let columns = [];
|
||||
for (var item of columnObjs) {
|
||||
columns.push(item.dataIndex);
|
||||
}
|
||||
if(columns.includes('bpm_status')||columns.includes('BPM_STATUS')){
|
||||
this.hasBpmStatus = true;
|
||||
}else{
|
||||
this.hasBpmStatus = false;
|
||||
}
|
||||
},
|
||||
initQueryInfo(){
|
||||
getAction(`${this.url.getQueryInfo}${this.code}`).then((res)=>{
|
||||
console.log("--onlineList-获取查询条件配置",res);
|
||||
if(res.success){
|
||||
this.queryInfo = res.result
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
initAutoList(){
|
||||
if(!this.$route.params.code){
|
||||
return false
|
||||
}
|
||||
// 清空高级查询条件
|
||||
this.superQuery.params = ''
|
||||
if (this.$refs.superQuery) {
|
||||
this.$refs.superQuery.handleReset()
|
||||
}
|
||||
|
||||
this.table.loading = true
|
||||
this.code = this.$route.params.code
|
||||
if (!this.queryParam) {
|
||||
this.queryParam = {}
|
||||
}
|
||||
getAction(`${this.url.getColumns}${this.code}`).then((res)=>{
|
||||
console.log("--onlineList-加载动态列>>",res);
|
||||
if(res.success){
|
||||
if(res.result.checkboxFlag == 'Y'){
|
||||
this.checkboxFlag = true
|
||||
}else{
|
||||
this.checkboxFlag = false
|
||||
}
|
||||
|
||||
if(res.result.paginationFlag=='Y'){
|
||||
this.table.pagination = {...this.metaPagination}
|
||||
}else{
|
||||
this.table.pagination = false
|
||||
}
|
||||
|
||||
this.fieldHrefSlots = res.result.fieldHrefSlots
|
||||
this.dictOptions = res.result.dictOptions
|
||||
this.formTemplate = res.result.formTemplate
|
||||
this.description = res.result.description
|
||||
this.currentTableName = res.result.currentTableName
|
||||
this.initCgButtonList(res.result.cgButtonList)
|
||||
this.initCgEnhanceJs(res.result.enhanceJs)
|
||||
this.initButtonSwitch(res.result.hideColumns)
|
||||
let currColumns = res.result.columns
|
||||
for(let a=0;a<currColumns.length;a++){
|
||||
if(currColumns[a].customRender){
|
||||
let dictCode = currColumns[a].customRender;
|
||||
let replaceFlag = '_replace_text_';
|
||||
if(dictCode.startsWith(replaceFlag)){
|
||||
let textFieldName = dictCode.replace(replaceFlag,'')
|
||||
currColumns[a].customRender=(text,record)=>{
|
||||
return record[textFieldName]
|
||||
}
|
||||
}else{
|
||||
currColumns[a].customRender=(text)=>{
|
||||
return filterMultiDictText(this.dictOptions[dictCode], text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(res.result.scrollFlag==1){
|
||||
this.table.scroll = { x :'115%' }
|
||||
}else{
|
||||
this.table.scroll = { x :false }
|
||||
}
|
||||
currColumns.push(this.actionColumn);
|
||||
this.table.columns = [...currColumns]
|
||||
this.hasBpmStatusFilter();
|
||||
this.loadData();
|
||||
this.initQueryInfo();
|
||||
//加载新路由,清空checkbox选中
|
||||
this.table.selectedRowKeys = [];
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
loadData(arg){
|
||||
if(this.table.pagination){
|
||||
if(arg==1){
|
||||
this.table.pagination.current=1
|
||||
}
|
||||
this.table.loading = true
|
||||
let params = this.getQueryParams();//查询条件
|
||||
console.log("--onlineList-查询条件-->",params)
|
||||
getAction(`${this.url.getData}${this.code}`,params).then((res)=>{
|
||||
console.log("--onlineList-列表数据",res)
|
||||
if(res.success){
|
||||
let result = res.result;
|
||||
if(Number(result.total)>0){
|
||||
this.table.pagination.total = Number(result.total)
|
||||
this.table.dataSource = result.records
|
||||
}else{
|
||||
this.table.pagination.total=0;
|
||||
this.table.dataSource=[]
|
||||
//this.$message.warning("查无数据")
|
||||
}
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.table.loading = false
|
||||
})
|
||||
}else{
|
||||
this.loadDataNoPage()
|
||||
}
|
||||
},
|
||||
loadDataNoPage(){
|
||||
this.table.loading = true
|
||||
let param = this.getQueryParams()//查询条件
|
||||
param['pageSize'] = -521;
|
||||
getAction(`${this.url.getData}${this.code}`,filterObj(param)).then((res)=>{
|
||||
console.log("--onlineList-列表数据",res)
|
||||
if(res.success){
|
||||
let result = res.result;
|
||||
if(Number(result.total)>0){
|
||||
this.table.dataSource = result.records
|
||||
}else{
|
||||
this.table.dataSource=[]
|
||||
}
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.table.loading = false
|
||||
})
|
||||
},
|
||||
getQueryParams() {
|
||||
let param = Object.assign({}, this.queryParam,this.isorter);
|
||||
param.pageNo = this.table.pagination.current;
|
||||
param.pageSize = this.table.pagination.pageSize;
|
||||
param.superQueryMatchType = this.superQuery.matchType
|
||||
param.superQueryParams = encodeURIComponent(this.superQuery.params)
|
||||
return filterObj(param);
|
||||
},
|
||||
handleChangeInTableSelect(selectedRowKeys, selectionRows) {
|
||||
this.table.selectedRowKeys = selectedRowKeys
|
||||
this.table.selectionRows = selectionRows
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
},
|
||||
handleTableChange(pagination, filters, sorter){
|
||||
//TODO 筛选
|
||||
if (Object.keys(sorter).length>0){
|
||||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend"==sorter.order?"asc":"desc"
|
||||
}
|
||||
this.table.pagination = pagination;
|
||||
this.loadData();
|
||||
},
|
||||
handleAdd(){
|
||||
this.cgButtonJsHandler('beforeAdd')
|
||||
this.$refs.modal.add(this.formTemplate);
|
||||
},
|
||||
handleImportXls(){
|
||||
this.$refs.importModal.show()
|
||||
},
|
||||
importOk(){
|
||||
this.loadData(1)
|
||||
},
|
||||
handleExportXls2(){
|
||||
let param = this.queryParam;
|
||||
if(this.table.selectedRowKeys && this.table.selectedRowKeys.length>0){
|
||||
param['selections'] = this.table.selectedRowKeys.join(",")
|
||||
}
|
||||
let paramsStr = encodeURI(JSON.stringify(param));
|
||||
console.log('paramsStr: ' + paramsStr)
|
||||
let url = window._CONFIG['domianURL']+this.url.exportXls+this.code+"?paramsStr="+paramsStr
|
||||
window.location.href = url;
|
||||
},
|
||||
handleExportXls(){
|
||||
let param = this.queryParam;
|
||||
if(this.table.selectedRowKeys && this.table.selectedRowKeys.length>0){
|
||||
param['selections'] = this.table.selectedRowKeys.join(",")
|
||||
}
|
||||
console.log("导出参数",param)
|
||||
let paramsStr = JSON.stringify(filterObj(param));
|
||||
downFile(this.url.exportXls+this.code,{paramsStr:paramsStr}).then((data)=>{
|
||||
if (!data) {
|
||||
this.$message.warning("文件下载失败")
|
||||
return
|
||||
}
|
||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||
window.navigator.msSaveBlob(new Blob([data]), this.description+'.xls')
|
||||
}else{
|
||||
let url = window.URL.createObjectURL(new Blob([data]))
|
||||
let link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
link.setAttribute('download', this.description+'.xls')
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link); //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEdit(record){
|
||||
this.cgButtonLinkHandler(record,"beforeEdit","js")
|
||||
this.$refs.modal.edit(this.formTemplate,record.id);
|
||||
},
|
||||
showLinkButton(item,record){
|
||||
let btn = new ButtonExpHandler(item.exp,record);
|
||||
return btn.show;
|
||||
},
|
||||
handleDetail(record){
|
||||
this.$refs.modal.detail(this.formTemplate,record.id);
|
||||
},
|
||||
handleDeleteOne(record){
|
||||
this.cgButtonLinkHandler(record,"beforeDelete","js")
|
||||
this.handleDelete(record.id)
|
||||
},
|
||||
handleDelete(id){
|
||||
deleteAction(this.url.optPre+this.code+"/"+id).then((res)=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleFormSuccess(){
|
||||
this.loadData()
|
||||
},
|
||||
// 查询完 schema 后,生成高级查询的字段列表
|
||||
handleGetSchema(schema) {
|
||||
if (schema && schema.properties) {
|
||||
let setField = (array, field) => {
|
||||
let type = field.type || 'string'
|
||||
type = (type === 'inputNumber' ? 'number' : type)
|
||||
array.push({
|
||||
type: type,
|
||||
value: field.key,
|
||||
text: field.title,
|
||||
// 额外字典参数
|
||||
dictCode: field.dictCode,
|
||||
dictTable: field.dictTable,
|
||||
dictText: field.dictText,
|
||||
options: field.enum || field.options,
|
||||
order: field.order,
|
||||
})
|
||||
}
|
||||
let fieldList = []
|
||||
for (let key in schema.properties) {
|
||||
if (!schema.properties.hasOwnProperty(key)) {
|
||||
continue
|
||||
}
|
||||
let field = schema.properties[key]
|
||||
// tab = 子表
|
||||
if (field.view === 'tab') {
|
||||
let subTable = {
|
||||
type: 'sub-table',
|
||||
value: field.key,
|
||||
text: field.describe,
|
||||
children: []
|
||||
}
|
||||
for (let column of field.columns) {
|
||||
setField(subTable.children, column)
|
||||
}
|
||||
fieldList.push(subTable)
|
||||
} else {
|
||||
field.key = key
|
||||
setField(fieldList, field)
|
||||
}
|
||||
}
|
||||
// 冒泡排序
|
||||
for (let i = 0; i < fieldList.length; i++) {
|
||||
for (let j = i + 1; j < fieldList.length; j++) {
|
||||
let temp1 = fieldList[i]
|
||||
let temp2 = fieldList[j]
|
||||
if (temp1.order > temp2.order) {
|
||||
fieldList[i] = temp2
|
||||
fieldList[j] = temp1
|
||||
}
|
||||
}
|
||||
}
|
||||
this.superQuery.fieldList = fieldList
|
||||
}
|
||||
},
|
||||
onClearSelected(){
|
||||
this.table.selectedRowKeys = []
|
||||
this.table.selectionRows = []
|
||||
},
|
||||
getImgView(text){
|
||||
if(text && text.indexOf(",")>0){
|
||||
text = text.substring(0,text.indexOf(","))
|
||||
}
|
||||
return window._CONFIG['staticDomainURL']+"/"+text
|
||||
},
|
||||
downloadRowFile(text){
|
||||
if(!text){
|
||||
this.$message.warning("未知的文件")
|
||||
return;
|
||||
}
|
||||
if(text.indexOf(",")>0){
|
||||
text = text.substring(0,text.indexOf(","))
|
||||
}
|
||||
window.open(window._CONFIG['staticDomainURL']+"/"+text);//TODO 下载的方法
|
||||
},
|
||||
handleDelBatch(){
|
||||
if(this.table.selectedRowKeys.length<=0){
|
||||
this.$message.warning('请选择一条记录!');
|
||||
return false;
|
||||
}else{
|
||||
let ids = "";
|
||||
let that = this;
|
||||
that.table.selectedRowKeys.forEach(function(val) {
|
||||
ids+=val+",";
|
||||
});
|
||||
that.$confirm({
|
||||
title:"确认删除",
|
||||
content:"是否删除选中数据?",
|
||||
onOk: function(){
|
||||
that.handleDelete(ids)
|
||||
that.onClearSelected();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
searchByquery(){
|
||||
this.loadData(1);
|
||||
},
|
||||
searchReset(){
|
||||
this.queryParam = {}
|
||||
this.loadData(1);
|
||||
},
|
||||
handleToggleSearch(){
|
||||
this.toggleSearchStatus = !this.toggleSearchStatus;
|
||||
},
|
||||
getFormatDate(text){
|
||||
if(!text){
|
||||
return ''
|
||||
}
|
||||
let a = text;
|
||||
if(a.length>10){
|
||||
a = a.substring(0,10);
|
||||
}
|
||||
return a;
|
||||
},
|
||||
getImportUrl(){
|
||||
return '/online/cgform/api/importXls/'+this.code
|
||||
},
|
||||
initCgEnhanceJs(enhanceJs){
|
||||
//console.log("--onlineList-js增强",enhanceJs)
|
||||
if(enhanceJs){
|
||||
let Obj = eval ("(" + enhanceJs + ")");
|
||||
this.EnhanceJS = new Obj(getAction,postAction,deleteAction);
|
||||
this.cgButtonJsHandler('created')
|
||||
}else{
|
||||
this.EnhanceJS = ''
|
||||
}
|
||||
},
|
||||
initCgButtonList(btnList){
|
||||
let linkArr = []
|
||||
let buttonArr = []
|
||||
if(btnList && btnList.length>0){
|
||||
for(let i=0;i<btnList.length;i++){
|
||||
let temp = btnList[i]
|
||||
if(temp.buttonStyle=='button'){
|
||||
buttonArr.push(temp)
|
||||
}else if(temp.buttonStyle=='link'){
|
||||
linkArr.push(temp)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.cgButtonLinkList = [...linkArr]
|
||||
this.cgButtonList=[...buttonArr]
|
||||
},
|
||||
cgButtonJsHandler(buttonCode){
|
||||
if(this.EnhanceJS[buttonCode]){
|
||||
this.EnhanceJS[buttonCode](this)
|
||||
}
|
||||
},
|
||||
cgButtonActionHandler(buttonCode){
|
||||
//处理自定义button的 需要配置该button自定义sql
|
||||
if(!this.table.selectedRowKeys || this.table.selectedRowKeys.length==0){
|
||||
this.$message.warning("请先选中一条记录")
|
||||
return false
|
||||
}
|
||||
if(this.table.selectedRowKeys.length>1){
|
||||
this.$message.warning("请只选中一条记录")
|
||||
return false
|
||||
}
|
||||
let params = {
|
||||
formId:this.code,
|
||||
buttonCode:buttonCode,
|
||||
dataId:this.table.selectedRowKeys[0]
|
||||
}
|
||||
console.log("自定义按钮请求后台参数:",params)
|
||||
postAction(this.url.buttonAction,params).then(res=>{
|
||||
if(res.success){
|
||||
this.loadData()
|
||||
this.$message.success("处理完成!")
|
||||
}else{
|
||||
this.$message.warning("处理失败!")
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
cgButtonLinkHandler(record,buttonCode,optType){
|
||||
if(optType=="js"){
|
||||
if(this.EnhanceJS[buttonCode]){
|
||||
this.EnhanceJS[buttonCode](this,record)
|
||||
}
|
||||
}else if(optType=="action"){
|
||||
let params = {
|
||||
formId:this.code,
|
||||
buttonCode:buttonCode,
|
||||
dataId:record.id
|
||||
}
|
||||
console.log("自定义按钮link请求后台参数:",params)
|
||||
postAction(this.url.buttonAction,params).then(res=>{
|
||||
if(res.success){
|
||||
this.loadData()
|
||||
this.$message.success("处理完成!")
|
||||
}else{
|
||||
this.$message.warning("处理失败!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
initButtonSwitch(hideColumns){
|
||||
Object.keys(this.buttonSwitch).forEach(key=>{
|
||||
this.buttonSwitch[key]=true
|
||||
})
|
||||
if(hideColumns && hideColumns.length>0){
|
||||
Object.keys(this.buttonSwitch).forEach(key=>{
|
||||
if(hideColumns.indexOf(key)>=0){
|
||||
this.buttonSwitch[key]=false
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 高级查询
|
||||
handleSuperQuery(params, matchType) {
|
||||
if (!params || params.length === 0) {
|
||||
this.superQuery.params = ''
|
||||
} else {
|
||||
this.superQuery.params = JSON.stringify(params)
|
||||
}
|
||||
this.superQuery.matchType = matchType
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
<style>
|
||||
.ant-card-body .table-operator{
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.ant-table-tbody .ant-table-row td{
|
||||
padding-top:15px;
|
||||
padding-bottom:15px;
|
||||
}
|
||||
.anty-row-operator button{margin: 0 5px}
|
||||
.ant-btn-danger{background-color: #ffffff}
|
||||
|
||||
.anty-img-wrap{height:25px;position: relative;}
|
||||
.anty-img-wrap > img{max-height:100%;}
|
||||
.ant-modal-cust-warp{height: 100%}
|
||||
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
|
||||
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
|
||||
</style>
|
||||
@ -1,696 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button v-if="buttonSwitch.add" @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button v-if="buttonSwitch.import" @click="handleImportXls" type="primary" icon="upload" style="margin-left:8px">导入</a-button>
|
||||
<a-button v-if="buttonSwitch.export" @click="handleExportXls" type="primary" icon="download" style="margin-left:8px">导出</a-button>
|
||||
<template v-if="cgButtonList && cgButtonList.length>0" v-for="(item,index) in cgButtonList">
|
||||
<a-button
|
||||
v-if=" item.optType=='js' "
|
||||
:key=" 'cgbtn'+index "
|
||||
@click="cgButtonJsHandler(item.buttonCode)"
|
||||
type="primary"
|
||||
:icon="item.buttonIcon"
|
||||
style="margin-left:8px">
|
||||
{{ item.buttonName }}
|
||||
</a-button>
|
||||
<a-button
|
||||
v-else-if=" item.optType=='action' "
|
||||
:key=" 'cgbtn'+index "
|
||||
@click="cgButtonActionHandler(item.buttonCode)"
|
||||
type="primary"
|
||||
:icon="item.buttonIcon"
|
||||
style="margin-left:8px">
|
||||
{{ item.buttonName }}
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<a-button
|
||||
v-if="buttonSwitch.batch_delete"
|
||||
@click="handleDelBatch"
|
||||
style="margin-left:8px"
|
||||
v-show="selectedRowKeys.length > 0"
|
||||
ghost
|
||||
type="primary"
|
||||
icon="delete">批量删除</a-button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i>
|
||||
已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="cgformTreeList"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="pagination"
|
||||
:loading="loading"
|
||||
@change="handleTableChange"
|
||||
v-bind="tableProps"
|
||||
@expand="handleExpand"
|
||||
style="min-height: 300px"
|
||||
:expandedRowKeys="expandedRowKeys">
|
||||
|
||||
<template slot="dateSlot" slot-scope="text">
|
||||
<span>{{ getDateNoTime(text) }}</span>
|
||||
</template>
|
||||
|
||||
<template slot="htmlSlot" slot-scope="text">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
|
||||
<template slot="imgSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
||||
</template>
|
||||
|
||||
<template slot="fileSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button
|
||||
v-else
|
||||
:ghost="true"
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="downloadRowFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
|
||||
<template v-if="showOptButton('update',record)">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical"/>
|
||||
</template>
|
||||
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
更多 <a-icon type="down" />
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item >
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item v-if="showOptButton('delete',record)">
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
<!-- 自定义按钮 -->
|
||||
<template v-if="cgButtonLinkList && cgButtonLinkList.length>0" v-for="(btnItem,btnIndex) in cgButtonLinkList">
|
||||
<a-menu-item :key=" 'cgbtnLink'+btnIndex ">
|
||||
<a href="javascript:void(0);" @click="cgButtonLinkHandler(record,btnItem.buttonCode,btnItem.optType)">
|
||||
<a-icon v-if="btnItem.buttonIcon" :type="btnItem.buttonIcon" />
|
||||
{{ btnItem.buttonName }}
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
|
||||
<onl-cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></onl-cgform-auto-modal>
|
||||
|
||||
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
|
||||
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { getAction,postAction,deleteAction,downFile } from '@/api/manage'
|
||||
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
|
||||
import { filterObj } from '@/utils/util';
|
||||
import JImportModal from '@/components/jeecg/JImportModal'
|
||||
|
||||
export default {
|
||||
name: 'OnlCgformTreeList',
|
||||
components: {
|
||||
JImportModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
code: '87b55a515d3441b6b98e48e5b35474a6',
|
||||
description: '在线报表功能测试页面',
|
||||
currentTableName:"",
|
||||
pidField:"",
|
||||
hasChildrenField:"",
|
||||
textField:'',
|
||||
loading: false,
|
||||
// 表头
|
||||
columns: [],
|
||||
//数据集
|
||||
dataSource: [],
|
||||
// 选择器
|
||||
selectedRowKeys: [],
|
||||
selectionRows: [],
|
||||
// 分页参数
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
},
|
||||
|
||||
url: {
|
||||
getColumns: '/online/cgform/api/getColumns/',
|
||||
getTreeData: '/online/cgform/api/getTreeData/',
|
||||
optPre:"/online/cgform/api/form/",
|
||||
exportXls:'/online/cgform/api/exportXls/',
|
||||
buttonAction:'/online/cgform/api/doButton',
|
||||
},
|
||||
isorter:{
|
||||
column: 'create_time',
|
||||
order: 'desc',
|
||||
},
|
||||
dictOptions:{
|
||||
|
||||
},
|
||||
|
||||
queryParam:{
|
||||
|
||||
},
|
||||
actionColumn:{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
fixed:"right",
|
||||
align:"center",
|
||||
width:150
|
||||
},
|
||||
formTemplate:"99",
|
||||
|
||||
/*自定义按钮-link*/
|
||||
cgButtonLinkList:[],
|
||||
/*自定义按钮-button*/
|
||||
cgButtonList:[],
|
||||
/*JS增强*/
|
||||
EnhanceJS:'',
|
||||
/*操作按钮权限*/
|
||||
buttonSwitch:{
|
||||
add:true,
|
||||
update:true,
|
||||
delete:true,
|
||||
batch_delete:true,
|
||||
import:true,
|
||||
export:true
|
||||
},
|
||||
expandedRowKeys:[],
|
||||
hasBpmStatus:false,
|
||||
flowCodePre:"onl_",
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initAutoListConfig().then(()=>{
|
||||
this.loadData(1)
|
||||
}).catch(msg=>{
|
||||
console.log(msg)
|
||||
})
|
||||
},
|
||||
mounted(){
|
||||
//this.cgButtonJsHandler('mounted')
|
||||
},
|
||||
watch: {
|
||||
'$route'() {
|
||||
// 刷新参数放到这里去触发,就可以刷新相同界面了
|
||||
this.initAutoListConfig().then(()=>{
|
||||
this.loadData(1)
|
||||
}).catch(msg=>{
|
||||
console.log(msg)
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tableProps() {
|
||||
let _this = this
|
||||
return {
|
||||
// 列表项是否可选择
|
||||
// https://vue.ant.design/components/table-cn/#rowSelection
|
||||
rowSelection: {
|
||||
selectedRowKeys: _this.selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resetData(){
|
||||
this.description=''
|
||||
this.currentTableName=''
|
||||
this.pidField=''
|
||||
this.hasChildrenField=''
|
||||
this.textField=''
|
||||
this.columns = []
|
||||
this.dataSource = []
|
||||
this.selectedRowKeys=[]
|
||||
this.selectionRows=[]
|
||||
},
|
||||
initAutoListConfig() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.$route.params.code) {
|
||||
reject("列表加载需要参数CODE为空!")
|
||||
} else {
|
||||
this.resetData()
|
||||
this.loading = true
|
||||
this.code = this.$route.params.code
|
||||
getAction(`${this.url.getColumns}${this.code}`)
|
||||
.then(res => {
|
||||
console.log("--onlineList-加载动态列>>", res);
|
||||
if(res.success){
|
||||
this.configInfohandler(res)
|
||||
resolve();
|
||||
}else{
|
||||
reject("onlineList-加载表配置信息失败")
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
configInfohandler(res){
|
||||
this.dictOptions = res.result.dictOptions
|
||||
this.formTemplate = res.result.formTemplate
|
||||
this.description = res.result.description
|
||||
this.currentTableName = res.result.currentTableName
|
||||
this.pidField = res.result.pidField
|
||||
this.hasChildrenField = res.result.hasChildrenField
|
||||
this.textField = res.result.textField
|
||||
//自定义按钮
|
||||
this.initCgButtonList(res.result.cgButtonList)
|
||||
//JS增强
|
||||
this.initCgEnhanceJs(res.result.enhanceJs)
|
||||
//操作按钮权限
|
||||
this.initButtonSwitch(res.result.hideColumns)
|
||||
let currColumns = res.result.columns
|
||||
let textFieldIndex = -1
|
||||
let hasBpmStatus = false
|
||||
for(let a=0;a<currColumns.length;a++){
|
||||
currColumns[a].align = 'left'
|
||||
//找到显示列
|
||||
if(this.textField==currColumns[a].dataIndex){
|
||||
textFieldIndex = a
|
||||
}
|
||||
//数据字典翻译
|
||||
if(currColumns[a].customRender){
|
||||
let dictCode = currColumns[a].customRender;
|
||||
currColumns[a].customRender=(text)=>{
|
||||
return filterMultiDictText(this.dictOptions[dictCode], text);
|
||||
}
|
||||
}
|
||||
//判断是否有bpm_status
|
||||
if(currColumns[a].dataIndex.toLowerCase()=='bpm_status'){
|
||||
hasBpmStatus = true;
|
||||
}
|
||||
}
|
||||
this.hasBpmStatus = hasBpmStatus;
|
||||
|
||||
if(textFieldIndex!=-1){
|
||||
let textFieldColumn = currColumns.splice(textFieldIndex,1)
|
||||
currColumns.unshift(textFieldColumn[0])
|
||||
}
|
||||
currColumns.push(this.actionColumn);
|
||||
this.columns = [...currColumns]
|
||||
},
|
||||
//加载根节点
|
||||
loadData(arg){
|
||||
if(arg==1){
|
||||
this.pagination.current=1
|
||||
}
|
||||
this.loading = true
|
||||
this.expandedRowKeys=[]
|
||||
let params = this.getQueryParams();//查询条件
|
||||
params[this.pidField]='0'
|
||||
console.log("--onlineList-查询条件-->",params)
|
||||
getAction(`${this.url.getTreeData}${this.code}`,params).then((res)=>{
|
||||
console.log("--onlineList-列表数据",res)
|
||||
if(res.success){
|
||||
let result = res.result;
|
||||
if(Number(result.total)>0){
|
||||
this.pagination.total = Number(result.total)
|
||||
let dataSource = res.result.records.map(item => {
|
||||
// 判断是否标记了带有子级
|
||||
if (item[this.hasChildrenField] === true || item[this.hasChildrenField]=='1') {
|
||||
let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true }
|
||||
item.children = [loadChild]
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.dataSource = dataSource
|
||||
}else{
|
||||
this.pagination.total=0;
|
||||
this.dataSource=[]
|
||||
}
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
//加载叶子节点
|
||||
handleExpand(expanded, record) {
|
||||
// 判断是否是展开状态
|
||||
if (expanded) {
|
||||
this.expandedRowKeys.push(record.id)
|
||||
if (record.children.length>0 && record.children[0].isLoading === true) {
|
||||
let params = this.getQueryParams();//查询条件
|
||||
params[this.pidField] = record.id
|
||||
getAction(`${this.url.getTreeData}${this.code}`,params).then((res)=>{
|
||||
if(res.success){
|
||||
if(Number(res.result.total)>0){
|
||||
let dataSource = res.result.records.map(item => {
|
||||
// 判断是否标记了带有子级
|
||||
if (item[this.hasChildrenField] === true || item[this.hasChildrenField]=='1') {
|
||||
let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true }
|
||||
item.children = [loadChild]
|
||||
}
|
||||
return item
|
||||
})
|
||||
record.children = dataSource
|
||||
}else{
|
||||
record.children=''
|
||||
record.hasChildrenField='0'
|
||||
}
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}else{
|
||||
let keyIndex = this.expandedRowKeys.indexOf(record.id)
|
||||
if(keyIndex>=0){
|
||||
this.expandedRowKeys.splice(keyIndex, 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
getQueryParams() {
|
||||
let param = Object.assign({}, this.queryParam,this.isorter);
|
||||
param.pageNo = this.pagination.current;
|
||||
param.pageSize = this.pagination.pageSize;
|
||||
return filterObj(param);
|
||||
},
|
||||
initCgButtonList(btnList){
|
||||
let linkArr = []
|
||||
let buttonArr = []
|
||||
if(btnList && btnList.length>0){
|
||||
for(let i=0;i<btnList.length;i++){
|
||||
let temp = btnList[i]
|
||||
if(temp.buttonStyle=='button'){
|
||||
buttonArr.push(temp)
|
||||
}else if(temp.buttonStyle=='link'){
|
||||
linkArr.push(temp)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.cgButtonLinkList = [...linkArr]
|
||||
this.cgButtonList=[...buttonArr]
|
||||
},
|
||||
initCgEnhanceJs(enhanceJs){
|
||||
//console.log("--onlineList-js增强",enhanceJs)
|
||||
if(enhanceJs){
|
||||
let Obj = eval ("(" + enhanceJs + ")");
|
||||
this.EnhanceJS = new Obj(getAction,postAction,deleteAction);
|
||||
this.cgButtonJsHandler('created')
|
||||
}else{
|
||||
this.EnhanceJS = ''
|
||||
}
|
||||
},
|
||||
initButtonSwitch(hideColumns){
|
||||
if(hideColumns && hideColumns.length>0){
|
||||
Object.keys(this.buttonSwitch).forEach(key=>{
|
||||
if(hideColumns.indexOf(key)>=0){
|
||||
this.buttonSwitch[key]=false
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
onClearSelected(){
|
||||
this.selectedRowKeys = []
|
||||
this.selectionRows = []
|
||||
},
|
||||
handleTableChange(pagination, filters, sorter){
|
||||
//TODO 筛选
|
||||
if (Object.keys(sorter).length>0){
|
||||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend"==sorter.order?"asc":"desc"
|
||||
}
|
||||
this.pagination = pagination;
|
||||
this.loadData();
|
||||
},
|
||||
/*-------数据格式化-begin----------*/
|
||||
getDateNoTime(text){
|
||||
if(!text){
|
||||
return ''
|
||||
}
|
||||
let a = text;
|
||||
if(a.length>10){
|
||||
a = a.substring(0,10);
|
||||
}
|
||||
return a;
|
||||
},
|
||||
getImgView(text){
|
||||
if(text && text.indexOf(",")>0){
|
||||
text = text.substring(0,text.indexOf(","))
|
||||
}
|
||||
return window._CONFIG['staticDomainURL']+"/"+text
|
||||
},
|
||||
downloadRowFile(text){
|
||||
if(!text){
|
||||
this.$message.warning("未知的文件")
|
||||
return;
|
||||
}
|
||||
if(text.indexOf(",")>0){
|
||||
text = text.substring(0,text.indexOf(","))
|
||||
}
|
||||
window.open(window._CONFIG['staticDomainURL']+"/"+text);
|
||||
},
|
||||
/*-------数据格式化-end----------*/
|
||||
|
||||
/*-------功能按钮触发事件-begin----------*/
|
||||
handleEdit(record){
|
||||
this.cgButtonLinkHandler(record,"beforeEdit","js")
|
||||
this.$refs.modal.edit(this.formTemplate,record.id);
|
||||
},
|
||||
handleDetail(record){
|
||||
this.$refs.modal.detail(this.formTemplate,record.id);
|
||||
},
|
||||
handleDeleteOne(record){
|
||||
this.cgButtonLinkHandler(record,"beforeDelete","js")
|
||||
this.handleDelete(record.id)
|
||||
},
|
||||
handleDelete(id){
|
||||
deleteAction(this.url.optPre+this.code+"/"+id).then((res)=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAdd(){
|
||||
this.cgButtonJsHandler('beforeAdd')
|
||||
this.$refs.modal.add(this.formTemplate);
|
||||
},
|
||||
handleFormSuccess(){
|
||||
this.loadData()
|
||||
},
|
||||
handleImportXls(){
|
||||
this.$refs.importModal.show()
|
||||
},
|
||||
importOk(){
|
||||
this.loadData(1)
|
||||
},
|
||||
getImportUrl(){
|
||||
return '/online/cgform/api/importXls/'+this.code
|
||||
},
|
||||
handleExportXls(){
|
||||
let param = this.queryParam;
|
||||
if(this.selectedRowKeys && this.selectedRowKeys.length>0){
|
||||
param['selections'] = this.selectedRowKeys.join(",")
|
||||
}
|
||||
console.log("导出参数",param)
|
||||
let paramsStr = JSON.stringify(filterObj(param));
|
||||
downFile(this.url.exportXls+this.code,{paramsStr:paramsStr}).then((data)=>{
|
||||
if (!data) {
|
||||
this.$message.warning("文件下载失败")
|
||||
return
|
||||
}
|
||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||
window.navigator.msSaveBlob(new Blob([data]), this.description+'.xls')
|
||||
}else{
|
||||
let url = window.URL.createObjectURL(new Blob([data]))
|
||||
let link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
link.setAttribute('download', this.description+'.xls')
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link); //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelBatch(){
|
||||
if(this.selectedRowKeys.length<=0){
|
||||
this.$message.warning('请选择一条记录!');
|
||||
return false;
|
||||
}else{
|
||||
let ids = "";
|
||||
let that = this;
|
||||
that.selectedRowKeys.forEach(function(val) {
|
||||
ids+=val+",";
|
||||
});
|
||||
that.$confirm({
|
||||
title:"确认删除",
|
||||
content:"是否删除选中数据?",
|
||||
onOk: function(){
|
||||
that.handleDelete(ids)
|
||||
that.onClearSelected();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/*-------功能按钮触发事件-begin----------*/
|
||||
|
||||
/*-------JS增强-begin----------*/
|
||||
cgButtonLinkHandler(record,buttonCode,optType){
|
||||
if(optType=="js"){
|
||||
if(this.EnhanceJS[buttonCode]){
|
||||
this.EnhanceJS[buttonCode](this,record)
|
||||
}
|
||||
}else if(optType=="action"){
|
||||
let params = {
|
||||
formId:this.code,
|
||||
buttonCode:buttonCode,
|
||||
dataId:record.id
|
||||
}
|
||||
console.log("自定义按钮link请求后台参数:",params)
|
||||
postAction(this.url.buttonAction,params).then(res=>{
|
||||
if(res.success){
|
||||
this.loadData()
|
||||
this.$message.success("处理完成!")
|
||||
}else{
|
||||
this.$message.warning("处理失败!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
cgButtonJsHandler(buttonCode){
|
||||
if(this.EnhanceJS[buttonCode]){
|
||||
this.EnhanceJS[buttonCode](this)
|
||||
}
|
||||
},
|
||||
cgButtonActionHandler(buttonCode){
|
||||
//处理自定义button的 需要配置该button自定义sql
|
||||
if(!this.selectedRowKeys || this.selectedRowKeys.length==0){
|
||||
this.$message.warning("请先选中一条记录")
|
||||
return false
|
||||
}
|
||||
if(this.selectedRowKeys.length>1){
|
||||
this.$message.warning("请只选中一条记录")
|
||||
return false
|
||||
}
|
||||
let params = {
|
||||
formId:this.code,
|
||||
buttonCode:buttonCode,
|
||||
dataId:this.selectedRowKeys[0]
|
||||
}
|
||||
console.log("自定义按钮请求后台参数:",params)
|
||||
postAction(this.url.buttonAction,params).then(res=>{
|
||||
if(res.success){
|
||||
this.loadData()
|
||||
this.$message.success("处理完成!")
|
||||
}else{
|
||||
this.$message.warning("处理失败!")
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
/*-------JS增强-end----------*/
|
||||
showOptButton(opt,record){
|
||||
//只有当按钮属性为false,或是按钮属性为true但是流程已提交时才隐藏
|
||||
if(!this.buttonSwitch[opt]){
|
||||
return false
|
||||
}else{
|
||||
if(this.hasBpmStatus){
|
||||
if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
showViewFlowButton(record){
|
||||
if(this.hasBpmStatus){
|
||||
if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
},
|
||||
startProcess: function(record){
|
||||
var that = this;
|
||||
this.$confirm({
|
||||
title:"提示",
|
||||
content:"确认提交流程吗?",
|
||||
onOk: function(){
|
||||
var param = {
|
||||
flowCode:that.flowCodePre+that.currentTableName,
|
||||
id:record.id,
|
||||
formUrl:"modules/bpm/task/form/OnlineFormDetail",
|
||||
formUrlMobile:"modules/bpm/task/form/OnlineFormDetail"
|
||||
}
|
||||
postAction(that.url.startProcess,param).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.ant-card-body .table-operator{
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.ant-table-tbody .ant-table-row td{
|
||||
padding-top:15px;
|
||||
padding-bottom:15px;
|
||||
}
|
||||
.anty-row-operator button{margin: 0 5px}
|
||||
.ant-btn-danger{background-color: #ffffff}
|
||||
|
||||
.anty-img-wrap{height:25px;position: relative;}
|
||||
.anty-img-wrap > img{max-height:100%;}
|
||||
.ant-modal-cust-warp{height: 100%}
|
||||
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
|
||||
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
|
||||
</style>
|
||||
@ -1,111 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
<online-common-list
|
||||
:ref="'onl_'+mainModel.currentTableName"
|
||||
:code="code"
|
||||
:model="mainModel"
|
||||
@seleted="onSelected">
|
||||
</online-common-list>
|
||||
|
||||
<a-tabs defaultActiveKey="0">
|
||||
<a-tab-pane v-for="(item,index) in subList" :tab="item.description" :key="index+''" :forceRender="true" >
|
||||
<online-common-list
|
||||
:ref="item.currentTableName"
|
||||
:code="item.code"
|
||||
:model="item"
|
||||
:main="selectedRow">
|
||||
</online-common-list>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'OnlCgformErpList',
|
||||
components:{
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
code:'',
|
||||
url: {
|
||||
getColumns: '/online/cgform/api/getErpColumns/',
|
||||
},
|
||||
mainModel:{},
|
||||
subList:[],
|
||||
mainId:'',
|
||||
selectedRow:{}
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route'() {
|
||||
// 刷新参数放到这里去触发,就可以刷新相同界面了
|
||||
this.initColumnConfig()
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.initColumnConfig();
|
||||
},
|
||||
methods:{
|
||||
getSubIndex(index){
|
||||
return index+1 + ''
|
||||
},
|
||||
getSubRef(item){
|
||||
let ref = item.currentTableName
|
||||
console.log("ref string",ref)
|
||||
return ref;
|
||||
},
|
||||
initColumnConfig(){
|
||||
if(!this.$route.params.code){
|
||||
return false
|
||||
}
|
||||
this.code = this.$route.params.code
|
||||
getAction(`${this.url.getColumns}${this.code}`).then((res)=>{
|
||||
console.log("erp表单配置",res)
|
||||
if(res.success){
|
||||
this.mainModel = res.result.main
|
||||
this.subList = res.result.subList
|
||||
|
||||
this.$nextTick(()=>{
|
||||
this.$refs['onl_'+this.mainModel.currentTableName].initListByModel();
|
||||
if(this.subList && this.subList.length>0){
|
||||
for(let item of this.subList){
|
||||
this.$refs[item.currentTableName][0].initListByModel();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelected(row){
|
||||
console.log("onSelected",row)
|
||||
this.selectedRow = row;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.ant-card-body .table-operator{
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.ant-table-tbody .ant-table-row td{
|
||||
padding-top:15px;
|
||||
padding-bottom:15px;
|
||||
}
|
||||
.anty-row-operator button{margin: 0 5px}
|
||||
.ant-btn-danger{background-color: #ffffff}
|
||||
|
||||
.anty-img-wrap{height:25px;position: relative;}
|
||||
.anty-img-wrap > img{max-height:100%;}
|
||||
.ant-modal-cust-warp{height: 100%}
|
||||
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
|
||||
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
|
||||
</style>
|
||||
@ -1,269 +0,0 @@
|
||||
/**
|
||||
* 同步列表,可以同步新增、修改、删除
|
||||
* @author sunjianlei
|
||||
* */
|
||||
export async function syncAllTable(vm, table1) {
|
||||
vm.$refs.editableTable.resetScrollTop()
|
||||
let deleteIds = table1.$refs.editableTable.getDeleteIds()
|
||||
let table1Value
|
||||
await table1.$refs.editableTable.getValuesPromise(false).then((values) => {
|
||||
table1Value = values
|
||||
return vm.$refs.editableTable.getValuesPromise(false)
|
||||
}).then((values) => {
|
||||
|
||||
table1Value.forEach(value => {
|
||||
let flag = false
|
||||
values.forEach((thisValue) => {
|
||||
if (value.id === thisValue.id) {
|
||||
|
||||
// 判断是否修改了值
|
||||
let dbFieldName = thisValue['dbFieldName']
|
||||
let dbFieldTxt = thisValue['dbFieldTxt']
|
||||
|
||||
// return
|
||||
|
||||
if (value.dbFieldName !== dbFieldName
|
||||
|| value.dbFieldTxt !== dbFieldTxt) {
|
||||
|
||||
// 修改了
|
||||
vm.$refs.editableTable.setValues([{
|
||||
rowKey: thisValue.id,
|
||||
values: {
|
||||
dbFieldName: value.dbFieldName,
|
||||
dbFieldTxt: value.dbFieldTxt
|
||||
}
|
||||
}])
|
||||
|
||||
}
|
||||
flag = true
|
||||
} else {
|
||||
// id不匹配则有可能是新增也有可能是删除了的
|
||||
// 遍历传进来的 deleteIds 进行对比
|
||||
deleteIds.forEach(delId => {
|
||||
// 对比成功,则删除该条数据
|
||||
if (delId === thisValue.id) {
|
||||
vm.$refs.editableTable.removeRows(vm.$refs.editableTable.caseId + delId)
|
||||
flag = true
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// return
|
||||
// 判断是否操作了该条数据,若没有操作则代表要执行新增操作
|
||||
if (!flag) {
|
||||
let record = Object.assign({}, value)
|
||||
vm.columns.forEach(column => {
|
||||
if (
|
||||
column.dataIndex !== 'dbFieldName' &&
|
||||
column.dataIndex !== 'dbFieldTxt'
|
||||
) {
|
||||
record[column.dataIndex] = column.defaultValue
|
||||
}
|
||||
})
|
||||
vm.$refs.editableTable.push(record)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将数据分类并Set进dataSource
|
||||
* @author sunjianlei
|
||||
**/
|
||||
export function setDataSource(vm, queryData) {
|
||||
let dataSource = []
|
||||
// 遍历查询出来的数据
|
||||
queryData.forEach(value => {
|
||||
|
||||
let data = { id: value['id'] }
|
||||
vm.columns.forEach(column => {
|
||||
let key = column.key
|
||||
if (key) {
|
||||
data[key] = value[key]
|
||||
|
||||
// 由于多选下拉框返回的是一个数组,所以需要改成 [1,2,3] 数组的形式,否则组件不识别
|
||||
// if (key === 'indexField') {
|
||||
// data[key] = value[key].split(',')
|
||||
// }
|
||||
|
||||
}
|
||||
})
|
||||
dataSource.push(data)
|
||||
})
|
||||
vm.dataSource = dataSource
|
||||
}
|
||||
|
||||
/** 获取主表的初始化数据 */
|
||||
export function getMasterTableInitialData() {
|
||||
return [
|
||||
{
|
||||
dbFieldName: 'id',
|
||||
dbFieldTxt: '主键',
|
||||
dbLength: 36,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'string',
|
||||
dbIsKey: '1',
|
||||
dbIsNull: '0',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
isReadOnly: '1',
|
||||
fieldShowType: 'text',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 1
|
||||
},
|
||||
{
|
||||
dbFieldName: 'create_by',
|
||||
dbFieldTxt: '创建人',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'string',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'text',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 2
|
||||
},
|
||||
{
|
||||
dbFieldName: 'create_time',
|
||||
dbFieldTxt: '创建日期',
|
||||
dbLength: 20,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'Date',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'datetime',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 3
|
||||
},
|
||||
{
|
||||
dbFieldName: 'update_by',
|
||||
dbFieldTxt: '更新人',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'string',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'text',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 4
|
||||
},
|
||||
{
|
||||
dbFieldName: 'update_time',
|
||||
dbFieldTxt: '更新日期',
|
||||
dbLength: 20,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'Date',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'datetime',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 5
|
||||
},{
|
||||
dbFieldName: 'sys_org_code',
|
||||
dbFieldTxt: '所属部门',
|
||||
dbLength: 64,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'string',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'text',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 6
|
||||
}
|
||||
// {
|
||||
// dbFieldName: 'sys_org_code',
|
||||
// dbFieldTxt: '所属部门',
|
||||
// dbLength: 50,
|
||||
// dbPointLength: 0,
|
||||
// dbDefaultVal: '',
|
||||
// dbType: 'string',
|
||||
// dbIsKey: false,
|
||||
// dbIsNull: true
|
||||
// }, {
|
||||
// dbFieldName: 'sys_company_code',
|
||||
// dbFieldTxt: '所属公司',
|
||||
// dbLength: 50,
|
||||
// dbPointLength: 0,
|
||||
// dbDefaultVal: '',
|
||||
// dbType: 'string',
|
||||
// dbIsKey: false,
|
||||
// dbIsNull: true
|
||||
// }, {
|
||||
// dbFieldName: 'bpm_status',
|
||||
// dbFieldTxt: '流程状态',
|
||||
// dbLength: 32,
|
||||
// dbPointLength: 0,
|
||||
// dbDefaultVal: '',
|
||||
// dbType: 'string',
|
||||
// dbIsKey: false,
|
||||
// dbIsNull: true
|
||||
// }
|
||||
]
|
||||
}
|
||||
/** 获取树的初始化数据 */
|
||||
export function getTreeNeedFields() {
|
||||
return [{
|
||||
dbFieldName: 'pid',
|
||||
dbFieldTxt: '父级节点',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'string',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '1',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'text',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 7
|
||||
},{
|
||||
dbFieldName: 'has_child',
|
||||
dbFieldTxt: '是否有子节点',
|
||||
dbLength: 3,
|
||||
dbPointLength: 0,
|
||||
dbDefaultVal: '',
|
||||
dbType: 'string',
|
||||
dbIsKey: '0',
|
||||
dbIsNull: '1',
|
||||
// table2
|
||||
isShowForm: '0',
|
||||
isShowList: '0',
|
||||
fieldShowType: 'list',
|
||||
fieldLength: '120',
|
||||
queryMode: 'single',
|
||||
orderNum: 8,
|
||||
// table3
|
||||
dictField:"yn"
|
||||
}]
|
||||
}
|
||||
@ -1,256 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="报表编码">
|
||||
<a-input placeholder="请输入报表编码" v-model="queryParam.code"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="报表名字">
|
||||
<a-input placeholder="请输入报表名字" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">录入</a-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel">
|
||||
<a-icon type="delete"/>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button style="margin-left: 8px"> 批量操作
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i>
|
||||
已选择
|
||||
<a style="font-weight: 600">
|
||||
{{ selectedRowKeys.length }}
|
||||
</a>
|
||||
项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item @click="popReportURL(record.id)">
|
||||
配置地址
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a @click="goPageOnline(record.id)">功能测试</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<onlCgreportHead-modal ref="modalForm" @ok="modalFormOk"></onlCgreportHead-modal>
|
||||
|
||||
<!-- 提示online报表链接 -->
|
||||
<a-modal
|
||||
title="报表访问链接"
|
||||
:visible="visible"
|
||||
@cancel="handleCancel">
|
||||
<template slot="footer">
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" class="copy-this-text" :data-clipboard-text="reportUrlText" @click="onCopyUrl">复制</a-button>
|
||||
</template>
|
||||
<p>{{ reportUrlText }}</p>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import Clipboard from 'clipboard'
|
||||
import { getAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'OnlCgreportHeadList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
Clipboard
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: '在线报表配置管理页面',
|
||||
visible:false,
|
||||
reportUrlText:'',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '报表名称',
|
||||
align: 'center',
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '编码',
|
||||
align: 'center',
|
||||
dataIndex: 'code'
|
||||
},
|
||||
{
|
||||
title: '查询SQL',
|
||||
align: 'center',
|
||||
dataIndex: 'cgrSql'
|
||||
},
|
||||
{
|
||||
title: '数据源',
|
||||
align: 'center',
|
||||
dataIndex: 'dbSource'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align: 'center',
|
||||
dataIndex: 'content'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/online/cgreport/head/list',
|
||||
delete: '/online/cgreport/head/delete',
|
||||
deleteBatch: '/online/cgreport/head/deleteBatch',
|
||||
getParamsInfo:'/online/cgreport/api/getParamsInfo/'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initReportUrlText(id){
|
||||
getAction(this.url.getParamsInfo+id).then((res) => {
|
||||
let textUrl = ""
|
||||
if (res.success) {
|
||||
if(res.result && res.result.length>0){
|
||||
for(let i of res.result){
|
||||
textUrl+=i.paramName+"=${"+i.paramName+"}&"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
if(textUrl.length>0){
|
||||
textUrl = textUrl.substring(0,textUrl.length-1)
|
||||
this.reportUrlText = `/online/cgreport/${id}?${textUrl}`
|
||||
}else{
|
||||
this.reportUrlText = `/online/cgreport/${id}`
|
||||
}
|
||||
})
|
||||
},
|
||||
goPageOnline(id){
|
||||
this.$router.push({path: '/online/cgreport/'+id})
|
||||
},
|
||||
popReportURL(id){
|
||||
this.visible = true;
|
||||
this.initReportUrlText(id)
|
||||
},
|
||||
handleCancel(){
|
||||
this.visible = false
|
||||
this.reportUrlText = '';
|
||||
},
|
||||
onCopyUrl(){
|
||||
var clipboard = new Clipboard('.copy-this-text')
|
||||
clipboard.on('success', () => {
|
||||
clipboard.destroy()
|
||||
this.$message.success('复制成功')
|
||||
this.handleCancel()
|
||||
})
|
||||
clipboard.on('error', () => {
|
||||
this.$message.error('该浏览器不支持自动复制')
|
||||
clipboard.destroy()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.ant-card-body .table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.ant-table-tbody .ant-table-row td {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.anty-row-operator button {
|
||||
margin: 0 5px
|
||||
}
|
||||
|
||||
.ant-btn-danger {
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
}
|
||||
</style>
|
||||
@ -1,319 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="24" v-if="queryInfo && queryInfo.length>0">
|
||||
<template v-for="(item,index) in queryInfo">
|
||||
<template v-if=" item.hidden==='1' ">
|
||||
<a-col v-if="item.view.indexOf('Date')>=0" :md="12" :sm="16" :key=" 'query'+index " v-show="toggleSearchStatus">
|
||||
<onl-cgreport-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></onl-cgreport-query-form-item>
|
||||
</a-col>
|
||||
<a-col v-else :md="6" :sm="8" :key=" 'query'+index " v-show="toggleSearchStatus">
|
||||
<onl-cgreport-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></onl-cgreport-query-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-col v-if="item.view.indexOf('Date')>=0" :md="12" :sm="16" :key=" 'query'+index ">
|
||||
<onl-cgreport-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></onl-cgreport-query-form-item>
|
||||
</a-col>
|
||||
<a-col v-else :md="6" :sm="8" :key=" 'query'+index ">
|
||||
<onl-cgreport-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></onl-cgreport-query-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchByQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="table-operator" style="margin-bottom: 10px">
|
||||
<a-button type="primary" icon="plus" @click="exportExcel">导出</a-button>
|
||||
</div>
|
||||
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="table.columns"
|
||||
:dataSource="table.dataSource"
|
||||
:pagination="table.pagination"
|
||||
:loading="table.loading"
|
||||
:scroll="table.scroll"
|
||||
:rowSelection="{fixed:true, selectedRowKeys: table.selectedRowKeys, onChange: handleChangeInTableSelect}"
|
||||
@change="handleChangeInTable"
|
||||
style="min-height: 300px"
|
||||
>
|
||||
|
||||
<!-- 支持链接href跳转 -->
|
||||
<template
|
||||
v-for="field of fieldHrefSlots"
|
||||
:slot="field.slotName"
|
||||
slot-scope="text, record"
|
||||
>
|
||||
<a @click="handleClickFieldHref(field,record)">{{ text }}</a>
|
||||
</template>
|
||||
|
||||
</a-table>
|
||||
|
||||
<!-- 跳转Href的动态组件方式 -->
|
||||
<a-modal v-bind="hrefComponent.model" v-on="hrefComponent.on">
|
||||
<component :is="hrefComponent.is" v-bind="hrefComponent.params"/>
|
||||
</a-modal>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { HrefJump } from '@/mixins/OnlAutoListMixin'
|
||||
import { getAction,downFile } from '@/api/manage'
|
||||
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
|
||||
import {filterObj} from '@/utils/util';
|
||||
|
||||
export default {
|
||||
name: 'OnlCgreportAutoList',
|
||||
mixins: [HrefJump],
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
queryInfo: [],
|
||||
// 查询参数,多个页面的查询参数用 code 作为键来区分
|
||||
queryParamsMap: {},
|
||||
selfParam:{
|
||||
},
|
||||
sorter: {
|
||||
column: '',
|
||||
order: 'desc',
|
||||
},
|
||||
dictOptions: {},
|
||||
toggleSearchStatus: false, // 高级搜索 展开/关闭
|
||||
reportCode: '',
|
||||
description: '在线报表功能测试页面',
|
||||
url: {
|
||||
getColumnsAndData: '/online/cgreport/api/getColumnsAndData/',
|
||||
getQueryInfo: '/online/cgreport/api/getQueryInfo/',
|
||||
getParamsInfo:'/online/cgreport/api/getParamsInfo/'
|
||||
},
|
||||
table: {
|
||||
loading: true,
|
||||
// 表头
|
||||
columns: [],
|
||||
//数据集
|
||||
dataSource: [],
|
||||
// 选择器
|
||||
selectedRowKeys: [],
|
||||
selectionRows: [],
|
||||
scroll: { x: false },
|
||||
// 分页参数
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
cgreportHeadName:""
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initParamsInfo()
|
||||
this.initQueryInfo();
|
||||
},
|
||||
watch: {
|
||||
'$route'() {
|
||||
// 刷新参数放到这里去触发,就可以刷新相同界面了
|
||||
this.initParamsInfo()
|
||||
this.initQueryInfo();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
queryParam: {
|
||||
get() {
|
||||
return this.queryParamsMap[this.reportCode]
|
||||
},
|
||||
set(newVal) {
|
||||
this.$set(this.queryParamsMap, this.reportCode, newVal)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initParamsInfo(){
|
||||
if(!this.$route.params.code){
|
||||
return false
|
||||
}
|
||||
//获取报表ID
|
||||
this.reportCode = this.$route.params.code;
|
||||
if (!this.queryParam) {
|
||||
this.queryParam = {}
|
||||
}
|
||||
|
||||
this.selfParam={}
|
||||
getAction(`${this.url.getParamsInfo}${this.reportCode}`).then((res) => {
|
||||
if (res.success) {
|
||||
if(res.result && res.result.length>0){
|
||||
for(let i of res.result){
|
||||
this.selfParam['self_'+i.paramName]=(!this.$route.query[i.paramName])?"":this.$route.query[i.paramName]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
this.loadData()
|
||||
})
|
||||
},
|
||||
initQueryInfo() {
|
||||
if(!this.reportCode){
|
||||
return false
|
||||
}
|
||||
getAction(`${this.url.getQueryInfo}${this.reportCode}`).then((res) => {
|
||||
console.log("获取查询条件", res);
|
||||
if (res.success) {
|
||||
this.queryInfo = res.result
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
loadData(arg) {
|
||||
if(!this.reportCode){
|
||||
return false
|
||||
}
|
||||
if (arg == 1) {
|
||||
this.table.pagination.current = 1
|
||||
}
|
||||
let params = this.getQueryParams();//查询条件
|
||||
console.log(params)
|
||||
|
||||
//获取报表ID
|
||||
console.log(' 动态报表 reportCode : ' + this.reportCode);
|
||||
this.table.loading = true
|
||||
|
||||
getAction(`${this.url.getColumnsAndData}${this.reportCode}`, params).then(res => {
|
||||
if (res.success) {
|
||||
let { data, columns, cgreportHeadName, dictOptions, fieldHrefSlots } = res.result
|
||||
|
||||
let columnWidth = 230
|
||||
this.dictOptions = dictOptions
|
||||
for(let a=0;a<columns.length;a++){
|
||||
if(columns[a].customRender){
|
||||
let field_name = columns[a].customRender;
|
||||
columns[a].customRender = (t => t ? filterMultiDictText(this.dictOptions[field_name], t + '') : t)
|
||||
}
|
||||
columns.width = columnWidth
|
||||
}
|
||||
this.table.scroll.x = columns.length * columnWidth
|
||||
this.table.columns = [...columns]
|
||||
this.cgreportHeadName = cgreportHeadName
|
||||
this.fieldHrefSlots = fieldHrefSlots
|
||||
if (data) {
|
||||
this.table.pagination.total = Number(data.total)
|
||||
this.table.dataSource = data.records
|
||||
} else {
|
||||
this.table.pagination.total = 0
|
||||
this.table.dataSource = []
|
||||
}
|
||||
|
||||
}else{
|
||||
this.$message.warn('查询失败:'+res.message)
|
||||
}
|
||||
|
||||
}).catch((e) => {
|
||||
console.error(e)
|
||||
this.$message.error('查询失败')
|
||||
}).finally(() => {
|
||||
this.table.loading = false
|
||||
})
|
||||
},
|
||||
getQueryParams() {
|
||||
let param = Object.assign({}, this.queryParam, this.sorter,this.selfParam);
|
||||
param.pageNo = this.table.pagination.current;
|
||||
param.pageSize = this.table.pagination.pageSize;
|
||||
return filterObj(param);
|
||||
},
|
||||
searchByQuery() {
|
||||
this.loadData(1);
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.loadData(1);
|
||||
},
|
||||
handleToggleSearch() {
|
||||
this.toggleSearchStatus = !this.toggleSearchStatus;
|
||||
},
|
||||
exportExcel() {
|
||||
let fileName = this.cgreportHeadName
|
||||
let selfParam = {}
|
||||
for (let queryName in this.$route.query) {
|
||||
if (this.$route.query.hasOwnProperty(queryName)) {
|
||||
let value = this.$route.query[queryName]
|
||||
selfParam['self_' + queryName] = value || ''
|
||||
}
|
||||
}
|
||||
downFile(`/online/cgreport/api/exportXls/${this.reportCode}`, Object.assign(selfParam, this.queryParam)).then((data) => {
|
||||
if (!data) {
|
||||
this.$message.warning("文件下载失败")
|
||||
return
|
||||
}
|
||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||
window.navigator.msSaveBlob(new Blob([data]), fileName+'.xls')
|
||||
}else{
|
||||
let url = window.URL.createObjectURL(new Blob([data]))
|
||||
let link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
link.setAttribute('download', fileName+'.xls')
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link); //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||
}
|
||||
})
|
||||
},
|
||||
handleChangeInTableSelect(selectedRowKeys, selectionRows) {
|
||||
this.table.selectedRowKeys = selectedRowKeys
|
||||
this.table.selectionRows = selectionRows
|
||||
},
|
||||
handleChangeInTable(pagination, filters, sorter) {
|
||||
//分页、排序、筛选变化时触发
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
this.sorter.column = sorter.field
|
||||
this.sorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
|
||||
} else {
|
||||
this.sorter.column = null
|
||||
this.sorter.order = null
|
||||
}
|
||||
this.table.pagination = pagination
|
||||
this.loadData()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 500px
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -14,6 +14,12 @@
|
||||
<a-input placeholder="请输入文件地址" v-model="queryParam.url"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
@ -79,26 +79,30 @@
|
||||
{
|
||||
title: '表名',
|
||||
align: 'center',
|
||||
dataIndex: 'dataTable'
|
||||
dataIndex: 'dataTable',
|
||||
width: "120"
|
||||
}, {
|
||||
title: '数据ID',
|
||||
align: 'center',
|
||||
dataIndex: 'dataId'
|
||||
dataIndex: 'dataId',
|
||||
width: "120"
|
||||
}, {
|
||||
title: '版本号',
|
||||
align: 'center',
|
||||
dataIndex: 'dataVersion'
|
||||
dataIndex: 'dataVersion',
|
||||
width: "50"
|
||||
}, {
|
||||
title: '数据内容',
|
||||
align: 'center',
|
||||
dataIndex: 'dataContent',
|
||||
width: "120px",
|
||||
width: "150",
|
||||
scopedSlots: {customRender: 'dataContent'},
|
||||
}, {
|
||||
title: '创建人',
|
||||
align: 'center',
|
||||
dataIndex: 'createBy'
|
||||
}
|
||||
dataIndex: 'createBy',
|
||||
width: "100"
|
||||
},
|
||||
],
|
||||
url: {
|
||||
list: "/sys/dataLog/list",
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
|
||||
<!-- 按钮操作区域 -->
|
||||
<a-row style="margin-left: 14px">
|
||||
<a-button @click="handleAdd(2)" type="primary">添加子部门</a-button>
|
||||
<a-button @click="handleAdd(1)" type="primary">添加一级部门</a-button>
|
||||
<a-button @click="handleAdd(1)" type="primary">添加部门</a-button>
|
||||
<a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
@ -73,7 +73,7 @@
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-tabs defaultActiveKey="1">
|
||||
<a-tab-pane tab="基本信息" key="1" >
|
||||
<a-card :bordered="false">
|
||||
<a-card :bordered="false" v-if="selectedKeys.length>0">
|
||||
<a-form :form="form">
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
@ -146,9 +146,14 @@
|
||||
</a-form>
|
||||
<div class="anty-form-btn">
|
||||
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
|
||||
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">修改并保存</a-button>
|
||||
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
<a-card v-else >
|
||||
<a-empty>
|
||||
<span slot="description"> 请先选择一个部门! </span>
|
||||
</a-empty>
|
||||
</a-card>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="部门权限" key="2" forceRender>
|
||||
<depart-auth-modal ref="departAuth"/>
|
||||
@ -224,6 +229,7 @@
|
||||
visible: false,
|
||||
departTree: [],
|
||||
rightClickSelectedKey: '',
|
||||
rightClickSelectedOrgCode: '',
|
||||
hiding: true,
|
||||
model: {},
|
||||
dropTrigger: '',
|
||||
@ -282,6 +288,8 @@
|
||||
that.departTree = []
|
||||
queryDepartTreeList().then((res) => {
|
||||
if (res.success) {
|
||||
//部门全选后,再添加部门,选中数量增多
|
||||
this.allTreeKeys = [];
|
||||
for (let i = 0; i < res.result.length; i++) {
|
||||
let temp = res.result[i]
|
||||
that.treeData.push(temp)
|
||||
@ -311,6 +319,7 @@
|
||||
this.dropTrigger = 'contextmenu'
|
||||
console.log(node.node.eventKey)
|
||||
this.rightClickSelectedKey = node.node.eventKey
|
||||
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
|
||||
},
|
||||
onExpand(expandedKeys) {
|
||||
console.log('onExpand', expandedKeys)
|
||||
@ -422,8 +431,10 @@
|
||||
}else{
|
||||
this.orgCategoryDisabled = false;
|
||||
}
|
||||
this.form.getFieldDecorator('fax', {initialValue: ''})
|
||||
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
|
||||
this.$nextTick(() => {
|
||||
this.form.getFieldDecorator('fax', {initialValue: ''})
|
||||
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
|
||||
})
|
||||
},
|
||||
getCurrSelectedTitle() {
|
||||
return !this.currSelected.title ? '' : this.currSelected.title
|
||||
@ -486,7 +497,7 @@
|
||||
} else if (num == 2) {
|
||||
let key = this.currSelected.key
|
||||
if (!key) {
|
||||
this.$message.warning('请先选中一条记录!')
|
||||
this.$message.warning('请先点击选中上级部门!')
|
||||
return false
|
||||
}
|
||||
this.$refs.departModal.add(this.selectedKeys)
|
||||
@ -497,12 +508,26 @@
|
||||
}
|
||||
},
|
||||
handleDelete() {
|
||||
deleteByDepartId({id: this.rightClickSelectedKey}).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message.success('删除成功!')
|
||||
this.loadTree()
|
||||
} else {
|
||||
this.$message.warning('删除失败!')
|
||||
var that = this
|
||||
this.$confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要删除此部门以及子节点数据吗?',
|
||||
onOk: function () {
|
||||
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => {
|
||||
if (resp.success) {
|
||||
//删除成功后,去除已选中中的数据
|
||||
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
|
||||
that.$message.success('删除成功!')
|
||||
that.loadTree()
|
||||
//删除后同步清空右侧基本信息内容
|
||||
let orgCode=that.form.getFieldValue("orgCode");
|
||||
if(orgCode && orgCode === that.rightClickSelectedOrgCode){
|
||||
that.onClearSelected()
|
||||
}
|
||||
} else {
|
||||
that.$message.warning('删除失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
|
||||
:treeData="departTree"
|
||||
:autoExpandParent="autoExpandParent"
|
||||
:expandedKeys="iExpandedKeys"
|
||||
@expand="onExpand"
|
||||
/>
|
||||
|
||||
</template>
|
||||
@ -99,7 +101,7 @@
|
||||
},
|
||||
methods: {
|
||||
callback(key) {
|
||||
console.log(key)
|
||||
//console.log(key)
|
||||
},
|
||||
loadData() {
|
||||
this.refresh();
|
||||
@ -130,11 +132,15 @@
|
||||
})
|
||||
},
|
||||
setThisExpandedKeys(node) {
|
||||
//只展开一级目录
|
||||
if (node.children && node.children.length > 0) {
|
||||
this.iExpandedKeys.push(node.key)
|
||||
//下方代码放开注释则默认展开所有节点
|
||||
/**
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.setThisExpandedKeys(node.children[a])
|
||||
}
|
||||
*/
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
@ -153,7 +159,7 @@
|
||||
onSearch(value) {
|
||||
let that = this
|
||||
if (value) {
|
||||
searchByKeywords({keyWord: value}).then((res) => {
|
||||
searchByKeywords({keyWord: value,myDeptSearch:'1'}).then((res) => {
|
||||
if (res.success) {
|
||||
that.departTree = []
|
||||
for (let i = 0; i < res.result.length; i++) {
|
||||
|
||||
@ -79,6 +79,8 @@
|
||||
methods: {
|
||||
handleCancel(){
|
||||
this.visible = false
|
||||
//回收站字典列表刷新
|
||||
this.$emit("refresh")
|
||||
},
|
||||
show(){
|
||||
this.visible = true
|
||||
@ -106,14 +108,25 @@
|
||||
})
|
||||
},
|
||||
handleDelete(id){
|
||||
deleteAction("/sys/dict/deletePhysic/"+id).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
this.loadData();
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
this.$confirm({
|
||||
title: '彻底删除字典',
|
||||
content: (<div>
|
||||
<p>您确定要彻底删除这个字典项吗?</p>
|
||||
<p style="color:red;">注意:彻底删除后将无法恢复,请谨慎操作!</p>
|
||||
</div>),
|
||||
centered: false,
|
||||
onOk: () => {
|
||||
var that = this;
|
||||
deleteAction("/sys/dict/deletePhysic/"+id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -171,6 +171,10 @@
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
if (this.superQueryParams) {
|
||||
param['superQueryParams'] = encodeURI(this.superQueryParams)
|
||||
param['superQueryMatchType'] = this.superQueryMatchType
|
||||
}
|
||||
return filterObj(param);
|
||||
},
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
</div>
|
||||
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
|
||||
<dict-item-list ref="dictItemList"></dict-item-list>
|
||||
<dict-delete-list ref="dictDeleteList"></dict-delete-list>
|
||||
<dict-delete-list ref="dictDeleteList" @refresh="() =>loadData()"></dict-delete-list>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@ -72,6 +72,8 @@
|
||||
import DictItemList from './DictItemList'
|
||||
import DictDeleteList from './DictDeleteList'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||
import Vue from 'vue'
|
||||
|
||||
export default {
|
||||
name: "DictList",
|
||||
@ -135,6 +137,7 @@
|
||||
exportXlsUrl: "sys/dict/exportXls",
|
||||
importExcelUrl: "sys/dict/importExcel",
|
||||
refleshCache: "sys/dict/refleshCache",
|
||||
queryAllDictItems: "sys/dict/queryAllDictItems",
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -149,6 +152,10 @@
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
if (this.superQueryParams) {
|
||||
param['superQueryParams'] = encodeURI(this.superQueryParams)
|
||||
param['superQueryMatchType'] = this.superQueryMatchType
|
||||
}
|
||||
return filterObj(param);
|
||||
},
|
||||
//取消选择
|
||||
@ -174,6 +181,13 @@
|
||||
refleshCache(){
|
||||
getAction(this.url.refleshCache).then((res) => {
|
||||
if (res.success) {
|
||||
//重新加载缓存
|
||||
getAction(this.url.queryAllDictItems).then((res) => {
|
||||
if (res.success) {
|
||||
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
})
|
||||
this.$message.success("刷新缓存完成!");
|
||||
}
|
||||
}).catch(e=>{
|
||||
|
||||
@ -178,12 +178,15 @@
|
||||
},
|
||||
methods: {
|
||||
getQueryParams(){
|
||||
console.log(this.queryParam.createTimeRange)
|
||||
var param = Object.assign({}, this.queryParam,this.isorter);
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
delete param.createTimeRange; // 时间参数不传递后台
|
||||
if (this.superQueryParams) {
|
||||
param['superQueryParams'] = encodeURI(this.superQueryParams)
|
||||
param['superQueryMatchType'] = this.superQueryMatchType
|
||||
}
|
||||
return filterObj(param);
|
||||
},
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
|
||||
<a href="javascript:;" @click="handleAddSub(record)">添加下级</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDataRule(record)">数据规则</a>
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
title="数据权限规则"
|
||||
:width="drawerWidth"
|
||||
@close="onClose"
|
||||
:visible="visible"
|
||||
:wrapStyle="{height: 'calc(100% - 108px)',overflow: 'auto',paddingBottom: '108px'}"
|
||||
>
|
||||
:visible="visible">
|
||||
|
||||
<!-- 抽屉内容的border -->
|
||||
<div
|
||||
:style="{
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:scroll="{x: 1500}"
|
||||
size="middle"
|
||||
:pagination="false"
|
||||
:dataSource="dataSource"
|
||||
@ -45,7 +46,7 @@
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
|
||||
<a href="javascript:;" @click="handleAddSub(record)">添加下级</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDataRule(record)">数据规则</a>
|
||||
@ -134,6 +135,7 @@
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
width: 150
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin: 5px 0 10px 2px">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">角色录入</a-button>
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button>
|
||||
<!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</a-button>-->
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls">导出</a-button>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button>
|
||||
</div>
|
||||
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
@ -63,6 +63,7 @@
|
||||
<a @click="handleOpen(record)">用户</a>
|
||||
<a-divider type="vertical"/>
|
||||
|
||||
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
更多 <a-icon type="down"/>
|
||||
@ -115,10 +116,10 @@
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" :md="24" :sm="24" style="margin: -25px 0px 10px 2px">
|
||||
<a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">用户录入</a-button>
|
||||
<div class="table-operator" :md="24" :sm="24">
|
||||
<a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">新增用户</a-button>
|
||||
<!--<a-button @click="handleEdit2" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
|
||||
<a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">添加已有用户</a-button>
|
||||
<a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">已有用户</a-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys2.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
@ -301,7 +302,10 @@
|
||||
width: 120
|
||||
}],
|
||||
|
||||
|
||||
// 高级查询参数
|
||||
superQueryParams2: '',
|
||||
// 高级查询拼接条件
|
||||
superQueryMatchType2: 'and',
|
||||
url: {
|
||||
list: '/sys/role/list',
|
||||
delete: '/sys/role/delete',
|
||||
@ -355,6 +359,7 @@
|
||||
let sqp = {}
|
||||
if (this.superQueryParams2) {
|
||||
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
|
||||
sqp['superQueryMatchType'] = this.superQueryMatchType2
|
||||
}
|
||||
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
|
||||
param.field = this.getQueryField2()
|
||||
|
||||
@ -108,6 +108,7 @@
|
||||
<script>
|
||||
import SysAnnouncementModal from './modules/SysAnnouncementModal'
|
||||
import {doReleaseData, doReovkeData} from '@/api/api'
|
||||
import {getAction} from '@/api/manage'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
|
||||
export default {
|
||||
@ -273,11 +274,15 @@
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData(1);
|
||||
this.syncHeadNotic(id)
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
syncHeadNotic(anntId){
|
||||
getAction("sys/annountCement/syncNotic",{anntId:anntId})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -39,9 +39,11 @@
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleAddSub(record)">添加下级</a>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
@ -56,6 +58,7 @@
|
||||
import { getAction } from '@/api/manage'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import SysCategoryModal from './modules/SysCategoryModal'
|
||||
import { deleteAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: "SysCategoryList",
|
||||
@ -69,12 +72,12 @@
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title:'类型名称',
|
||||
title:'分类名称',
|
||||
align:"left",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title:'类型编码',
|
||||
title:'分类编码',
|
||||
align:"left",
|
||||
dataIndex: 'code'
|
||||
},
|
||||
@ -97,7 +100,8 @@
|
||||
hasChildrenField:"hasChild",
|
||||
pidField:"pid",
|
||||
dictOptions:{
|
||||
}
|
||||
},
|
||||
subExpandedKeys:[],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -228,6 +232,8 @@
|
||||
this.dataSource = [...this.dataSource]
|
||||
resolve()
|
||||
}else{
|
||||
row.children=''
|
||||
row.hasChildrenField='0'
|
||||
reject()
|
||||
}
|
||||
}else{
|
||||
@ -247,6 +253,45 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
handleAddSub(record){
|
||||
this.subExpandedKeys = [];
|
||||
this.getExpandKeysByPid(record.id,this.dataSource,this.dataSource)
|
||||
this.$refs.modalForm.subExpandedKeys = this.subExpandedKeys;
|
||||
this.$refs.modalForm.title = "添加子分类";
|
||||
this.$refs.modalForm.edit({'pid':record.id});
|
||||
this.$refs.modalForm.disableSubmit = false;
|
||||
},
|
||||
handleDelete: function (record) {
|
||||
let that = this;
|
||||
deleteAction(that.url.delete, {id: record.id}).then((res) => {
|
||||
if (res.success) {
|
||||
if (record.pid && record.pid!='0') {
|
||||
let formData = {pid: record.pid};
|
||||
that.$message.success(res.message);
|
||||
that.subExpandedKeys = [];
|
||||
that.getExpandKeysByPid(record.pid, this.dataSource, this.dataSource)
|
||||
that.addOk(formData, this.subExpandedKeys.reverse())
|
||||
} else {
|
||||
that.loadData();
|
||||
}
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加子分类时获取所有父级id
|
||||
getExpandKeysByPid(pid,arr,all){
|
||||
if(pid && arr && arr.length>0){
|
||||
for(let i=0;i<arr.length;i++){
|
||||
if(arr[i].id==pid){
|
||||
this.subExpandedKeys.push(arr[i].id)
|
||||
this.getExpandKeysByPid(arr[i]['pid'],all,all)
|
||||
}else{
|
||||
this.getExpandKeysByPid(pid,arr[i].children,all)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -122,21 +122,15 @@
|
||||
align: 'center',
|
||||
customRender: (t, r, index) => index + 1
|
||||
},
|
||||
{
|
||||
title: '数据源名称',
|
||||
align: 'center',
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '数据源编码',
|
||||
align: 'center',
|
||||
dataIndex: 'code'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
title: '数据源名称',
|
||||
align: 'center',
|
||||
dataIndex: 'remark',
|
||||
customRender: (t) => ellipsis(t)
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '数据库类型',
|
||||
|
||||
@ -133,7 +133,8 @@
|
||||
readAllMsg:"sys/sysAnnouncementSend/readAll",
|
||||
},
|
||||
loading:false,
|
||||
openPath:''
|
||||
openPath:'',
|
||||
formData:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -145,6 +146,7 @@
|
||||
putAction(this.url.editCementSend,{anntId:record.anntId}).then((res)=>{
|
||||
if(res.success){
|
||||
this.loadData();
|
||||
this.syncHeadNotic(record.anntId)
|
||||
}
|
||||
});
|
||||
if(record.openType==='component'){
|
||||
@ -155,6 +157,9 @@
|
||||
this.$refs.ShowAnnouncement.detail(record);
|
||||
}
|
||||
},
|
||||
syncHeadNotic(anntId){
|
||||
getAction("sys/annountCement/syncNotic",{anntId:anntId})
|
||||
},
|
||||
readAll(){
|
||||
var that = this;
|
||||
that.$confirm({
|
||||
@ -165,6 +170,7 @@
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.syncHeadNotic();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -66,7 +66,6 @@
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="border-top: 5px">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">添加用户</a-button>
|
||||
<a-button @click="handleSyncUser" v-has="'user:syncbpm'" type="primary" icon="plus">同步流程</a-button>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('用户信息')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
@ -120,6 +119,7 @@
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<!-- <a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>-->
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
@ -220,7 +220,8 @@
|
||||
title: '用户账号',
|
||||
align: "center",
|
||||
dataIndex: 'username',
|
||||
width: 120
|
||||
width: 120,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '用户姓名',
|
||||
@ -261,6 +262,12 @@
|
||||
width: 180,
|
||||
dataIndex: 'orgCode'
|
||||
},
|
||||
{
|
||||
title: '负责部门',
|
||||
align: "center",
|
||||
width: 180,
|
||||
dataIndex: 'departIds_dictText'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align: "center",
|
||||
@ -277,7 +284,6 @@
|
||||
|
||||
],
|
||||
url: {
|
||||
imgerver: window._CONFIG['staticDomainURL'],
|
||||
syncUser: "/process/extActProcess/doSyncUser",
|
||||
list: "/sys/user/list",
|
||||
delete: "/sys/user/delete",
|
||||
@ -294,7 +300,7 @@
|
||||
},
|
||||
methods: {
|
||||
getAvatarView: function (avatar) {
|
||||
return getFileAccessHttpUrl(avatar,this.url.imgerver,"http")
|
||||
return getFileAccessHttpUrl(avatar)
|
||||
},
|
||||
|
||||
batchFrozen: function (status) {
|
||||
@ -366,8 +372,6 @@
|
||||
this.$refs.sysUserAgentModal.agentSettings(username);
|
||||
this.$refs.sysUserAgentModal.title = "用户代理人设置";
|
||||
},
|
||||
handleSyncUser() {
|
||||
},
|
||||
passwordModalOk() {
|
||||
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<a-card :loading="cardLoading" :bordered="false" style="height: 100%;">
|
||||
<a-spin :spinning="loading">
|
||||
<a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入机构名称查询..." allowClear enterButton />
|
||||
<a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入机构名称查询..." enterButton />
|
||||
|
||||
<a-tree
|
||||
showLine
|
||||
|
||||
@ -40,7 +40,11 @@
|
||||
<a-button style="float: right" @click="handleSubmit" type="primary" htmlType="button" icon="form">保存</a-button>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else style="height:330px;"><h3>请先选择一个部门!</h3></div>
|
||||
<a-card v-else :bordered="false" style="height:200px">
|
||||
<a-empty>
|
||||
<span slot="description"> 请先选择一个部门! </span>
|
||||
</a-empty>
|
||||
</a-card>
|
||||
<depart-datarule-modal ref="datarule"/>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
multiple
|
||||
treeCheckable="tree"
|
||||
checkable
|
||||
@expand="onExpand"
|
||||
:expandedKeys="expandedKeysss"
|
||||
:checkedKeys="checkedKeys"
|
||||
allowClear="true"
|
||||
:checkStrictly="true"
|
||||
@ -45,6 +47,7 @@
|
||||
data () {
|
||||
return {
|
||||
checkedKeys:[], // 存储选中的部门id
|
||||
expandedKeysss:[],//展开的节点
|
||||
userId:"", // 存储用户id
|
||||
model:{}, // 存储SysUserDepartsVO表
|
||||
userDepartModel:{userId:'',departIdList:[]}, // 存储用户id一对多部门信息的对象
|
||||
@ -146,9 +149,27 @@
|
||||
queryIdTree().then((res)=>{
|
||||
if(res.success){
|
||||
this.departTree = res.result;
|
||||
if(this.checkedKeys&&this.checkedKeys.length >0){
|
||||
let treekey=[];
|
||||
let arr=res.result;
|
||||
if(arr&&arr.length>0){
|
||||
arr.forEach(item => {
|
||||
treekey.push(item.key);
|
||||
/* if(item.children&&item.children.length>0){
|
||||
item.children.forEach(item1 => {
|
||||
treekey.push(item1.key);
|
||||
})
|
||||
}*/
|
||||
})
|
||||
this.expandedKeysss = treekey
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
onExpand(expandedKeys){
|
||||
this.expandedKeysss = expandedKeys;
|
||||
},
|
||||
modalFormOk(){
|
||||
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
|
||||
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
|
||||
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
|
||||
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
|
||||
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
|
||||
@ -75,7 +77,7 @@
|
||||
expandedKeysss:[],
|
||||
allTreeKeys:[],
|
||||
autoExpandParent: true,
|
||||
checkStrictly: false,
|
||||
checkStrictly: true,
|
||||
title:"部门角色权限配置",
|
||||
visible: false,
|
||||
loading: false,
|
||||
@ -83,16 +85,25 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
onTreeNodeSelect(id){
|
||||
if(id && id.length>0){
|
||||
this.selectedKeys = id
|
||||
}
|
||||
this.$refs.datarule.show(this.selectedKeys[0],this.departId,this.roleId)
|
||||
},
|
||||
onCheck (checkedKeys, { halfCheckedKeys }) {
|
||||
// 保存选中的和半选中的,后面保存的时候合并提交
|
||||
this.checkedKeys = checkedKeys
|
||||
this.halfCheckedKeys = halfCheckedKeys
|
||||
onCheck (o) {
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = o.checked;
|
||||
}else{
|
||||
this.checkedKeys = o
|
||||
}
|
||||
},
|
||||
show(roleId,departId){
|
||||
this.departId = departId
|
||||
@ -131,11 +142,9 @@
|
||||
},
|
||||
handleSubmit(exit) {
|
||||
let that = this;
|
||||
let checkedKeys = [...that.checkedKeys, ...that.halfCheckedKeys]
|
||||
const permissionIds = checkedKeys.join(",")
|
||||
let params = {
|
||||
roleId:that.roleId,
|
||||
permissionIds,
|
||||
permissionIds:that.checkedKeys.join(","),
|
||||
lastpermissionIds:that.defaultCheckedKeys.join(","),
|
||||
};
|
||||
that.loading = true;
|
||||
@ -170,22 +179,9 @@
|
||||
queryTreeListForDeptRole({departId:this.departId}).then((res) => {
|
||||
this.treeData = res.result.treeList
|
||||
this.allTreeKeys = res.result.ids
|
||||
const keyLeafPairs = this.convertTreeListToKeyLeafPairs(this.treeData)
|
||||
queryDeptRolePermission({roleId:this.roleId}).then((res)=>{
|
||||
// 过滤出 leaf node 即可,即选中的
|
||||
// Tree组件中checkStrictly默认为false的时候,选中子节点,父节点会自动设置选中或半选中
|
||||
// 保存 checkedKeys 以及 halfCheckedKeys 以便于未做任何操作时提交表单数据
|
||||
const checkedKeys = [...res.result].filter(key => {
|
||||
const keyLeafPair = keyLeafPairs.filter(item => item.key === key)[0]
|
||||
return keyLeafPair && keyLeafPair.isLeaf
|
||||
})
|
||||
const halfCheckedKeys = [...res.result].filter(key => {
|
||||
const keyLeafPair = keyLeafPairs.filter(item => item.key === key)[0]
|
||||
return keyLeafPair && !keyLeafPair.isLeaf
|
||||
})
|
||||
this.checkedKeys = [...checkedKeys];
|
||||
this.halfCheckedKeys = [...halfCheckedKeys]
|
||||
this.defaultCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
|
||||
this.checkedKeys = [...res.result];
|
||||
this.defaultCheckedKeys = [...res.result];
|
||||
this.expandedKeysss = this.allTreeKeys;
|
||||
})
|
||||
})
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" :md="24" :sm="24">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">部门角色录入</a-button>
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新建部门角色</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||
@ -55,18 +55,15 @@
|
||||
更多 <a-icon type="down"/>
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a @click="handlePerssion(record)">授权</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a @click="handlePerssion(record)">授权</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
</a-table>
|
||||
@ -132,9 +129,7 @@
|
||||
methods: {
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.currentDeptId = '';
|
||||
this.loadData(1);
|
||||
this.$emit('clearSelectedDepartKeys')
|
||||
},
|
||||
loadData(arg) {
|
||||
if (!this.url.list) {
|
||||
|
||||
@ -166,7 +166,7 @@
|
||||
},
|
||||
/** 加载desform */
|
||||
loadDesformList() {
|
||||
getAction(this.url.getDeptRoleList, { departId: this.currentDeptId }).then((res) => {
|
||||
getAction(this.url.getDeptRoleList, { departId: this.currentDeptId, userId:this.userId }).then((res) => {
|
||||
if (res.success) {
|
||||
this.desformList = res.result
|
||||
var designName = [];
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" :md="24" :sm="24" style="margin-top: -15px">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">用户录入</a-button>
|
||||
<!--<a-button @click="handleEdit" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
|
||||
<a-button @click="handleAddUserDepart" type="primary" icon="plus">添加已有用户</a-button>
|
||||
<a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">新建用户</a-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
@ -75,8 +75,12 @@
|
||||
更多 <a-icon type="down"/>
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDeptRole(record)">分配部门角色</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
<a href="javascript:;" @click="handleDetail(record)">用户详情</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
@ -84,9 +88,6 @@
|
||||
<a>取消关联</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDeptRole(record)">分配部门角色</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
@ -124,15 +125,20 @@
|
||||
currentDeptId: '',
|
||||
// 表头
|
||||
columns: [{
|
||||
title: '用户账号',
|
||||
align: "center",
|
||||
dataIndex: 'username'
|
||||
},
|
||||
title: '用户账号',
|
||||
align: "center",
|
||||
dataIndex: 'username'
|
||||
},
|
||||
{
|
||||
title: '用户名称',
|
||||
align: "center",
|
||||
dataIndex: 'realname'
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
align: "center",
|
||||
dataIndex: 'orgCode'
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align: "center",
|
||||
@ -143,17 +149,12 @@
|
||||
align: "center",
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
align: "center",
|
||||
dataIndex: 'orgCode'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 170
|
||||
width: 150
|
||||
}],
|
||||
url: {
|
||||
list: "/sys/user/departUserList",
|
||||
@ -169,9 +170,7 @@
|
||||
methods: {
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.currentDeptId = '';
|
||||
this.loadData(1);
|
||||
this.$emit('clearSelectedDepartKeys')
|
||||
},
|
||||
loadData(arg) {
|
||||
if (!this.url.list) {
|
||||
@ -315,8 +314,12 @@
|
||||
})
|
||||
},
|
||||
handleDeptRole(record){
|
||||
this.$refs.deptRoleUser.add(record,this.currentDeptId);
|
||||
this.$refs.deptRoleUser.title = "部门角色分配";
|
||||
if(this.currentDeptId != ''){
|
||||
this.$refs.deptRoleUser.add(record,this.currentDeptId);
|
||||
this.$refs.deptRoleUser.title = "部门角色分配";
|
||||
}else{
|
||||
this.$message.warning("请先选择一个部门!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,14 +15,14 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator="['itemText', validatorRules.itemText]"/>
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="['itemText', validatorRules.itemText]"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="数据值">
|
||||
<a-input placeholder="请输入数据值" v-decorator="['itemValue', validatorRules.itemValue]"/>
|
||||
<a-input placeholder="请输入数据值" v-decorator.trim="['itemValue', validatorRules.itemValue]"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
|
||||
@ -15,14 +15,14 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="字典名称">
|
||||
<a-input placeholder="请输入字典名称" v-decorator="[ 'dictName', validatorRules.dictName]"/>
|
||||
<a-input placeholder="请输入字典名称" v-decorator.trim="[ 'dictName', validatorRules.dictName]"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="字典编码">
|
||||
<a-input placeholder="请输入字典编码" v-decorator="[ 'dictCode', validatorRules.dictCode]"/>
|
||||
<a-input placeholder="请输入字典编码" v-decorator.trim="[ 'dictCode', validatorRules.dictCode]"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
|
||||
@ -4,9 +4,8 @@
|
||||
:width="drawerWidth"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
:wrapStyle="{height: 'calc(100% - 108px)',overflow: 'auto',paddingBottom: '108px'}"
|
||||
>
|
||||
:confirmLoading="confirmLoading">
|
||||
|
||||
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
@ -76,7 +75,7 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="授权标识">
|
||||
<a-input placeholder="多个用逗号分隔, 如: user:list,user:create" v-decorator="[ 'perms', {}]" :readOnly="disableSubmit"/>
|
||||
<a-input placeholder="多个用逗号分隔, 如: user:list,user:create" v-decorator="[ 'perms', {rules:[{ required: false, message: '请输入授权标识!' },{validator: this.validatePerms }]}]" :readOnly="disableSubmit"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
@ -102,7 +101,7 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="菜单图标">
|
||||
<a-input placeholder="点击右侧按钮选择图标" v-model="model.icon" :readOnly="disableSubmit">
|
||||
<a-input placeholder="点击选择图标" v-model="model.icon" :readOnly="disableSubmit">
|
||||
<a-icon slot="addonAfter" type="setting" @click="selectIcons" />
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
@ -175,11 +174,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addPermission,editPermission,queryTreeList} from '@/api/api'
|
||||
import {addPermission,editPermission,queryTreeList, duplicateCheck} from '@/api/api'
|
||||
import Icons from './icon/Icons'
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
|
||||
export default {
|
||||
name: "PermissionModal",
|
||||
components: {Icons},
|
||||
@ -359,6 +357,26 @@
|
||||
callback("请输入正整数!");
|
||||
}
|
||||
},
|
||||
validatePerms(rule, value, callback){
|
||||
if(value && value.length>0){
|
||||
//校验授权标识是否存在
|
||||
var params = {
|
||||
tableName: 'sys_permission',
|
||||
fieldName: 'perms',
|
||||
fieldVal: value,
|
||||
dataId: this.model.id
|
||||
};
|
||||
duplicateCheck(params).then((res) => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback("授权标识已存在!")
|
||||
}
|
||||
})
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
},
|
||||
onChangeMenuType(e) {
|
||||
//console.log('localMenuType checked', e.target.value)
|
||||
this.localMenuType=e.target.value
|
||||
|
||||
@ -47,12 +47,8 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="状态">
|
||||
<a-radio-group buttonStyle="solid" v-decorator="[ 'status', {'initialValue':0}]">
|
||||
<a-radio-button :value="0">正常</a-radio-button>
|
||||
<a-radio-button :value="-1">停止</a-radio-button>
|
||||
</a-radio-group>
|
||||
<j-dict-select-tag type="radioButton" v-decorator="[ 'status', {'initialValue':0}]" :trigger-change="true" dictCode="quartz_status"/>
|
||||
</a-form-item>
|
||||
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
@ -72,6 +68,7 @@
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="角色名称">
|
||||
<a-input placeholder="请输入角色名称" v-decorator="[ 'roleName', validatorRules.roleName]" />
|
||||
<a-input placeholder="请输入角色名称" v-decorator.trim="[ 'roleName', validatorRules.roleName]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="角色编码">
|
||||
<a-input placeholder="请输入角色编码" :disabled="roleDisabled" v-decorator="[ 'roleCode', validatorRules.roleCode]" />
|
||||
<a-input placeholder="请输入角色编码" :disabled="roleDisabled" v-decorator.trim="[ 'roleCode', validatorRules.roleCode]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
|
||||
@ -170,10 +170,11 @@
|
||||
this.edit(selectUser,userIds);
|
||||
},
|
||||
edit(selectUser,userIds){
|
||||
if(!userIds){
|
||||
this.selectedRowKeys = []
|
||||
}else{
|
||||
//控制台报错
|
||||
if(userIds&&userIds.length>0){
|
||||
this.selectedRowKeys = userIds.split(',');
|
||||
}else{
|
||||
this.selectedRowKeys = []
|
||||
}
|
||||
if(!selectUser){
|
||||
this.selectionRows=[]
|
||||
|
||||
@ -91,6 +91,14 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row style="width: 100%;">
|
||||
<a-col :span="24/2">
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="摘要">
|
||||
<a-textarea placeholder="请输入摘要" v-decorator="['msgAbstract',validatorRules.msgAbstract]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
@ -165,8 +173,9 @@
|
||||
title:{rules: [{ required: true, message: '请输入标题!' }]},
|
||||
msgCategory:{rules: [{ required: true, message: '请选择消息类型!' }]},
|
||||
msgType:{rules: [{ required: true, message: '请选择通告对象类型!' }]},
|
||||
endTime:{rules:[{validator: this.endTimeValidate}]},
|
||||
startTime:{rules:[{validator: this.startTimeValidate}]}
|
||||
endTime:{rules:[{ required: true, message: '请选择结束时间!'} ,{validator: this.endTimeValidate}]},
|
||||
startTime:{rules:[{required: true, message: '请选择开始时间!'},{validator: this.startTimeValidate}]},
|
||||
msgAbstract:{rules: [{ required: true, message: '请输入摘要!' }]},
|
||||
},
|
||||
url: {
|
||||
queryByIds: "/sys/user/queryByIds",
|
||||
@ -209,7 +218,7 @@
|
||||
});
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag'))
|
||||
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag','msgAbstract'))
|
||||
});
|
||||
},
|
||||
close () {
|
||||
@ -219,6 +228,11 @@
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
//当设置指定用户类型,但用户为空时,后台报错
|
||||
if(this.userType &&!(this.userIds!=null && this.userIds.length >0)){
|
||||
this.$message.warning('指定用户不能为空!')
|
||||
return;
|
||||
}
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
@ -241,6 +255,7 @@
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
that.resetUser();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
</j-tree-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="[ 'name', validatorRules.name]" placeholder="请输入类型名称"></a-input>
|
||||
<a-form-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="[ 'name', validatorRules.name]" placeholder="请输入分类名称"></a-input>
|
||||
</a-form-item>
|
||||
|
||||
<!--<a-form-item label="类型编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
@ -80,15 +80,16 @@
|
||||
}]
|
||||
},
|
||||
pid:{},
|
||||
name:{}
|
||||
name:{rules: [{ required: true, message: '请输入类型名称!' }]}
|
||||
},
|
||||
url: {
|
||||
add: "/sys/category/add",
|
||||
edit: "/sys/category/edit",
|
||||
checkCode:"/sys/category/checkCode"
|
||||
checkCode:"/sys/category/checkCode",
|
||||
},
|
||||
expandedRowKeys:[],
|
||||
pidField:"pid"
|
||||
pidField:"pid",
|
||||
subExpandedKeys:[]
|
||||
|
||||
}
|
||||
},
|
||||
@ -153,10 +154,13 @@
|
||||
let treeData = this.$refs.treeSelect.getCurrTreeData()
|
||||
this.expandedRowKeys=[]
|
||||
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
|
||||
if(formData.pid && this.expandedRowKeys.length==0){
|
||||
this.expandedRowKeys = this.subExpandedKeys;
|
||||
}
|
||||
this.$emit('ok',formData,this.expandedRowKeys.reverse());
|
||||
}else{
|
||||
this.$emit('ok',formData);
|
||||
}
|
||||
}
|
||||
},
|
||||
getExpandKeysByPid(pid,arr,all){
|
||||
if(pid && arr && arr.length>0){
|
||||
|
||||
@ -14,14 +14,14 @@
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="数据源名称">
|
||||
<a-input placeholder="请输入数据源名称" v-decorator="['name', validatorRules.name]"/>
|
||||
label="数据源编码">
|
||||
<a-input placeholder="请输入数据源编码" :disabled="!!model.id" v-decorator="['code', validatorRules.code]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="数据源编码">
|
||||
<a-input placeholder="请输入数据源编码" :disabled="!!model.id" v-decorator="['code', validatorRules.code]"/>
|
||||
label="数据源名称">
|
||||
<a-input placeholder="请输入数据源名称" v-decorator="['name', validatorRules.name]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
@ -137,6 +137,14 @@
|
||||
'2': { dbDriver: 'oracle.jdbc.OracleDriver' },
|
||||
// SQLServer 数据库
|
||||
'3': { dbDriver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver' },
|
||||
},
|
||||
dbUrlMap: {
|
||||
// MySQL 数据库
|
||||
'1': { dbUrl: 'jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false' },
|
||||
// Oracle
|
||||
'2': { dbUrl: 'jdbc:oracle:thin:@127.0.0.1:1521:ORCL' },
|
||||
// SQLServer 数据库
|
||||
'3': { dbUrl: 'jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=jeecgboot' }
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -216,9 +224,13 @@
|
||||
// 数据库类型更改时,联动更改数据库驱动
|
||||
handleDbTypeChange(val) {
|
||||
let dbDriver = this.dbDriverMap[val]
|
||||
let dbUrl = this.dbUrlMap[val]
|
||||
if (dbDriver) {
|
||||
this.form.setFieldsValue(dbDriver)
|
||||
}
|
||||
if (dbUrl) {
|
||||
this.form.setFieldsValue(dbUrl)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<a-form :form="form">
|
||||
|
||||
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入用户账号" v-decorator="[ 'username', validatorRules.username]" :readOnly="!!model.id"/>
|
||||
<a-input placeholder="请输入用户账号" v-decorator.trim="[ 'username', validatorRules.username]" :readOnly="!!model.id"/>
|
||||
</a-form-item>
|
||||
|
||||
<template v-if="!model.id">
|
||||
@ -37,11 +37,11 @@
|
||||
</template>
|
||||
|
||||
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||
<a-input placeholder="请输入用户姓名" v-decorator="[ 'realname', validatorRules.realname]" />
|
||||
<a-input placeholder="请输入用户姓名" v-decorator.trim="[ 'realname', validatorRules.realname]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入工号" v-decorator="[ 'workNo', validatorRules.workNo]" />
|
||||
<a-input placeholder="请输入工号" v-decorator.trim="[ 'workNo', validatorRules.workNo]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
@ -54,7 +54,8 @@
|
||||
style="width: 100%"
|
||||
placeholder="请选择用户角色"
|
||||
optionFilterProp = "children"
|
||||
v-model="selectedRole">
|
||||
v-model="selectedRole"
|
||||
:getPopupContainer= "(target) => target.parentNode">
|
||||
<a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id">
|
||||
{{ role.roleName }}
|
||||
</a-select-option>
|
||||
@ -64,9 +65,9 @@
|
||||
<!--部门分配-->
|
||||
<a-form-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
|
||||
<a-input-search
|
||||
placeholder="点击右侧按钮选择部门"
|
||||
placeholder="点击选择部门"
|
||||
v-model="checkedDepartNameString"
|
||||
disabled
|
||||
readOnly
|
||||
@search="onSearch">
|
||||
<a-button slot="enterButton" icon="search">选择</a-button>
|
||||
</a-input-search>
|
||||
@ -104,11 +105,12 @@
|
||||
<a-date-picker
|
||||
style="width: 100%"
|
||||
placeholder="请选择生日"
|
||||
v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"/>
|
||||
v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"
|
||||
:getCalendarContainer="node => node.parentNode"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select v-decorator="[ 'sex', {}]" placeholder="请选择性别">
|
||||
<a-select v-decorator="[ 'sex', {}]" placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode">
|
||||
<a-select-option :value="1">男</a-select-option>
|
||||
<a-select-option :value="2">女</a-select-option>
|
||||
</a-select>
|
||||
@ -248,7 +250,6 @@
|
||||
picUrl: "",
|
||||
url: {
|
||||
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
imgerver: window._CONFIG['staticDomainURL'],
|
||||
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
|
||||
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
|
||||
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
|
||||
@ -332,7 +333,7 @@
|
||||
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync','workNo','telephone','post'))
|
||||
});
|
||||
//身份为上级显示负责部门,否则不显示
|
||||
if(this.model.identity=="2"){
|
||||
if(this.model.userIdentity=="2"){
|
||||
this.identity="2";
|
||||
this.departIdShow=true;
|
||||
}else{
|
||||
@ -406,10 +407,14 @@
|
||||
values.birthday = values.birthday.format(this.dateFormat);
|
||||
}
|
||||
let formData = Object.assign(this.model, values);
|
||||
formData.avatar = that.fileList;
|
||||
if(that.fileList != ''){
|
||||
formData.avatar = that.fileList;
|
||||
}else{
|
||||
formData.avatar = null;
|
||||
}
|
||||
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
|
||||
formData.selecteddeparts = this.userDepartModel.departIdList.length>0?this.userDepartModel.departIdList.join(","):'';
|
||||
formData.identity=this.identity;
|
||||
formData.userIdentity=this.identity;
|
||||
//如果是上级择传入departIds,否则为空
|
||||
if(this.identity==="2"){
|
||||
formData.departIds=this.departIds.join(",");
|
||||
|
||||
@ -53,6 +53,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { putAction,deleteAction,getFileAccessHttpUrl } from "@/api/manage"
|
||||
|
||||
// 高度封装的请求,请务必使用 superRequest.call(this,{}) 的方式调用
|
||||
function superRequest(options) {
|
||||
@ -95,9 +96,11 @@
|
||||
{ title: '操作', align: 'center', dataIndex: 'action', width: 200, scopedSlots: { customRender: 'action' } }
|
||||
],
|
||||
url: {
|
||||
getAvatar: (path) => `window._CONFIG['staticDomainURL']/${path}`,
|
||||
getAvatar: (path) => getFileAccessHttpUrl(`${path}`),
|
||||
// 回收站操作,get = 获取列表;put = 取回;delete = 彻底删除
|
||||
recycleBin: '/sys/user/recycleBin',
|
||||
putRecycleBin: '/sys/user/putRecycleBin',
|
||||
deleteRecycleBin: '/sys/user/deleteRecycleBin',
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -137,10 +140,8 @@
|
||||
content: `您确定要恢复这 ${userIds.length} 个用户吗?`,
|
||||
centered: true,
|
||||
onOk: () => {
|
||||
superRequest.call(this, {
|
||||
loading: true,
|
||||
promise: this.$http.put(this.url.recycleBin, userIds),
|
||||
success: () => {
|
||||
putAction(this.url.putRecycleBin,{userIds:userIds.join(',')}).then((res)=>{
|
||||
if(res.success){
|
||||
this.handleOk()
|
||||
this.handleClearSelection()
|
||||
this.$message.success(`还原 ${userIds.length} 个用户成功!`)
|
||||
@ -159,15 +160,16 @@
|
||||
</div>),
|
||||
centered: true,
|
||||
onOk: () => {
|
||||
superRequest.call(this, {
|
||||
loading: true,
|
||||
promise: this.$http.delete(this.url.recycleBin + `?userIds=${userIds.join(',')}`),
|
||||
success: () => {
|
||||
var that = this;
|
||||
deleteAction(that.url.deleteRecycleBin, {userIds: userIds.join(',')}).then((res) => {
|
||||
if (res.success) {
|
||||
this.loadData()
|
||||
this.handleClearSelection()
|
||||
this.$message.success(`彻底删除 ${userIds.length} 个用户成功!`)
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
@ -169,7 +169,7 @@
|
||||
this.checkedKeys = [...res.result];
|
||||
this.defaultCheckedKeys = [...res.result];
|
||||
this.expandedKeysss = this.allTreeKeys;
|
||||
//console.log(this.defaultCheckedKeys)
|
||||
console.log(this.defaultCheckedKeys)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<a-form-item>
|
||||
<a-input
|
||||
size="large"
|
||||
v-decorator="['username',validatorRules.username,{ validator: this.handleUsernameOrEmail }]"
|
||||
v-decorator="['username',{initialValue:'admin', rules: validatorRules.username.rules}]"
|
||||
type="text"
|
||||
placeholder="请输入帐户名 / admin">
|
||||
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
<a-form-item>
|
||||
<a-input
|
||||
v-decorator="['password',validatorRules.password]"
|
||||
v-decorator="['password',{initialValue:'123456', rules: validatorRules.password.rules}]"
|
||||
size="large"
|
||||
type="password"
|
||||
autocomplete="false"
|
||||
@ -43,7 +43,6 @@
|
||||
<a-col :span="8" style="text-align: right">
|
||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/>
|
||||
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
||||
<!--<j-graphic-code @success="generateCode" ref="jgraphicCodeRef" style="float: right" remote></j-graphic-code>-->
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@ -106,15 +105,12 @@
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
|
||||
<!-- <div class="user-login-other">
|
||||
<div class="user-login-other">
|
||||
<span>其他登陆方式</span>
|
||||
<a><a-icon class="item-icon" type="alipay-circle"></a-icon></a>
|
||||
<a><a-icon class="item-icon" type="taobao-circle"></a-icon></a>
|
||||
<a><a-icon class="item-icon" type="weibo-circle"></a-icon></a>
|
||||
<router-link class="register" :to="{ name: 'register' }">
|
||||
注册账户
|
||||
</router-link>
|
||||
</div>-->
|
||||
<a @click="onThirdLogin('github')" title="github"><a-icon class="item-icon" type="github"></a-icon></a>
|
||||
<a @click="onThirdLogin('wechat_enterprise')" title="企业微信"><a-icon class="item-icon" type="wechat"></a-icon></a>
|
||||
<a @click="onThirdLogin('dingtalk')" title="钉钉"><a-icon class="item-icon" type="dingding"></a-icon></a>
|
||||
</div>
|
||||
</a-form>
|
||||
|
||||
<two-step-captcha
|
||||
@ -173,7 +169,6 @@
|
||||
import { timeFix } from "@/utils/util"
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN ,ENCRYPTED_STRING} from "@/store/mutation-types"
|
||||
import JGraphicCode from '@/components/jeecg/JGraphicCode'
|
||||
import { putAction,postAction,getAction } from '@/api/manage'
|
||||
import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
|
||||
import store from '@/store/'
|
||||
@ -181,8 +176,7 @@
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TwoStepCaptcha,
|
||||
JGraphicCode
|
||||
TwoStepCaptcha
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -232,7 +226,28 @@
|
||||
// update-end- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
|
||||
},
|
||||
methods: {
|
||||
...mapActions([ "Login", "Logout","PhoneLogin" ]),
|
||||
...mapActions([ "Login", "Logout","PhoneLogin","ThirdLogin" ]),
|
||||
//第三方登录
|
||||
onThirdLogin(source){
|
||||
let url = window._CONFIG['domianURL']+`/thirdLogin/render/${source}`
|
||||
window.open(url, `login ${source}`, 'height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
|
||||
let that = this;
|
||||
let receiveMessage = function(event){
|
||||
var origin = event.origin
|
||||
console.log("origin",origin);
|
||||
|
||||
let token = event.data
|
||||
console.log("event.data",token)
|
||||
that.ThirdLogin(token).then(res=>{
|
||||
if(res.success){
|
||||
that.loginSuccess()
|
||||
}else{
|
||||
that.requestFailed(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener("message", receiveMessage, false);
|
||||
},
|
||||
// handler
|
||||
handleUsernameOrEmail (rule, value, callback) {
|
||||
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
|
||||
@ -361,7 +376,7 @@
|
||||
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||
// this.loginBtn = false
|
||||
// update-end- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||
this.$router.push({ name: "dashboard" })
|
||||
this.$router.push({ path: "/dashboard/analysis" })
|
||||
this.$notification.success({
|
||||
message: '欢迎',
|
||||
description: `${timeFix()},欢迎回来`,
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<a-form ref="formRegister" :autoFormCreate="(form)=>{this.form = form}" id="formRegister">
|
||||
<a-form-item
|
||||
fieldDecoratorId="username"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '用户名不能为空'}, { validator: this.checkUsername }], validateTrigger: ['change', 'blur']}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '用户名不能为空'}, { validator: this.checkUsername }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
<a-input size="large" type="text" autocomplete="false" placeholder="请输入用户名"></a-input>
|
||||
</a-form-item>
|
||||
|
||||
@ -20,25 +20,25 @@
|
||||
</template>
|
||||
<a-form-item
|
||||
fieldDecoratorId="password"
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handlePasswordLevel }], validateTrigger: ['change', 'blur']}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handlePasswordLevel }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
<a-input size="large" type="password" @click="handlePasswordInputClick" autocomplete="false" placeholder="至少8位密码,区分大小写"></a-input>
|
||||
</a-form-item>
|
||||
</a-popover>
|
||||
|
||||
<a-form-item
|
||||
fieldDecoratorId="password2"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '至少8位密码,区分大小写' }, { validator: this.handlePasswordCheck }], validateTrigger: ['change', 'blur']}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '至少8位密码,区分大小写' }, { validator: this.handlePasswordCheck }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
|
||||
<a-input size="large" type="password" autocomplete="false" placeholder="确认密码"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
fieldDecoratorId="email"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, type: 'email', message: '请输入正确的邮箱地址' }, { validator: this.handleEmailCheck }], validateTrigger: ['change', 'blur']}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, type: 'email', message: '请输入正确的邮箱地址' }, { validator: this.handleEmailCheck }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
<a-input size="large" type="text" placeholder="邮箱"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
fieldDecoratorId="mobile"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号' }, { validator: this.handlePhoneCheck } ], validateTrigger: ['change', 'blur'] }">
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号' }, { validator: this.handlePhoneCheck } ], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
<a-input size="large" placeholder="11 位手机号">
|
||||
<a-select slot="addonBefore" size="large" defaultValue="+86">
|
||||
<a-select-option value="+86">+86</a-select-option>
|
||||
@ -58,7 +58,7 @@
|
||||
<a-col class="gutter-row" :span="16">
|
||||
<a-form-item
|
||||
fieldDecoratorId="captcha"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur', validateFirst: true}">
|
||||
<a-input size="large" type="text" placeholder="验证码">
|
||||
<a-icon slot="prefix" type="mail" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
</a-input>
|
||||
|
||||
@ -27,8 +27,9 @@
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="10">
|
||||
<j-graphic-code @success="generateCode" style="float: right"></j-graphic-code>
|
||||
<a-col :span="10" style="text-align: right">
|
||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/>
|
||||
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
||||
@ -40,15 +41,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JGraphicCode from '@/components/jeecg/JGraphicCode'
|
||||
import {getAction} from '@/api/manage'
|
||||
import {checkOnlyUser} from '@/api/api'
|
||||
import { getAction,postAction } from '@/api/manage'
|
||||
import { checkOnlyUser } from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: "Step1",
|
||||
components: {
|
||||
JGraphicCode
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
@ -57,12 +54,32 @@
|
||||
verifiedCode: "",
|
||||
validatorRules: {
|
||||
username: {rules: [{required: false}, {validator: this.validateInputUsername}]},
|
||||
inputCode: {rules: [{required: true, message: '请输入验证码!'}, {validator: this.validateInputCode}]},
|
||||
inputCode: {rules: [{required: true, message: '请输入验证码!'}]},
|
||||
},
|
||||
randCodeImage:'',
|
||||
requestCodeSuccess:true,
|
||||
currdatetime:''
|
||||
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.handleChangeCheckCode();
|
||||
},
|
||||
methods: {
|
||||
handleChangeCheckCode(){
|
||||
this.currdatetime = new Date().getTime();
|
||||
getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{
|
||||
if(res.success){
|
||||
this.randCodeImage = res.result
|
||||
this.requestCodeSuccess=true
|
||||
}else{
|
||||
this.$message.error(res.message)
|
||||
this.requestCodeSuccess=false
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.requestCodeSuccess=false
|
||||
})
|
||||
},
|
||||
nextStep() {
|
||||
let that = this
|
||||
this.form.validateFields((err, values) => {
|
||||
@ -77,28 +94,38 @@
|
||||
} else {
|
||||
params.username = username;
|
||||
}
|
||||
getAction("/sys/user/querySysUser", params).then((res) => {
|
||||
if (res.success) {
|
||||
var userList = {
|
||||
username: res.result.username,
|
||||
phone: res.result.phone,
|
||||
isPhone: isPhone
|
||||
};
|
||||
setTimeout(function () {
|
||||
that.$emit('nextStep', userList)
|
||||
})
|
||||
}
|
||||
});
|
||||
that.validateInputCode().then(()=>{
|
||||
getAction("/sys/user/querySysUser", params).then((res) => {
|
||||
if (res.success) {
|
||||
var userList = {
|
||||
username: res.result.username,
|
||||
phone: res.result.phone,
|
||||
isPhone: isPhone
|
||||
};
|
||||
setTimeout(function () {
|
||||
that.$emit('nextStep', userList)
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
validateInputCode(rule, value, callback) {
|
||||
if (!value || this.verifiedCode == this.inputCodeContent) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("您输入的验证码不正确!"));
|
||||
}
|
||||
validateInputCode() {
|
||||
return new Promise((resolve,reject)=>{
|
||||
postAction("/sys/checkCaptcha",{
|
||||
captcha:this.inputCodeContent,
|
||||
checkKey:this.currdatetime
|
||||
}).then(res=>{
|
||||
if(res.success){
|
||||
resolve();
|
||||
}else{
|
||||
this.$message.error(res.message)
|
||||
reject();
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
inputCodeChange(e) {
|
||||
this.inputCodeContent = e.target.value;
|
||||
|
||||
Reference in New Issue
Block a user