word.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <div class="o_box">
  3. <div class="o_content">
  4. <span>{{ lang.ssInputContent }}</span>
  5. <textarea v-autoHeight="38" rows="1" class="binfo_input binfo_textarea" cols v-model="checkJson.content"
  6. :placeholder="lang.Enterpronounce" @change="setJson"></textarea>
  7. </div>
  8. <div class="o_content">
  9. <span>{{ lang.AddImage }}</span>
  10. <div class="o_uploadbox_img" v-if="checkJson.img">
  11. <div class="pic_mask">
  12. <span @click="checkImg(checkJson.img)">{{ lang.ssView }}</span>
  13. <span @click="deleteImg()">{{ lang.ssDelete }}</span>
  14. </div>
  15. <img :src="checkJson.img" alt="">
  16. </div>
  17. <div class="o_uploadbox" v-if="!checkJson.img" @click="getImg()">{{ lang.AutoGenerate }}</div>
  18. <div class="o_uploadbox" style="padding: 0 6px;" @click="addImg($event)" v-if="!checkJson.img">
  19. <span class="icon_pic"></span>
  20. <input type="file" accept="image/*" style="display: none" @change="beforeUpload($event)" />
  21. </div>
  22. </div>
  23. <div v-if="proVisible" class="mask">
  24. <div class="progressBox">
  25. <div class="lbox">
  26. <img src="../../../../../assets/loading.gif" />{{ lang.ssUploadWait }}
  27. </div>
  28. <div style="margin-bottom: 10px">
  29. <span>{{
  30. isFinishSize
  31. }}M</span>
  32. /
  33. <span>{{
  34. isAllSize
  35. }}M</span>
  36. </div>
  37. <el-progress :text-inside="true" :stroke-width="20" :percentage="progress
  38. ? progress
  39. : 0
  40. " style="width: 80%"></el-progress>
  41. </div>
  42. </div>
  43. <gpt-img :sysPicVisible.sync="sysPicVisible" :value="checkJson.content" @setImg="setImg"></gpt-img>
  44. </div>
  45. </template>
  46. <script>
  47. import minxin from './minxins/minxin';
  48. export default {
  49. mixins: [minxin],
  50. props: {
  51. cjson: {
  52. type: Object,
  53. },
  54. },
  55. data() {
  56. return {
  57. checkJson: {},
  58. }
  59. },
  60. methods: {
  61. setJson() {
  62. this.$emit('setJson', this.checkJson)
  63. },
  64. setImg(url){
  65. this.checkJson.img = url
  66. this.$emit('setJson', this.checkJson)
  67. }
  68. },
  69. watch: {
  70. cjson: {
  71. handler: function (newVal, oldVal) {
  72. this.checkJson = this.depthCopy(newVal);
  73. },
  74. deep: true,
  75. },
  76. imgUrl: {
  77. handler: function (newVal, oldVal) {
  78. this.checkJson.img = newVal
  79. this.$forceUpdate()
  80. this.$emit('setJson', this.checkJson)
  81. },
  82. deep: true,
  83. },
  84. },
  85. mounted() {
  86. this.checkJson = this.depthCopy(this.cjson);
  87. }
  88. }
  89. </script>
  90. <style scoped>
  91. .o_box {
  92. width: 100%;
  93. box-sizing: border-box;
  94. padding: 12px 16px 12px 48px;
  95. background: #f5f6f7;
  96. position: relative;
  97. }
  98. .binfo_input {
  99. width: 100%;
  100. margin: 0;
  101. padding: 8px;
  102. display: block;
  103. min-width: 0;
  104. outline: none;
  105. box-sizing: border-box;
  106. background: none;
  107. border: none;
  108. border-radius: 4px;
  109. background: #fff;
  110. font-size: 16px;
  111. resize: none;
  112. font-family: 'Microsoft YaHei';
  113. min-height: 38px;
  114. /* border: 1px solid #3682fc00; */
  115. border: 1.5px solid #CAD1DC;
  116. }
  117. .binfo_textarea {
  118. border: 1.5px solid #CAD1DC;
  119. font-size: 14px;
  120. resize: none;
  121. /* background: #f6f6f6; */
  122. font-family: 'Microsoft YaHei';
  123. }
  124. .binfo_input:focus-visible {
  125. border: 1.5px solid #3681FC !important;
  126. }
  127. .o_content {
  128. display: flex;
  129. color: #000;
  130. font-size: 14px;
  131. }
  132. .o_content+.o_content {
  133. margin-top: 10px;
  134. }
  135. .o_content>span {
  136. min-width: fit-content;
  137. margin-right: 12px;
  138. line-height: 38px;
  139. }
  140. .o_uploadbox {
  141. height: 32px;
  142. padding: 0 8px;
  143. background: #eee;
  144. line-height: 32px;
  145. margin-top: 3px;
  146. font-size: 14px;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. cursor: pointer;
  151. }
  152. .o_uploadbox+.o_uploadbox {
  153. margin-left: 12px;
  154. }
  155. .icon_pic {
  156. width: 20px;
  157. height: 20px;
  158. background-image: url('../../../../../assets/icon/englishVoice/icon_picture.png');
  159. background-size: 100% 100%;
  160. display: block;
  161. }
  162. .mask {
  163. background-color: rgb(0 0 0 / 30%);
  164. /* position: fixed; */
  165. position: absolute;
  166. top: 0;
  167. left: 0;
  168. width: 100%;
  169. height: 100%;
  170. z-index: 90;
  171. display: flex;
  172. align-items: center;
  173. justify-content: center;
  174. }
  175. .progressBox {
  176. width: 300px;
  177. height: 150px;
  178. background: #fff;
  179. border-radius: 10px;
  180. box-shadow: 0 0 6px 1px #bfbfbf;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. flex-direction: column;
  185. position: relative;
  186. color: #6c6c6c;
  187. }
  188. .progressBox>>>.el-progress-bar__outer {
  189. background-color: #d1dfff !important;
  190. }
  191. .progressBox .lbox {
  192. height: 50px;
  193. font-size: 19px;
  194. display: flex;
  195. align-items: center;
  196. color: #747474;
  197. }
  198. .progressBox .lbox img {
  199. width: 40px;
  200. margin-right: 20px;
  201. }
  202. .closeCss {
  203. position: absolute;
  204. top: 8px;
  205. right: 8px;
  206. cursor: pointer;
  207. width: 20px;
  208. height: 20px;
  209. }
  210. .closeCss>img {
  211. width: 100%;
  212. height: 100%;
  213. }
  214. .o_uploadbox_img {
  215. width: 100px;
  216. height: 100px;
  217. border-radius: 5px;
  218. position: relative;
  219. overflow: hidden;
  220. }
  221. .o_uploadbox_img>img {
  222. width: 100%;
  223. height: 100%;
  224. object-fit: cover;
  225. }
  226. .o_uploadbox_img:hover .pic_mask {
  227. display: flex;
  228. }
  229. .pic_mask {
  230. position: absolute;
  231. width: 100%;
  232. height: 100%;
  233. background: rgba(0, 0, 0, .3);
  234. flex-direction: column;
  235. justify-content: center;
  236. align-items: center;
  237. top: 0;
  238. left: 0;
  239. color: #458dff;
  240. display: none;
  241. border-radius: 5px;
  242. }
  243. .pic_mask>span {
  244. cursor: pointer;
  245. font-size: 14px;
  246. color: #fff;
  247. }
  248. .pic_mask>span+span {
  249. margin-top: 10px;
  250. }</style>