|
|
@ -110,8 +110,8 @@ const resetQuery = () => { |
|
|
|
|
|
|
|
// 显示弹窗 |
|
|
|
const formRef = ref() |
|
|
|
const openForm = (type: string, strategyCode: string, id: number) => { |
|
|
|
formRef.value.open(type, strategyCode, id) |
|
|
|
const openForm = (type: string, strategyCode: string, id?: number, priority?:number) => { |
|
|
|
formRef.value.open(type, strategyCode, id, priority) |
|
|
|
} |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
@ -130,9 +130,11 @@ const route = useRoute() // 路由信息 |
|
|
|
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
const buttonBaseClick = async (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
openForm('create', queryParams.strategyCode) |
|
|
|
await getDefaultPriority() |
|
|
|
|
|
|
|
openForm('create', queryParams.strategyCode,undefined,defaultPriority.value) |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
@ -207,13 +209,19 @@ const butttondata = (row) => { |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', queryParams.strategyCode, row.id) |
|
|
|
openForm('update', queryParams.strategyCode, row.id,undefined) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const defaultPriority = ref(0)//默认优先级 |
|
|
|
const getDefaultPriority = async ()=>{ |
|
|
|
const res = await RuleApi.getMaxPriority(queryParams.strategyCode) |
|
|
|
console.log('getMaxPriority',res) |
|
|
|
if(res){ |
|
|
|
defaultPriority.value = Number(res) |
|
|
|
} |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted( async() => { |
|
|
|
getList() |
|
|
|