dev_xds
姜玉琦 2024-07-02 00:20:13 +08:00
commit c6cef388aa
2 changed files with 71 additions and 41 deletions

View File

@ -66,7 +66,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-if="1==2" v-hasPermi="['project:projectStandard:edit']"></el-button> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)" v-hasPermi="['project:projectStandard:edit']"></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['project:projectStandard:remove']">删除</el-button> v-hasPermi="['project:projectStandard:remove']">删除</el-button>
</template> </template>
@ -104,18 +104,20 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<standardDlg ref="dlg" @success="loadData"></standardDlg>
</div> </div>
</template> </template>
<script> <script>
import { listProjectStandard, getProjectStandard, delProjectStandard, addProjectStandard, updateProjectStandard } from "@/api/project/projectStandard"; import { listProjectStandard, getProjectStandard, delProjectStandard, addProjectStandard, updateProjectStandard } from "@/api/project/projectStandard";
import standardTypes from './standardType' import standardTypes from './standardType'
import standardDlg from './projectStandardDlg.vue'
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "ProjectStandard", name: "ProjectStandard",
components: { components: {
Treeselect Treeselect,standardDlg
}, },
data() { data() {
return { return {
@ -214,7 +216,7 @@ export default {
row.standardType=row.oldStandardType; row.standardType=row.oldStandardType;
}else{ }else{
updateProjectStandard(row).then(d=>{ updateProjectStandard(row).then(d=>{
debugger; this.$modal.msgSuccess("更新成功");
}) })
} }
},400); },400);
@ -269,6 +271,10 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
handleEdit(row) {
let tmps = this.depts.filter(d => d.deptId == this.activeName);
this.$refs.dlg.showDialog(this.prj, tmps.length > 0 ? tmps[0] : {}, row);
},
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)

View File

@ -12,15 +12,16 @@
<el-tab-pane :label="'' + it.deptName" :name="'' + it.deptId" :key="idx" v-for="(it, idx) in depts"> <el-tab-pane :label="'' + it.deptName" :name="'' + it.deptId" :key="idx" v-for="(it, idx) in depts">
<div> <div>
<el-button type="primary" @click="doAdd"></el-button> <el-button type="primary" @click="doAdd"></el-button>
<el-button style="margin-right:12px;" type="danger" :disabled="multiple" @click="handleDelete"></el-button> <el-button style="margin-right:12px;" type="danger" :disabled="multiple"
@click="handleDelete">删除</el-button>
<div style="display: inline-block;width:200px;position: relative;top: 12px;"> <div style="display: inline-block;width:200px;position: relative;top: 12px;">
<treeselect v-model="standType" :options="options" :show-count="true" placeholder="请选择类型" /> <treeselect v-model="standType" :options="options" :show-count="true" placeholder="请选择类型" />
</div> </div>
<el-button type="success" style="margin-left:12px;" @click="doQuery"></el-button> <el-button type="success" style="margin-left:12px;" @click="doQuery"></el-button>
</div> </div>
<div class="div-data"> <div class="div-data">
<el-table v-loading="loading" :data="projectStandardList" @selection-change="handleSelectionChange" <el-table v-loading="loading" :data="projectStandardList"
stripe> @selection-change="handleSelectionChange" stripe>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="图片路径" align="center" prop="imageFile"> <el-table-column label="图片路径" align="center" prop="imageFile">
<template slot-scope="{row}"> <template slot-scope="{row}">
@ -38,12 +39,15 @@
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" prop="ord"> <el-table-column label="排序" align="center" prop="ord">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-input-number v-model="row.ord" controls-position="right" @change="doSave(row, false)" <el-input-number v-model="row.ord" controls-position="right"
:min="1" :max="10000"></el-input-number> @change="doSave(row, false)" :min="1" :max="10000"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型" align="center" prop="standardType"> <el-table-column label="类型" align="center" prop="standardType" class-name="td-tree-select">
<template slot-scope="{row}">{{ getType(row) }}</template> <template slot-scope="{row}">
<treeselect v-model="row.standardType" :options="options" :show-count="true"
placeholder="请选择类型" @select="a => doRowSelect(row, a)" />
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -128,6 +132,17 @@ export default {
}, },
methods: { methods: {
doRowSelect(row, a) {
setTimeout(() => {
if (a.children && a.children.length > 0) {
row.standardType = row.oldStandardType;
} else {
updateProjectStandard(row).then(d => {
this.$modal.msgSuccess("更新成功");
})
}
}, 400);
},
doTabClick() { doTabClick() {
setTimeout(() => { setTimeout(() => {
this.doQuery(); this.doQuery();
@ -235,6 +250,7 @@ export default {
listProjectStandard(this.queryParams).then(response => { listProjectStandard(this.queryParams).then(response => {
this.projectStandardList = (response.rows || []).map(it => { this.projectStandardList = (response.rows || []).map(it => {
it.editDesc = false; it.editDesc = false;
it.oldStandardType=it.standardType;
return it; return it;
}); });
this.total = response.total; this.total = response.total;
@ -275,16 +291,24 @@ export default {
} }
} }
}</style> }
</style>
<style lang="scss"> <style lang="scss">
.project-standar-drawer { .project-standar-drawer {
.el-tab-pane { .el-tab-pane {
min-height: 800px; min-height: 800px;
} }
.vue-treeselect__menu-container { .vue-treeselect__menu-container {
.vue-treeselect__menu { .vue-treeselect__menu {
max-height: 600px !important; max-height: 600px !important;
} }
} }
.td-tree-select {
.cell {
overflow: visible;
}
}
} }
</style> </style>