|
|
@ -1,109 +1,60 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-card :bordered="false"> |
|
|
|
<a-modal |
|
|
|
<!-- 查询区域 --> |
|
|
|
width="96%" |
|
|
|
<div class="table-page-search-wrapper"> |
|
|
|
title="评分项管理" |
|
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
|
|
|
:visible="visible" |
|
|
|
<a-row :gutter="24"> |
|
|
|
:confirm-loading="confirmLoading" |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
@ok="handleOk" |
|
|
|
<a-form-item label="中文名称"> |
|
|
|
@cancel="handleCancel" |
|
|
|
<a-input placeholder="中文名称" v-model="queryParam.fieldName"></a-input> |
|
|
|
> |
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
|
|
|
|
<a-form-item label="英文名称"> |
|
|
|
|
|
|
|
<a-input placeholder="英文名称" v-model="queryParam.fieldEnName"></a-input> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
|
|
|
|
<a-form-item label="实体状态"> |
|
|
|
|
|
|
|
<j-dict-select-tag type="list" v-model="queryParam.status" dictCode="a_status" placeholder="请选择实体状态" /> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
|
|
|
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
|
|
|
|
|
|
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
|
|
|
|
|
|
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
</a-row> |
|
|
|
|
|
|
|
</a-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 查询区域-END --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 操作按钮区域 --> |
|
|
|
|
|
|
|
<div class="table-operator"> |
|
|
|
|
|
|
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
|
|
|
|
|
|
|
<a-button type="primary" icon="download" @click="handleExportXls('字段管理')">导出</a-button> |
|
|
|
|
|
|
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
|
|
|
|
|
|
|
<a-button type="primary" icon="import">导入</a-button> |
|
|
|
|
|
|
|
</a-upload> |
|
|
|
|
|
|
|
<!-- 高级查询区域 --> |
|
|
|
|
|
|
|
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
|
|
|
|
|
|
|
<a-dropdown v-if="selectedRowKeys.length > 0"> |
|
|
|
|
|
|
|
<a-menu slot="overlay"> |
|
|
|
|
|
|
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> |
|
|
|
|
|
|
|
</a-menu> |
|
|
|
|
|
|
|
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> |
|
|
|
|
|
|
|
</a-dropdown> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- table区域-begin --> |
|
|
|
|
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
|
|
|
<j-vxe-table |
|
|
|
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
|
|
|
|
|
|
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-table |
|
|
|
|
|
|
|
ref="table" |
|
|
|
|
|
|
|
size="middle" |
|
|
|
|
|
|
|
:scroll="{x:true}" |
|
|
|
|
|
|
|
bordered |
|
|
|
|
|
|
|
rowKey="id" |
|
|
|
|
|
|
|
:columns="columns" |
|
|
|
:columns="columns" |
|
|
|
:dataSource="dataSource" |
|
|
|
:dataSource="dataSource" |
|
|
|
:pagination="ipagination" |
|
|
|
|
|
|
|
:loading="loading" |
|
|
|
:loading="loading" |
|
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
|
|
|
height='auto' |
|
|
|
class="j-table-force-nowrap" |
|
|
|
|
|
|
|
@change="handleTableChange"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template slot="htmlSlot" slot-scope="text"> |
|
|
|
toolbar |
|
|
|
<div v-html="text"></div> |
|
|
|
:toolbarConfig="toolbarConfig" |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="imgSlot" slot-scope="text"> |
|
|
|
|
|
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
|
|
|
|
|
|
|
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot="fileSlot" slot-scope="text"> |
|
|
|
|
|
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
|
|
|
|
|
|
|
<a-button |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
:ghost="true" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
icon="download" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
@click="downloadFile(text)"> |
|
|
|
|
|
|
|
下载 |
|
|
|
|
|
|
|
</a-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span slot="action" slot-scope="text, record"> |
|
|
|
row-number |
|
|
|
<a @click="handleEdit(record)">编辑</a> |
|
|
|
row-selection |
|
|
|
|
|
|
|
keep-source |
|
|
|
|
|
|
|
async-remove |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:pagination="pagination" |
|
|
|
|
|
|
|
style="margin-top: 8px;" |
|
|
|
|
|
|
|
@pageChange="handlePageChange" |
|
|
|
|
|
|
|
@valueChange="valueChange" |
|
|
|
|
|
|
|
@added="added"> |
|
|
|
|
|
|
|
<template v-slot:toolbarSuffix> |
|
|
|
|
|
|
|
<a style=" |
|
|
|
|
|
|
|
background: #e6f7ff; |
|
|
|
|
|
|
|
color: red; |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
border: 1px solid #91d5ff; |
|
|
|
|
|
|
|
padding: 6px 300px 8px 31px; |
|
|
|
|
|
|
|
border-radius: 5px;"> |
|
|
|
|
|
|
|
注意: 编辑后请点击保存按钮保存数据</a> |
|
|
|
|
|
|
|
<!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>--> |
|
|
|
|
|
|
|
<!-- <p style="color: red;font-size: 16px"></p>--> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:action="props"> |
|
|
|
|
|
|
|
<a @click="submitForm(props)">保存</a> |
|
|
|
<a-divider type="vertical"/> |
|
|
|
<a-divider type="vertical"/> |
|
|
|
<a @click="handleDetail(record)">详情</a> |
|
|
|
<!-- <a @click="viewDetail(props.rowId)">详情</a>--> |
|
|
|
<a-divider type="vertical" /> |
|
|
|
<!-- <a-divider type="vertical"/>--> |
|
|
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
|
|
|
<a-popconfirm title="确定删除吗?" @confirm="handleDelete(props.rowId)"> |
|
|
|
<a>删除</a> |
|
|
|
<a>删除</a> |
|
|
|
</a-popconfirm> |
|
|
|
</a-popconfirm> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
</j-vxe-table> |
|
|
|
|
|
|
|
|
|
|
|
</a-table> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<fieldx-modal ref="modalForm" @ok="modalFormOk"></fieldx-modal> |
|
|
|
</a-modal> |
|
|
|
</a-card> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -113,141 +64,188 @@ |
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
|
|
|
import FieldxModal from './modules/FieldxModal' |
|
|
|
import FieldxModal from './modules/FieldxModal' |
|
|
|
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
|
|
|
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
|
|
|
|
|
|
|
import {JVXETypes} from '@/components/jeecg/JVxeTable' |
|
|
|
|
|
|
|
import {filterObj} from '@/utils/util' |
|
|
|
|
|
|
|
import moment from "dayjs"; |
|
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'FieldxList', |
|
|
|
name: 'FieldxList', |
|
|
|
mixins: [JeecgListMixin, mixinDevice], |
|
|
|
mixins: [JeecgListMixin, mixinDevice], |
|
|
|
components: { |
|
|
|
components: {}, |
|
|
|
FieldxModal |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
description: '字段管理管理页面', |
|
|
|
description: '字段管理管理页面', |
|
|
|
loadRouteType:false, |
|
|
|
tableid:'', |
|
|
|
tableId:'', |
|
|
|
tablename:'', |
|
|
|
// 表头 |
|
|
|
visible: false, |
|
|
|
columns: [ |
|
|
|
confirmLoading: false, |
|
|
|
{ |
|
|
|
// 工具栏的按钮配置 |
|
|
|
title: '#', |
|
|
|
toolbarConfig: { |
|
|
|
dataIndex: '', |
|
|
|
// add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 |
|
|
|
key:'rowIndex', |
|
|
|
btn: ['add'], |
|
|
|
width:60, |
|
|
|
|
|
|
|
align:"center", |
|
|
|
|
|
|
|
customRender:function (t,r,index) { |
|
|
|
|
|
|
|
return parseInt(index)+1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title:'对应实体', |
|
|
|
|
|
|
|
align:"center", |
|
|
|
|
|
|
|
dataIndex: 'tableId_dictText' |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
// 是否正在加载 |
|
|
|
title:'中文名称', |
|
|
|
loading: false, |
|
|
|
align:"center", |
|
|
|
// 分页器参数 |
|
|
|
dataIndex: 'fieldName' |
|
|
|
pagination: { |
|
|
|
|
|
|
|
// 当前页码 |
|
|
|
|
|
|
|
current: 1, |
|
|
|
|
|
|
|
// 每页的条数 |
|
|
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
// 可切换的条数 |
|
|
|
|
|
|
|
pageSizeOptions: ['10', '20', '30', '100', '200'], |
|
|
|
|
|
|
|
// 数据总数(目前并不知道真实的总数,所以先填写0,在后台查出来后再赋值) |
|
|
|
|
|
|
|
total: 0, |
|
|
|
|
|
|
|
showQuickJumper: true, |
|
|
|
|
|
|
|
showSizeChanger: true, |
|
|
|
|
|
|
|
id: null |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 开启 reload 数据效果 |
|
|
|
|
|
|
|
reloadEffect:true, |
|
|
|
|
|
|
|
// 表头 |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
/*关于样式宽度布局 |
|
|
|
|
|
|
|
如果留行号和可选择行的话 宽度得留给它12% 也就是还省88%的宽度 |
|
|
|
|
|
|
|
关于插槽 每个按钮留10%的宽度 如果有两个按钮 宽度就设为20% 按钮一般就两个字 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// title: '', width: '100px', fixed: 'left', key: '', |
|
|
|
|
|
|
|
// type: JVXETypes.normal, |
|
|
|
|
|
|
|
// placeholder: '请输入${title}', |
|
|
|
|
|
|
|
// disabled: true, |
|
|
|
|
|
|
|
// }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'英文名称', |
|
|
|
key: 'tableId_dictText', title: '对应实体', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.normal, |
|
|
|
dataIndex: 'fieldEnName' |
|
|
|
disabled: true, |
|
|
|
|
|
|
|
defaultValue:this.tablename, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'数据类型', |
|
|
|
key: 'fieldName', title: '中文名称', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.input, |
|
|
|
dataIndex: 'type_dictText' |
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'数据长度', |
|
|
|
key: 'fieldEnName', title: '英文名称', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.input, |
|
|
|
dataIndex: 'length' |
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'浮点精度', |
|
|
|
key: 'type', title: '数据类型', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.selectSearch, |
|
|
|
dataIndex: 'accuracy' |
|
|
|
dictCode:'date_type', |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'显示形式', |
|
|
|
key: 'accuracy', title: '浮点精度', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.inputNumber, |
|
|
|
dataIndex: 'format' |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'是否主键', |
|
|
|
key: 'format', title: '显示形式', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.textarea, |
|
|
|
dataIndex: 'isPk_dictText' |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'是否外键', |
|
|
|
key: 'isPk', title: '是否主键', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'isFk_dictText' |
|
|
|
dictCode:'yn', |
|
|
|
|
|
|
|
defaultValue:0, |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'关联实体', |
|
|
|
key: 'isFk', title: '是否外键', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'associateTable' |
|
|
|
dictCode:'yn', |
|
|
|
|
|
|
|
defaultValue:0, |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'关联字段', |
|
|
|
key: 'associateTable', title: '关联实体', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'associateField' |
|
|
|
dictCode:'tablex,table_name,id', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'是否为空', |
|
|
|
key: 'associateField', title: '关联字段', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'isNull_dictText' |
|
|
|
options: [], |
|
|
|
|
|
|
|
placeholder: '请选择${title}', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'是否重复', |
|
|
|
key: 'isNull', title: '是否为空', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'isUniqueness_dictText' |
|
|
|
dictCode:'yn', |
|
|
|
|
|
|
|
defaultValue:0, |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'字段规则', |
|
|
|
key: 'isUniqueness', title: '是否重复', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'rule', |
|
|
|
dictCode:'yn', |
|
|
|
scopedSlots: {customRender: 'htmlSlot'} |
|
|
|
defaultValue:0, |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'字段状态', |
|
|
|
key: 'rule', title: '字段规则', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.textarea, |
|
|
|
dataIndex: 'status_dictText' |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'版本状态', |
|
|
|
key: 'status', title: '字段状态', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'verisonStatus_dictText' |
|
|
|
dictCode:'a_status', |
|
|
|
|
|
|
|
defaultValue:1, |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title:'版本号', |
|
|
|
key: 'verisonStatus', title: '版本状态', width: '6%', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.select, |
|
|
|
dataIndex: 'verison' |
|
|
|
dictCode:'verison_status', |
|
|
|
|
|
|
|
defaultValue:1, |
|
|
|
|
|
|
|
validateRules: [{required: true, message: '${title}不能为空'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// key: 'verison', title: '版本号', width: '18%', |
|
|
|
|
|
|
|
// type: JVXETypes.input, |
|
|
|
|
|
|
|
// dictCode:'yn', |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// title: '操作', |
|
|
|
|
|
|
|
// dataIndex: 'action', |
|
|
|
|
|
|
|
// align: "center", |
|
|
|
|
|
|
|
// fixed: "right", |
|
|
|
|
|
|
|
// width: 147, |
|
|
|
|
|
|
|
// scopedSlots: {customRender: 'action'} |
|
|
|
|
|
|
|
// } |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'action', |
|
|
|
key: 'action', |
|
|
|
align:"center", |
|
|
|
type: JVXETypes.slot, |
|
|
|
fixed:"right", |
|
|
|
fixed: 'right', |
|
|
|
width:147, |
|
|
|
// 对齐方式为居中 |
|
|
|
scopedSlots: { customRender: 'action' } |
|
|
|
align: 'center', |
|
|
|
|
|
|
|
minWidth: '6%', |
|
|
|
|
|
|
|
slotName: 'action', |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
url: { |
|
|
|
url: { |
|
|
|
|
|
|
|
add: "/fieldx/fieldx/add", |
|
|
|
|
|
|
|
edit: "/fieldx/fieldx/edit", |
|
|
|
list: "/fieldx/fieldx/list", |
|
|
|
list: "/fieldx/fieldx/list", |
|
|
|
delete: "/fieldx/fieldx/delete", |
|
|
|
delete: "/fieldx/fieldx/delete", |
|
|
|
deleteBatch: "/fieldx/fieldx/deleteBatch", |
|
|
|
deleteBatch: "/fieldx/fieldx/deleteBatch", |
|
|
|
exportXlsUrl: "/fieldx/fieldx/exportXls", |
|
|
|
exportXlsUrl: "/fieldx/fieldx/exportXls", |
|
|
|
importExcelUrl: "fieldx/fieldx/importExcel", |
|
|
|
importExcelUrl: "fieldx/fieldx/importExcel", |
|
|
|
|
|
|
|
getFieldByTableId:"/fieldx/fieldx/getFieldByTableId", |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
dictOptions: {}, |
|
|
|
dictOptions: {}, |
|
|
|
superFieldList: [], |
|
|
|
superFieldList: [], |
|
|
|
|
|
|
|
//参数 |
|
|
|
|
|
|
|
loadRouteType: false, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
this.loadParameter(); |
|
|
|
|
|
|
|
this.getSuperFieldList(); |
|
|
|
this.getSuperFieldList(); |
|
|
|
this.searchQuery(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
importExcelUrl: function () { |
|
|
|
importExcelUrl: function () { |
|
|
@ -255,29 +253,173 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
initDictConfig(){ |
|
|
|
submitForm(props) { |
|
|
|
|
|
|
|
this.model = Object.assign({}, props); |
|
|
|
|
|
|
|
var str = props.rowId; |
|
|
|
|
|
|
|
let httpurl = ''; |
|
|
|
|
|
|
|
let method = ''; |
|
|
|
|
|
|
|
if (str.search("row") !== -1) { |
|
|
|
|
|
|
|
props.row.id =''; |
|
|
|
|
|
|
|
httpurl += this.url.add; |
|
|
|
|
|
|
|
method = 'post'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
httpurl += this.url.edit; |
|
|
|
|
|
|
|
method = 'put'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
props.row.tableId = this.tableid |
|
|
|
|
|
|
|
httpAction(httpurl, props.row, method).then((res) => { |
|
|
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
|
|
this.$message.success(res.message); |
|
|
|
|
|
|
|
this.$emit('ok'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//新增触发事件 |
|
|
|
|
|
|
|
added(event) { |
|
|
|
|
|
|
|
const {type, row, column, value, target} = event |
|
|
|
|
|
|
|
this.tableid = this.model.id |
|
|
|
|
|
|
|
target.setValues([{ |
|
|
|
|
|
|
|
rowKey: row.id, |
|
|
|
|
|
|
|
values: {tableId_dictText: this.model.tableName} |
|
|
|
|
|
|
|
}]) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//数据发生变化时事件 即 编辑 时同步保存 |
|
|
|
|
|
|
|
async handleValueChange(event) { |
|
|
|
|
|
|
|
//this.submitForm(event) |
|
|
|
|
|
|
|
// console.log("//数据发生变化时事件", event); |
|
|
|
|
|
|
|
//const str = event.row.id; |
|
|
|
|
|
|
|
let httpUrl = this.url.edit; |
|
|
|
|
|
|
|
let method = 'put'; |
|
|
|
|
|
|
|
await httpAction(httpUrl, event.row, method).then((res) => { |
|
|
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
|
|
this.$message.success(res.message); |
|
|
|
|
|
|
|
this.$emit('ok'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 数据发生变化时 |
|
|
|
|
|
|
|
valueChange(event){ |
|
|
|
|
|
|
|
const {type, row, column, value, target} = event |
|
|
|
|
|
|
|
if (column.key == "associateTable"){ |
|
|
|
|
|
|
|
let tableId = row.associateTable |
|
|
|
|
|
|
|
// 清空关联字段数据 |
|
|
|
|
|
|
|
target.setValues([{ |
|
|
|
|
|
|
|
rowKey: row.id, |
|
|
|
|
|
|
|
values: {associateField: ''} |
|
|
|
|
|
|
|
}]) |
|
|
|
|
|
|
|
target.$refs.vxe.columns[11].options = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 调用接口,向选项中传值 |
|
|
|
|
|
|
|
getAction(this.url.getFieldByTableId, {"tableId": tableId}).then((res) => { |
|
|
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
|
|
this.fieldxList = res.result.records || res.result; |
|
|
|
|
|
|
|
// 从2开始 |
|
|
|
|
|
|
|
target.$refs.vxe.columns[11].options = this.fieldxList; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
edit(record) { |
|
|
|
|
|
|
|
this.model = Object.assign({}, record); |
|
|
|
|
|
|
|
console.log(this.model) |
|
|
|
|
|
|
|
//console.log(topicid); |
|
|
|
|
|
|
|
this.queryParam.tableId = this.model.id; |
|
|
|
|
|
|
|
this.tableid = this.model.id |
|
|
|
|
|
|
|
//console.log(this.queryParam.topicid); |
|
|
|
|
|
|
|
this.loadData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
showModal() { |
|
|
|
|
|
|
|
this.visible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchReset() { |
|
|
|
// handleOk(e) { |
|
|
|
this.tableId = this.$route.query.tableId; |
|
|
|
// this.ModalText = 'The modal will be closed after two seconds'; |
|
|
|
this.queryParam ={}; |
|
|
|
// this.confirmLoading = true; |
|
|
|
this.queryParam.tableId = this.tableId; |
|
|
|
// setTimeout(() => { |
|
|
|
this.loadData(1); |
|
|
|
// this.visible = false; |
|
|
|
|
|
|
|
// this.confirmLoading = false; |
|
|
|
|
|
|
|
// }, 2000); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
handleOk(e) { |
|
|
|
|
|
|
|
this.visible = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchQuery(){ |
|
|
|
handleCancel(e) { |
|
|
|
this.tableId = this.$route.query.tableId; |
|
|
|
console.log('Clicked cancel button'); |
|
|
|
this.queryParam.tableId = this.$route.query.tableId; |
|
|
|
this.visible = false; |
|
|
|
this.loadData(1); |
|
|
|
}, |
|
|
|
|
|
|
|
initDictConfig() { |
|
|
|
}, |
|
|
|
}, |
|
|
|
//加载传递参数 |
|
|
|
//加载传递参数 |
|
|
|
loadParameter() { |
|
|
|
loadParameter() { |
|
|
|
if (this.loadRouteType == false) { |
|
|
|
if (this.loadRouteType === false) { |
|
|
|
this.queryParam.tableId = this.$route.query.tableId; |
|
|
|
// this.id = this.$route.query.id; |
|
|
|
this.tableId = this.$route.query.tableId; |
|
|
|
console.log('this.id -----------------', this.id) |
|
|
|
console.log(this.queryParam.tableId) |
|
|
|
//this.styleId = this.id; |
|
|
|
|
|
|
|
//this.biaoTi = this.$route.query.styleNames + "款式型号管理"; |
|
|
|
|
|
|
|
//console.log("**********传递到此层的id:" + this.id); |
|
|
|
this.loadRouteType = true; |
|
|
|
this.loadRouteType = true; |
|
|
|
this.loadData(1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载数据 |
|
|
|
|
|
|
|
loadData(arg) { |
|
|
|
|
|
|
|
//加载数据 若传入参数1则加载第一页的内容 |
|
|
|
|
|
|
|
if (arg === 1) { |
|
|
|
|
|
|
|
this.pagination.current = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 调用查询数据接口 |
|
|
|
|
|
|
|
this.loadParameter(); |
|
|
|
|
|
|
|
var params = this.getQueryParams1();//查询条件 |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
getAction(this.url.list, params).then(res => { |
|
|
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
|
|
/*// 后台查询回来的 total,数据总数量 |
|
|
|
|
|
|
|
this.pagination.total = res.result.total*/ |
|
|
|
|
|
|
|
// 将查询的数据赋值给 dataSource |
|
|
|
|
|
|
|
this.dataSource = res.result.records || res.result; |
|
|
|
|
|
|
|
console.log(this.dataSource, 'abc') |
|
|
|
|
|
|
|
if (res.result.total) { |
|
|
|
|
|
|
|
this.pagination.total = res.result.total; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.pagination.total = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//this.dataSource = res.result.records |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$error({title: '主表查询失败', content: res.message}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
|
|
// 这里是无论成功或失败都会执行的方法,在这里关闭loading |
|
|
|
|
|
|
|
this.loading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 当分页参数变化时触发的事件 |
|
|
|
|
|
|
|
handlePageChange(event) { |
|
|
|
|
|
|
|
// 重新赋值 |
|
|
|
|
|
|
|
this.pagination.current = event.current |
|
|
|
|
|
|
|
this.pagination.pageSize = event.pageSize |
|
|
|
|
|
|
|
// 查询数据 |
|
|
|
|
|
|
|
this.loadData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getQueryParams1() { |
|
|
|
|
|
|
|
//获取查询条件 |
|
|
|
|
|
|
|
let sqp = {} |
|
|
|
|
|
|
|
if (this.superQueryParams) { |
|
|
|
|
|
|
|
sqp['superQueryParams'] = encodeURI(this.superQueryParams) |
|
|
|
|
|
|
|
sqp['superQueryMatchType'] = this.superQueryMatchType |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); |
|
|
|
|
|
|
|
param.field = this.getQueryField(); |
|
|
|
|
|
|
|
param.pageNo = this.ipagination.current; |
|
|
|
|
|
|
|
param.pageSize = this.ipagination.pageSize; |
|
|
|
|
|
|
|
//param.id = this.id |
|
|
|
|
|
|
|
return filterObj(param); |
|
|
|
|
|
|
|
}, |
|
|
|
getSuperFieldList(){ |
|
|
|
getSuperFieldList(){ |
|
|
|
let fieldList=[]; |
|
|
|
let fieldList=[]; |
|
|
|
fieldList.push({type:'string',value:'tableId',text:'对应实体',dictCode:'tablex,table_name,id'}) |
|
|
|
fieldList.push({type:'string',value:'tableId',text:'对应实体',dictCode:'tablex,table_name,id'}) |
|
|
|