editDefault.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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-check"
  31. @click="saveDdefual()">保存
  32. </el-button> &nbsp;&nbsp;
  33. <el-button
  34. class="el-button el-button--default el-button--small"
  35. icon="el-icon-use"
  36. @click="cleanDefult()">清&nbsp;&nbsp;空
  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"
  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, remove, saveDdefual} from "../../../../../api/manager/AdjustForm";
  72. export default {
  73. props: ['pkeyId1', 'htmlData1'],
  74. data() {
  75. return {
  76. textarea: '',
  77. setsignaTable: []
  78. }
  79. },
  80. methods: {
  81. async saveDdefual() {
  82. if(this.htmlData1.tr === '' || this.htmlData1.td === ''){
  83. this.$message({
  84. type: "warning",
  85. message: "请先选择元素"
  86. });
  87. return;
  88. }
  89. if(this.textarea === '' || this.textarea=== ''){
  90. this.$message({
  91. type: "warning",
  92. message: "请输入默认值"
  93. });
  94. return;
  95. }
  96. const {data: res} = await saveDdefual({
  97. trIndex: this.htmlData1.tr,
  98. tdIndex: this.htmlData1.td,
  99. tableId: this.pkeyId1,
  100. textId: this.textarea,
  101. type: '4',
  102. })
  103. if (res.code === 200) {
  104. this.getSingInfo();
  105. this.$message({
  106. type: "success",
  107. message: "操作成功"
  108. });
  109. this.$parent.copss();
  110. }
  111. },
  112. async deleteTableSig (ids) {//删除数据
  113. const {data: res} = await remove(ids);
  114. this.getSingInfo();
  115. if (res.code === 200) {
  116. this.$message({
  117. type: "success",
  118. message: "操作成功"
  119. });
  120. }
  121. },
  122. cleanDefult () {//删除数据
  123. this.textarea='';
  124. },
  125. async getSingInfo() {
  126. const {data: res} = await getSigList(
  127. {
  128. current: 0,
  129. size: 100,
  130. tabId: this.pkeyId1,
  131. type:4
  132. }
  133. )
  134. if (res.code === 200) {
  135. this.setsignaTable = res.data.records;
  136. }
  137. }
  138. },
  139. created() {
  140. this.getSingInfo();
  141. this.setsignaTable = [];
  142. this.textarea='';
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. </style>