audit-data-list.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <div :class="[$style.wrapHeight, $style.dataclass]">
  3. <div :class="$style.rowHeight">
  4. <div :class="$style.rowLeft">
  5. <audit-class-tree
  6. ref="auditMaintainCatalogTree"
  7. show-line
  8. top-node-text="数据分类维护"
  9. :is-select-dep="true"
  10. :draggable="true"
  11. :cate="true"
  12. :is-select="true"
  13. @treeSelect="treeSelect"
  14. ></audit-class-tree>
  15. </div>
  16. <div :class="$style.rightcard">
  17. <a-card>
  18. <!-- 高级搜索组件 -->
  19. <audit-advanced-query
  20. :expand="expand"
  21. :search-data="formData"
  22. :ref-name="searchform"
  23. :search-style="{ height: '150px', left: '20px', top: '57px' }"
  24. :search-fun="handleSearch"
  25. @searchedClick="searchedClick"
  26. >
  27. <template>
  28. <a-col :span="12">
  29. <a-form-model-item :label="'分类编号'" prop="categoryId">
  30. <a-input v-model="formData.categoryId" allow-clear />
  31. </a-form-model-item>
  32. </a-col>
  33. <a-col :span="12">
  34. <a-form-model-item :label="'分类名称'" prop="categoryName">
  35. <a-input v-model="formData.categoryName" allow-clear />
  36. </a-form-model-item>
  37. </a-col>
  38. </template>
  39. </audit-advanced-query>
  40. <SdDataTable
  41. :key="key"
  42. ref="dataTable"
  43. :projectlist="true"
  44. :editnode="editnode"
  45. form-id="iamDataCategoryQueryList"
  46. data-url="api/xcoa-mobile/v1/iamdatacategory/iamDataCategoryQueryList"
  47. :columns="columns"
  48. :actions="actions"
  49. :filter-expressions="expressions"
  50. :search-fields="['categoryId', 'categoryName']"
  51. :show-advance-query="true"
  52. @searchbtnClick="searchbtnClick"
  53. >
  54. <template slot="categoryName" slot-scope="text, record">
  55. <a v-if="showNameStatue(record)" @click="dataDetail(record)">{{ text }}</a>
  56. <span v-else :class="$style.invalid">{{ text }}</span>
  57. </template>
  58. </SdDataTable>
  59. </a-card>
  60. </div>
  61. <a-modal
  62. :title="detailInfo.categoryName ? detailInfo.categoryName : ''"
  63. :visible="detailShow"
  64. @cancel="detailShow = false"
  65. >
  66. <a-form-model :model="detailInfo" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
  67. <a-form-model-item :label="'分类名称'">
  68. <a-input v-model="detailInfo.categoryName" disabled />
  69. </a-form-model-item>
  70. <a-form-model-item :label="'分类编号'">
  71. <a-input v-model="detailInfo.categoryId" disabled />
  72. </a-form-model-item>
  73. <a-form-model-item :label="'分类描述'">
  74. <a-input v-model="detailInfo.categoryDesc" disabled />
  75. </a-form-model-item>
  76. <a-form-model-item :label="'权重'">
  77. <a-input v-model="detailInfo.weightNum" disabled />
  78. </a-form-model-item>
  79. <a-form-model-item :label="'排序'">
  80. <a-input v-model="detailInfo.sortNum" disabled />
  81. </a-form-model-item>
  82. </a-form-model>
  83. </a-modal>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import { Modal, message } from 'ant-design-vue'
  89. import axios from '@/common/services/axios-instance'
  90. import auditClassTree from './audit-class-tree.vue'
  91. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  92. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  93. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  94. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  95. import dataService from './data-config'
  96. import SdDataTable from '@/common/components/sd-data-table.vue'
  97. import TableActionTypes from '@/common/services/table-action-types'
  98. export default {
  99. name: 'AuditDataList',
  100. metaInfo: {
  101. title: '数据查看',
  102. },
  103. components: {
  104. SdDataTable,
  105. auditClassTree,
  106. auditAdvancedQuery,
  107. },
  108. mixins: [auditAdvancedQueryMixins, auditAdvancedGroupMixins],
  109. data() {
  110. return {
  111. editnode: true,
  112. key: 0,
  113. searchform: 'searchform',
  114. formData: {
  115. categoryName: '',
  116. categoryId: '',
  117. },
  118. auditOrgId: null,
  119. parentId: 0,
  120. parentCategoryId: '000000',
  121. level: 1,
  122. isEnd: null,
  123. columns: [
  124. {
  125. dataIndex: 'dataCategoryBean.id',
  126. sdHidden: true,
  127. },
  128. {
  129. dataIndex: 'dataCategoryBean.categoryName',
  130. title: '分类名称',
  131. scopedSlots: { customRender: 'categoryName' },
  132. },
  133. {
  134. dataIndex: 'dataCategoryBean.categoryId',
  135. title: '分类编号',
  136. },
  137. {
  138. dataIndex: 'dataCategoryBean.categoryDesc',
  139. title: '分类描述',
  140. },
  141. {
  142. dataIndex: 'dataCategoryBean.weightNum',
  143. title: '权重',
  144. sdHidden: true,
  145. },
  146. {
  147. dataIndex: 'dataCategoryBean.sortNum',
  148. title: '排序',
  149. sdHidden: true,
  150. },
  151. {
  152. dataIndex: 'dataCategoryBean.reservestring1',
  153. sdHidden: true,
  154. },
  155. ],
  156. actions: [
  157. {
  158. label: '授权申请',
  159. permission: null,
  160. type: TableActionTypes.primary,
  161. callback: this.empower,
  162. },
  163. ],
  164. expressions: [],
  165. isroot: true,
  166. className: '',
  167. detailShow: false,
  168. detailInfo: {},
  169. }
  170. },
  171. methods: {
  172. showNameStatue(record) {
  173. return record.dataCategoryBean.reservestring1 === 'true'
  174. },
  175. // 查看详情
  176. dataDetail(record) {
  177. this.detailInfo = record.dataCategoryBean
  178. this.detailShow = true
  179. },
  180. handleSearch() {
  181. this.expressions = []
  182. // 模型编号
  183. if (this.formData.categoryId) {
  184. this.expressions.push({
  185. dataType: 'str',
  186. name: 'categoryId',
  187. op: 'like',
  188. stringValue: `%${this.formData.categoryId}%`,
  189. })
  190. }
  191. // 模型名称
  192. if (this.formData.categoryName) {
  193. this.expressions.push({
  194. dataType: 'str',
  195. name: 'categoryName',
  196. op: 'like',
  197. stringValue: `%${this.formData.categoryName}%`,
  198. })
  199. }
  200. },
  201. treeSelect(selectedKeys, info) {
  202. this.formData.categoryId = ''
  203. this.formData.categoryName = ''
  204. this.expressions = []
  205. if (info.selectedNodes[0].key !== '0') {
  206. const categoryId = info.selectedNodes[0].data.props.props.categoryId
  207. this.expressions = [
  208. {
  209. dataType: 'str',
  210. name: 'categoryId',
  211. op: 'like',
  212. stringValue: `%${categoryId}%`,
  213. },
  214. ]
  215. }
  216. },
  217. refresh() {
  218. this.$refs.dataTable.refresh()
  219. },
  220. // 授权
  221. empower() {
  222. const url = '/sd-flow-guide?code=PRODUCT_IAM_SQSQ' // 新页面要打开的路由地址
  223. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  224. if (refreshFlag) {
  225. // 这里写或者调刷新的方法
  226. this.refresh()
  227. }
  228. })
  229. },
  230. },
  231. }
  232. </script>
  233. <style module lang="scss">
  234. @use '@/common/design' as *;
  235. .wrap-height {
  236. height: 100%;
  237. .row-left {
  238. width: 20%;
  239. }
  240. .row-height {
  241. display: flex;
  242. flex: auto;
  243. height: 100%;
  244. .rightcard {
  245. flex: 1;
  246. width: calc(100% - 20%);
  247. height: 100%;
  248. overflow-y: auto;
  249. }
  250. }
  251. }
  252. .dataclass {
  253. :global(.projectlist .ant-table-empty .ant-table-body) {
  254. overflow-x: hidden !important;
  255. }
  256. :global(span > .ant-btn:nth-child(2)) {
  257. color: #fff;
  258. background-color: #1890ff;
  259. border-color: #1890ff;
  260. }
  261. // :global(.ant-table-placeholder) {
  262. // width: auto;
  263. // }
  264. }
  265. .invalid {
  266. color: #ccc;
  267. }
  268. </style>