初始化动态配置

20231126-yw
yuanwei 1 year ago
parent a119bf8f26
commit 8862d27529

@ -9,13 +9,16 @@
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,null,'5',item.clickFuc)"
:disabled="executeFuc(item,null,'3',item.disabledFuc)"
clearable
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select'" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]" :placeholder="item.columnDesc" clearable>
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
@ -28,15 +31,16 @@
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query, null,'6',item.clickFuc)"
clearable>
<el-option
v-for="item in options[item.clickFuc]"
:key="item.ylqxzcrbarmc"
:label="item.ylqxzcrbarmc"
:value="item.ylqxzcrbarmc"
:key="item.filterType"
:label="item.sysName"
:value="item.filterType"
/>
</el-select>
</el-form-item>
@ -45,6 +49,7 @@
v-model="dateRange"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd HH:mm:ss"
:disabled="executeEval(null,item.disabledFuc,false)"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
@ -57,6 +62,7 @@
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
@ -173,13 +179,13 @@
v-if="item.columnType == 'id'"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-else-if="item.columnType == 'selection'"
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="executeFuc"></el-table-column>
<el-table-column
v-else-if="item.columnType == 'radio'"
v-if="item.columnType == 'radio'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -192,7 +198,7 @@
</template>
</el-table-column>
<el-table-column
v-else-if="item.columnType == 'laber'"
v-if="item.columnType == 'laber'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -205,7 +211,7 @@
</template>
</el-table-column>
<el-table-column
v-else-if="item.columnType == 'eltag'"
v-if="item.columnType == 'eltag'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -220,7 +226,7 @@
</template>
</el-table-column>
<el-table-column
v-else-if="item.columnType == 'button'"
v-if="item.columnType == 'button'"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
@ -233,14 +239,15 @@
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
:disabled="executeFuc(scope.row,null,'3',buttonItem.disabledFuc)"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,null,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-else
v-if="item.columnType == 'text'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -837,6 +844,12 @@ export default {
},
executeFuc(row,number,type,clickFuc,value){
return executeFuc(this,row,number,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
},
components: {

@ -50,12 +50,16 @@
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,null,'5',item.clickFuc)"
clearable
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select'" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]" :placeholder="item.columnDesc" clearable>
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
@ -68,6 +72,7 @@
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query, null,'6',item.clickFuc)"
@ -85,6 +90,7 @@
v-model="dateRange"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd HH:mm:ss"
:disabled="executeEval(null,item.disabledFuc,false)"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
@ -97,6 +103,7 @@
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
@ -286,13 +293,13 @@
v-if="item.columnType == 'id'"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-else-if="item.columnType == 'selection'"
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="executeFuc"></el-table-column>
<el-table-column
v-else-if="item.columnType == 'radio'"
v-if="item.columnType == 'radio'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -305,7 +312,7 @@
</template>
</el-table-column>
<el-table-column
v-else-if="item.columnType == 'laber'"
v-if="item.columnType == 'laber'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -318,7 +325,7 @@
</template>
</el-table-column>
<el-table-column
v-else-if="item.columnType == 'eltag'"
v-if="item.columnType == 'eltag'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -333,7 +340,7 @@
</template>
</el-table-column>
<el-table-column
v-else-if="item.columnType == 'button'"
v-if="item.columnType == 'button'"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
@ -346,14 +353,15 @@
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
:disabled="executeFuc(scope.row,null,'3',buttonItem.disabledFuc)"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,null,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-else
v-if="item.columnType == 'text'"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
@ -2421,6 +2429,12 @@ export default {
},
executeFuc(row,number,type,clickFuc,value){
return executeFuc(this,row,number,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
},
mounted() {
@ -2438,7 +2452,7 @@ export default {
},
created() {
this.findBasicProductSet();
getHead("maintain","1").then((re) => {
getHead("product","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;

@ -220,8 +220,8 @@
<el-form-item label-width="50px" label="样式" :prop="'buttonList.' + i + '.style'">
<el-input type="input" style="width: 120px;" v-model="item.style" placeholder="请输入样式"></el-input>
</el-form-item>
<el-form-item label-width="70px" label="禁用判断方法" :prop="'buttonList.' + i + '.disabledFuc'">
<el-input type="input" style="width: 120px;" v-model="item.disabledFuc" placeholder="请输入禁用判断方法"></el-input>
<el-form-item label-width="70px" label="禁用eval表达式" :prop="'buttonList.' + i + '.disabledFuc'">
<el-input type="input" style="width: 120px;" v-model="item.disabledFuc" placeholder="请输入禁用eval表达式"></el-input>
</el-form-item>
<el-form-item label-width="70px" label="点击方法" :prop="'buttonList.' + i + '.clickFuc'">
<el-input type="input" style="width: 120px;" v-model="item.clickFuc" placeholder="请输入点击方法"></el-input>

@ -33,7 +33,7 @@
<el-table-column prop="width" label="宽度"></el-table-column>
<el-table-column prop="lableRule" show-overflow-tooltip="true" label="字典替换规则"></el-table-column>
<el-table-column prop="clickFuc" label="事件"></el-table-column>
<el-table-column prop="disabledFuc" label="禁用方法"></el-table-column>
<el-table-column prop="disabledFuc" label="禁用eval表达式"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
@ -137,12 +137,12 @@
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col">
<el-form-item label="禁用方法" prop="clickFuc" class="query-form-item">
<el-input v-model="subData.disabledFuc" style="width: 80%" placeholder="请输入禁用方法"
<el-form-item label="禁用eval表达式" prop="clickFuc" class="query-form-item">
<el-input v-model="subData.disabledFuc" style="width: 80%" placeholder="请输入禁用eval表达式"
auto-complete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">

Loading…
Cancel
Save