dynamicExcel.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. class='parent'
  36. id='parent'
  37. ></div>
  38. <div class="excelRight">
  39. <setInputTPT
  40. v-if="setUptype===0"
  41. :pkeyId='pkeyId'
  42. @cop='domss'
  43. />
  44. <electronicSignature v-if="setUptype===1" />
  45. <setFormula v-if="setUptype===2" />
  46. <editDefault v-if="setUptype===3" />
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import setInputTPT from './template/setInputTPT.vue'
  53. import electronicSignature from './template/electronicSignature.vue'
  54. import setFormula from './template/setFormula.vue'
  55. import editDefault from './template/editDefault.vue'
  56. import Vue from 'vue'
  57. import dictVue from '../../../system/dict.vue'
  58. export default {
  59. props: ['pkeyId'],
  60. data () {
  61. return {
  62. setUptype: 0,//右侧显示的类型1
  63. }
  64. },
  65. mounted () {
  66. this.cop()
  67. },
  68. methods: {
  69. GoBack () {//返回上一级
  70. this.$emit('remove')
  71. },
  72. async cop () {
  73. var MyComponent = await Vue.extend({
  74. template: localStorage.getItem('excelHtml')
  75. })
  76. var component = new MyComponent().$mount()
  77. let na = document.getElementById('parent')
  78. document.getElementById('parent').appendChild(component.$el);
  79. },
  80. async copss () {
  81. var MyComponent = await Vue.extend({
  82. template: localStorage.getItem('excelHtml')
  83. })
  84. var component = new MyComponent().$mount()
  85. let na = document.getElementById('parent')
  86. na.innerHTML = `<div
  87. class='parent'
  88. id='parent'
  89. ></div>`
  90. document.getElementById('parent').appendChild(component.$el);
  91. },
  92. domss () {
  93. this.copss()
  94. },
  95. },
  96. components: {
  97. setInputTPT,
  98. electronicSignature,
  99. setFormula,
  100. editDefault
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .excelHtnl {
  106. margin: 0 0 0 10px;
  107. background-color: #fff;
  108. box-sizing: border-box;
  109. padding: 0 20px 100px 20px;
  110. height: 100%;
  111. overflow: scroll;
  112. .header {
  113. display: flex;
  114. justify-content: space-between;
  115. height: 50px;
  116. align-items: center;
  117. .GoBack {
  118. color: rgba(0, 82, 216, 1);
  119. text-decoration: underline;
  120. font-family: SourceHanSansSC;
  121. cursor: pointer;
  122. }
  123. }
  124. .excelBox {
  125. margin-top: 10px;
  126. display: flex;
  127. justify-content: flex-start;
  128. .excelRight {
  129. flex-grow: 1;
  130. box-sizing: border-box;
  131. padding: 20px 0px 0px 30px;
  132. }
  133. }
  134. }
  135. </style>