Showing
8 changed files
with
326 additions
and
52 deletions
doc/SQL/zj/V1119_1_文档管理回收站菜单.txt
0 → 100644
1 | +INSERT INTO `user-center`.`sys_menu`(`id`, `parentId`, `menuCode`, `name`, `url`, `path`, `css`, `sort`, `createTime`, `updateTime`, `isMenu`, `hidden`, `menuDesc`, `type`, `moduleid`) VALUES (1900012, 900800, '', '回收站', NULL, 'documentationManagement/documentRecycle', 'layui-icon-menu-fill', 140400, '2021-10-25 05:10:39', '2021-10-25 05:25:39', 1, 0, '', 1, 'documentRecycle'); | ||
2 | + | ||
3 | +INSERT INTO `user-center`.`sys_role_menu`(`roleId`, `menuId`) VALUES (1, 1900012); |
@@ -15,6 +15,9 @@ | @@ -15,6 +15,9 @@ | ||
15 | {{node.label }} | 15 | {{node.label }} |
16 | </div> | 16 | </div> |
17 | <div style="width: 60px;" v-if="isAdmin()"> | 17 | <div style="width: 60px;" v-if="isAdmin()"> |
18 | + <a @click="editType(data)" style="margin-right: 10px;"> | ||
19 | + <i class="el-icon-edit"></i> | ||
20 | + </a> | ||
18 | <a @click="showFolder(true,false)" style="margin-right: 10px;"> | 21 | <a @click="showFolder(true,false)" style="margin-right: 10px;"> |
19 | <i class="el-icon-plus"></i> | 22 | <i class="el-icon-plus"></i> |
20 | </a> | 23 | </a> |
@@ -36,7 +39,7 @@ | @@ -36,7 +39,7 @@ | ||
36 | style="width: 220px;margin-right:10px" clearable/> | 39 | style="width: 220px;margin-right:10px" clearable/> |
37 | <el-button :size="$global.elementSize" @click="searchFile"> | 40 | <el-button :size="$global.elementSize" @click="searchFile"> |
38 | <i class="iconfont icon-sousuo"></i>搜索</el-button> | 41 | <i class="iconfont icon-sousuo"></i>搜索</el-button> |
39 | - <el-button :size="$global.elementSize" @click="showUserDialog(true)" v-if="!isView"> | 42 | + <el-button :size="$global.elementSize" @click="showUserDialog(true)" v-if="!isView && !isRecycle"> |
40 | <i class="iconfont icon-icon--quanxian"></i> | 43 | <i class="iconfont icon-icon--quanxian"></i> |
41 | 授权 | 44 | 授权 |
42 | </el-button> | 45 | </el-button> |
@@ -44,11 +47,11 @@ | @@ -44,11 +47,11 @@ | ||
44 | <i class="iconfont icon-icon--download"></i> | 47 | <i class="iconfont icon-icon--download"></i> |
45 | 下载 | 48 | 下载 |
46 | </el-button> | 49 | </el-button> |
47 | - <el-button :size="$global.elementSize" @click="showFolder(true,true)" v-if="canAddFolder"> | 50 | + <el-button :size="$global.elementSize" @click="showFolder(true,true)" v-if="canAddFolder && !isRecycle"> |
48 | <i class="iconfont icon-weidaqiadewenjianjia"></i> | 51 | <i class="iconfont icon-weidaqiadewenjianjia"></i> |
49 | 新增文件夹 | 52 | 新增文件夹 |
50 | </el-button> | 53 | </el-button> |
51 | - <el-button type="primary" :size="$global.elementSize" @click="showUploadFile(true)"> | 54 | + <el-button type="primary" :size="$global.elementSize" @click="showUploadFile(true)" v-if=" !isRecycle"> |
52 | <i class="iconfont icon-icon--shangchuan"></i> | 55 | <i class="iconfont icon-icon--shangchuan"></i> |
53 | 上传 | 56 | 上传 |
54 | </el-button> | 57 | </el-button> |
@@ -200,12 +200,14 @@ export default { | @@ -200,12 +200,14 @@ export default { | ||
200 | // 左侧树 | 200 | // 左侧树 |
201 | let getTree = () => { | 201 | let getTree = () => { |
202 | // 查询条件 | 202 | // 查询条件 |
203 | - | 203 | + let params = { |
204 | + recycle: props.isRecycle ? 1: 0 | ||
205 | + }; | ||
204 | let url = `/inspection-report/file/document/tree`; | 206 | let url = `/inspection-report/file/document/tree`; |
205 | if(props.isRecycle){ | 207 | if(props.isRecycle){ |
206 | url = `/inspection-report/file/document/tree/recycle`; | 208 | url = `/inspection-report/file/document/tree/recycle`; |
207 | } | 209 | } |
208 | - proxy.$http.get("/inspection-report/file/document/tree", {}, function (res) { | 210 | + proxy.$http.get("/inspection-report/file/document/tree", params, function (res) { |
209 | if (res && res.data) { | 211 | if (res && res.data) { |
210 | treeData.value = res.data; | 212 | treeData.value = res.data; |
211 | let first = res.data[0]; | 213 | let first = res.data[0]; |
@@ -353,6 +355,11 @@ export default { | @@ -353,6 +355,11 @@ export default { | ||
353 | } | 355 | } |
354 | addDialogTitle.value = title | 356 | addDialogTitle.value = title |
355 | } | 357 | } |
358 | + let editType = (data) =>{ | ||
359 | + Object.assign(docForm.value,data); | ||
360 | + addDialogVisible.value = true; | ||
361 | + isUserFolder.value = false; | ||
362 | + } | ||
356 | 363 | ||
357 | /** | 364 | /** |
358 | * 添加文件夹 | 365 | * 添加文件夹 |
@@ -372,7 +379,11 @@ export default { | @@ -372,7 +379,11 @@ export default { | ||
372 | // 新增 | 379 | // 新增 |
373 | proxy.$http.get(`/inspection-report/file/file/insertFolder`, params, function (res) { | 380 | proxy.$http.get(`/inspection-report/file/file/insertFolder`, params, function (res) { |
374 | if (res && res.code == 0) { | 381 | if (res && res.code == 0) { |
375 | - proxy.$global.showMsg("新建成功!"); | 382 | + let msg = res.msg; |
383 | + if(!msg){ | ||
384 | + msg = "操作成功"; | ||
385 | + } | ||
386 | + proxy.$global.showMsg(msg); | ||
376 | } | 387 | } |
377 | }) | 388 | }) |
378 | // 属性tree | 389 | // 属性tree |
@@ -512,7 +523,7 @@ export default { | @@ -512,7 +523,7 @@ export default { | ||
512 | 523 | ||
513 | 524 | ||
514 | let isAdmin = () =>{ | 525 | let isAdmin = () =>{ |
515 | - return localStorage.getItem('lgn') == 'admin'; | 526 | + return localStorage.getItem('lgn') == 'admin' && props.isRecycle == false; |
516 | } | 527 | } |
517 | 528 | ||
518 | /** | 529 | /** |
@@ -521,14 +532,6 @@ export default { | @@ -521,14 +532,6 @@ export default { | ||
521 | * @param index | 532 | * @param index |
522 | */ | 533 | */ |
523 | let clickTopNav = (item,index) =>{ | 534 | let clickTopNav = (item,index) =>{ |
524 | - // let arr = historyNode.value; | ||
525 | - // // 删除当前节点后面的路径 | ||
526 | - // arr.filter(function (v,i) { | ||
527 | - // if(i > index){ | ||
528 | - // arr.splice(i,1); | ||
529 | - // } | ||
530 | - // }) | ||
531 | - | ||
532 | addHistoryNode(item); | 535 | addHistoryNode(item); |
533 | getPage(item.id); | 536 | getPage(item.id); |
534 | } | 537 | } |
@@ -636,7 +639,8 @@ export default { | @@ -636,7 +639,8 @@ export default { | ||
636 | tagHandleClose, | 639 | tagHandleClose, |
637 | isAdmin, | 640 | isAdmin, |
638 | reNameFile, | 641 | reNameFile, |
639 | - reNameFileFlg | 642 | + reNameFileFlg, |
643 | + editType | ||
640 | 644 | ||
641 | } | 645 | } |
642 | } | 646 | } |
@@ -21,9 +21,9 @@ | @@ -21,9 +21,9 @@ | ||
21 | {{scope.row[item.prop]}} | 21 | {{scope.row[item.prop]}} |
22 | </span> | 22 | </span> |
23 | </slot> | 23 | </slot> |
24 | - | ||
25 | </template> | 24 | </template> |
26 | </el-table-column> | 25 | </el-table-column> |
26 | + <slot name="tools" v-if="columns.length > 0" ></slot> | ||
27 | </el-table> | 27 | </el-table> |
28 | <!-- 分页 --> | 28 | <!-- 分页 --> |
29 | <div style='text-align: center;background-color: white' v-if="showPage"> | 29 | <div style='text-align: center;background-color: white' v-if="showPage"> |
1 | -<el-row :gutter="5" > | ||
2 | - <el-col :span="3" > | 1 | +<div> |
2 | + <el-row :gutter="5"> | ||
3 | + <el-col :span="3"> | ||
3 | <div class="cm-card" :style="{'min-height':height+'px','height':'100%'}"> | 4 | <div class="cm-card" :style="{'min-height':height+'px','height':'100%'}"> |
4 | <div style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold"> | 5 | <div style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold"> |
5 | <el-link type="info" :underline="false"><i class="iconfont icon-liebiao"></i> 资源类型</el-link> | 6 | <el-link type="info" :underline="false"><i class="iconfont icon-liebiao"></i> 资源类型</el-link> |
6 | </div> | 7 | </div> |
7 | - <el-tree :data="treeData" :default-expanded-keys="[1]" node-key="id" @node-click="handleConfigNodeClick"/> | 8 | + <el-tree :data="treeData" :props="props" > |
9 | + <template #default="{ node, data }"> | ||
10 | + <div style="position: relative;flex-direction: row;width: 100%;"> | ||
11 | + <div style="width: calc(100% - 60px);max-width: calc(100% - 60px);overflow: hidden;text-overflow: ellipsis;text-align: left;" | ||
12 | + @click="handleConfigNodeClick(data)" :title="node.label"> | ||
13 | + {{node.label }} | ||
14 | + </div> | ||
15 | + <div style="width: 60px;float: right"> | ||
16 | + <a @click="editType(data)" style="margin-right: 10px;"> | ||
17 | + <i class="el-icon-setting"></i> | ||
18 | + </a> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + </template> | ||
22 | + </el-tree> | ||
8 | </div> | 23 | </div> |
9 | </el-col> | 24 | </el-col> |
10 | - <el-col :span="21" > | ||
11 | - <div class="cm-card" :style="{'min-height':height+'px','height':'100%'}" > | 25 | + <el-col :span="21"> |
26 | + <div class="cm-card" :style="{'min-height':height+'px','height':'100%'}"> | ||
27 | + <div style="text-align: left;padding: 3px;"> | ||
28 | + <el-dropdown split-button @click="addConfig()"> | ||
29 | + <i class="icon el-icon-plus"/>添加 | ||
30 | + <template #dropdown> | ||
31 | + <div style="max-height: 300px;overflow-y: auto"> | ||
32 | + <el-dropdown-menu> | ||
33 | + <el-dropdown-item v-for="(item ,index) in defList" @click="addConfig(item)"> | ||
34 | + {{item.colAlias}} | ||
35 | + </el-dropdown-item> | ||
36 | + </el-dropdown-menu> | ||
37 | + </div> | ||
38 | + | ||
39 | + </template> | ||
40 | + </el-dropdown> | ||
41 | + <el-button type="primary" @click="saveConfig" style="margin-left: 10px">保存</el-button> | ||
42 | + </div> | ||
12 | 43 | ||
13 | <cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true" | 44 | <cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true" |
14 | :showBorder="true" :currentPage="currentPage" :loading="false" | 45 | :showBorder="true" :currentPage="currentPage" :loading="false" |
15 | :showPage="false" :height="(height - 20)"> | 46 | :showPage="false" :height="(height - 20)"> |
16 | <template #default="{row,prop,column}"> | 47 | <template #default="{row,prop,column}"> |
17 | - <span v-if="prop == 'resListId'" >{{currentNode.label}}</span> | 48 | + <span v-if="prop == 'resListId'">{{currentNode.label}}</span> |
18 | <div v-else> | 49 | <div v-else> |
19 | <div v-if="['showUsers'].indexOf(prop) != -1"> | 50 | <div v-if="['showUsers'].indexOf(prop) != -1"> |
20 | showUsers | 51 | showUsers |
21 | </div> | 52 | </div> |
22 | - <div v-else-if="['colSort','colWidth'].indexOf(prop) != -1"> | ||
23 | - <el-input @blur="changeProperty(row,prop,column)" type="number" size="small" placeholder="请填写" | ||
24 | - v-model="row[prop]"> | ||
25 | - <!--<template #suffix> | ||
26 | - <i class="el-icon-edit"/> | ||
27 | - </template>--> | ||
28 | - </el-input> | ||
29 | - </div> | 53 | + |
30 | <div v-else-if="['colIsTd','isQuery','isFilter','status'].indexOf(prop) != -1"> | 54 | <div v-else-if="['colIsTd','isQuery','isFilter','status'].indexOf(prop) != -1"> |
31 | <!-- 展示下拉选项 --> | 55 | <!-- 展示下拉选项 --> |
32 | <el-select placeholder="请选择" size="small" style="width: 100%" | 56 | <el-select placeholder="请选择" size="small" style="width: 100%" |
33 | - @change="changeProperty(row,prop,column)" v-model="row[prop]" :multiple="false" | 57 | + @change="changeProperty(row,prop,column)" v-model="row[prop]" |
58 | + :multiple="false" | ||
34 | collapse-tags clearable filterable placeholder="请选择"> | 59 | collapse-tags clearable filterable placeholder="请选择"> |
35 | - <el-option label="是" :value="0"> </el-option> | ||
36 | - <el-option label="否" :value="1"> </el-option> | 60 | + <el-option label="是" :value="0"></el-option> |
61 | + <el-option label="否" :value="1"></el-option> | ||
37 | </el-select> | 62 | </el-select> |
38 | </div> | 63 | </div> |
39 | <div v-else-if="['colType'].indexOf(prop) != -1"> | 64 | <div v-else-if="['colType'].indexOf(prop) != -1"> |
40 | <el-select placeholder="选择类型" size="small" style="width: 100%" | 65 | <el-select placeholder="选择类型" size="small" style="width: 100%" |
41 | - @change="changeProperty(row,prop,column)" v-model="row.colType" :multiple="false" | 66 | + @change="getColType(row)" v-model="row.colType" :multiple="false" |
42 | collapse-tags clearable filterable placeholder="请选择"> | 67 | collapse-tags clearable filterable placeholder="请选择"> |
43 | <el-option v-for="(value,key) in colTypes" :key="index" | 68 | <el-option v-for="(value,key) in colTypes" :key="index" |
44 | :label="value" | 69 | :label="value" |
@@ -47,22 +72,68 @@ | @@ -47,22 +72,68 @@ | ||
47 | </el-select> | 72 | </el-select> |
48 | </div> | 73 | </div> |
49 | <div v-else-if="['colTypeQueryFields'].indexOf(prop) != -1"> | 74 | <div v-else-if="['colTypeQueryFields'].indexOf(prop) != -1"> |
50 | - colTypeQueryFields | 75 | + <span v-if="Object.keys(fieldsObj).length == 0 || fieldsObj.propertyType == 'INPUT' || row.colType == 'INPUT'"> - </span> |
76 | + | ||
77 | + <el-select v-else-if="fieldsObj.propertyType == 'LIST'" placeholder="请选择扩展属性" | ||
78 | + size="small" style="width: 100%" | ||
79 | + @change="getColTypeExtVal(row)" v-model="row.colTypeQueryFields" | ||
80 | + :multiple="false" | ||
81 | + collapse-tags clearable filterable placeholder="请选择"> | ||
82 | + <el-option v-for="(value,key) in fieldsObj.object" :key="index" | ||
83 | + :label="value[fieldsObj.text]" | ||
84 | + :value="value[fieldsObj.value]"> | ||
85 | + </el-option> | ||
86 | + </el-select> | ||
87 | + </div> | ||
88 | + | ||
89 | + <div v-else-if="prop == 'colTypeVal'"> | ||
90 | + <span v-if="fieldsValueObj == undefined || fieldsValueObj[row.id] == undefined || Object.keys(fieldsValueObj) == 0"> - </span> | ||
91 | + <el-button v-else icon="el-icon-setting" @click="showSettingCmDialog(true,row)" size="mini" | ||
92 | + style="margin-left: 10px"></el-button> | ||
51 | </div> | 93 | </div> |
52 | 94 | ||
53 | <div v-else> | 95 | <div v-else> |
54 | - <el-input @blur="changeProperty(row,prop,column)" size="small" placeholder="请填写" | ||
55 | - prefix-icon="el-icon-edit" v-model="row[prop]"> | ||
56 | - <!--<template #suffix> | ||
57 | - <i class="el-icon-loading"/> | ||
58 | - <i class="el-icon-edit"/> | ||
59 | - </template>--> | 96 | + <el-input @blur="changeProperty(row,prop,column)" |
97 | + :type="['colSort','colWidth'].indexOf(prop) != -1 ? 'number' : 'text'" | ||
98 | + size="small" placeholder="请填写"v-model="row[prop]"> | ||
99 | + <template #suffix> | ||
100 | + <i class="el-icon-edit" style="color: #409EFF" v-if="editColProps[prop] && editColProps[prop] == true"/> | ||
101 | + <i class="el-icon-circle-check" v-else-if="editColProps[prop] && editColProps[prop] == false" /> | ||
102 | + <i class="el-icon-edit-outline" v-else /> | ||
103 | + </template> | ||
60 | </el-input> | 104 | </el-input> |
61 | </div> | 105 | </div> |
62 | 106 | ||
63 | </div> | 107 | </div> |
64 | </template> | 108 | </template> |
109 | + <template #tools> | ||
110 | + <el-table-column fixed="right" label="操作" width="80" align="center"> | ||
111 | + <template #default="scope"> | ||
112 | + <el-button type="text" size="small" @click.prevent="deleteRow(scope.$index)"> | ||
113 | + <i class="el-icon-delete"/> | ||
114 | + </el-button> | ||
115 | + </template> | ||
116 | + </el-table-column> | ||
117 | + </template> | ||
65 | </cm-table-page> | 118 | </cm-table-page> |
66 | </div> | 119 | </div> |
67 | </el-col> | 120 | </el-col> |
68 | -</el-row> | 121 | + </el-row> |
122 | + | ||
123 | + <cm-dialog title="属性配置" width="500px" :showDialogVisible="settingCmDialogFlg" @hidedialog="showSettingCmDialog" @okfunc="getSettingDetail"> | ||
124 | + <template v-slot> | ||
125 | + <div style="padding: 10px" style="display: flex"> | ||
126 | + <div v-for="(v,k) in fieldsValueObj[currentRow.id].props" style="width: 50%"> | ||
127 | + <div style="text-align: left;padding-left: 10px;">{{v}}</div> | ||
128 | + <el-select v-model="settingVal[currentRow.id][k]" :placeholder="v" style="margin: 3px"> | ||
129 | + <el-option v-for="(value ,index) in fieldsValueObj[currentRow.id].object" | ||
130 | + :key="index" | ||
131 | + :label="value[fieldsValueObj[currentRow.id].text]" | ||
132 | + :value="value[fieldsValueObj[currentRow.id].value]" > | ||
133 | + </el-option> | ||
134 | + </el-select> | ||
135 | + </div> | ||
136 | + </div> | ||
137 | + </template> | ||
138 | + </cm-dialog> | ||
139 | +</div> |
@@ -2,19 +2,99 @@ | @@ -2,19 +2,99 @@ | ||
2 | * 配置页面编辑属性 | 2 | * 配置页面编辑属性 |
3 | * @returns {{editColProps: {}}} | 3 | * @returns {{editColProps: {}}} |
4 | */ | 4 | */ |
5 | -let configPageEdit = () =>{ | 5 | +let configPageEdit = () => { |
6 | + const {proxy} = Vue.getCurrentInstance(); | ||
6 | // 编辑属性 | 7 | // 编辑属性 |
7 | let editColProps = Vue.ref({}); | 8 | let editColProps = Vue.ref({}); |
9 | + let fieldsObj = Vue.ref({}); | ||
10 | + let fieldsValueObj = Vue.ref({}); | ||
11 | + let settingCmDialogFlg = Vue.ref(false); | ||
12 | + let currentRow = Vue.ref({}); | ||
13 | + let settingVal = Vue.ref({}); | ||
14 | + | ||
15 | + /** | ||
16 | + * 配置行编辑 | ||
17 | + * | ||
18 | + * 作者: Wang | ||
19 | + * 时间:2021/10/27 14:34 | ||
20 | + */ | ||
21 | + let changeProperty = (row, prop, column) => { | ||
22 | + let isAdd = row.isAdd; | ||
23 | + // if(isAdd && isAdd == 1){ | ||
24 | + // // 新增编辑 | ||
25 | + // } | ||
26 | + editColProps.value[prop] = true; | ||
27 | + } | ||
8 | 28 | ||
9 | - // 配置行编辑 | ||
10 | - let changeProperty = (row,prop,column) =>{ | 29 | + /** |
30 | + * 属性配置 | ||
31 | + * | ||
32 | + * 作者: Wang | ||
33 | + * 时间:2021/10/27 14:34 | ||
34 | + */ | ||
35 | + let getColType = (row) => { | ||
11 | 36 | ||
37 | + // 获取属性标识的配置 | ||
38 | + let code = row.colType; | ||
39 | + proxy.$http.get(`/api-web/v32/res/list/detail/col/${code}`, {}, function (res) { | ||
40 | + if (res && res.object) { | ||
41 | + fieldsObj.value = res.object; | ||
42 | + row.colTypeQueryFields = ''; | ||
43 | + } | ||
44 | + }); | ||
45 | + } | ||
46 | + | ||
47 | + /** | ||
48 | + * 属性配置扩展值 | ||
49 | + * | ||
50 | + * 作者: Wang | ||
51 | + * 时间:2021/10/27 14:34 | ||
52 | + */ | ||
53 | + let getColTypeExtVal = (row) => { | ||
54 | + // 获取属性标识的配置 | ||
55 | + let params = { | ||
56 | + colType: row.colType, | ||
57 | + colTypeQueryFields: row.colTypeQueryFields | ||
58 | + } | ||
59 | + proxy.$http.get(`/api-web/v32/res/list/detail/setting`, params, function (res) { | ||
60 | + if (res && res.object) { | ||
61 | + fieldsValueObj.value[row.id] = res.object; | ||
62 | + settingVal.value[row.id] = {}; | ||
63 | + } | ||
64 | + }); | ||
65 | + | ||
66 | + } | ||
67 | + | ||
68 | + let showSettingCmDialog = (flg, row) => { | ||
69 | + settingCmDialogFlg.value = flg; | ||
70 | + if (flg == true && row) { | ||
71 | + currentRow.value = row; | ||
72 | + // 记载已配置的属性 | ||
73 | + if(row.setting && row.setting[row.id]){ | ||
74 | + settingVal.value[row.id] = row.setting[row.id] | ||
75 | + } | ||
76 | + } | ||
12 | } | 77 | } |
13 | 78 | ||
79 | + let getSettingDetail = () => { | ||
80 | + showSettingCmDialog(false) | ||
81 | + // 标记为已设置 | ||
82 | + currentRow.value['setting'] = settingVal.value[currentRow.value.id]; | ||
83 | + } | ||
14 | 84 | ||
15 | 85 | ||
16 | return { | 86 | return { |
17 | - editColProps,changeProperty | 87 | + editColProps, |
88 | + changeProperty, | ||
89 | + getColType, | ||
90 | + fieldsObj, | ||
91 | + fieldsValueObj, | ||
92 | + getColTypeExtVal, | ||
93 | + settingCmDialogFlg, | ||
94 | + showSettingCmDialog, | ||
95 | + getSettingDetail, | ||
96 | + currentRow, | ||
97 | + settingVal | ||
18 | } | 98 | } |
19 | } | 99 | } |
20 | 100 | ||
@@ -44,12 +124,39 @@ export default { | @@ -44,12 +124,39 @@ export default { | ||
44 | let dataList = Vue.ref([]); | 124 | let dataList = Vue.ref([]); |
45 | let columns = Vue.ref([]); | 125 | let columns = Vue.ref([]); |
46 | let colTypes = Vue.ref({}); | 126 | let colTypes = Vue.ref({}); |
127 | + let defList = Vue.ref([]); | ||
128 | + | ||
129 | + // 单元格编辑 | ||
130 | + const { | ||
131 | + editColProps, | ||
132 | + changeProperty, | ||
133 | + getColType, | ||
134 | + fieldsObj, | ||
135 | + fieldsValueObj, | ||
136 | + getColTypeExtVal, | ||
137 | + settingCmDialogFlg, | ||
138 | + showSettingCmDialog, | ||
139 | + getSettingDetail, | ||
140 | + currentRow, | ||
141 | + settingVal | ||
142 | + } = configPageEdit() | ||
143 | + | ||
47 | 144 | ||
48 | // 获取左侧树结构 | 145 | // 获取左侧树结构 |
49 | let loadTree = () => { | 146 | let loadTree = () => { |
50 | proxy.$http.get("/api-web/v32/res/list/config/tree", {}, function (res) { | 147 | proxy.$http.get("/api-web/v32/res/list/config/tree", {}, function (res) { |
51 | if (res && res.data) { | 148 | if (res && res.data) { |
52 | - treeData.value = res.data | 149 | + let arr = []; |
150 | + res.data.forEach(function (v){ | ||
151 | + arr.push({ | ||
152 | + id:v.id, | ||
153 | + label:v.label, | ||
154 | + children:v.children | ||
155 | + }); | ||
156 | + }) | ||
157 | + | ||
158 | + treeData.value = arr | ||
159 | + //treeData.value = res.data; | ||
53 | currentNode.value = res.data[0]; | 160 | currentNode.value = res.data[0]; |
54 | 161 | ||
55 | getConfigData(); | 162 | getConfigData(); |
@@ -61,18 +168,29 @@ export default { | @@ -61,18 +168,29 @@ export default { | ||
61 | if (currentNode.value) { | 168 | if (currentNode.value) { |
62 | // 查询参数 | 169 | // 查询参数 |
63 | let params = { | 170 | let params = { |
64 | - treeNodeId: currentNode.value.id | 171 | + treeNodeId: currentNode.value.id, |
172 | + loadDefault: defList.value.length == 0 ? 1 : 0 | ||
65 | } | 173 | } |
66 | proxy.$http.get(`/api-web/v32/res/list/config`, params, function (res) { | 174 | proxy.$http.get(`/api-web/v32/res/list/config`, params, function (res) { |
67 | if (res && res.object) { | 175 | if (res && res.object) { |
68 | columns.value = res.object.columns; | 176 | columns.value = res.object.columns; |
69 | dataList.value = res.object.datas; | 177 | dataList.value = res.object.datas; |
70 | colTypes.value = res.object.colTypes; | 178 | colTypes.value = res.object.colTypes; |
179 | + let arr = res.object.defaultList; | ||
180 | + if (arr && arr.length > 0) { | ||
181 | + defList.value = arr; | ||
182 | + } | ||
71 | } | 183 | } |
72 | }); | 184 | }); |
73 | } | 185 | } |
74 | } | 186 | } |
75 | 187 | ||
188 | + /** | ||
189 | + * 左侧树,树节点点击 | ||
190 | + * | ||
191 | + * 作者: Wang | ||
192 | + * 时间:2021/10/28 17:55 | ||
193 | + */ | ||
76 | let handleConfigNodeClick = (data) => { | 194 | let handleConfigNodeClick = (data) => { |
77 | if (data) { | 195 | if (data) { |
78 | currentNode.value = data; | 196 | currentNode.value = data; |
@@ -80,6 +198,66 @@ export default { | @@ -80,6 +198,66 @@ export default { | ||
80 | } | 198 | } |
81 | } | 199 | } |
82 | 200 | ||
201 | + /** | ||
202 | + * 添加列 | ||
203 | + * | ||
204 | + * 作者: Wang | ||
205 | + * 时间:2021/10/26 17:33 | ||
206 | + */ | ||
207 | + let addConfig = (item) => { | ||
208 | + if (!item) { | ||
209 | + let data = {}; | ||
210 | + // 增加一个空行 | ||
211 | + columns.value.forEach(function (v) { | ||
212 | + data[v.prop] = ''; | ||
213 | + }) | ||
214 | + data['id'] = (new Date()).getTime(); | ||
215 | + data['colType'] = "INPUT"; | ||
216 | + data['colWidth'] = 100; | ||
217 | + data['isFilter'] = 1; | ||
218 | + data['isQuery'] = 1; | ||
219 | + data['colIsTd'] = 1; | ||
220 | + data['status'] = 0; | ||
221 | + // 新增状态 | ||
222 | + data['isAdd'] = 1; | ||
223 | + | ||
224 | + // 添加第一个 | ||
225 | + dataList.value.splice(0, 0, data); | ||
226 | + return; | ||
227 | + } | ||
228 | + | ||
229 | + let isExistArr = dataList.value.filter(function (v) { | ||
230 | + if (v.colKey == item.colKey) { | ||
231 | + return v; | ||
232 | + } | ||
233 | + }) | ||
234 | + if (isExistArr.length > 0) { | ||
235 | + proxy.$global.showMsg("已存在相同的标识,请修改后在添加!", 'warning') | ||
236 | + return; | ||
237 | + } | ||
238 | + // 添加 | ||
239 | + dataList.value.splice(0, 0, item); | ||
240 | + } | ||
241 | + // 保存 | ||
242 | + let saveConfig = () => { | ||
243 | + console.log(dataList.value) | ||
244 | + } | ||
245 | + | ||
246 | + /** | ||
247 | + * 删除 | ||
248 | + * | ||
249 | + * 作者: Wang | ||
250 | + * 时间:2021/10/26 19:47 | ||
251 | + */ | ||
252 | + let deleteRow = (index) => { | ||
253 | + proxy.$global.confirm("确认删除该行配置吗?", function () { | ||
254 | + dataList.value.splice(index, 1); | ||
255 | + | ||
256 | + proxy.$global.showMsg("删除成功!") | ||
257 | + }) | ||
258 | + } | ||
259 | + | ||
260 | + | ||
83 | // 挂载完 | 261 | // 挂载完 |
84 | Vue.onMounted(() => { | 262 | Vue.onMounted(() => { |
85 | loadTree(); | 263 | loadTree(); |
@@ -88,12 +266,27 @@ export default { | @@ -88,12 +266,27 @@ export default { | ||
88 | return { | 266 | return { |
89 | height, | 267 | height, |
90 | dataList, | 268 | dataList, |
269 | + defList, | ||
91 | columns, | 270 | columns, |
92 | colTypes, | 271 | colTypes, |
93 | treeData, | 272 | treeData, |
94 | currentNode, | 273 | currentNode, |
95 | handleConfigNodeClick, | 274 | handleConfigNodeClick, |
96 | - changeProperty | 275 | + addConfig, |
276 | + deleteRow, | ||
277 | + saveConfig, | ||
278 | + // 单元格编辑 | ||
279 | + editColProps, | ||
280 | + changeProperty, | ||
281 | + getColType, | ||
282 | + fieldsObj, | ||
283 | + fieldsValueObj, | ||
284 | + getColTypeExtVal, | ||
285 | + settingCmDialogFlg, | ||
286 | + showSettingCmDialog, | ||
287 | + getSettingDetail, | ||
288 | + currentRow, | ||
289 | + settingVal | ||
97 | } | 290 | } |
98 | } | 291 | } |
99 | } | 292 | } |
-
Please register or login to post a comment