桃源记客服系统前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.0 KiB

<template>
<div class="game-maintenance-container">
<el-card shadow="hover">
<div class="game-order-search mb15" >
<el-form label-position="right"
:model="formLabelAlign"
>
<el-form-item label="选择渠道" prop="serverId">
<el-select v-model="tableData.param.channel" class="m-2" placeholder="选择渠道" size="large" @change="getNotice">
<el-option v-for="item in channels" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="内容:">
<el-input v-model="tableData.param.content" placeholder="" type="textarea" class="w-50 m-2" rows="25" clearable/>
</el-form-item>
<el-form-item>
<el-button size="large" type="primary" class="ml10" @click="noticeMaintenance">
登录公告发送
</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</template>
<script lang="ts">
import {toRefs, reactive, onMounted, defineComponent, } from 'vue';
//import { ElMessageBox, ElMessage } from 'element-plus';
import {gameGetNoticeLogin, gameNoticeLogin} from "/@/api/game";
import {ElMessage} from "element-plus/es";
import {AllChannelList} from "/@/utils/game";
interface TableDataState {
tableData: {
param: {
content:string
status:number
noticeType:number
channel:string
id:number
};
};
channels:object
}
export default defineComponent({
name: 'apiV1GameOrderOrderList',
setup() {
// const {proxy} = getCurrentInstance() as any;
const state = reactive<TableDataState>({
tableData: {
param: {
status: 0,
content: "",
noticeType:2,
channel:"0",
id:0,
},
},
channels:AllChannelList
});
const noticeMaintenance=()=>{
gameNoticeLogin(state.tableData.param).then(()=>{
ElMessage.success('发送成功');
}).finally(()=>{
// state.loading = false;
})
}
// 初始化表格数据
const initTableData = () => {
getNotice()
};
const getNotice=()=>{
gameGetNoticeLogin(state.tableData.param).then((res:any)=>{
state.tableData.param.content = res.data.content;
state.tableData.param.id = res.data.id;
});
};
// function GetStateStr(s:number){
// if (s==2){
// return "成功"
// }
// return "失败(错误id="+s+")"
// }
// // 分页改变
// const onHandleSizeChange = (val: number) => {
// state.tableData.param.pageSize = val;
// };
// // 分页改变
// const onHandleCurrentChange = (val: number) => {
// state.tableData.param.pageNum = val;
// };
// 页面加载时
onMounted(() => {
initTableData();
});
return {
getNotice,
noticeMaintenance,
...toRefs(state),
};
},
});
</script>