Browse Source

权限授权

dev
kilo 2 years ago
parent
commit
8d96e47ea9
  1. 217
      src/views/activiti/form/ProcessPermissionAuthorizationForm.vue
  2. 180
      src/views/processmaterials/ProcessPermissionAuthorizationList.vue

217
src/views/activiti/form/ProcessPermissionAuthorizationForm.vue

@ -0,0 +1,217 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form :form="form" slot="detail">
<a-row>
<a-col :span="12">
<a-form-item label="流程发起公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['company']" :trigger-change="true" dictCode="" placeholder="请选择流程发起公司" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="流程发起时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择流程发起时间" v-decorator="['createTime']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="流程发起部门" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['sysOrgCode']" :trigger-change="true" dictCode="" placeholder="请选择流程发起部门" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="流程发起人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['createBy']" :trigger-change="true" dictCode="" placeholder="请选择流程发起人" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授权人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['authorizationPerson']" :trigger-change="true" dictCode="" placeholder="请选择授权人" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="被授权人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['authorizedPerson']" :trigger-change="true" dictCode="" placeholder="请选择被授权人" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授权时间(开启时间)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择授权时间(开启时间)" v-decorator="['privilegedTimeStart']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授权时间(结束时间)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择授权时间(结束时间)" v-decorator="['privilegedTimeEnd']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否继续授权" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-switch v-decorator="['continueAuthorize']" ></j-switch>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授权时间(确认时间)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['privilegedAffirmedTime']" placeholder="请输入授权时间(确认时间)" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授权天数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['authorizationNumberDays']" placeholder="请输入授权天数" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="文件id" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['fileId']" placeholder="请输入文件id" ></a-input>
</a-form-item>
</a-col>
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
<a-button @click="submitForm"> </a-button>
</a-col>
</a-row>
</a-form>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jeecg/JFormContainer'
import JDate from '@/components/jeecg/JDate'
import JDictSelectTag from "@/components/dict/JDictSelectTag"
import JSwitch from '@/components/jeecg/JSwitch'
export default {
name: 'ProcessPermissionAuthorizationForm',
components: {
JFormContainer,
JDate,
JDictSelectTag,
JSwitch,
},
props: {
//data
formData: {
type: Object,
default: ()=>{},
required: false
},
//true false
formBpm: {
type: Boolean,
default: false,
required: false
},
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/processpermissionauthorization/processPermissionAuthorization/add",
edit: "/processpermissionauthorization/processPermissionAuthorization/edit",
queryById: "/processpermissionauthorization/processPermissionAuthorization/queryById"
}
}
},
computed: {
formDisabled(){
if(this.formBpm===true){
if(this.formData.disabled===false){
return false
}
return true
}
return this.disabled
},
showFlowSubmitButton(){
if(this.formBpm===true){
if(this.formData.disabled===false){
return true
}
}
return false
}
},
created () {
//data
this.showFlowData();
},
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,'company','createTime','sysOrgCode','createBy','authorizationPerson','authorizedPerson','privilegedTimeStart','privilegedTimeEnd','continueAuthorize','privilegedAffirmedTime','authorizationNumberDays','fileId'))
})
},
//
showFlowData(){
if(this.formBpm === true){
let params = {id:this.formData.dataId};
getAction(this.url.queryById,params).then((res)=>{
if(res.success){
this.edit (res.result);
}
});
}
},
submitForm () {
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);
console.log("表单提交数据",formData)
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;
})
}
})
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'company','createTime','sysOrgCode','createBy','authorizationPerson','authorizedPerson','privilegedTimeStart','privilegedTimeEnd','continueAuthorize','privilegedAffirmedTime','authorizationNumberDays','fileId'))
},
}
}
</script>

180
src/views/processmaterials/ProcessPermissionAuthorizationList.vue

@ -0,0 +1,180 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<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>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><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"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<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 @click="handleDetail(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>
</a-table>
</div>
<process-permission-authorization-modal ref="modalForm" @ok="modalFormOk"></process-permission-authorization-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ProcessPermissionAuthorizationModal from './modules/ProcessPermissionAuthorizationModal'
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
export default {
name: 'ProcessPermissionAuthorizationList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ProcessPermissionAuthorizationModal,
JSuperQuery,
},
data () {
return {
description: '权限授权流程管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/processpermissionauthorization/processPermissionAuthorization/list",
delete: "/processpermissionauthorization/processPermissionAuthorization/delete",
deleteBatch: "/processpermissionauthorization/processPermissionAuthorization/deleteBatch",
exportXlsUrl: "/processpermissionauthorization/processPermissionAuthorization/exportXls",
importExcelUrl: "processpermissionauthorization/processPermissionAuthorization/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.$set(this.dictOptions, 'continueAuthorize', [{text:'是',value:'Y'},{text:'否',value:'N'}])
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'company',text:'流程发起公司',dictCode:''})
fieldList.push({type:'date',value:'createTime',text:'流程发起时间'})
fieldList.push({type:'string',value:'sysOrgCode',text:'流程发起部门',dictCode:''})
fieldList.push({type:'string',value:'createBy',text:'流程发起人',dictCode:''})
fieldList.push({type:'string',value:'authorizationPerson',text:'授权人',dictCode:''})
fieldList.push({type:'string',value:'authorizedPerson',text:'被授权人',dictCode:''})
fieldList.push({type:'date',value:'privilegedTimeStart',text:'授权时间(开启时间)'})
fieldList.push({type:'date',value:'privilegedTimeEnd',text:'授权时间(结束时间)'})
fieldList.push({type:'switch',value:'continueAuthorize',text:'是否继续授权'})
fieldList.push({type:'string',value:'privilegedAffirmedTime',text:'授权时间(确认时间)',dictCode:''})
fieldList.push({type:'int',value:'authorizationNumberDays',text:'授权天数',dictCode:''})
fieldList.push({type:'string',value:'fileId',text:'文件id',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
Loading…
Cancel
Save