|
@@ -14,7 +14,7 @@
|
|
|
</el-tooltip>
|
|
|
</span>
|
|
|
<span v-if="item.needFilters">
|
|
|
- <el-popover placement="bottom" trigger="click">
|
|
|
+ <el-popover :width="300" placement="bottom" trigger="click">
|
|
|
<template #reference>
|
|
|
<el-icon>
|
|
|
<ArrowDownBold />
|
|
@@ -22,7 +22,7 @@
|
|
|
</template>
|
|
|
<el-form>
|
|
|
<el-form-item :label="item.columnLabel">
|
|
|
- <el-select v-model="filterValues[item.columnName]" size="small" placeholder="筛选" default-first-option filterable clearable>
|
|
|
+ <el-select v-model="filterValues[item.columnName]" size="default" placeholder="筛选" default-first-option filterable clearable>
|
|
|
<el-option v-for="(option, optionIndex) in tableDataFilters[item.columnName]" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -31,10 +31,11 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" :width="fixedWidth">
|
|
|
+ <el-table-column fixed="right" label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="primary" @click="handleEdit(scope.row)" size="small">编辑</el-button>
|
|
|
- <el-button type="danger" @click="handleRemove(scope.row)" size="small">删除</el-button>
|
|
|
+ <el-button class="btnEdit" @click="handleEdit(scope.row)" size="small">编辑</el-button>
|
|
|
+ <el-button v-for="el in btnGroups" :key="el.auth_id" class="btnDel" @click="handleOther(el,scope.row)" size="small">{{el.auth_name}}</el-button>
|
|
|
+ <el-button class="btnDel" @click="handleRemove(scope.row)" size="small">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -107,9 +108,10 @@ const props = defineProps({
|
|
|
//弹框表单-行数
|
|
|
rows: {
|
|
|
type: Number,
|
|
|
- default: 12,
|
|
|
+ default: 24,
|
|
|
},
|
|
|
});
|
|
|
+const router = useRouter();
|
|
|
const page = ref<number>(0); //分页参数
|
|
|
const { dataContent, showOverflowTooltip, fixedWidth, labelWidth, rows } =
|
|
|
props;
|
|
@@ -126,6 +128,7 @@ const tableForm = ref<any>({}); //弹框新增/编辑数据
|
|
|
const filterValues = ref<any>({}); //表头-下拉-选中数据
|
|
|
const tableDataFilters = ref<any>({}); //表头-下拉数据
|
|
|
const tableGroups = ref<any>([]); //表格分组数据
|
|
|
+const btnGroups = ref<any>([]); //操作-按钮-额外数据
|
|
|
const pageTitle = ref<any>("");
|
|
|
const rowTitle = ref("");
|
|
|
const delTitle = ref("");
|
|
@@ -250,14 +253,28 @@ const filterHandler = (value: string, row, column: TableColumnCtx<any>) => {
|
|
|
const handleAdd = () => {
|
|
|
editFlag.value = true;
|
|
|
editType.value = "add";
|
|
|
+ editTitle.value = "新增";
|
|
|
tableForm.value = {};
|
|
|
};
|
|
|
//表格数据编辑弹框
|
|
|
const handleEdit = (row) => {
|
|
|
editFlag.value = true;
|
|
|
editType.value = "edit";
|
|
|
+ editTitle.value = "编辑";
|
|
|
tableForm.value = _.cloneDeep(row);
|
|
|
};
|
|
|
+const handleOther = (item, row) => {
|
|
|
+ const queryparams = item.queryparams;
|
|
|
+ const arr = queryparams.split(",");
|
|
|
+ const obj = <any>{};
|
|
|
+ arr.forEach((p) => {
|
|
|
+ obj[p] = item[p];
|
|
|
+ });
|
|
|
+ router.push({
|
|
|
+ path: item.route_info,
|
|
|
+ query: obj,
|
|
|
+ });
|
|
|
+};
|
|
|
//表格数据删除弹框
|
|
|
const handleRemove = (row) => {
|
|
|
delFlag.value = true;
|
|
@@ -324,7 +341,8 @@ const filteredTableData = computed(() => {
|
|
|
//获取表格id
|
|
|
onBeforeMount(() => {
|
|
|
const route = useRoute();
|
|
|
- const { qid, title } = route.meta;
|
|
|
+ const { qid, title, other } = route.meta;
|
|
|
+ btnGroups.value = other;
|
|
|
pageTitle.value = title;
|
|
|
if (qid) {
|
|
|
queryId.value = qid;
|
|
@@ -348,6 +366,22 @@ onBeforeMount(() => {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
+ .btnEdit {
|
|
|
+ border: 1px solid #f79ec6;
|
|
|
+ font-size: 12px;
|
|
|
+ font-family: Microsoft YaHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #ac014d;
|
|
|
+ }
|
|
|
+ .btnDel {
|
|
|
+ background: #eb2f3b;
|
|
|
+ color: #fff;
|
|
|
+ border: 1px solid #eb2f3b;
|
|
|
+ }
|
|
|
+ .cell {
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|