Browse Source

删除冗余视图

zhontai 2 years ago
parent
commit
397a843563

+ 3 - 1
package.json

@@ -75,7 +75,9 @@
   },
   "keywords": [
     "vue3",
-    "element-plus"
+    "element-plus",
+    "zhontai",
+    "admin"
   ],
   "repository": {
     "type": "git",

+ 2 - 0
src/theme/my-app.scss

@@ -1,3 +1,5 @@
+/* 主布局样式
+------------------------------- */
 .layout-container {
   .layout-aside {
     .el-scrollbar__view {

+ 0 - 123
src/views/admin/crmuser/components/crm-user-form.vue

@@ -1,123 +0,0 @@
-<template>
-  <div>
-    <el-dialog v-model="state.showDialog" destroy-on-close :title="title" :close-on-click-modal="false" draggable width="600px">
-      <el-form :model="form" ref="formRef" size="default" label-width="80px">
-        <el-row :gutter="35">
-          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <el-form-item
-              label="手机号"
-              prop="mobile"
-              :rules="[
-                { required: true, message: '请输入手机号', trigger: ['blur', 'change'] },
-                { validator: testMobile, trigger: ['blur', 'change'] },
-              ]"
-            >
-              <el-input v-model="form.mobile" clearable />
-            </el-form-item>
-            <el-form-item label="邮箱" prop="email" :rules="[{ validator: testEmail, trigger: ['blur', 'change'] }]">
-              <el-input v-model="form.email" clearable />
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button @click="onCancel" size="default">取 消</el-button>
-          <el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
-        </span>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { getCurrentInstance, ref, reactive, toRefs } from 'vue'
-import { testMobile, testEmail } from '/@/utils/test'
-import { Crm as CrmApi } from '/@/api/customer/Crm'
-import { CrmMemberDetailInfoDto, CrmMemberUpdateDto } from '/@/api/customer/data-contracts'
-
-defineProps({
-  title: {
-    type: String,
-    default: '',
-  },
-})
-
-const { proxy } = getCurrentInstance() as any
-
-const formRef = ref()
-
-const state = reactive({
-  showDialog: false,
-  sureLoading: false,
-  form: {} as CrmMemberUpdateDto & CrmMemberDetailInfoDto,
-})
-
-const { form } = toRefs(state)
-
-// 打开对话框
-const open = async (row: any = {}) => {
-  proxy.$modal.loading()
-
-  if (row.id > 0) {
-    const res = await new CrmApi().get({ id: row.id }, { loading: true }).catch(() => {
-      proxy.$modal.closeLoading()
-    })
-
-    if (res?.success) {
-      state.form = res.data as CrmMemberUpdateDto & CrmMemberDetailInfoDto
-    }
-  } else {
-    state.form = {} as CrmMemberUpdateDto & CrmMemberDetailInfoDto
-  }
-
-  proxy.$modal.closeLoading()
-  state.showDialog = true
-}
-
-// 取消
-const onCancel = () => {
-  state.showDialog = false
-}
-
-// 确定
-const onSure = () => {
-  formRef.value.validate(async (valid: boolean) => {
-    if (!valid) return
-
-    state.sureLoading = true
-    let res = {} as any
-
-    if (state.form.id != undefined && state.form.id > 0) {
-      res = await new CrmApi().update(state.form, { showSuccessMessage: true }).catch(() => {
-        state.sureLoading = false
-      })
-    } else {
-      res = await new CrmApi().add(state.form, { showSuccessMessage: true }).catch(() => {
-        state.sureLoading = false
-      })
-    }
-
-    state.sureLoading = false
-
-    if (res?.success) {
-      proxy.eventBus.emit('refresh')
-      state.showDialog = false
-    }
-  })
-}
-
-defineExpose({
-  open,
-})
-</script>
-
-<script lang="ts">
-import { defineComponent } from 'vue'
-
-export default defineComponent({
-  name: 'admin/crmuser/form',
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 176
src/views/admin/crmuser/components/set-belong-tenant.vue

@@ -1,176 +0,0 @@
-<template>
-  <div>
-    <el-dialog v-model="state.showDialog" destroy-on-close :title="title" :close-on-click-modal="false" draggable width="600px">
-      <el-row>
-        <el-form :inline="true">
-          <el-button type="primary" icon="ele-Setting" @click="onClearSet">清除已选 </el-button>
-        </el-form>
-      </el-row>
-      <el-row :gutter="35">
-        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <el-table
-            :data="state.tenantList"
-            style="width: 100%"
-            v-loading="state.loading"
-            row-key="id"
-            ref="singleTableRef"
-            highlight-current-row
-            @current-change="onSetChange"
-          >
-            <el-table-column label="名称" prop="name" min-width="120" show-overflow-tooltip />
-            <el-table-column label="编码" prop="code" min-width="120" show-overflow-tooltip />
-            <el-table-column label="手机号" prop="phone" min-width="120" show-overflow-tooltip />
-            <el-table-column label="邮箱" prop="email" min-width="120" show-overflow-tooltip />
-            <el-table-column label="启用" prop="enabled" min-width="120" show-overflow-tooltip>
-              <template #default="{ row }"> {{ row.enabled ? '是' : '否' }} </template>
-            </el-table-column>
-          </el-table>
-          <div class="my-flex my-flex-end view-info-page" style="margin-top: 20px">
-            <el-pagination
-              v-model:currentPage="state.pageInput.CurrentPage"
-              v-model:page-size="state.pageInput.PageSize"
-              :total="state.total"
-              :page-sizes="state.pageSize"
-              :layout="state.layout"
-              @size-change="onSizeChange"
-              @current-change="onCurrentChange"
-            ></el-pagination>
-          </div>
-        </el-col>
-      </el-row>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button @click="onCancel" size="default">取 消</el-button>
-          <el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
-        </span>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { getCurrentInstance, ref, reactive } from 'vue'
-import { Crm as CrmApi } from '/@/api/customer/Crm'
-import { BelongTenantDto } from '/@/api/customer/data-contracts'
-
-defineProps({
-  title: {
-    type: String,
-    default: '',
-  },
-})
-
-const { proxy } = getCurrentInstance() as any
-
-const singleTableRef = ref()
-
-const currentRow = ref()
-
-const state = reactive({
-  loading: false,
-  showDialog: false,
-  sureLoading: false,
-  total: 0,
-  pageSize: [10, 20, 50, 100],
-  layout: 'total, sizes, prev, pager, next',
-  pageInput: {
-    CurrentPage: 1,
-    PageSize: 10,
-  },
-  tenantList: [] as BelongTenantDto[],
-  memberIds: [] as number[],
-})
-
-// 打开对话框
-const open = async (memberIds: number[]) => {
-  proxy.$modal.loading()
-
-  state.memberIds = memberIds
-
-  currentRow.value = null
-
-  onQuery()
-
-  proxy.$modal.closeLoading()
-  state.showDialog = true
-}
-
-// 取消
-const onCancel = () => {
-  state.showDialog = false
-}
-
-// 确定
-const onSure = () => {
-  if (currentRow.value) {
-    onUpdate(currentRow.value!.id)
-  } else {
-    proxy.$modal
-      .confirm('未选中任何所有者,确定继续?')
-      .then(() => {
-        onUpdate(null)
-      })
-      .catch(() => {})
-  }
-}
-
-const onQuery = async () => {
-  state.loading = true
-
-  const res = await new CrmApi().getBelongTenantList(state.pageInput, { loading: true }).catch(() => {
-    proxy.$modal.closeLoading()
-  })
-
-  state.tenantList = res?.data?.list ?? []
-  state.total = res?.data?.total ?? 0
-
-  state.loading = false
-}
-
-const onUpdate = async (id: number | null) => {
-  let res = {} as any
-
-  res = await new CrmApi().setBelongTenant({ ids: state.memberIds, newTenantId: id }, { showSuccessMessage: true }).catch(() => {
-    state.sureLoading = false
-  })
-
-  state.sureLoading = false
-
-  if (res?.success) {
-    proxy.eventBus.emit('refresh')
-    state.showDialog = false
-  }
-}
-
-const onSizeChange = (val: number) => {
-  state.pageInput.PageSize = val
-  onQuery()
-}
-
-const onCurrentChange = (val: number) => {
-  state.pageInput.CurrentPage = val
-  onQuery()
-}
-
-const onSetChange = (tenant: BelongTenantDto) => {
-  currentRow.value = tenant
-}
-
-const onClearSet = () => {
-  singleTableRef.value!.setCurrentRow(null)
-}
-
-defineExpose({
-  open,
-})
-</script>
-
-<script lang="ts">
-import { defineComponent } from 'vue'
-
-export default defineComponent({
-  name: 'admin/crmuser/components/set-belong-tenant',
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 173
src/views/admin/crmuser/components/set-belong-user.vue

@@ -1,173 +0,0 @@
-<template>
-  <div>
-    <el-dialog v-model="state.showDialog" destroy-on-close :title="title" :close-on-click-modal="false" draggable width="600px">
-      <el-row>
-        <el-form :inline="true">
-          <el-button type="primary" icon="ele-Setting" @click="onClearSet">清除已选 </el-button>
-        </el-form>
-      </el-row>
-      <el-row :gutter="35">
-        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-          <el-table
-            :data="state.userList"
-            style="width: 100%"
-            v-loading="state.loading"
-            row-key="id"
-            ref="singleTableRef"
-            highlight-current-row
-            @current-change="onSetChange"
-          >
-            <el-table-column label="姓名" prop="name" min-width="120" show-overflow-tooltip />
-            <el-table-column label="手机号" prop="email" min-width="120" show-overflow-tooltip />
-            <el-table-column label="邮箱" prop="mobile" min-width="120" show-overflow-tooltip />
-            <el-table-column label="状态" prop="status" min-width="120" show-overflow-tooltip />
-          </el-table>
-          <div class="my-flex my-flex-end view-info-page" style="margin-top: 20px">
-            <el-pagination
-              v-model:currentPage="state.pageInput.CurrentPage"
-              v-model:page-size="state.pageInput.PageSize"
-              :total="state.total"
-              :page-sizes="state.pageSize"
-              :layout="state.layout"
-              @size-change="onSizeChange"
-              @current-change="onCurrentChange"
-            ></el-pagination>
-          </div>
-        </el-col>
-      </el-row>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button @click="onCancel" size="default">取 消</el-button>
-          <el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
-        </span>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { getCurrentInstance, ref, reactive } from 'vue'
-import { Crm as CrmApi } from '/@/api/customer/Crm'
-import { BelongUserDto } from '/@/api/customer/data-contracts'
-
-defineProps({
-  title: {
-    type: String,
-    default: '',
-  },
-})
-
-const { proxy } = getCurrentInstance() as any
-
-const singleTableRef = ref()
-
-const currentRow = ref()
-
-const state = reactive({
-  loading: false,
-  showDialog: false,
-  sureLoading: false,
-  total: 0,
-  pageSize: [10, 20, 50, 100],
-  layout: 'total, sizes, prev, pager, next',
-  pageInput: {
-    CurrentPage: 1,
-    PageSize: 10,
-  },
-  userList: [] as BelongUserDto[],
-  memberIds: [] as number[],
-})
-
-// 打开对话框
-const open = async (memberIds: number[]) => {
-  proxy.$modal.loading()
-
-  state.memberIds = memberIds
-
-  currentRow.value = null
-
-  onQuery()
-
-  proxy.$modal.closeLoading()
-  state.showDialog = true
-}
-
-// 取消
-const onCancel = () => {
-  state.showDialog = false
-}
-
-// 确定
-const onSure = () => {
-  if (currentRow.value) {
-    onUpdate(currentRow.value!.id)
-  } else {
-    proxy.$modal
-      .confirm('未选中任何所有者,确定继续?')
-      .then(() => {
-        onUpdate(null)
-      })
-      .catch(() => {})
-  }
-}
-
-const onQuery = async () => {
-  state.loading = true
-
-  const res = await new CrmApi().getBelongUserList(state.pageInput, { loading: true }).catch(() => {
-    proxy.$modal.closeLoading()
-  })
-
-  state.userList = res?.data?.list ?? []
-  state.total = res?.data?.total ?? 0
-
-  state.loading = false
-}
-
-const onUpdate = async (id: number | null) => {
-  let res = {} as any
-
-  res = await new CrmApi().setBelongUser({ ids: state.memberIds, newBelongUserId: id }, { showSuccessMessage: true }).catch(() => {
-    state.sureLoading = false
-  })
-
-  state.sureLoading = false
-
-  if (res?.success) {
-    proxy.eventBus.emit('refresh')
-    state.showDialog = false
-  }
-}
-
-const onSizeChange = (val: number) => {
-  state.pageInput.PageSize = val
-  onQuery()
-}
-
-const onCurrentChange = (val: number) => {
-  state.pageInput.CurrentPage = val
-  onQuery()
-}
-
-const onSetChange = (user: BelongUserDto) => {
-  currentRow.value = user
-}
-
-const onClearSet = () => {
-  singleTableRef.value!.setCurrentRow(null)
-}
-
-defineExpose({
-  open,
-})
-</script>
-
-<script lang="ts">
-import { defineComponent } from 'vue'
-
-export default defineComponent({
-  name: 'admin/crmuser/components/set-belong-user',
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 241
src/views/admin/crmuser/index.vue

@@ -1,241 +0,0 @@
-<template>
-  <div style="padding: 0px 0px 8px 8px">
-    <el-row :gutter="8" style="width: 100%">
-      <el-col :span="24" :xs="24">
-        <el-card shadow="never" :body-style="{ paddingBottom: '0' }" style="margin-top: 8px">
-          <el-form :inline="true">
-            <el-form-item label="创建时间">
-              <my-date-range ref="crmUserDateRangeRef"></my-date-range>
-            </el-form-item>
-            <el-form-item label="查询内容">
-              <el-input v-model="state.filterModel.filterStr" placeholder="客户名称,手机号码"></el-input>
-            </el-form-item>
-            <el-form-item label="客户所有人">
-              <el-select v-model="state.filterModel.belongUserId" :clearable="true">
-                <el-option v-for="item in state.belongUserList" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-            <el-form-item>
-              <el-button type="primary" icon="ele-Search" @click="onQuery"> 查询 </el-button>
-              <el-button type="primary" icon="ele-Plus" @click="onAdd"> 新增 </el-button>
-              <el-button type="primary" icon="ele-Setting" @click="onBatchSetBelongUser"> 批量分配 </el-button>
-              <el-button type="primary" icon="ele-Setting" @click="onBatchSetTenant"> 批量转移 </el-button>
-            </el-form-item>
-          </el-form>
-        </el-card>
-
-        <el-card shadow="never" style="margin-top: 8px">
-          <el-table :data="state.listData" style="width: 100%" v-loading="state.loading" row-key="id" ref="multipleTableRef">
-            <el-table-column type="selection" width="50" />
-            <el-table-column label="客户名称" prop="userName" min-width="120" show-overflow-tooltip />
-            <el-table-column label="手机号码" prop="mobile" min-width="120" show-overflow-tooltip />
-            <el-table-column label="邮箱" prop="email" min-width="120" show-overflow-tooltip />
-            <el-table-column label="客户所有人" prop="belongUserName" min-width="120" show-overflow-tooltip />
-            <el-table-column label="创建时间" prop="createdTime" min-width="120" show-overflow-tooltip />
-            <el-table-column label="操作" width="160" fixed="right" header-align="center" align="center">
-              <template #default="{ row }">
-                <my-dropdown-more>
-                  <template #dropdown>
-                    <el-dropdown-menu>
-                      <el-dropdown-item @click="onEdit(row)">编辑</el-dropdown-item>
-                      <el-dropdown-item @click="onSetBelongUser(row)">分配</el-dropdown-item>
-                      <el-dropdown-item @click="onSetTenant(row)">转移</el-dropdown-item>
-                      <el-dropdown-item @click="onDelete(row)">删除</el-dropdown-item>
-                    </el-dropdown-menu>
-                  </template>
-                </my-dropdown-more>
-              </template>
-            </el-table-column>
-          </el-table>
-          <div class="my-flex my-flex-end view-info-page" style="margin-top: 20px">
-            <el-pagination
-              v-model:currentPage="state.pageInput.currentPage"
-              v-model:page-size="state.pageInput.pageSize"
-              :total="state.total"
-              :page-sizes="state.pageSize"
-              :layout="state.layout"
-              @size-change="onSizeChange"
-              @current-change="onCurrentChange"
-            ></el-pagination>
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-
-    <crm-user-form ref="crmUserFormRef" :title="state.crmUserFormTitle"></crm-user-form>
-    <set-belong-user ref="setBelongUserRef" v-model="state.currentBelongUserId" :title="state.setBelongUserTitle"></set-belong-user>
-    <set-belong-tenant ref="setBelongTenantRef" :title="state.setBelongTenantTitle"></set-belong-tenant>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { getCurrentInstance, onMounted, onUnmounted, reactive, ref } from 'vue'
-import CrmUserForm from './components/crm-user-form.vue'
-import MyDateRange from '/@/components/my-date-range/index.vue'
-import { Crm as CrmApi } from '/@/api/customer/Crm'
-import { PageInputCrmMemberSearchDto, CrmMemberInfoDto, CrmMemberSearchDto, FilterBelongUserDto } from '/@/api/customer/data-contracts'
-import MyDropdownMore from '/@/components/my-dropdown-more/index.vue'
-import SetBelongUser from './components/set-belong-user.vue'
-import SetBelongTenant from './components/set-belong-tenant.vue'
-
-const { proxy } = getCurrentInstance() as any
-
-const crmUserFormRef = ref()
-
-const crmUserDateRangeRef = ref()
-
-const multipleTableRef = ref()
-
-const setBelongUserRef = ref()
-
-const setBelongTenantRef = ref()
-
-const state = reactive({
-  loading: false,
-  crmUserFormTitle: '',
-  setBelongUserTitle: '',
-  setBelongTenantTitle: '',
-  total: 0,
-  pageSize: [10, 20, 50, 100],
-  layout: 'total, sizes, prev, pager, next',
-  belongUserList: [] as FilterBelongUserDto[],
-  currentBelongUserId: null,
-  filterModel: {
-    filterStr: '',
-    belongUserId: null,
-  },
-  pageInput: {
-    currentPage: 1,
-    pageSize: 10,
-    filter: {
-      startDate: '',
-      endDate: '',
-      filterStr: '',
-      belongUserId: null,
-    } as CrmMemberSearchDto,
-  } as PageInputCrmMemberSearchDto,
-  listData: [] as CrmMemberInfoDto[],
-})
-
-onMounted(() => {
-  onQuery()
-  onGetFilterBelongUserList()
-  proxy.eventBus.on('refresh', async () => {
-    onQuery()
-  })
-})
-
-onUnmounted(() => {
-  proxy.eventBus.off('refresh')
-})
-
-const onQuery = async () => {
-  state.loading = true
-
-  if (state.pageInput.filter) {
-    state.pageInput.filter.startDate = crmUserDateRangeRef.value.dateRange[0]
-    state.pageInput.filter.endDate = crmUserDateRangeRef.value.dateRange[1]
-    state.pageInput.filter.filterStr = state.filterModel.filterStr
-    state.pageInput.filter.belongUserId = state.filterModel.belongUserId
-  }
-
-  const res = await new CrmApi().getList(state.pageInput)
-
-  state.listData = res?.data?.list ?? []
-  state.total = res?.data?.total ?? 0
-
-  state.loading = false
-}
-
-const onGetFilterBelongUserList = async () => {
-  const res = await new CrmApi().getFilterBelongUserList()
-
-  state.belongUserList = res?.data ?? []
-}
-
-const onAdd = () => {
-  state.crmUserFormTitle = '新增'
-  crmUserFormRef.value.open()
-}
-
-const onBatchSetBelongUser = () => {
-  const selectRows = multipleTableRef.value!.getSelectionRows() as CrmMemberInfoDto[]
-
-  if ((selectRows.length as number) > 0) {
-    state.setBelongUserTitle = '批量分配'
-
-    const memberIds = selectRows?.map((i) => i.id)
-
-    setBelongUserRef.value.open(memberIds)
-  } else {
-    proxy.$modal.msgWarning('请先勾选客户')
-  }
-}
-
-const onBatchSetTenant = () => {
-  const selectRows = multipleTableRef.value!.getSelectionRows() as CrmMemberInfoDto[]
-
-  if ((selectRows.length as number) > 0) {
-    state.setBelongTenantTitle = '批量转移'
-
-    const memberIds = selectRows?.map((i) => i.id)
-
-    setBelongTenantRef.value.open(memberIds)
-  } else {
-    proxy.$modal.msgWarning('请先勾选客户')
-  }
-}
-
-const onSetBelongUser = (row: CrmMemberInfoDto) => {
-  state.setBelongUserTitle = '分配'
-
-  const memberIds = []
-  memberIds.push(row.id)
-
-  setBelongUserRef.value.open(memberIds)
-}
-
-const onSetTenant = (row: CrmMemberInfoDto) => {
-  state.setBelongTenantTitle = '转移'
-
-  const memberIds = []
-  memberIds.push(row.id)
-
-  setBelongTenantRef.value.open(memberIds)
-}
-
-const onEdit = (row: CrmMemberInfoDto) => {
-  state.crmUserFormTitle = '编辑'
-  crmUserFormRef.value.open(row)
-}
-
-const onDelete = (row: CrmMemberInfoDto) => {
-  proxy.$modal
-    .confirmDelete(`确定要删除?`)
-    .then(async () => {
-      await new CrmApi().softDelete({ id: row.id }, { loading: true })
-      onQuery()
-    })
-    .catch(() => {})
-}
-
-const onSizeChange = (val: number) => {
-  state.pageInput.pageSize = val
-  onQuery()
-}
-
-const onCurrentChange = (val: number) => {
-  state.pageInput.currentPage = val
-  onQuery()
-}
-</script>
-
-<script lang="ts">
-import { defineComponent } from 'vue'
-
-export default defineComponent({
-  name: 'admin/crmuser',
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 29 - 7
src/views/admin/personal/index.vue

@@ -52,10 +52,10 @@
       <el-col :span="24">
         <el-card shadow="hover" class="mt15 personal-edit" header="更新信息">
           <div class="personal-edit-title">基本信息</div>
-          <el-form :model="personalForm" size="default" label-width="40px" class="mt35 mb35">
+          <el-form ref="formRef" :model="personalForm" size="default" label-width="40px" class="mt35 mb35">
             <el-row :gutter="35">
               <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
-                <el-form-item label="姓名">
+                <el-form-item label="姓名" :rules="[{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] }]">
                   <el-input v-model="personalForm.name" placeholder="请输入姓名" clearable></el-input>
                 </el-form-item>
               </el-col>
@@ -66,7 +66,7 @@
               </el-col>
               <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                 <el-form-item>
-                  <el-button type="primary">
+                  <el-button type="primary" @click="onUpdateBasic">
                     <el-icon>
                       <ele-Position />
                     </el-icon>
@@ -92,7 +92,7 @@
             <div class="personal-edit-safe-item">
               <div class="personal-edit-safe-item-left">
                 <div class="personal-edit-safe-item-left-label">密保手机</div>
-                <div class="personal-edit-safe-item-left-value">已绑定手机:{{ personalInfo.phone }}</div>
+                <div class="personal-edit-safe-item-left-value">已绑定手机:{{ personalInfo.mobile }}</div>
               </div>
               <div class="personal-edit-safe-item-right">
                 <el-button text type="primary">立即修改</el-button>
@@ -117,7 +117,7 @@
 </template>
 
 <script setup lang="ts" name="personal">
-import { reactive, computed, onMounted, toRefs } from 'vue'
+import { reactive, computed, onMounted, toRefs, ref } from 'vue'
 import { formatAxis } from '/@/utils/formatTime'
 import { User as UserApi } from '/@/api/admin/User'
 
@@ -127,15 +127,17 @@ const state = reactive({
   newsInfoList: [] as any,
   recommendList: [] as any,
   personalInfo: {
-    phone: '',
+    mobile: '',
     email: '',
   },
   personalForm: {
     name: '',
     nickName: '',
   },
+  updateLoading: false,
 })
 
+const formRef = ref()
 const { personalInfo, personalForm } = toRefs(state)
 
 // 当前时间提示语
@@ -153,11 +155,31 @@ const initData = async () => {
   if (res?.success) {
     state.personalForm.name = res.data?.name as string
     state.personalForm.nickName = res.data?.nickName as string
-    state.personalInfo.phone = res.data?.mobile as string
+    state.personalInfo.mobile = res.data?.mobile as string
     state.personalInfo.email = res.data?.email as string
   }
   state.loading = false
 }
+
+const onUpdateBasic = async () => {
+  formRef.value.validate(async (valid: boolean) => {
+    if (!valid) return
+
+    state.updateLoading = true
+    //let res = {} as any
+    // if (state.form.id != undefined && state.form.id > 0) {
+    //   res = await new UserApi().update(state.form, { showSuccessMessage: true })
+    // } else {
+    //   res = await new UserApi().add(state.form, { showSuccessMessage: true })
+    // }
+
+    state.updateLoading = false
+
+    // if (res?.success) {
+
+    // }
+  })
+}
 </script>
 
 <style scoped lang="scss">

+ 0 - 102
src/views/admin/srm/components/srm-form.vue

@@ -1,102 +0,0 @@
-<template>
-  <div>
-    <el-dialog v-model="state.showDialog" destroy-on-close :title="title" :close-on-click-modal="false" draggable width="600px">
-      <el-form :model="form" ref="formRef" size="default" label-width="80px">
-        <el-row :gutter="35">
-          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <el-form-item label="" prop="" :rules="[]"> </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button @click="onCancel" size="default">取 消</el-button>
-          <el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
-        </span>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { getCurrentInstance, ref, reactive, toRefs } from 'vue'
-
-defineProps({
-  title: {
-    type: String,
-    default: '',
-  },
-})
-
-const { proxy } = getCurrentInstance() as any
-
-const formRef = ref()
-
-const state = reactive({
-  showDialog: false,
-  sureLoading: false,
-  form: {} as any,
-})
-
-const { form } = toRefs(state)
-
-// 打开对话框
-const open = async (row: any = {}) => {
-  proxy.$modal.loading()
-
-  if (row.id > 0) {
-    const res = {} as any
-
-    if (res?.success) {
-      state.form = res.data as any
-    }
-  } else {
-    state.form = {} as any
-  }
-
-  proxy.$modal.closeLoading()
-  state.showDialog = true
-}
-
-// 取消
-const onCancel = () => {
-  state.showDialog = false
-}
-
-// 确定
-const onSure = () => {
-  formRef.value.validate(async (valid: boolean) => {
-    if (!valid) return
-
-    state.sureLoading = true
-    let res = {} as any
-
-    if (state.form.id != undefined && state.form.id > 0) {
-      res = {} as any
-    } else {
-      res = {} as any
-    }
-
-    state.sureLoading = false
-
-    if (res?.success) {
-      proxy.eventBus.emit('refresh')
-      state.showDialog = false
-    }
-  })
-}
-
-defineExpose({
-  open,
-})
-</script>
-
-<script lang="ts">
-import { defineComponent } from 'vue'
-
-export default defineComponent({
-  name: 'admin/srm/form',
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 124
src/views/admin/srm/index.vue

@@ -1,124 +0,0 @@
-<template>
-  <div style="padding: 0px 0px 8px 8px">
-    <el-row :gutter="8" style="width: 100%">
-      <el-col :span="24" :xs="24">
-        <el-card shadow="never" :body-style="{ paddingBottom: '0' }" style="margin-top: 8px">
-          <el-form :inline="true">
-            <el-form-item>
-              <el-button type="primary" icon="ele-Search" @click="onQuery"> 查询 </el-button>
-              <el-button type="primary" icon="ele-Plus" @click="onAdd"> 新增 </el-button>
-            </el-form-item>
-          </el-form>
-        </el-card>
-
-        <el-card shadow="never" style="margin-top: 8px">
-          <el-table :data="state.listData" style="width: 100%" v-loading="state.loading" row-key="id">
-            <el-table-column prop="" label="" min-width="120" show-overflow-tooltip />
-            <el-table-column label="操作" width="160" fixed="right" header-align="center" align="center">
-              <template #default="{ row }">
-                <el-button icon="ele-EditPen" size="small" text type="primary" @click="onEdit(row)">编辑</el-button>
-                <el-button icon="ele-Delete" size="small" text type="danger" @click="onDelete(row)">删除</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-          <div class="my-flex my-flex-end view-info-page">
-            <el-pagination
-              v-model:currentPage="state.pageInput.currentPage"
-              v-model:page-size="state.pageInput.pageSize"
-              :total="state.total"
-              :page-sizes="state.pageSize"
-              :layout="state.layout"
-              @size-change="onSizeChange"
-              @current-change="onCurrentChange"
-            ></el-pagination>
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-
-    <srm-form ref="srmFormRef" :title="state.srmFormTitle"></srm-form>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import { getCurrentInstance, onMounted, onUnmounted, reactive, ref } from 'vue'
-import SrmForm from './components/srm-form.vue'
-
-const { proxy } = getCurrentInstance() as any
-
-const srmFormRef = ref()
-
-const state = reactive({
-  loading: false,
-  srmFormTitle: '',
-  total: 0,
-  pageSize: [10, 20, 50, 100],
-  layout: 'total, sizes, prev, pager, next',
-  pageInput: {
-    currentPage: 1,
-    pageSize: 10,
-  },
-  listData: [],
-})
-
-onMounted(() => {
-  onQuery()
-  proxy.eventBus.on('refresh', async () => {
-    onQuery()
-  })
-})
-
-onUnmounted(() => {
-  proxy.eventBus.off('refresh')
-})
-
-const onQuery = async () => {
-  state.loading = true
-
-  const res = {} as any
-
-  state.listData = res?.data?.list ?? []
-  state.total = res?.data?.total ?? 0
-
-  state.loading = false
-}
-
-const onAdd = () => {
-  state.srmFormTitle = '新增'
-  srmFormRef.value.open()
-}
-
-const onEdit = (row: any) => {
-  state.srmFormTitle = '编辑'
-  srmFormRef.value.open(row)
-}
-
-const onDelete = (row: any) => {
-  proxy.$modal
-    .confirmDelete(`确定要删除?`)
-    .then(async () => {
-      onQuery()
-    })
-    .catch(() => {})
-}
-
-const onSizeChange = (val: number) => {
-  state.pageInput.pageSize = val
-  onQuery()
-}
-
-const onCurrentChange = (val: number) => {
-  state.pageInput.currentPage = val
-  onQuery()
-}
-</script>
-
-<script lang="ts">
-import { defineComponent } from 'vue'
-
-export default defineComponent({
-  name: 'admin/srm',
-})
-</script>
-
-<style lang="scss" scoped></style>