技术方案库修改

This commit is contained in:
cwchen 2025-10-31 10:25:47 +08:00
parent 22acd6baa3
commit 314e59a34f
7 changed files with 56 additions and 33 deletions

View File

@ -198,6 +198,11 @@ export default {
type: [Number, String], type: [Number, String],
default: 600 default: 600
}, },
//
autoLoad: {
type: Boolean,
default: true
},
}, },
computed: { computed: {
/* 根据操作栏控制表头是否显示 */ /* 根据操作栏控制表头是否显示 */
@ -322,7 +327,10 @@ export default {
this.$set(this.queryParams, key, this.sendParams[key]) this.$set(this.queryParams, key, this.sendParams[key])
} }
} }
this.getTableList() // autoLoad
if (this.autoLoad) {
this.getTableList()
}
}, },
updated() { updated() {
// 使 handleColWidth // 使 handleColWidth

View File

@ -57,14 +57,14 @@ export default {
watch: { watch: {
value(newVal) { value(newVal) {
if (newVal) { if (newVal) {
this.activeCategory = newVal this.activeCategory = parseInt(newVal)
} }
}, },
immediate: true immediate: true
}, },
mounted() { mounted() {
if (this.value) { if (this.value) {
this.activeCategory = this.value; this.activeCategory = parseInt(this.value);
} }
}, },
created() { created() {

View File

@ -2,13 +2,13 @@
<!-- 技术方案列表 --> <!-- 技术方案列表 -->
<div class="right-table-card"> <div class="right-table-card">
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="false" ref="technicalTableRef" <TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="false" ref="technicalTableRef"
:columnsList="columnsList" :request-api="listAPI" :sendParams="{'technicalSolutionTypeId':value }"> :columnsList="columnsList" :request-api="listAPI" :sendParams="sendParams" :autoLoad="false">
<template slot="tableTitle"> <template slot="tableTitle">
<h3>数据列表</h3> <h3>数据列表</h3>
</template> </template>
<template slot="tableActions"> <template slot="tableActions">
<el-button @click="handleAdd" :disabled="disabled" v-hasPermi="['enterpriseLibrary:technical:add']" class="add-btn"><i <el-button @click="handleAdd" :disabled="disabled" v-hasPermi="['enterpriseLibrary:technical:add']"
class="el-icon-plus"></i> 新增</el-button> class="add-btn"><i class="el-icon-plus"></i> 新增</el-button>
</template> </template>
<template slot="technicalSolutionState"> <template slot="technicalSolutionState">
<span>可引用</span> <span>可引用</span>
@ -34,7 +34,7 @@
<script> <script>
import TableModel from '@/components/TableModel2' import TableModel from '@/components/TableModel2'
import { columnsList, formLabel } from './config' import { columnsList, formLabel } from './config'
import { listAPI,delDataAPI } from '@/api/enterpriseLibrary/technical/technical' import { listAPI, delDataAPI } from '@/api/enterpriseLibrary/technical/technical'
import { encryptWithSM4 } from '@/utils/sm' import { encryptWithSM4 } from '@/utils/sm'
export default { export default {
@ -61,16 +61,25 @@ export default {
} }
}, },
watch: { watch: {
value(newVal){ value: {
if(newVal){ handler(newVal) {
this.handleQuery(); if (newVal) {
} this.$nextTick(() => {
}, this.handleQuery();
immediate: true })
}
},
immediate: true
}
}, },
computed:{ computed: {
disabled(){ disabled() {
return !this.value; return !this.value;
},
sendParams() {
return {
technicalSolutionTypeId: this.value
}
} }
}, },
created() { created() {
@ -114,7 +123,7 @@ export default {
/** 查看操作 */ /** 查看操作 */
handleDetail(row) { handleDetail(row) {
console.log(row); console.log(row);
this.$router.push({ this.$router.push({
name: 'TechnicalDetail', name: 'TechnicalDetail',
query: { query: {
@ -131,24 +140,30 @@ export default {
}, },
/** 删除操作 */ /** 删除操作 */
handleDelete(row) { handleDelete(row) {
this.$modal.confirm(`是否确认删除此数据项?`).then(() => { this.$confirm(`确定要删除方案类型"${raw.technicalSolutionName}"吗?删除后将无法恢复!`, '操作提示', {
// confirmButtonText: '确定',
this.$modal.loading("正在删除,请稍候..."); cancelButtonText: '取消',
delUser({ userId: row.userId }).then(res => { type: 'warning',
this.$modal.closeLoading(); dangerouslyUseHTMLString: true,
customClass: 'delete-confirm-dialog'
}).then(() => {
delDataAPI(
{
technicalSolutionTypeId: raw.technicalSolutionTypeId,
technicalSolutionId: row.technicalSolutionId
}
).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$modal.msgSuccess("删除成功"); this.$message.success('删除成功');
this.activeCategory = null;
this.handleQuery(); this.handleQuery();
} else { } else {
this.$modal.msgError(res.msg); this.$message.error(res.msg || '删除失败');
} }
}).catch(error => { }).catch(error => {
this.$modal.closeLoading(); console.error('删除失败:', error);
this.$modal.msgError(error);
}); });
}).catch(() => { })
//
});
}, },
}, },
} }

View File

@ -52,6 +52,7 @@ export default {
path: "/technical/index", path: "/technical/index",
query: { query: {
enterpriseId: encryptWithSM4(this.enterpriseId || '0'), enterpriseId: encryptWithSM4(this.enterpriseId || '0'),
checkedCategory: encryptWithSM4(this.technicalSolutionTypeId + ''),
} }
} }
this.$tab.closeOpenPage(obj) this.$tab.closeOpenPage(obj)

View File

@ -64,6 +64,7 @@ export default {
path: "/technical/index", path: "/technical/index",
query: { query: {
enterpriseId: encryptWithSM4(this.enterpriseId || '0'), enterpriseId: encryptWithSM4(this.enterpriseId || '0'),
checkedCategory: encryptWithSM4(this.technicalSolutionTypeId + ''),
} }
} }
this.$tab.closeOpenPage(obj) this.$tab.closeOpenPage(obj)

View File

@ -3,7 +3,7 @@ export const formLabel = [
isShow: false, // 是否展示label isShow: false, // 是否展示label
f_type: 'ipt', f_type: 'ipt',
f_label: '方案名称', f_label: '方案名称',
f_model: 'userName', f_model: 'technicalName',
f_max: 32, f_max: 32,
}, },
{ {
@ -12,7 +12,7 @@ export const formLabel = [
f_label: '建设性质', f_label: '建设性质',
f_model: 'natureConstruction', f_model: 'natureConstruction',
f_selList: [], f_selList: [],
f_dict: 'nature_construction', f_dict: 'construction_nature',
}, },
{ {
isShow: false, // 是否展示label isShow: false, // 是否展示label

View File

@ -34,17 +34,15 @@ export default {
}, },
data() { data() {
return { return {
activeCategory: null, activeCategory: this.$route.query.checkedCategory ? decryptWithSM4(this.$route.query.checkedCategory) : null,
enterpriseId: decryptWithSM4(this.$route.query.enterpriseId), enterpriseId: decryptWithSM4(this.$route.query.enterpriseId),
} }
}, },
methods: { methods: {
handleCategoryChange(categoryId) { handleCategoryChange(categoryId) {
this.activeCategory = categoryId this.activeCategory = categoryId
console.log('切换到分类:', categoryId)
}, },
handleAddCategory() { handleAddCategory() {
console.log('添加分类')
}, },
handleCategoryCommand(command) { handleCategoryCommand(command) {
if (command.type === 'edit') { if (command.type === 'edit') {