From 8e3411a56294bb5884ff032dda49a862a87339ff Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期一, 23 六月 2025 22:48:12 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
---
src/views/wel/index.vue | 234 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 129 insertions(+), 105 deletions(-)
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 3b6bc1f..b65de3c 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -13,24 +13,78 @@
@refresh-change="refreshChange"
@on-load="onLoad"
@tree-load="treeLoad"
+ @row-del="rowDel"
@row-save="rowSave"
@row-update="rowUpdate"
- @row-del="rowDel"
>
- <template #menu="{row, size}">
- <el-button :size="size"
- text
- type="primary"
- @click="handleAdd(row)">鏂板瀛愮骇</el-button>
+ <template #name="{ row }">
+ <span>{{row.name}}</span>
+ <el-button :size="size" text icon="el-icon-setting" type="primary" placeholder="淇敼" @click="showEdit(row)"></el-button>
+ <el-button :size="size" text icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="鍒犻櫎"></el-button>
+ <el-button :size="size" text icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="鏂板瀛愮骇"></el-button>
</template>
</avue-crud>
+ <el-dialog :title="modalTitle" append-to-body v-model="modalBox">
+ <avue-form :option="modalOption" v-model="modalForm" @submit="modalSubmit" @reset-change="modalCancel"/>
+ </el-dialog>
</basic-container>
</template>
<script>
+
export default {
data() {
return {
+ selectedColumn: {},
+ modalForm: {},
+ modalOption: {
+ submitText: "淇濆瓨",
+ emptyText: "鍙栨秷",
+ menuPosition: "right",
+ column: [
+ {
+ label: '鑺傜偣绫诲瀷',
+ prop: 'nodeType',
+ type: 'select',
+ dicUrl: '/blade-system/dict-biz/dictionary?code=nc_node_type',
+ props: {
+ label: 'dictValue',
+ value: 'dictKey',
+ },
+ disabled: true
+ },
+ {
+ label: '璁惧锛堟満搴婏級',
+ prop: 'abc',
+ hide: true
+ },
+ {
+ label: '鑺傜偣鍚嶇О',
+ prop: 'name',
+ hide: true
+ },
+ {
+ label: '鑺傜偣鎻忚堪',
+ prop: 'abc',
+ hide: true
+ },
+ {
+ label: '鍏ㄨ矾寰�',
+ prop: 'abc',
+ hide: true,
+ span: 24
+ },
+ {
+ label: '澶囨敞',
+ prop: 'remark',
+ type: "textarea",
+ hide: true,
+ span: 24
+ }
+ ]
+ },
+ modalBox: false,
+ modalTitle: "",
id: "",
parentId:1,
search: {
@@ -47,107 +101,56 @@
lazy: true,
rowKey: 'id',
addBtn: false,
- // editBtn: false,
- // delBtn: false,
- // labelWidth: 120,
- // emptyBtn: false,
- // searchSpan: 8,
+ editBtn: false,
+ delBtn: false,
fit: true,
+ menu: false,
column: [
{
label: '鐩綍',
prop: 'name',
- width: '200',
- display: false
+ width: '300'
},
{
label: '鐗堟湰',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '鐗堟',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '鎻忚堪',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '绫诲瀷',
- prop: 'nodeType',
- display: false
+ prop: 'nodeType'
},
{
label: '璁惧',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '鍥哄寲鐘舵��',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '閿佸畾鐘舵��',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '娴佺▼鐘舵��',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '娴嬭瘯绋嬪簭',
- prop: '',
- display: false
+ prop: 'abc'
},
{
label: '鍒涘缓浜�',
prop: 'createUser',
- display: false
- },
- {
- label: '鑺傜偣绫诲瀷',
- prop: 'modalSelect',
- type: 'select',
- dicUrl: '/blade-system/dict-biz/dictionary?code=nc_node_type',
- props: {
- label: 'dictValue',
- value: 'dictKey',
- },
- hide: true
- },
- {
- label: '璁惧锛堟満搴婏級',
- prop: '',
- hide: true
- },
- {
- label: '鑺傜偣鍚嶇О',
- prop: 'name',
- hide: true
- },
- {
- label: '鑺傜偣鎻忚堪',
- prop: '',
- hide: true
- },
- {
- label: '鍏ㄨ矾寰�',
- prop: '',
- hide: true,
- span: 24
- },
- {
- label: '澶囨敞',
- prop: 'remark',
- type: "textarea",
- hide: true,
- span: 24
+ width: '180'
}
],
},
@@ -155,24 +158,65 @@
};
},
methods: {
- rowDel (row, index, done) {
- // alert(1);
- // done(row);
+ rowDel(row, index, done) {
+ console.log(done);
+ done(row);
},
- rowSave(row, done) { //鏂板瀛愯妭鐐�
- console.log(row,123)
- // row.parentId = 1;
- // row.id = 9;
- // console.log(row,11)
- // done(row);
+ rowSave (row, done) {
+ console.log(done,1111);
+ done(row);
},
rowUpdate (row, index, done) {
- //alert(3);
- //done(row);
+ console.log(done,222);
+ done(row);
},
- handleAdd (row) { //鏂板瀛愯妭鐐�
- this.id = row.id;
- this.$refs.crud.rowAdd();
+ showEdit(row,done) {
+ this.modalTitle = "淇敼";
+ this.modalBox = true;
+ return;
+ },
+ showDel(row) {
+ //璋冪敤鎺ュ彛
+ this.loading = true;
+ axios({
+ url: '/blade-mdm/program/node/remove',
+ method: 'post',
+ params: {id: row.id},
+ }).then(
+ res => {
+ this.loading = false;
+ this.$refs.crud.rowDel(row);
+ }
+ );
+ },
+ showAdd (row) { //鏂板瀛愯妭鐐�
+ this.modalTitle = "鏂板瀛愯妭鐐�";
+ this.selectedColumn.nodeType = String(Number(row.nodeType) + 10);
+ this.selectedColumn.parentId = row.id;
+ this.selectedColumn.name = "";
+ this.selectedColumn.id = "";
+ this.modalForm = this.selectedColumn;
+ this.modalBox = true;
+ },
+ modalSubmit(row) { //鏂板瀛愯妭鐐逛繚瀛�
+ //璋冪敤鎺ュ彛
+ this.loading = true;
+ axios({
+ url: '/blade-mdm/program/node/save',
+ method: 'post',
+ data: this.modalForm,
+ }).then(
+ res => {
+ //this.$refs.crud.rowSave(this.modalForm);
+ this.onLoad();
+ this.$refs.crud.refreshTable();
+ this.modalBox = false;
+ this.loading = false;
+ }
+ );
+ },
+ modalCancel() {
+ this.modalBox = false;
},
treeLoad (tree, treeNode, resolve) {
// setTimeout(() => {
@@ -204,26 +248,6 @@
this.loading = false;
}
);
- // this.data = [{
- // id: this.parentId,
- // parentId: this.parentId,
- // date: '2016-05-02',
- // name: '鐜嬪皬铏�',
- // address: 'hhh',
- // hasChildren: true
- // },
- // {
- // id: 7,
- // parentId: 7,
- // date: '2016-05-02',
- // name: '鐜嬪皬铏�',
- // address: 'hhh',
- // hasChildren: false
- // }]
- // this.loading = false;
- },
- handleEdit(row,index) {
-
},
currentChange(current) {
this.mypage.current = current;
--
Gitblit v1.9.3