提交 650b5dca 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 05330d08
......@@ -81,6 +81,8 @@ import AppDepartmentSelect from './components/app-department-select/app-departme
import AppGroupSelect from './components/app-group-select/app-group-select.vue'
import UpdatePwd from './components/app-update-password/app-update-password.vue'
import AppMenuItem from './components/app-menu-item/app-menu-item.vue'
import AppFullScren from './components/app-full-scren/app-full-scren.vue'
import AppLockScren from './components/app-lock-scren/app-lock-scren.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载实体权限服务注册中心
......@@ -105,6 +107,8 @@ export const AppComponents = {
v.prototype.$verify = Verify;
v.prototype.$viewTool = ViewTool;
v.prototype.$uiActionTool = UIActionTool;
v.component('app-full-scren',AppFullScren);
v.component('app-lock-scren',AppLockScren);
v.component('input-box', InputBox);
v.component('app-keep-alive',AppKeepAlive);
v.component('tab-page-exp',TabPageExp);
......
import { Store } from 'vuex';
import store from '@/store';
/**
* 实体权限服务
*
......@@ -15,7 +14,16 @@ export default class AuthService {
* @type {(any | null)}
* @memberof AuthService
*/
public $store: Store<any> | null = null;
public $store: any;
/**
* 系统操作标识映射统一资源Map
*
* @public
* @type {Map<string,any>}
* @memberof AuthService
*/
public sysOPPrivsMap:Map<string,any> = new Map();
/**
* 默认操作标识
......@@ -24,7 +32,7 @@ export default class AuthService {
* @type {(any)}
* @memberof AuthService
*/
public defaultOPPrivs: any = { UPDATE: 1, CREATE: 1, READ: 1, DELETE: 1, WFSTART:1,DENY:1,NONE:1 };
public defaultOPPrivs: any = {CREATE: 1,DELETE: 1,DENY: 1,NONE: 1,READ: 1,UPDATE: 1,WFSTART: 1};
/**
* Creates an instance of AuthService.
......@@ -33,7 +41,8 @@ export default class AuthService {
* @memberof AuthService
*/
constructor(opts: any = {}) {
this.$store = opts.$store;
this.$store = store;
this.registerSysOPPrivs();
}
/**
......@@ -42,10 +51,27 @@ export default class AuthService {
* @returns {(any | null)}
* @memberof AuthService
*/
public getStore(): Store<any> | null {
public getStore(): any {
return this.$store;
}
/**
* 获取计算统一资源之后的系统操作标识
*
* @returns {}
* @memberof AuthService
*/
public getSysOPPrivs(){
let copySysOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(Object.keys(copySysOPPrivs).length === 0) return {};
Object.keys(copySysOPPrivs).forEach((name:any) =>{
if(this.sysOPPrivsMap.get(name)){
copySysOPPrivs[name] = this.getResourcePermission(this.sysOPPrivsMap.get(name))?1:0;
}
})
return copySysOPPrivs;
}
/**
* 获取实体权限服务
*
......@@ -57,6 +83,16 @@ export default class AuthService {
return (window as any)['authServiceRegister'].getService(name);
}
/**
* 注册系统操作标识统一资源
*
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof AuthService
*/
public registerSysOPPrivs(){
}
/**
* 根据当前数据获取实体操作标识
*
......@@ -76,7 +112,7 @@ export default class AuthService {
* @memberof AuthService
*/
public getMenusPermission(item: any): boolean {
return true;
return this.$store.getters['authresource/getAuthMenu'](item);
}
/**
......@@ -87,7 +123,7 @@ export default class AuthService {
* @memberof AuthService
*/
public getResourcePermission(tag: any): boolean {
return true;
return this.$store.getters['authresource/getResourceData'](tag);
}
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ export default class JobsInfoAuthServiceBase extends AuthService {
* @memberof JobsInfoAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
let curDefaultOPPrivs:any = this.getSysOPPrivs();
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
......
......@@ -27,7 +27,7 @@ export default class JobsLockAuthServiceBase extends AuthService {
* @memberof JobsLockAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
let curDefaultOPPrivs:any = this.getSysOPPrivs();
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
......
......@@ -27,7 +27,7 @@ export default class JobsLogAuthServiceBase extends AuthService {
* @memberof JobsLogAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
let curDefaultOPPrivs:any = this.getSysOPPrivs();
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
......
......@@ -27,7 +27,7 @@ export default class JobsRegistryAuthServiceBase extends AuthService {
* @memberof JobsRegistryAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
let curDefaultOPPrivs:any = this.getSysOPPrivs();
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
......
......@@ -2,9 +2,9 @@
<div class="app-actionbar">
<div class="app-actionbar-item" v-for="(item,index) in items" :key="index">
<Badge v-if="item.counterService&&item.counterService.counterData" v-show="item.visabled" :count="item.counterService.counterData[item.counterId]" type="primary">
<i-button :style="{'pointer-events':item.disabled?'none':'auto'}" @click="handleClick(item, $event)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
<i-button :disabled="item.disabled" @click="handleClick(item, $event)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
</Badge>
<i-button v-show="item.visabled" :style="{'pointer-events':item.disabled?'none':'auto'}" v-else @click="handleClick(item, $event)">{{item.actionName}}</i-button>
<i-button v-show="item.visabled" :disabled="item.disabled" v-else @click="handleClick(item, $event)">{{item.actionName}}</i-button>
</div>
</div>
</template>
......
......@@ -12,7 +12,7 @@
</div>
<template v-if="placeholder">
<div v-if="value" class="app-embed-value">
<span v-for="(item,index) in value" :key="index">
<span v-for="(item,index) in value.split(',')" :key="index">
{{item}}
</span>
</div>
......@@ -247,19 +247,21 @@ export default class AppEmbedPicker extends Vue {
* @memberof AppEmbedPicker
*/
public setValue(item: any) {
let selectsrfkey: Array<any> = [];
let selectsrfmajortext: Array<any> = [];
let srfkey: string = '';
let srfmajortext: string = '';
if(item && Array.isArray(item)){
item.forEach((select: any)=>{
selectsrfkey.push(select.srfkey);
selectsrfmajortext.push(select.srfmajortext);
srfkey += select.srfkey+",";
srfmajortext += select.srfmajortext+',';
})
srfkey = srfkey.substring(0,srfkey.length-1);
srfmajortext = srfmajortext.substring(0,srfmajortext.length-1);
if (this.valueItem) {
let value = selectsrfkey.length > 0 ? selectsrfkey : '';
let value = srfkey;
this.$emit('formitemvaluechange', { name: this.valueItem, value: value });
}
if (this.name) {
let value = selectsrfmajortext.length > 0 ? selectsrfmajortext : '';
let value = srfmajortext;
this.$emit('formitemvaluechange', { name: this.name, value: value });
}
}
......
......@@ -27,7 +27,7 @@
</a>
<dropdown-menu slot='list' v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<dropdown-item v-for="(detail,index) in (uiActionGroup.details)" :key="index" :name="detail.name">
<span class='item' v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto'}" @click="doUIAction($event, detail)">
<span class='item' v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto','color':detail.disabled?'#7b7979':'#2d8cf0'}" @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i>
......@@ -58,7 +58,7 @@
<span class='item-extract-mode'>
<template v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<div v-for="(detail,index) in uiActionGroup.details" :key="index">
<span v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto'}" class='item' @click="doUIAction($event, detail)">
<span v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto','color':detail.disabled?'#7b7979':'#2d8cf0'}" class='item' @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i>
......
<template>
<div class="fullscren">
<Icon :type="fullScren == true ? 'ios-contract' : 'ios-expand'" color="#aaa" size="22" @click="handleScreen"/>
</div>
</template>
<script lang = 'ts'>
import { Vue, Component, Prop, Model, Watch } from 'vue-property-decorator';
@Component({})
export default class AppFullScren extends Vue{
public fullScren: boolean = false;
public handleScreen(){
if(this.fullscreenEnable()){
this.exitFullScreen();
}else{
this.reqFullScreen();
}
}
/**
* 监控全屏状态和键盘
*/
public created(){
let _this = this;
window.onresize = function(){
if(_this.fullscreenEnable()){
_this.fullScren = true;
}else{
_this.fullScren = false;
}
};
window.addEventListener("keydown", this.keyDown, true);
}
/**
* 监控F11
*/
public keyDown($event: any){
if ($event.keyCode == 122) {
$event.returnValue = false;
this.fullScren = !this.fullScren;
this.handleScreen();
}
}
/**
* 浏览器判断是否全屏
*/
public fullscreenEnable(){
const isFullscreen = (document as any).isFullScreen || (document as any).mozIsFullScreen || (document as any).webkitIsFullScreen;
return isFullscreen;
}
/**
* 浏览器全屏
*/
public reqFullScreen(){
if ((document as any).documentElement.requestFullScreen) {
(document as any).documentElement.requestFullScreen();
} else if ((document as any).documentElement.webkitRequestFullScreen) {
(document as any).documentElement.webkitRequestFullScreen();
} else if ((document as any).documentElement.mozRequestFullScreen) {
(document as any).documentElement.mozRequestFullScreen();
}
};
/**
* 浏览器退出全屏
*/
public exitFullScreen(){
if ((document as any).documentElement.requestFullScreen) {
(document as any).exitFullScreen();
} else if ((document as any).documentElement.webkitRequestFullScreen) {
(document as any).webkitCancelFullScreen();
} else if ((document as any).documentElement.mozRequestFullScreen) {
(document as any).mozCancelFullScreen();
}
}
}
</script>
<style lang='less'>
.fullscren{
cursor:pointer;
padding: 0 5px;
}
.ivu-icon-ios-expand{
font-weight: bolder;
}
.ivu-icon-ios-contract{
font-weight: bolder;
}
</style>
\ No newline at end of file
<template>
<div class="lockscren">
<span>
<Icon type="md-lock" size="22" color="#aaa" @click="handleLock"/>
<el-dialog :title="this.$t('components.lockScren.title')"
:visible.sync="box"
width="30%"
append-to-body>
<el-form :model="form"
ref="form"
label-width="82px">
<el-form-item :label="this.$t('components.lockScren.label')"
prop="passwd"
:rules="[{ required: true, message: this.$t('components.lockScren.message')}]">
<el-input v-model="form.passwd"
:placeholder="this.$t('components.lockScren.placeholder')"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button type="primary" @click="handleSetLock">{{this.$t('components.lockScren.confirmButtonText')}}</el-button>
</span>
</el-dialog>
</span>
</div>
</template>
<script lang = 'ts'>
import { Vue, Component, Prop, Model, Watch } from 'vue-property-decorator';
@Component({})
export default class AppLockScren extends Vue{
/**
* 对话框状态
*/
public box: boolean = false;
/**
* 锁屏密码
*/
public form: any = {passwd: ''};
/**
* 用户名
*/
public user: any = {name: ''};
/**
* 点击锁屏图表展示对话框
*/
public handleLock(){
this.box = true;
}
/**
* 锁屏确认
*/
public handleSetLock(){
(this.$refs["form"] as any).validate((valid: any )=> {
if (valid) {
const username = this.user.name == '' ? 'visitor' : this.user.name;
const password = window.btoa(this.form.passwd);
const routerPath = window.btoa(this.$route.path);
sessionStorage.setItem('lockPassword',password);
sessionStorage.setItem('lockState','true');
sessionStorage.setItem('userName',username);
sessionStorage.setItem('routerPath',routerPath);
this.$router.push({ path: "/lock" });
}
});
}
/**
* 获取当前用户名
*
* @memberof AppUser
*/
public mounted() {
let _user:any = {};
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context && this.$store.getters.getAppData().context.srfusername){
_user.name = this.$store.getters.getAppData().context.srfusername;
}
if(localStorage.getItem("user")){
let user:any = JSON.parse(localStorage.getItem("user") as string);
if(user && user.personname){
_user.name = user.personname;
}
}
Object.assign(this.user,_user);
}
}
</script>
<style lang='less'>
.lockscren{
cursor:pointer;
padding: 0 5px;
}
</style>
\ No newline at end of file
.lock-container {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.title {
margin-bottom: 8px;
color: #333;
}
.el-icon-unlock{
font-size: 20px;
}
.el-icon-switch-button{
font-size: 20px;
}
}
.lock-container::before {
z-index: -999;
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-image: url("/assets/img/lock_login.png");
background-size: cover;
}
.lock-form {
width: 300px;
}
\ No newline at end of file
<template>
<div class="lock-container">
<div class="lock-form animated bounceInDown">
<div class="animated">
<h3 class="title">{{username}}</h3>
<el-input :placeholder="this.$t('components.lockScren.placeholder1')"
type="password"
class="input-with-select animated"
v-model="passwd">
<el-button slot="append"
icon="el-icon-unlock"
size="25px"
@click="handleLogin"></el-button>
<el-button slot="append"
icon="el-icon-switch-button"
size="25px"
@click="handleLogout"></el-button>
</el-input>
</div>
</div>
</div>
</template>
<script lang = 'ts'>
import { Vue, Component, Prop, Model, Watch } from 'vue-property-decorator';
@Component({})
export default class AppLockIndex extends Vue{
/**
* 输入密码
*/
public passwd: string = '';
/**
* 保存的密码
*/
public lockpasswd: string = '';
/**
* 用户名
*/
public username: string = '';
/**
* 锁屏前的页面路由
*/
public path: string = '';
/**
* 获取锁屏相关信息
*
* @memberof AppLockIndex
*/
public mounted() {
this.username = (sessionStorage.getItem('userName') as string);
this.lockpasswd = window.atob(sessionStorage.getItem('lockPassword') as string);
this.path = window.atob(sessionStorage.getItem('routerPath') as string);
}
/**
* 解除锁屏
*
* @memberof AppLockIndex
*/
public handleLogin(){
if(this.lockpasswd != this.passwd){
this.passwd = '';
this.$message({
message: (this.$t('components.lockScren.message1') as string),
type: "error"
});
return;
}
this.clearSession();
this.$router.push({ path: this.path});
}
/**
* 登出
*
* @memberof AppLockIndex
*/
public handleLogout(){
this.$confirm((this.$t('components.lockScren.promptInformation') as string), (this.$t('components.lockScren.prompt') as string), {
confirmButtonText: (this.$t('components.lockScren.confirmButtonText') as string),
cancelButtonText: (this.$t('components.lockScren.cancelButtonText') as string),
type: "warning"
}).then(() => {
this.clearSession();
const get: Promise<any> = this.$http.get('/v7/logout');
get.then((response:any) =>{
if (response && response.status === 200) {
localStorage.removeItem('user');
localStorage.removeItem('token');
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
this.$router.push({ name: 'login' });
}
}).catch((error: any) =>{
console.error(error);
})
});
}
/**
* 清除锁屏时生成的session
*/
public clearSession(){
sessionStorage.removeItem('lockPassword');
sessionStorage.removeItem('lockState');
sessionStorage.removeItem('userName');
sessionStorage.removeItem('routerPath');
}
}
</script>
<style lang='less'>
@import './app-lock.less';
</style>
\ No newline at end of file
......@@ -316,14 +316,22 @@ export default class AppPickerSelectView extends Vue {
this.keySet = [];
this.selectItems = [];
if (newVal) {
this.selectItems = JSON.parse(newVal);
this.selectItems.forEach((item: any) => {
this.keySet.push(item.srfkey);
let index = this.items.findIndex((i) => Object.is(i.srfkey, item.srfkey));
if (index < 0) {
this.items.push({ srfmajortext : item.srfmajortext, srfkey: item.srfkey });
}
});
if (!this.data || !this.valueitem || !this.data[this.valueitem]) {
this.$Notice.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.editor') as any)+this.name+(this.$t('components.appPickerSelectView.valueitemException') as any) });
}else{
let tempvalue: Array<any> = this.data[this.valueitem].split(',');
let temptext: Array<any> = newVal.split(',');
tempvalue.forEach((srfkey: any, index: number)=>{
this.selectItems.push({ srfmajortext : temptext[index], srfkey: srfkey });
});
this.selectItems.forEach((item: any) => {
this.keySet.push(item.srfkey);
let index = this.items.findIndex((i) => Object.is(i.srfkey, item.srfkey));
if (index < 0) {
this.items.push({ srfmajortext : item.srfmajortext, srfkey: item.srfkey });
}
});
}
}
let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = this.selectItems;
......@@ -376,23 +384,31 @@ export default class AppPickerSelectView extends Vue {
this.$emit('formitemvaluechange', { name: this.valueitem, value: tempvalue });
}
if (this.name) {
let tempvalue = $event[0][this.deMajorField] ? $event[0][this.deMajorField] : $event[0].srfmajortext;
this.$emit('formitemvaluechange', { name: this.name, value: tempvalue });
let temptext = $event[0][this.deMajorField] ? $event[0][this.deMajorField] : $event[0].srfmajortext;
this.$emit('formitemvaluechange', { name: this.name, value: temptext });
}
}else{
let selects: Array<any> = [];
let tempvalue: string = '';
let temptext: string = '';
if ($event && Array.isArray($event)) {
$event.forEach((select: any) => {
selects.push({ srfkey: select.srfkey, srfmajortext: select.srfmajortext });
let index = this.items.findIndex((item) => Object.is(item.srfkey, select.srfkey));
let srfkey = select[this.deKeyField] ? select[this.deKeyField] : select.srfkey;
tempvalue += srfkey+",";
let srfmajortext = select[this.deMajorField] ? select[this.deMajorField] : select.srfmajortext;
temptext += srfmajortext+",";
let index = this.items.findIndex((item) => Object.is(item.srfkey, srfkey));
if (index < 0) {
this.items.push({ srfmajortext : select.srfmajortext, srfkey: select.srfkey });
this.items.push({ srfmajortext : srfmajortext, srfkey: srfkey });
}
});
}
tempvalue = tempvalue.substring(0,tempvalue.length-1);
temptext = temptext.substring(0,temptext.length-1);
if(this.valueitem){
this.$emit('formitemvaluechange',{ name: this.valueitem, value: tempvalue });
}
if (this.name) {
let value = selects.length > 0 ? JSON.stringify(selects) : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
this.$emit('formitemvaluechange', { name: this.name, value: temptext });
}
}
}
......@@ -553,8 +569,18 @@ export default class AppPickerSelectView extends Vue {
}
});
}
let value = val.length > 0 ? JSON.stringify(val) : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
let tempvalue: string = '';
let temptext: string = '';
val.forEach((select: any)=>{
let srfkey = select[this.deKeyField] ? select[this.deKeyField] : select.srfkey;
tempvalue += srfkey+",";
let srfmajortext = select[this.deMajorField] ? select[this.deMajorField] : select.srfmajortext;
temptext += srfmajortext+",";
});
tempvalue = tempvalue.substring(0,tempvalue.length-1);
temptext = temptext.substring(0,temptext.length-1);
this.$emit('formitemvaluechange',{ name: this.valueitem, value: tempvalue });
this.$emit('formitemvaluechange', { name: this.name, value: temptext });
}
}
......
import MDViewEngine from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class TreeGridExViewEngine
* @extends {MDViewEngine}
*/
export default class TreeGridExViewEngine extends MDViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof TreeGridExViewEngine
*/
protected treegridex: any;
/**
* Creates an instance of TreeGridExViewEngine.
* @memberof TreeGridExViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof TreeGridExViewEngine
*/
public init(options: any = {}): void {
this.treegridex = options.treegridex;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof TreeGridExViewEngine
*/
public load(opts: any = {},isnotify:boolean=false): void {
if(!this.view.isformDruipart){
super.load(opts);
}else{
if(isnotify){
super.load(opts);
}
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof TreeGridExViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'treegridex')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof TreeGridExViewEngine
*/
public getMDCtrl(): any {
return this.treegridex;
}
/**
* 事件处理
*
* @param {string} eventName
* @param {*} args
* @memberof TreeGridExViewEngine
*/
public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'rowdblclick') && this.gridRowAllowActive(2)) {
this.doEdit(args);
return;
}
if (Object.is(eventName, 'selectionchange')) {
this.selectionChange(args);
if (this.gridRowAllowActive(1)) {
this.doEdit(args);
}
return;
}
super.MDCtrlEvent(eventName, args);
}
/**
* 表格是否被允许激活
*
* @param {number} mode
* @returns {boolean}
* @memberof TreeGridExViewEngine
*/
public gridRowAllowActive(mode: number): boolean {
return this.view.gridRowActiveMode === mode ? true : false;
}
}
\ No newline at end of file
......@@ -246,6 +246,18 @@ export default {
localUpload:'Local upload',
or:'Or',
imgMsg1:'Select from stock'
},
lockScren:{
title:'Set the password lock screen',
label:'password',
message:'The lock screen password cannot be empty',
placeholder:'Please enter the lock screen password',
placeholder1:'Please enter your login password',
message1: 'The unlock password is wrong. Please reenter it',
promptInformation:'Do you want to quit the system? Do you want to continue?',
prompt:'prompt',
confirmButtonText:'determine',
cancelButtonText:'cancel',
}
};
\ No newline at end of file
......@@ -247,5 +247,17 @@ export default {
localUpload:'本地上传',
or:'或',
imgMsg1:'从素材库选择'
},
lockScren:{
title:'设置锁屏密码',
label:'锁屏密码',
message:'锁屏密码不能为空',
placeholder:'请输入锁屏密码',
placeholder1:'请输入登录密码',
message1: '解锁密码错误,请重新输入',
promptInformation:'是否退出系统, 是否继续?',
prompt:'提示',
confirmButtonText:'确定',
cancelButtonText:'取消',
}
};
\ No newline at end of file
......@@ -33,6 +33,7 @@ mock.onGet('/appdata').reply((config: any) => {
// 当前用户条线代码
srfsectorbc:""
},
unires:["RESOURCE1","RESOURCE2"],
//当前用户所有组织部门标识
srforgsections:[{"srforgsectorid":"5bd1ecf4d3c31e31cb66373df56b852f","srforgsectorname":"项目一部"},{"srforgsectorid":"2ad1ecf4d3c31e31cb66373df56b852f","srforgsectorname":"项目二部"}]
}];
......
......@@ -11,5 +11,24 @@ export class FormButtonModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
this.disabled = opts.disabled;
this.uiaction = opts.uiaction;
}
/**
* 是否禁用
*
* @type {boolean}
* @memberof FormButtonModel
*/
public disabled:boolean = false;
/**
* 按钮对应的界面行为
*
* @type {*}
* @memberof FormButtonModel
*/
public uiaction:any;
}
\ No newline at end of file
......@@ -88,6 +88,7 @@
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave"
updateAction=""
removeAction="Remove"
......
......@@ -37,6 +37,7 @@
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave"
updateAction=""
removeAction="Remove"
......
......@@ -67,6 +67,7 @@
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave"
updateAction=""
removeAction="Remove"
......
......@@ -50,10 +50,14 @@ Vue.use(UserComponent);
Vue.use(PortletComponent);
router.beforeEach((to: any, from: any, next: any) => {
if (to.meta && !to.meta.ignoreAddPage) {
router.app.$store.commit('addPage', to);
if(sessionStorage.getItem('lockState') && to.path != '/lock'){
next({ path: '/lock'});
}else{
if (to.meta && !to.meta.ignoreAddPage) {
router.app.$store.commit('addPage', to);
}
next();
}
next();
});
Interceptors.getInstance(router,store);
......
......@@ -216,6 +216,20 @@ const router = new Router({
},
component: () => import('@components/login/login.vue'),
},
{
path: '/lock',
name: 'lock',
meta: {
caption: '锁屏',
viewType: 'lock',
requireAuth: false,
ignoreAddPage: true,
},
beforeEnter: (to: any, from: any, next: any) => {
next();
},
component: () => import('@components/app-lock/app-lock.vue'),
},
{
path: '/404',
component: () => import('@components/404/404.vue')
......
......@@ -44,6 +44,8 @@
<app-lang style='font-size: 15px;padding: 0 10px;'></app-lang>
<app-orgsector></app-orgsector>
<app-user></app-user>
<app-lock-scren />
<app-full-scren />
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
</div>
</header>
......
......@@ -38,6 +38,10 @@
.el-table th {
padding: 5px 0;
}
.el-table th.gutter:last-of-type {
display: block !important;
width: 10px !important;
}
.grid .el-table__body-wrapper .el-table__row td{
border-left: 1px solid rgb(245,245,245);
border-top: 1px solid rgb(245,245,245);
......@@ -116,7 +120,7 @@
> .ivu-card-body {
// height: 50%;
// flex-grow: 1;
height: calc(100% - 62px);
height: calc(100% - 74px);
padding: 0px;
> .content-container {
height: 100%;
......
......@@ -441,11 +441,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
* @public
* @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase
*/
public onFormLoad(data: any = {}): void {
public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data);
this.fillForm(data);
this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null });
}
......@@ -453,15 +454,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充
*
* @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase
*/
public fillForm(_datas: any = {}): void {
public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name];
}
});
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
......@@ -484,6 +489,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
});
}
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/**
* 重置草稿表单状态
*
......@@ -700,7 +712,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data);
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
......@@ -744,7 +755,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data);
this.onFormLoad(data,'loadDraft');
setTimeout(() => {
const form: any = this.$refs.form;
if (form) {
......
......@@ -1425,6 +1425,26 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[name] = value;
}
/**
* 计算表单按钮权限状态
*
* @param {*} [data] 传入数据
* @memberof MainBase
*/
public computeButtonState(data:any){
let targetData:any = this.transformData(data);
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService);
this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
}
})
}
}
/**
......@@ -1599,6 +1619,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'load');
this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......@@ -1642,6 +1663,7 @@ export default class MainBase extends Vue implements ControlInterface {
this.onFormLoad(data,'loadDraft');
data.jobsinfo = null;
this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......@@ -1699,6 +1721,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'autoSave');
this.$emit('save', data);
this.computeButtonState(data);
AppCenterService.notifyMessage({name:"JobsInfo",action:'appRefresh',data:data});
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......@@ -1777,6 +1800,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'save');
this.$emit('save', data);
this.computeButtonState(data);
AppCenterService.notifyMessage({name:"JobsInfo",action:'appRefresh',data:data});
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......
......@@ -8,7 +8,7 @@
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName"
:cell-class-name="getCellClassName"
:height="isEnablePagingBar && items.length > 0 ? 'calc(100% - 50px)' : '100%'"
max-height="items.length > 0 ? 'calc(100%-50px)' : '100%'"
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
......@@ -382,6 +382,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase
*/
@Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 显示处理提示
......@@ -1607,7 +1615,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0){
if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
......
......@@ -67,13 +67,14 @@
}
}
.el-table__header-wrapper{
display: contents;
}
.el-table__body-wrapper{
height: auto !important;
min-height: 45px;
max-height: 100px;
height: auto;
}
.el-table__footer-wrapper{
display: contents;
min-height: 45px;
max-height: 100px;
height: auto;
}
}
.grid-pagination {
......
......@@ -435,11 +435,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
* @public
* @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase
*/
public onFormLoad(data: any = {}): void {
public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data);
this.fillForm(data);
this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null });
}
......@@ -447,15 +448,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充
*
* @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase
*/
public fillForm(_datas: any = {}): void {
public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name];
}
});
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
......@@ -478,6 +483,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
});
}
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/**
* 重置草稿表单状态
*
......@@ -694,7 +706,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data);
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
......@@ -738,7 +749,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data);
this.onFormLoad(data,'loadDraft');
setTimeout(() => {
const form: any = this.$refs.form;
if (form) {
......
......@@ -1236,6 +1236,26 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[name] = value;
}
/**
* 计算表单按钮权限状态
*
* @param {*} [data] 传入数据
* @memberof MainBase
*/
public computeButtonState(data:any){
let targetData:any = this.transformData(data);
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService);
this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
}
})
}
}
/**
......@@ -1410,6 +1430,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'load');
this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......@@ -1453,6 +1474,7 @@ export default class MainBase extends Vue implements ControlInterface {
this.onFormLoad(data,'loadDraft');
data.jobslog = null;
this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......@@ -1510,6 +1532,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'autoSave');
this.$emit('save', data);
this.computeButtonState(data);
AppCenterService.notifyMessage({name:"JobsLog",action:'appRefresh',data:data});
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......@@ -1588,6 +1611,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'save');
this.$emit('save', data);
this.computeButtonState(data);
AppCenterService.notifyMessage({name:"JobsLog",action:'appRefresh',data:data});
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......
......@@ -8,7 +8,7 @@
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName"
:cell-class-name="getCellClassName"
:height="isEnablePagingBar && items.length > 0 ? 'calc(100% - 50px)' : '100%'"
max-height="items.length > 0 ? 'calc(100%-50px)' : '100%'"
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
......@@ -368,6 +368,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase
*/
@Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 显示处理提示
......@@ -1577,7 +1585,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0){
if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
......
......@@ -67,13 +67,14 @@
}
}
.el-table__header-wrapper{
display: contents;
}
.el-table__body-wrapper{
height: auto !important;
min-height: 45px;
max-height: 100px;
height: auto;
}
.el-table__footer-wrapper{
display: contents;
min-height: 45px;
max-height: 100px;
height: auto;
}
}
.grid-pagination {
......
......@@ -405,11 +405,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
* @public
* @param {*} [data={}]
* @param {string} [action]
* @memberof DefaultBase
*/
public onFormLoad(data: any = {}): void {
public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data);
this.fillForm(data);
this.fillForm(data,action);
this.formLogic({ name: '', newVal: null, oldVal: null });
}
......@@ -417,15 +418,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 值填充
*
* @param {*} [_datas={}]
* @param {string} [action]
* @memberof DefaultBase
*/
public fillForm(_datas: any = {}): void {
public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name];
}
});
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
......@@ -448,6 +453,13 @@ export default class DefaultBase extends Vue implements ControlInterface {
});
}
/**
* 新建默认值
* @memberof DefaultBase
*/
public createDefault(){
}
/**
* 重置草稿表单状态
*
......@@ -664,7 +676,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
get.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.onFormLoad(data);
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
......@@ -708,7 +719,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
const data = response.data;
this.resetDraftFormStates();
this.onFormLoad(data);
this.onFormLoad(data,'loadDraft');
setTimeout(() => {
const form: any = this.$refs.form;
if (form) {
......
......@@ -1044,6 +1044,26 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[name] = value;
}
/**
* 计算表单按钮权限状态
*
* @param {*} [data] 传入数据
* @memberof MainBase
*/
public computeButtonState(data:any){
let targetData:any = this.transformData(data);
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService);
this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
}
})
}
}
/**
......@@ -1218,6 +1238,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'load');
this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......@@ -1261,6 +1282,7 @@ export default class MainBase extends Vue implements ControlInterface {
this.onFormLoad(data,'loadDraft');
data.jobsregistry = null;
this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
});
......@@ -1318,6 +1340,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'autoSave');
this.$emit('save', data);
this.computeButtonState(data);
AppCenterService.notifyMessage({name:"JobsRegistry",action:'appRefresh',data:data});
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......@@ -1396,6 +1419,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'save');
this.$emit('save', data);
this.computeButtonState(data);
AppCenterService.notifyMessage({name:"JobsRegistry",action:'appRefresh',data:data});
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......
......@@ -8,7 +8,7 @@
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName"
:cell-class-name="getCellClassName"
:height="isEnablePagingBar && items.length > 0 ? 'calc(100% - 50px)' : '100%'"
max-height="items.length > 0 ? 'calc(100%-50px)' : '100%'"
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
......@@ -322,6 +322,14 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof MainBase
*/
@Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof MainBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 显示处理提示
......@@ -1507,7 +1515,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0){
if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
......
......@@ -67,13 +67,14 @@
}
}
.el-table__header-wrapper{
display: contents;
}
.el-table__body-wrapper{
height: auto !important;
min-height: 45px;
max-height: 100px;
height: auto;
}
.el-table__footer-wrapper{
display: contents;
min-height: 45px;
max-height: 100px;
height: auto;
}
}
.grid-pagination {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册