|
@@ -367,112 +367,108 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- <el-col :span="24">
|
|
|
- <div class="btn-show-condition">
|
|
|
- <span class="table-title">条件编辑</span>
|
|
|
- <el-table :data="conditionBtnData" style="width: 100%">
|
|
|
- <el-table-column label="序号" type="index" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="tableName" label="表名" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select
|
|
|
- v-model="scope.row.tableName"
|
|
|
- @change="conditionTableChange(scope.row)"
|
|
|
- placeholder="请选择"
|
|
|
+ <el-col
|
|
|
+ :span="24"
|
|
|
+ v-show="
|
|
|
+ btnGroupFormData.btnType != 3 && btnGroupFormData.btnType != 7
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-form-item label="" prop="btnParams">
|
|
|
+ <div class="filter-table-wrap">
|
|
|
+ <span class="title">公共参数</span>
|
|
|
+ <el-table :data="commonFieldData" style="width: 100%">
|
|
|
+ <el-table-column label="序号" type="index" width="50">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="fieldName"
|
|
|
+ label="字段名"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in tableList"
|
|
|
- :key="item.tableName"
|
|
|
- :label="item.tableComment"
|
|
|
- :value="item.tableName"
|
|
|
- >
|
|
|
- <span style="float: left">{{ item.tableComment }}</span>
|
|
|
- <span
|
|
|
- style="float: right; color: #8492a6; font-size: 13px"
|
|
|
- >{{ item.tableName }}</span
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.fieldName"
|
|
|
+ placeholder="请选择"
|
|
|
>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="fieldName" label="字段名" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select
|
|
|
- v-model="scope.row.fieldName"
|
|
|
- placeholder="请选择"
|
|
|
+ <el-option
|
|
|
+ v-for="item in rootFieldInfo.fieldList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.key"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ float: right;
|
|
|
+ color: #8492a6;
|
|
|
+ font-size: 13px;
|
|
|
+ "
|
|
|
+ >{{ item.key }}</span
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="flagValue"
|
|
|
+ label="默认值"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in scope.row.fieldList"
|
|
|
- :key="item.fieldName"
|
|
|
- :label="item.fieldDescription"
|
|
|
- :value="item.fieldName"
|
|
|
- >
|
|
|
- <span style="float: left">{{
|
|
|
- item.fieldDescription
|
|
|
- }}</span>
|
|
|
- <span
|
|
|
- style="float: right; color: #8492a6; font-size: 13px"
|
|
|
- >{{ item.fieldName }}</span
|
|
|
+ <template slot="header" slot-scope="">
|
|
|
+ 默认值
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="不设置默认值时,默认为当前行的该字段"
|
|
|
+ placement="top-start"
|
|
|
>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="condition" label="条件" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select
|
|
|
- v-model="scope.row.condition"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in conditionList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="flagValue" label="参照值" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.flagValue"
|
|
|
- @input="
|
|
|
- scope.row.flagValue = scope.row.flagValue.replace(
|
|
|
- /^(0+)|[^\d]+/g,
|
|
|
- ''
|
|
|
- )
|
|
|
- "
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="deleteConditionItem(scope.$index)"
|
|
|
- >删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="inline-large-button mb10"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- style="width: 100%"
|
|
|
- @click="addConditionHandler"
|
|
|
- >
|
|
|
- 添加条件
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </el-col> -->
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <el-button
|
|
|
+ type="info"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="editFlagHandler(scope.row, scope.$index)"
|
|
|
+ >
|
|
|
+ </el-button> -->
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.fieldValue"
|
|
|
+ placeholder="请输入默认值"
|
|
|
+ size="normal"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="deleteFilterItem(scope.$index)"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="inline-large-button mb10"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ style="width: 100%"
|
|
|
+ @click="addFilterHandler"
|
|
|
+ >
|
|
|
+ 添加条件
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -485,13 +481,13 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- listMenu,
|
|
|
- getMenu,
|
|
|
- delMenu,
|
|
|
- addMenu,
|
|
|
- updateMenu,
|
|
|
-} from "@/api/system/menu";
|
|
|
-import { listBtn, addBtn, getBtn, updateBtn, delBtn } from "@/api/system/btn";
|
|
|
+ listBtn,
|
|
|
+ addBtn,
|
|
|
+ getBtn,
|
|
|
+ updateBtn,
|
|
|
+ delBtn,
|
|
|
+ checkBtn,
|
|
|
+} from "@/api/system/btn";
|
|
|
import { listForm } from "@/api/dragform/form";
|
|
|
import { listProcess } from "@/api/bpmprocess/process";
|
|
|
import { listTable } from "@/api/dragform/tableList";
|
|
@@ -500,7 +496,8 @@ import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import IconSelect from "@/components/IconSelect";
|
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
-
|
|
|
+import { dragTableInfo } from "@/api/tablelist/commonTable";
|
|
|
+import { camelCase } from "@/utils";
|
|
|
export default {
|
|
|
name: "ExcuteBtnMange",
|
|
|
dicts: ["sys_show_hide", "sys_normal_disable"],
|
|
@@ -621,6 +618,17 @@ export default {
|
|
|
tableOptions: [],
|
|
|
processOptions: [],
|
|
|
scriptOptions: [],
|
|
|
+ // 普遍字段参数
|
|
|
+ commonFieldData: [
|
|
|
+ {
|
|
|
+ fieldName: "",
|
|
|
+ fieldValue: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ rootFieldInfo: {
|
|
|
+ tableName: "",
|
|
|
+ fieldList: [],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -628,6 +636,63 @@ export default {
|
|
|
this.initFormSubData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 删除公共传参
|
|
|
+ deleteFilterItem(index) {
|
|
|
+ this.commonFieldData.splice(index, 1);
|
|
|
+ },
|
|
|
+ // 添加公共传参
|
|
|
+ addFilterHandler() {
|
|
|
+ this.commonFieldData.push({
|
|
|
+ fieldName: "",
|
|
|
+ fieldValue: "",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取根节点绑定表格的字段数据
|
|
|
+ async getRootFieldInfo(btnKey) {
|
|
|
+ let res = await checkBtn({ btnKey });
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.rows[0]?.tableKey) {
|
|
|
+ let tableInfo = await dragTableInfo({
|
|
|
+ queryMap: { tableKey: res.rows[0].tableKey },
|
|
|
+ });
|
|
|
+ this.rootFieldInfo.fieldList = this.columnsHandler(
|
|
|
+ JSON.parse(tableInfo.data.resultMap.template.dtColumnName)
|
|
|
+ );
|
|
|
+ console.log(this.rootFieldInfo.fieldList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理列表信息
|
|
|
+ columnsHandler(columns) {
|
|
|
+ let resArr = [];
|
|
|
+ columns.forEach((item) => {
|
|
|
+ for (const key in item) {
|
|
|
+ let tempObj = {};
|
|
|
+ tempObj.key = camelCase(key);
|
|
|
+ tempObj.value = item[key];
|
|
|
+ resArr.push(tempObj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return resArr;
|
|
|
+ },
|
|
|
+ // 给所有节点设置根节点key
|
|
|
+ setRootBtnKey(rows, rootKey = "") {
|
|
|
+ if (rows.length == 0) {
|
|
|
+ return rows;
|
|
|
+ }
|
|
|
+ for (let i = 0; i < rows.length; i++) {
|
|
|
+ let row = rows[i];
|
|
|
+ if (row.btnParentId == 0) {
|
|
|
+ row.rootKey = row.btnKey;
|
|
|
+ } else {
|
|
|
+ row.rootKey = rootKey;
|
|
|
+ }
|
|
|
+ if (row.children.length != 0) {
|
|
|
+ row.children = this.setRootBtnKey(row.children, row.rootKey);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rows;
|
|
|
+ },
|
|
|
// 选择图标
|
|
|
selected(name) {
|
|
|
this.btnGroupFormData.btnIcon = name;
|
|
@@ -637,7 +702,9 @@ export default {
|
|
|
this.loading = true;
|
|
|
|
|
|
listBtn(this.queryParams).then((response) => {
|
|
|
- this.btnList = response.rows;
|
|
|
+ let res = this.setRootBtnKey(response.rows);
|
|
|
+ console.log(res);
|
|
|
+ this.btnList = res;
|
|
|
console.log("btnList", this.btnList);
|
|
|
this.loading = false;
|
|
|
});
|
|
@@ -726,7 +793,7 @@ export default {
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
- handleAdd(row) {
|
|
|
+ async handleAdd(row) {
|
|
|
this.title = "新增按钮";
|
|
|
this.reset();
|
|
|
this.getTreeselect();
|
|
@@ -734,6 +801,7 @@ export default {
|
|
|
this.editType = row ? true : false;
|
|
|
if (row != null && row.id) {
|
|
|
//在已知节点下新增
|
|
|
+ await this.getRootFieldInfo(row.rootKey);
|
|
|
this.btnGroupFormData.btnParentId = row.id;
|
|
|
} else {
|
|
|
this.btnGroupFormData.btnParentId = 0;
|
|
@@ -751,10 +819,12 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
+ async handleUpdate(row) {
|
|
|
this.reset();
|
|
|
this.getTreeselect();
|
|
|
this.editType = false;
|
|
|
+ //在已知节点下新增
|
|
|
+ await this.getRootFieldInfo(row.rootKey);
|
|
|
getBtn(row.id).then((response) => {
|
|
|
this.btnGroupFormData = response.data;
|
|
|
this.open = true;
|
|
@@ -774,15 +844,30 @@ export default {
|
|
|
}
|
|
|
return res;
|
|
|
},
|
|
|
+ // 获取公共数据
|
|
|
+ // getCommonData(list) {
|
|
|
+ // if (list.length == 0) return '';
|
|
|
+
|
|
|
+ // },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["btnGroupFormRef"].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- let validateRes = myValidate(this.btnGroupFormData);
|
|
|
+ let validateRes = this.myValidate(this.btnGroupFormData);
|
|
|
if (!validateRes.flag) {
|
|
|
this.$message.error(validateRes.msg);
|
|
|
return;
|
|
|
}
|
|
|
+ // 获取公共参数
|
|
|
+ // let commonData=this.getCommonData(this.commonFieldData)
|
|
|
+ if (
|
|
|
+ this.btnGroupFormData.btnType != 3 &&
|
|
|
+ this.btnGroupFormData.btnType != 7
|
|
|
+ ) {
|
|
|
+ this.btnGroupFormData.btnParams = JSON.stringify(
|
|
|
+ this.commonFieldData
|
|
|
+ );
|
|
|
+ }
|
|
|
if (this.editType) {
|
|
|
// 新增按钮组
|
|
|
this.btnGroupFormData.btnKey = uuidv4();
|
|
@@ -879,4 +964,10 @@ export default {
|
|
|
.submenu-title-noDropdown:hover {
|
|
|
background-color: linear-gradient(to right, blue, rgb(69, 118, 225));
|
|
|
}
|
|
|
+
|
|
|
+.filter-table-wrap {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|