audit-false-problem.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <div :class="$style.rowHeight">
  4. <audit-advanced-query
  5. :expand="expand"
  6. :search-data="searchData"
  7. :ref-name="searchform"
  8. :search-style="{ height: '230px', left: '20px', top: '57px' }"
  9. :search-fun="handleSearch"
  10. @searchedClick="searchedClick"
  11. >
  12. <!-- 插槽放置搜索内容 -->
  13. <template>
  14. <a-row>
  15. <!-- <a-col :span="12">
  16. <a-form-model-item :label="'非问题标签编号'" prop="code">
  17. <a-input v-model="searchData.code" allow-clear />
  18. </a-form-model-item>
  19. </a-col> -->
  20. <a-col :span="12">
  21. <a-form-model-item :label="'非问题标签名称'" prop="name">
  22. <a-input v-model="searchData.name" allow-clear />
  23. </a-form-model-item>
  24. </a-col>
  25. </a-row>
  26. <a-col :span="12">
  27. <a-form-model-item :label="'时间'" prop="operationTime">
  28. <a-range-picker v-model="searchData.operationTime" />
  29. </a-form-model-item>
  30. </a-col>
  31. </template>
  32. </audit-advanced-query>
  33. <a-card>
  34. <SdDataTableEx
  35. ref="sddataTable"
  36. :form-id="formId"
  37. :page-id="pageId"
  38. :data-url="dataUrl"
  39. :columns="columns"
  40. :actions="actions"
  41. :filter-expressions="expressions"
  42. show-selection
  43. :search-fields="['name']"
  44. :show-advance-query="true"
  45. @searchbtnClick="searchbtnClick"
  46. >
  47. <!-- 表格列 -->
  48. <template slot="link" slot-scope="text, record">
  49. <a @click="showFormModal(record.id)">{{ text }}</a>
  50. </template>
  51. <!-- 插槽放置表格内容 -->
  52. <template v-slot:form="{ model }" v-sd-watermark="waterMark" @saved="onSaved">
  53. <!-- <sdFormItem name="" /> -->
  54. <!-- code name description -->
  55. <!-- <SdFormItem name="code" label="非问题标签编号" /> -->
  56. <SdFormItem name="name" label="非问题标签名称" />
  57. <SdFormItem name="type" label="非问题标签类型" />
  58. <SdFormItem name="description" label="非问题标签内容">
  59. <a-textarea v-model="model.description" />
  60. </SdFormItem>
  61. </template>
  62. </SdDataTableEx>
  63. </a-card>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. // 筛选组件
  69. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  70. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  71. // 表格组件 + 表格扩展组件
  72. import SdDataTableEx from '@/common/components/sd-data-table-ex.vue'
  73. // 表格按钮类型
  74. import TableActionTypes from '@/common/services/table-action-types'
  75. import TableColumnTypes from '@/common/services/table-column-types'
  76. // 请求
  77. import SdFormItem from '@/common/components/sd-form-item.vue'
  78. export default {
  79. // 大驼峰文件名
  80. name: 'AuditFalseProblem',
  81. metaInfo: {
  82. // 页面标题
  83. title: '非问题说明',
  84. },
  85. components: {
  86. // 引入组件
  87. SdFormItem,
  88. SdDataTableEx,
  89. auditAdvancedQuery,
  90. },
  91. mixins: [auditAdvancedQueryMixins],
  92. data() {
  93. return {
  94. // 搜索条件
  95. searchData: {
  96. name: '',
  97. // code: '',
  98. operationTime: [],
  99. },
  100. // 搜索接口传参
  101. expressions: [],
  102. // 搜索组件ref
  103. searchform: 'searchform',
  104. // 搜索条件展开
  105. expand: false,
  106. // 列表请求地址
  107. dataUrl: 'api/xcoa-mobile/v1/iam-page/businessList',
  108. // pageId
  109. pageId: 'audit/maintain/iamProblemStatement',
  110. // formId
  111. formId: 'iamProblemStatement',
  112. // 表头
  113. columns: [
  114. {
  115. title: '序号',
  116. dataIndex: 'sortNumber',
  117. width: '80px',
  118. customRender: (text, record, index) => `${index + 1}`,
  119. },
  120. // code name description
  121. {
  122. title: '非问题标签编号',
  123. dataIndex: 'id',
  124. },
  125. {
  126. title: '非问题标签名称',
  127. dataIndex: 'name',
  128. scopedSlots: { customRender: 'link' },
  129. },
  130. {
  131. title: '非问题标签类型',
  132. dataIndex: 'type',
  133. },
  134. {
  135. title: '非问题标签内容',
  136. dataIndex: 'description',
  137. },
  138. {
  139. title: '创建时间',
  140. dataIndex: 'creationTime',
  141. sdRender: TableColumnTypes.date,
  142. },
  143. ],
  144. // 按钮
  145. actions: [
  146. {
  147. label: '新增',
  148. id: 'create',
  149. permission: 'create',
  150. type: TableActionTypes.primary,
  151. callback: this.showFormModal,
  152. },
  153. // 删除
  154. {
  155. label: '删除',
  156. id: 'delete',
  157. type: TableActionTypes.ex.delete, // 删除按钮,不需要回调,会自动处理(对sd-data-table无效)
  158. },
  159. ],
  160. // 表单提交地址
  161. pagePath: 'audit/maintain/iamProblemStatement',
  162. // 领域数据
  163. areaOption: [],
  164. }
  165. },
  166. methods: {
  167. // 搜索方法
  168. handleSearch() {
  169. // 搜索条件
  170. this.expressions = []
  171. const searchDataKeys = Object.keys(this.searchData)
  172. searchDataKeys.map((item) => {
  173. if (item !== 'operationTime' && this.searchData[item] !== '') {
  174. this.expressions.push({
  175. dataType: 'str',
  176. name: item,
  177. op: 'like',
  178. stringValue: `%${this.searchData[item]}%`,
  179. })
  180. }
  181. })
  182. if (this.searchData.operationTime.length === 2) {
  183. this.searchData.operationTime.map((item, index) => {
  184. this.expressions.push({
  185. dataType: 'long',
  186. name: 'creationTime',
  187. op: index === 0 ? 'ge' : 'lt',
  188. longValue: item._d.getTime(),
  189. })
  190. })
  191. }
  192. },
  193. // 显示表单
  194. showFormModal(id = null) {
  195. this.$refs.sddataTable.showDetailModal(id, this.pagePath)
  196. },
  197. },
  198. }
  199. </script>
  200. <style lang="scss" module>
  201. @use '@/common/design' as *;
  202. .wrap-height {
  203. height: 100%;
  204. .row-height {
  205. position: relative;
  206. display: flex;
  207. flex: auto;
  208. height: 100%;
  209. .rightcard {
  210. flex: 1;
  211. width: calc(100% - 20%);
  212. height: 100%;
  213. }
  214. }
  215. }
  216. </style>