diff --git a/.env.development b/.env.development index 54d28e8..b70607e 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ ENV = 'development' VITE_CLI_PORT = 8088 VITE_SERVER_PORT = 8888 VITE_BASE_API = /api -VITE_BASE_PATH = http://410fed99.r6.cpolar.top +VITE_BASE_PATH = http://4a1840b2.r12.cpolar.top VITE_EDITOR = vscode // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP diff --git a/src/api/lbt.js b/src/api/lbt.js index 2e99dfa..4c54823 100644 --- a/src/api/lbt.js +++ b/src/api/lbt.js @@ -29,5 +29,12 @@ const api = { data }) }, + editLbtState: data => { + return service({ + url: '/banner/status', + method: 'put', + data + }) + }, } export default api diff --git a/src/view/lbtManage/index.vue b/src/view/lbtManage/index.vue index f612700..2a87155 100644 --- a/src/view/lbtManage/index.vue +++ b/src/view/lbtManage/index.vue @@ -2,7 +2,7 @@ // 引入依赖 import api from '@/api/lbt' // import { toSQLLine } from '@/utils/stringFun' -import WarningBar from '@/components/warningBar/warningBar.vue' +// import WarningBar from '@/components/warningBar/warningBar.vue' import { ref, onMounted } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { useRouter, useRoute } from 'vue-router' @@ -12,6 +12,7 @@ const dialogFormVisible = ref(false) import { useUserStore } from '@/pinia/modules/user' const userStore = useUserStore() import { parseTime } from '@/utils' +import { fa } from 'element-plus/es/locale' // 变量 const path = ref(import.meta.env.VITE_BASE_API) const queryParams = ref({ @@ -150,7 +151,7 @@ function delLbtFunc(item) { .then(async() => { const res = await api.delLbt({ // ids: [item.ID] - id: item.ID + id: item.ID }) if (res.code === 0) { ElMessage({ @@ -173,6 +174,22 @@ function handleSizeChange(val) { queryParams.value.pageSize = val getLbtList() } +const state_loading = ref(false) +async function changeStateFunc(row) { // 改变状态 + state_loading.value = true + const res = await api.editLbtState({ status: row.status }) + state_loading.value = false + // eslint-disable-next-line no-empty + if (res.code === 0) { + ElMessage({ + type: 'success', + message: '修改成功!' + }) + return true + } else { + return false + } +}