mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
JeecgBoot 2.1.1 代码生成器AI版本发布
This commit is contained in:
@ -3,29 +3,39 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="名称">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
|
||||
<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-form-item label="年龄">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.age"></a-input>
|
||||
<!-- <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>
|
||||
<span class="group-query-strig">~</span>
|
||||
<a-input placeholder="最大年龄" type="le" v-model="queryParam.age_end" style="width:calc(50% - 15px);"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="字典下拉">
|
||||
<j-dict-select-tag v-model="queryParam.sex" placeholder="请选择用户名称" dictCode="sex"/>
|
||||
<a-form-item label="生日">
|
||||
<a-range-picker v-model="queryParam.birthdayRange"
|
||||
format="YYYY-MM-DD"
|
||||
:placeholder="['开始时间', '结束时间']"
|
||||
@change="onBirthdayChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="字典表下拉">
|
||||
<j-dict-select-tag v-model="queryParam.realname" placeholder="请选择用户" dictCode="sys_user,realname,id"/>
|
||||
<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-form-item label="选择用户">
|
||||
<j-dict-select-tag v-model="queryParam.id" placeholder="请选择用户" dictCode="demo,name,id"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@ -165,10 +175,12 @@
|
||||
<script>
|
||||
import JeecgDemoModal from './modules/JeecgDemoModal'
|
||||
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 { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import Vue from 'vue'
|
||||
import { filterObj } from '@/utils/util';
|
||||
|
||||
//高级查询modal需要参数
|
||||
const superQueryFieldList=[{
|
||||
@ -191,6 +203,7 @@
|
||||
JeecgDemoModal,
|
||||
JSuperQuery,
|
||||
JeecgDemoTabsModal,
|
||||
JInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -278,6 +291,15 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getQueryParams(){
|
||||
console.log(this.queryParam.birthdayRange)
|
||||
var param = Object.assign({}, this.queryParam,this.isorter);
|
||||
param.field = this.getQueryField();
|
||||
param.pageNo = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
delete param.birthdayRange; //范围参数不传递后台
|
||||
return filterObj(param);
|
||||
},
|
||||
initDictConfig() {
|
||||
console.log("--我才是真的方法!--")
|
||||
//初始化字典 - 性别
|
||||
@ -295,6 +317,11 @@
|
||||
jump() {
|
||||
this.$router.push({path: '/jeecg/helloworld'})
|
||||
},
|
||||
onBirthdayChange: function (value, dateString) {
|
||||
console.log(dateString[0],dateString[1]);
|
||||
this.queryParam.birthday_begin=dateString[0];
|
||||
this.queryParam.birthday_end=dateString[1];
|
||||
},
|
||||
//列设置更改事件
|
||||
onColSettingsChange (checkedValues) {
|
||||
var key = this.$route.name+":colsettings";
|
||||
|
||||
@ -55,14 +55,14 @@
|
||||
<a-col :span="12">选中的部门ID(v-model):{{ departId }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 用户选择控件 -->
|
||||
<!-- 通过部门选择用户控件 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择用户">
|
||||
<j-select-user-by-dep v-model="userRealName"></j-select-user-by-dep>
|
||||
<j-select-user-by-dep v-model="userIds" :multi="true"></j-select-user-by-dep>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中的用户(v-model):{{ userRealName }}</a-col>
|
||||
<a-col :span="12">选中的用户(v-model):{{ userIds }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 用户选择控件 -->
|
||||
@ -75,6 +75,16 @@
|
||||
<a-col :span="12">选中的用户(v-model):{{ multiUser }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 角色选择 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择角色">
|
||||
<j-select-role v-model="formData.selectRole"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.selectRole}}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- JCheckbox -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
@ -207,18 +217,48 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="树字典">
|
||||
<j-tree-dict parentCode="B01" />
|
||||
<j-tree-dict parentCode="A01" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12"></a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="下拉树选择">
|
||||
<j-tree-select
|
||||
v-model="formData.treeSelect"
|
||||
placeholder="请选择菜单"
|
||||
dict="sys_permission,name,id"
|
||||
pidField="parent_id"
|
||||
pidValue=""
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :spapn="12">选中的值(v-model):{{ formData.treeSelect }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="下拉树多选">
|
||||
<j-tree-select
|
||||
v-model="formData.treeSelectMultiple"
|
||||
placeholder="请选择菜单"
|
||||
dict="sys_permission,name,id"
|
||||
pidField="parent_id"
|
||||
pidValue=""
|
||||
multiple
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :spapn="12">选中的值(v-model):{{ formData.treeSelectMultiple }}</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- VueCron -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="cron表达式">
|
||||
<j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?'}]" @change="setCorn"></j-cron>
|
||||
<!-- <j-cron ref="innerVueCron" v-model="cron" @change="setCorn"></j-cron>-->
|
||||
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -234,6 +274,7 @@
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
|
||||
import JSelectRole from '@/components/jeecgbiz/JSelectRole'
|
||||
import JCheckbox from '@/components/jeecg/JCheckbox'
|
||||
import JCodeEditor from '@/components/jeecg/JCodeEditor'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
@ -244,6 +285,8 @@
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import JTreeDict from "../../components/jeecg/JTreeDict.vue";
|
||||
import JCron from "@/components/jeecg/JCron.vue";
|
||||
import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
||||
|
||||
export default {
|
||||
name: 'SelectDemo',
|
||||
components: {
|
||||
@ -252,20 +295,21 @@
|
||||
JSelectDepart,
|
||||
JSelectUserByDep,
|
||||
JSelectMultiUser,
|
||||
JSelectRole,
|
||||
JCheckbox,
|
||||
JCodeEditor,
|
||||
JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple,
|
||||
JCron
|
||||
JCron, JTreeSelect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
selectedDepUsers: '',
|
||||
formData:{},
|
||||
formData: {},
|
||||
form: this.$form.createForm(this),
|
||||
departId: '4f1765520d6346f9bd9c79e2479e5b12,57197590443c44f083d42ae24ef26a2c',
|
||||
userRealName: '',
|
||||
multiUser: '',
|
||||
userIds: 'admin',
|
||||
multiUser: 'admin,jeecg',
|
||||
jcheckbox: {
|
||||
values: 'spring,jeecgboot',
|
||||
options: [
|
||||
@ -368,7 +412,6 @@ sayHi('hello, world!')`
|
||||
this.modal.fullScreen = mode
|
||||
},
|
||||
setCorn(data){
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.form.cronExpression = data;
|
||||
})
|
||||
|
||||
@ -224,7 +224,7 @@
|
||||
getAction(this.url.customerListByMainId, {mainId: record.id}).then((res) => {
|
||||
if (res.success) {
|
||||
this.loading = false;
|
||||
this.innerData = res.result;
|
||||
this.innerData = res.result.records;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -62,6 +62,39 @@
|
||||
{
|
||||
pattern: /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/, // 正则
|
||||
message: '${title}必须以字母开头,可包含数字、下划线、横杠'
|
||||
},
|
||||
{
|
||||
handler(type, value, row, column, callback, target) {
|
||||
// type 触发校验的类型(input、change、blur)
|
||||
// value 当前校验的值
|
||||
// callback(flag, message) 方法必须执行且只能执行一次
|
||||
// flag = 是否通过了校验,不填写或者填写 null 代表不进行任何操作
|
||||
// message = 提示的类型,默认使用配置的 message
|
||||
// target 行编辑的实例对象
|
||||
|
||||
if (type === 'blur') {
|
||||
let { values } = target.getValuesSync({ validate: false })
|
||||
|
||||
if (value === 'abc') {
|
||||
callback(false, '${title}不能是abc') // false = 未验证
|
||||
return
|
||||
}
|
||||
|
||||
let count = 0
|
||||
for (let val of values) {
|
||||
if (val['dbFieldName'] === value) {
|
||||
if (++count >= 2) {
|
||||
callback(false, '${title}不能重复==')
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
callback(true) // true = 通过验证
|
||||
} else {
|
||||
callback() // 不填写或者填写 null 代表不进行任何操作
|
||||
}
|
||||
},
|
||||
message: '${title}默认提示'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -133,14 +133,19 @@
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1;
|
||||
}
|
||||
//update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
|
||||
var params = this.getQueryParams();
|
||||
getAction(this.url.list, {mainId: params.mainId}).then((res) => {
|
||||
getAction(this.url.list, {orderId: params.mainId, pageNo : this.ipagination.current,
|
||||
pageSize :this.ipagination.pageSize}).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result;
|
||||
this.dataSource = res.result.records;
|
||||
this.ipagination.total = res.result.total;
|
||||
} else {
|
||||
this.dataSource = null;
|
||||
}
|
||||
})
|
||||
//update-end--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
|
||||
|
||||
},
|
||||
getOrderMain(orderId) {
|
||||
this.queryParam.mainId = orderId;
|
||||
|
||||
@ -123,13 +123,17 @@
|
||||
this.ipagination.current = 1;
|
||||
}
|
||||
var params = this.getQueryParams();
|
||||
getAction(this.url.list, {mainId: params.mainId}).then((res) => {
|
||||
//update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
|
||||
getAction(this.url.list, {orderId: params.mainId ,pageNo : this.ipagination.current,
|
||||
pageSize :this.ipagination.pageSize}).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result;
|
||||
this.dataSource = res.result.records;
|
||||
this.ipagination.total = res.result.total;
|
||||
} else {
|
||||
this.dataSource = null;
|
||||
}
|
||||
})
|
||||
//update-end--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
|
||||
},
|
||||
getOrderMain(orderId) {
|
||||
this.queryParam.mainId = orderId;
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
:wrapperCol="wrapperCol"
|
||||
label="航班时间"
|
||||
hasFeedback>
|
||||
<j-date v-decorator="['tickectDate',{trigger:'input',rules:[{ required: true,message: '请输入航班号!'}]}]"></j-date>
|
||||
<j-date :trigger-change="true" v-decorator="['tickectDate',{rules:[{ required: true,message: '请输入航班号!'}]}]"></j-date>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="消息标题">
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
|
||||
@ -0,0 +1,389 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="表名">
|
||||
<a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :md="6" :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" style="margin-left:8px">自定义按钮</a-button>
|
||||
<a-button @click="doEnhanceJs" type="primary" icon="strikethrough" style="margin-left:8px">JS增强</a-button>
|
||||
<a-button @click="doEnhanceSql" type="primary" icon="filter" style="margin-left:8px">SQL增强</a-button>
|
||||
<a-button @click="doEnhanceJava" type="primary" icon="tool" style="margin-left:8px">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 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">
|
||||
|
||||
<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 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>
|
||||
@ -95,12 +95,22 @@
|
||||
</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 @click="handleDelete(record.id)">删除</a>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
@ -168,6 +178,8 @@
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import Clipboard from 'clipboard'
|
||||
|
||||
import { filterObj } from '@/utils/util';
|
||||
|
||||
export default {
|
||||
name: 'OnlCgformHeadList',
|
||||
mixins: [JeecgListMixin],
|
||||
@ -231,7 +243,8 @@
|
||||
delete: '/online/cgform/head/delete',
|
||||
deleteBatch: '/online/cgform/head/deleteBatch',
|
||||
doDbSynch: '/online/cgform/api/doDbSynch/',
|
||||
removeRecord: '/online/cgform/head/removeRecord'
|
||||
removeRecord: '/online/cgform/head/removeRecord',
|
||||
copyOnline: '/online/cgform/head/copyOnline'
|
||||
},
|
||||
tableTypeDictOptions: [],
|
||||
sexDictOptions: [],
|
||||
@ -253,7 +266,6 @@
|
||||
this.tableTypeDictOptions = res.result
|
||||
}
|
||||
})
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
doDbSynch(id) {
|
||||
@ -266,6 +278,15 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
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
|
||||
},
|
||||
@ -281,9 +302,18 @@
|
||||
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) {
|
||||
@ -391,7 +421,21 @@
|
||||
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>
|
||||
|
||||
@ -89,8 +89,9 @@
|
||||
:dataSource="table.dataSource"
|
||||
:pagination="table.pagination"
|
||||
:loading="table.loading"
|
||||
:rowSelection="{selectedRowKeys:table.selectedRowKeys, onChange: handleChangeInTableSelect}"
|
||||
:rowSelection="rowSelectionConfig"
|
||||
@change="handleTableChange"
|
||||
:scroll="table.scroll"
|
||||
style="min-height: 300px">
|
||||
|
||||
<template slot="dateSlot" slot-scope="text">
|
||||
@ -102,19 +103,19 @@
|
||||
</template>
|
||||
|
||||
<template slot="imgSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
|
||||
<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>
|
||||
<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="uploadFile(text)">
|
||||
@click="downloadRowFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
@ -143,6 +144,19 @@
|
||||
<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>
|
||||
<a href="javascript:;" @click="startProcess(record)">提交流程</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item v-if="buttonSwitch.delete">
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-menu-item @click="handlePreviewPic(record)">审批进度</a-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-menu-item v-if="buttonSwitch.delete">
|
||||
@ -165,10 +179,11 @@
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
<OnlCgformAutoModal @success="handleFormSuccess" ref="modal" :code="code"></OnlCgformAutoModal>
|
||||
<cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></cgform-auto-modal>
|
||||
|
||||
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
|
||||
|
||||
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
@ -183,7 +198,7 @@
|
||||
export default {
|
||||
name: 'OnlCgFormAutoList',
|
||||
components: {
|
||||
JImportModal
|
||||
JImportModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -197,6 +212,7 @@
|
||||
optPre:"/online/cgform/api/form/",
|
||||
exportXls:'/online/cgform/api/exportXls/',
|
||||
buttonAction:'/online/cgform/api/doButton',
|
||||
startProcess: "/process/extActProcess/startMutilProcess",
|
||||
},
|
||||
flowCodePre:"onl_",
|
||||
isorter:{
|
||||
@ -216,6 +232,7 @@
|
||||
toggleSearchStatus:false,
|
||||
table: {
|
||||
loading: true,
|
||||
scroll:{x:false},
|
||||
// 表头
|
||||
columns: [],
|
||||
//数据集
|
||||
@ -225,17 +242,20 @@
|
||||
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
|
||||
|
||||
}
|
||||
},
|
||||
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',
|
||||
@ -256,6 +276,7 @@
|
||||
export:true
|
||||
},
|
||||
hasBpmStatus:false,
|
||||
checkboxFlag:false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -270,6 +291,18 @@
|
||||
this.initAutoList()
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
rowSelectionConfig:function() {
|
||||
if(!this.checkboxFlag){
|
||||
return null
|
||||
}
|
||||
return {
|
||||
fixed:true,
|
||||
selectedRowKeys:this.table.selectedRowKeys,
|
||||
onChange: this.handleChangeInTableSelect
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasBpmStatusFilter(){
|
||||
var columnObjs = this.table.columns;
|
||||
@ -283,6 +316,30 @@
|
||||
this.hasBpmStatus = 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
initQueryInfo(){
|
||||
getAction(`${this.url.getQueryInfo}${this.code}`).then((res)=>{
|
||||
console.log("--onlineList-获取查询条件配置",res);
|
||||
@ -302,6 +359,18 @@
|
||||
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.dictOptions = res.result.dictOptions
|
||||
this.formTemplate = res.result.formTemplate
|
||||
this.description = res.result.description
|
||||
@ -313,11 +382,24 @@
|
||||
for(let a=0;a<currColumns.length;a++){
|
||||
if(currColumns[a].customRender){
|
||||
let dictCode = currColumns[a].customRender;
|
||||
currColumns[a].customRender=(text)=>{
|
||||
return filterMultiDictText(this.dictOptions[dictCode], text);
|
||||
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();
|
||||
@ -329,22 +411,44 @@
|
||||
})
|
||||
},
|
||||
loadData(arg){
|
||||
if(arg==1){
|
||||
this.table.pagination.current=1
|
||||
if(this.table.pagination){
|
||||
if(arg==1){
|
||||
this.table.pagination.current=1
|
||||
}
|
||||
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)
|
||||
}
|
||||
this.table.loading = false
|
||||
})
|
||||
}else{
|
||||
this.loadDataNoPage()
|
||||
}
|
||||
let params = this.getQueryParams();//查询条件
|
||||
console.log("--onlineList-查询条件-->",params)
|
||||
getAction(`${this.url.getData}${this.code}`,params).then((res)=>{
|
||||
},
|
||||
loadDataNoPage(){
|
||||
let param = Object.assign({}, this.queryParam,this.isorter);
|
||||
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.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)
|
||||
@ -361,6 +465,7 @@
|
||||
handleChangeInTableSelect(selectedRowKeys, selectionRows) {
|
||||
this.table.selectedRowKeys = selectedRowKeys
|
||||
this.table.selectionRows = selectionRows
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
},
|
||||
handleTableChange(pagination, filters, sorter){
|
||||
//TODO 筛选
|
||||
@ -453,7 +558,7 @@
|
||||
}
|
||||
return window._CONFIG['imgDomainURL']+"/"+text
|
||||
},
|
||||
uploadFile(text){
|
||||
downloadRowFile(text){
|
||||
if(!text){
|
||||
this.$message.warning("未知的文件")
|
||||
return;
|
||||
@ -461,7 +566,7 @@
|
||||
if(text.indexOf(",")>0){
|
||||
text = text.substring(0,text.indexOf(","))
|
||||
}
|
||||
window.open(window._CONFIG['imgDomainURL']+"/"+text);//TODO 下载的方法
|
||||
window.open(window._CONFIG['downloadUrl']+"/"+text);//TODO 下载的方法
|
||||
},
|
||||
handleDelBatch(){
|
||||
if(this.table.selectedRowKeys.length<=0){
|
||||
|
||||
@ -66,28 +66,30 @@
|
||||
</template>
|
||||
|
||||
<template slot="imgSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
|
||||
<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>
|
||||
<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="uploadFile(text)">
|
||||
@click="downloadRowFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<template v-if="buttonSwitch.update">
|
||||
|
||||
<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" />
|
||||
@ -96,7 +98,16 @@
|
||||
<a-menu-item >
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item v-if="buttonSwitch.delete">
|
||||
|
||||
<a-menu-item v-if="showSubmitFlowButton(record)">
|
||||
<a @click="startProcess(record)">提交流程</a>
|
||||
</a-menu-item>
|
||||
|
||||
<template v-if="showViewFlowButton(record)">
|
||||
<a-menu-item @click="handlePreviewPic(record)">审批进度</a-menu-item>
|
||||
</template>
|
||||
|
||||
<a-menu-item v-if="showOptButton('delete',record)">
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
@ -117,9 +128,10 @@
|
||||
|
||||
</a-table>
|
||||
|
||||
<onl-cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></onl-cgform-auto-modal>
|
||||
<cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></cgform-auto-modal>
|
||||
|
||||
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
|
||||
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
@ -129,12 +141,11 @@
|
||||
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
|
||||
JImportModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -171,7 +182,7 @@
|
||||
optPre:"/online/cgform/api/form/",
|
||||
exportXls:'/online/cgform/api/exportXls/',
|
||||
buttonAction:'/online/cgform/api/doButton',
|
||||
startProcess: "/process/extActProcess/startMutilProcess",
|
||||
startProcess: "/process/extActProcess/startMutilProcess"
|
||||
},
|
||||
isorter:{
|
||||
column: 'create_time',
|
||||
@ -209,7 +220,9 @@
|
||||
import:true,
|
||||
export:true
|
||||
},
|
||||
expandedRowKeys:[]
|
||||
expandedRowKeys:[],
|
||||
hasBpmStatus:false,
|
||||
flowCodePre:"onl_",
|
||||
|
||||
}
|
||||
},
|
||||
@ -299,18 +312,27 @@
|
||||
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])
|
||||
@ -461,7 +483,7 @@
|
||||
}
|
||||
return window._CONFIG['imgDomainURL']+"/"+text
|
||||
},
|
||||
uploadFile(text){
|
||||
downloadRowFile(text){
|
||||
if(!text){
|
||||
this.$message.warning("未知的文件")
|
||||
return;
|
||||
@ -469,7 +491,7 @@
|
||||
if(text.indexOf(",")>0){
|
||||
text = text.substring(0,text.indexOf(","))
|
||||
}
|
||||
window.open(window._CONFIG['domianURL'] + "/sys/common/download/"+text);
|
||||
window.open(window._CONFIG['downloadUrl']+"/"+text);
|
||||
},
|
||||
/*-------数据格式化-end----------*/
|
||||
|
||||
@ -615,6 +637,59 @@
|
||||
|
||||
},
|
||||
/*-------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
|
||||
},
|
||||
showSubmitFlowButton(record){
|
||||
if(this.hasBpmStatus){
|
||||
if(record.bpm_status ==null || record.bpm_status =='' || record.bpm_status == '1'){
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
},
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
164
ant-design-vue-jeecg/src/views/modules/oss/OSSFileList.vue
Normal file
164
ant-design-vue-jeecg/src/views/modules/oss/OSSFileList.vue
Normal file
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="文件名称">
|
||||
<a-input placeholder="请输入文件名称" v-model="queryParam.fileName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="文件地址">
|
||||
<a-input placeholder="请输入文件地址" v-model="queryParam.url"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<!-- <a-button type="primary" icon="download" @click="handleExportXls('文件列表')">导出</a-button>-->
|
||||
<a-upload
|
||||
name="file"
|
||||
:multiple="false"
|
||||
:action="uploadAction"
|
||||
:headers="tokenHeader"
|
||||
:showUploadList="false"
|
||||
:beforeUpload="beforeUpload"
|
||||
@change="handleChange">
|
||||
<a-button>
|
||||
<a-icon type="upload"/>
|
||||
文件上传
|
||||
</a-button>
|
||||
</a-upload>
|
||||
</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="ossDelete(record.id)">删除</a>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
|
||||
export default {
|
||||
name: "OSSFileList",
|
||||
mixins: [JeecgListMixin],
|
||||
data() {
|
||||
return {
|
||||
description: '文件列表',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: "center",
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '文件名称',
|
||||
align: "center",
|
||||
dataIndex: 'fileName'
|
||||
},
|
||||
{
|
||||
title: '文件地址',
|
||||
align: "center",
|
||||
dataIndex: 'url'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: "center",
|
||||
scopedSlots: {customRender: 'action'},
|
||||
}
|
||||
],
|
||||
url: {
|
||||
upload: "/oss/file/upload",
|
||||
list: "/oss/file/list",
|
||||
delete: "/oss/file/delete"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
uploadAction() {
|
||||
return window._CONFIG['domianURL'] + this.url.upload;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeUpload(file) {
|
||||
var fileType = file.type;
|
||||
if (fileType === 'image') {
|
||||
if (fileType.indexOf('image') < 0) {
|
||||
this.$message.warning('请上传图片');
|
||||
return false;
|
||||
}
|
||||
} else if (fileType === 'file') {
|
||||
if (fileType.indexOf('image') >= 0) {
|
||||
this.$message.warning('请上传文件');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
handleChange(info) {
|
||||
if (info.file.status === 'done') {
|
||||
if (info.file.response.success) {
|
||||
this.loadData()
|
||||
this.$message.success(`${info.file.name} 上传成功!`);
|
||||
} else {
|
||||
this.$message.error(`${info.file.name} 上传失败.`);
|
||||
}
|
||||
} else if (info.file.status === 'error') {
|
||||
this.$message.error(`${info.file.name} 上传失败.`);
|
||||
}
|
||||
},
|
||||
ossDelete(id) {
|
||||
var that = this;
|
||||
that.$confirm({
|
||||
title: "确认删除",
|
||||
content: "是否删除选中文件?",
|
||||
onOk: function () {
|
||||
that.handleDelete(id)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
31
ant-design-vue-jeecg/src/views/system/AddressList.vue
Normal file
31
ant-design-vue-jeecg/src/views/system/AddressList.vue
Normal file
@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<a-row type="flex" :gutter="16">
|
||||
<a-col :md="5" :sm="24">
|
||||
<address-list-left v-model="currentOrgCode"/>
|
||||
</a-col>
|
||||
<a-col :md="24-5" :sm="24">
|
||||
<address-list-right v-model="currentOrgCode"/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddressListLeft from './modules/AddressListLeft'
|
||||
import AddressListRight from './modules/AddressListRight'
|
||||
|
||||
export default {
|
||||
name: 'AddressList',
|
||||
components: { AddressListLeft, AddressListRight },
|
||||
data() {
|
||||
return {
|
||||
description: '通讯录页面',
|
||||
currentOrgCode: ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
@ -2,7 +2,7 @@
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="表名">
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="departTree"
|
||||
:checkStrictly="true"
|
||||
:checkStrictly="checkStrictly"
|
||||
:expandedKeys="iExpandedKeys"
|
||||
:autoExpandParent="autoExpandParent"
|
||||
@expand="onExpand"/>
|
||||
@ -53,6 +53,23 @@
|
||||
</a-col>
|
||||
</div>
|
||||
</a-card>
|
||||
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown :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>
|
||||
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
树操作 <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
</a-col>
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-card :bordered="false">
|
||||
@ -79,6 +96,28 @@
|
||||
label="机构编码">
|
||||
<a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="机构类型">
|
||||
<template v-if="orgCategoryDisabled">
|
||||
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
|
||||
<a-radio value="1">
|
||||
公司
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
|
||||
<a-radio value="2">
|
||||
部门
|
||||
</a-radio>
|
||||
<a-radio value="3">
|
||||
岗位
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
@ -186,6 +225,10 @@
|
||||
selectedKeys: [],
|
||||
autoIncr: 1,
|
||||
currSelected: {},
|
||||
|
||||
allTreeKeys:[],
|
||||
checkStrictly: true,
|
||||
|
||||
form: this.$form.createForm(this),
|
||||
labelCol: {
|
||||
xs: {span: 24},
|
||||
@ -202,6 +245,7 @@
|
||||
validatorRules: {
|
||||
departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]},
|
||||
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]},
|
||||
orgCategory: {rules: [{required: true, message: '请输入机构类型!'}]},
|
||||
mobile: {rules: [{validator: this.validateMobile}]}
|
||||
},
|
||||
url: {
|
||||
@ -211,6 +255,7 @@
|
||||
exportXlsUrl: "sys/sysDepart/exportXls",
|
||||
importExcelUrl: "sys/sysDepart/importExcel",
|
||||
},
|
||||
orgCategoryDisabled:false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -233,7 +278,8 @@
|
||||
that.treeData.push(temp)
|
||||
that.departTree.push(temp)
|
||||
that.setThisExpandedKeys(temp)
|
||||
console.log(temp.id)
|
||||
that.getAllKeys(temp);
|
||||
// console.log(temp.id)
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
@ -338,7 +384,14 @@
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log('onCheck', checkedKeys, info)
|
||||
this.hiding = false
|
||||
this.checkedKeys = checkedKeys.checked
|
||||
//this.checkedKeys = checkedKeys.checked
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = checkedKeys.checked;
|
||||
}else{
|
||||
this.checkedKeys = checkedKeys
|
||||
}
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
},
|
||||
onSelect(selectedKeys, e) {
|
||||
console.log('selected', selectedKeys, e)
|
||||
@ -355,8 +408,13 @@
|
||||
},
|
||||
// 触发onSelect事件时,为部门树右侧的form表单赋值
|
||||
setValuesToForm(record) {
|
||||
if(record.orgCategory == '1'){
|
||||
this.orgCategoryDisabled = true;
|
||||
}else{
|
||||
this.orgCategoryDisabled = false;
|
||||
}
|
||||
this.form.getFieldDecorator('fax', {initialValue: ''})
|
||||
this.form.setFieldsValue(pick(record, 'departName', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
|
||||
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
|
||||
},
|
||||
getCurrSelectedTitle() {
|
||||
return !this.currSelected.title ? '' : this.currSelected.title
|
||||
@ -459,6 +517,39 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
expandAll () {
|
||||
this.iExpandedKeys = this.allTreeKeys
|
||||
},
|
||||
closeAll () {
|
||||
this.iExpandedKeys = []
|
||||
},
|
||||
checkALL () {
|
||||
this.checkStriccheckStrictlytly = false
|
||||
this.checkedKeys = this.allTreeKeys
|
||||
},
|
||||
cancelCheckALL () {
|
||||
//this.checkedKeys = this.defaultCheckedKeys
|
||||
this.checkedKeys = []
|
||||
},
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
getAllKeys(node) {
|
||||
// console.log('node',node);
|
||||
this.allTreeKeys.push(node.key)
|
||||
if (node.children && node.children.length > 0) {
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.getAllKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
}
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
|
||||
},
|
||||
created() {
|
||||
this.currFlowId = this.$route.params.id
|
||||
@ -516,4 +607,16 @@
|
||||
.ant-btn {
|
||||
margin-left: 3px
|
||||
}
|
||||
|
||||
.drawer-bootom-button {
|
||||
/*position: absolute;*/
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: left;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
</style>
|
||||
@ -9,8 +9,8 @@
|
||||
<template>
|
||||
|
||||
<!--组织机构-->
|
||||
<a-directory-tree
|
||||
selectable
|
||||
<a-tree
|
||||
showLine
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkStrictly="true"
|
||||
@select="onSelect"
|
||||
|
||||
125
ant-design-vue-jeecg/src/views/system/DictDeleteList.vue
Normal file
125
ant-design-vue-jeecg/src/views/system/DictDeleteList.vue
Normal file
@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:width="modalWidth"
|
||||
:style="modalStyle"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
@cancel="handleCancel">
|
||||
<template slot="footer">
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
</template>
|
||||
<a-table
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
size="middle"
|
||||
:columns="columns"
|
||||
:loading="loading"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleBack(record.id)"><a-icon type="redo"/>字典取回</a>
|
||||
<a-divider type="vertical"/>
|
||||
<a @click="handleDelete(record.id)"><a-icon type="scissor"/>彻底删除</a>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
</a-modal>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction,deleteAction,putAction } from '@/api/manage'
|
||||
export default {
|
||||
name: "DictDeleteList",
|
||||
data () {
|
||||
return {
|
||||
modalWidth: '90%',
|
||||
modalStyle: { 'top': '20px'},
|
||||
title: '操作',
|
||||
visible: false,
|
||||
loading: false,
|
||||
dataSource:[],
|
||||
columns:[
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 120,
|
||||
align: "center",
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '字典名称',
|
||||
align: "left",
|
||||
dataIndex: 'dictName'
|
||||
},
|
||||
{
|
||||
title: '字典编号',
|
||||
align: "left",
|
||||
dataIndex: 'dictCode'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align: "left",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: "center",
|
||||
scopedSlots: {customRender: 'action'}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleCancel(){
|
||||
this.visible = false
|
||||
},
|
||||
show(){
|
||||
this.visible = true
|
||||
this.loadData();
|
||||
},
|
||||
loadData(){
|
||||
this.loading = true
|
||||
getAction("/sys/dict/deleteList").then(res=>{
|
||||
this.loading = false
|
||||
if(res.success){
|
||||
this.dataSource = res.result
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleBack(id){
|
||||
putAction("/sys/dict/back/"+id).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
this.loadData();
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -16,7 +16,7 @@
|
||||
}">
|
||||
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" :form="form">
|
||||
<a-form layout="inline" :form="form" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="10">
|
||||
<a-col :md="8" :sm="12">
|
||||
<a-form-item label="名称">
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<!-- 左侧面板 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="12">
|
||||
<a-col :md="7" :sm="8">
|
||||
<a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
|
||||
@ -30,6 +30,8 @@
|
||||
<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="hdd" @click="openDeleteList">回收站</a-button>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
@ -58,6 +60,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>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@ -66,11 +69,12 @@
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import DictModal from './modules/DictModal'
|
||||
import DictItemList from './DictItemList'
|
||||
import DictDeleteList from './DictDeleteList'
|
||||
|
||||
export default {
|
||||
name: "DictList",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {DictModal, DictItemList},
|
||||
components: {DictModal, DictItemList,DictDeleteList},
|
||||
data() {
|
||||
return {
|
||||
description: '这是数据字典页面',
|
||||
@ -161,6 +165,10 @@
|
||||
that.queryParam.dictCode = "";
|
||||
that.loadData(this.ipagination.current);
|
||||
},
|
||||
|
||||
openDeleteList(){
|
||||
this.$refs.dictDeleteList.show()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openKeys(val) {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
|
||||
198
ant-design-vue-jeecg/src/views/system/NewPermissionList.vue
Normal file
198
ant-design-vue-jeecg/src/views/system/NewPermissionList.vue
Normal file
@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button
|
||||
@click="batchDel"
|
||||
v-if="selectedRowKeys.length > 0"
|
||||
ghost
|
||||
type="primary"
|
||||
icon="delete">批量删除
|
||||
</a-button>
|
||||
</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
|
||||
:columns="columns"
|
||||
size="middle"
|
||||
:pagination="false"
|
||||
:dataSource="dataSource"
|
||||
:loading="loading"
|
||||
@expand="expandSubmenu"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
|
||||
|
||||
<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>
|
||||
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDataRule(record)">数据规则</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>
|
||||
<!-- 字符串超长截取省略号显示 -->
|
||||
<span slot="url" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="25"/>
|
||||
</span>
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<span slot="component" slot-scope="text">
|
||||
<j-ellipsis :value="text"/>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<permission-modal ref="modalForm" @ok="modalFormOk"></permission-modal>
|
||||
<permission-data-rule-list ref="PermissionDataRuleList" @ok="modalFormOk"></permission-data-rule-list>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PermissionModal from './modules/PermissionModal'
|
||||
import { getSystemMenuList,getSystemSubmenu } from '@/api/api'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import PermissionDataRuleList from './PermissionDataRuleList'
|
||||
import JEllipsis from '@/components/jeecg/JEllipsis'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '菜单名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name'
|
||||
}, {
|
||||
title: '菜单类型',
|
||||
dataIndex: 'menuType',
|
||||
key: 'menuType',
|
||||
customRender: function(text) {
|
||||
if (text == 0) {
|
||||
return '菜单'
|
||||
} else if (text == 1) {
|
||||
return '菜单'
|
||||
} else if (text == 2) {
|
||||
return '按钮/权限'
|
||||
} else {
|
||||
return text
|
||||
}
|
||||
}
|
||||
},/*{
|
||||
title: '权限编码',
|
||||
dataIndex: 'perms',
|
||||
key: 'permissionCode',
|
||||
},*/{
|
||||
title: 'icon',
|
||||
dataIndex: 'icon',
|
||||
key: 'icon'
|
||||
},
|
||||
{
|
||||
title: '组件',
|
||||
dataIndex: 'component',
|
||||
key: 'component',
|
||||
scopedSlots: { customRender: 'component' }
|
||||
},
|
||||
{
|
||||
title: '路径',
|
||||
dataIndex: 'url',
|
||||
key: 'url',
|
||||
scopedSlots: { customRender: 'url' }
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'sortNo',
|
||||
key: 'sortNo'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
width: 150
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'PermissionList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
PermissionDataRuleList,
|
||||
PermissionModal,
|
||||
JEllipsis
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: '这是菜单管理页面',
|
||||
// 表头
|
||||
columns: columns,
|
||||
loading: false,
|
||||
url: {
|
||||
list: '/sys/permission/list',
|
||||
delete: '/sys/permission/delete',
|
||||
deleteBatch: '/sys/permission/deleteBatch'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
this.dataSource = []
|
||||
getSystemMenuList().then((res) => {
|
||||
if (res.success) {
|
||||
console.log(res.result)
|
||||
this.dataSource = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
expandSubmenu(expanded, record){
|
||||
if(expanded){
|
||||
getSystemSubmenu({parentId:record.id}).then((res) => {
|
||||
if (res.success) {
|
||||
record.children = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 打开数据规则编辑
|
||||
handleDataRule(record) {
|
||||
this.$refs.PermissionDataRuleList.edit(record)
|
||||
},
|
||||
handleAddSub(record) {
|
||||
this.$refs.modalForm.title = "添加子菜单";
|
||||
this.$refs.modalForm.localMenuType = 1;
|
||||
this.$refs.modalForm.disableSubmit = false;
|
||||
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@ -14,7 +14,7 @@
|
||||
background: '#fff',
|
||||
}">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form>
|
||||
<a-form @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="12">
|
||||
<a-col :md="8" :sm="8">
|
||||
<a-form-item label="规则名称" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
|
||||
@ -118,6 +118,10 @@
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
//20190908 scott for: 首次进入菜单列表的时候,不加载权限列表
|
||||
if(!this.permId){
|
||||
return
|
||||
}
|
||||
let that = this
|
||||
this.dataSource = []
|
||||
var params = this.getQueryParams()//查询条件
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="10">
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="12" :sm="12">
|
||||
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :span="6">
|
||||
@ -89,6 +89,9 @@
|
||||
<a>撤销</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a @click="handleDetail(record)">查看</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
178
ant-design-vue-jeecg/src/views/system/SysPositionList.vue
Normal file
178
ant-design-vue-jeecg/src/views/system/SysPositionList.vue
Normal file
@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="职务编码">
|
||||
<a-input placeholder="请输入职务编码" v-model="queryParam.code"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="职务名称">
|
||||
<a-input placeholder="请输入职务名称" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="职级">
|
||||
<j-dict-select-tag v-model="queryParam.rank" placeholder="请选择职级" dictCode="position_rank"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
</template>
|
||||
<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>
|
||||
<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 @click="handleAdd" 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>
|
||||
</a-upload>
|
||||
<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>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<sysPosition-modal ref="modalForm" @ok="modalFormOk"></sysPosition-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SysPositionModal from './modules/SysPositionModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
||||
|
||||
export default {
|
||||
name: 'SysPositionList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
SysPositionModal,
|
||||
JDictSelectTag
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: '职务表管理页面',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '职务编码',
|
||||
align: 'center',
|
||||
dataIndex: 'code'
|
||||
},
|
||||
{
|
||||
title: '职务名称',
|
||||
align: 'center',
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '职级',
|
||||
align: 'center',
|
||||
dataIndex: 'rank_dictText'
|
||||
},
|
||||
// {
|
||||
// title: '公司id',
|
||||
// align: 'center',
|
||||
// dataIndex: 'companyId'
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/sys/position/list',
|
||||
delete: '/sys/position/delete',
|
||||
deleteBatch: '/sys/position/deleteBatch',
|
||||
exportXlsUrl: '/sys/position/exportXls',
|
||||
importExcelUrl: '/sys/position/importExcel',
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@ -2,7 +2,7 @@
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :span="6">
|
||||
@ -132,11 +132,7 @@
|
||||
loading:false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleDetail: function(record){
|
||||
this.$refs.sysAnnouncementModal.detail(record);
|
||||
this.$refs.sysAnnouncementModal.title="查看";
|
||||
|
||||
@ -3,12 +3,13 @@
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @submit.prevent="searchQuery">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
|
||||
<a-col :md="6" :sm="12">
|
||||
<a-form-item label="账号">
|
||||
<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>
|
||||
<!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
|
||||
<j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
@ -117,9 +118,8 @@
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
|
||||
|
||||
<a-divider type="vertical" v-has="'user:edit'"/>
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical"/>
|
||||
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
@ -180,6 +180,7 @@
|
||||
import {frozenBatch} from '@/api/api'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import SysUserAgentModal from "./modules/SysUserAgentModal";
|
||||
import JInput from '@/components/jeecg/JInput'
|
||||
|
||||
export default {
|
||||
name: "UserList",
|
||||
@ -187,7 +188,8 @@
|
||||
components: {
|
||||
SysUserAgentModal,
|
||||
UserModal,
|
||||
PasswordModal
|
||||
PasswordModal,
|
||||
JInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
<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="输入组织机构名称进行查询..."/>
|
||||
|
||||
<a-tree
|
||||
showLine
|
||||
checkStrictly
|
||||
:expandedKeys.sync="expandedKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
|
||||
:treeData="treeDataSource"
|
||||
@select="handleTreeSelect"
|
||||
/>
|
||||
</a-spin>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryDepartTreeList, searchByKeywords } from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: 'AddressListLeft',
|
||||
props: ['value'],
|
||||
data() {
|
||||
return {
|
||||
cardLoading: true,
|
||||
loading: false,
|
||||
treeDataSource: [],
|
||||
selectedKeys: [],
|
||||
expandedKeys: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.queryTreeData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
queryTreeData(keyword) {
|
||||
this.commonRequestThen(queryDepartTreeList({
|
||||
departName: keyword ? keyword : undefined
|
||||
}))
|
||||
},
|
||||
|
||||
handleSearch(value) {
|
||||
if (value) {
|
||||
this.commonRequestThen(searchByKeywords({ keyWord: value }))
|
||||
} else {
|
||||
this.queryTreeData()
|
||||
}
|
||||
},
|
||||
|
||||
handleTreeSelect(selectedKeys, event) {
|
||||
if (selectedKeys.length > 0 && this.selectedKeys[0] !== selectedKeys[0]) {
|
||||
this.selectedKeys = [selectedKeys[0]]
|
||||
let orgCode = event.node.dataRef.orgCode
|
||||
this.emitInput(orgCode)
|
||||
}
|
||||
},
|
||||
|
||||
emitInput(orgCode) {
|
||||
this.$emit('input', orgCode)
|
||||
},
|
||||
|
||||
commonRequestThen(promise) {
|
||||
this.loading = true
|
||||
promise.then(res => {
|
||||
if (res.success) {
|
||||
this.treeDataSource = res.result
|
||||
|
||||
// 默认选中第一条数据、默认展开所有第一级
|
||||
if (res.result.length > 0) {
|
||||
this.expandedKeys = []
|
||||
res.result.forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
this.selectedKeys = [item.id]
|
||||
this.emitInput(item.orgCode)
|
||||
}
|
||||
this.expandedKeys.push(item.id)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warn('组织机构查询失败:' + res.message)
|
||||
console.error('组织机构查询失败:', res)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
this.cardLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<a-card class="j-address-list-right-card-box" :loading="cardLoading" :bordered="false">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="10">
|
||||
|
||||
<a-col :md="6" :sm="12">
|
||||
<a-form-item label="姓名" style="margin-left:8px">
|
||||
<a-input placeholder="请输入姓名查询" v-model="queryParam.realname"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
|
||||
<a-col :md="6" :sm="12">
|
||||
<a-form-item label="工号" style="margin-left:8px">
|
||||
<a-input placeholder="请输入工号查询" v-model="queryParam.workNo"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 18px">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="userId"
|
||||
:pagination="ipagination"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
</a-table>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
|
||||
export default {
|
||||
name: 'AddressListRight',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {},
|
||||
props: ['value'],
|
||||
data() {
|
||||
return {
|
||||
description: '用户信息',
|
||||
cardLoading: true,
|
||||
positionInfo: {},
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
key: 'rowIndex',
|
||||
dataIndex: '',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: (t, r, i) => parseInt(i) + 1
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
width: '20%',
|
||||
align: 'center',
|
||||
dataIndex: 'departName'
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
width: '15%',
|
||||
align: 'center',
|
||||
dataIndex: 'realname'
|
||||
},
|
||||
{
|
||||
title: '工号',
|
||||
width: '15%',
|
||||
align: 'center',
|
||||
dataIndex: 'workNo'
|
||||
},
|
||||
{
|
||||
title: '职务',
|
||||
width: '15%',
|
||||
align: 'center',
|
||||
dataIndex: 'post',
|
||||
customRender: (text) => (text || '').split(',').map(t => this.positionInfo[t] ? this.positionInfo[t] : t).join(',')
|
||||
},
|
||||
{
|
||||
title: '座机',
|
||||
width: '15%',
|
||||
align: 'center',
|
||||
dataIndex: 'telephone'
|
||||
},
|
||||
// {
|
||||
// title: '手机号',
|
||||
// width: '12%',
|
||||
// align: 'center',
|
||||
// dataIndex: 'phone'
|
||||
// },
|
||||
{
|
||||
title: '公司邮箱',
|
||||
width: '15%',
|
||||
align: 'center',
|
||||
dataIndex: 'email'
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/sys/user/queryByOrgCodeForAddressList',
|
||||
listByPosition: '/sys/position/list'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
immediate: true,
|
||||
handler(orgCode) {
|
||||
this.dataSource = []
|
||||
this.loadData(1, orgCode)
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.queryPositionInfo()
|
||||
},
|
||||
methods: {
|
||||
|
||||
loadData(pageNum, orgCode) {
|
||||
if (!orgCode) {
|
||||
return
|
||||
}
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (pageNum === 1) {
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
this.loading = true
|
||||
getAction(this.url.list, {
|
||||
orgCode,
|
||||
...this.getQueryParams()
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.ipagination.total = res.result.total
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
this.cardLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
searchQuery() {
|
||||
this.loadData(1, this.value)
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.loadData(1, this.value)
|
||||
},
|
||||
|
||||
handleTableChange(pagination, filters, sorter) {
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
this.isorter.column = sorter.field
|
||||
this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
|
||||
}
|
||||
this.ipagination = pagination
|
||||
this.loadData(null, this.value)
|
||||
},
|
||||
|
||||
// 查询职务信息
|
||||
queryPositionInfo() {
|
||||
getAction(this.url.listByPosition, { pageSize: 99999 }).then(res => {
|
||||
if (res.success) {
|
||||
let positionInfo = {}
|
||||
res.result.records.forEach(record => {
|
||||
positionInfo[record['code']] = record['name']
|
||||
})
|
||||
this.positionInfo = positionInfo
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.j-address-list-right-card-box .ant-table-placeholder {
|
||||
min-height: 46px;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.j-address-list-right-card-box {
|
||||
height: 100%;
|
||||
min-height: 300px;
|
||||
}
|
||||
</style>
|
||||
@ -30,6 +30,28 @@
|
||||
:disabled="condition">
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="机构类型">
|
||||
<template v-if="seen">
|
||||
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
|
||||
<a-radio value="1">
|
||||
公司
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
|
||||
<a-radio value="2">
|
||||
部门
|
||||
</a-radio>
|
||||
<a-radio value="3">
|
||||
岗位
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
@ -107,6 +129,7 @@
|
||||
url: {
|
||||
add: "/sys/sysDepart/add",
|
||||
},
|
||||
dictDisabled:true,
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@ -128,8 +151,10 @@
|
||||
add (depart) {
|
||||
if(depart){
|
||||
this.seen = false;
|
||||
this.dictDisabled = false;
|
||||
}else{
|
||||
this.seen = true;
|
||||
this.dictDisabled = true;
|
||||
}
|
||||
this.edit(depart);
|
||||
},
|
||||
@ -139,8 +164,13 @@
|
||||
this.visible = true;
|
||||
this.loadTreeData();
|
||||
this.model.parentId = record!=null?record.toString():null;
|
||||
if(this.seen){
|
||||
this.model.orgCategory = '1';
|
||||
}else{
|
||||
this.model.orgCategory = '2';
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
|
||||
this.form.setFieldsValue(pick(this.model,'orgCategory','departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@ -23,6 +23,22 @@
|
||||
label="机构编码">
|
||||
<a-input style="border:0px;" placeholder="" v-decorator="['orgCode', {}]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="机构类型">
|
||||
<a-radio-group :disabled="true" v-decorator="['orgCategory',{}]" placeholder="请选择机构类型">
|
||||
<a-radio value="1">
|
||||
公司
|
||||
</a-radio>
|
||||
<a-radio value="2">
|
||||
部门
|
||||
</a-radio>
|
||||
<a-radio value="3">
|
||||
岗位
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
@ -98,7 +114,7 @@
|
||||
console.log("record:");
|
||||
console.log(record);
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(record, 'departName', 'parentId', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'));
|
||||
this.form.setFieldsValue(pick(record, 'orgCategory','departName', 'parentId', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'));
|
||||
});
|
||||
},
|
||||
clearForm() {
|
||||
|
||||
@ -148,6 +148,16 @@
|
||||
<a-switch checkedChildren="是" unCheckedChildren="否" v-model="alwaysShow"/>
|
||||
</a-form-item>
|
||||
|
||||
<!--update_begin author:wuxianquan date:20190908 for:增加组件,外链打开方式可选 -->
|
||||
<a-form-item
|
||||
v-show="show"
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="打开方式">
|
||||
<a-switch checkedChildren="外部" unCheckedChildren="内部" v-model="internalOrExternal"/>
|
||||
</a-form-item>
|
||||
<!--update_end author:wuxianquan date:20190908 for:增加组件,外链打开方式可选 -->
|
||||
|
||||
|
||||
</a-form>
|
||||
|
||||
@ -186,6 +196,9 @@
|
||||
alwaysShow:false,//表单元素-聚合路由
|
||||
menuHidden:false,//表单元素-隐藏路由
|
||||
routeSwitch:true, //是否路由菜单
|
||||
/*update_begin author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
|
||||
internalOrExternal:false,//菜单打开方式
|
||||
/*update_end author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
|
||||
isKeepalive:true, //是否缓存路由
|
||||
show:true,//根据菜单类型,动态显示隐藏表单元素
|
||||
menuLabel:'菜单名称',
|
||||
@ -213,7 +226,7 @@
|
||||
component:{rules: [{ required: this.show, message: '请输入前端组件!' }]},
|
||||
url:{rules: [{ required: this.show, message: '请输入菜单路径!' }]},
|
||||
permsType:{rules: [{ required: true, message: '请输入授权策略!' }]},
|
||||
sortNo:{initialValue:1.0,rules: [{validator: this.validateNumber}]},
|
||||
sortNo:{initialValue:1.0},
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -254,13 +267,20 @@
|
||||
if(record.route!=null){
|
||||
this.routeSwitch = record.route?true:false;
|
||||
}
|
||||
|
||||
|
||||
if(record.keepAlive!=null){
|
||||
this.isKeepalive = record.keepAlive?true:false;
|
||||
}else{
|
||||
this.isKeepalive = false; // 升级兼容 如果没有(后台没有传过来、或者是新建)默认为false
|
||||
}
|
||||
|
||||
/*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/
|
||||
if(record.internalOrExternal!=null){
|
||||
this.internalOrExternal = record.internalOrExternal?true:false;
|
||||
}else{
|
||||
this.internalOrExternal = false;
|
||||
}
|
||||
/*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/
|
||||
|
||||
|
||||
//console.log('record.menuType', record.menuType);
|
||||
@ -295,6 +315,10 @@
|
||||
this.model.hidden = this.menuHidden;
|
||||
this.model.route = this.routeSwitch;
|
||||
this.model.keepAlive = this.isKeepalive;
|
||||
/*update_begin author:wuxianquan date:20190908 for:获取值*/
|
||||
this.model.internalOrExternal = this.internalOrExternal;
|
||||
/*update_end author:wuxianquan date:20190908 for:获取值*/
|
||||
|
||||
let formData = Object.assign(this.model, values);
|
||||
if ((formData.menuType == 1 || formData.menuType == 2) && !formData.parentId) {
|
||||
that.validateStatus = 'error';
|
||||
|
||||
@ -28,7 +28,8 @@
|
||||
<!-- <a-icon type="share-alt" />-->
|
||||
<!-- 在线cron表达式生成-->
|
||||
<!-- </a>-->
|
||||
<j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入cron表达式!' }]}]" @change="setCorn"></j-cron>
|
||||
<!-- <j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入cron表达式!' }]}]" @change="setCorn"></j-cron>-->
|
||||
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
@ -61,9 +62,9 @@
|
||||
|
||||
<script>
|
||||
import { httpAction } from '@/api/manage'
|
||||
import JCron from "@/components/jeecg/JCron.vue";
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import pick from 'lodash.pick'
|
||||
import moment from "moment"
|
||||
// import moment from "moment"
|
||||
|
||||
export default {
|
||||
name: "QuartzJobModal",
|
||||
@ -109,6 +110,8 @@
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
console.log(this.model)
|
||||
this.visible = true;
|
||||
@ -127,10 +130,10 @@
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
// if (typeof values.cronExpression == "undefined" || Object.keys(values.cronExpression).length==0 ) {
|
||||
// this.$message.warning('请输入cron表达式!');
|
||||
// return false;
|
||||
// }
|
||||
if (typeof values.cronExpression == "undefined" || Object.keys(values.cronExpression).length==0 ) {
|
||||
this.$message.warning('请输入cron表达式!');
|
||||
return false;
|
||||
}
|
||||
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
@ -171,9 +174,9 @@
|
||||
})
|
||||
|
||||
// console.log(Object.keys(data).length==0);
|
||||
// if (Object.keys(data).length==0) {
|
||||
// this.$message.warning('请输入cron表达式!');
|
||||
// }
|
||||
if (Object.keys(data).length==0) {
|
||||
this.$message.warning('请输入cron表达式!');
|
||||
}
|
||||
},
|
||||
validateCron(rule, value, callback){
|
||||
if(!value){
|
||||
|
||||
@ -66,17 +66,17 @@
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- update-begin author:kangxiaolin date:20190921 for:系统发送通知 用户多选失败 #513 -->
|
||||
<a-table
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect}"
|
||||
@change="handleTableChange"
|
||||
>
|
||||
|
||||
<!-- update-end author:kangxiaolin date:20190921 for:系统发送通知 用户多选失败 #513 -->
|
||||
</a-table>
|
||||
</a-modal>
|
||||
</template>
|
||||
@ -178,7 +178,13 @@
|
||||
if(!selectUser){
|
||||
this.selectionRows=[]
|
||||
}else{
|
||||
this.selectionRows = selectUser;
|
||||
var that=this;
|
||||
that.selectionRows=[];
|
||||
selectUser.forEach(function(record,index){
|
||||
console.log(record)
|
||||
that.selectionRows.push({id: that.selectedRowKeys[index],realname:record})
|
||||
})
|
||||
// this.selectionRows = selectUser;
|
||||
}
|
||||
},
|
||||
loadData (arg){
|
||||
@ -211,11 +217,23 @@
|
||||
}
|
||||
return str;
|
||||
},
|
||||
onSelectChange (selectedRowKeys,selectionRows) {
|
||||
//--update-begin----author:kangxiaolin---date:20190921------for:系统发送通知 用户多选失败 #513----
|
||||
onSelectChange (selectedRowKeys) {
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
console.log(this.selectedRowKeys);
|
||||
this.selectionRows = selectionRows;
|
||||
},
|
||||
onSelect(record, selected){
|
||||
if(selected == true ){
|
||||
this.selectionRows.push(record);
|
||||
}else {
|
||||
this.selectionRows.forEach(function(item,index,arr){
|
||||
if(item.id == record.id) {
|
||||
arr.splice(index, 1);
|
||||
}
|
||||
})
|
||||
}
|
||||
//--update-end----author:kangxiaolin---date:20190921------for:系统发送通知 用户多选失败 #513----
|
||||
},
|
||||
|
||||
searchReset(){
|
||||
let that = this;
|
||||
Object.keys(that.queryParam).forEach(function(key){
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
placeholder="请选择父级节点"
|
||||
v-decorator="['pid', validatorRules.pid]"
|
||||
dict="sys_category,name,id"
|
||||
pidField="pid">
|
||||
pidField="pid"
|
||||
pidValue="0">
|
||||
</j-tree-select>
|
||||
</a-form-item>
|
||||
|
||||
@ -25,9 +26,16 @@
|
||||
<a-input v-decorator="[ 'name', validatorRules.name]" placeholder="请输入类型名称"></a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="类型编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<!--<a-form-item label="类型编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="[ 'code', validatorRules.code]" placeholder="请输入类型编码"></a-input>
|
||||
</a-form-item>
|
||||
</a-form-item>-->
|
||||
|
||||
<!--<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<span style="font-size: 12px;color:red" slot="label">编码规则(注)</span>
|
||||
<span style="font-size: 12px;color:red">
|
||||
编码值前缀需和父节点保持一致,比如父级节点编码是A01则当前编码必须以A01开头
|
||||
</span>
|
||||
</a-form-item>-->
|
||||
|
||||
|
||||
</a-form>
|
||||
@ -37,7 +45,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { httpAction } from '@/api/manage'
|
||||
import { httpAction,getAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
||||
|
||||
@ -64,13 +72,20 @@
|
||||
|
||||
confirmLoading: false,
|
||||
validatorRules:{
|
||||
pid:{},
|
||||
name:{},
|
||||
code:{},
|
||||
code:{
|
||||
rules: [{
|
||||
required: true, message: '请输入类型编码!'
|
||||
},{
|
||||
validator: this.validateMyCode
|
||||
}]
|
||||
},
|
||||
pid:{},
|
||||
name:{}
|
||||
},
|
||||
url: {
|
||||
add: "/sys/category/add",
|
||||
edit: "/sys/category/edit",
|
||||
checkCode:"/sys/category/checkCode"
|
||||
},
|
||||
expandedRowKeys:[],
|
||||
pidField:"pid"
|
||||
@ -154,7 +169,20 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
validateMyCode(rule, value, callback){
|
||||
let params = {
|
||||
pid: this.form.getFieldValue('pid'),
|
||||
code: value
|
||||
}
|
||||
getAction(this.url.checkCode,params).then((res) => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="职务编码">
|
||||
<a-input placeholder="请输入职务编码" v-decorator="['code', validatorRules.code]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="职务名称">
|
||||
<a-input placeholder="请输入职务名称" v-decorator="['name', validatorRules.name]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="职级"
|
||||
>
|
||||
<j-dict-select-tag
|
||||
placeholder="请选择职级"
|
||||
:triggerChange="true"
|
||||
dictCode="position_rank"
|
||||
v-decorator="['rank', validatorRules.rank]"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!--<a-form-item-->
|
||||
<!-- :labelCol="labelCol"-->
|
||||
<!-- :wrapperCol="wrapperCol"-->
|
||||
<!-- label="公司id">-->
|
||||
<!-- <a-input placeholder="请输入公司id" v-decorator="['companyId', {}]"/>-->
|
||||
<!--</a-form-item>-->
|
||||
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { httpAction } from '@/api/manage'
|
||||
import { duplicateCheck } from '@/api/api'
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
||||
|
||||
let validatorCodeTimer = null
|
||||
|
||||
export default {
|
||||
name: 'SysPositionModal',
|
||||
components: { JDictSelectTag },
|
||||
data() {
|
||||
return {
|
||||
title: '操作',
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules: {
|
||||
code: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入职务编码' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 函数消抖的简单实现,防止一段时间内发送多次请求
|
||||
if (validatorCodeTimer) {
|
||||
// 停止上次开启的定时器
|
||||
clearTimeout(validatorCodeTimer)
|
||||
}
|
||||
validatorCodeTimer = setTimeout(() => {
|
||||
duplicateCheck({
|
||||
tableName: 'sys_position',
|
||||
fieldName: 'code',
|
||||
fieldVal: value,
|
||||
dataId: this.model.id
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback(res.message)
|
||||
}
|
||||
}).catch(console.error)
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
name: { rules: [{ required: true, message: '请输入职务名称' }] },
|
||||
rank: { rules: [{ required: true, message: '请选择职级' }] },
|
||||
},
|
||||
url: {
|
||||
add: '/sys/position/add',
|
||||
edit: '/sys/position/edit',
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
add() {
|
||||
this.edit({})
|
||||
},
|
||||
edit(record) {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,
|
||||
'code',
|
||||
'name',
|
||||
'rank',
|
||||
// 'companyId'
|
||||
))
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
},
|
||||
handleOk() {
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let httpurl = ''
|
||||
let method = ''
|
||||
if (!this.model.id) {
|
||||
httpurl += this.url.add
|
||||
method = 'post'
|
||||
} else {
|
||||
httpurl += this.url.edit
|
||||
method = 'put'
|
||||
}
|
||||
|
||||
let formData = Object.assign(this.model, values)
|
||||
httpAction(httpurl, formData, method).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false
|
||||
that.close()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
||||
@ -40,6 +40,14 @@
|
||||
<a-input placeholder="请输入用户名称" v-decorator="[ 'realname', validatorRules.realname]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入工号" v-decorator="[ 'workNo', validatorRules.workNo]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" >
|
||||
<a-select
|
||||
mode="multiple"
|
||||
@ -104,6 +112,10 @@
|
||||
<a-input placeholder="请输入手机号码" :disabled="isDisabledAuth('user:form:phone')" v-decorator="[ 'phone', validatorRules.phone]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入座机" v-decorator="[ 'telephone', validatorRules.telephone]"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="工作流引擎" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag v-decorator="['activitiSync', {}]" placeholder="请选择是否同步工作流引擎" :type="'radio'" :triggerChange="true" dictCode="activiti_sync"/>
|
||||
</a-form-item>
|
||||
@ -127,6 +139,7 @@
|
||||
import Vue from 'vue'
|
||||
// 引入搜索部门弹出框的组件
|
||||
import departWindow from './DepartWindow'
|
||||
import JSelectPosition from '@/components/jeecgbiz/JSelectPosition'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { getAction } from '@/api/manage'
|
||||
import {addUser,editUser,queryUserRole,queryall } from '@/api/api'
|
||||
@ -134,9 +147,10 @@
|
||||
import {duplicateCheck } from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: "RoleModal",
|
||||
name: "UserModal",
|
||||
components: {
|
||||
departWindow,
|
||||
JSelectPosition
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -185,8 +199,19 @@
|
||||
validator: this.validateEmail
|
||||
}],
|
||||
},
|
||||
roles:{}
|
||||
roles:{},
|
||||
// sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))}
|
||||
workNo: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入工号' },
|
||||
{ validator: this.validateWorkNo }
|
||||
]
|
||||
},
|
||||
telephone: {
|
||||
rules: [
|
||||
{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },
|
||||
]
|
||||
}
|
||||
},
|
||||
title:"操作",
|
||||
visible: false,
|
||||
@ -282,7 +307,7 @@
|
||||
that.visible = true;
|
||||
that.model = Object.assign({}, record);
|
||||
that.$nextTick(() => {
|
||||
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync'))
|
||||
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync','workNo','telephone','post'))
|
||||
});
|
||||
// 调用查询用户对应的部门信息的方法
|
||||
that.checkedDepartKeys = [];
|
||||
@ -389,7 +414,10 @@
|
||||
if(!value){
|
||||
callback()
|
||||
}else{
|
||||
if(new RegExp(/^1[3|4|5|7|8][0-9]\d{8}$/).test(value)){
|
||||
//update-begin--Author:kangxiaolin Date:20190826 for:[05] 手机号不支持199号码段--------------------
|
||||
if(new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)){
|
||||
//update-end--Author:kangxiaolin Date:20190826 for:[05] 手机号不支持199号码段--------------------
|
||||
|
||||
var params = {
|
||||
tableName: 'sys_user',
|
||||
fieldName: 'phone',
|
||||
@ -447,6 +475,21 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
validateWorkNo(rule, value, callback){
|
||||
var params = {
|
||||
tableName: 'sys_user',
|
||||
fieldName: 'work_no',
|
||||
fieldVal: value,
|
||||
dataId: this.userId
|
||||
};
|
||||
duplicateCheck(params).then((res) => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback("工号已存在!")
|
||||
}
|
||||
})
|
||||
},
|
||||
handleConfirmBlur (e) {
|
||||
const value = e.target.value;
|
||||
this.confirmDirty = this.confirmDirty || !!value
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
:treeData="treeData"
|
||||
@expand="onExpand"
|
||||
@select="onTreeNodeSelect"
|
||||
:selectedKeys="selectedKeys"
|
||||
:expandedKeys="expandedKeysss"
|
||||
:checkStrictly="checkStrictly">
|
||||
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
|
||||
@ -30,8 +31,10 @@
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<!-- 简化Tree逻辑,使用默认checkStrictly为false的行为,即默认父子关联
|
||||
<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>
|
||||
@ -67,25 +70,28 @@
|
||||
treeData: [],
|
||||
defaultCheckedKeys:[],
|
||||
checkedKeys:[],
|
||||
halfCheckedKeys:[],
|
||||
expandedKeysss:[],
|
||||
allTreeKeys:[],
|
||||
autoExpandParent: true,
|
||||
checkStrictly: true,
|
||||
checkStrictly: false,
|
||||
title:"角色权限配置",
|
||||
visible: false,
|
||||
loading: false,
|
||||
selectedKeys:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onTreeNodeSelect(id){
|
||||
this.$refs.datarule.show(id[0],this.roleId)
|
||||
},
|
||||
onCheck (o) {
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = o.checked;
|
||||
}else{
|
||||
this.checkedKeys = o
|
||||
if(id && id.length>0){
|
||||
this.selectedKeys = id
|
||||
}
|
||||
this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
|
||||
},
|
||||
onCheck (checkedKeys, { halfCheckedKeys }) {
|
||||
// 保存选中的和半选中的,后面保存的时候合并提交
|
||||
this.checkedKeys = checkedKeys
|
||||
this.halfCheckedKeys = halfCheckedKeys
|
||||
},
|
||||
show(roleId){
|
||||
this.roleId=roleId
|
||||
@ -116,24 +122,18 @@
|
||||
this.checkedKeys = this.allTreeKeys
|
||||
},
|
||||
cancelCheckALL () {
|
||||
//this.checkedKeys = this.defaultCheckedKeys
|
||||
this.checkedKeys = []
|
||||
},
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
handleSubmit(){
|
||||
let that = this;
|
||||
let checkedKeys = [...that.checkedKeys, ...that.halfCheckedKeys]
|
||||
const permissionIds = checkedKeys.join(",")
|
||||
let params = {
|
||||
roleId:that.roleId,
|
||||
permissionIds:that.checkedKeys.join(","),
|
||||
permissionIds,
|
||||
lastpermissionIds:that.defaultCheckedKeys.join(","),
|
||||
};
|
||||
that.loading = true;
|
||||
@ -150,6 +150,15 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
convertTreeListToKeyLeafPairs(treeList, keyLeafPair = []) {
|
||||
for(const {key, isLeaf, children} of treeList) {
|
||||
keyLeafPair.push({key, isLeaf})
|
||||
if(children && children.length > 0) {
|
||||
this.convertTreeListToKeyLeafPairs(children, keyLeafPair)
|
||||
}
|
||||
}
|
||||
return keyLeafPair;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
visible () {
|
||||
@ -157,11 +166,23 @@
|
||||
queryTreeListForRole().then((res) => {
|
||||
this.treeData = res.result.treeList
|
||||
this.allTreeKeys = res.result.ids
|
||||
const keyLeafPairs = this.convertTreeListToKeyLeafPairs(this.treeData)
|
||||
queryRolePermission({roleId:this.roleId}).then((res)=>{
|
||||
this.checkedKeys = [...res.result];
|
||||
this.defaultCheckedKeys = [...res.result];
|
||||
this.expandedKeysss = this.allTreeKeys;
|
||||
//console.log(this.defaultCheckedKeys)
|
||||
// 过滤出 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.expandedKeysss = this.allTreeKeys;
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="10">
|
||||
<j-graphic-code @success="generateCode" style="float: right"></j-graphic-code>
|
||||
<j-graphic-code @success="generateCode" ref="jgraphicCodeRef" style="float: right" remote></j-graphic-code>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@ -85,12 +85,12 @@
|
||||
|
||||
<a-form-item>
|
||||
<a-checkbox v-model="formLogin.rememberMe">自动登陆</a-checkbox>
|
||||
<!-- <router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
|
||||
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
|
||||
忘记密码
|
||||
</router-link>
|
||||
<router-link :to="{ name: 'register'}" class="forge-password" style="float: right;margin-right: 10px" >
|
||||
注册账户
|
||||
</router-link>-->
|
||||
</router-link>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item style="margin-top:24px">
|
||||
@ -265,6 +265,9 @@
|
||||
//loginParams.password = encryption(values.password,that.encryptedString.key,that.encryptedString.iv)
|
||||
loginParams.password = values.password
|
||||
// update-begin- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
|
||||
let checkParams = this.$refs.jgraphicCodeRef.getLoginParam()
|
||||
loginParams.captcha = checkParams.checkCode
|
||||
loginParams.checkKey = checkParams.checkKey
|
||||
|
||||
that.Login(loginParams).then((res) => {
|
||||
this.departConfirm(res)
|
||||
|
||||
Reference in New Issue
Block a user