技术方案库修改
This commit is contained in:
parent
22acd6baa3
commit
314e59a34f
|
|
@ -198,6 +198,11 @@ export default {
|
|||
type: [Number, String],
|
||||
default: 600
|
||||
},
|
||||
// 是否自动加载数据 默认自动加载
|
||||
autoLoad: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
/* 根据操作栏控制表头是否显示 */
|
||||
|
|
@ -322,7 +327,10 @@ export default {
|
|||
this.$set(this.queryParams, key, this.sendParams[key])
|
||||
}
|
||||
}
|
||||
this.getTableList()
|
||||
// 根据 autoLoad 属性决定是否自动加载数据
|
||||
if (this.autoLoad) {
|
||||
this.getTableList()
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
// 若需要自适应最小宽度,可启用下行;当前使用固定宽度 handleColWidth
|
||||
|
|
|
|||
|
|
@ -57,14 +57,14 @@ export default {
|
|||
watch: {
|
||||
value(newVal) {
|
||||
if (newVal) {
|
||||
this.activeCategory = newVal
|
||||
this.activeCategory = parseInt(newVal)
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
mounted() {
|
||||
if (this.value) {
|
||||
this.activeCategory = this.value;
|
||||
this.activeCategory = parseInt(this.value);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
<!-- 技术方案列表 -->
|
||||
<div class="right-table-card">
|
||||
<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">
|
||||
<h3>数据列表</h3>
|
||||
</template>
|
||||
<template slot="tableActions">
|
||||
<el-button @click="handleAdd" :disabled="disabled" v-hasPermi="['enterpriseLibrary:technical:add']" class="add-btn"><i
|
||||
class="el-icon-plus"></i> 新增</el-button>
|
||||
<el-button @click="handleAdd" :disabled="disabled" v-hasPermi="['enterpriseLibrary:technical:add']"
|
||||
class="add-btn"><i class="el-icon-plus"></i> 新增</el-button>
|
||||
</template>
|
||||
<template slot="technicalSolutionState">
|
||||
<span>可引用</span>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<script>
|
||||
import TableModel from '@/components/TableModel2'
|
||||
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'
|
||||
|
||||
export default {
|
||||
|
|
@ -61,16 +61,25 @@ export default {
|
|||
}
|
||||
},
|
||||
watch: {
|
||||
value(newVal){
|
||||
if(newVal){
|
||||
this.handleQuery();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
value: {
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
this.$nextTick(() => {
|
||||
this.handleQuery();
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
disabled(){
|
||||
computed: {
|
||||
disabled() {
|
||||
return !this.value;
|
||||
},
|
||||
sendParams() {
|
||||
return {
|
||||
technicalSolutionTypeId: this.value
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -114,7 +123,7 @@ export default {
|
|||
/** 查看操作 */
|
||||
handleDetail(row) {
|
||||
console.log(row);
|
||||
|
||||
|
||||
this.$router.push({
|
||||
name: 'TechnicalDetail',
|
||||
query: {
|
||||
|
|
@ -131,24 +140,30 @@ export default {
|
|||
},
|
||||
/** 删除操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm(`是否确认删除此数据项?`).then(() => {
|
||||
// 显示加载遮罩
|
||||
this.$modal.loading("正在删除,请稍候...");
|
||||
delUser({ userId: row.userId }).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$confirm(`确定要删除方案类型"${raw.technicalSolutionName}"吗?删除后将无法恢复!`, '操作提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
dangerouslyUseHTMLString: true,
|
||||
customClass: 'delete-confirm-dialog'
|
||||
}).then(() => {
|
||||
delDataAPI(
|
||||
{
|
||||
technicalSolutionTypeId: raw.technicalSolutionTypeId,
|
||||
technicalSolutionId: row.technicalSolutionId
|
||||
}
|
||||
).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$message.success('删除成功');
|
||||
this.activeCategory = null;
|
||||
this.handleQuery();
|
||||
} else {
|
||||
this.$modal.msgError(res.msg);
|
||||
this.$message.error(res.msg || '删除失败');
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgError(error);
|
||||
console.error('删除失败:', error);
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消删除,不需要处理
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ export default {
|
|||
path: "/technical/index",
|
||||
query: {
|
||||
enterpriseId: encryptWithSM4(this.enterpriseId || '0'),
|
||||
checkedCategory: encryptWithSM4(this.technicalSolutionTypeId + ''),
|
||||
}
|
||||
}
|
||||
this.$tab.closeOpenPage(obj)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ export default {
|
|||
path: "/technical/index",
|
||||
query: {
|
||||
enterpriseId: encryptWithSM4(this.enterpriseId || '0'),
|
||||
checkedCategory: encryptWithSM4(this.technicalSolutionTypeId + ''),
|
||||
}
|
||||
}
|
||||
this.$tab.closeOpenPage(obj)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ export const formLabel = [
|
|||
isShow: false, // 是否展示label
|
||||
f_type: 'ipt',
|
||||
f_label: '方案名称',
|
||||
f_model: 'userName',
|
||||
f_model: 'technicalName',
|
||||
f_max: 32,
|
||||
},
|
||||
{
|
||||
|
|
@ -12,7 +12,7 @@ export const formLabel = [
|
|||
f_label: '建设性质',
|
||||
f_model: 'natureConstruction',
|
||||
f_selList: [],
|
||||
f_dict: 'nature_construction',
|
||||
f_dict: 'construction_nature',
|
||||
},
|
||||
{
|
||||
isShow: false, // 是否展示label
|
||||
|
|
|
|||
|
|
@ -34,17 +34,15 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
activeCategory: null,
|
||||
activeCategory: this.$route.query.checkedCategory ? decryptWithSM4(this.$route.query.checkedCategory) : null,
|
||||
enterpriseId: decryptWithSM4(this.$route.query.enterpriseId),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCategoryChange(categoryId) {
|
||||
this.activeCategory = categoryId
|
||||
console.log('切换到分类:', categoryId)
|
||||
},
|
||||
handleAddCategory() {
|
||||
console.log('添加分类')
|
||||
},
|
||||
handleCategoryCommand(command) {
|
||||
if (command.type === 'edit') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue