| | |
| | | <div class="updateUser"> |
| | | <main> |
| | | <div class="mainContent"> |
| | | <el-form ref="user" style="width: 100%;"> |
| | | <el-form-item prop="code" label="所属事件编号"> |
| | | <el-input v-model="imagedata.code"></el-input> |
| | | <el-form :disabled="isDisabled" ref="user" style="width: 100%;"> |
| | | <el-form-item prop="baseId" label="所属事件编号"> |
| | | <el-input v-model="imagedata.baseId"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code" label="大类名称"> |
| | | <el-input v-model="imagedata.questionType"></el-input> |
| | | <el-form-item prop="eventSource" label="大类名称"> |
| | | <el-input v-model="imagedata.eventSource"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code" label="小类名称"> |
| | | <el-input v-model="imagedata.bigType"></el-input> |
| | | <el-form-item prop="regionName" label="小类名称"> |
| | | <el-input v-model="imagedata.regionName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code" label="图片Id"> |
| | | <el-input v-model="imagedata.imagesId"></el-input> |
| | | <el-form-item prop="id" label="图片Id"> |
| | | <el-input v-model="imagedata.id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code" label="上传时间"> |
| | | <el-input v-model="imagedata.uploadTime"></el-input> |
| | | <el-form-item prop="createTime" label="上传时间"> |
| | | <el-input v-model="imagedata.createTime"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="questionType" label="图片:" min-width="8"> |
| | | <img style="width: 180px;height: 120px;" :src=imagedata.imageUrl> |
| | | <el-form-item prop="eventSource" label="图片:" min-width="8"> |
| | | <!-- <img style="width: 180px;height: 120px;" :src=imagedata.url>--> |
| | | <el-upload |
| | | action="" |
| | | :show-file-list="false" |
| | | :on-success="handleImageSuccess" |
| | | :before-upload="beforeImageUpload"> |
| | | <img v-if="imagedata.url" :src="imagedata.url" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <!-- <el-form-item prop="bigType" label="大类名称" min-width="8" v-model="imagedata.bigType"> |
| | | </el-form-item> |
| | | <el-form-item prop="smallType" label="小类名称" min-width="8" v-model="imagedata.smallType"> |
| | | </el-form-item> |
| | | <el-form-item prop="imagesId" label="图片Id" min-width="8" v-model="imagedata.imagesId"> --> |
| | | <!-- </el-form-item> |
| | | <el-form-item prop="uploadTime" label="上传时间" min-width="15" v-model="imagedata.uploadTime"> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item v-if="updateFlag"> --> |
| | | <div class="optionBtn"> |
| | | <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">提交 |
| | | </el-button> |
| | | <div v-if="!isDisabled" class="optionBtn"> |
| | | <el-button type="primary" class="btn submit" @click.native.prevent="onSubmit">提交</el-button> |
| | | </div> |
| | | <!-- </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | </main> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { getTypeList } from "@/utils/helper"; |
| | | import { deepClone } from "@/utils/helper"; |
| | | import imageManagement from "@/api/operate/imageManagement"; |
| | | |
| | | export default { |
| | | data() { |
| | | |
| | | return { |
| | | |
| | | imagedata: { |
| | | code: "SJ202211010001", |
| | | questionType: "违规", |
| | | bigType: "违反国家有关标准编制城乡规划", |
| | | smallType: "在居民住宅楼、未配套设立专用烟道的商住综合楼、商住综合楼内与居住层相邻的商业楼层内新建、改建、扩建产生油烟、异味、废气的餐饮服务项目", |
| | | imagesId: "1", |
| | | uploadTime: "2022-10-31 20:20:01", |
| | | imageUrl: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.fabao365.xuanfa.cn%2Fimage%2F202107%2F130f9d19f204302f.jpg&refer=http%3A%2F%2Fimg.fabao365.xuanfa.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670034077&t=974b018f9e27023a01d2d8ad3c7c44f2" |
| | | code: '', |
| | | eventSource: '', |
| | | regionName: '', |
| | | smallType: '', |
| | | id: '', |
| | | createTime: '', |
| | | url: '' |
| | | }, |
| | | isDisabled: false |
| | | } |
| | | }, |
| | | created() { |
| | | // const that = this; |
| | | // this.user = JSON.parse(JSON.stringify(that.userInfo)); |
| | | // console.log(this.user); |
| | | // this.user.parentId = this.user.parentId === 0 ? '暂无上级部门' : this.user.parentId; |
| | | // this.checkedList = this.user.userInfoDTOS; |
| | | // this.checkedList.forEach((e) => { |
| | | // this.checkedUser.push(e.userId); |
| | | // }); |
| | | // console.log(this.checkedUser) |
| | | // this.$axios({ |
| | | // method: "get", |
| | | // url: "sccg/depart/tree", |
| | | // }).then((res) => { |
| | | // that.departList = res.data; |
| | | // }); |
| | | // this.getUserList(this.user.id); |
| | | // // 获取部门类型 |
| | | // this.getDepartType(); |
| | | this.imagedata = deepClone(this.originalData); |
| | | this.isDisabled = this.dialogType === 'view'; |
| | | }, |
| | | methods: { |
| | | // handleUser() { |
| | | // this.$refs["user"].validate((valid) => { |
| | | // if (valid) { |
| | | // const { user, checkedList } = this; |
| | | // const arr = []; |
| | | // checkedList.forEach((item) => { |
| | | // arr.push({ leader: item.leader, userId: item.id ? item.id : item.userId }); |
| | | // }); |
| | | // if (arr.length === 0) { |
| | | // this.$message({ |
| | | // type: 'warning', |
| | | // message: '请选择部门人员', |
| | | // }) |
| | | // } else { |
| | | // this.$axios |
| | | // .post("sccg/depart/update", { |
| | | // id: user.id, |
| | | // departName: user.departName, |
| | | // parentId: user.parentId === '暂无上级部门' ? 0 : user.parentId, |
| | | // departDes: user.departDes, |
| | | // departManagerList: arr, |
| | | // }) |
| | | // .then((res) => { |
| | | // this.$message({ |
| | | // message: res.message, |
| | | // type: res.code === 200 ? "success" : "warning", |
| | | // }); |
| | | // this.$emit("changeDialog", { flag: false }); |
| | | // this.getDepartList(); |
| | | // }); |
| | | // } |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | // }); |
| | | // }, |
| | | // // 获取部门类型 |
| | | // async getDepartType() { |
| | | // this.typeList = await getTypeList(1, "08"); |
| | | // }, |
| | | |
| | | // // 设置领导 |
| | | // setLeader(idx) { |
| | | // if (this.updateFlag) { |
| | | // this.checkedList.forEach((item, index) => { |
| | | // item.leader = index === idx; |
| | | // }); |
| | | // } |
| | | // }, |
| | | |
| | | // // 获取所有用户信息 |
| | | // getUserList(id) { |
| | | // // 获取所有用户信息、用户查询(暂时支持电话号码) |
| | | // this.$axios.get(`/sccg/depart/query_surplus_exist_user?id=`+id).then((res) => { |
| | | // if (res.code === 200) { |
| | | // this.userList = res.data; |
| | | // } |
| | | // }); |
| | | // }, |
| | | // addUser() { |
| | | // this.checkedList = []; |
| | | // this.userList.forEach((item) => { |
| | | // this.checkedUser.forEach((child) => { |
| | | // if (item.id == child) { |
| | | // this.checkedList.push({ |
| | | // id: item.id, |
| | | // username: item.username, |
| | | // leader: false, |
| | | // }); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // this.checkedList[0].leader = true; |
| | | // console.log(this.checkedList); |
| | | // this.openUser = false; |
| | | // }, |
| | | // }, |
| | | // props: ["userInfo", "updateFlag", "getDepartList", "changeDialog"], |
| | | onSubmit() { |
| | | this.$refs.user.validate(valid => { |
| | | if (valid) { |
| | | if (this.dialogType === 'create') { |
| | | imageManagement.addImageResource(this.imagedata) |
| | | .then(() => { |
| | | this.$message.success('操作成功'); |
| | | this.$emit('closeDialog'); |
| | | }) |
| | | .catch(err => this.$message.error(`${err}`)) |
| | | } else { |
| | | imageManagement.updateImageResource(this.imagedata) |
| | | .then(() => { |
| | | this.$message.success('操作成功'); |
| | | this.$emit('closeDialog'); |
| | | }) |
| | | .catch(err => this.$message.error(`${err}`)) |
| | | } |
| | | } else { |
| | | this.$message.warning('请检查必填项'); |
| | | } |
| | | }) |
| | | }, |
| | | handleImageSuccess() {}, |
| | | beforeImageUpload(file) { |
| | | imageManagement.importImage(file) |
| | | .then(res => { |
| | | }) |
| | | .catch(err => this.$message.error(`${err}`)) |
| | | } |
| | | }, |
| | | props: ['updateFlag'] |
| | | props: { |
| | | originalData: { |
| | | type: Object, |
| | | default: () => null |
| | | }, |
| | | dialogType: { |
| | | type: String, |
| | | default: () => 'create' |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |