feat:添加讨论,添加活动,新建关卡接口对接

This commit is contained in:
岳佳鑫
2022-10-31 18:25:36 +08:00
parent a9d78e9c7c
commit f4fed29376
6 changed files with 170 additions and 37 deletions

View File

@@ -65,6 +65,7 @@
v-model:value="textV2"
placeholder="请输入活动说明"
allow-clear
maxlength="150"
/>
</div>
</div>
@@ -75,6 +76,7 @@
<div class="btnbox">
<a-range-picker
style="width: 424px"
v-model:value="time"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
@@ -208,13 +210,15 @@
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn2" @click="createActivity">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/activity";
import { message } from "ant-design-vue";
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -252,6 +256,7 @@ export default {
textV1: "",
textV2: "",
radioV1: "",
time: "",
});
const closeDrawer = () => {
ctx.emit("update:addactiveVisible", false);
@@ -265,12 +270,50 @@ export default {
state.radioV1 = "";
}
};
//创建活动
const createActivity = () => {
if(!state.inputV1) return message.info("请输入活动名称");
if(!state.inputV2) return message.info("请输入活动时长");
if(!state.textV1) return message.info("请输入活动公告");
if(!state.inputV3) return message.info("请输入活动地址");
let obj = {
activityAddress: state.inputV3, //活动地址
activityDuration: state.inputV2, //活动时长
activityEndTime: "", //活动结束时间
activityId: 0, //活动ID
activityName: state.inputV1, //活动名称
activityNotice: state.textV1, //活动公告
activityStartTime: "", //活动开始时间
activityTag: "", //活动逻辑删除标识
afterSignIn: state.inputV5, //活动开始后多少分钟签到
beforeSignIn: state.inputV4, //活动开始前多少分钟签到
createTime: "", //创建时间
createUser: 0, //创建人
signOutTime: state.inputV6, //签退开始时间
standardSettings: state.radioV1, //标准设置
updateTime: "", //更新时间
updateUser: 0, //更新人
};
api
.createActivity(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
}, 1000);
})
.catch((err) => {
console.log("创建失败",err);
})
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
cloradio1,
createActivity,
};
},
};

View File

@@ -33,7 +33,8 @@
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入讨论名称"
maxlength="20"
show-count
:maxlength="20"
/>
</div>
</div>
@@ -46,6 +47,8 @@
v-model:value="textV1"
placeholder="请输入讨论说明"
allow-clear
show-count
:maxlength="200"
/>
</div>
</div>
@@ -61,13 +64,15 @@
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn2" @click="createDiscuss">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/discuss";
import { message } from "ant-design-vue";
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -103,15 +108,47 @@ export default {
});
const closeDrawer = () => {
ctx.emit("update:adddiscussVisible", false);
state.inputV1 = "";
state.textV2 = "";
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
//创建讨论
const createDiscuss = () => {
if(!state.inputV1) return message.info("请输入讨论名称");
let obj = {
discussName: state.inputV1, //讨论名称
discussExplain: state.textV1, //讨论说明
discussSettings: state.checkedC1, //讨论设置
createTime: "", //创建时间
createUser: 0, //创建人
discussFlag: "", //活动逻辑删除标识
discussId: 0, //讨论Id
discussTag: "", //是否必修的标识
updateTime: "", //更新时间
updateUser: 0, //更新人
projectId: 0, //项目id
};
api
.createDiscuss(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
createDiscuss,
};
},
};
@@ -160,6 +197,9 @@ export default {
display: flex;
flex: 1;
align-items: center;
.ant-input {
height: 100%;
}
.xkbtn {
cursor: pointer;
width: 130px;
@@ -185,40 +225,22 @@ export default {
margin-right: 5px;
}
}
.kqszbox {
.qdqtbox {
margin-left: 56px;
}
.setbox {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 24px;
.timerbox {
margin-top: 6px;
margin-right: 32px;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
.textarea {
width: 423px;
.ant-input {
width: 100%;
}
.ant-input-textarea-show-count {
position: relative;
}
.ant-input-textarea-show-count::after {
position: absolute;
right: 10px;
bottom: 0px;
}
.ant-input {
border-radius: 8px;
}
}
}
}