|
@@ -1,15 +1,16 @@
|
|
|
<template>
|
|
|
<div class="myDia">
|
|
|
<!-- 日期选择器和其他操作 -->
|
|
|
- <div style="margin-bottom: 26px;display: flex;position: relative;width: 100%" class="dataPlicker">
|
|
|
+ <div style="margin-bottom: 26px;display: flex;position: relative;width: 100%" class="dataPlicker">
|
|
|
<el-date-picker
|
|
|
v-model="value"
|
|
|
type="date"
|
|
|
- placeholder="选择日期">
|
|
|
+ placeholder="选择日期"
|
|
|
+ @change="handleDateChange">
|
|
|
</el-date-picker>
|
|
|
- <div style="border: 1px #00ffff solid;display: flex;justify-content: center;align-items: center;margin-left: 10px;width: 100px;color: #00ffff;cursor: pointer" @click="choose">
|
|
|
+ <!-- <div style="border: 1px #00ffff solid;display: flex;justify-content: center;align-items: center;margin-left: 10px;width: 100px;color: #00ffff;cursor: pointer" @click="choose">
|
|
|
<i class="el-icon-plus"><span style="margin-left: 10px">上报问题</span></i>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div style="position: absolute;right: 10px;color: #00ffff;font-size: 25px;cursor: pointer" @click="close">
|
|
|
<img src="../../../assets/zhang/engineer/ownCloseBtn.png">
|
|
|
</div>
|
|
@@ -26,18 +27,18 @@
|
|
|
<div class="flex-column" style="width: 15%">操作</div>
|
|
|
</div>
|
|
|
<div class="flex-row" v-for="(item, index) in paginatedData" :key="index">
|
|
|
- <div class="flex-column" style="width: 15%">{{ item.a }}</div>
|
|
|
- <div class="flex-column" style="width: 15%">{{ item.b }}</div>
|
|
|
- <div class="flex-column" style="width: 30%">{{ item.c }}</div>
|
|
|
- <div class="flex-column" style="width: 15%">{{ item.d }}</div>
|
|
|
+ <div class="flex-column" style="width: 15%">{{ item.createDate }}</div>
|
|
|
+ <div class="flex-column" style="width: 15%">{{ item.title }}</div>
|
|
|
+ <div class="flex-column" style="width: 30%">{{ item.description }}</div>
|
|
|
+ <div class="flex-column" style="width: 15%">{{ item.person }}</div>
|
|
|
<div class="flex-column" style="width: 10%">
|
|
|
- <span v-if="item.e === 1"><span style="color: #67C23A">●</span> 已完结</span>
|
|
|
- <span v-if="item.e === 0"><span style="color: #FAAD14">●</span> 处理中</span>
|
|
|
+ <span v-if="item.status == 0"><span style="color: #67C23A">●</span> 已完结</span>
|
|
|
+ <span v-if="item.status == 1"><span style="color: #FAAD14">●</span> 处理中</span>
|
|
|
</div>
|
|
|
<div class="flex-column" style="width: 15%">
|
|
|
- <span v-if="item.e === 1"></span>
|
|
|
- <span v-if="item.e === 0" style="color: #00FFFF;cursor: pointer" @click="deal()">变更状态</span>
|
|
|
- <div v-if="item.e === 0" class="wanjie">已完结</div>
|
|
|
+ <span v-if="item.status == 0"></span>
|
|
|
+ <span v-if="item.status == 1" style="color: #00FFFF;cursor: pointer" @click="togglePost(item)">变更状态</span>
|
|
|
+ <div v-if="item.status == 1&&item.isShowPost" class="wanjie" @click="changeIssueStatus(item.id)">已完结</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -57,62 +58,106 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getIssueListLastWeek,changeIssueStatus } from '@/api/screen/service';
|
|
|
+
|
|
|
export default {
|
|
|
name: "UnitCamera",
|
|
|
+ props: {
|
|
|
+ appOrg: {
|
|
|
+ type: String,
|
|
|
+ default: "10001",
|
|
|
+ },
|
|
|
+ },
|
|
|
data() {
|
|
|
- return {
|
|
|
- value: "2020-02-09",
|
|
|
- dataList: [
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 0 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 0 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 0 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
- { a: "2024/12/28", b: "施工整改问题1", c: "施工整改问题具体内容", d: "张三", e: 1 },
|
|
|
-
|
|
|
- ],
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 10,
|
|
|
- total: 0,
|
|
|
+ return {
|
|
|
+ value: null,
|
|
|
+ getProList: [],
|
|
|
+ // showPost:false,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ total: 0,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- // 计算分页后的数据
|
|
|
paginatedData() {
|
|
|
const start = (this.currentPage - 1) * this.pageSize;
|
|
|
const end = start + this.pageSize;
|
|
|
- return this.dataList.slice(start, end);
|
|
|
+ return this.getProList.slice(start, end);
|
|
|
},
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getIssueListLastWeek();
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- const style = document.createElement('style');
|
|
|
+ const style = document.createElement('style');
|
|
|
style.innerHTML = `
|
|
|
.el-picker-panel.el-date-picker {
|
|
|
background: #062223 !important;
|
|
|
}
|
|
|
`;
|
|
|
document.head.appendChild(style);
|
|
|
- this.total = this.dataList.length;
|
|
|
- },
|
|
|
- methods: {
|
|
|
- choose() {
|
|
|
- this.$emit("subIssue");
|
|
|
+},
|
|
|
+methods: {
|
|
|
+ // 获取近一周问题列表
|
|
|
+ getIssueListLastWeek() {
|
|
|
+ if (this.value) {
|
|
|
+ const selectedDate = this.formatDate(this.value);
|
|
|
+ getIssueListLastWeek(this.$props.appOrg, selectedDate).then((res) => {
|
|
|
+ if (Number(res.code) === 200) {
|
|
|
+ this.getProList = (res.data || []).map(item => ({
|
|
|
+ ...item,
|
|
|
+ isShowPost: false
|
|
|
+ }));
|
|
|
+ this.total = this.getProList.length;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ getIssueListLastWeek(this.$props.appOrg).then((res) => {
|
|
|
+ if (Number(res.code) === 200) {
|
|
|
+ this.getProList = (res.data || []).map(item => ({
|
|
|
+ ...item,
|
|
|
+ isShowPost: false
|
|
|
+ }));
|
|
|
+ this.total = this.getProList.length;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
- deal() {
|
|
|
-
|
|
|
- // this.$emit("dealIssue");
|
|
|
+ // 日期格式化方法
|
|
|
+ formatDate(date) {
|
|
|
+ const d = new Date(date);
|
|
|
+ const year = d.getFullYear();
|
|
|
+ const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
|
+ const day = String(d.getDate()).padStart(2, "0");
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+ },
|
|
|
+ // 处理日期选择器变化
|
|
|
+ handleDateChange() {
|
|
|
+ this.currentPage = 1; // 重置分页
|
|
|
+ this.getIssueListLastWeek(); // 刷新数据
|
|
|
+ },
|
|
|
+ togglePost(item) {
|
|
|
+ // 关闭所有其他条目
|
|
|
+ this.getProList.forEach(i => {
|
|
|
+ if (i.id !== item.id) i.isShowPost = false;
|
|
|
+ });
|
|
|
+ // 切换当前条目状态
|
|
|
+ item.isShowPost = !item.isShowPost;
|
|
|
},
|
|
|
+ changeIssueStatus(f) {
|
|
|
+ const issueData = {
|
|
|
+ id: f,
|
|
|
+ status: 0,
|
|
|
+ };
|
|
|
|
|
|
+ changeIssueStatus(issueData).then((res) => {
|
|
|
+ if (Number(res.code) === 200) {
|
|
|
+ this.getIssueListLastWeek(); // 刷新数据
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.error("修改状态失败:", err);
|
|
|
+ });
|
|
|
+ },
|
|
|
close() {
|
|
|
this.$emit("close");
|
|
|
},
|
|
@@ -122,7 +167,6 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
.me{
|
|
|
display: flex;flex-wrap: wrap;justify-content: space-around;height: 380px;overflow: auto;
|
|
@@ -214,7 +258,7 @@ export default {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
color: #00F0ff;
|
|
|
- display: none;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
|
|
|
::v-deep .el-input__inner{
|