dynamicExcel.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <div class="excelHtnl">
  3. <div
  4. class="header"
  5. style=" position: absolute;left:10px;top:0"
  6. >
  7. <div class="flexStar">
  8. <h2>编辑WBS库</h2>
  9. <div
  10. class="GoBack marleft20"
  11. @click="GoBack()"
  12. >
  13. 返回上一级
  14. </div>
  15. </div>
  16. <div style="width: 37%;">
  17. <avue-tabs :option="option" @change="handleChange"></avue-tabs>
  18. </div>
  19. </div>
  20. <div
  21. class="excelBox"
  22. style="margin-top:40px;height: 100%;"
  23. >
  24. <div
  25. style="width:60%;height: 100%;overflow: scroll;"
  26. class='parent'
  27. id='parent'
  28. ></div>
  29. <div class="excelRight" style="width:30%;margin-left:4%;height: 100%;overflow: scroll;" >
  30. <span v-if="type.prop==='tab1'">
  31. <setInputTPT
  32. v-if="type.prop==='tab1'"
  33. :pkeyId='pkeyId'
  34. @cop='domss'
  35. :htmlData="htmlData"
  36. />
  37. </span>
  38. <span v-else-if="type.prop==='tab2'"> <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
  39. <span v-else-if="type.prop==='tab3'"> <setFormula :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
  40. <span v-else-if="type.prop==='tab4'"> <editDefault :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
  41. <span v-else-if="type.prop==='tab5'"> <promptSettings :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import setInputTPT from './template/setInputTPT.vue'
  48. import electronicSignature from './template/electronicSignature.vue'
  49. import setFormula from './template/setFormula.vue'
  50. import editDefault from './template/editDefault.vue'
  51. import promptSettings from './template/promptSettings.vue'
  52. import Vue from 'vue'
  53. // import dictVue from '../../../system/dict.vue'
  54. export default {
  55. props: ['pkeyId'],
  56. data () {
  57. return {
  58. setUptype: 0,//右侧显示的类型1
  59. htmlData: {
  60. name: '',
  61. tr: '',
  62. td: ''
  63. },
  64. type:{},
  65. option:{
  66. column: [{
  67. label: '设置输入框',
  68. prop: 'tab1',
  69. width: 10,
  70. }, {
  71. label: '电签位置配置',
  72. prop: 'tab2',
  73. }, {
  74. label: '设置公式开放条件',
  75. prop: 'tab3',
  76. }, {
  77. label: '编辑默认信息',
  78. prop: 'tab4',
  79. }, {
  80. label: '提示设置',
  81. prop: 'tab5',
  82. }
  83. ]
  84. }
  85. }
  86. },
  87. mounted () {
  88. this.cop()
  89. this.type = this.option.column[0];
  90. },
  91. methods: {
  92. GoBack () {//返回上一级
  93. this.$emit('remove')
  94. },
  95. handleChange(column) {
  96. this.type = column;
  97. },
  98. async cop () {
  99. let _that = this
  100. console.log("11")
  101. var MyComponent = await Vue.extend({
  102. template: localStorage.getItem('excelHtml'),
  103. data () {
  104. return {
  105. formData: {},
  106. getTokenHeader: {}
  107. }
  108. },
  109. methods: {
  110. getInformation (name, tr, td) {//鼠标右键事件
  111. _that.getInformation(name, tr, td)
  112. },
  113. formUploadSuccess(){},
  114. formUploadExceed(){},
  115. formUploadLoading(){},
  116. delTableFormFile(){},
  117. formUploadError(){},
  118. uploadprogress(){}
  119. }
  120. })
  121. var component = new MyComponent().$mount()
  122. document.getElementById('parent').appendChild(component.$el);
  123. },
  124. async copss () {
  125. let _that = this
  126. console.log("22")
  127. var MyComponent = await Vue.extend({
  128. template: localStorage.getItem('excelHtml'),
  129. data () {
  130. return {
  131. formData: {},
  132. getTokenHeader: {}
  133. }
  134. },
  135. methods: {
  136. getInformation (name, tr, td) {//鼠标右键事件
  137. _that.getInformation(name, tr, td)
  138. },
  139. formUploadSuccess(){},
  140. formUploadExceed(){},
  141. formUploadLoading(){},
  142. delTableFormFile(){},
  143. formUploadError(){},
  144. uploadprogress(){}
  145. }
  146. })
  147. var component = new MyComponent().$mount()
  148. let na = document.getElementById('parent')
  149. na.innerHTML = `<div
  150. class='parent'
  151. id='parent'
  152. ></div>`
  153. document.getElementById('parent').appendChild(component.$el);
  154. },
  155. domss () {
  156. this.copss()
  157. },
  158. getInformation (name, tr, td) {//鼠标点击事件
  159. this.htmlData = {
  160. name,
  161. tr,
  162. td
  163. }
  164. },
  165. },
  166. components: {
  167. setInputTPT,
  168. electronicSignature,
  169. setFormula,
  170. editDefault,
  171. promptSettings
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .excelHtnl {
  177. margin: 0 0 0 10px;
  178. background-color: #fff;
  179. box-sizing: border-box;
  180. padding: 0 20px 100px 20px;
  181. height: 100%;
  182. .header {
  183. border-radius: 4px;
  184. box-sizing: border-box;
  185. width: calc(100% - 20px);
  186. background-color: #fff;
  187. display: flex;
  188. justify-content: space-between;
  189. z-index: 99;
  190. height: 50px;
  191. align-items: center;
  192. .GoBack {
  193. color: rgba(0, 82, 216, 1);
  194. text-decoration: underline;
  195. display: flex;
  196. align-items: center;
  197. font-family: SourceHanSansSC;
  198. cursor: pointer;
  199. }
  200. }
  201. .excelBox {
  202. margin-top: 10px;
  203. display: flex;
  204. justify-content: flex-start;
  205. .excelRight {
  206. flex-grow: 1;
  207. box-sizing: border-box;
  208. padding: 20px 0px 0px 30px;
  209. }
  210. }
  211. }
  212. // 设置图片样式
  213. .hc-upload-table-form {
  214. position: relative;
  215. height: 100%;
  216. display: flex;
  217. justify-content: center;
  218. align-items: center;
  219. }
  220. .hc-upload-table-form .el-upload {
  221. position: relative;
  222. flex: 1;
  223. height: 100%;
  224. color: #ccc;
  225. }
  226. .hc-upload-table-form .el-upload .hc-table-form-icon {
  227. font-size: 24px;
  228. font-weight: 100;
  229. }
  230. .hc-upload-table-form .el-upload .hc-table-form-img {
  231. width: 100%;
  232. height: 100%;
  233. }
  234. </style>