From 09a49f7cd53acba5261802daf491cf01a10f8d9b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 13 五月 2025 09:40:06 +0800
Subject: [PATCH] 最新版本541200007
---
admin/src/components/operation/HiddenDangerParam.vue | 84 +++++++++++++++++++++++++++++++++++------
1 files changed, 71 insertions(+), 13 deletions(-)
diff --git a/admin/src/components/operation/HiddenDangerParam.vue b/admin/src/components/operation/HiddenDangerParam.vue
index f96d588..bef7aff 100644
--- a/admin/src/components/operation/HiddenDangerParam.vue
+++ b/admin/src/components/operation/HiddenDangerParam.vue
@@ -4,6 +4,7 @@
width="600px"
:visible.sync="isShowModal"
:confirm-working="isWorking"
+ @close="close"
@confirm="confirm"
>
<el-form :model="param" ref="paramRef" :rules="rules">
@@ -22,6 +23,11 @@
default-time="08:00:00"
/>
</el-form-item>
+ <el-form-item label="璐d换閮ㄩ棬" prop="companyId">
+ <el-select @change="getAddrList" clearable filterable v-model="param.companyId">
+ <el-option v-for="op in department" :key="op.id" :label="op.name" :value="op.id"></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="闅愭偅鍖哄煙" prop="areaId">
<el-select v-model="param.areaId" @change="changeArea" placeholder="璇烽�夋嫨">
<el-option
@@ -33,7 +39,7 @@
</el-select>
</el-form-item>
<el-form-item label="澶勭悊浜�" prop="checkUserId">
- <el-select v-model="param.checkUserId" placeholder="璇烽�夋嫨">
+ <el-select v-model="param.checkUserId" filterable placeholder="璇烽�夋嫨">
<el-option
v-for="item in memberList"
:key="item.id"
@@ -61,6 +67,7 @@
:action="uploadImgUrl"
:show-file-list="false"
:on-success="uploadAvatarSuccess"
+ :on-error="uploadError"
:before-upload="beforeUpload"
>
<div class="upload_wrap">
@@ -104,8 +111,9 @@
import dayjs from 'dayjs'
import { allList, memberList } from '@/api/business/hiddenDangerParam'
import { create } from '@/api/business/hiddenDanger'
+import { Loading } from 'element-ui'
+import { companyGetListPost } from '@/api/business/company'
export default {
- name: 'OperaVisitsHkWindow',
extends: BaseOpera,
components: {
GlobalWindow
@@ -113,6 +121,7 @@
data () {
return {
isShowModal: false,
+ loadingInstance: false,
param: {},
userInfo: this.$store.state.userInfo,
uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
@@ -124,11 +133,13 @@
uploadData: {
folder: 'HIDDEN_DANGER_FILE'
},
+ department: [],
rules: {
// starttime: [{ required: true, message: '璇烽�夋嫨鏃ユ湡', trigger: 'change' }],
areaId: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }],
cateId: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }],
checkUserId: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }],
+ companyId: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }],
faceImgUrl: [{ required: true, message: '璇蜂笂浼�', trigger: 'change' }],
content: [{ required: true, message: '璇疯緭鍏�', trigger: 'blur' }]
@@ -140,16 +151,34 @@
this.initData()
},
methods: {
+
initData () {
allList({ type: 1 }).then(res => { // 绫诲瀷
this.typeList = res || []
})
- allList({ type: 0 }).then(res => { // 浣嶇疆
- this.addrList = res || []
- })
- memberList({}).then(res => {
- this.memberList = res || []
- })
+ // memberList({}).then(res => {
+ // this.memberList = res || []
+ // })
+ this.getfindCompanyTreePage()
+ },
+ getfindCompanyTreePage() {
+ companyGetListPost({queryHiddenDanger: 1})
+ .then(res => {
+ if (res && res.length > 0) {
+ this.department = res
+ }
+ })
+ },
+ getAddrList() {
+ const { companyId } = this.param
+ this.$set(this.param, 'areaId', '')
+ this.$set(this.param, 'checkUserId', '')
+ this.addrList = []
+ if(companyId){
+ allList({ type: 0,companyId }).then(res => { // 浣嶇疆
+ this.addrList = res || []
+ })
+ }
},
changeArea (e) {
const item = this.addrList.find(i => i.id === e)
@@ -158,6 +187,8 @@
const memberNames = item.memberNames.split(',')
if (memberIds && memberIds.length === 1) {
this.$set(this.param, 'checkUserId', memberIds[0])
+ } else {
+ this.$set(this.param, 'checkUserId', '')
}
memberIds.forEach((mem, i) => {
arr.push({
@@ -168,12 +199,30 @@
this.memberList = arr
},
beforeUpload (file) {
- if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb', 'image/jpeg', 'image/png', 'image/gif'].indexOf(file.type) == -1) {
+ if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb', 'image/jpeg','image/jpg', 'image/png', 'image/gif'].indexOf(file.type) == -1) {
this.$message.error('璇蜂笂浼犳纭殑瑙嗛/鍥剧墖鏍煎紡')
return false
}
+ this.loadingInstance = Loading.service({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ },
+ uploadError() {
+ this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂�
+ if(this.loadingInstance){
+ this.loadingInstance.close()
+ }
+ })
},
uploadAvatarSuccess (file) {
+ this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂�
+ if(this.loadingInstance){
+ this.loadingInstance.close()
+ }
+ })
console.log('file', file)
const item = file.data[0]
if (['.mp4', '.avi', '.flv', '.wmv'].some(char => item.imgaddr.includes(char))) {
@@ -195,6 +244,10 @@
},
handleDelImg (i) {
this.fileList.splice(i, 1)
+ },
+ close(){
+ this.isShowModal = false
+ this.$emit('close')
},
// 鍚屾淇℃伅
confirm () {
@@ -255,10 +308,15 @@
display: flex;
flex-wrap: wrap;
.item {
- width: 140px;
- max-height: 140px;
+ width: 92px;
+ max-height: 92px;
margin-left: 10px;
position: relative;
+ border: 1px dashed #d9d9d9;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
.close{
font-size: 20px;
position: absolute;
@@ -269,8 +327,8 @@
cursor: pointer;
}
.img {
- width: 140px;
- max-height: 90px;
+ width: 92px;
+ max-height: 92px;
}
}
}
--
Gitblit v1.9.3