chroe: adjust page js code

This commit is contained in:
engigu
2024-01-18 21:38:16 +08:00
parent b20279860a
commit c3c5acd585
15 changed files with 28 additions and 165 deletions
+12 -31
View File
@@ -1,38 +1,19 @@
class CommonUtils {
// static getCurlString(task_id, options) {
// let data = { task_id: task_id };
// data.title = 'message title';
// data.text = 'Hello World!';
// if (options.html) {
// data.html = '<h1> Hello World! </h1>';
// }
// if (options.markdown) {
// data.html = '**Hello World!**';
// }
// let dataStr = JSON.stringify(data, null, 4);
// let example = `curl -X POST --location '${gethttpOrigin()}/api/v1/message/send' \\
// --header 'Content-Type: application/json' \\
// --data '${dataStr}'`;
// return example;
// }
static formatInsConfigDisplay = (scope) => {
if (!scope.row.config) {
return ""
}
if (scope.row.way_type == "Email") {
let config = JSON.parse(scope.row.config)
let info = `发送账号:${config.to_account}`
return info
} else {
return "暂无"
}
}
static formatInsConfigDisplay = (scope) => {
if (!scope.row.config) {
return ""
}
if (scope.row.way_type == "Email") {
let config = JSON.parse(scope.row.config)
let info = `发送账号:${config.to_account}`
return info
} else {
return "暂无"
}
}
}
@@ -14,7 +14,6 @@ import { defineComponent } from 'vue';
export default defineComponent({
methods: {
handleDelete() {
// 触发自定义事件
this.$emit('customHandleDelete');
}
}
+8 -21
View File
@@ -3,7 +3,6 @@
<el-menu :collapse="isCollapse" breakpoint="768px" mode="horizontal" @select="handleSelect()"
:default-active="currActivate()" :ellipsis="false" :menu-width="'auto'">
<el-menu-item index="0" :disabled="false">
<!-- <div class="title-logo" v-html="titleLogo"></div> -->
<img style="width: 60px" class="title-logo" :src="titleLogo" alt="Message logo" />
</el-menu-item>
@@ -34,23 +33,10 @@ export default {
titleLogo: '',
});
const menuData = reactive([
{
id: '1',
title: '发信日志',
path: '/sendlogs',
}, {
id: '2',
title: '发信任务',
path: '/sendtasks',
}, {
id: '3',
title: '发信渠道',
path: '/sendways',
}, {
id: '4',
title: '设置',
path: '/settings',
},
{ id: '1', title: '发信日志', path: '/sendlogs' },
{ id: '2', title: '发信任务', path: '/sendtasks' },
{ id: '3', title: '发信渠道', path: '/sendways' },
{ id: '4', title: '设置', path: '/settings' },
]);
const checkIsLogin = () => {
@@ -118,7 +104,6 @@ export default {
font-size: 15px;
justify-content: center;
align-items: center;
}
.el-menu-item li {
@@ -132,7 +117,8 @@ export default {
.logout-btn {
margin: auto 40px auto 40px;
float: right;
/* background-color: #f7efee;
/*
background-color: #f7efee;
border: none;
padding: 10px 20px;
text-align: center;
@@ -140,6 +126,7 @@ export default {
font-size: 16px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s ease; */
transition: background-color 0.3s ease;
*/
}
</style>
-1
View File
@@ -71,7 +71,6 @@ export default {
// 注册
const clickRegister = () => {
ElMessage({ message: `暂未开放注册!`, type: 'error' })
};
return { ...toRefs(state), clickLogin, clickRegister, pageState };
@@ -138,7 +138,6 @@ hr {
margin-top: -10vh;
}
.pagination-block {
margin-top: 30px;
display: flex;
@@ -51,7 +51,6 @@
<script >
import { computed, ref, reactive, toRefs, onMounted } from 'vue'
// import { InfoFilled } from '@element-plus/icons-vue'
import { usePageState } from '@/store/page_sate';
import { request } from '@/api/api'
import addTaskPopUpComponent from './view/addTaskPopUp.vue'
@@ -67,7 +66,6 @@ export default {
editTaskPopUpComponent,
tableDeleteButton,
viewTaskAPIPopUpComponent,
// InfoFilled,
},
setup() {
const pageState = usePageState();
@@ -125,6 +123,7 @@ export default {
await queryListData(pageNum, state.pageSize);
}
const rowStyle = () => {
return {
'font-size': '13px',
@@ -139,6 +138,7 @@ export default {
await queryListData(state.currPage, state.pageSize, state.search, state.optionValue);
}
const clickAdd = () => {
pageState.ShowDialogData[state.addTaskPopUpComponentName] = {};
pageState.ShowDialogData[state.addTaskPopUpComponentName].isShow = true;
@@ -155,7 +155,6 @@ export default {
await queryListData(1, state.pageSize);
});
return {
...toRefs(state), handleEdit, handleDelete, handleViewAPI, handleViewLogs,
clickAdd, rowStyle, handPageChange, filterFunc
@@ -164,7 +163,6 @@ export default {
}
</script>
<style scoped>
hr {
color: #FAFCFF;
@@ -19,7 +19,6 @@
<el-button @click="handleEditTask()" size="small" type="primary" style="margin-left: 20px;">修改</el-button>
</div>
<div class="dashed" />
<div class="ins-area">
@@ -101,7 +100,7 @@
<script>
import { defineComponent, onMounted, watch, reactive, toRefs } from 'vue';
import { _, intersection } from 'lodash';
import { _ } from 'lodash';
import { QuestionFilled } from '@element-plus/icons-vue'
import { v4 as uuidv4 } from 'uuid';
import { usePageState } from '@/store/page_sate.js';
@@ -101,7 +101,7 @@ export default defineComponent({
});
setTimeout(() => {
Prism.highlightAll()
}, 10)
}, 100)
}
return {
@@ -115,51 +115,5 @@ export default defineComponent({
.language-javascript {
background-color: #f0f0f0;
}
/* pre {
overflow: hidden !important;
code{
display: inline-block;
padding-bottom: 20px;
position: relative;
top: 20px;
}
&::before {
content: "";
position: absolute;
background: red;
width: 10px;
height: 10px;
border-radius: 50%;
top: 10px;
left: 15px;
transform: translate(-50%);
}
&::after {
content: "";
position: absolute;
background: sandybrown;
width: 10px;
height: 10px;
border-radius: 50%;
top: 10px;
left: 30px;
transform: translate(-50%);
}
code:first-child{
&::after{
content: "";
position: absolute;
background: limegreen;
width: 10px;
height: 10px;
border-radius: 50%;
top: -24px;
left: -7px;
transform: translate(-50%);
}
}
} */
</style>
@@ -49,7 +49,6 @@
<addWayComponent :componentName="addWayComponentName" />
<editWayComponent :componentName="editWayComponentName" />
</div>
</div>
</template>
@@ -117,20 +116,20 @@ export default {
await queryListData(pageNum, state.pageSize);
}
const rowStyle = () => {
return {
'font-size': '13px',
}
}
const filterFunc = async () => {
// console.log('state.optionValue', state.optionValue);
await queryListData(state.currPage, state.pageSize, state.search, state.optionValue);
}
const clickAdd = () => {
pageState.ShowDialogData[state.addWayComponentName] = {};
pageState.ShowDialogData[state.addWayComponentName].isShow = true;
// console.log('clickAdd', pageState.ShowDialogData[state.addWayComponentName].isShow)
}
const queryListData = async (page, size, name = '', type = '') => {
@@ -114,7 +114,6 @@ export default defineComponent({
handleCancer();
window.location.reload();
}
}
return {
@@ -125,15 +124,5 @@ export default defineComponent({
</script>
<style scoped>
/* :global(.el-dialog) {
width: 500px;
} */
/* :global(.el-dialog__title) {
font-size: 14px;
}
:global(.el-dialog label) {
font-size: 13px;
} */
</style>
@@ -7,13 +7,11 @@
<el-tabs class="demo-tabs" @tab-click="handleClick">
<el-form label-width="100px" v-for="item in waysLabelData">
<!-- <el-tab-pane :label="item.label" :name="item.type"> -->
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
<el-input v-if="one.isTextArea != true" size="small" v-model="one.value" :placeholder="one.desc" />
<el-input v-if="one.isTextArea == true" size="small" type="textarea" v-model="one.value"
:placeholder="one.desc" :autosize="{ minRows: 4, maxRows: 10 }" />
</el-form-item>
<!-- </el-tab-pane> -->
</el-form>
</el-tabs>
@@ -53,14 +51,8 @@ export default defineComponent({
isShow: false,
waysLabelData: [],
editData: {},
});
const dealDisplayData = () => {
}
// 监测父页面传过来的数据
watch(pageState.ShowDialogData, (newValue, oldValue) => {
if (newValue[props.componentName]) {
// 弹出编辑框
@@ -88,26 +80,22 @@ export default defineComponent({
};
});
const handleCancer = () => {
if (pageState.ShowDialogData[props.componentName]) {
pageState.ShowDialogData[props.componentName].isShow = false;
}
}
const handleClick = () => {
}
const getEditData = (type) => {
for (const element of state.waysLabelData) {
// if (element.type == type) {
const data = {};
for (const item of element.inputs) {
data[item.col] = item.value;
}
return data;
// }
}
return {};
}
@@ -136,7 +124,6 @@ export default defineComponent({
const handleSubmit = async () => {
let postData = getFinalData();
const rsp = await request.post('/sendways/edit', postData);
// console.log('edit res',rsp)
if (await rsp.data.code == 200) {
handleCancer();
}
@@ -147,18 +134,9 @@ export default defineComponent({
};
},
});
</script>
<style scoped>
/* :global(.el-dialog) {
width: 500px;
} */
/* :global(.el-dialog__title) {
font-size: 14px;
} */
/* :global(.el-dialog label) {
font-size: 13px;
} */
</style>
@@ -27,10 +27,6 @@ export default defineComponent({
components: {
QuestionFilled,
},
props: {
},
methods: {
},
setup() {
const state = reactive({
version: '',
@@ -44,10 +44,6 @@ export default defineComponent({
</script>
<style scoped>
/* :deep(.el-input .el-input__wrapper) {
margin-top: 10px;
} */
:deep(.el-button) {
float: right !important;
margin-top: 10px;
@@ -40,10 +40,6 @@ export default defineComponent({
components: {
QuestionFilled,
},
props: {
},
methods: {
},
setup() {
const router = useRouter();
const state = reactive({
@@ -66,6 +62,7 @@ export default defineComponent({
ElMessage({ message: msg, type: 'success' })
}
}
const handleView = async () => {
router.push('/sendlogs?taskid=' + CONSTANT.LOG_TASK_ID, { replace: true });
}
@@ -93,9 +90,6 @@ export default defineComponent({
</script>
<style scoped>
/* :deep(.el-input .el-input__wrapper) {
margin-top: 10px;
} */
:deep(.el-button) {
float: right !important;
@@ -52,12 +52,7 @@ export default defineComponent({
components: {
QuestionFilled,
},
props: {
},
methods: {
},
setup() {
const router = useRouter();
const state = reactive({
title: '',
slogan: '',