dynamicExcel.vue 3.2 KB

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