issueSubDia.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <div class="issueDia">
  3. <div style="width: 100%;height: 35px;margin-bottom: 20px;display: flex;justify-content: center">
  4. <img src="../../../assets/zhang/engineer/issueTitle.png">
  5. <div class="myTitle">问题上报</div>
  6. <div style=""></div>
  7. <div style="width: 20px;height: 20px;position: absolute;top: 5px;right: 15px" @click="close">
  8. <img src="../../../assets/zhang/engineer/ownCloseBtn.png">
  9. </div>
  10. </div>
  11. <div v-if="dialogVisible" style="z-index: 10000;display: flex;justify-content: center;align-items: center;background-color: transparent;position: absolute;width: 100%;height: 100%" @click="handleCloseView">
  12. <img width="600px" :src="dialogImageUrl" alt="">
  13. </div>
  14. <div class="me">
  15. <div style="width: 35%;color: #00ffff;">
  16. <!-- <div style="text-align: right;margin-bottom: 10px;height: 32px;line-height: 32px">时间:</div>-->
  17. <div style="text-align: right;margin-bottom: 25px;height: 32px;line-height: 32px">标题:</div>
  18. <div style="text-align: right;margin-bottom: 125px;">内容:</div>
  19. <div style="text-align: right;margin-bottom: 125px;">整改要求:</div>
  20. <div style="text-align: right">截图附件:</div>
  21. </div>
  22. <div style="width: 65%;">
  23. <!-- <el-date-picker
  24. style="margin-bottom: 10px"
  25. v-model="value"
  26. type="date"
  27. placeholder="选择日期">
  28. </el-date-picker>-->
  29. <div>
  30. <el-input v-model="title" placeholder="请输入标题" style="margin-bottom: 20px;width: 220px"></el-input>
  31. </div>
  32. <el-input v-model="description" type="textarea" :rows=6 placeholder="请输入内容" resize="none" style="margin-bottom: 20px;width: 350px"></el-input>
  33. <el-input v-model="need" type="textarea" :rows=6 placeholder="请输入整改要求" resize="none" style="margin-bottom: 20px;width: 350px"></el-input>
  34. <div style="width: 130px;height: 130px;background: rgba(15, 86, 86, 0.54);margin-bottom: 10px;mborder-radius: 4px;color: #00ffff;position: relative;font-size: 45px;display: flex;align-items: center">
  35. <i v-if="!fileFlag" class="el-icon-plus" style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);"></i>
  36. <input v-if="!fileFlag" type="file" ref="fileInput" @change="handleFileChange" style="display: none;position: absolute;left: -1000px"/>
  37. <div v-if="!fileFlag" @click="triggerFileInput" style="width: 100%;height: 100%;cursor: pointer;position: absolute;"></div>
  38. <div class="sth" v-if="fileFlag">
  39. <div style="width: 0;height: 0;border-left: 30px solid transparent;border-top: 30px solid #000000;position: absolute;top: 0;right: 0">
  40. </div>
  41. <div class="close-icon" @click="handleRemove"></div>
  42. <div style="width: 100%;height: 50%">
  43. <div style="width: 100%;height: 50%;display: flex;justify-content: center;align-items: start">
  44. <i class="el-icon-view" @click="handlePictureCardPreview"></i>
  45. </div>
  46. <div style="width: 100%;height: 50%;display: flex;justify-content: center;color: #00FFFF;font-size: 14px;align-items: end">预览</div>
  47. </div>
  48. </div>
  49. <img width="100%" :src="dialogImageUrl" v-if="fileFlag" style="height: 100%;object-fit: cover;">
  50. </div>
  51. <el-button style="width: 100px;margin-top: 10px;margin-right: 10px;border: 1px solid #00FFFF;border-radius: 2px;" @click="add">提交</el-button>
  52. <el-button style="width: 100px;margin-top: 10px;background: rgba(15, 86, 86, 0.54);color: #00ffff;border: 1px solid #00FFFF;border-radius: 2px;">取消</el-button>
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import { add } from "@/api/screen/service";
  59. import pinyin from "../data/pinyin.js";
  60. export default {
  61. name: "UnitCamera",
  62. props: {
  63. imgUrl: {
  64. type: String,
  65. default: '',
  66. },
  67. },
  68. data() {
  69. return {
  70. title:'',
  71. description:'',
  72. need:'',
  73. fileFlag: false,
  74. fileList: [],
  75. dialogImageUrl: '',
  76. dialogVisible: false,
  77. disabled: false,
  78. value:"2020-01-01",
  79. check:false,
  80. checked:false
  81. };
  82. },
  83. mounted() {},
  84. mounted() {
  85. this.dialogImageUrl = this.imgUrl
  86. },
  87. methods: {
  88. triggerFileInput(){
  89. this.$refs.fileInput.click();
  90. },
  91. add() {
  92. alert(this.imgUrl)
  93. return
  94. const issueData = {
  95. title:this.title,
  96. description:this.description,
  97. need:this.need,
  98. projectId:'',
  99. delFlag: 0,
  100. file:this.dialogImageUrl,
  101. status: 0,
  102. };
  103. add(issueData).then((res) => {
  104. if (Number(res.code) === 200) {
  105. this.close();
  106. }
  107. }).catch((err) => {
  108. console.error("提交失败:", err);
  109. });
  110. },
  111. handleFileChange(event) {
  112. const file = event.target.files[0];
  113. if (file) {
  114. this.fileFlag = true
  115. const reader = new FileReader();
  116. reader.onload = (e) => {
  117. this.dialogImageUrl = e.target.result; // base64 编码的图片 URL
  118. };
  119. reader.readAsDataURL(file); // 读取文件并转换为 base64 格式
  120. console.log(this.dialogImageUrl)
  121. }
  122. },
  123. handleRemove() {
  124. this.fileFlag = false
  125. this.dialogImageUrl = ''
  126. },
  127. handlePictureCardPreview() {
  128. this.dialogVisible = true;
  129. },
  130. handleCloseView() {
  131. this.dialogVisible = false;
  132. },
  133. change(){
  134. this.checked = !this.check
  135. },
  136. changed(){
  137. this.check = !this.checked
  138. },
  139. choose(){
  140. this.$emit("choose");
  141. },
  142. close() {
  143. this.$emit("close");
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss" scoped>
  149. .close-icon {
  150. position: absolute;
  151. right: 2px;
  152. top: 3px;
  153. width: 15px;
  154. height: 15px;
  155. cursor: pointer;
  156. }
  157. .close-icon::before,
  158. .close-icon::after {
  159. content: '';
  160. position: absolute;
  161. top: 50%;
  162. left: 50%;
  163. width: 10px;
  164. height: 1px;
  165. background-color: #00FFFF;
  166. transform-origin: center;
  167. transform: translate(-50%, -50%);
  168. }
  169. .close-icon::before {
  170. transform: translate(-50%, -50%) rotate(45deg); /* 旋转 45 度 */
  171. }
  172. .close-icon::after {
  173. transform: translate(-50%, -50%) rotate(-45deg); /* 旋转 -45 度 */
  174. }
  175. .myTitle{
  176. color: #00F6EC;
  177. font-size: 16px;
  178. position: absolute;
  179. left: 40px;
  180. top: 6px;
  181. }
  182. .me{
  183. display: flex;flex-wrap: wrap;justify-content: space-around;height: 100%;overflow: auto;
  184. }
  185. .me::-webkit-scrollbar {
  186. display: none;
  187. }
  188. .sth{
  189. width: 100%;
  190. height: 100%;
  191. position: absolute;
  192. font-size: 22px;
  193. cursor: pointer;
  194. opacity: 0;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. flex-wrap: wrap;
  199. transition: background-color 0.5s ease;
  200. }
  201. .sth:hover{
  202. opacity: 1;
  203. background: rgba(5, 28, 38, 0.58);
  204. }
  205. .el-scrollbar {
  206. background: #15696b;
  207. border: 1px solid #00ffff;
  208. ul {
  209. li {
  210. color: #fff;
  211. }
  212. }
  213. }
  214. .el-select-dropdown__item.hover,
  215. .el-select-dropdown__item:hover {
  216. background: #15696b;
  217. color: #00ffff;
  218. }
  219. .el-select-dropdown__item.selected {
  220. color: #00ffff;
  221. }
  222. .el-select .el-input .el-select__caret {
  223. display: none;
  224. }
  225. .issueDia {
  226. position: relative;
  227. width: 640px;
  228. height: 708px;
  229. background-size: cover;
  230. background-image: radial-gradient(circle at 50% 50%, #031417b3 0%, #0C1A1A 84%);
  231. }
  232. ::v-deep .el-input__inner{
  233. color: #00ffff;
  234. background-color: rgba(15, 86, 86, 0.54);
  235. border: 1px solid #00ffff4d;
  236. }
  237. ::v-deep .el-textarea__inner{
  238. color: #00ffff;
  239. background-color: rgba(15, 86, 86, 0.54);
  240. border: 1px solid #00ffff4d;
  241. }
  242. ::v-deep .el-button{
  243. font-weight: bold;
  244. color: rgba(2, 24, 24, 0.71);
  245. background-color: #00ffff;
  246. }
  247. ::v-deep .el-checkbox__inner{
  248. background-color: #15696b;
  249. }
  250. ::v-deep .is-checked .el-checkbox__inner{
  251. color: #00ffff;
  252. background-color: #00ffff;
  253. }
  254. ::v-deep .el-checkbox__inner::after{
  255. border-color: rgba(2, 24, 24, 0.71);
  256. border-width: 2px;
  257. }
  258. ::v-deep .el-checkbox__label{
  259. color: #15696b;
  260. }
  261. ::v-deep .is-checked .el-checkbox__label{
  262. color: #00ffff;
  263. }
  264. ::v-deep .el-input__prefix{
  265. color: #00F6EC;
  266. }
  267. ::v-deep .el-input__inner::placeholder{
  268. color: #199294;
  269. }
  270. ::v-deep .el-textarea__inner::placeholder{
  271. color: #199294;
  272. }
  273. </style>