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