123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <template>
- <div :class="$style.wrapHeight">
- <div :class="$style.rowHeight">
- <audit-advanced-query
- :expand="expand"
- :search-data="searchData"
- :ref-name="searchform"
- :search-style="{ height: '230px', left: '20px', top: '57px' }"
- :search-fun="handleSearch"
- @searchedClick="searchedClick"
- >
- <!-- 插槽放置搜索内容 -->
- <template>
- <a-row>
- <!-- <a-col :span="12">
- <a-form-model-item :label="'非问题标签编号'" prop="code">
- <a-input v-model="searchData.code" allow-clear />
- </a-form-model-item>
- </a-col> -->
- <a-col :span="12">
- <a-form-model-item :label="'非问题标签名称'" prop="name">
- <a-input v-model="searchData.name" allow-clear />
- </a-form-model-item>
- </a-col>
- </a-row>
- <a-col :span="12">
- <a-form-model-item :label="'时间'" prop="operationTime">
- <a-range-picker v-model="searchData.operationTime" />
- </a-form-model-item>
- </a-col>
- </template>
- </audit-advanced-query>
- <a-card>
- <SdDataTableEx
- ref="sddataTable"
- :form-id="formId"
- :page-id="pageId"
- :data-url="dataUrl"
- :columns="columns"
- :actions="actions"
- :filter-expressions="expressions"
- show-selection
- :search-fields="['name']"
- :show-advance-query="true"
- @searchbtnClick="searchbtnClick"
- >
- <!-- 表格列 -->
- <template slot="link" slot-scope="text, record">
- <a @click="showFormModal(record.id)">{{ text }}</a>
- </template>
- <!-- 插槽放置表格内容 -->
- <template v-slot:form="{ model }" v-sd-watermark="waterMark" @saved="onSaved">
- <!-- <sdFormItem name="" /> -->
- <!-- code name description -->
- <!-- <SdFormItem name="code" label="非问题标签编号" /> -->
- <SdFormItem name="name" label="非问题标签名称" />
- <SdFormItem name="type" label="非问题标签类型" />
- <SdFormItem name="description" label="非问题标签内容">
- <a-textarea v-model="model.description" />
- </SdFormItem>
- </template>
- </SdDataTableEx>
- </a-card>
- </div>
- </div>
- </template>
- <script>
- // 筛选组件
- import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
- import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
- // 表格组件 + 表格扩展组件
- import SdDataTableEx from '@/common/components/sd-data-table-ex.vue'
- // 表格按钮类型
- import TableActionTypes from '@/common/services/table-action-types'
- import TableColumnTypes from '@/common/services/table-column-types'
- // 请求
- import SdFormItem from '@/common/components/sd-form-item.vue'
- export default {
- // 大驼峰文件名
- name: 'AuditFalseProblem',
- metaInfo: {
- // 页面标题
- title: '非问题说明',
- },
- components: {
- // 引入组件
- SdFormItem,
- SdDataTableEx,
- auditAdvancedQuery,
- },
- mixins: [auditAdvancedQueryMixins],
- data() {
- return {
- // 搜索条件
- searchData: {
- name: '',
- // code: '',
- operationTime: [],
- },
- // 搜索接口传参
- expressions: [],
- // 搜索组件ref
- searchform: 'searchform',
- // 搜索条件展开
- expand: false,
- // 列表请求地址
- dataUrl: 'api/xcoa-mobile/v1/iam-page/businessList',
- // pageId
- pageId: 'audit/maintain/iamProblemStatement',
- // formId
- formId: 'iamProblemStatement',
- // 表头
- columns: [
- {
- title: '序号',
- dataIndex: 'sortNumber',
- width: '80px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- // code name description
- {
- title: '非问题标签编号',
- dataIndex: 'id',
- },
- {
- title: '非问题标签名称',
- dataIndex: 'name',
- scopedSlots: { customRender: 'link' },
- },
- {
- title: '非问题标签类型',
- dataIndex: 'type',
- },
- {
- title: '非问题标签内容',
- dataIndex: 'description',
- },
- {
- title: '创建时间',
- dataIndex: 'creationTime',
- sdRender: TableColumnTypes.date,
- },
- ],
- // 按钮
- actions: [
- {
- label: '新增',
- id: 'create',
- permission: 'create',
- type: TableActionTypes.primary,
- callback: this.showFormModal,
- },
- // 删除
- {
- label: '删除',
- id: 'delete',
- type: TableActionTypes.ex.delete, // 删除按钮,不需要回调,会自动处理(对sd-data-table无效)
- },
- ],
- // 表单提交地址
- pagePath: 'audit/maintain/iamProblemStatement',
- // 领域数据
- areaOption: [],
- }
- },
- methods: {
- // 搜索方法
- handleSearch() {
- // 搜索条件
- this.expressions = []
- const searchDataKeys = Object.keys(this.searchData)
- searchDataKeys.map((item) => {
- if (item !== 'operationTime' && this.searchData[item] !== '') {
- this.expressions.push({
- dataType: 'str',
- name: item,
- op: 'like',
- stringValue: `%${this.searchData[item]}%`,
- })
- }
- })
- if (this.searchData.operationTime.length === 2) {
- this.searchData.operationTime.map((item, index) => {
- this.expressions.push({
- dataType: 'long',
- name: 'creationTime',
- op: index === 0 ? 'ge' : 'lt',
- longValue: item._d.getTime(),
- })
- })
- }
- },
- // 显示表单
- showFormModal(id = null) {
- this.$refs.sddataTable.showDetailModal(id, this.pagePath)
- },
- },
- }
- </script>
- <style lang="scss" module>
- @use '@/common/design' as *;
- .wrap-height {
- height: 100%;
- .row-height {
- position: relative;
- display: flex;
- flex: auto;
- height: 100%;
- .rightcard {
- flex: 1;
- width: calc(100% - 20%);
- height: 100%;
- }
- }
- }
- </style>
|