From d73c61eb5a8dcc4e40732b97d92d36edcf6b3d61 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 11 十二月 2024 16:07:08 +0800
Subject: [PATCH] ll
---
admin/src/components/operation/HiddenDangerParam.vue | 83 +++++++++++++++++++++++++++++++++++------
1 files changed, 70 insertions(+), 13 deletions(-)
diff --git a/admin/src/components/operation/HiddenDangerParam.vue b/admin/src/components/operation/HiddenDangerParam.vue
index c8bfb1a..babe186 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">
@@ -21,6 +22,11 @@
type="datetime"
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="璇烽�夋嫨">
@@ -61,6 +67,7 @@
:action="uploadImgUrl"
:show-file-list="false"
:on-success="uploadAvatarSuccess"
+ :on-error="uploadError"
:before-upload="beforeUpload"
>
<div class="upload_wrap">
@@ -101,10 +108,12 @@
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import UploadFaceImg from '@/components/common/UploadFaceImg'
+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
@@ -112,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',
@@ -123,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' }]
@@ -135,18 +147,34 @@
}
},
created () {
+ this.$set(this.param, 'submitTime', dayjs().format('YYYY-MM-DD HH:mm:ss'))
this.initData()
},
methods: {
+
initData () {
allList({ type: 1 }).then(res => { // 绫诲瀷
this.typeList = res || []
})
- allList({ type: 0 }).then(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', '')
+ allList({ type: 0,companyId }).then(res => { // 浣嶇疆
this.addrList = res || []
- })
- memberList({}).then(res => {
- this.memberList = res || []
})
},
changeArea (e) {
@@ -156,6 +184,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({
@@ -166,23 +196,41 @@
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'].indexOf(item.imgaddr) === -1) {
+ if (['.mp4', '.avi', '.flv', '.wmv'].some(char => item.imgaddr.includes(char))) {
this.fileList.push({
- type: 0,
+ type: 1,
fileurl: item.imgaddr,
fileurlFull: item.url
})
} else {
this.fileList.push({
- type: 1,
+ type: 0,
fileurl: item.imgaddr,
fileurlFull: item.url
})
@@ -193,6 +241,10 @@
},
handleDelImg (i) {
this.fileList.splice(i, 1)
+ },
+ close(){
+ this.isShowModal = false
+ this.$emit('close')
},
// 鍚屾淇℃伅
confirm () {
@@ -253,10 +305,15 @@
display: flex;
flex-wrap: wrap;
.item {
- width: 90px;
- max-height: 90px;
+ 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;
@@ -267,8 +324,8 @@
cursor: pointer;
}
.img {
- width: 90px;
- max-height: 90px;
+ width: 92px;
+ max-height: 92px;
}
}
}
--
Gitblit v1.9.3