promptSettings.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div>
  3. <div class="editDefault">
  4. <el-row :span="24">
  5. <el-col :span="3.3" style="line-height: 40px">
  6. 元素坐标:
  7. </el-col>
  8. <el-col :span="18">
  9. <avue-input v-model="htmlData1.name" placeholder="请点击坐标" :disabled='true'></avue-input>
  10. </el-col>
  11. </el-row>
  12. <el-row :span="24">
  13. <el-col :span="3.3" style="line-height: 40px">
  14. 提示信息:
  15. </el-col>
  16. <el-col :span="18">
  17. <el-input
  18. class="martop15"
  19. style="width:100%;"
  20. type="textarea"
  21. :rows="5"
  22. placeholder="请输入内容"
  23. v-model="textarea"
  24. ></el-input>
  25. </el-col>
  26. </el-row>
  27. <el-row style="text-align: center">
  28. <el-button type="primary"
  29. size="small"
  30. icon="el-icon-circle-plus-outline"
  31. @click="saveTiool()">保存
  32. </el-button> &nbsp;&nbsp;
  33. <el-button type="primary"
  34. size="small"
  35. icon="el-icon-circle-plus-outline"
  36. @click="cleanDefult()">清空
  37. </el-button>
  38. </el-row>
  39. </div>
  40. <div style="border: 1px dotted rgb(187, 187, 187);box-sizing: border-box;padding: 0px 15px;"
  41. class="martop20 marbottom10">
  42. <table @click
  43. class="table martop20 copyTable"
  44. width='100%'
  45. border='1px '
  46. bordercolor="#E5E5E5"
  47. cellpadding='2px'
  48. >
  49. <thead
  50. cellpadding='2px'
  51. height='40px'
  52. >
  53. <tr>
  54. <th width='30%'>元素位置</th>
  55. <th width='30%'>提示语</th>
  56. <th width='20%'>操作</th>
  57. </tr>
  58. </thead>
  59. <tbody height='36px'>
  60. <tr v-for="(item,key) in setsignaTable" :key="key" v-on:click="">
  61. <td>{{ item.colName }}</td>
  62. <td>{{ item.sigRoleName }}</td>
  63. <td align="center"><span style="color:red;cursor: pointer;" v-on:click="deleteTableSig(item.id)">删除</span></td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </div>
  68. </div>
  69. </template>
  70. <script>
  71. import {getSigList, saveDdefual,remove} from "../../../../../api/manager/AdjustForm";
  72. export default {
  73. props: ['pkeyId1', 'htmlData1'],
  74. data() {
  75. return {
  76. textarea: '',
  77. setsignaTable: [],
  78. }
  79. },
  80. methods: {
  81. cleanDefult () {//清空数据
  82. this.textarea='';
  83. },
  84. async saveTiool() {
  85. if(this.htmlData1.tr === '' || this.htmlData1.td === ''){
  86. this.$message({
  87. type: "warning",
  88. message: "请先选择元素"
  89. });
  90. return;
  91. }
  92. if(this.textarea === '' || this.textarea=== ''){
  93. this.$message({
  94. type: "warning",
  95. message: "请输入提示语"
  96. });
  97. return;
  98. }
  99. const {data: res} = await saveDdefual({
  100. trIndex: this.htmlData1.tr,
  101. tdIndex: this.htmlData1.td,
  102. tableId: this.pkeyId1,
  103. textId: this.textarea,
  104. type: '5',
  105. })
  106. if (res.code === 200) {
  107. this.getSingInfo()
  108. this.$message({
  109. type: "success",
  110. message: "操作成功"
  111. });
  112. this.$parent.getExcelHtml(this.pkeyId1);
  113. }
  114. },
  115. async deleteTableSig(ids) {//删除数据
  116. // this.setsignaTable.splice(key, 1);
  117. const {data: res} = await remove(ids);
  118. this.getSingInfo();
  119. if (res.code === 200) {
  120. this.$message({
  121. type: "success",
  122. message: "操作成功"
  123. });
  124. }
  125. },
  126. async getSingInfo() {
  127. const {data: res} = await getSigList(
  128. {
  129. current: 0,
  130. size: 100,
  131. tabId: this.pkeyId1,
  132. type: 5
  133. }
  134. )
  135. if (res.code === 200) {
  136. this.setsignaTable = res.data.records;
  137. }
  138. }
  139. },
  140. created() {
  141. this.getSingInfo();
  142. this.setsignaTable = [];
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. .copyTable td{
  148. user-select:initial !important;
  149. }
  150. </style>