mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
Jeecg-Boot 2.1.2版本发布
This commit is contained in:
@ -39,8 +39,8 @@
|
||||
<!-- 部门选择控件 -->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择部门">
|
||||
<j-select-depart v-decorator="['departId']" :trigger-change="true"></j-select-depart>
|
||||
<a-form-item label="选择部门 自定义返回值">
|
||||
<j-select-depart v-decorator="['departId']" :trigger-change="true" customReturnField="departName"></j-select-depart>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中的部门ID(v-decorator):{{ getDepartIdValue() }}</a-col>
|
||||
@ -69,7 +69,7 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择用户">
|
||||
<j-select-multi-user v-model="multiUser"></j-select-multi-user>
|
||||
<j-select-multi-user v-model="multiUser" ></j-select-multi-user>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中的用户(v-model):{{ multiUser }}</a-col>
|
||||
@ -217,7 +217,7 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="树字典">
|
||||
<j-tree-dict parentCode="A01" />
|
||||
<j-tree-dict parentCode="B01" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12"></a-col>
|
||||
|
||||
@ -177,13 +177,14 @@
|
||||
import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import Clipboard from 'clipboard'
|
||||
|
||||
import { filterObj } from '@/utils/util';
|
||||
|
||||
export default {
|
||||
name: 'OnlCgformHeadList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
JDictSelectTag
|
||||
JDictSelectTag,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -132,6 +132,7 @@
|
||||
|
||||
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
|
||||
|
||||
<process-inst-pic-modal ref="processInstPicModal"></process-inst-pic-modal>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
@ -691,6 +692,12 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
handlePreviewPic: function(record){
|
||||
var flowCode = this.flowCodePre+this.currentTableName;
|
||||
var dataId = record.id;
|
||||
this.$refs.processInstPicModal.preview(flowCode,dataId);
|
||||
this.$refs.processInstPicModal.title="流程图";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
187
ant-design-vue-jeecg/src/views/system/SysFillRuleList.vue
Normal file
187
ant-design-vue-jeecg/src/views/system/SysFillRuleList.vue
Normal file
@ -0,0 +1,187 @@
|
||||
<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.ruleName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="规则Code">
|
||||
<a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<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 -->
|
||||
<a-alert type="info" showIcon style="margin-bottom: 16px;">
|
||||
<template slot="message">
|
||||
<span>已选择</span>
|
||||
<a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
|
||||
<span>项</span>
|
||||
<template v-if="selectedRowKeys.length>0">
|
||||
<a-divider type="vertical"/>
|
||||
<a @click="onClearSelected">清空</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-alert>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item @click="handleTest(record)">
|
||||
功能测试
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<sys-fill-rule-modal ref="modalForm" @ok="modalFormOk"/>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import SysFillRuleModal from './modules/SysFillRuleModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
|
||||
export default {
|
||||
name: 'SysFillRuleList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: { SysFillRuleModal },
|
||||
data() {
|
||||
return {
|
||||
description: '填值规则管理页面',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: (t, r, index) => 1 + index
|
||||
},
|
||||
{
|
||||
title: '规则名称',
|
||||
align: 'center',
|
||||
dataIndex: 'ruleName'
|
||||
},
|
||||
{
|
||||
title: '规则Code',
|
||||
align: 'center',
|
||||
dataIndex: 'ruleCode'
|
||||
},
|
||||
{
|
||||
title: '规则实现类',
|
||||
align: 'center',
|
||||
dataIndex: 'ruleClass'
|
||||
},
|
||||
{
|
||||
title: '规则参数',
|
||||
align: 'center',
|
||||
dataIndex: 'ruleParams'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/sys/fillRule/list',
|
||||
test: '/sys/fillRule/testFillRule',
|
||||
delete: '/sys/fillRule/delete',
|
||||
deleteBatch: '/sys/fillRule/deleteBatch',
|
||||
exportXlsUrl: '/sys/fillRule/exportXls',
|
||||
importExcelUrl: '/sys/fillRule/importExcel',
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl() {
|
||||
return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTest(record) {
|
||||
let closeLoading = this.$message.loading('生成中...', 0)
|
||||
|
||||
getAction(this.url.test, {
|
||||
ruleCode: record.ruleCode
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$info({
|
||||
title: '填值规则功能测试',
|
||||
content: '生成结果:' + res.result
|
||||
})
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
closeLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@ -19,7 +19,7 @@
|
||||
<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"/>
|
||||
<j-dict-select-tag v-model="queryParam.postRank" placeholder="请选择职级" dictCode="position_rank"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
{
|
||||
title: '职级',
|
||||
align: 'center',
|
||||
dataIndex: 'rank_dictText'
|
||||
dataIndex: 'postRank_dictText'
|
||||
},
|
||||
// {
|
||||
// title: '公司id',
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="border-top: 5px">
|
||||
<a-button @click="handleAdd" v-has="'user:add'" type="primary" icon="plus">添加用户</a-button>
|
||||
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'user:add'">添加用户</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>
|
||||
@ -119,6 +119,7 @@
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
|
||||
<a-dropdown>
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
<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="['ruleName', validatorRules.ruleName]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="规则Code">
|
||||
<a-input placeholder="请输入规则Code" :disabled="disabledCode" v-decorator="['ruleCode', validatorRules.ruleCode]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="规则实现类">
|
||||
<a-input placeholder="请输入规则实现类" v-decorator="['ruleClass', validatorRules.ruleClass]"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="规则参数">
|
||||
<a-textarea placeholder="请输入规则参数" :rows="5" v-decorator="['ruleParams', validatorRules.ruleParams]"/>
|
||||
</a-form-item>
|
||||
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { httpAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
name: 'SysFillRuleModal',
|
||||
components: {},
|
||||
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: {
|
||||
ruleName: { rules: [{ required: true, message: '规则名称不能为空' }] },
|
||||
ruleCode: {
|
||||
rules: [
|
||||
{ required: true, message: '规则Code不能为空' },
|
||||
{ validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) }
|
||||
]
|
||||
},
|
||||
ruleClass: { rules: [{ required: true, message: '规则实现类不能为空' }] },
|
||||
ruleParams: {
|
||||
rules: [{
|
||||
validator: (rule, value, callback) => {
|
||||
|
||||
try {
|
||||
let json = JSON.parse(value)
|
||||
if (json instanceof Array) {
|
||||
callback('只能传递JSON对象,不能传递JSON数组')
|
||||
} else if (json instanceof Object) {
|
||||
callback()
|
||||
} else {
|
||||
callback('请输入JSON字符串')
|
||||
}
|
||||
} catch {
|
||||
callback('请输入JSON字符串')
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
},
|
||||
url: {
|
||||
add: '/sys/fillRule/add',
|
||||
edit: '/sys/fillRule/edit',
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
disabledCode() {
|
||||
return !!this.model.id
|
||||
}
|
||||
},
|
||||
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, 'ruleName', 'ruleCode', 'ruleClass', 'ruleParams'))
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
},
|
||||
handleOk() {
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let httpUrl = this.url.add, method = 'post'
|
||||
if (this.model.id) {
|
||||
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>
|
||||
@ -33,7 +33,7 @@
|
||||
placeholder="请选择职级"
|
||||
:triggerChange="true"
|
||||
dictCode="position_rank"
|
||||
v-decorator="['rank', validatorRules.rank]"
|
||||
v-decorator="['postRank', validatorRules.postRank]"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!--<a-form-item-->
|
||||
@ -104,7 +104,7 @@
|
||||
]
|
||||
},
|
||||
name: { rules: [{ required: true, message: '请输入职务名称' }] },
|
||||
rank: { rules: [{ required: true, message: '请选择职级' }] },
|
||||
postRank: { rules: [{ required: true, message: '请选择职级' }] },
|
||||
},
|
||||
url: {
|
||||
add: '/sys/position/add',
|
||||
@ -126,7 +126,7 @@
|
||||
this.form.setFieldsValue(pick(this.model,
|
||||
'code',
|
||||
'name',
|
||||
'rank',
|
||||
'postRank',
|
||||
// 'companyId'
|
||||
))
|
||||
})
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
</a-tabs>
|
||||
|
||||
<a-form-item>
|
||||
<a-checkbox v-model="formLogin.rememberMe">自动登陆</a-checkbox>
|
||||
<a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]" >自动登陆</a-checkbox>
|
||||
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
|
||||
忘记密码
|
||||
</router-link>
|
||||
@ -201,13 +201,6 @@
|
||||
time: 60,
|
||||
smsSendBtn: false,
|
||||
},
|
||||
formLogin: {
|
||||
username: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
mobile: "",
|
||||
rememberMe: true
|
||||
},
|
||||
validatorRules:{
|
||||
username:{rules: [{ required: true, message: '请输入用户名!',validator: 'click'}]},
|
||||
password:{rules: [{ required: true, message: '请输入密码!',validator: 'click'}]},
|
||||
@ -251,19 +244,18 @@
|
||||
},
|
||||
handleSubmit () {
|
||||
let that = this
|
||||
let loginParams = {
|
||||
remember_me: that.formLogin.rememberMe
|
||||
};
|
||||
let loginParams = {};
|
||||
that.loginBtn = true;
|
||||
// 使用账户密码登陆
|
||||
if (that.customActiveKey === 'tab1') {
|
||||
that.form.validateFields([ 'username', 'password','inputCode' ], { force: true }, (err, values) => {
|
||||
that.form.validateFields([ 'username', 'password','inputCode', 'rememberMe' ], { force: true }, (err, values) => {
|
||||
if (!err) {
|
||||
loginParams.username = values.username
|
||||
// update-begin- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
|
||||
//loginParams.password = md5(values.password)
|
||||
//loginParams.password = encryption(values.password,that.encryptedString.key,that.encryptedString.iv)
|
||||
loginParams.password = values.password
|
||||
loginParams.remember_me = values.rememberMe
|
||||
// update-begin- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
|
||||
let checkParams = this.$refs.jgraphicCodeRef.getLoginParam()
|
||||
loginParams.captcha = checkParams.checkCode
|
||||
@ -282,10 +274,11 @@
|
||||
})
|
||||
// 使用手机号登陆
|
||||
} else {
|
||||
that.form.validateFields([ 'mobile', 'captcha' ], { force: true }, (err, values) => {
|
||||
that.form.validateFields([ 'mobile', 'captcha', 'rememberMe' ], { force: true }, (err, values) => {
|
||||
if (!err) {
|
||||
loginParams.mobile = values.mobile
|
||||
loginParams.captcha = values.captcha
|
||||
loginParams.remember_me = values.rememberMe
|
||||
that.PhoneLogin(loginParams).then((res) => {
|
||||
console.log(res.result);
|
||||
this.departConfirm(res)
|
||||
|
||||
Reference in New Issue
Block a user