123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <template>
- <div>
- <a-modal
- class="modalselectmaintain"
- :body-style="bodyStyle"
- :title="title"
- :destroy-on-close="true"
- :visible="visible"
- :width="modalWidth"
- @ok="handleOk"
- @cancel="handleCancel"
- >
- <audit-advanced-query
- :expand="expand"
- :search-data="formData"
- :ref-name="searchform"
- :search-style="{ height: 'auto', left: '21px', top: '105px' }"
- :search-fun="handleSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-col :span="12">
- <a-form-model-item :label="'模型编号'" prop="modelCode">
- <a-input v-model="formData.modelCode" allow-clear />
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item :label="'模型名称'" prop="modelName">
- <a-input v-model="formData.modelName" allow-clear />
- </a-form-model-item>
- </a-col>
- </template>
- </audit-advanced-query>
- <!-- 列表 -->
- <sd-data-table-ex
- ref="SJMXDataTable"
- :show-advance-btn="true"
- form-id="iamModelMaintain"
- page-id="audit/maintain/iamModelMaintain"
- :pagination="{ pageSize: 10 }"
- :filter-expressions="filterExpressions"
- :check-type="'checkbox'"
- :columns="columns"
- :show-advance-query="true"
- :search-fields="['modelCode', 'modelName']"
- show-selection
- :process-res="processRes"
- @searchbtnClick="searchbtnClick"
- @onChange="onChange"
- >
- </sd-data-table-ex>
- </a-modal>
- </div>
- </template>
- <script>
- import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
- import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
- import components from './_import-components/audit-select-maintain-import'
- import { message } from 'ant-design-vue'
- const columns = [
- {
- title: '序号',
- dataIndex: 'sortNumber',
- customRender: (text, record, index) => `${index + 1}`,
- width: '80px',
- },
- {
- title: '模型编号',
- dataIndex: 'modelCode',
- },
- {
- title: '模型名称',
- dataIndex: 'modelName',
- scopedSlots: { customRender: 'islink' },
- },
- {
- title: '风险描述',
- dataIndex: 'rick',
- },
- {
- title: 'id',
- dataIndex: 'id',
- sdHidden: true,
- },
- ]
- export default {
- name: 'AuditSelectMaintain',
- metaInfo: {
- title: '审计模型选择器',
- },
- components: {
- ...components,
- auditAdvancedQuery,
- },
- mixins: [auditAdvancedQueryMixins],
- props: {
- // 弹出窗标题
- title: {
- type: String,
- default: '审计模型选择器',
- },
- // 弹出窗宽度
- modalWidth: {
- type: String,
- default: '1200px',
- },
- // 弹出窗显示参数
- visible: {
- type: Boolean,
- default: false,
- },
- },
- data() {
- return {
- bodyStyle: {
- minHeight: '700px',
- },
- // 列表展示用
- columns,
- // 高级搜索
- searchform: 'searchform',
- expand: false,
- // 列表展示过滤条件
- filterExpressions: [],
- formData: {
- modelCode: '',
- modelName: '',
- },
- period: [],
- }
- },
- methods: {
- processRes(data) {
- let index = 0
- data.data.forEach((item) => {
- item.id = this.$refs.SJMXDataTable.localPagination.current + '-' + index
- index++
- })
- return data
- },
- handleOk(e) {
- const rowKeys = this.$refs.SJMXDataTable.getSelectedRowKeys()
- if (rowKeys.length > 1) {
- return message.warning('最多可选一个模型')
- }
- this.$parent.visible = !this.$parent.visible
- this.$parent.visibleY = !this.$parent.visibleY
- // 列表选择事件,返回选择的数据
- this.$emit(
- 'listMxSelected',
- this.$refs.SJMXDataTable.getSelectedRowKeys(),
- this.$refs.SJMXDataTable.getSelectedRows()
- )
- },
- handleCancel(e) {
- this.$parent.visible = !this.$parent.visible
- this.$parent.visibleY = !this.$parent.visibleY
- },
- // 翻页操作
- 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.modelCode) {
- this.filterExpressions.push({
- dataType: 'str',
- name: 'modelCode',
- op: 'like',
- stringValue: `${this.formData.modelCode}`,
- })
- }
- // 模型名称
- if (this.formData.modelName) {
- this.filterExpressions.push({
- dataType: 'str',
- name: 'modelName',
- op: 'like',
- stringValue: `${this.formData.modelName}`,
- })
- }
- }
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- :global(.modalselectmaintain) {
- :global(.ant-modal-body) {
- overflow-x: hidden;
- }
- }
- </style>
|