123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <template>
- <div>
- <a-modal
- class="modalselectmaintain"
- :body-style="bodyStyle"
- :title="title"
- :destroy-on-close="true"
- :visible="visible"
- :width="modalWidth"
- @ok="handleOk"
- @cancel="handleCancel"
- >
- <!-- 列表 -->
- <SdTable
- ref="SJMXDataTable"
- :row-key="(record, index) => index"
- :columns="columns"
- :data-source="dataList"
- :pagination="false"
- :row-selection="{
- getCheckboxProps() {
- return {}
- },
- selectedRowKeys: selectedRowKeys,
- onChange: onSelectChange,
- }"
- >
- <template slot="type" slot-scope="text, record">
- <span v-if="record.type === 0 || record.type === '0'">非结构化</span>
- <span v-else>结构化</span>
- </template>
- </SdTable>
- </a-modal>
- </div>
- </template>
- <script>
- import SdTable from '@/common/components/sd-table.vue'
- import { message } from 'ant-design-vue'
- import DataService from './data-config'
- export default {
- name: 'AuditClassIndexTable',
- metaInfo: {
- title: '数据索引选择器',
- },
- components: {
- SdTable,
- },
- props: {
- // 弹出窗标题
- title: {
- type: String,
- default: '审搜索引选择器',
- },
- // 弹出窗宽度
- modalWidth: {
- type: String,
- default: '1200px',
- },
- // 弹出窗显示参数
- visible: {
- type: Boolean,
- default: false,
- },
- classData: {
- type: Array,
- default: () => [],
- },
- },
- data() {
- return {
- selectedRowKeys: [],
- selectedRows: [],
- dataUrl: 'api/xcoa-mobile/v1/iamsearchindex/getByCategoryIds',
- dataList: [],
- bodyStyle: {
- minHeight: '700px',
- },
- // 列表展示用
- columns: [
- {
- title: '业务编号',
- dataIndex: 'id',
- },
- {
- title: '索引名',
- dataIndex: 'indexName',
- },
- {
- title: '索引说明',
- dataIndex: 'indexRemark',
- },
- {
- title: '系统名称',
- dataIndex: 'systemName',
- },
- {
- title: '系统来源名称',
- dataIndex: 'indexSource',
- },
- {
- title: '索引类型',
- dataIndex: 'type',
- scopedSlots: { customRender: 'type' },
- },
- {
- title: '归属分类名称',
- dataIndex: 'categoryName',
- },
- // 分类id
- {
- dataIndex: 'categoryId',
- sdHidden: true,
- },
- ],
- // 高级搜索
- searchform: 'searchform',
- expand: false,
- period: [],
- allClassCodes: '',
- }
- },
- watch: {
- classData: {
- handler(val) {
- this.allClassCodes = val.map((item) => item.categoryId).join(',')
- this.getList()
- },
- deep: true,
- },
- },
- methods: {
- onSelectChange(selectedRowKeys, selectedRows) {
- this.selectedRowKeys = selectedRowKeys
- this.selectedRows = selectedRows
- },
- processRes(data) {
- let index = 0
- data.data.forEach((item) => {
- item.id = this.$refs.SJMXDataTable.localPagination.current + '-' + index
- index++
- })
- return data
- },
- getList() {
- DataService.findIndexListDatas(this.allClassCodes).then((res) => {
- this.dataList = res.data
- })
- },
- handleOk(e) {
- this.$parent.visible = !this.$parent.visible
- this.$parent.indexTableShow = !this.$parent.indexTableShow
- // 列表选择事件,返回选择的数据
- this.$emit('listMxSelected', this.selectedRowKeys, this.selectedRows)
- },
- handleCancel(e) {
- this.$parent.visible = !this.$parent.visible
- this.$parent.indexTableShow = !this.$parent.indexTableShow
- },
- // 翻页操作
- onChange(pagination, filters, sorter) {
- this.pageSize = pagination.pageSize
- this.startPosition = (pagination.current - 1) * pagination.pageSize
- },
- // 开启关闭
- searchedClick() {
- this.expand = false
- },
- handleSearch() {
- const formData = this.formData
- // 获取当前表格过滤条件
- this.filterExpressions = []
- // 获取高级搜索的数据
- // 开始修改
- if (formData !== null) {
- if (this.formData.categoryId) {
- this.filterExpressions.push({
- dataType: 'str',
- name: 'categoryId',
- op: 'like',
- stringValue: `${this.formData.categoryId}`,
- })
- }
- }
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- :global(.modalselectmaintain) {
- :global(.ant-modal-body) {
- overflow-x: hidden;
- }
- }
- </style>
|