fix JTable拖拽问题

This commit is contained in:
赵霄
2023-08-31 17:14:47 +08:00
parent 9e55453ad1
commit 59ed913bae
5 changed files with 36 additions and 28 deletions
+14 -1
View File
@@ -9,9 +9,22 @@ const getDomesticStandardDocumentInfo = (params) => getAction('/laws/standard/do
// 国内法规标准-获取表头信息 // 国内法规标准-获取表头信息
const getDomesticStandardTableHeader = (params) => getAction('/laws/standard/domestic/getCommonHeader', params) const getDomesticStandardTableHeader = (params) => getAction('/laws/standard/domestic/getCommonHeader', params)
// 海外标准-获取查询条件
const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
// 海外标准-获取表单
const getOverseasStandardForm = (params) => getAction('/laws/standard/overseas/getFormModel', params)
// 海外标准-获取信息
const getOverseasStandardDocumentInfo = (params) => getAction('/laws/standard/overseas/getByIdAndModule', params)
// 海外标准-获取表头信息
const getOverseasStandardTableHeader = (params) => getAction('/laws/standard/overseas/getCommonHeader', params)
export { export {
getDomesticStandardSearchForm, getDomesticStandardSearchForm,
getDomesticStandardFormModal, getDomesticStandardFormModal,
getDomesticStandardDocumentInfo, getDomesticStandardDocumentInfo,
getDomesticStandardTableHeader getDomesticStandardTableHeader,
getOverseasStandardSearchForm,
getOverseasStandardForm,
getOverseasStandardDocumentInfo,
getOverseasStandardTableHeader
} }
+5 -1
View File
@@ -325,8 +325,12 @@ export default {
} else { } else {
this.selfScroll = scroll this.selfScroll = scroll
} }
// 解决拖拽重置其他单元格宽度的问题
const colIndex = this.resultColumns.findIndex(tt => getKey(tt) === key)
const nowResultColumns = cloneDeep(this.resultColumns)
nowResultColumns.splice(colIndex, 1, col)
// 修改列宽后,更新表格字段 // 修改列宽后,更新表格字段
this.setResultColumns(columns) this.setResultColumns(nowResultColumns)
} }
// 停止拖拽监听 // 停止拖拽监听
const onDragstop = () => { const onDragstop = () => {
@@ -43,7 +43,7 @@
</div> </div>
<div class="page-right-box"> <div class="page-right-box">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<search ref="searchRef" :url="url" :get-query-condition-func="getQueryConditionFunc" @search="searchQuery" @reset="searchReset" /> <search ref="searchRef" :get-query-condition-func="getSearchFunc" @search="searchQuery" @reset="searchReset" />
</div> </div>
<div class="table-operator"> <div class="table-operator">
@@ -119,6 +119,7 @@ import JTable from '../../../components/jero/JTable.vue'
import Search from '../../../components/customField/Search.vue' import Search from '../../../components/customField/Search.vue'
import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin' import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin'
import OverseasStandardModal from './modules/OverseasStandardModal.vue' import OverseasStandardModal from './modules/OverseasStandardModal.vue'
import { getOverseasStandardTableHeader, getOverseasStandardSearchForm } from '../../../api/standardRegulationLibraryApi'
const apiTreeData = [ const apiTreeData = [
{ {
@@ -176,12 +177,13 @@ export default {
has: '' has: ''
} }
], ],
url: { getTableHeaderFunc: getOverseasStandardTableHeader,
tableHeader: '/laws/standard/overseas/getCommonHeader', getSearchFunc: getOverseasStandardSearchForm,
getSearchList: '/laws/standard/overseas/getQueryCondition', url:
list: '/laws/standard/overseas/getCommonHeader', {
delete: '/laws/standard/overseas/deleteByIdsAndModule' list: '/laws/standard/overseas/getCommonHeader',
} delete: '/laws/standard/overseas/deleteByIdsAndModule'
}
} }
}, },
created () { created () {
@@ -7,11 +7,13 @@
@close="handleCancel" @close="handleCancel"
:visible="visible" :visible="visible"
:maskClosable="false" :maskClosable="false"
style="height: 100%;overflow: auto;" style="height: 100%;overflow: auto;">
>
<a-spin :spinning="confirmLoading" style="width: 100%;height:100%"> <a-spin :spinning="confirmLoading" style="width: 100%;height:100%">
<div class="drawer-container"> <div class="drawer-container">
<add-form ref="addForm" :url="url" @submitFormData="submitFormData"></add-form> <add-form ref="addForm"
:get-form-func="getFormFunc"
:get-document-info-func="getInfoFunc"
@submitFormData="submitFormData" />
</div> </div>
<div class="drawer-footer"> <div class="drawer-footer">
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;"> <a-button @click="handleOk" type="primary" style="margin-bottom: 0;">
@@ -26,6 +28,7 @@
<script> <script>
import AddForm from '../../../../components/customField/AddForm.vue' import AddForm from '../../../../components/customField/AddForm.vue'
import { postAction } from '../../../../api/manage' import { postAction } from '../../../../api/manage'
import { getOverseasStandardForm, getOverseasStandardDocumentInfo } from '../../../../api/standardRegulationLibraryApi'
export default { export default {
name: 'OverseasStandardModal', name: 'OverseasStandardModal',
@@ -38,9 +41,9 @@ export default {
// 存储表单的数据 // 存储表单的数据
form: {}, form: {},
confirmLoading: false, confirmLoading: false,
getFormFunc: getOverseasStandardForm,
getInfoFunc: getOverseasStandardDocumentInfo,
url: { url: {
getAddForm: '/laws/standard/overseas/getFormModel',
getDocumentInfo: '/laws/standard/overseas/getByIdAndModule',
add: '/laws/standard/overseas/commonAdd', add: '/laws/standard/overseas/commonAdd',
edit: '/laws/standard/overseas/commonEdit' edit: '/laws/standard/overseas/commonEdit'
} }
-14
View File
@@ -92,17 +92,6 @@
</a-col> </a-col>
<a-col :span="3"></a-col> <a-col :span="3"></a-col>
</a-row> </a-row>
<a-row class="login-btn">
<a-col :span="3"></a-col>
<a-col :span="18">
<a-form-item>
<a-button block size="large" type="primary" htmlType="submit" @click="editFileByOnlyOffice('')">
在线编辑
</a-button>
</a-form-item>
</a-col>
<a-col :span="3"></a-col>
</a-row>
</div> </div>
</a-form> </a-form>
<a-form v-if="mobile" :form="form" class="user-layout-login user-layout-login-mobile" ref="formLogin" id="formLogin"> <a-form v-if="mobile" :form="form" class="user-layout-login user-layout-login-mobile" ref="formLogin" id="formLogin">
@@ -400,9 +389,6 @@ export default {
}) })
} }
}) })
},
editFileByOnlyOffice (fileId) {
onlyOfficeEdit(fileId, '企业标准')
} }
} }
} }