xm-iam-modify-cpmqrzt-handler.vue 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div> </div>
  3. </template>
  4. <script>
  5. import components from './_import-components/xm-iam-modify-cpmqrzt-handler-import'
  6. export default {
  7. name: 'XmIamModifyCpmqrztHandler',
  8. components: {
  9. ...components,
  10. },
  11. data() {
  12. return {
  13. visible: false,
  14. button: {},
  15. initValues: [],
  16. childTable: undefined,
  17. selectedRows: [],
  18. }
  19. },
  20. methods: {
  21. run({ button, eventScript, context: { childTable, selectedRows } }) {
  22. this.button = button
  23. this.childTable = childTable
  24. this.selectedRows = selectedRows
  25. // 根据需修改的字段,获取字段信息
  26. const modifyField = eventScript.fieldName
  27. // 将修改的数据更新到记录中
  28. const modifyData = {}
  29. modifyData[modifyField] = eventScript.fieldValue
  30. this.selectedRows.forEach((r) => {
  31. Object.assign(r, modifyData)
  32. this.childTable.setRowValueById(r.id, r)
  33. })
  34. },
  35. },
  36. }
  37. </script>
  38. <style module lang="scss">
  39. @use '@/common/design' as *;
  40. </style>