项目管理

This commit is contained in:
cwchen 2025-09-12 10:06:44 +08:00
parent ea33da7442
commit 12c5dfb3db
11 changed files with 697 additions and 745 deletions

View File

@ -0,0 +1,37 @@
import request from '@/utils/request'
// 新增数据类型
export function addDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/addKyDataClassify',
method: 'POST',
data: data,
})
}
// 修改数据类型
export function updateDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/updateKyDataClassify',
method: 'POST',
data: data,
})
}
// 删除数据类型
export function deleteDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/delKyDataClassify',
method: 'POST',
data: data,
})
}
// 查询数据类型列表
export function getListDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/list',
method: 'GET',
params: data,
})
}

View File

@ -0,0 +1,37 @@
import request from '@/utils/request'
// 新增数据类型
export function addDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/addKyDataClassify',
method: 'POST',
data: data,
})
}
// 修改数据类型
export function updateDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/updateKyDataClassify',
method: 'POST',
data: data,
})
}
// 删除数据类型
export function deleteDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/delKyDataClassify',
method: 'POST',
data: data,
})
}
// 查询数据类型列表
export function getListDataClassAPI(data) {
return request({
url: '/smartArchives/data/classify/list',
method: 'GET',
params: data,
})
}

View File

@ -9,3 +9,21 @@ export function getProListAPI(data) {
params: data,
})
}
// 配置档案类型
export function updateContentsNameAPI(data) {
return request({
url: '/smartArchives/project/updateContentsName',
method: 'POST',
data: data,
})
}
// 档案类型下拉选
export function getFileCatalogSelectAPI(data) {
return request({
url: '/smartArchives/project/getFileCatalogSelect',
method: 'GET',
params: data,
})
}

View File

@ -0,0 +1,17 @@
export const formLabel = [
{
isShow: false, // 是否展示label
f_type: 'ipt',
f_label: '分类名称',
f_model: 'dataTypeName',
f_max: 32,
},
]
export const columnsList = [
{ t_props: 'dataTypeName', t_label: '分类名称' },
{ t_props: 'updateUserName', t_label: '维度' },
{ t_props: 'updateTime', t_label: '更新人' },
{ t_props: 'remark', t_label: '更新时间' },
{ t_props: 'remark', t_label: '分类描述' }
]

View File

