dynamicExcel.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="excelHtnl">
  3. <div class="header">
  4. <div class="flexStar">
  5. <h2>编辑WBS库</h2>
  6. <div
  7. class="GoBack marleft20"
  8. @click="GoBack()"
  9. >
  10. 返回上一级
  11. </div>
  12. </div>
  13. <div>
  14. <el-button
  15. type="info"
  16. size="small"
  17. @click="setUptype=0"
  18. >设置输入框</el-button>
  19. <el-button
  20. type="info"
  21. size="small"
  22. @click="setUptype=1"
  23. >电签位置配置</el-button>
  24. <el-button
  25. type="success"
  26. size="small"
  27. @click="setUptype=2"
  28. >设置公式开放条件</el-button>
  29. <el-button
  30. type="primary"
  31. size="small"
  32. @click="setUptype=3"
  33. >编辑默认信息</el-button>
  34. <el-button
  35. type="info"
  36. size="small"
  37. @click="setUptype=4"
  38. >提示设置</el-button>
  39. </div>
  40. </div>
  41. <div class="excelBox">
  42. <div
  43. style="width:60%;"
  44. class='parent'
  45. id='parent'
  46. ></div>
  47. <div
  48. class="excelRight"
  49. style="width:30%;margin-left:6%;"
  50. >
  51. <setInputTPT
  52. v-if="setUptype===0"
  53. :pkeyId='pkeyId'
  54. @cop='domss'
  55. :htmlData="htmlData"
  56. />
  57. <electronicSignature v-if="setUptype===1" />
  58. <setFormula v-if="setUptype===2" />
  59. <editDefault v-if="setUptype===3" />
  60. <promptSettings v-if="setUptype===4" />
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import setInputTPT from './template/setInputTPT.vue'
  67. import electronicSignature from './template/electronicSignature.vue'
  68. import setFormula from './template/setFormula.vue'
  69. import editDefault from './template/editDefault.vue'
  70. import promptSettings from './template/promptSettings.vue'
  71. import Vue from 'vue'
  72. // import dictVue from '../../../system/dict.vue'
  73. export default {
  74. props: ['pkeyId'],
  75. data () {
  76. return {
  77. setUptype: 0,//右侧显示的类型1
  78. htmlData: {
  79. name: '',
  80. tr: '',
  81. td: ''
  82. }
  83. }
  84. },
  85. mounted () {
  86. this.cop()
  87. },
  88. methods: {
  89. GoBack () {//返回上一级
  90. this.$emit('remove')
  91. },
  92. async cop () {
  93. let _that = this
  94. var MyComponent = await Vue.extend({
  95. template: localStorage.getItem('excelHtml'),
  96. data () {
  97. return {
  98. formData: {}
  99. }
  100. },
  101. methods: {
  102. getInformation (name, tr, td) {//鼠标右键事件
  103. _that.getInformation(name, tr, td)
  104. },
  105. }
  106. })
  107. var component = new MyComponent().$mount()
  108. document.getElementById('parent').appendChild(component.$el);
  109. },
  110. async copss () {
  111. let _that = this
  112. var MyComponent = await Vue.extend({
  113. template: localStorage.getItem('excelHtml'),
  114. data () {
  115. return {
  116. formData: {}
  117. }
  118. },
  119. methods: {
  120. getInformation (name, tr, td) {//鼠标右键事件
  121. _that.getInformation(name, tr, td)
  122. },
  123. }
  124. })
  125. var component = new MyComponent().$mount()
  126. let na = document.getElementById('parent')
  127. na.innerHTML = `<div
  128. class='parent'
  129. id='parent'
  130. ></div>`
  131. document.getElementById('parent').appendChild(component.$el);
  132. },
  133. domss () {
  134. this.copss()
  135. },
  136. getInformation (name, tr, td) {//鼠标点击事件
  137. this.htmlData = {
  138. name,
  139. tr,
  140. td
  141. }
  142. },
  143. },
  144. components: {
  145. setInputTPT,
  146. electronicSignature,
  147. setFormula,
  148. editDefault,
  149. promptSettings
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .excelHtnl {
  155. margin: 0 0 0 10px;
  156. background-color: #fff;
  157. box-sizing: border-box;
  158. padding: 0 20px 100px 20px;
  159. height: 100%;
  160. overflow: scroll;
  161. .header {
  162. display: flex;
  163. justify-content: space-between;
  164. height: 50px;
  165. align-items: center;
  166. .GoBack {
  167. color: rgba(0, 82, 216, 1);
  168. text-decoration: underline;
  169. display: flex;
  170. align-items: center;
  171. font-family: SourceHanSansSC;
  172. cursor: pointer;
  173. }
  174. }
  175. .excelBox {
  176. margin-top: 10px;
  177. display: flex;
  178. justify-content: flex-start;
  179. .excelRight {
  180. flex-grow: 1;
  181. box-sizing: border-box;
  182. padding: 20px 0px 0px 30px;
  183. }
  184. }
  185. }
  186. </style>