|
@@ -9,18 +9,18 @@ export function usePriList() {
|
|
|
// 获取当前板块接口列表
|
|
|
onMounted(async () => {
|
|
|
const route = useRoute();
|
|
|
- form.projectId = route.query.projectId.toString();
|
|
|
+ form.projectId = Number(route.query.projectId);
|
|
|
|
|
|
UrlList = await getGroupUrl(["prizeSet"]);
|
|
|
onSearch(ruleFormRef.value);
|
|
|
- projectIdQuery();
|
|
|
+ projectIdQuery();
|
|
|
|
|
|
});
|
|
|
let form = reactive({
|
|
|
- projectId:"", //项目
|
|
|
- prizeName:"", //奖励名称
|
|
|
- conditionMode:"", //条件模式
|
|
|
- prizeContent:"", //奖励内容
|
|
|
+ projectId: null, //项目
|
|
|
+ prizeName: "", //奖励名称
|
|
|
+ conditionMode: "", //条件模式
|
|
|
+ prizeContent: "", //奖励内容
|
|
|
|
|
|
|
|
|
});
|
|
@@ -69,7 +69,10 @@ export function usePriList() {
|
|
|
{
|
|
|
label: "条件模式",
|
|
|
prop: "conditionMode",
|
|
|
- minWidth: 200
|
|
|
+ minWidth: 200,
|
|
|
+ formatter: ({ conditionMode }) => {
|
|
|
+ return conditionModeOptionList.find(item => item.id == conditionMode).label
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
label: "是否递归",
|
|
@@ -79,7 +82,10 @@ export function usePriList() {
|
|
|
{
|
|
|
label: "奖励内容",
|
|
|
prop: "prizeContent",
|
|
|
- minWidth: 200
|
|
|
+ minWidth: 200,
|
|
|
+ formatter: ({ prizeContent }) => {
|
|
|
+ return prizeContentOptionList.find(item => item.id == prizeContent).label
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
{
|
|
@@ -143,11 +149,11 @@ export function usePriList() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- // 项目选项数据
|
|
|
- const projectIdOptionList = ref([]);
|
|
|
+ // 项目选项数据
|
|
|
+ const projectIdOptionList = ref([]);
|
|
|
//获取项目数据
|
|
|
async function projectIdQuery() {
|
|
|
- const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriProjectDic.method, url: UrlList.prizeSet.prigetPriProjectDic.url, params: { } });
|
|
|
+ const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriProjectDic.method, url: UrlList.prizeSet.prigetPriProjectDic.url, params: {} });
|
|
|
if (status === 1) {
|
|
|
projectIdOptionList.value = data.records;
|
|
|
}
|
|
@@ -166,8 +172,8 @@ export function usePriList() {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- // 删除
|
|
|
+
|
|
|
+ // 删除
|
|
|
function handleDelete(row) {
|
|
|
ElMessageBox.confirm(
|
|
|
`是否删除该奖励配置? `,
|
|
@@ -187,20 +193,20 @@ export function usePriList() {
|
|
|
onSearch(ruleFormRef.value);
|
|
|
} else {
|
|
|
ElMessageBox.alert(msg, "提示", {
|
|
|
- confirmButtonText: "关闭",
|
|
|
- type: "warning"
|
|
|
- });
|
|
|
+ confirmButtonText: "关闭",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
};
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 新增
|
|
|
+ // 新增
|
|
|
const addVisible = ref(false);
|
|
|
function handleAdd() {
|
|
|
addVisible.value = true;
|
|
|
};
|
|
|
|
|
|
- // 修改
|
|
|
+ // 修改
|
|
|
const editUpdatePriListVisible = ref(false);
|
|
|
const editUpdatePriListFormData = ref({});
|
|
|
function handleUpdatePriList(row) {
|
|
@@ -222,6 +228,8 @@ export function usePriList() {
|
|
|
ruleFormRef,
|
|
|
projectIdQuery,
|
|
|
projectIdOptionList,
|
|
|
+ conditionModeOptionList,
|
|
|
+ prizeContentOptionList,
|
|
|
|
|
|
handleAdd,
|
|
|
addVisible,
|