自定义分类
This commit is contained in:
parent
dac6bc69a6
commit
8d34703506
|
|
@ -1,36 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 新增数据类型
|
||||
export function addDataClassAPI(data) {
|
||||
export function addKyFilesCustomizeClassifyAPI(data) {
|
||||
return request({
|
||||
url: '/smartArchives/data/classify/addKyDataClassify',
|
||||
url: '/smartArchives/files/customize/addKyFilesCustomizeClassify',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改数据类型
|
||||
export function updateDataClassAPI(data) {
|
||||
export function updateKyFilesCustomizeClassifyAPI(data) {
|
||||
return request({
|
||||
url: '/smartArchives/data/classify/updateKyDataClassify',
|
||||
url: '/smartArchives/files/customize/updateKyFilesCustomizeClassify',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除数据类型
|
||||
export function deleteDataClassAPI(data) {
|
||||
export function delKyFilesCustomizeClassifyAPI(data) {
|
||||
return request({
|
||||
url: '/smartArchives/data/classify/delKyDataClassify',
|
||||
url: '/smartArchives/files/customize/delKyFilesCustomizeClassify',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数据类型列表
|
||||
export function getListDataClassAPI(data) {
|
||||
export function getKyFilesCustomizeClassifyListAPI(data) {
|
||||
return request({
|
||||
url: '/smartArchives/data/classify/list',
|
||||
url: '/smartArchives/files/customize/getKyFilesCustomizeClassifyList',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
import TableModel from '@/components/TableModel'
|
||||
import { columnsList, formLabel } from './config'
|
||||
import {
|
||||
deleteDataClassAPI,
|
||||
delKyFilesMultiClassifyAPI,
|
||||
getKyFilesMultiClassifyListAPI,
|
||||
} from '@/api/archivesManagement/archClassification'
|
||||
import FileDimensionForm from './prop/fileDimensionForm'
|
||||
|
|
@ -86,10 +86,10 @@ export default {
|
|||
},
|
||||
/** 删除操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm(`是否确认删除数据类型名称为"${row.dataTypeName}"的数据项?`).then(() => {
|
||||
this.$modal.confirm(`是否确认删除分类名称为"${row.classifyName}"的数据项?`).then(() => {
|
||||
// 显示加载遮罩
|
||||
this.$modal.loading("正在删除,请稍候...");
|
||||
deleteDataClassAPI({ id: row.id }).then(res => {
|
||||
delKyFilesMultiClassifyAPI({ id: row.id }).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
|
|
|||
|
|
@ -3,15 +3,14 @@ export const formLabel = [
|
|||
isShow: false, // 是否展示label
|
||||
f_type: 'ipt',
|
||||
f_label: '自定义分类名称',
|
||||
f_model: 'dataTypeName',
|
||||
f_model: 'customizeClassifyName',
|
||||
f_max: 32,
|
||||
},
|
||||
]
|
||||
|
||||
export const columnsList = [
|
||||
{ t_props: 'dataTypeName', t_label: '自定分类名称' },
|
||||
{ t_props: 'customizeClassifyName', t_label: '自定分类名称' },
|
||||
{ t_props: 'updateUserName', t_label: '更新人' },
|
||||
{ t_props: 'updateTime', t_label: '更新人' },
|
||||
{ t_props: 'remark', t_label: '更新时间' },
|
||||
{ t_props: 'remark', t_label: '分类描述' }
|
||||
{ t_props: 'updateTime', t_label: '更新时间' },
|
||||
{ t_props: 'classifyDesc', t_label: '分类描述' }
|
||||
]
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
<!-- 档案多维度管理 -->
|
||||
<div class="app-container">
|
||||
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="customClassificationTableRef"
|
||||
:columnsList="columnsList" :request-api="getListDataClassAPI">
|
||||
:columnsList="columnsList" :request-api="getKyFilesCustomizeClassifyListAPI">
|
||||
<template slot="btn">
|
||||
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['data:classify:add']"
|
||||
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['files:customize:add']"
|
||||
@click="handleAdd">
|
||||
新增
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['data:classify:update']"
|
||||
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['files:customize:update']"
|
||||
@click="handleUpdate(data)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['data:classify:del']"
|
||||
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['files:customize:del']"
|
||||
@click="handleDelete(data)">
|
||||
删除
|
||||
</el-button>
|
||||
|
|
@ -31,9 +31,9 @@
|
|||
import TableModel from '@/components/TableModel'
|
||||
import { columnsList, formLabel } from './config'
|
||||
import {
|
||||
deleteDataClassAPI,
|
||||
getListDataClassAPI,
|
||||
} from '@/api/archivesManagement/archClassification'
|
||||
delKyFilesCustomizeClassifyAPI,
|
||||
getKyFilesCustomizeClassifyListAPI,
|
||||
} from '@/api/archivesManagement/archCustomClassification'
|
||||
import CustomizeForm from './prop/customizeForm'
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ export default {
|
|||
return {
|
||||
formLabel,
|
||||
columnsList,
|
||||
getListDataClassAPI,
|
||||
getKyFilesCustomizeClassifyListAPI,
|
||||
title: "",
|
||||
isflag: false,
|
||||
isAdd: '',
|
||||
|
|
@ -86,10 +86,10 @@ export default {
|
|||
},
|
||||
/** 删除操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm(`是否确认删除数据类型名称为"${row.dataTypeName}"的数据项?`).then(() => {
|
||||
this.$modal.confirm(`是否确认删除自定义名称为"${row.customizeClassifyName}"的数据项?`).then(() => {
|
||||
// 显示加载遮罩
|
||||
this.$modal.loading("正在删除,请稍候...");
|
||||
deleteDataClassAPI({ id: row.id }).then(res => {
|
||||
delKyFilesCustomizeClassifyAPI({ id: row.id }).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
|
|
|||
|
|
@ -3,21 +3,14 @@
|
|||
<el-dialog class="l-dialog" :class="lDialog" :title="title" :visible.sync="dialogVisible" :showClose="true"
|
||||
:closeOnClickModal="false" @close="handleClose" :append-to-body="true">
|
||||
<div>
|
||||
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px">
|
||||
<el-form-item label="分类名称" prop="dataTypeName">
|
||||
<el-input class="form-item" v-model="form.dataTypeName" clearable show-word-limit
|
||||
placeholder="请输入分类名称" maxlength="32"></el-input>
|
||||
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="120px">
|
||||
<el-form-item label="自定义分类名称" prop="customizeClassifyName">
|
||||
<el-input class="form-item" v-model="form.customizeClassifyName" clearable show-word-limit
|
||||
placeholder="请输入自定义分类名称" maxlength="64"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="维度" prop="dataTypeName2">
|
||||
<el-select class="form-item" v-model="form.dataTypeName2" filterable clearable
|
||||
placeholder="请选择维度">
|
||||
<el-option v-for="item in dict.type.dimension" :key="item.value" :label="item.label"
|
||||
:value="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类描述" prop="remark">
|
||||
<el-form-item label="分类描述" prop="classifyDesc">
|
||||
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" class="form-item"
|
||||
v-model="form.remark" clearable show-word-limit placeholder="请输入分类描述" maxlength="255"></el-input>
|
||||
v-model="form.classifyDesc" clearable show-word-limit placeholder="请输入分类描述" maxlength="255"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -31,8 +24,8 @@
|
|||
<script>
|
||||
import _ from 'lodash'
|
||||
import {
|
||||
addDataClassAPI,
|
||||
updateDataClassAPI,
|
||||
addKyFilesCustomizeClassifyAPI,
|
||||
updateKyFilesCustomizeClassifyAPI,
|
||||
} from '@/api/archivesManagement/archCustomClassification'
|
||||
export default {
|
||||
name: "CustomizeForm",
|
||||
|
|
@ -44,17 +37,13 @@ export default {
|
|||
dialogVisible: true,
|
||||
isDisabled: true,
|
||||
form: {
|
||||
dataTypeName: '',
|
||||
dataTypeName2: '',
|
||||
remark: '',
|
||||
customizeClassifyName: null,
|
||||
classifyDesc: null,
|
||||
},
|
||||
loading: null,
|
||||
rules: {
|
||||
dataTypeName: [
|
||||
{ required: true, message: '数据类型名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
dataTypeName2: [
|
||||
{ required: true, message: '数据类型名称不能为空', trigger: 'blur' }
|
||||
customizeClassifyName: [
|
||||
{ required: true, message: '自定义分类名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -68,16 +57,15 @@ export default {
|
|||
if (this.isAdd === 'edit' && this.rowData) {
|
||||
// 编辑模式:填充表单数据
|
||||
this.form = {
|
||||
dataTypeName: this.rowData.dataTypeName || '',
|
||||
dataTypeName2: this.rowData.dataTypeName2 || '',
|
||||
remark: this.rowData.remark || '',
|
||||
customizeClassifyName: this.rowData.customizeClassifyName || '',
|
||||
classifyDesc: this.rowData.classifyDesc || '',
|
||||
id: this.rowData.id || null,
|
||||
};
|
||||
} else {
|
||||
// 新增模式:重置表单
|
||||
this.form = {
|
||||
dataTypeName: '',
|
||||
dataTypeName2: '',
|
||||
remark: '',
|
||||
customizeClassifyName: null,
|
||||
classifyDesc: null,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
|
@ -100,9 +88,9 @@ export default {
|
|||
/**重置表单*/
|
||||
reset() {
|
||||
this.form = {
|
||||
dataTypeName: '',
|
||||
dataTypeName2: '',
|
||||
remark: '',
|
||||
customizeClassifyName: null,
|
||||
classifyDesc: null,
|
||||
id:null
|
||||
};
|
||||
this.resetForm("ruleForm");
|
||||
},
|
||||
|
|
@ -124,14 +112,8 @@ export default {
|
|||
target: this.$el.querySelector('.el-dialog') || document.body
|
||||
})
|
||||
let params = _.cloneDeep(this.form);
|
||||
const data = {
|
||||
dataTypeName: params.dataTypeName,
|
||||
dataTypeName2: params.dataTypeName2,
|
||||
remark: params.remark,
|
||||
}
|
||||
|
||||
if (this.isAdd === 'add') {
|
||||
addDataClassAPI(data).then(res => {
|
||||
addKyFilesCustomizeClassifyAPI(params).then(res => {
|
||||
this.loading.close();
|
||||
if (res.code === 200) {
|
||||
this.handleReuslt(res);
|
||||
|
|
@ -143,13 +125,7 @@ export default {
|
|||
// this.$modal.msgError('提交失败,请重试');
|
||||
});
|
||||
} else {
|
||||
const data = {
|
||||
dataTypeName: params.dataTypeName,
|
||||
dataTypeName2: params.dataTypeName2,
|
||||
remark: params.remark,
|
||||
id: this.rowData.id,
|
||||
}
|
||||
updateDataClassAPI(data).then(res => {
|
||||
updateKyFilesCustomizeClassifyAPI(params).then(res => {
|
||||
this.loading.close();
|
||||
if (res.code === 200) {
|
||||
this.handleReuslt(res);
|
||||
|
|
|
|||
Loading…
Reference in New Issue