issueListDia.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <div class="myDia">
  3. <!-- 日期选择器和其他操作 -->
  4. <div style="margin-bottom: 26px;display: flex;position: relative;width: 100%" class="dataPlicker">
  5. <el-date-picker
  6. v-model="value"
  7. type="date"
  8. placeholder="选择日期"
  9. @change="handleDateChange">
  10. </el-date-picker>
  11. <div class="choose-area">
  12. <el-select v-model="food" placeholder="请选择" @change="changeFoods">
  13. <el-option
  14. v-for="item in foods"
  15. :key="item"
  16. :label="item"
  17. :value="item"
  18. >
  19. </el-option>
  20. </el-select>
  21. </div>
  22. <!-- <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">
  23. <i class="el-icon-plus"><span style="margin-left: 10px">上报问题</span></i>
  24. </div> -->
  25. <div style="position: absolute;right: 10px;color: #00ffff;font-size: 25px;cursor: pointer" @click="close">
  26. <img src="../../../assets/zhang/engineer/ownCloseBtn.png">
  27. </div>
  28. </div>
  29. <!-- 表格数据 -->
  30. <div class="flex-container">
  31. <div class="header">
  32. <div class="flex-column" style="width: 15%">时间</div>
  33. <div class="flex-column" style="width: 15%">标题</div>
  34. <div class="flex-column" style="width: 30%">问题内容</div>
  35. <div class="flex-column" style="width: 15%">发起人</div>
  36. <div class="flex-column" style="width: 10%">问题状态</div>
  37. <div class="flex-column" style="width: 15%">操作</div>
  38. </div>
  39. <div class="flex-row" v-for="(item, index) in paginatedData" :key="index">
  40. <div class="flex-column" style="width: 15%">{{ item.createDate }}</div>
  41. <div class="flex-column" style="width: 15%">{{ item.title }}</div>
  42. <div class="flex-column" style="width: 30%">{{ item.description }}</div>
  43. <div class="flex-column" style="width: 15%">{{ item.person }}</div>
  44. <div class="flex-column" style="width: 10%">
  45. <span v-if="item.status == 1"><span style="color: #67C23A">●</span> 已完结</span>
  46. <span v-if="item.status == 0"><span style="color: #FAAD14">●</span> 处理中</span>
  47. </div>
  48. <div class="flex-column" style="width: 15%">
  49. <span v-if="item.status == 1"></span>
  50. <span v-if="item.status == 0" style="color: #00FFFF;cursor: pointer" @click="dealIssue(item)">变更状态</span>
  51. <div v-if="item.status == 0&&item.isShowPost" class="wanjie" @click="changeIssueStatus(item.id)">已完结</div>
  52. </div>
  53. </div>
  54. </div>
  55. <!-- 分页组件 -->
  56. <div style="width: 100%;display: flex;justify-content: center;align-items: center;margin-top: 10px;">
  57. <el-pagination
  58. background
  59. layout="prev, pager, next"
  60. :current-page="currentPage"
  61. :page-size="pageSize"
  62. :total="total"
  63. @current-change="handlePageChange">
  64. </el-pagination>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import { getIssueListLastWeek,changeIssueStatus } from '@/api/screen/service';
  70. export default {
  71. name: "UnitCamera",
  72. props: {
  73. appOrg: {
  74. type: String,
  75. default: "0000",
  76. },
  77. },
  78. data() {
  79. return {
  80. value: null,
  81. food: "",
  82. foods: ["处理中", "已完结",],
  83. getProList: [],
  84. // showPost:false,
  85. currentPage: 1,
  86. pageSize: 10,
  87. total: 0,
  88. };
  89. },
  90. computed: {
  91. paginatedData() {
  92. const start = (this.currentPage - 1) * this.pageSize;
  93. const end = start + this.pageSize;
  94. return this.getProList.slice(start, end);
  95. },
  96. },
  97. created() {
  98. this.fetchData();
  99. },
  100. mounted() {
  101. const style = document.createElement('style');
  102. style.innerHTML = `
  103. .el-picker-panel.el-date-picker {
  104. background: #062223 !important;
  105. }
  106. `;
  107. document.head.appendChild(style);
  108. },
  109. methods: {
  110. dealIssue(y){
  111. this.$emit('dealIssue',y)
  112. },
  113. // 获取近一周问题列表
  114. fetchData() {
  115. let selectedFood = null;
  116. let selectedDate = null;
  117. if (this.food) {
  118. selectedFood = this.food === "处理中" ? 0 : 1;
  119. }
  120. if (this.value) {
  121. selectedDate = this.formatDate(this.value);
  122. }
  123. getIssueListLastWeek(this.$props.appOrg, selectedDate, selectedFood).then((res) => {
  124. if (Number(res.code) === 200) {
  125. this.getProList = (res.data || []).map(item => ({
  126. ...item,
  127. isShowPost: false
  128. }));
  129. this.total = this.getProList.length;
  130. }
  131. }).catch(error => {
  132. console.error("Error fetching data:", error);
  133. });
  134. },
  135. // 日期格式化方法
  136. formatDate(date) {
  137. const d = new Date(date);
  138. const year = d.getFullYear();
  139. const month = String(d.getMonth() + 1).padStart(2, "0");
  140. const day = String(d.getDate()).padStart(2, "0");
  141. return `${year}-${month}-${day}`;
  142. },
  143. // 处理日期选择器变化
  144. handleDateChange(value) {
  145. this.value = value;
  146. this.currentPage = 1; // 重置分页
  147. this.fetchData(); // 刷新数据
  148. },
  149. changeFoods(food) {
  150. this.food = food;
  151. this.currentPage = 1; // 重置分页
  152. this.fetchData();// 刷新数据
  153. },
  154. togglePost(item) {
  155. // 关闭所有其他条目
  156. this.getProList.forEach(i => {
  157. if (i.id !== item.id) i.isShowPost = false;
  158. });
  159. // 切换当前条目状态
  160. item.isShowPost = !item.isShowPost;
  161. },
  162. changeIssueStatus(f) {
  163. const issueData = {
  164. id: f,
  165. status: 1,
  166. };
  167. changeIssueStatus(issueData).then((res) => {
  168. if (Number(res.code) === 200) {
  169. this.getIssueListLastWeek(); // 刷新数据
  170. }
  171. }).catch((err) => {
  172. console.error("修改状态失败:", err);
  173. });
  174. },
  175. close() {
  176. this.$emit("close");
  177. },
  178. handlePageChange(page) {
  179. this.currentPage = page; // 更新当前页码
  180. },
  181. },
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. .me{
  186. display: flex;flex-wrap: wrap;justify-content: space-around;height: 380px;overflow: auto;
  187. }
  188. .me::-webkit-scrollbar {
  189. display: none;
  190. }
  191. .flex-container {
  192. width: 100%;
  193. height: 566px;
  194. font-family: PingFangSC-Medium;
  195. font-weight: 500;
  196. }
  197. .header{
  198. display: flex; /* 每行使用 flexbox 布局 */
  199. position: relative;
  200. background-color: rgba(21, 105, 107, 0.5);
  201. }
  202. .flex-row {
  203. display: flex; /* 每行使用 flexbox 布局 */
  204. position: relative;
  205. }
  206. .choose-area {
  207. margin-left: 20px;
  208. width: 91.05px;
  209. height: 35px;
  210. line-height: 30px;
  211. /* padding-left: 15px; */
  212. font-size: 14px;
  213. color: #00ffff;
  214. background: url("../../../assets/images/main/choose_short.png") no-repeat;
  215. cursor: pointer;
  216. background-size: 100%;
  217. }
  218. .choose-area {
  219. .el-select {
  220. width: 100%;
  221. }
  222. .el-input {
  223. input {
  224. background: rgba(255, 255, 255, 0);
  225. color: #00ffff;
  226. border: none;
  227. padding: 0;
  228. width: 50px;
  229. }
  230. }
  231. }
  232. .flex-row::before{
  233. content: "";
  234. height: 15px;
  235. border-left: 2px #00FFFF solid;
  236. position: absolute;
  237. left: 0;
  238. top: 15px
  239. }
  240. .flex-column {
  241. display: flex;
  242. justify-content: center;
  243. height: 46px;
  244. padding: 8px 12px;
  245. text-align: left; /* 左对齐文本 */
  246. color: white;
  247. }
  248. .header .flex-column {
  249. color: #00ffff;
  250. }
  251. .el-scrollbar {
  252. background: #15696b;
  253. border: 1px solid #00ffff;
  254. ul {
  255. li {
  256. color: #fff;
  257. }
  258. }
  259. }
  260. .el-select-dropdown__item.hover,
  261. .el-select-dropdown__item:hover {
  262. background: #15696b;
  263. color: #00ffff;
  264. }
  265. .el-select-dropdown__item.selected {
  266. color: #00ffff;
  267. }
  268. .el-select .el-input .el-select__caret {
  269. display: none;
  270. }
  271. .choose-area .el-select[data-v-856d8f0c] {
  272. width: 100%;
  273. }
  274. .myDia{
  275. width: 1050px;
  276. height: 710px;
  277. padding: 24px 35px ;
  278. background-image: radial-gradient(circle at 50% 50%, #031417b3 0%, #0C1A1A 84%);
  279. }
  280. .myDia ::v-deep .el-picker-panel.el-date-picker {
  281. background: #062223 !important;
  282. }
  283. .wanjie{
  284. position: absolute;
  285. /* left: 30px; */
  286. margin-left: 75px;
  287. top: 25px;
  288. width: 120px;
  289. height: 60px;
  290. background: #0017168f;
  291. box-shadow: inset 0 0 17px 0 #05ffff7a;
  292. background: #44f1ff1a;
  293. display: flex;
  294. justify-content: center;
  295. align-items: center;
  296. color: #00F0ff;
  297. cursor: pointer;
  298. }
  299. ::v-deep .el-input__inner{
  300. color: #00ffff;
  301. background-color: rgba(15, 86, 86, 0.54);
  302. border: 1px solid #00ffff4d;
  303. }
  304. ::v-deep .el-input__prefix{
  305. color: #00F6EC;
  306. }
  307. ::v-deep .el-input__suffix{
  308. color: #00F6EC;
  309. }
  310. ::v-deep .el-input__inner::placeholder{
  311. color: #199294;
  312. }
  313. ::v-deep .btn-prev{
  314. color: #00F6EC !important;
  315. background-color: rgba(21, 105, 107, 0.35) !important;
  316. border: 1px #15696b solid;
  317. }
  318. ::v-deep .btn-next{
  319. color: #00F6EC !important;
  320. background-color: rgba(21, 105, 107, 0.35) !important;
  321. border: 1px #15696b solid;
  322. }
  323. ::v-deep .el-pager li.active{
  324. background-color: #00ffff !important;
  325. color: rgba(9, 8, 8, 0.68) !important;
  326. }
  327. ::v-deep .el-pager li{
  328. background-color: rgba(21, 105, 107, 0.35) !important;
  329. color: #00ffff !important;
  330. }
  331. </style>