From 9e08d54b02b9ebb08389f0ca1dbe3c5518a2b34e Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 16 十一月 2023 10:28:47 +0800 Subject: [PATCH] 主题库-枚举下拉清空 --- Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 243 +++++++++++++++++++++++++---------------------- 1 files changed, 129 insertions(+), 114 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue index 369da39..5e44b6a 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue @@ -6,11 +6,11 @@ <span v-if="permissionList.busineStatus"> <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" - icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle" >娣诲姞 {{ msg }} + icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle">娣诲姞 {{ msg }} </el-button> </span> <!-- 鍏ㄥ睆缂栬緫--> - <span v-if="permissionList.fullscreenStatus"> + <span v-if="permissionList.fullscreenStatus"> <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" icon="el-icon-full-screen" size="small" @click="fullscreenHandle">鍏ㄥ睆缂栬緫 @@ -19,10 +19,10 @@ <span v-if="permissionList.ruleStatus"> <!-- 楠岃瘉瑙勫垯--> <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" - @click="ruleAddHandler" >楠岃瘉瑙勫垯 + @click="ruleAddHandler">楠岃瘉瑙勫垯 </el-button> </span> - <span v-if="permissionList.attrStatus"> + <span v-if="permissionList.attrStatus"> <!-- 灞炴�у垎缁�--> <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁� @@ -34,35 +34,38 @@ <!-- 淇濆瓨--> <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain size="small" - type="success" @click.prevent="addsHandler" >淇濆瓨 + type="success" @click.prevent="addsHandler">淇濆瓨 </el-button> </span> - <!-- 棰勮鎺掑簭--> - <el-button icon="el-icon-arrow-down" size="small" @click="orderHandle" v-if="permissionList.orderStatus">棰勮鎺掑簭</el-button> + <!-- 棰勮鎺掑簭--> + <el-button v-if="permissionList.orderStatus" icon="el-icon-arrow-down" size="small" @click="orderHandle">棰勮鎺掑簭 + </el-button> <span v-if="permissionList.removeStatus"> <!-- 鍒犻櫎--> <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-delete" size="small" - @click="CrudRemove" >鍒犻櫎 + @click="CrudRemove">鍒犻櫎 </el-button> </span> <!-- 閲嶇疆--> - <el-button icon="el-icon-refresh-right" size="small" @click="resetHandler" v-if="permissionList.resetStatus">閲嶇疆</el-button> + <el-button v-if="permissionList.resetStatus" icon="el-icon-refresh-right" size="small" @click="resetHandler"> + 閲嶇疆 + </el-button> </el-button-group> <el-button-group> <span v-if="permissionList.injectStatus"><!-- 鍒嗙被娉ㄥ叆--> <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" - size="small" @click="injectBtn" >鍒嗙被娉ㄥ叆 + size="small" @click="injectBtn">鍒嗙被娉ㄥ叆 </el-button></span> - <span v-if="permissionList.isShowStatus"> <!-- 缁勫悎瑙勫垯--> + <span v-if="permissionList.isShowStatus"> <!-- 缁勫悎瑙勫垯--> <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" @click="isShowHandler">缁勫悎瑙勫垯 </el-button></span> <span v-if="permissionList.enumStatus"> <!-- 鏋氫妇娉ㄥ叆--> <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" - size="small" @click="enumVisHandle" >鏋氫妇娉ㄥ叆 + size="small" @click="enumVisHandle">鏋氫妇娉ㄥ叆 </el-button></span> - <span v-if="permissionList.cascadStatus"> + <span v-if="permissionList.cascadStatus"> <!-- 绾ц仈灞炴��--> <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">绾ц仈灞炴�� @@ -72,12 +75,15 @@ <el-button-group> <!-- 鍚屾鍒板叾浠栨ā鏉�--> - <el-button icon="el-icon-share" size="small" @click="syncHandle" v-if="permissionList.syncStatus">鍚屾鍒板叾浠栨ā鏉�</el-button> + <el-button v-if="permissionList.syncStatus" icon="el-icon-share" size="small" @click="syncHandle">鍚屾鍒板叾浠栨ā鏉� + </el-button> </el-button-group> <el-button-group> <!-- 缂栫爜鐢宠棰勮--> - <el-button icon="el-icon-view" size="small" style="" @click="applicationHandle" v-if="permissionList.applicationStatus">缂栫爜鐢宠棰勮</el-button> + <el-button v-if="permissionList.applicationStatus" icon="el-icon-view" size="small" style="" + @click="applicationHandle">缂栫爜鐢宠棰勮 + </el-button> </el-button-group> <!-- 鏄惁寮�鍚紪杈� --> @@ -314,80 +320,82 @@ ></refer-config-dialog> </div> - <el-table v-if="this.crudArrayFlag" - ref="referAttrCrud" - v-loading="loading" - border - :data="ProData" - :height="this.tableHeight" - style="width: 100%" - @select="selectHandle" - @cell-click="handleCellClicks" - @selection-change="selectionChange" - @row-click="rowClick" - > - <el-table-column - :fixed="!editStyleFlag ? 'left' : undefined" - type="selection" width="55"> - </el-table-column> - <!--<el-table-column fixed label="搴忓彿" type="index" width="55"></el-table-column>--> - <el-table-column v-for="(item,index) in this.option.column" v-if="item.edit !='referName'" - :key="item.id" - :fixed="!editStyleFlag ? item.fixed : undefined" - :formatter="formAttr" - :label="item.label" - :prop="item.prop" - :show-overflow-tooltip="true" - :sortable="item.sortable" - :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" - align="center" + + <el-table v-if="this.crudArrayFlag" + ref="referAttrCrud" + v-loading="loading" + :data="ProData" + :height="this.tableHeight" + border + style="width: 100%" + @select="selectHandle" + @cell-click="handleCellClicks" + @selection-change="selectionChange" + @row-click="rowClick" > - <template slot-scope="{ row }"> - <el-input - v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" - v-show="!AddCellFlag" - :ref="'input' + row.oid" - v-model="row[item.prop]" - @blur="saveRows(row)" - ></el-input> - <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" - v-model="row[item.prop]" - :style="{width:(item.width-10)+'px'}" - controls-position="right" - size="small" @blur="saveRows"></el-input-number> - <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend" - v-model="row[item.prop]" allow-create default-first-option - filterable - @blur="selectChangeHandler(item.editConfig,index)"> - <el-option - v-for="optionItem in item.data" - :key="optionItem.dictValue" - :label="optionItem.dictValue" - :value="optionItem.dictValue"> - </el-option> - </el-select> - <el-switch - v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" - inactive-value="false"> - </el-switch> - <span v-else>{{ row[item.prop] }}</span> - </template> - </el-table-column> - <el-table-column - fixed="right" - label="鎿嶄綔" - width="70"> - <template slot-scope="scope"> - <el-button - size="small" - type="text" - @click.native.prevent="CrudRowDel(scope.$index)"> - 绉婚櫎 - </el-button> - </template> - </el-table-column> - </el-table> - </div> + <el-table-column + :fixed="!editStyleFlag ? 'left' : undefined" + type="selection" width="55"> + </el-table-column> + <!--<el-table-column fixed label="搴忓彿" type="index" width="55"></el-table-column>--> + <el-table-column v-for="(item,index) in this.option.column" v-if="item.edit !='referName'" + :key="item.id" + :fixed="!editStyleFlag ? item.fixed : undefined" + :formatter="formAttr" + :label="item.label" + :prop="item.prop" + :show-overflow-tooltip="true" + :sortable="item.sortable" + :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" + align="center" + > + <template slot-scope="{ row }"> + <el-input + v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" + v-show="!AddCellFlag" + :ref="'input' + row.oid" + v-model="row[item.prop]" + @blur="saveRows(row)" + ></el-input> + <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" + v-show="!AddCellFlag" + v-model="row[item.prop]" + :style="{width:(item.width-10)+'px'}" + controls-position="right" + size="small" @blur="saveRows"></el-input-number> + <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend" :clearable="true" + v-model="row[item.prop]" allow-create default-first-option + filterable v-show="!AddCellFlag" + @blur="selectChangeHandler(item.editConfig,index)"> + <el-option + v-for="optionItem in item.data" + :key="optionItem.dictValue" + :label="optionItem.dictValue" + :value="optionItem.dictValue"> + </el-option> + </el-select> + <el-switch + v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" v-show="!AddCellFlag" + inactive-value="false"> + </el-switch> + <span v-else>{{ row[item.prop] }}</span> + </template> + </el-table-column> + <el-table-column + fixed="right" + label="鎿嶄綔" + width="70"> + <template slot-scope="scope"> + <el-button + size="small" + type="text" + @click.native.prevent="CrudRowDel(scope.$index)"> + 绉婚櫎 + </el-button> + </template> + </el-table-column> + </el-table> + </div> </template> <script> @@ -396,6 +404,7 @@ import func from "@/util/func"; import {getCurrentInstance} from "vue"; import {mapGetters} from "vuex"; + export default { name: "attrCrud .vue", props: { @@ -655,7 +664,7 @@ addBtn: false, header: false, align: 'center', - columnBtn:false, + columnBtn: false, menuAlign: 'center', column: [{ label: '', @@ -1097,6 +1106,8 @@ indexClassName: "搴忓彿", indexLabelClassName: '搴忓彿', index: true, + indexFixed:false, + selectionFixed:false, border: true, addBtn: false, menu: false, @@ -1106,7 +1117,7 @@ { label: "灞炴�ц嫳鏂囧悕绉�", prop: "id", - width: 100, + width: 130, }, { label: "灞炴�т腑鏂囧悕绉�", @@ -1192,7 +1203,7 @@ List: [], option: { index: false, - columnBtn:false, + columnBtn: false, border: true, editBtn: false, selection: true, @@ -1544,22 +1555,22 @@ }, computed: { ...mapGetters(["permission"]), - permissionList(){ - return{ - busineStatus:this.vaildData(this.permission.classifyTree.attr_add,false), - fullscreenStatus:this.vaildData(this.permission.classifyTree.attr_view_edit,false), - ruleStatus:this.vaildData(this.permission.classifyTree.attr_rule,false), - attrStatus:this.vaildData(this.permission.classifyTree.attr_group,false), - saveStatus:this.vaildData(this.permission.classifyTree.attr_save,false), - resetStatus:this.vaildData(this.permission.classifyTree.attr_reset,false), - injectStatus:this.vaildData(this.permission.classifyTree.attr_inject,false), - isShowStatus:this.vaildData(this.permission.classifyTree.attr_formrule,false), - enumStatus:this.vaildData(this.permission.classifyTree.attr_enum,false), - cascadStatus:this.vaildData(this.permission.classifyTree.attr_parentcode,false), - syncStatus:this.vaildData(this.permission.classifyTree.attr_sync,false), - applicationStatus:this.vaildData(this.permission.classifyTree.attr_application,false), - orderStatus:this.vaildData(this.permission.classifyTree.attr_sort,false), - removeStatus:this.vaildData(this.permission.classifyTree.attr_delete,false), + permissionList() { + return { + busineStatus: this.vaildData(this.permission.classifyTree.attr_add, false), + fullscreenStatus: this.vaildData(this.permission.classifyTree.attr_view_edit, false), + ruleStatus: this.vaildData(this.permission.classifyTree.attr_rule, false), + attrStatus: this.vaildData(this.permission.classifyTree.attr_group, false), + saveStatus: this.vaildData(this.permission.classifyTree.attr_save, false), + resetStatus: this.vaildData(this.permission.classifyTree.attr_reset, false), + injectStatus: this.vaildData(this.permission.classifyTree.attr_inject, false), + isShowStatus: this.vaildData(this.permission.classifyTree.attr_formrule, false), + enumStatus: this.vaildData(this.permission.classifyTree.attr_enum, false), + cascadStatus: this.vaildData(this.permission.classifyTree.attr_parentcode, false), + syncStatus: this.vaildData(this.permission.classifyTree.attr_sync, false), + applicationStatus: this.vaildData(this.permission.classifyTree.attr_application, false), + orderStatus: this.vaildData(this.permission.classifyTree.attr_sort, false), + removeStatus: this.vaildData(this.permission.classifyTree.attr_delete, false), } }, attrOids() { @@ -1840,8 +1851,8 @@ // 鏂板嚱鏁扮敤浜庢墽琛宐atchAddSave鏂规硶 const executeBatchAddSave = () => { batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { - this.$message.success('淇濆瓨鎴愬姛') this.editOpenFlag = false; + this.$message.success('淇濆瓨鎴愬姛') // 璋冪敤鐖剁粍浠朵慨鏀规寜閽姸鎬� this.$emit('editCloseChildren') this.AddCellFlag = true; @@ -2094,15 +2105,17 @@ } else { this.injectOption.classifyNumber = 0; } + // console.log(this.ProData) this.injectVisible = false; }, //鍒嗙被娉ㄥ叆娓呯┖ injectHandleReset() { - this.$set(this.CurrentCell, 'classifyInvokeText', '') - this.$set(this.CurrentCell, 'classifyInvokeAttr:', '') - this.$set(this.CurrentCell, 'classitwInvokeAttrName', '') - this.$set(this.CurrentCell, 'classifyInvokeEditFlag', 'false') - this.$set(this.CurrentCell, 'classifyInvokeLevel', 'none') + this.CurrentCell.classifyInvokeText = null; + this.CurrentCell.classifyInvokeAttr = ''; + this.CurrentCell.classifyInvokeAttrName = ''; + this.CurrentCell.classifyInvokeEditFlag = ''; + this.CurrentCell.classifyInvokeLevel = null; + // console.log(this.ProData) this.injectVisible = false; }, // 鍒嗙被娉ㄥ叆鍙栨秷 @@ -2215,8 +2228,9 @@ <style lang="scss" scoped> //鍥哄畾鍒楅珮搴� /deep/ .el-table__fixed { - height: calc(100vh - 612px)!important; + height: calc(100vh - 612px) !important; } + ///deep/ .el-table__fixed[v-if='editStyleFlag'] { // height: calc(100vh - 152px)!important; // 缂栬緫鐘舵�佷笅鐨勯珮搴� //} @@ -2229,6 +2243,7 @@ width: 10px; } + // 婊氬姩鏉$殑婊戝潡 /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { background-color: #ececec; -- Gitblit v1.9.3