| | |
| | | > |
| | | <el-select |
| | | filterable |
| | | v-model="projectId" |
| | | v-model="searchParams.type" |
| | | placeholder="请选择工作类型" |
| | | class="flex1" |
| | | > |
| | | <el-option |
| | | v-for="item in [1, 2]" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | v-for="item in [{ label: '视察工作', value: 1 }]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <img |
| | | src="../../assets/img/down-circle@2x.png" |
| | | class="w--15 h--16 shrink0" |
| | | /> |
| | | <div class="flex a-center gap--5"> |
| | | <i |
| | | @click.stop="(searchParams.type = ''), getlist()" |
| | | class="el-icon-circle-close c-fff cursor-pointer" |
| | | v-show="searchParams.type" |
| | | /> |
| | | <img |
| | | src="../../assets/img/down-circle@2x.png" |
| | | class="w--15 h--16 shrink0" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div |
| | | @click="handleClick" |
| | | class="flex a-center j-between px--20 w--350 h--40 relative bgcolor1 picker" |
| | | class="flex a-center relative j-between px--20 w--350 h--40 relative bgcolor1 picker" |
| | | > |
| | | <el-date-picker |
| | | v-model="monthrange" |
| | |
| | | placeholder="" |
| | | > |
| | | </el-date-picker> |
| | | <div class="absolute w100 h100 flex a-center c-fff fs--14 SHS"> |
| | | <div |
| | | class="absolute h100 flex a-center c-fff fs--14 SHS" |
| | | style="width: calc(100% - 40px)" |
| | | > |
| | | <div class="flex a-center flex1 shrink0 gap--13"> |
| | | <img |
| | | src="../../assets/img/home/Shape@2x (6).png" |
| | |
| | | <div v-else>请选择日期</div> |
| | | </div> |
| | | </div> |
| | | <i |
| | | @click.stop="clearDate" |
| | | class="el-icon-circle-close c-fff cursor-pointer absolute top--10 right--10" |
| | | v-show="dateTxt1" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="flex a-center j-between w--300 pl--20 h--40 relative bgcolor1 searchBox" |
| | | class="relative flex a-center j-between w--300 pl--20 h--40 relative bgcolor1 searchBox" |
| | | > |
| | | <el-input |
| | | filterable |
| | |
| | | placeholder="请输入搜索内容" |
| | | class="flex1" |
| | | /> |
| | | <div @click="getlist" class="btn SHSR">搜索</div> |
| | | <div |
| | | class="flex a-center gap--5 absolute shrink0" |
| | | style="top: -2px; right: -2px" |
| | | > |
| | | <i |
| | | @click.stop="(searchParams.content = ''), getlist()" |
| | | class="el-icon-circle-close c-fff cursor-pointer" |
| | | v-show="searchParams.content" |
| | | /> |
| | | <div @click="getlist" class="btn SHSR">搜索</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div |
| | |
| | | <el-button type="text" class="btnColor" @click="toDetail(row)" |
| | | >详情</el-button |
| | | > |
| | | <el-button type="text" class="btnColor" @click="editForm(row)" |
| | | <el-button |
| | | type="text" |
| | | class="btnColor" |
| | | style="margin-left: 0" |
| | | @click="editForm(row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button type="text" class="btnColor">删除</el-button> |
| | | <el-button type="text" class="btnColor">隐藏</el-button> |
| | | <el-popconfirm |
| | | title="是否确认删除此工作内容?" |
| | | @confirm="confirmDelete(row)" |
| | | > |
| | | <el-button slot="reference" type="text" class="btnColor" |
| | | >删除</el-button |
| | | > |
| | | </el-popconfirm> |
| | | <el-popconfirm |
| | | :title="`是否确认${row.state == 1 ? '隐藏' : '展示'}此工作内容?`" |
| | | @confirm="confirmState(row)" |
| | | > |
| | | <el-button slot="reference" type="text" class="btnColor">{{ |
| | | row.state == 1 ? "隐藏" : "展示" |
| | | }}</el-button> |
| | | </el-popconfirm> |
| | | </template> |
| | | </el-table-column> |
| | | </CustomTable> |
| | |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | :page-size="searchParams.pageSize" |
| | | :total="totalSizes" |
| | | /> |
| | |
| | | </div> |
| | | </div> |
| | | </CustomDialog> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="dialogImageUrl" alt="" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import HeaderBox from "../header/index.vue"; |
| | | import moment from "moment"; |
| | | import { getWorkPresentationList, addWorkPresentation } from "./service"; |
| | | import { |
| | | getWorkPresentationList, |
| | | addWorkPresentation, |
| | | updateWorkPresentation, |
| | | operateWorkPresentation, |
| | | deleteWorkPresentation, |
| | | } from "./service"; |
| | | export default { |
| | | components: { HeaderBox }, |
| | | props: {}, |
| | |
| | | }, |
| | | formData: {}, |
| | | listData: [], |
| | | dialogImageUrl: "", |
| | | dialogVisible: false, |
| | | }; |
| | | }, |
| | | computed: {}, |
| | |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | clearDate() { |
| | | this.dateTxt1 = ""; |
| | | this.dateTxt2 = ""; |
| | | this.searchParams.time = ""; |
| | | this.monthrange = null; |
| | | this.getlist(); |
| | | }, |
| | | |
| | | confirmState(row) { |
| | | operateWorkPresentation({ id: row.id }).then((res) => { |
| | | this.$message.success("修改成功"); |
| | | this.getlist(); |
| | | }); |
| | | }, |
| | | |
| | | confirmDelete(row) { |
| | | deleteWorkPresentation(row.id).then((res) => { |
| | | this.$message.success("删除成功"); |
| | | this.getlist(); |
| | | }); |
| | | }, |
| | | |
| | | openImgDialog(img) { |
| | | this.imgArr = img.split(","); |
| | | this.previewVisible = true; |
| | |
| | | |
| | | saveForm() { |
| | | if (!this.formData.title) { |
| | | Message({ |
| | | message: "请输入工作标题", |
| | | type: "warning", |
| | | duration: 1500, |
| | | }); |
| | | this.$message.warning("请输入工作标题"); |
| | | return; |
| | | } |
| | | if (!this.formData.type) { |
| | | Message({ |
| | | message: "请选择工作类型", |
| | | type: "warning", |
| | | duration: 1500, |
| | | }); |
| | | this.$message.warning("请选择工作类型"); |
| | | return; |
| | | } |
| | | if (!this.formData.intro) { |
| | | Message({ |
| | | message: "请输入工作标简介", |
| | | type: "warning", |
| | | duration: 1500, |
| | | }); |
| | | this.$message.warning("请输入工作标简介"); |
| | | return; |
| | | } |
| | | if (!this.formData.state) { |
| | | Message({ |
| | | message: "请选择展示状态", |
| | | type: "warning", |
| | | duration: 1500, |
| | | }); |
| | | this.$message.warning("请选择展示状态"); |
| | | return; |
| | | } |
| | | if (!this.fileList.length) { |
| | | Message({ |
| | | message: "请上传工作图片", |
| | | type: "warning", |
| | | duration: 1500, |
| | | }); |
| | | this.$message.warning("请上传工作图片"); |
| | | return; |
| | | } |
| | | |
| | |
| | | clientId: localStorage.getItem("clientId"), |
| | | }; |
| | | obj.img = this.fileList.map((item) => item.url).join(","); |
| | | addWorkPresentation(obj).then((res) => { |
| | | let api = obj.id ? updateWorkPresentation : addWorkPresentation; |
| | | api(obj).then((res) => { |
| | | this.closeForm(); |
| | | this.getlist(); |
| | | }); |
| | |
| | | }, |
| | | |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList); |
| | | this.fileList = this.fileList.filter((item) => { |
| | | return item.url != file.url; |
| | | }); |
| | | }, |
| | | |
| | | handlePictureCardPreview(file) { |
| | | this.dialogImageUrl = file.url; |
| | | this.dialogVisible = true; |
| | | this.imgArr = [file.url]; |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | handleSuccess(response, file, fileList) { |
| | | console.log(response, file, fileList); |
| | | this.fileList.push({ |
| | | url: process.env.VUE_APP_IMAGE_BASE_URL + response.data, |
| | | }); |
| | |
| | | this.$router.push({ |
| | | path: "/workList/detail", |
| | | query: { |
| | | projectId: row.projectId, |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | toHiddenDanger(row, type) { |
| | | this.$router.push({ |
| | | path: "/hiddenDanger", |
| | | query: { |
| | | projectId: row.projectId, |
| | | activeTab: type, |
| | | id: row.id, |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | handleSizeChange(val) { |
| | | this.searchParams.pageSize = val; |
| | | this.getlist(); |
| | | }, |
| | | |
| | | handleCurrentChange(val) { |
| | | this.searchParams.pageNum = val; |
| | | this.getlist(); |
| | | }, |
| | | |
| | | handleClick(type) { |
| | |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | // <div |
| | | // class="flex a-center flex-column gap--15 px--20 py--20 border1 br--8 uploadBox" |
| | | // > |
| | | // <img |
| | | // src="../../assets/img/home/89Combined Shape@2x.png" |
| | | // class="w--18 h--18" |
| | | // /> |
| | | // <div class="c-fff fs--16">上传图片</div> |
| | | // </div> |
| | | |
| | | ::v-deep .el-upload--picture-card { |
| | | border: 2px dashed #8c939d; |
| | | background-color: transparent; |
| | |
| | | } |
| | | |
| | | .btn { |
| | | position: absolute; |
| | | top: -2px; |
| | | right: -2px; |
| | | background: linear-gradient( |
| | | 90deg, |
| | | #3467d0 0%, |
| | | #0d226a 50.35%, |
| | | #376fe0 100% |
| | | ); |
| | | height: 38px; |
| | | display: flex; |
| | | align-items: center; |
| | | line-height: 38px; |
| | | font-size: 14px; |
| | | color: #ffffff; |
| | | font-family: "Source Han Sans CN Heavy"; |
| | | padding: 0 26px; |
| | | border: 1px solid #307ad9; |
| | | box-sizing: border-box; |