issueSubDia.vue 8.4 KB

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