audit-maintain-quote-list.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <div :class="$style.rowHeight">
  4. <div :class="$style.rightcard">
  5. <a-card>
  6. <!-- 高级搜索组件 -->
  7. <audit-advanced-query
  8. :expand="expand"
  9. :search-data="formData"
  10. :ref-name="searchform"
  11. :search-style="{ height: '150px', left: '20px', top: '57px' }"
  12. :search-fun="handleSearch"
  13. @searchedClick="searchedClick"
  14. >
  15. <template>
  16. <a-col :span="12">
  17. <a-form-model-item :label="'模型名称'" prop="tagCode">
  18. <a-input v-model="formData.modelName" allow-clear />
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :span="12">
  22. <a-form-model-item :label="'模型编号'" prop="modelName">
  23. <a-input v-model="formData.modelCode" allow-clear />
  24. </a-form-model-item>
  25. </a-col>
  26. </template>
  27. </audit-advanced-query>
  28. <sd-data-table
  29. ref="SJMXDataTable"
  30. :filter-expressions="expressions"
  31. :columns="columns"
  32. :actions="actions"
  33. form-id="iamModelMaintainRankList"
  34. data-url="api/xcoa-mobile/v1/iammodelmaintain/iamModelMaintainRankList"
  35. :search-fields="['modelCode', 'modelName']"
  36. show-selection
  37. :show-advance-query="true"
  38. @searchbtnClick="searchbtnClick"
  39. >
  40. <div slot="islink" slot-scope="text, record">
  41. <!-- 本身是创建人,或者有共享查看权限 -->
  42. <a v-if="rowNameStatus(record)" :title="text" @click="rowClick(record)">{{ text }}</a>
  43. <span v-else :title="text">{{ text }}</span>
  44. </div>
  45. </sd-data-table>
  46. </a-card>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  53. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  54. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  55. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  56. import components from './_import-components/audit-view-list-import'
  57. import { getUserInfo } from '@/common/store-mixin'
  58. export default {
  59. name: 'AuditMaintainQuoteList',
  60. metaInfo: {
  61. title: '模型引用排行',
  62. },
  63. components: {
  64. ...components,
  65. auditAdvancedQuery,
  66. },
  67. mixins: [auditAdvancedQueryMixins, auditAdvancedGroupMixins],
  68. data() {
  69. return {
  70. key: 0,
  71. treeData: [],
  72. searchform: 'searchform',
  73. formData: {
  74. modelName: '',
  75. modelCode: '',
  76. },
  77. formId: 'iamModelMaintain',
  78. columns: [
  79. {
  80. title: '排行',
  81. dataIndex: 'sortNumber',
  82. width: '70px',
  83. customRender: (text, record, index) => `${index + 1}`,
  84. },
  85. {
  86. title: '模型名称',
  87. dataIndex: 'modelName',
  88. scopedSlots: { customRender: 'islink' },
  89. },
  90. {
  91. title: '模型编号',
  92. dataIndex: 'modelCode',
  93. },
  94. // 标签描述
  95. {
  96. title: '引用次数',
  97. dataIndex: 'reservelong5',
  98. },
  99. // 创建人
  100. {
  101. title: '创建人',
  102. dataIndex: 'reservestring3',
  103. },
  104. ],
  105. expressions: [
  106. {
  107. dataType: 'str',
  108. name: 'catalogId',
  109. op: 'eq',
  110. stringValue: 0,
  111. },
  112. ],
  113. catalogId: null,
  114. catalogName: '',
  115. isroot: true,
  116. }
  117. },
  118. computed: {
  119. userInfoData() {
  120. return getUserInfo()
  121. },
  122. },
  123. methods: {
  124. rowNameStatus(record) {
  125. return record.reservelong1 === 1 || record.creatorId === this.userInfoData.id
  126. },
  127. refresh() {
  128. return this.$refs.SJMBKDataTable.refresh(true)
  129. },
  130. rowClick(record) {
  131. const url = '/audit-maintain-from?record=' + record.id + '&type=readonly' // 新页面要打开的路由地址
  132. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  133. if (refreshFlag) {
  134. this.refresh()
  135. }
  136. })
  137. },
  138. // 查询
  139. handleSearch() {
  140. this.expressions = []
  141. // 模型编号
  142. if (this.formData.modelCode) {
  143. this.expressions.push({
  144. dataType: 'str',
  145. name: 'modelCode',
  146. op: 'like',
  147. stringValue: `%${this.formData.modelCode}%`,
  148. })
  149. }
  150. // 模型名称
  151. if (this.formData.modelName) {
  152. this.expressions.push({
  153. dataType: 'str',
  154. name: 'modelName',
  155. op: 'like',
  156. stringValue: `%${this.formData.modelName}%`,
  157. })
  158. }
  159. },
  160. },
  161. }
  162. </script>
  163. <style module lang="scss">
  164. @use '@/common/design' as *;
  165. .wrap-height {
  166. height: 100%;
  167. .row-height {
  168. display: flex;
  169. flex: auto;
  170. height: 100%;
  171. .rightcard {
  172. flex: 1;
  173. width: calc(100% - 20%);
  174. height: 100%;
  175. }
  176. }
  177. }
  178. .no-action {
  179. color: $text-color-secondary;
  180. }
  181. </style>