| | |
| | | import request from '@/router/axios'; |
| | | import website from "@/config/website"; |
| | | |
| | | export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key) => request({ |
| | | export const loginByUsername = (tenantId, deptId, roleId, userId, password, type, key) => request({ |
| | | url: '/api/framework/loginController/login', |
| | | method: 'post', |
| | | headers: { |
| | |
| | | }, |
| | | params: { |
| | | tenantId, |
| | | username, |
| | | userId, |
| | | password, |
| | | grant_type: (website.captchaMode ? "captcha" : "password"), |
| | | scope: "all", |
| | |
| | | import {paramLow,callPreEvent, callPostEvent} from '../BaseAction'; |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | import workActionDialog from "@/components/actions/base/startWorkFlow" |
| | | |
| | | |
| | | export const doAction = (options,callback) => { |
| | | options.sourceData = options.sourceData || {}; |
| | | options.dataStore = options.dataStore || []; |
| | | if (!options.dataStore || options.dataStore.length < 1) { |
| | | Vue.prototype.$message.error("è¯·éæ©éè¦åèµ·æµç¨çæ°æ®"); |
| | | return false; |
| | | } |
| | | if (!options.paramVOS.multi && options.dataStore.length > 1) { |
| | | Vue.prototype.$message.error("ä»
è½éæ©ä¸æ¡æ°æ®åèµ·æµç¨"); |
| | | return false; |
| | | } |
| | | |
| | | //éªè¯ä¸å
许å¯å¨çæ¡ä»¶ |
| | | if(!validatenull(options.paramVOS.checknotprocess)) { |
| | | let notprocess = options.paramVOS.checknotprocess.split('&'); |
| | | let checknotprocess=false; |
| | | notprocess.forEach((item,i)=>{ |
| | | if (options.dataStore[0][item.split('=')[0]] == item.split('=')[1]) { |
| | | checknotprocess=true; |
| | | return false; |
| | | } |
| | | }) |
| | | if (checknotprocess) { |
| | | Vue.prototype.$message.error(replaceFreeMarker(options.paramVOS.checknotprocessmsg,options.dataStore,{}) || "å½åæ°æ®ä¸å
许åèµ·æµç¨"); |
| | | return false; |
| | | } |
| | | } |
| | | // if (!options.dataStore || options.dataStore.length < 1) { |
| | | // Vue.prototype.$message.error("è¯·éæ©éè¦åèµ·æµç¨çæ°æ®"); |
| | | // return false; |
| | | // } |
| | | // if (!options.paramVOS.multi && options.dataStore.length > 1) { |
| | | // Vue.prototype.$message.error("ä»
è½éæ©ä¸æ¡æ°æ®åèµ·æµç¨"); |
| | | // return false; |
| | | // } |
| | | // |
| | | // //éªè¯ä¸å
许å¯å¨çæ¡ä»¶ |
| | | // if(!validatenull(options.paramVOS.checknotprocess)) { |
| | | // let notprocess = options.paramVOS.checknotprocess.split('&'); |
| | | // let checknotprocess=false; |
| | | // notprocess.forEach((item,i)=>{ |
| | | // if (options.dataStore[0][item.split('=')[0]] == item.split('=')[1]) { |
| | | // checknotprocess=true; |
| | | // return false; |
| | | // } |
| | | // }) |
| | | // if (checknotprocess) { |
| | | // Vue.prototype.$message.error(replaceFreeMarker(options.paramVOS.checknotprocessmsg,options.dataStore,{}) || "å½åæ°æ®ä¸å
许åèµ·æµç¨"); |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | showStartWindow(options, function () { |
| | |
| | | */ |
| | | export const showStartWindow = (options,callback)=> { |
| | | const paramVOS = options.paramVOS; |
| | | // if (!paramVOS['form'] && !paramVOS['context']) { |
| | | // Vue.prototype.$message.error("æé®é
ç½®ä¸æ£ç¡®"); |
| | | // return false; |
| | | // } |
| | | |
| | | const dialogConstructor = Vue.extend(workActionDialog); |
| | | let instance = new dialogConstructor(); |
| | | instance.sourceData = options.sourceData; |
| | | instance.dataStore = options.dataStore; |
| | | instance.paramVOS = paramVOS |
| | | |
| | | instance.dialogClose = function () { |
| | | vm.visible = false; |
| | | document.body.removeChild(vm.$el); |
| | | instance.$destroy(); |
| | | instance = null; |
| | | }; |
| | | if (callback) { |
| | | instance.saveCallback = callback; |
| | | } |
| | | let vm = instance.$mount(); |
| | | document.body.appendChild(vm.$el); |
| | | instance.visible = true; |
| | | |
| | | } |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-dialogDrag |
| | | append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :visible.sync="visible" |
| | | :width="width" |
| | | class="avue-dialog" |
| | | title="å¯å¨æµç¨" |
| | | top="0" |
| | | style="margin-top: -10% !important;" |
| | | @close="dialogClose"> |
| | | |
| | | <el-form :model="saveParam" :rules="rules" class="demo-form-inline" label-position="left" label-width="auto"> |
| | | <el-form-item label="æµç¨æ¨¡æ¿"> |
| | | <el-input v-model="saveParam.modelName" disabled placeholder="æµç¨æ¨¡æ¿"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨åç§°" prop="processName"> |
| | | <el-input v-model="saveParam.processName" placeholder="æµç¨åç§°"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨æè¿°"> |
| | | <el-input v-model="saveParam.processDesc" :rows="4" placeholder="æµç¨æè¿°" type="textarea"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-divider></el-divider> |
| | | <div class="btns-icon"> |
| | | <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button> |
| | | </div> |
| | | <el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto"> |
| | | <el-form-item v-for="(item, index) in initFrom" :key="index" :label="item.taskName"> |
| | | <el-select v-model="collectParam.flowTaskUsers[index]['userId']" :placeholder="item.taskName" filterable |
| | | style="width: 100%;" @change="handleSelect($event, index)"> |
| | | <el-option v-for="(key, keyi) in typeName" :key="keyi" :label="key.userNames" |
| | | :value="key.userId"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleCancel">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {validatenull} from "@/util/validate"; |
| | | |
| | | export default { |
| | | name: "startWorkFlow", |
| | | props: { |
| | | paramVOS: { |
| | | type: Object, |
| | | default: {} |
| | | }, |
| | | sourceData: { |
| | | //æå±åºåçä¸ä¸åºåé䏿°æ® |
| | | type: Object, |
| | | default: {} |
| | | }, |
| | | dataStore: { |
| | | //å¼¹çªæ¶æé®æå±åºåé䏿°æ® |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | saveParam: {}, |
| | | users: [], |
| | | collectParam: {}, |
| | | initFrom: [], |
| | | typeName: [], |
| | | } |
| | | }, |
| | | watch: { |
| | | users: { |
| | | handler(val) { |
| | | this.collectParam.flowTaskUsers = val |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | parameter: { |
| | | handler(newval, oldval) { |
| | | this.saveParam = Object.assign({processName: '', processDesc: ''}, newval); |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | computed: { |
| | | fullscreen() { |
| | | if (this.paramVOS.width || this.paramVOS.height) { |
| | | return false; |
| | | } else if (this.paramVOS.form) { |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | width() { |
| | | if (!validatenull(this.paramVOS.width)) { |
| | | if (this.paramVOS.width.includes("px") || this.paramVOS.width.includes("%")) { |
| | | return this.paramVOS.width; |
| | | } else { |
| | | return this.paramVOS.width + "px"; |
| | | } |
| | | } else { |
| | | return "40%"; |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // å
³éå¼¹çª |
| | | dialogClose() { |
| | | this.visible = false; |
| | | }, |
| | | |
| | | handleSelect() { |
| | | |
| | | }, |
| | | |
| | | handleCollect() { |
| | | |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.dialogClose(); |
| | | }, |
| | | |
| | | handleConfirm() { |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | |
| | | rev: () => {import("@/components/actions/base/RevisionAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //å¯å¨æµç¨ |
| | | launchworkflow: () => {import("@/components/actions/base/StartWorkflowAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | }; |
| | | if (handlers[type]) { |
| | | handlers[type]() |
| | |
| | | <div v-if="type === 'table' || type === 'TreeTable'"> |
| | | <!--topå±ç¤ºè¡¨æ ¼ä¸æ¹åºå menuå±ç¤ºè¡¨æ ¼æä½æ åºå æ å°±æ¯é»è®¤ --> |
| | | <el-tooltip v-if="LocationType === 'top'" v-for="item in basicButtonList.top" :content="item.description || item.name" placement="top"> |
| | | <el-button :key="item.oid" :icon="item.paramVOS.icon" |
| | | :type="item.paramVOS.btnType || 'primary'" plain |
| | | <el-button :key="item.oid" |
| | | :icon="item.paramVOS && item.paramVOS.icon ? item.paramVOS.icon :''" |
| | | :type="item.paramVOS && item.paramVOS.btnType ? item.paramVOS.btnType : 'primary'" plain |
| | | size="small" |
| | | @click="buttonClick(item)">{{ item.name }}</el-button> |
| | | </el-tooltip> |
| | |
| | | <div v-else-if="type === 'form'"> |
| | | <el-tooltip v-for="item in basicButtonList" :content="item.description || item.name" placement="top"> |
| | | <el-button :key="item.oid" |
| | | :icon="item.paramVOS.icon" |
| | | :type="item.paramVOS.btnType || 'primary'" |
| | | :icon="item.paramVOS && item.paramVOS.icon ? item.paramVOS.icon :''" |
| | | :type="item.paramVOS && item.paramVOS.btnType ? item.paramVOS.btnType : 'primary'" plain |
| | | plain |
| | | size="small" |
| | | @click="buttonClick(item)">{{ item.name }}</el-button> |
| | |
| | | <div v-else-if="type === 'tree'" class="tree-buttons"> |
| | | <el-tooltip v-for="item in basicButtonList" :content="item.description || item.name" placement="top"> |
| | | <el-button :key="item.oid" |
| | | :icon="item.paramVOS.icon" |
| | | :type="item.paramVOS.btnType || 'primary'" |
| | | :icon="item.paramVOS && item.paramVOS.icon ? item.paramVOS.icon :''" |
| | | :type="item.paramVOS && item.paramVOS.btnType ? item.paramVOS.btnType : 'primary'" plain |
| | | plain |
| | | size="small" |
| | | @click="buttonClick(item)">{{ item.name }}</el-button> |
| | |
| | | @keyup.enter.native="handleLogin"> |
| | | <top-color v-show="false"></top-color> |
| | | <div class="login-weaper animated bounceInDown"> |
| | | <div class="login-left"> |
| | | <div class="login-time"> |
| | | {{time}} |
| | | </div> |
| | | <p class="title">{{ $t('login.info') }}</p> |
| | | <div style="font-size: 15px"> |
| | | <span>----------------------------------------------</span> |
| | | <br> |
| | | <span>管çç§æ·ç¼å·ï¼000000</span> |
| | | <br> |
| | | <span>è¶
级管çåè´¦å·: admin / admin</span> |
| | | <br> |
| | | <span>人äºè´¦å·: hr / hr</span> |
| | | <br> |
| | | <span>ç»çè´¦å·: manager / manager</span> |
| | | <br> |
| | | <span>èæ¿è´¦å·: boss / boss</span> |
| | | <br> |
| | | <span>----------------------------------------------</span> |
| | | <br> |
| | | <span>æ®éç§æ·ç¼å·ï¼è¯¦è§ç§æ·ç®¡ç模å</span> |
| | | <br> |
| | | <span>ç§æ·ç®¡çåè´¦å·: admin / admin</span> |
| | | <br> |
| | | <span>----------------------------------------------</span> |
| | | </div> |
| | | <!--<img class="img" src="/img/logo.png" alt="">--> |
| | | </div> |
| | | <div class="login-border"> |
| | | <div class="login-main"> |
| | | <h4 class="login-title"> |
| | |
| | | </h4> |
| | | <userLogin v-if="activeName==='user'"></userLogin> |
| | | <thirdLogin v-else-if="activeName==='third'"></thirdLogin> |
| | | <div class="login-menu"> |
| | | <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a> |
| | | <!--<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>--> |
| | | <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a> |
| | | <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="login-bg-image"> |
| | | <el-image |
| | | style="width: 20vw; height: 44vh" |
| | | :src="require('../../../public/img/Group.png')" |
| | | fit="fill"></el-image> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | <style lang="scss" scoped> |
| | | .login-container { |
| | | background: #fff url('../../../public/img/login-background.png')no-repeat center; |
| | | background-size: 100% 100%; /* æè
background-size: 100% 100%; */ |
| | | } |
| | | .login-bg-image{ |
| | | position: fixed; |
| | | left: 10%; |
| | | top: 35%; |
| | | |
| | | } |
| | | </style> |
| | |
| | | } |
| | | this.$router.push({path: this.tagWel.value}); |
| | | loading.close(); |
| | | }).catch(() => { |
| | | }).catch((err) => { |
| | | console.log('err',err) |
| | | loading.close(); |
| | | |
| | | }); |
| | |
| | | //æ ¹æ®ç¨æ·åç»å½ |
| | | LoginByUsername({commit}, userInfo) { |
| | | return new Promise((resolve, reject) => { |
| | | loginByUsername(userInfo.tenantId, userInfo.deptId, userInfo.roleId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key,).then(res => { |
| | | loginByUsername(userInfo.tenantId, userInfo.deptId, userInfo.roleId, userInfo.username, userInfo.password, userInfo.type, userInfo.key,).then(res => { |
| | | const data = res.data; |
| | | if (data.success) { |
| | | commit('SET_TOKEN', data.obj.sessionInfo.token); |
| | | commit('SET_REFRESH_TOKEN', data.obj.sessionInfo.token); |
| | | commit('SET_TENANT_ID', data.tenant_id); |
| | | commit('SET_USER_INFO', data.obj.sessionInfo); |
| | | if (data.code === 200) { |
| | | commit('SET_TOKEN', data.obj.tokenVO.accessToken); |
| | | commit('SET_REFRESH_TOKEN', data.obj.tokenVO.accessToken); |
| | | // commit('SET_TENANT_ID', data.tenant_id); |
| | | // commit('SET_USER_INFO', data.obj.sessionInfo); ç¨æ·ä¿¡æ¯ |
| | | commit('DEL_ALL_TAG'); |
| | | commit('CLEAR_LOCK'); |
| | | } else { |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0 auto; |
| | | background-image: url("/img/bg/bg.jpg"); |
| | | background-size: 100% 100%; |
| | | } |
| | | |
| | | .login-weaper { |
| | | margin: 0 auto; |
| | | width: 1000px; |
| | | box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.4); |
| | | |
| | | width: 500px; |
| | | border-radius: 20px; |
| | | background-color: rgba(256, 256, 256, 0.6); |
| | | box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.3); |
| | | .el-input-group__append { |
| | | border: none; |
| | | } |
| | |
| | | font-size: 30px; |
| | | letter-spacing: 2px; |
| | | } |
| | | |
| | | .login-border { |
| | | border-left: none; |
| | | border-top-right-radius: 5px; |
| | | border-bottom-right-radius: 5px; |
| | | color: #fff; |
| | | background-color: #fff; |
| | | width: 50%; |
| | | float: left; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .login-main { |
| | | margin: 0 auto; |
| | | width: 65%; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud ref="crud" |
| | | v-model="form" |
| | | :before-open="beforeOpen" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @row-click="selectedRowClick" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button v-if="hasUpload" icon="el-icon-upload2" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="handleUpload">ä¸ ä¼ |
| | | </el-button> |
| | | <el-button v-if="hasEdit" icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="handleEdit">ä¿® æ¹ |
| | | </el-button> |
| | | <el-button v-if="hasDownload" icon="el-icon-download" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="handleDownload">ä¸ è½½ |
| | | </el-button> |
| | | <el-button v-if="hasDel" icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="handleDelete">å é¤ |
| | | </el-button> |
| | | </template> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="hasDownload" icon="el-icon-download" |
| | | size="small" |
| | | type="text" |
| | | @click="handleDownload(scope.row)">ä¸è½½ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog :visible.sync="attachBox" |
| | | append-to-body |
| | | title="é件管ç" |
| | | width="555px"> |
| | | <avue-form ref="form" v-model="attachForm" :option="attachOption" :upload-after="uploadAfter" |
| | | :upload-before="uploadBefore" :upload-error="uploadError"> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | // import {getList, getFile, upload, update, remove, download} from "@/api/resource/file"; |
| | | import {validatenull} from "@/util/validate"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "testFileTable", |
| | | // props: ["options", "ownbizOid"], |
| | | props:{ |
| | | options:{ |
| | | type:Object, |
| | | default:{} |
| | | }, |
| | | ownbizOid:{ |
| | | type:String, |
| | | default: "" |
| | | }, |
| | | sourceData:{ |
| | | type:Array, |
| | | default:[] |
| | | } |
| | | }, |
| | | /** |
| | | * 馿¬¡å è½½ç¶çº§è¡¨æ ¼å¦æä¸ºç©º ä¼ çé»è®¤æ¡ä»¶ |
| | | currentButtonKey: VIEW |
| | | ownbizOid: share |
| | | ownBtmName: share |
| | | fileDocClassify: ADMIN_SHARE |
| | | fileDocClassifyName: 管çåå
±äº«æä»¶ |
| | | page: 1 |
| | | limit: 10 |
| | | **/ |
| | | /** |
| | | *馿¬¡å è½½ç¶çº§è¡¨æ ¼å¦æå卿°æ® å è¡¨æ ¼è¡å
¨é ä¼ çé»è®¤æ¡ä»¶ |
| | | currentButtonKey: VIEW |
| | | ownbizOid: 0 // åé éæ©å½åè¡ä¼ å½åè¡id |
| | | ownBtmName: 0 // åé éæ©å½åè¡ä¼ å½ååç±»åç§° |
| | | fileDocClassify: !=processAuditSuggest |
| | | fileDocClassifyName: 管çåå
±äº«æä»¶ |
| | | page: 1 |
| | | limit: 10 |
| | | */ |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | params: {}, |
| | | loading: false, |
| | | // hasPage: this.options.hasPage || false, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | | //é»è®¤ä¸ºnullå
¨é¨æ¯true |
| | | hasUpload: validatenull(this.options.hasUpload) ? true : this.options.hasUpload, |
| | | hasEdit: validatenull(this.options.hasEdit) ? true : this.options.hasEdit, |
| | | hasDel: validatenull(this.options.hasDel) ? true : this.options.hasDel, |
| | | hasDownload: validatenull(this.options.hasDownload) ? true : this.options.hasDownload, |
| | | option: { |
| | | height: (this.options.tableHeight ? this.options.tableHeight : '300'), |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: false, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | refreshBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | addBtn:false, |
| | | column: [ |
| | | { |
| | | label: "æä»¶åç§°", |
| | | prop: "name", |
| | | search: true, |
| | | }, |
| | | { |
| | | label: "æä»¶å¤§å°", |
| | | prop: "fileSize", |
| | | formatter: function (d) { |
| | | if (!d.fileSize || d.fileSize == null || d.fileSize * 1 == 0 || isNaN(d.fileSize * 1)) { |
| | | return "æªç¥å¤§å°"; |
| | | } else { |
| | | //åå§å¤§å°æ¯B |
| | | var filesize = d.fileSize * 1; |
| | | if (filesize > 1024 * 1024 * 1024 * 1024) { |
| | | return parseInt(filesize / (1024 * 1024 * 1024 * 1024)) + "TB"; |
| | | } else if (filesize > 1024 * 1024 * 1024) { |
| | | return parseInt(filesize / (1024 * 1024 * 1024)) + "GB"; |
| | | } else if (filesize > 1024 * 1024) { |
| | | return parseInt(filesize / (1024 * 1024)) + "MB"; |
| | | } else if (filesize > 1024) { |
| | | return parseInt(filesize / 1024) + "KB"; |
| | | } else { |
| | | return filesize + "B"; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | label: "å建è
", |
| | | prop: "creator" |
| | | }, |
| | | { |
| | | label: "å建æ¶é´", |
| | | prop: "createTime" |
| | | }, |
| | | ] |
| | | }, |
| | | columnType: { |
| | | text: "input", |
| | | combox: "select", |
| | | truefalse: "switch", |
| | | number: "number", |
| | | textarea: "textarea", |
| | | datetime: "datetime", |
| | | date: "date", |
| | | refer: "refer", |
| | | }, |
| | | data: [], |
| | | attachForm: {}, |
| | | attachOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [{ |
| | | prop: 'fileDocClassify', |
| | | label: 'æä»¶ç±»å', |
| | | props: { |
| | | label: 'value', |
| | | value: 'key' |
| | | }, |
| | | change: () => { |
| | | (!!this.options.fileDocClassifyCombox) && this.changeFun('fileDocClassify'); |
| | | }, |
| | | blur: () => { |
| | | (!this.options.fileDocClassifyCombox) && this.changeFun('fileDocClassify'); |
| | | }, |
| | | value: this.options.fileDocClassify || "ADMIN_SHARE", |
| | | type: (!this.options.fileDocClassifyCombox) ? 'input' : 'select', |
| | | dicData: (this.options.fileDocClassifyCombox || []),//[{key: 'text', value: 'ææ¬æ¡'}] |
| | | display: (!!this.options.fileDocClassifyCombox) |
| | | }, { |
| | | label: 'éä»¶ä¸ä¼ ', |
| | | prop: 'attachFile', |
| | | type: 'upload', |
| | | dragFile: true, |
| | | showFileList: false, |
| | | accept: this.options.uploadAccept || 'file', |
| | | loadText: 'æä»¶ä¸ä¼ ä¸ï¼è¯·ç¨ç', |
| | | span: 24, |
| | | propsHttp: { |
| | | res: 'data' |
| | | }, |
| | | data: { |
| | | ownbizOid: this.options.ownbizOid || "share", |
| | | ownBtmName: this.options.ownbizBtm || "share", |
| | | fileDocClassify: this.options.fileDocClassify || "ADMIN_SHARE", |
| | | fileDocClassifyName: this.options.fileDocClassifyName || "管çåå
±äº«æä»¶" |
| | | }, |
| | | action: "/api/ubcs-resource/fileController/uploadFile" |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | oids() { |
| | | let oids = []; |
| | | this.selectionList.forEach(ele => { |
| | | oids.push(ele.oid); |
| | | }); |
| | | return oids.join(","); |
| | | } |
| | | }, |
| | | created() { |
| | | this.setFormItem(); |
| | | this.setParams() |
| | | }, |
| | | mounted() { |
| | | console.log('sourceData',this.sourceData) |
| | | }, |
| | | watch: { |
| | | ownbizOid(val) { |
| | | this.setParams() |
| | | this.refreshChange() |
| | | }, |
| | | }, |
| | | methods: { |
| | | setFormItem() { |
| | | /*this.options.formItems=[{ |
| | | field: 'fileDocClassify11', |
| | | title: 'æä»¶ç±»å', |
| | | type: 'combox', |
| | | data: [{key: 'text', value: 'ææ¬æ¡'},{key: 'number', value: 'æ°åæ¡'}] |
| | | }]*/ |
| | | if (this.options && this.options.formItems) { |
| | | this.options.formItems.forEach(item => { |
| | | // è®¾ç½®è¡¨åæ ¡éªçè§åï¼ææ¬ |
| | | let message = "è¯·éæ©"; |
| | | let trigger = "change"; |
| | | if (item.type === "text") { |
| | | message = "请è¾å
¥"; |
| | | trigger = "blur"; |
| | | } |
| | | this.attachOption.column.push({ |
| | | ...item, |
| | | label: item.title, |
| | | prop: item.field, |
| | | display: !item.hidden, |
| | | value: item.defaultValue, |
| | | disabled: item.readOnly, |
| | | type: this.columnType[item.type], |
| | | dicData: this.getDataList(item.type, item.data), |
| | | change: () => { |
| | | if (item.type !== "text" && item.type !== "number" && item.type !== "textarea") { |
| | | this.changeFun(item.field); |
| | | } |
| | | }, |
| | | blur: () => { |
| | | if (item.type == "text" || item.type == "number" || item.type == "textarea") { |
| | | this.changeFun(item.field); |
| | | } |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: item.required, |
| | | message: `请${message}${item.title}`, |
| | | trigger, |
| | | }, |
| | | { |
| | | // å¦ææ²¡ææ£ååå¹é
ä»»ä½å符 |
| | | pattern: item.verify ? item.verify : /[\s\S.]*/g, |
| | | message: item.tooltips, |
| | | trigger, |
| | | }, |
| | | ], |
| | | props: { |
| | | label: 'value', |
| | | value: 'key' |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | changeFun(prop) { |
| | | this.attachOption.column[1].data[prop] = this.attachForm[prop] |
| | | }, |
| | | getDataList(type, dicData) { |
| | | if (type === "truefalse") { |
| | | return [ |
| | | { |
| | | key: false, |
| | | value: "å¦", |
| | | }, |
| | | { |
| | | key: true, |
| | | value: "æ¯", |
| | | }, |
| | | ]; |
| | | } else if (type === "combox") { |
| | | return dicData; |
| | | } |
| | | return []; |
| | | }, |
| | | setParams() { |
| | | var queryMap = { |
| | | currentButtonKey: 'VIEW', |
| | | ownbizOid: this.options.ownbizOid || "share", |
| | | ownBtmName: this.options.ownbizBtm || "share", |
| | | fileDocClassify: this.options.fileDocClassify || "ADMIN_SHARE", |
| | | fileDocClassifyName: this.options.fileDocClassifyName || "管çåå
±äº«æä»¶" |
| | | }; |
| | | if (this.options.where) { |
| | | Object.assign(queryMap, this.options.where); |
| | | } |
| | | this.params = queryMap; |
| | | |
| | | if (!this.options.pageObject) { |
| | | this.options.pageObject = { |
| | | limit: 10, |
| | | page: 1 |
| | | }; |
| | | } |
| | | this.page.pageSize = this.options.pageObject.limit; |
| | | this.page.currentPage = this.options.pageObject.page; |
| | | |
| | | this.attachOption.column[1].data.ownbizOid = this.options.ownbizOid || "share"; |
| | | this.attachOption.column[1].data.ownBtmName = this.options.ownbizBtm || "share"; |
| | | this.attachOption.column[1].data.fileDocClassify = this.options.fileDocClassify || "ADMIN_SHARE"; |
| | | this.attachOption.column[1].data.fileDocClassifyName = this.options.fileDocClassifyName || "管çåå
±äº«æä»¶" |
| | | |
| | | }, |
| | | handleUpload() { |
| | | this.attachOption.column[1].data.fileOid = ''; |
| | | delete this.attachOption.column[1].data.oid; |
| | | delete this.attachOption.column[1].data.updateFileFlag; |
| | | this.attachBox = true; |
| | | }, |
| | | handleEdit() { |
| | | if (this.selectionList.length == 0) { |
| | | this.$message.warning('è¯·éæ©éè¦ä¿®æ¹çæä»¶') |
| | | return false; |
| | | } else if (this.selectionList.length > 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®') |
| | | return false; |
| | | } |
| | | this.attachOption.column[1].data.fileOid = this.oids; |
| | | this.attachOption.column[1].data.oid = this.oids; |
| | | this.attachOption.column[1].data.updateFileFlag = true |
| | | this.attachBox = true; |
| | | }, |
| | | uploadBefore(file, done, loading, column) { |
| | | done(); |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | this.attachBox = false; |
| | | this.$message.success('æä»¶ä¸ä¼ æå') |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | uploadError(error, column) { |
| | | this.$message.error(error || 'ä¸ä¼ æä»¶åºç°äºå¼å¸¸') |
| | | }, |
| | | handleDownload(row) { |
| | | //window.open(`${row.link}`); |
| | | let data = new FormData(); |
| | | if (row && row.oid) { |
| | | data.append('fileOids', row.oid) |
| | | this.downloadFile(data); |
| | | } else { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return; |
| | | } |
| | | data.append('fileOids', this.oids) |
| | | this.downloadFile(data); |
| | | } |
| | | }, |
| | | downloadFile(data) { |
| | | download(data).then(res => { |
| | | // console.log(res); |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | } |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("ç¡®å®å°éæ©æä»¶å é¤?", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove([row.oid]); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return; |
| | | } |
| | | this.$confirm("ç¡®å®å°éæ©æ°æ®å é¤?", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.oids.split(',')); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.$refs.crud.setCurrentRow(this.selectionList[list.length - 1]); |
| | | }, |
| | | selectedRowClick(row) { |
| | | this.selectionList = row; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.setCurrentRow(row); |
| | | this.$refs.crud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | // this.loading = true; |
| | | // var query = {} |
| | | // if (this.query) { |
| | | // for (var key in this.query) { |
| | | // query['conditionMap["' + key + '"]'] = this.query[key]; |
| | | // } |
| | | // } |
| | | // getList(page.currentPage, page.pageSize, Object.assign(params, this.params, query, this.query)).then(res => { |
| | | // const data = res.data.data; |
| | | // this.page.total = data.total; |
| | | // if (this.options.fileDocClassifyCombox) { |
| | | // this.data = data.records.map(item => { |
| | | // if (validatenull(item.fileDocClassifyName) && !validatenull(item.fileDocClassify)) { |
| | | // item.fileDocClassifyName = this.options.fileDocClassifyCombox[item.fileDocClassify] || ''; |
| | | // } |
| | | // return { |
| | | // ...item |
| | | // } |
| | | // }) |
| | | // } else { |
| | | // this.data = data.records; |
| | | // } |
| | | // |
| | | // this.loading = false; |
| | | // this.selectionClear(); |
| | | // }).catch(error => { |
| | | // this.$message.error(error); |
| | | // this.loading = false; |
| | | // }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | /deep/.el-dialog{ |
| | | height: 20% !important; |
| | | } |
| | | </style> |