123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <script lang="ts">
- export default {
- name: "Edit"
- };
- </script>
- <script setup lang="ts">
- import { inject, onMounted, reactive, ref, Uploadfile, UploadImg, Editor, useRenderIcon, ElMessage, ElMessageBox, Upload, Close, http, getGroupUrl, RegularVerification, verification } from "@/utils/importUsed"
- let UrlList = reactive(null)
- onMounted(async () => {
- UrlList = await getGroupUrl(["kxsSys"]);
- })
- const props = defineProps<{
- editVisible: {
- type: Boolean;
- default: false;
- };
- width: {
- type: Number;
- default: 50;
- };
- formData: {
- id: any;
- type: any;
- default: {};
- };
- }>();
- const UpdateForm: any = ref({
- status: "",
- });
- const statusOptionList = [
- ]
- const ruleFormRef = ref()
- const activeId = ref('1')
- const submit = async (formEl) => {
-
- if (!formEl) return
- await formEl.validate(async (valid, fields) => {
- if (valid) {
-
- console.log('submit!')
-
- const { status, msg }: any = await http.Request({
- method: UrlList.kxsSys.sysCampchangeStatus.method,
- url: UrlList.kxsSys.sysCampchangeStatus.url,
- params: UpdateForm.value
- });
- if (status === 1) {
-
- ElMessage({
- message: "修改成功",
- type: "success"
- });
- UpdateForm.value = {
- status: "",
- };
-
- closeChangeStatusVisible();
- } else {
-
- ElMessageBox.alert(msg, "提示", {
- confirmButtonText: "关闭",
- type: "warning"
- });
- }
- } else {
-
- ElMessage({
- message: "请输入完整信息",
- type: "error"
- });
- }
- })
- };
- const rules = reactive({
- })
- const closeFn: any = inject('closeEditChangeStatusVisible');
- const openVisible = async () => {
-
- const { status, data }: any = await http.Request({ method: UrlList.kxsSys.sysCamp.method, url: UrlList.kxsSys.sysCamp.url, params: { id: props.formData.id } });
- if (status === 1) {
- UpdateForm.value = data;
- }
- };
- const closeChangeStatusVisible = () => {
- UpdateForm.value = {
- status: "",
- };
- closeFn();
- };
- </script>
- <template lang="pug">
- .main
- el-dialog(v-model='props.editVisible' width="50%" title="修改" @close="closeChangeStatusVisible()" @open="openVisible")
- el-form(:model='UpdateForm' label-position="right" ref="ruleFormRef" :rules="rules" label-width="100px")
- el-form-item(label="状态 0未开始 1进行中 2已结束", prop="status")
- el-select(
- v-model="UpdateForm.status",
- placeholder="请选择状态 0未开始 1进行中 2已结束",
- clearable,
- class="!w-[230px]"
- )
- el-option(:label="item.label", :value="item.id" v-for="(item,index) in statusOptionList")
- el-button(
- :icon="useRenderIcon(Close)",
- :loading="loading",
- @click="closeChangeStatusVisible()"
- ) 关闭
- el-button(
- type="primary",
- :icon="useRenderIcon(Upload)",
- @click="submit(ruleFormRef)"
- ) 确认提交
- </template>
- <style scoped lang="scss">
- :deep(.el-dropdown-menu__item i) {
- margin: 0;
- }
- :deep(.el-form-item__label) {
- font-weight: 700;
- }
- :deep(.el-pagination) {
- flex-flow: wrap;
- }
- :deep(.is-draggable) {
- max-height: 80vh;
- overflow: auto;
- }
- :deep(.el-dialog__header) {
- position: sticky;
- top: 0;
- z-index: 2;
- background: #fff;
- }
- .collapsedom {
- padding: 0 20px;
- background-color: #fff;
- }
- .ovh-x {
- height: 40vh;
- overflow-y: auto;
- }
- :deep(.el-descriptions__header) {
- margin: 16px 0 !important;
- }
- </style>
|