@ -1,388 +1,111 @@
<template>
<!-- 基础页面 -->
<!-- 档案多维度管理 -->
<div class="app-container">
<el-form
v-show="showSearch"
:model="queryParams"
ref="queryForm"
size="small"
inline
@submit.native.prevent
>
<el-form-item label="" prop="name">
<el-input
v-model="queryParams.name"
placeholder="数据类型名称"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button
>
<el-button icon="el-icon-refresh" @click="handleReset"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleDialog(null, 'add')"
>新增</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
/>
</el-row>
<el-table
:data="tableList"
fit
highlight-current-row
style="width: 100%"
v-loading="isLoading"
:max-height="650"
border
>
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="
(index) =>
(queryParams.pageNum - 1) * queryParams.pageSize +
index +
1
"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
/>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{ row }">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDialog(row, 'edit')"
>
编辑
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="fileDimensionTableRef"
:columnsList="columnsList" :request-api="getListDataClassAPI">
<template slot="btn">
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['data:classify:add']"
@click="handleAdd">
新增
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(row)"
style="color: #f56c6c"
>
</template>
<template slot="handle" slot-scope="{ data }">
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['data:classify:update']"
@click="handleUpdate(data)">
修改
</el-button>
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['data:classify:del']"
@click="handleDelete(data)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 弹框 -->
<el-dialog
:title="dialogTitle"
:visible.sync="dialogVisible"
width="40%"
v-loading="isLoading"
>
<el-form
ref="dialogForm"
:model="dialogForm"
:rules="dialogRules"
label-width=""
size="small"
@submit.native.prevent
>
<el-form-item label="分类名称" prop="classificationName">
<el-input
v-model="dialogForm.classificationName"
placeholder="请输入"
clearable
maxlength="50"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="维度" prop="dimensionality">
<el-select
v-model="dialogForm.dimensionality"
placeholder="请选择"
clearable
style="width: 100%"
>
<el-option
v-for="item in dimensionalityList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="分类描述" prop="remark">
<el-input
v-model="dialogForm.remark"
placeholder="请输入"
clearable
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
maxlength="200"
show-word-limit
style="width: 100%"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleSubmit"
> </el-button
>
</span>
</el-dialog>
</TableModel>
<!-- 新增/编辑 -->
<FileDimensionForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
</div>
</template>
<script>
// import { } from '@/api/'
import TableModel from '@/components/TableModel'
import { columnsList, formLabel } from './config'
import {
deleteDataClassAPI,
getListDataClassAPI,
} from '@/api/archivesManagement/archClassification'
import FileDimensionForm from './prop/fileDimensionForm'
export default {
name: 'ArchClassification',
components: {
TableModel,
FileDimensionForm
},
data() {
return {
isLoading: false,
showSearch: true,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
},
queryParams: {
pageNum: 1,
pageSize: 10,
name: '', //
},
total: 0, //
//
tableColumns: [
{ label: '分类名称', prop: 'classificationName' },
{ label: '维度', prop: 'dimensionality' },
{ label: '更新人', prop: 'updater' },
{ label: '更新时间', prop: 'updateTime' },
{ label: '分类描述', prop: 'remark' },
],
//
tableList: [
{
id: 1,
classificationName: '测试',
dimensionality: '测试维度',
updater: '张三',
updateTime: '2024-06-20 12:00:00',
remark: '测试数据',
},
],
isOut: false, //
dialogTitle: '详情',
dialogVisible: false,
dialogForm: {
classificationName: '',
remark: '',
},
dialogRules: {
classificationName: [
{
required: true,
message: '请输入分类名称',
trigger: 'blur',
},
],
},
dimensionalityList: [
{ label: '变电', value: 1 },
{ label: '线路', value: 2 },
{ label: '电缆', value: 3 },
],
formLabel,
columnsList,
getListDataClassAPI,
title: "",
isflag: false,
isAdd: '',
row: {},
loading: false,
}
},
created() {
this.getList()
},
methods: {
//
/** 新增按钮操作 */
handleAdd() {
this.title = "新增";
this.isAdd = 'add';
this.isflag = true;
},
closeDialog() {
this.isflag = false;
},
showColose() {
this.isflag = false;
},
/** 修改操作 */
handleUpdate(row) {
this.title = "修改";
this.isAdd = 'edit';
this.row = row;
this.isflag = true;
},
/* 搜索操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
this.$refs.fileDimensionTableRef.getTableList()
},
//
handleReset() {
this.$refs.queryForm.resetFields()
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
this.isLoading = true
try {
const params = {
...this.queryParams,
}
console.log('🚀 ~ getList ~ params:', params)
// const res = await (params)
// console.log('🚀 ~ ~ res:', res)
// this.tableList = res.data.rows || []
// this.total = res.data.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
handleDialog(row, type) {
console.log('🚀 ~ handleDialog ~ row:', row)
this.dialogTitle = type == 'add' ? '新增' : '编辑'
this.dialogVisible = true
setTimeout(() => {
this.$refs.dialogForm.resetFields()
if (type == 'edit') {
this.dialogForm.fileName = row.fileName
this.dialogForm.remark = row.remark
this.getDialogInfo()
}
}, 100)
},
//
/** 删除操作 */
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
try {
if (this.isLoading) return
this.isLoading = true
const params = { id: row.id }
console.log('🚀 ~ handleDelete ~ params:', params)
// const res = await (params)
// console.log('🚀 ~ ~ res:', res)
this.$message({
type: 'success',
message: '删除成功',
})
} catch (error) {
console.log('🚀 ~ handleDelete ~ error:', error)
} finally {
this.isLoading = false
this.getList()
}
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
})
})
},
//
async getDialogInfo() {
try {
this.isLoading = true
const params = { ...this.dialogForm }
console.log('🚀 ~ getDialogInfo ~ params:', params)
// const res = await (params)
// console.log('🚀 ~ ~ res:', res)
} catch (error) {
console.log('🚀 ~ 获取弹框信息 ~ error:', error)
} finally {
this.isLoading = false
}
},
//
handleSubmit() {
this.$refs.dialogForm.validate((valid) => {
console.log('🚀 ~ handleSubmit ~ valid:', valid)
if (!valid) return
try {
if (this.isLoading) return
this.isLoading = true
const params = { ...this.dialogForm }
console.log('🚀 ~ handleSubmit ~ params:', params)
} catch (error) {
console.log('🚀 ~ handleSubmit ~ error:', error)
} finally {
this.isLoading = false
this.dialogVisible = false
this.getList()
}
})
},
//
formatTime(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
},
//
handleExport() {
//
this.$message({
type: 'warning',
message: '导出功能开发中,敬请期待!',
})
try {
let fileName = `导出_${this.formatTime(new Date())}.xLsx`
let url = '/material/backstage/costPush/exportPushCheck'
const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params)
// this.derive(url, params, fileName)
// this.download(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
this.$modal.confirm(`是否确认删除数据类型名称为"${row.dataTypeName}"的数据项?`).then(() => {
//
this.$modal.loading("正在删除,请稍候...");
deleteDataClassAPI({ id: row.id }).then(res => {
this.$modal.closeLoading();
if (res.code === 200) {
this.$modal.msgSuccess("删除成功");
this.handleQuery();
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError("删除失败,请重试");
console.error('删除失败:', error);
});
}).catch(() => {
//
});
},
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -4,13 +4,20 @@
: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-form-item label="分类名称" prop="dataTypeName">
<el-input class="form-item" v-model="form.dataTypeName" clearable show-word-limit
placeholder="请输入数据类型名称" maxlength="32"></el-input>
placeholder="请输入分类名称" maxlength="32"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<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-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.remark" clearable show-word-limit placeholder="请输入分类描述" maxlength="255"></el-input>
</el-form-item>
</el-form>
</div>
@ -26,10 +33,11 @@ import _ from 'lodash'
import {
addDataClassAPI,
updateDataClassAPI,
} from '@/api/data-collect/data-class-manage'
} from '@/api/archivesManagement/archClassification'
export default {
name: "DataClassForm",
name: "FileDimensionForm",
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"],
dicts: ['dimension'],
data() {
return {
lDialog: this.width > 500 ? "w700" : "w500",
@ -37,6 +45,7 @@ export default {
isDisabled: true,
form: {
dataTypeName: '',
dataTypeName2: '',
remark: '',
},
loading: null,
@ -44,6 +53,9 @@ export default {
dataTypeName: [
{ required: true, message: '数据类型名称不能为空', trigger: 'blur' }
],
dataTypeName2: [
{ required: true, message: '数据类型名称不能为空', trigger: 'blur' }
],
},
};
},
@ -57,12 +69,14 @@ export default {
//
this.form = {
dataTypeName: this.rowData.dataTypeName || '',
dataTypeName2: this.rowData.dataTypeName2 || '',
remark: this.rowData.remark || '',
};
} else {
//
this.form = {
dataTypeName: '',
dataTypeName2: '',
remark: '',
};
}
@ -87,6 +101,7 @@ export default {
reset() {
this.form = {
dataTypeName: '',
dataTypeName2: '',
remark: '',
};
this.resetForm("ruleForm");
@ -111,6 +126,7 @@ export default {
let params = _.cloneDeep(this.form);
const data = {
dataTypeName: params.dataTypeName,
dataTypeName2: params.dataTypeName2,
remark: params.remark,
}
@ -129,6 +145,7 @@ export default {
} else {
const data = {
dataTypeName: params.dataTypeName,
dataTypeName2: params.dataTypeName2,
remark: params.remark,
id: this.rowData.id,
}

View File

@ -0,0 +1,17 @@
export const formLabel = [
{
isShow: false, // 是否展示label
f_type: 'ipt',
f_label: '自定义分类名称',
f_model: 'dataTypeName',
f_max: 32,
},
]
export const columnsList = [
{ t_props: 'dataTypeName', t_label: '自定分类名称' },
{ t_props: 'updateUserName', t_label: '更新人' },
{ t_props: 'updateTime', t_label: '更新人' },
{ t_props: 'remark', t_label: '更新时间' },
{ t_props: 'remark', t_label: '分类描述' }
]

View File

@ -1,371 +1,111 @@
<template>
<!-- 基础页面 -->
<!-- 档案多维度管理 -->
<div class="app-container">
<el-form
v-show="showSearch"
:model="queryParams"
ref="queryForm"
size="small"
inline
@submit.native.prevent
>
<el-form-item label="" prop="name">
<el-input
v-model="queryParams.name"
placeholder="数据类型名称"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button
>
<el-button icon="el-icon-refresh" @click="handleReset"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleDialog(null, 'add')"
>新增</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
/>
</el-row>
<el-table
:data="tableList"
fit
highlight-current-row
style="width: 100%"
v-loading="isLoading"
:max-height="650"
border
>
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="
(index) =>
(queryParams.pageNum - 1) * queryParams.pageSize +
index +
1
"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
/>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{ row }">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDialog(row, 'edit')"
>
编辑
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="customClassificationTableRef"
:columnsList="columnsList" :request-api="getListDataClassAPI">
<template slot="btn">
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['data:classify:add']"
@click="handleAdd">
新增
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(row)"
style="color: #f56c6c"
>
</template>
<template slot="handle" slot-scope="{ data }">
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['data:classify:update']"
@click="handleUpdate(data)">
修改
</el-button>
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['data:classify:del']"
@click="handleDelete(data)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 弹框 -->
<el-dialog
:title="dialogTitle"
:visible.sync="dialogVisible"
width="40%"
v-loading="isLoading"
>
<el-form
ref="dialogForm"
:model="dialogForm"
:rules="dialogRules"
label-width=""
size="small"
@submit.native.prevent
>
<el-form-item label="自定义分类名称" prop="classificationName">
<el-input
v-model="dialogForm.classificationName"
placeholder="请输入"
clearable
maxlength="50"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="分类描述" prop="remark">
<el-input
v-model="dialogForm.remark"
placeholder="请输入"
clearable
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
maxlength="200"
show-word-limit
style="width: 100%"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleSubmit"
> </el-button
>
</span>
</el-dialog>
</TableModel>
<!-- 新增/编辑 -->
<CustomizeForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
</div>
</template>
<script>
// import { } from '@/api/'
import TableModel from '@/components/TableModel'
import { columnsList, formLabel } from './config'
import {
deleteDataClassAPI,
getListDataClassAPI,
} from '@/api/archivesManagement/archClassification'
import CustomizeForm from './prop/customizeForm'
export default {
name: 'ArchClassification',
components: {
TableModel,
CustomizeForm
},
data() {
return {
isLoading: false,
showSearch: true,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
},
queryParams: {
pageNum: 1,
pageSize: 10,
name: '', //
},
total: 0, //
//
tableColumns: [
{ label: '自定义分类名称', prop: 'classificationName' },
{ label: '更新人', prop: 'updater' },
{ label: '更新时间', prop: 'updateTime' },
{ label: '分类描述', prop: 'remark' },
],
//
tableList: [
{
id: 1,
classificationName: '测试',
updater: '张三',
updateTime: '2024-06-20 12:00:00',
remark: '测试数据',
},
],
isOut: false, //
dialogTitle: '详情',
dialogVisible: false,
dialogForm: {
fileName: '',
remark: '',
},
dialogRules: {
classificationName: [
{
required: true,
message: '请输入自定义分类名称',
trigger: 'blur',
},
],
},
dimensionalityList: [
{ label: '变电', value: 1 },
{ label: '线路', value: 2 },
{ label: '电缆', value: 3 },
],
formLabel,
columnsList,
getListDataClassAPI,
title: "",
isflag: false,
isAdd: '',
row: {},
loading: false,
}
},
created() {
this.getList()
},
methods: {
//
/** 新增按钮操作 */
handleAdd() {
this.title = "新增";
this.isAdd = 'add';
this.isflag = true;
},
closeDialog() {
this.isflag = false;
},
showColose() {
this.isflag = false;
},
/** 修改操作 */
handleUpdate(row) {
this.title = "修改";
this.isAdd = 'edit';
this.row = row;
this.isflag = true;
},
/* 搜索操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
this.$refs.customClassificationTableRef.getTableList()
},
//
handleReset() {
this.$refs.queryForm.resetFields()
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
this.isLoading = true
try {
const params = {
...this.queryParams,
}
console.log('🚀 ~ getList ~ params:', params)
// const res = await (params)
// console.log('🚀 ~ ~ res:', res)
// this.tableList = res.data.rows || []
// this.total = res.data.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
handleDialog(row, type) {
console.log('🚀 ~ handleDialog ~ row:', row)
this.dialogTitle = type == 'add' ? '新增' : '编辑'
this.dialogVisible = true
setTimeout(() => {
this.$refs.dialogForm.resetFields()
if (type == 'edit') {
this.dialogForm.fileName = row.fileName
this.dialogForm.remark = row.remark
this.getDialogInfo()
}
}, 100)
},
//
/** 删除操作 */
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
try {
if (this.isLoading) return
this.isLoading = true
const params = { id: row.id }
console.log('🚀 ~ handleDelete ~ params:', params)
// const res = await (params)
// console.log('🚀 ~ ~ res:', res)
this.$message({
type: 'success',
message: '删除成功',
})
} catch (error) {
console.log('🚀 ~ handleDelete ~ error:', error)
} finally {
this.isLoading = false
this.getList()
}
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
})
})
},
//
async getDialogInfo() {
try {
this.isLoading = true
const params = { ...this.dialogForm }
console.log('🚀 ~ getDialogInfo ~ params:', params)
// const res = await (params)
// console.log('🚀 ~ ~ res:', res)
} catch (error) {
console.log('🚀 ~ 获取弹框信息 ~ error:', error)
} finally {
this.isLoading = false
}
},
//
handleSubmit() {
this.$refs.dialogForm.validate((valid) => {
console.log('🚀 ~ handleSubmit ~ valid:', valid)
if (!valid) return
try {
if (this.isLoading) return
this.isLoading = true
const params = { ...this.dialogForm }
console.log('🚀 ~ handleSubmit ~ params:', params)
} catch (error) {
console.log('🚀 ~ handleSubmit ~ error:', error)
} finally {
this.isLoading = false
this.dialogVisible = false
this.getList()
}
})
},
//
formatTime(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
},
//
handleExport() {
//
this.$message({
type: 'warning',
message: '导出功能开发中,敬请期待!',
})
try {
let fileName = `导出_${this.formatTime(new Date())}.xLsx`
let url = '/material/backstage/costPush/exportPushCheck'
const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params)
// this.derive(url, params, fileName)
// this.download(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
this.$modal.confirm(`是否确认删除数据类型名称为"${row.dataTypeName}"的数据项?`).then(() => {
//
this.$modal.loading("正在删除,请稍候...");
deleteDataClassAPI({ id: row.id }).then(res => {
this.$modal.closeLoading();
if (res.code === 200) {
this.$modal.msgSuccess("删除成功");
this.handleQuery();
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError("删除失败,请重试");
console.error('删除失败:', error);
});
}).catch(() => {
//
});
},
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,204 @@
<template>
<!-- 小型弹窗用于完成删除保存等操作 -->
<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-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-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" class="form-item"
v-model="form.remark" clearable show-word-limit placeholder="请输入分类描述" maxlength="255"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
<el-button type="primary" class="search-btn" :disabled="disabled"
@click="submitForm('ruleForm')">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import _ from 'lodash'
import {
addDataClassAPI,
updateDataClassAPI,
} from '@/api/archivesManagement/archCustomClassification'
export default {
name: "CustomizeForm",
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"],
dicts: ['dimension'],
data() {
return {
lDialog: this.width > 500 ? "w700" : "w500",
dialogVisible: true,
isDisabled: true,
form: {
dataTypeName: '',
dataTypeName2: '',
remark: '',
},
loading: null,
rules: {
dataTypeName: [
{ required: true, message: '数据类型名称不能为空', trigger: 'blur' }
],
dataTypeName2: [
{ required: true, message: '数据类型名称不能为空', trigger: 'blur' }
],
},
};
},
created() {
this.initFormData();
},
methods: {
/** 初始化表单数据 */
initFormData() {
if (this.isAdd === 'edit' && this.rowData) {
//
this.form = {
dataTypeName: this.rowData.dataTypeName || '',
dataTypeName2: this.rowData.dataTypeName2 || '',
remark: this.rowData.remark || '',
};
} else {
//
this.form = {
dataTypeName: '',
dataTypeName2: '',
remark: '',
};
}
},
/*关闭弹窗 */
handleClose() {
this.dialogVisible = false;
this.$emit("closeDialog");
setTimeout(() => {
this.dialogVisible = true;
});
},
/**确认弹窗 */
sureBtnClick() {
this.dialogVisible = false;
this.$emit("closeDialog");
setTimeout(() => {
this.dialogVisible = true;
});
},
/**重置表单*/
reset() {
this.form = {
dataTypeName: '',
dataTypeName2: '',
remark: '',
};
this.resetForm("ruleForm");
},
handleReuslt(res) {
this.$modal.msgSuccess(res.msg);
this.reset();
this.$emit('handleQuery');
this.handleClose();
},
/**验证 */
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
//
this.loading = this.$loading({
lock: true,
text: "数据提交中,请稍候...",
background: 'rgba(0,0,0,0.5)',
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 => {
this.loading.close();
if (res.code === 200) {
this.handleReuslt(res);
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.loading.close();
// this.$modal.msgError('');
});
} else {
const data = {
dataTypeName: params.dataTypeName,
dataTypeName2: params.dataTypeName2,
remark: params.remark,
id: this.rowData.id,
}
updateDataClassAPI(data).then(res => {
this.loading.close();
if (res.code === 200) {
this.handleReuslt(res);
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.loading.close();
// this.$modal.msgError('');
});
}
}
});
}
}
};
</script>
<style lang="scss">
.w700 .el-dialog {
width: 700px;
}
.w500 .el-dialog {
width: 500px;
}
.w500 .el-dialog__header,
.w700 .el-dialog__header {
// background: #eeeeee;
.el-dialog__title {
font-size: 16px;
}
}
.yxq .el-range-separator {
margin-right: 7px !important;
}
.el-date-editor--daterange.el-input__inner {
width: 260px;
}
.form-item {
width: 100%;
}
.select-style {
display: flex;
justify-content: space-between;
}
</style>

View File

@ -13,13 +13,13 @@
</template>
<template slot="handle" slot-scope="{ data }">
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['data:classify:update']"
@click="handleUpdate(data)">
@click="handleUpdate(data)" v-if="!data.contentsName">
配置档案类型
</el-button>
</template>
</TableModel>
<!-- 新增/编辑 -->
<DataClassForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
<!-- 配置 -->
<FileSetForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
</div>
</template>
@ -30,15 +30,15 @@ import { columnsList, formLabel } from './config'
import {
getProListAPI
} from '@/api/archivesManagement/project'
import DataClassForm from './prop/dataClassForm'
import FileSetForm from './prop/fileSetForm'
export default {
name: 'DataClassManage',
name: 'ProManager',
dicts:['pro_type','voltage_level'],
components: {
TableModel,
DataClassForm
FileSetForm
},
data() {
return {
@ -82,28 +82,6 @@ export default {
handleQuery() {
this.$refs.proTableRef.getTableList()
},
/** 删除操作 */
handleDelete(row) {
this.$modal.confirm(`是否确认删除数据类型名称为"${row.dataTypeName}"的数据项?`).then(() => {
//
this.$modal.loading("正在删除,请稍候...");
deleteDataClassAPI({ id: row.id }).then(res => {
this.$modal.closeLoading();
if (res.code === 200) {
this.$modal.msgSuccess("删除成功");
this.handleQuery();
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError("删除失败,请重试");
console.error('删除失败:', error);
});
}).catch(() => {
//
});
},
},
}
</script>

View File

@ -0,0 +1,164 @@
<template>
<!-- 小型弹窗用于完成删除保存等操作 -->
<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="id">
<el-select class="form-item" v-model="form.id" filterable clearable
placeholder="请选择档案类型">
<el-option v-for="item in fileSetList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
<el-button type="primary" class="search-btn" :disabled="disabled"
@click="submitForm('ruleForm')">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import _ from 'lodash'
import {
updateContentsNameAPI,
getFileCatalogSelectAPI
} from '@/api/archivesManagement/project'
export default {
name: "FileSetForm",
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"],
data() {
return {
lDialog: this.width > 500 ? "w700" : "w500",
dialogVisible: true,
isDisabled: true,
form: {
id: undefined,
proId:this.rowData.id,
},
fileSetList: [],
loading: null,
rules: {
id: [
{ required: true, message: '请选择档案类型', trigger: 'change' }
],
},
};
},
created() {
this.initFormData();
},
methods: {
/** 初始化表单数据 */
async initFormData() {
await getFileCatalogSelectAPI().then(res => {
this.fileSetList = res.data;
});
if (this.isAdd === 'edit' && this.rowData) {
//
this.form = {
id: undefined,
proId:this.rowData.id,
};
}
},
/*关闭弹窗 */
handleClose() {
this.dialogVisible = false;
this.$emit("closeDialog");
setTimeout(() => {
this.dialogVisible = true;
});
},
/**确认弹窗 */
sureBtnClick() {
this.dialogVisible = false;
this.$emit("closeDialog");
setTimeout(() => {
this.dialogVisible = true;
});
},
/**重置表单*/
reset() {
this.form = {
id: null,
proId:null,
};
this.resetForm("ruleForm");
},
handleReuslt(res) {
this.$modal.msgSuccess(res.msg);
this.reset();
this.$emit('handleQuery');
this.handleClose();
},
/**验证 */
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
//
this.loading = this.$loading({
lock: true,
text: "数据提交中,请稍候...",
background: 'rgba(0,0,0,0.5)',
target: this.$el.querySelector('.el-dialog') || document.body
})
let params = _.cloneDeep(this.form);
const selected = this.fileSetList.find(item => item.id === this.form.id);
params.contentsName = selected.name;
console.log(params);
updateContentsNameAPI(params).then(res => {
this.loading.close();
if (res.code === 200) {
this.handleReuslt(res);
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.loading.close();
// this.$modal.msgError('');
});
}
});
}
}
};
</script>
<style lang="scss">
.w700 .el-dialog {
width: 700px;
}
.w500 .el-dialog {
width: 500px;
}
.w500 .el-dialog__header,
.w700 .el-dialog__header {
// background: #eeeeee;
.el-dialog__title {
font-size: 16px;
}
}
.yxq .el-range-separator {
margin-right: 7px !important;
}
.el-date-editor--daterange.el-input__inner {
width: 260px;
}
.form-item {
width: 100%;
}
.select-style {
display: flex;
justify-content: space-between;
}
</style>