promptSettings.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. else if(this.htmlData1.name === '警告' ){
  93. this.$message({
  94. type: "warning",
  95. message: "警告框不能配置提示信息"
  96. });
  97. return;
  98. }
  99. if(this.textarea === '' || this.textarea=== ''){
  100. this.$message({
  101. type: "warning",
  102. message: "请输入提示语"
  103. });
  104. return;
  105. }
  106. // let isCan=true
  107. // this.setsignaTable.forEach(element => {
  108. // if (isCan) {
  109. // // 如果满足条件,执行相应的操作,并将条件修改为 false
  110. // if (element.colKey===this.htmlData1.keyname) { // 这里 someConditionMet 是你的条件判断函数
  111. // isCan = false;
  112. // }
  113. // }
  114. // });
  115. // if(isCan){
  116. const {data: res} = await saveDdefual({
  117. trIndex: this.htmlData1.tr,
  118. tdIndex: this.htmlData1.td,
  119. tableId: this.pkeyId1,
  120. textId: this.textarea,
  121. type: '5',
  122. })
  123. if (res.code === 200) {
  124. this.getSingInfo()
  125. this.$message({
  126. type: "success",
  127. message: "操作成功"
  128. });
  129. this.$parent.getExcelHtml(this.pkeyId1);
  130. }
  131. // }
  132. // else{
  133. // this.$message.warning('一个字段只能配置一个提示信息')
  134. // }
  135. },
  136. async deleteTableSig(ids) {//删除数据
  137. // this.setsignaTable.splice(key, 1);
  138. const {data: res} = await remove(ids);
  139. this.getSingInfo();
  140. if (res.code === 200) {
  141. this.$message({
  142. type: "success",
  143. message: "操作成功"
  144. });
  145. }
  146. },
  147. async getSingInfo() {
  148. const {data: res} = await getSigList(
  149. {
  150. current: 0,
  151. size: 100,
  152. tabId: this.pkeyId1,
  153. type: 5
  154. }
  155. )
  156. if (res.code === 200) {
  157. this.setsignaTable = res.data.records;
  158. }
  159. }
  160. },
  161. created() {
  162. this.getSingInfo();
  163. this.setsignaTable = [];
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .copyTable td{
  169. user-select:initial !important;
  170. }
  171. </style>