mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-03 03:38:44 +08:00 
			
		
		
		
	@@ -10,7 +10,7 @@ export const rules = reactive({
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  primaryType: 'id',
 | 
			
		||||
  primaryTitle: '表单编号',
 | 
			
		||||
  action: true,
 | 
			
		||||
  columns: [
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  primaryType: 'id',
 | 
			
		||||
  primaryTitle: '日志编号',
 | 
			
		||||
  action: true,
 | 
			
		||||
  actionWidth: '80px',
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  primaryType: 'id',
 | 
			
		||||
  primaryTitle: '日志编号',
 | 
			
		||||
  action: true,
 | 
			
		||||
  actionWidth: '300',
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ export const rules = reactive({
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  primaryType: 'id',
 | 
			
		||||
  primaryTitle: '配置编号',
 | 
			
		||||
  action: true,
 | 
			
		||||
  actionWidth: '400px',
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ const detailData = ref() // 详情 Ref
 | 
			
		||||
// 详情操作
 | 
			
		||||
const handleDetail = async (row: JobLogApi.JobLogVO) => {
 | 
			
		||||
  // 设置数据
 | 
			
		||||
  const res = JobLogApi.getJobLogApi(row.id)
 | 
			
		||||
  const res = await JobLogApi.getJobLogApi(row.id)
 | 
			
		||||
  detailData.value = res
 | 
			
		||||
  dialogTitle.value = t('action.detail')
 | 
			
		||||
  dialogVisible.value = true
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ export const rules = reactive({
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  primaryType: 'id',
 | 
			
		||||
  primaryTitle: '任务编号',
 | 
			
		||||
  action: true,
 | 
			
		||||
  actionWidth: '280px',
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ const { t } = useI18n()
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  primaryType: 'id',
 | 
			
		||||
  primaryTitle: '日志编号',
 | 
			
		||||
  action: true,
 | 
			
		||||
  columns: [
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,10 @@
 | 
			
		||||
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
 | 
			
		||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
 | 
			
		||||
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
 | 
			
		||||
const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)
 | 
			
		||||
 | 
			
		||||
// 表单校验
 | 
			
		||||
export const rules = reactive({
 | 
			
		||||
  signature: [required],
 | 
			
		||||
@@ -24,8 +28,17 @@ const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
    {
 | 
			
		||||
      title: '渠道编码',
 | 
			
		||||
      field: 'code',
 | 
			
		||||
      dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
 | 
			
		||||
      isSearch: true
 | 
			
		||||
      // dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
 | 
			
		||||
      // dictClass: 'string',
 | 
			
		||||
      isSearch: true,
 | 
			
		||||
      form: {
 | 
			
		||||
        component: 'Select',
 | 
			
		||||
        componentProps: {
 | 
			
		||||
          options: authorizedGrantOptions,
 | 
			
		||||
          multiple: false,
 | 
			
		||||
          filterable: true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: t('common.status'),
 | 
			
		||||
 
 | 
			
		||||
@@ -44,12 +44,13 @@ const [registerTable, { exportList }] = useXTable({
 | 
			
		||||
 | 
			
		||||
// 弹窗相关的变量
 | 
			
		||||
const dialogVisible = ref(false) // 是否显示弹出层
 | 
			
		||||
const dialogTitle = ref('edit') // 弹出层标题
 | 
			
		||||
const dialogTitle = ref(t('action.detail')) // 弹出层标题
 | 
			
		||||
const actionType = ref('') // 操作按钮的类型
 | 
			
		||||
// ========== 详情相关 ==========
 | 
			
		||||
const detailData = ref() // 详情 Ref
 | 
			
		||||
const handleDetail = (row: SmsLoglApi.SmsLogVO) => {
 | 
			
		||||
  // 设置数据
 | 
			
		||||
  actionType.value = 'detail'
 | 
			
		||||
  detailData.value = row
 | 
			
		||||
  dialogVisible.value = true
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,9 @@
 | 
			
		||||
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
 | 
			
		||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
 | 
			
		||||
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
 | 
			
		||||
const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
@@ -25,9 +28,17 @@ const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
    {
 | 
			
		||||
      title: '短信渠道',
 | 
			
		||||
      field: 'channelId',
 | 
			
		||||
      dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
 | 
			
		||||
      dictClass: 'number',
 | 
			
		||||
      isSearch: true
 | 
			
		||||
      // dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
 | 
			
		||||
      // dictClass: 'number',
 | 
			
		||||
      isSearch: true,
 | 
			
		||||
      // table: {
 | 
			
		||||
      // component: 'Select',
 | 
			
		||||
      componentProps: {
 | 
			
		||||
        options: authorizedGrantOptions
 | 
			
		||||
        // multiple: false,
 | 
			
		||||
        // filterable: true
 | 
			
		||||
      }
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '发送状态',
 | 
			
		||||
 
 | 
			
		||||
@@ -19,12 +19,44 @@ const getTenantPackageOptions = async () => {
 | 
			
		||||
}
 | 
			
		||||
getTenantPackageOptions()
 | 
			
		||||
 | 
			
		||||
const validateName = (rule: any, value: any, callback: any) => {
 | 
			
		||||
  const reg = /^[a-zA-Z0-9]{4,30}$/
 | 
			
		||||
  if (value === '') {
 | 
			
		||||
    callback(new Error('请输入用户名称'))
 | 
			
		||||
  } else {
 | 
			
		||||
    console.log(reg.test(rule), 'reg.test(rule)')
 | 
			
		||||
    if (!reg.test(value)) {
 | 
			
		||||
      callback(new Error('用户名称由 数字、字母 组成'))
 | 
			
		||||
    } else {
 | 
			
		||||
      callback()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
const validateMobile = (rule: any, value: any, callback: any) => {
 | 
			
		||||
  const reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/
 | 
			
		||||
  if (value === '') {
 | 
			
		||||
    callback(new Error('请输入联系手机'))
 | 
			
		||||
  } else {
 | 
			
		||||
    if (!reg.test(value)) {
 | 
			
		||||
      callback(new Error('请输入正确的手机号'))
 | 
			
		||||
    } else {
 | 
			
		||||
      callback()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 表单校验
 | 
			
		||||
export const rules = reactive({
 | 
			
		||||
  name: [required],
 | 
			
		||||
  packageId: [required],
 | 
			
		||||
  contactName: [required],
 | 
			
		||||
  contactMobile: [required],
 | 
			
		||||
  contactMobile: [
 | 
			
		||||
    required,
 | 
			
		||||
    {
 | 
			
		||||
      validator: validateMobile,
 | 
			
		||||
      trigger: 'blur'
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  accountCount: [required],
 | 
			
		||||
  expireTime: [required],
 | 
			
		||||
  username: [
 | 
			
		||||
@@ -34,7 +66,8 @@ export const rules = reactive({
 | 
			
		||||
      max: 30,
 | 
			
		||||
      trigger: 'blur',
 | 
			
		||||
      message: '用户名称长度为 4-30 个字符'
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    { validator: validateName, trigger: 'blur' }
 | 
			
		||||
  ],
 | 
			
		||||
  password: [
 | 
			
		||||
    required,
 | 
			
		||||
@@ -90,7 +123,8 @@ const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
      title: '用户名称',
 | 
			
		||||
      field: 'username',
 | 
			
		||||
      isTable: false,
 | 
			
		||||
      isDetail: false
 | 
			
		||||
      isDetail: false,
 | 
			
		||||
      isForm: false
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '用户密码',
 | 
			
		||||
@@ -99,7 +133,8 @@ const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
      isDetail: false,
 | 
			
		||||
      form: {
 | 
			
		||||
        component: 'InputPassword'
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
      isForm: false
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '账号额度',
 | 
			
		||||
 
 | 
			
		||||
@@ -15,54 +15,54 @@
 | 
			
		||||
        <XTextButton preIcon="ep:delete" :title="t('action.del')" @click="deleteData(row.id)" />
 | 
			
		||||
      </template>
 | 
			
		||||
    </XTable>
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
  <XModal v-model="dialogVisible" :title="dialogTitle">
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <Form
 | 
			
		||||
      v-if="['create', 'update'].includes(actionType)"
 | 
			
		||||
      :schema="allSchemas.formSchema"
 | 
			
		||||
      :rules="rules"
 | 
			
		||||
      ref="formRef"
 | 
			
		||||
    >
 | 
			
		||||
      <template #menuIds>
 | 
			
		||||
        <el-card>
 | 
			
		||||
          <template #header>
 | 
			
		||||
            <div class="card-header">
 | 
			
		||||
              全选/全不选:
 | 
			
		||||
              <el-switch
 | 
			
		||||
                v-model="treeNodeAll"
 | 
			
		||||
                inline-prompt
 | 
			
		||||
                active-text="是"
 | 
			
		||||
                inactive-text="否"
 | 
			
		||||
                @change="handleCheckedTreeNodeAll()"
 | 
			
		||||
              />
 | 
			
		||||
            </div>
 | 
			
		||||
          </template>
 | 
			
		||||
          <el-tree
 | 
			
		||||
            ref="treeRef"
 | 
			
		||||
            node-key="id"
 | 
			
		||||
            show-checkbox
 | 
			
		||||
            :props="defaultProps"
 | 
			
		||||
            :data="menuOptions"
 | 
			
		||||
            empty-text="加载中,请稍后"
 | 
			
		||||
          />
 | 
			
		||||
        </el-card>
 | 
			
		||||
      </template>
 | 
			
		||||
    </Form>
 | 
			
		||||
    <!-- 操作按钮 -->
 | 
			
		||||
    <template #footer>
 | 
			
		||||
      <!-- 按钮:保存 -->
 | 
			
		||||
      <XButton
 | 
			
		||||
    <XModal v-model="dialogVisible" :title="dialogTitle">
 | 
			
		||||
      <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
      <Form
 | 
			
		||||
        v-if="['create', 'update'].includes(actionType)"
 | 
			
		||||
        type="primary"
 | 
			
		||||
        :title="t('action.save')"
 | 
			
		||||
        :loading="loading"
 | 
			
		||||
        @click="submitForm()"
 | 
			
		||||
      />
 | 
			
		||||
      <!-- 按钮:关闭 -->
 | 
			
		||||
      <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
 | 
			
		||||
    </template>
 | 
			
		||||
  </XModal>
 | 
			
		||||
        :schema="allSchemas.formSchema"
 | 
			
		||||
        :rules="rules"
 | 
			
		||||
        ref="formRef"
 | 
			
		||||
      >
 | 
			
		||||
        <template #menuIds>
 | 
			
		||||
          <el-card class="cardHeight">
 | 
			
		||||
            <template #header>
 | 
			
		||||
              <div class="card-header">
 | 
			
		||||
                全选/全不选:
 | 
			
		||||
                <el-switch
 | 
			
		||||
                  v-model="treeNodeAll"
 | 
			
		||||
                  inline-prompt
 | 
			
		||||
                  active-text="是"
 | 
			
		||||
                  inactive-text="否"
 | 
			
		||||
                  @change="handleCheckedTreeNodeAll()"
 | 
			
		||||
                />
 | 
			
		||||
              </div>
 | 
			
		||||
            </template>
 | 
			
		||||
            <el-tree
 | 
			
		||||
              ref="treeRef"
 | 
			
		||||
              node-key="id"
 | 
			
		||||
              show-checkbox
 | 
			
		||||
              :props="defaultProps"
 | 
			
		||||
              :data="menuOptions"
 | 
			
		||||
              empty-text="加载中,请稍候"
 | 
			
		||||
            />
 | 
			
		||||
          </el-card>
 | 
			
		||||
        </template>
 | 
			
		||||
      </Form>
 | 
			
		||||
      <!-- 操作按钮 -->
 | 
			
		||||
      <template #footer>
 | 
			
		||||
        <!-- 按钮:保存 -->
 | 
			
		||||
        <XButton
 | 
			
		||||
          v-if="['create', 'update'].includes(actionType)"
 | 
			
		||||
          type="primary"
 | 
			
		||||
          :title="t('action.save')"
 | 
			
		||||
          :loading="loading"
 | 
			
		||||
          @click="submitForm()"
 | 
			
		||||
        />
 | 
			
		||||
        <!-- 按钮:关闭 -->
 | 
			
		||||
        <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
 | 
			
		||||
      </template>
 | 
			
		||||
    </XModal>
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
</template>
 | 
			
		||||
<script setup lang="ts" name="TenantPackage">
 | 
			
		||||
import { handleTree, defaultProps } from '@/utils/tree'
 | 
			
		||||
@@ -179,7 +179,7 @@ onMounted(async () => {
 | 
			
		||||
// getList()
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.el-card {
 | 
			
		||||
.cardHeight {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  max-height: 400px;
 | 
			
		||||
  overflow-y: scroll;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,18 @@
 | 
			
		||||
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
 | 
			
		||||
// 国际化
 | 
			
		||||
const { t } = useI18n()
 | 
			
		||||
const validateMobile = (rule: any, value: any, callback: any) => {
 | 
			
		||||
  const reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/
 | 
			
		||||
  if (value === '') {
 | 
			
		||||
    callback(new Error('请输入联系手机'))
 | 
			
		||||
  } else {
 | 
			
		||||
    if (!reg.test(value)) {
 | 
			
		||||
      callback(new Error('请输入正确的手机号'))
 | 
			
		||||
    } else {
 | 
			
		||||
      callback()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
// 表单校验
 | 
			
		||||
export const rules = reactive({
 | 
			
		||||
  username: [required],
 | 
			
		||||
@@ -17,12 +29,13 @@ export const rules = reactive({
 | 
			
		||||
  ],
 | 
			
		||||
  status: [required],
 | 
			
		||||
  mobile: [
 | 
			
		||||
    required,
 | 
			
		||||
    {
 | 
			
		||||
      required: true,
 | 
			
		||||
      len: 11,
 | 
			
		||||
      trigger: 'blur',
 | 
			
		||||
      message: '请输入正确的手机号码'
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    { validator: validateMobile, trigger: 'blur' }
 | 
			
		||||
  ]
 | 
			
		||||
})
 | 
			
		||||
// crudSchemas
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user