123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <template>
- <div :class="[$style.wrapHeight, $style.dataclass]">
- <div :class="$style.rowHeight">
- <div :class="$style.rowLeft">
- <audit-class-tree
- ref="auditMaintainCatalogTree"
- show-line
- top-node-text="数据分类维护"
- :is-select-dep="true"
- :draggable="true"
- :cate="true"
- :is-select="true"
- @treeSelect="treeSelect"
- ></audit-class-tree>
- </div>
- <div :class="$style.rightcard">
- <a-card>
- <!-- 高级搜索组件 -->
- <audit-advanced-query
- :expand="expand"
- :search-data="formData"
- :ref-name="searchform"
- :search-style="{ height: '150px', left: '20px', top: '57px' }"
- :search-fun="handleSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-col :span="12">
- <a-form-model-item :label="'分类编号'" prop="categoryId">
- <a-input v-model="formData.categoryId" allow-clear />
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item :label="'分类名称'" prop="categoryName">
- <a-input v-model="formData.categoryName" allow-clear />
- </a-form-model-item>
- </a-col>
- </template>
- </audit-advanced-query>
- <SdDataTable
- :key="key"
- ref="dataTable"
- :projectlist="true"
- :editnode="editnode"
- form-id="iamDataCategoryQueryList"
- data-url="api/xcoa-mobile/v1/iamdatacategory/iamDataCategoryQueryList"
- :columns="columns"
- :actions="actions"
- :filter-expressions="expressions"
- :search-fields="['categoryId', 'categoryName']"
- :show-advance-query="true"
- @searchbtnClick="searchbtnClick"
- >
- <template slot="categoryName" slot-scope="text, record">
- <a v-if="showNameStatue(record)" @click="dataDetail(record)">{{ text }}</a>
- <span v-else :class="$style.invalid">{{ text }}</span>
- </template>
- </SdDataTable>
- </a-card>
- </div>
- <a-modal
- :title="detailInfo.categoryName ? detailInfo.categoryName : ''"
- :visible="detailShow"
- @cancel="detailShow = false"
- >
- <a-form-model :model="detailInfo" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
- <a-form-model-item :label="'分类名称'">
- <a-input v-model="detailInfo.categoryName" disabled />
- </a-form-model-item>
- <a-form-model-item :label="'分类编号'">
- <a-input v-model="detailInfo.categoryId" disabled />
- </a-form-model-item>
- <a-form-model-item :label="'分类描述'">
- <a-input v-model="detailInfo.categoryDesc" disabled />
- </a-form-model-item>
- <a-form-model-item :label="'权重'">
- <a-input v-model="detailInfo.weightNum" disabled />
- </a-form-model-item>
- <a-form-model-item :label="'排序'">
- <a-input v-model="detailInfo.sortNum" disabled />
- </a-form-model-item>
- </a-form-model>
- </a-modal>
- </div>
- </div>
- </template>
- <script>
- import { Modal, message } from 'ant-design-vue'
- import axios from '@/common/services/axios-instance'
- import auditClassTree from './audit-class-tree.vue'
- import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
- import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
- import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
- import crossWindowWatcher from '@/common/services/cross-window-watcher'
- import dataService from './data-config'
- import SdDataTable from '@/common/components/sd-data-table.vue'
- import TableActionTypes from '@/common/services/table-action-types'
- export default {
- name: 'AuditDataList',
- metaInfo: {
- title: '数据查看',
- },
- components: {
- SdDataTable,
- auditClassTree,
- auditAdvancedQuery,
- },
- mixins: [auditAdvancedQueryMixins, auditAdvancedGroupMixins],
- data() {
- return {
- editnode: true,
- key: 0,
- searchform: 'searchform',
- formData: {
- categoryName: '',
- categoryId: '',
- },
- auditOrgId: null,
- parentId: 0,
- parentCategoryId: '000000',
- level: 1,
- isEnd: null,
- columns: [
- {
- dataIndex: 'dataCategoryBean.id',
- sdHidden: true,
- },
- {
- dataIndex: 'dataCategoryBean.categoryName',
- title: '分类名称',
- scopedSlots: { customRender: 'categoryName' },
- },
- {
- dataIndex: 'dataCategoryBean.categoryId',
- title: '分类编号',
- },
- {
- dataIndex: 'dataCategoryBean.categoryDesc',
- title: '分类描述',
- },
- {
- dataIndex: 'dataCategoryBean.weightNum',
- title: '权重',
- sdHidden: true,
- },
- {
- dataIndex: 'dataCategoryBean.sortNum',
- title: '排序',
- sdHidden: true,
- },
- {
- dataIndex: 'dataCategoryBean.reservestring1',
- sdHidden: true,
- },
- ],
- actions: [
- {
- label: '授权申请',
- permission: null,
- type: TableActionTypes.primary,
- callback: this.empower,
- },
- ],
- expressions: [],
- isroot: true,
- className: '',
- detailShow: false,
- detailInfo: {},
- }
- },
- methods: {
- showNameStatue(record) {
- return record.dataCategoryBean.reservestring1 === 'true'
- },
- // 查看详情
- dataDetail(record) {
- this.detailInfo = record.dataCategoryBean
- this.detailShow = true
- },
- handleSearch() {
- this.expressions = []
- // 模型编号
- if (this.formData.categoryId) {
- this.expressions.push({
- dataType: 'str',
- name: 'categoryId',
- op: 'like',
- stringValue: `%${this.formData.categoryId}%`,
- })
- }
- // 模型名称
- if (this.formData.categoryName) {
- this.expressions.push({
- dataType: 'str',
- name: 'categoryName',
- op: 'like',
- stringValue: `%${this.formData.categoryName}%`,
- })
- }
- },
- treeSelect(selectedKeys, info) {
- this.formData.categoryId = ''
- this.formData.categoryName = ''
- this.expressions = []
- if (info.selectedNodes[0].key !== '0') {
- const categoryId = info.selectedNodes[0].data.props.props.categoryId
- this.expressions = [
- {
- dataType: 'str',
- name: 'categoryId',
- op: 'like',
- stringValue: `%${categoryId}%`,
- },
- ]
- }
- },
- refresh() {
- this.$refs.dataTable.refresh()
- },
- // 授权
- empower() {
- const url = '/sd-flow-guide?code=PRODUCT_IAM_SQSQ' // 新页面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refresh()
- }
- })
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .wrap-height {
- height: 100%;
- .row-left {
- width: 20%;
- }
- .row-height {
- display: flex;
- flex: auto;
- height: 100%;
- .rightcard {
- flex: 1;
- width: calc(100% - 20%);
- height: 100%;
- overflow-y: auto;
- }
- }
- }
- .dataclass {
- :global(.projectlist .ant-table-empty .ant-table-body) {
- overflow-x: hidden !important;
- }
- :global(span > .ant-btn:nth-child(2)) {
- color: #fff;
- background-color: #1890ff;
- border-color: #1890ff;
- }
- // :global(.ant-table-placeholder) {
- // width: auto;
- // }
- }
- .invalid {
- color: #ccc;
- }
- </style>
|