yuanliang 1 рік тому
батько
коміт
3c5d54e0e7

+ 33 - 0
src/views/system-manage/param-settings/api.ts

@@ -0,0 +1,33 @@
+import request from '@/utils/request'
+
+/**
+ * @description: 查询参数 多个逗号隔开
+ */
+export const sysParamConfigQueryByParamNameList = (params: object) => {
+  return request({
+    url: '/cbs-app/sysParamConfig/queryByParamNameList?paramNames=' + params,
+    method: 'get',
+    requestType: 'form',
+  } as any)
+}
+
+/**
+ * @description: 查询参数 多个逗号隔开
+ */
+export const sysParamConfigQueryByParamName = (params: object) => {
+  return request({
+    url: '/cbs-app/sysParamConfig/queryByParamName?paramName=' + params,
+    method: 'get',
+    requestType: 'form',
+  } as any)
+}
+/**
+ * @description: 修改
+ */
+export const sysParamConfigUpdate = (params: object) => {
+  return request({
+    url: '/cbs-app/sysParamConfig/update',
+    method: 'post',
+    data: params
+  } as any)
+}

+ 0 - 752
src/views/system-manage/param-settings/component/attendance-rule.tsx

@@ -1,752 +0,0 @@
-import {
-  addFormMinute,
-  addFormMinuteAddS,
-  reduceFormMinute,
-  reduceFormMinuteAddS,
-  reduceFormMinuteMS
-} from '@/utils/dateUtil'
-import {
-  NAlert,
-  NButton,
-  NForm,
-  NFormItem,
-  NFormItemGi,
-  NGrid,
-  NGridItem,
-  NInput,
-  NInputGroup,
-  NSelect,
-  useMessage
-} from 'naive-ui'
-import { defineComponent, reactive, ref, shallowRef } from 'vue'
-import { sysParamConfigPage, sysParamConfigUpdate } from '../../api'
-import styles from './index.module.less'
-
-export default defineComponent({
-  name: 'attendance-rule',
-  setup() {
-    const selectUnit = [
-      {
-        label: '元',
-        value: 'MONEY'
-      },
-      {
-        label: '%',
-        value: 'PERCENTAGE'
-      }
-    ]
-    const forms = reactive({}) as any
-    const beforeData: any = shallowRef({}) // 储存原始数据
-    const formsRef = ref()
-    const btnLoading = ref(false)
-    const message = useMessage()
-
-    const getList = async () => {
-      try {
-        const { data } = await sysParamConfigPage({ page: 1, rows: 999, group: 'ATTENDANCE' })
-
-        const rows = data.rows || []
-        rows.forEach((row: any) => {
-          forms[row.paramName] = row.paramValue
-        })
-        beforeData.value = { ...forms }
-      } catch {}
-    }
-
-    // 数组进行对比
-    const dataCompare = (beforeData: any, afterData: any) => {
-      const changeDate: any = []
-      for (let key in beforeData) {
-        if (beforeData[key] != afterData[key]) {
-          changeDate.push({
-            paramName: key,
-            paramValue: afterData[key]
-          })
-        }
-      }
-      return changeDate || []
-    }
-
-    const onSubmit = async () => {
-      formsRef.value.validate(async (errors: any) => {
-        if (errors) return
-
-        const submitData = dataCompare(beforeData.value, forms)
-        if (submitData && submitData.length > 0) {
-          btnLoading.value = true
-          try {
-            await sysParamConfigUpdate({ configs: [...submitData], group: 'ATTENDANCE' })
-            message.success('保存成功')
-            beforeData.value = { ...forms }
-          } catch {}
-          btnLoading.value = false
-        } else {
-          message.success('保存成功')
-        }
-      })
-    }
-
-    getList()
-
-    return () => (
-      <>
-        <NForm labelPlacement="left" model={forms} requireMarkPlacement="left" ref={formsRef}>
-          <NAlert
-            title="考勤定位范围"
-            showIcon={false}
-            bordered={false}
-            style="margin-bottom: 12px;"
-          />
-          <h3>考勤定位范围</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="签到、签退GPS定位须在学校定位点"
-              path="scope_of_attendance"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入定位距离',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['scope_of_attendance']}
-              >
-                {{ suffix: () => '米' }}
-              </NInput>
-              以内
-            </NFormItemGi>
-          </NGrid>
-          <h3>签到签退定位异常</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              v-slots={{
-                label: () => (
-                  <>
-                    <span class={styles.red}>签到</span>地点未在教学点范围内,扣减课酬
-                  </>
-                )
-              }}
-              path="sign_in_attendance"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入定位距离',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInputGroup class={[styles.mr14, styles.w140]}>
-                <NInput class={styles.w80} v-model:value={forms['sign_in_attendance']}></NInput>
-                <NSelect
-                  class={styles.w60}
-                  options={selectUnit}
-                  v-model:value={forms['sign_in_attendance_type']}
-                  defaultValue={'MONEY'}
-                />
-              </NInputGroup>
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              v-slots={{
-                label: () => (
-                  <>
-                    <span class={styles.red}>签退</span>地点未在教学点范围内,扣减课酬
-                  </>
-                )
-              }}
-              path="sign_out_attendance"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入金额',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInputGroup class={[styles.mr14, styles.w140]}>
-                <NInput class={styles.w80} v-model:value={forms['sign_out_attendance']}></NInput>
-                <NSelect
-                  class={styles.w60}
-                  options={selectUnit}
-                  v-model:value={forms['sign_out_attendance_type']}
-                  defaultValue={'MONEY'}
-                />
-              </NInputGroup>
-            </NFormItemGi>
-          </NGrid>
-
-          <NAlert title="签到规则" showIcon={false} bordered={false} style="margin-bottom: 12px;" />
-          <h3>正常签到</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NGridItem class={styles.inlineFlex}>
-              <NFormItem
-                label="课程开始前"
-                path="normal_sign_in_start"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入分钟数',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInput
-                  class={[styles.w140, styles.mr14]}
-                  v-model:value={forms['normal_sign_in_start']}
-                >
-                  {{ suffix: () => '分钟' }}
-                </NInput>
-              </NFormItem>
-              <NFormItem
-                label="至课程开始前"
-                showRequireMark={false}
-                path="normal_sign_in_end"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入分钟数',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInput
-                  class={[styles.w140, styles.mr14]}
-                  v-model:value={forms['normal_sign_in_end']}
-                  onUpdateValue={(val: any) => {
-                    forms['abnormal_sign_in'] = val
-                  }}
-                >
-                  {{ suffix: () => '分钟' }}
-                </NInput>
-              </NFormItem>
-            </NGridItem>
-            <NGridItem>
-              <div class={styles.tips}>
-                例: <span class={styles.red}>12:00:00</span> 开始的课程,正常签到时间范围:
-                <span class={styles.red}>
-                  {reduceFormMinute('12:00:00', forms['normal_sign_in_start'])} ~
-                  {reduceFormMinute('12:00:00', forms['normal_sign_in_end'])}
-                </span>{' '}
-                且最早
-                <span class={styles.red}>
-                  {reduceFormMinute('12:00:00', forms['normal_sign_in_start'])}
-                </span>
-                可以进行签到。
-              </div>
-            </NGridItem>
-          </NGrid>
-
-          {forms['normal_sign_in_end'] && (
-            <>
-              <h3>异常签到</h3>
-              <NGrid class={styles.pl13} cols={1}>
-                <NGridItem class={styles.inlineFlex}>
-                  <NFormItem
-                    label="未在课程开始前"
-                    path="abnormal_sign_in"
-                    rule={[
-                      {
-                        required: true,
-                        pattern: /^\d+$/,
-                        message: '请输入分钟数',
-                        trigger: ['blur', 'input']
-                      }
-                    ]}
-                  >
-                    <NInput
-                      class={[styles.w140, styles.mr14]}
-                      disabled
-                      v-model:value={forms['abnormal_sign_in']}
-                    >
-                      {{ suffix: () => '分钟' }}
-                    </NInput>
-                  </NFormItem>
-                  <NFormItem
-                    label="前签到,扣减当日训练补助"
-                    showRequireMark={false}
-                    path="abnormal_sign_in_fee"
-                    rule={[
-                      {
-                        required: true,
-                        pattern: /^\d+$/,
-                        message: '请输入金额',
-                        trigger: ['blur', 'input']
-                      }
-                    ]}
-                  >
-                    <NInputGroup class={[styles.mr14, styles.w140]}>
-                      <NInput
-                        class={styles.w80}
-                        v-model:value={forms['abnormal_sign_in_fee']}
-                      ></NInput>
-                      <NSelect
-                        class={styles.w60}
-                        options={selectUnit}
-                        v-model:value={forms['abnormal_sign_in_fee_type']}
-                        defaultValue={'MONEY'}
-                      />
-                    </NInputGroup>
-                  </NFormItem>
-                </NGridItem>
-                <NGridItem>
-                  <div class={styles.tips}>
-                    例: <span class={styles.red}>12:00:00</span> 开始的课程,在
-                    <span class={styles.red}>
-                      {reduceFormMinuteAddS('12:00:00', forms['abnormal_sign_in'])} ~ 12:00:00
-                    </span>{' '}
-                    时间段内签到为
-                    <span class={styles.red}>异常签到</span>。
-                  </div>
-                </NGridItem>
-              </NGrid>
-            </>
-          )}
-
-          <h3>迟到</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NGridItem class={styles.inlineFlex}>
-              <NFormItem
-                label="课程开始后"
-                path="late_sign_in"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入分钟数',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInput
-                  class={[styles.w140, styles.mr14]}
-                  v-model:value={forms['late_sign_in']}
-                  onUpdateValue={(val: any) => {
-                    forms['absence_sign_in'] = val
-                  }}
-                >
-                  {{ suffix: () => '分钟' }}
-                </NInput>
-              </NFormItem>
-              <NFormItem
-                label="以内签到,扣减当日训练补助"
-                showRequireMark={false}
-                path="late_sign_in_fee"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入金额',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInputGroup class={[styles.mr14, styles.w140]}>
-                  <NInput class={styles.w80} v-model:value={forms['late_sign_in_fee']}></NInput>
-                  <NSelect
-                    class={styles.w60}
-                    options={selectUnit}
-                    v-model:value={forms['late_sign_in_fee_type']}
-                    defaultValue={'MONEY'}
-                  />
-                </NInputGroup>
-              </NFormItem>
-            </NGridItem>
-            <NGridItem>
-              <div class={styles.tips}>
-                例: <span class={styles.red}>12:00:00</span> 开始的课程,在
-                <span class={styles.red}>
-                  {addFormMinuteAddS('12:00:00', 0)} ~{' '}
-                  {addFormMinute('12:00:00', forms['late_sign_in'])}
-                </span>
-                时间段内签到为
-                <span class={styles.red}>迟到</span>。
-              </div>
-            </NGridItem>
-          </NGrid>
-
-          {forms['late_sign_in'] && (
-            <>
-              <h3>旷课</h3>
-              <NGrid class={styles.pl13} cols={1}>
-                <NGridItem class={styles.inlineFlex}>
-                  <NFormItem
-                    label="课程开始"
-                    path="absence_sign_in"
-                    rule={[
-                      {
-                        required: true,
-                        pattern: /^\d+$/,
-                        message: '请输入分钟数',
-                        trigger: ['blur', 'input']
-                      }
-                    ]}
-                  >
-                    <NInput
-                      class={[styles.w140, styles.mr14]}
-                      v-model:value={forms['absence_sign_in']}
-                      disabled
-                    >
-                      {{ suffix: () => '分钟' }}
-                    </NInput>
-                  </NFormItem>
-                  <NFormItem
-                    label="后签到,扣减当日训练补助"
-                    showRequireMark={false}
-                    path="absence_sign_in_fee"
-                    rule={[
-                      {
-                        required: true,
-                        pattern: /^\d+$/,
-                        message: '请输入金额',
-                        trigger: ['blur', 'input']
-                      }
-                    ]}
-                  >
-                    <NInputGroup class={[styles.mr14, styles.w140]}>
-                      <NInput
-                        class={styles.w80}
-                        v-model:value={forms['absence_sign_in_fee']}
-                      ></NInput>
-                      <NSelect
-                        class={styles.w60}
-                        options={selectUnit}
-                        v-model:value={forms['absence_sign_in_fee_type']}
-                        defaultValue={'MONEY'}
-                      />
-                    </NInputGroup>
-                  </NFormItem>
-                </NGridItem>
-                <NGridItem>
-                  <div class={styles.tips}>
-                    例: <span class={styles.red}>12:00:00</span> 开始的课程,在
-                    <span class={styles.red}>
-                      {addFormMinute('12:00:00', forms['absence_sign_in'])}
-                    </span>{' '}
-                    后签到(含
-                    <span class={styles.red}>
-                      {addFormMinute('12:00:00', forms['absence_sign_in'])}
-                    </span>
-                    )为
-                    <span class={styles.red}>旷课</span>。
-                  </div>
-                </NGridItem>
-              </NGrid>
-            </>
-          )}
-
-          <h3>未签到</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="扣减当日训练补助"
-              path="not_sign_in_fee"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入金额',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInputGroup class={[styles.mr14, styles.w140]}>
-                <NInput class={styles.w80} v-model:value={forms['not_sign_in_fee']}></NInput>
-                <NSelect
-                  class={styles.w60}
-                  options={selectUnit}
-                  v-model:value={forms['not_sign_in_fee_type']}
-                  defaultValue={'MONEY'}
-                />
-              </NInputGroup>
-            </NFormItemGi>
-          </NGrid>
-
-          <NAlert title="签退规则" showIcon={false} bordered={false} style="margin-bottom: 12px;" />
-          <h3>正常签退</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NGridItem class={styles.inlineFlex}>
-              <NFormItem
-                label="当日课程结束"
-                path="normal_sign_out"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入分钟数',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['normal_sign_out']}>
-                  {{ suffix: () => '分钟' }}
-                </NInput>
-                内签退
-              </NFormItem>
-            </NGridItem>
-            <NGridItem>
-              <div class={styles.tips}>
-                例: <span class={styles.red}>13:00:00</span> 当日课程结束,可在
-                <span class={styles.red}>
-                  13:00:00 ~ {addFormMinute('13:00:00', forms['normal_sign_out'])}{' '}
-                </span>
-                时间段内完成签退。
-              </div>
-            </NGridItem>
-          </NGrid>
-
-          <h3>异常签退</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NGridItem class={styles.inlineFlex}>
-              <NFormItem
-                label="课程结束前"
-                path="abnormal_sign_out"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入分钟数',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInput
-                  class={[styles.w140, styles.mr14]}
-                  v-model:value={forms['abnormal_sign_out']}
-                  onUpdateValue={(val: any) => {
-                    forms['premise_sign_out'] = val
-                  }}
-                >
-                  {{ suffix: () => '分钟' }}
-                </NInput>
-              </NFormItem>
-              <NFormItem
-                label="至结束时间段内签退,扣减当日训练补助"
-                showRequireMark={false}
-                path="abnormal_sign_out_fee"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入金额',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInputGroup class={[styles.mr14, styles.w140]}>
-                  <NInput
-                    class={styles.w80}
-                    v-model:value={forms['abnormal_sign_out_fee']}
-                  ></NInput>
-                  <NSelect
-                    class={styles.w60}
-                    options={selectUnit}
-                    v-model:value={forms['abnormal_sign_out_fee_type']}
-                    defaultValue={'MONEY'}
-                  />
-                </NInputGroup>
-              </NFormItem>
-            </NGridItem>
-            <NGridItem>
-              <div class={styles.tips}>
-                例: <span class={styles.red}>17:00:00</span> 当日课程结束,在
-                <span class={styles.red}>
-                  {reduceFormMinute('17:00:00', forms['abnormal_sign_out'])} ~{' '}
-                  {reduceFormMinuteMS('17:00:00', 0)}
-                </span>
-                时间段内签退为
-                <span class={styles.red}>异常签到</span>。
-              </div>
-            </NGridItem>
-          </NGrid>
-
-          {forms['abnormal_sign_out'] && (
-            <>
-              <h3>早退</h3>
-              <NGrid class={styles.pl13} cols={1}>
-                <NGridItem class={styles.inlineFlex}>
-                  <NFormItem
-                    label="课程结束前"
-                    path="premise_sign_out"
-                    rule={[
-                      {
-                        required: true,
-                        pattern: /^\d+$/,
-                        message: '请输入分钟数',
-                        trigger: ['blur', 'input']
-                      }
-                    ]}
-                  >
-                    <NInput
-                      class={[styles.w140, styles.mr14]}
-                      v-model:value={forms['premise_sign_out']}
-                      disabled
-                    >
-                      {{ suffix: () => '分钟' }}
-                    </NInput>
-                  </NFormItem>
-                  <NFormItem
-                    label="以上签退,扣减当日训练补助"
-                    showRequireMark={false}
-                    path="premise_sign_out_fee"
-                    rule={[
-                      {
-                        required: true,
-                        pattern: /^\d+$/,
-                        message: '请输入金额',
-                        trigger: ['blur', 'input']
-                      }
-                    ]}
-                  >
-                    <NInputGroup class={[styles.mr14, styles.w140]}>
-                      <NInput
-                        class={styles.w80}
-                        v-model:value={forms['premise_sign_out_fee']}
-                      ></NInput>
-                      <NSelect
-                        class={styles.w60}
-                        options={selectUnit}
-                        v-model:value={forms['premise_sign_out_fee_type']}
-                        defaultValue={'MONEY'}
-                      />
-                    </NInputGroup>
-                  </NFormItem>
-                </NGridItem>
-                <NGridItem>
-                  <div class={styles.tips}>
-                    例: <span class={styles.red}>17:00:00</span> 当日课程结束,在
-                    <span class={styles.red}>
-                      {reduceFormMinute('17:00:00', forms['premise_sign_out'])}
-                    </span>
-                    前签退(含
-                    <span class={styles.red}>
-                      {reduceFormMinute('17:00:00', forms['premise_sign_out'])}
-                    </span>
-                    )为
-                    <span class={styles.red}>早退</span>。
-                  </div>
-                </NGridItem>
-              </NGrid>
-            </>
-          )}
-
-          {/* <h3>旷课</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NGridItem class={styles.inlineFlex}>
-              <NFormItem
-                label="课程开始"
-                path="absence_sign_out"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入分钟数',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['absence_sign_out']}>
-                  {{ suffix: () => '分钟' }}
-                </NInput>
-              </NFormItem>
-              <NFormItem
-                label="后签到,扣减当日训练补助"
-                showRequireMark={false}
-                path="absence_sign_out_fee"
-                rule={[
-                  {
-                    required: true,
-                    pattern: /^\d+$/,
-                    message: '请输入金额',
-                    trigger: ['blur', 'input']
-                  }
-                ]}
-              >
-                <NInputGroup class={[styles.mr14, styles.w140]}>
-                  <NInput class={styles.w80} v-model:value={forms['absence_sign_out_fee']}></NInput>
-                  <NSelect
-                    class={styles.w60}
-                    options={selectUnit}
-                    v-model:value={forms['absence_sign_out_fee_type']}
-                    defaultValue={'MONEY'}
-                  />
-                </NInputGroup>
-              </NFormItem>
-            </NGridItem>
-            <NGridItem>
-              <div class={styles.tips}>
-                例: <span class={styles.red}>12:00:00</span> 开始的课程,在
-                <span class={styles.red}>12:30:01 ~ 12:00:00</span> 以后签到为
-                <span class={styles.red}>旷课</span>
-              </div>
-            </NGridItem>
-          </NGrid> */}
-
-          <h3>未签退</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="课程未签退,扣减当日训练补助"
-              path="not_sign_out_fee"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入金额',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInputGroup class={[styles.mr14, styles.w140]}>
-                <NInput class={styles.w80} v-model:value={forms['not_sign_out_fee']}></NInput>
-                <NSelect
-                  class={styles.w60}
-                  options={selectUnit}
-                  v-model:value={forms['not_sign_out_fee_type']}
-                  defaultValue={'MONEY'}
-                />
-              </NInputGroup>
-            </NFormItemGi>
-          </NGrid>
-
-          <h3>签退提醒</h3>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="当日训练结束后"
-              path="sign_out_remind"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入分钟数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['sign_out_remind']}>
-                {{ suffix: () => '分钟' }}
-              </NInput>
-              对当日存在未签退课程的老师发送短信、推送、公众号提醒
-            </NFormItemGi>
-          </NGrid>
-        </NForm>
-
-        <NButton
-          type="primary"
-          onClick={onSubmit}
-          loading={btnLoading.value}
-          //v-auth="sysParamConfig/update1597903049401421825"
-        >
-          保存设置
-        </NButton>
-      </>
-    )
-  }
-})

+ 0 - 209
src/views/system-manage/param-settings/component/finance-rule.tsx

@@ -1,209 +0,0 @@
-import { NAlert, NButton, NForm, NFormItemGi, NGrid, NInput, useMessage } from 'naive-ui'
-import { defineComponent, reactive, ref, shallowRef } from 'vue'
-import { sysParamConfigPage, sysParamConfigUpdate } from '../../api'
-import styles from './index.module.less'
-
-export default defineComponent({
-  name: 'finance-rule',
-  setup() {
-    const forms = reactive({}) as any
-    const beforeData: any = shallowRef({}) // 储存原始数据
-    const formsRef = ref()
-    const btnLoading = ref(false)
-    const message = useMessage()
-
-    const getList = async () => {
-      try {
-        const { data } = await sysParamConfigPage({ page: 1, rows: 999, group: 'FINANCE' })
-
-        const rows = data.rows || []
-        rows.forEach((row: any) => {
-          if (row.paramName === 'refund_reason') {
-            forms[row.paramName] = row.paramValue.trim()
-          } else {
-            forms[row.paramName] = row.paramValue
-          }
-        })
-        beforeData.value = { ...forms }
-      } catch {}
-    }
-
-    // 数组进行对比
-    const dataCompare = (beforeData: any, afterData: any) => {
-      const changeDate: any = []
-      for (let key in beforeData) {
-        if (beforeData[key] != afterData[key]) {
-          changeDate.push({
-            paramName: key,
-            paramValue: afterData[key]
-          })
-        }
-      }
-      return changeDate || []
-    }
-
-    const onSubmit = async () => {
-      formsRef.value.validate(async (errors: any) => {
-        if (errors) return
-
-        const submitData = dataCompare(beforeData.value, forms)
-        if (submitData && submitData.length > 0) {
-          btnLoading.value = true
-          try {
-            await sysParamConfigUpdate({ configs: [...submitData], group: 'FINANCE' })
-            message.success('保存成功')
-            beforeData.value = { ...forms }
-          } catch {}
-          btnLoading.value = false
-        } else {
-          message.success('保存成功')
-        }
-      })
-    }
-
-    getList()
-    return () => (
-      <>
-        <NForm ref={formsRef} labelPlacement="left" model={forms} requireMarkPlacement="left">
-          <NAlert title="训练补助" showIcon={false} bordered={false} style="margin-bottom: 12px;" />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="训练结束"
-              path="training_end"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入训练结束天数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['training_end']}>
-                {{ suffix: () => '天' }}
-              </NInput>
-              后,发放训练补助
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="训练补助结算扣除"
-              path="subsidy_tax_rate"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入训练补助结算百分比',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['subsidy_tax_rate']}>
-                {{ suffix: () => '‰' }}
-              </NInput>
-              手续费
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="申请提现后"
-              path="subsidy_withdraw"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入申请提现的工作日',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['subsidy_withdraw']}>
-                {{ suffix: () => '个工作日' }}
-              </NInput>
-              内打款
-            </NFormItemGi>
-          </NGrid>
-
-          <NAlert title="交易退费" showIcon={false} bordered={false} style="margin-bottom: 12px;" />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="交易完成"
-              path="transaction_complete"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入交易完成天数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['transaction_complete']}
-              >
-                {{ suffix: () => '天' }}
-              </NInput>
-              内可申请退费
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="退费扣除"
-              path="transaction_complete_tax_rate"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入退费扣除百分比',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['transaction_complete_tax_rate']}
-              >
-                {{ suffix: () => '‰' }}
-              </NInput>
-              手续费
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="退费原因"
-              path="refund_reason"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入退费原因',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                type="textarea"
-                class={[styles.mr14]}
-                style={'width: 400px !important;'}
-                v-model:value={forms['refund_reason']}
-              ></NInput>
-            </NFormItemGi>
-          </NGrid>
-        </NForm>
-
-        <NButton
-          type="primary"
-          onClick={onSubmit}
-          loading={btnLoading.value}
-          //v-auth="sysParamConfig/update1597903120771698689"
-        >
-          保存设置
-        </NButton>
-      </>
-    )
-  }
-})

+ 0 - 42
src/views/system-manage/param-settings/component/index.module.less

@@ -1,42 +0,0 @@
-.mr14 {
-  margin-right: 14px;
-}
-
-.inlineFlex {
-  display: inline-flex !important;
-}
-
-.w140 {
-  width: 140px !important;
-}
-
-.w80 {
-  width: 80px !important;
-}
-
-.w60 {
-  width: 60px !important;
-}
-
-.red {
-  color: red;
-}
-
-h3 {
-  margin-bottom: 12px;
-  padding-left: 13px;
-}
-
-.pl13 {
-  padding-left: 13px;
-}
-
-.tips {
-  font-size: 13px;
-  color: #333;
-  margin-bottom: 20px;
-  background: #f7f7f7;
-  padding: 6px 12px;
-  border-radius: 4px;
-  max-width: 650px;
-}

+ 0 - 130
src/views/system-manage/param-settings/component/leave-category-operation.tsx

@@ -1,130 +0,0 @@
-import { clientTypeArray, openTypeArray } from '@/utils/searchArray'
-import {
-  NForm,
-  NFormItem,
-  NInput,
-  NSpace,
-  NButton,
-  useMessage,
-  NRadioGroup,
-  NRadio,
-  NSelect
-} from 'naive-ui'
-import { defineComponent, onMounted, PropType, reactive, ref } from 'vue'
-import { leaveCategorySave, leaveCategoryUpdate } from '../../api'
-export default defineComponent({
-  name: 'role-operation',
-  props: {
-    type: {
-      type: String,
-      default: 'add'
-    },
-    data: {
-      type: Object as PropType<any>,
-      default: () => {}
-    }
-  },
-  emits: ['close', 'getList'],
-  setup(props, { slots, attrs, emit }) {
-    const forms = reactive({
-      clientType: null,
-      name: null,
-      remark: null
-    })
-    const btnLoading = ref(false)
-
-    const formsRef = ref()
-    const message = useMessage()
-
-    const onSubmit = async () => {
-      formsRef.value.validate(async (error: any) => {
-        if (error) return false
-        try {
-          btnLoading.value = true
-          if (props.type === 'add') {
-            await leaveCategorySave({ ...forms })
-            message.success('添加成功')
-          } else if (props.type === 'edit') {
-            await leaveCategoryUpdate({ ...forms, id: props.data.id })
-            message.success('修改成功')
-          }
-
-          emit('close')
-          emit('getList')
-        } catch (e: any) {
-          console.log(e, 'e')
-        }
-        btnLoading.value = false
-      })
-    }
-
-    onMounted(async () => {
-      if (props.type === 'edit') {
-        const data = props.data
-        forms.clientType = data.clientType
-        forms.name = data.name
-        forms.remark = data.remark
-      }
-    })
-
-    return () => (
-      <div style="background: #fff; padding-top: 12px">
-        <NForm model={forms} ref={formsRef} label-placement="left" label-width="auto">
-          <NFormItem
-            label="客户端类型"
-            path="clientType"
-            rule={[
-              {
-                required: true,
-                message: '请输入客户端类型'
-              }
-            ]}
-          >
-            <NSelect
-              placeholder="请输入客户端类型"
-              v-model:value={forms.clientType}
-              options={clientTypeArray}
-              clearable
-            />
-          </NFormItem>
-          <NFormItem
-            label="类型名称"
-            path="name"
-            rule={[
-              {
-                required: true,
-                message: '请输入类型名称'
-              }
-            ]}
-          >
-            <NInput
-              v-model:value={forms.name}
-              placeholder="请输入类型名称"
-              clearable
-              maxlength={100}
-            ></NInput>
-          </NFormItem>
-          <NFormItem label="备注" path="remark">
-            <NInput
-              v-model:value={forms.remark}
-              maxlength={180}
-              type="textarea"
-              rows={3}
-              placeholder="请输入备注"
-              clearable
-            />
-          </NFormItem>
-        </NForm>
-
-        <NSpace justify="end">
-          <NButton type="default" onClick={() => emit('close')}>
-            取消
-          </NButton>
-          <NButton type="primary" onClick={onSubmit} loading={btnLoading.value}>
-            保存
-          </NButton>
-        </NSpace>
-      </div>
-    )
-  }
-})

+ 0 - 161
src/views/system-manage/param-settings/component/leave-category.tsx

@@ -1,161 +0,0 @@
-import Pagination from '@/components/pagination'
-import { NButton, NDataTable, NModal, NSpace, NTag, useDialog, useMessage } from 'naive-ui'
-import { defineComponent, onMounted, reactive } from 'vue'
-import { leaveCategoryPage, leaveCategoryRemove } from '../../api'
-import { filterClientType, filterMessageGroup } from '@/utils/filters'
-import LeaveCategoryOperation from './leave-category-operation'
-import TheTooltip from '@/components/TheTooltip'
-
-export default defineComponent({
-  name: 'subsidy-list',
-  setup() {
-    const state = reactive({
-      loading: false,
-      pagination: {
-        page: 1,
-        rows: 10,
-        pageTotal: 0
-      },
-      dataList: [] as any,
-      visiableLeave: false,
-      leaveOperation: 'add',
-      leaveData: {} as any
-    })
-    const dialog = useDialog()
-    const message = useMessage()
-
-    const columns = () => {
-      return [
-        {
-          title: '编号',
-          key: 'id'
-        },
-        {
-          title: '客户端类型',
-          key: 'clientType',
-          render(row: any) {
-            return filterClientType(row.clientType)
-          }
-        },
-        {
-          title: '类型名称',
-          key: 'name',
-          render(row: any) {
-            return <TheTooltip content={row.name} />
-          }
-        },
-        {
-          title: '备注',
-          key: 'remark',
-          render(row: any) {
-            return <TheTooltip content={row.remark} />
-          }
-        },
-        {
-          title: '操作',
-          key: 'operation',
-          render(row: any) {
-            return (
-              <NSpace>
-                <NButton
-                  type="primary"
-                  size="small"
-                  text
-                  //v-auth="leaveCategory/update1610189620435570689"
-                  onClick={() => {
-                    state.visiableLeave = true
-                    state.leaveOperation = 'edit'
-                    state.leaveData = row
-                  }}
-                >
-                  修改
-                </NButton>
-                <NButton
-                  type="primary"
-                  size="small"
-                  text
-                  onClick={() => onRemove(row)}
-                  //v-auth="leaveCategory/remove1610189694385344513"
-                >
-                  删除
-                </NButton>
-              </NSpace>
-            )
-          }
-        }
-      ]
-    }
-
-    const onRemove = (row: any): void => {
-      dialog.warning({
-        title: '警告',
-        content: `删除"${row.name}",是否继续?`,
-        positiveText: '确定',
-        negativeText: '取消',
-        onPositiveClick: async () => {
-          try {
-            await leaveCategoryRemove({ id: row.id })
-            getList()
-            message.success('删除成功')
-          } catch {}
-        }
-      })
-    }
-
-    const getList = async () => {
-      try {
-        state.loading = true
-        const { data } = await leaveCategoryPage({ ...state.pagination })
-        state.loading = false
-        state.pagination.pageTotal = Number(data.total)
-        state.dataList = data.rows || []
-      } catch {
-        state.loading = false
-      }
-    }
-
-    onMounted(() => {
-      getList()
-    })
-    return () => (
-      <>
-        <NSpace style="padding-bottom: 12px">
-          <NButton
-            type="primary"
-            //v-auth="leaveCategory/save1610189531537297410"
-            onClick={() => {
-              state.visiableLeave = true
-              state.leaveOperation = 'add'
-              state.leaveData = []
-            }}
-          >
-            新增
-          </NButton>
-        </NSpace>
-        <NDataTable loading={state.loading} columns={columns()} data={state.dataList}></NDataTable>
-        <Pagination
-          v-model:page={state.pagination.page}
-          v-model:pageSize={state.pagination.rows}
-          v-model:pageTotal={state.pagination.pageTotal}
-          onList={getList}
-          sync
-        ></Pagination>
-
-        <NModal
-          v-model:show={state.visiableLeave}
-          preset="dialog"
-          showIcon={false}
-          title={state.leaveOperation === 'add' ? '新增请假类型' : '修改请假类型'}
-          style={{ width: '600px' }}
-        >
-          <LeaveCategoryOperation
-            type={state.leaveOperation}
-            data={state.leaveData}
-            onClose={() => (state.visiableLeave = false)}
-            onGetList={getList}
-          />
-        </NModal>
-      </>
-    )
-  }
-})

+ 0 - 110
src/views/system-manage/param-settings/component/member-fee.tsx

@@ -1,110 +0,0 @@
-import { NAlert, NButton, NForm, NFormItemGi, NGrid, NInput, useMessage } from 'naive-ui'
-import { defineComponent, reactive, ref, shallowRef } from 'vue'
-import { getVipPriceSettings, setVipPriceSettings } from '../../api'
-import styles from './index.module.less'
-
-export default defineComponent({
-  name: 'member-fee',
-  setup() {
-    const forms = reactive({ id: 0, originalPrice: 0, salePrice: 0 }) as any
-    const beforeData: any = shallowRef({}) // 储存原始数据
-    const formsRef = ref()
-    const btnLoading = ref(false)
-    const message = useMessage()
-
-    const getList = async () => {
-      try {
-        const { data } = await getVipPriceSettings({ page: 1, rows: 999, cardTypes: ['VIP'] })
-
-        const rows = data.rows[0]
-
-        forms.id = rows.id
-        forms.originalPrice = rows.originalPrice
-        forms.salePrice = rows.salePrice
-        console.log(forms)
-        // beforeData.value = { ...forms }
-      } catch {}
-    }
-
-    // // 数组进行对比
-    // const dataCompare = (beforeData: any, afterData: any) => {
-    //   const changeDate: any = []
-    //   for (let key in beforeData) {
-    //     if (beforeData[key] != afterData[key]) {
-    //       changeDate.push({
-    //         id: key,
-    //         paramValue: afterData[key]
-    //       })
-    //     }
-    //   }
-    //   return changeDate || []
-    // }
-
-    const onSubmit = async () => {
-      formsRef.value.validate(async (errors: any) => {
-        if (errors) return
-        try {
-          const res = await setVipPriceSettings({ ...forms })
-        } catch (e) {
-          console.log(e)
-        }
-        message.success('保存成功')
-      })
-    }
-
-    getList()
-    return () => (
-      <>
-        <NForm ref={formsRef} labelPlacement="left" model={forms} requireMarkPlacement="left">
-          <NAlert title="会员价格" showIcon={false} bordered={false} style="margin-bottom: 12px;" />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="会员原价"
-              path="originalPrice"
-              rule={[
-                {
-                  required: true,
-                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                  message: '请输正确的会员原价',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms.originalPrice}>
-                {{ suffix: () => '元' }}
-              </NInput>
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="会员售价"
-              path="salePrice"
-              rule={[
-                {
-                  required: true,
-                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                  message: '请输正确的入会员售价',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms.salePrice}>
-                {{ suffix: () => '元' }}
-              </NInput>
-            </NFormItemGi>
-          </NGrid>
-        </NForm>
-
-        <NButton
-          type="primary"
-          onClick={onSubmit}
-          loading={btnLoading.value}
-          //v-auth="vipPriceSettings/update1623234797500751874"
-        >
-          保存设置
-        </NButton>
-      </>
-    )
-  }
-})

+ 0 - 255
src/views/system-manage/param-settings/component/message-operation.tsx

@@ -1,255 +0,0 @@
-import { getMenus } from '@/api/system/menu'
-import UploadFile from '@/components/upload-file'
-import { clientTypeArray, messageGroupArray, openTypeArray } from '@/utils/searchArray'
-import { SearchOutline } from '@vicons/ionicons5'
-import {
-  NForm,
-  NFormItemGi,
-  NInput,
-  NSpace,
-  NButton,
-  useMessage,
-  NRadioGroup,
-  NRadio,
-  NSelect,
-  NGrid
-} from 'naive-ui'
-import { defineComponent, onMounted, PropType, reactive, ref } from 'vue'
-import { sysMessageConfigSave, sysMessageConfigUpdate } from '../../api'
-const messageTypeArray = [
-  { label: 'CUSTOME_MESSAGE_PUSH', value: 'CUSTOME_MESSAGE_PUSH' },
-  { label: 'SMS_VERIFY_CODE_LOGIN', value: 'SMS_VERIFY_CODE_LOGIN' },
-  { label: 'SMS_VERIFY_CODE_LOGOFF', value: 'SMS_VERIFY_CODE_LOGOFF' },
-  { label: 'SMS_VERIFY_CODE_REGISTER', value: 'SMS_VERIFY_CODE_REGISTER' },
-  { label: 'SMS_VERIFY_CODE_UPDATE_PSW', value: 'SMS_VERIFY_CODE_UPDATE_PSW' },
-  { label: 'SMS_VERIFY_CODE_UPDATE_PHONE', value: 'SMS_VERIFY_CODE_UPDATE_PHONE' },
-  { label: 'SMS_VERIFY_CODE', value: 'SMS_VERIFY_CODE' },
-  { label: 'CAPTCHA_SESSION_KEY', value: 'CAPTCHA_SESSION_KEY' },
-  { label: 'SMS_VERIFY_CODE_BANK_CARD', value: 'SMS_VERIFY_CODE_BANK_CARD' },
-  { label: 'STUDENT_JOIN_FANSGROUP', value: 'STUDENT_JOIN_FANSGROUP' },
-  { label: 'FANSGROUP_APPLY_SUCCESS', value: 'FANSGROUP_APPLY_SUCCESS' }
-]
-
-const subTypeArray = [
-  { label: 'TEACHER_AUTH', value: 'TEACHER_AUTH' },
-  { label: 'PRACTICE', value: 'PRACTICE' },
-  { label: 'MUSIC_SHEET', value: 'MUSIC_SHEET' },
-  { label: 'COURSE', value: 'COURSE' },
-  { label: 'INCOME', value: 'INCOME' },
-  { label: 'HOMEWORK', value: 'HOMEWORK' },
-  { label: 'EVALUATE', value: 'EVALUATE' },
-  { label: 'GROUP_CHAT', value: 'GROUP_CHAT' },
-  { label: 'VIP', value: 'VIP' }
-]
-
-const actionArray = [
-  { label: 'h5', value: 'h5' },
-  { label: 'app', value: 'app' }
-]
-
-export default defineComponent({
-  name: 'role-operation',
-  props: {
-    type: {
-      type: String,
-      default: 'add'
-    },
-    data: {
-      type: Object as PropType<any>,
-      default: () => {}
-    }
-  },
-  emits: ['close', 'getList'],
-  setup(props, { slots, attrs, emit }) {
-    const forms = reactive({
-      sendFlag: null,
-      clientId: null,
-      actionUrl: null,
-      icon: null,
-      description: null,
-      params: null,
-      content: null,
-      messageType: null,
-      action: null,
-      subType: null,
-      group: null
-    }) as any
-    const btnLoading = ref(false)
-
-    const formsRef = ref()
-    const message = useMessage()
-
-    const onSubmit = async () => {
-      console.log('date', '1212')
-      formsRef.value.validate(async (error: any) => {
-        if (error) return false
-
-        try {
-          btnLoading.value = true
-          if (props.type === 'add') {
-            await sysMessageConfigSave({ ...forms })
-            message.success('添加成功')
-          } else if (props.type === 'edit') {
-            await sysMessageConfigUpdate({ ...forms, id: props.data.id })
-            message.success('修改成功')
-          }
-
-          emit('close')
-          emit('getList')
-        } catch (e: any) {
-          console.log(e, 'e')
-        }
-        btnLoading.value = false
-      })
-    }
-
-    onMounted(async () => {
-      if (props.type === 'edit') {
-        const data = props.data
-        forms.sendFlag = data.sendFlag
-        forms.clientId = data.clientId
-        forms.actionUrl = data.actionUrl
-        forms.icon = data.icon
-        forms.description = data.description
-        forms.params = data.params
-        forms.content = data.content
-        forms.messageType = data.messageType
-        forms.action = data.action
-        forms.subType = data.subType
-        forms.group = data.group
-      }
-    })
-
-    return () => (
-      <div style="background: #fff; padding-top: 12px">
-        <NForm model={forms} ref={formsRef} label-placement="left" label-width="100">
-          <NGrid cols={2}>
-            <NFormItemGi label="图标地址" path="icon">
-              <UploadFile size={5} listType="image-card" v-model:fileList={forms.icon} />
-            </NFormItemGi>
-            <NFormItemGi
-              label="是否发送"
-              path="sendFlag"
-              rule={[
-                {
-                  required: true,
-                  message: '请选择是否发送'
-                }
-              ]}
-            >
-              <NRadioGroup v-model:value={forms.sendFlag}>
-                <NRadio value={1}>发送</NRadio>
-                <NRadio value={0}>不发送</NRadio>
-              </NRadioGroup>
-            </NFormItemGi>
-            <NFormItemGi
-              label="客户端类型"
-              path="clientId"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入客户端类型'
-                }
-              ]}
-            >
-              <NSelect
-                placeholder="请输入客户端类型"
-                v-model:value={forms.clientId}
-                options={clientTypeArray}
-              />
-            </NFormItemGi>
-            <NFormItemGi
-              label="消息类型"
-              path="messageType"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入消息类型'
-                }
-              ]}
-            >
-              <NSelect
-                placeholder="请输入消息类型"
-                v-model:value={forms.messageType}
-                options={messageTypeArray}
-              />
-            </NFormItemGi>
-            <NFormItemGi
-              label="消息组"
-              path="group"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入消息组'
-                }
-              ]}
-            >
-              <NSelect
-                placeholder="请输入消息组"
-                v-model:value={forms.group}
-                options={messageGroupArray}
-              />
-            </NFormItemGi>
-            <NFormItemGi label="二级分类" path="subType">
-              <NSelect
-                placeholder="请输入二级分类"
-                v-model:value={forms.subType}
-                options={subTypeArray}
-              />
-            </NFormItemGi>
-            <NFormItemGi label="跳转类型" path="action">
-              <NSelect
-                placeholder="请输入跳转类型"
-                v-model:value={forms.action}
-                options={actionArray}
-              />
-            </NFormItemGi>
-            <NFormItemGi label="跳转连接" path="actionUrl">
-              <NInput
-                v-model:value={forms.actionUrl}
-                placeholder="请输入跳转连接"
-                clearable
-                maxlength={100}
-              ></NInput>
-            </NFormItemGi>
-            <NFormItemGi label="其它参数" path="params">
-              <NInput
-                v-model:value={forms.params}
-                placeholder="请输入其它参数"
-                clearable
-                maxlength={100}
-              ></NInput>
-            </NFormItemGi>
-            <NFormItemGi label="消息内容" path="content">
-              <NInput
-                v-model:value={forms.content}
-                placeholder="请输入消息内容"
-                clearable
-                maxlength={100}
-              ></NInput>
-            </NFormItemGi>
-            <NFormItemGi label="描述" path="description">
-              <NInput
-                v-model:value={forms.description}
-                maxlength={180}
-                type="textarea"
-                rows={2}
-                placeholder="请输入描述"
-                clearable
-              />
-            </NFormItemGi>
-          </NGrid>
-        </NForm>
-
-        <NSpace justify="end">
-          <NButton type="default" onClick={() => emit('close')}>
-            取消
-          </NButton>
-          <NButton type="primary" onClick={onSubmit} loading={btnLoading.value}>
-            保存
-          </NButton>
-        </NSpace>
-      </div>
-    )
-  }
-})

+ 0 - 180
src/views/system-manage/param-settings/component/message-setting.tsx

@@ -1,180 +0,0 @@
-import Pagination from '@/components/pagination'
-import { NButton, NDataTable, NModal, NSpace, NTag, useDialog, useMessage } from 'naive-ui'
-import { defineComponent, onMounted, reactive } from 'vue'
-import { sysMessageConfigPage, sysMessageConfigRemove } from '../../api'
-import { filterClientType, filterMessageGroup } from '@/utils/filters'
-import MessageOperation from './message-operation'
-
-export default defineComponent({
-  name: 'subsidy-list',
-  setup() {
-    const state = reactive({
-      loading: false,
-      pagination: {
-        page: 1,
-        rows: 10,
-        pageTotal: 0
-      },
-      dataList: [] as any,
-      visiablePayment: false,
-      paymentOperation: 'add',
-      paymentData: {} as any
-    })
-    const dialog = useDialog()
-    const message = useMessage()
-
-    const columns = () => {
-      return [
-        {
-          title: '编号',
-          key: 'id'
-        },
-        {
-          title: '客户端类型',
-          key: 'clientId',
-          render(row: any) {
-            return filterClientType(row.clientId)
-          }
-        },
-        {
-          title: '消息类型',
-          key: 'messageType'
-        },
-        {
-          title: '消息跳转类型',
-          key: 'action'
-        },
-        {
-          title: '二级分类',
-          key: 'subType'
-        },
-        {
-          title: '消息组',
-          key: 'group',
-          render(row: any) {
-            return filterMessageGroup(row.group)
-          }
-        },
-        {
-          title: '消息是否发送',
-          key: 'sendFlag',
-          render(row: any) {
-            return row.sendFlag === 1 ? (
-              <NTag type="primary">发送</NTag>
-            ) : (
-              <NTag type="default">不发送</NTag>
-            )
-          }
-        },
-        {
-          title: '描述',
-          key: 'description'
-        },
-        {
-          title: '操作',
-          key: 'operation',
-          render(row: any) {
-            return (
-              <NSpace>
-                <NButton
-                  type="primary"
-                  size="small"
-                  text
-                  //v-auth="sysMessageConfig/update1597903931924926465"
-                  onClick={() => {
-                    state.visiablePayment = true
-                    state.paymentOperation = 'edit'
-                    state.paymentData = row
-                  }}
-                >
-                  修改
-                </NButton>
-                <NButton
-                  type="primary"
-                  size="small"
-                  text
-                  onClick={() => onRemove(row)}
-                  //v-auth="sysMessageConfig/remove1597904021058080770"
-                >
-                  删除
-                </NButton>
-              </NSpace>
-            )
-          }
-        }
-      ]
-    }
-
-    const onRemove = (row: any): void => {
-      dialog.warning({
-        title: '警告',
-        content: `是否删除?`,
-        positiveText: '确定',
-        negativeText: '取消',
-        onPositiveClick: async () => {
-          try {
-            await sysMessageConfigRemove({ id: row.id })
-            getList()
-            message.success('删除成功')
-          } catch {}
-        }
-      })
-    }
-
-    const getList = async () => {
-      try {
-        state.loading = true
-        const { data } = await sysMessageConfigPage({ ...state.pagination })
-        state.loading = false
-        state.pagination.pageTotal = Number(data.total)
-        state.dataList = data.rows || []
-      } catch {
-        state.loading = false
-      }
-    }
-
-    onMounted(() => {
-      getList()
-    })
-    return () => (
-      <>
-        <NSpace style="padding-bottom: 12px">
-          <NButton
-            type="primary"
-            //v-auth="sysMessageConfig/save1597903839524409345"
-            onClick={() => {
-              state.visiablePayment = true
-              state.paymentOperation = 'add'
-              state.paymentData = []
-            }}
-          >
-            新增
-          </NButton>
-        </NSpace>
-        <NDataTable loading={state.loading} columns={columns()} data={state.dataList}></NDataTable>
-        <Pagination
-          v-model:page={state.pagination.page}
-          v-model:pageSize={state.pagination.rows}
-          v-model:pageTotal={state.pagination.pageTotal}
-          onList={getList}
-          sync
-        ></Pagination>
-
-        <NModal
-          v-model:show={state.visiablePayment}
-          preset="dialog"
-          showIcon={false}
-          title={state.paymentOperation === 'add' ? '新增消息通知' : '修改消息通知'}
-          style={{ width: '800px' }}
-        >
-          <MessageOperation
-            type={state.paymentOperation}
-            data={state.paymentData}
-            onClose={() => (state.visiablePayment = false)}
-            onGetList={getList}
-          />
-        </NModal>
-      </>
-    )
-  }
-})

+ 0 - 401
src/views/system-manage/param-settings/component/other-rule.tsx

@@ -1,401 +0,0 @@
-import { deepClone } from '@/layout/components/Header/imkit/utils/utils'
-import { NAlert, NButton, NForm, NFormItemGi, NGrid, NInput, NSelect, useMessage } from 'naive-ui'
-import { defineComponent, onMounted, reactive, ref, shallowRef } from 'vue'
-import { sysParamConfigPage, sysParamConfigUpdate } from '../../api'
-import styles from './index.module.less'
-
-export default defineComponent({
-  name: 'other-rule',
-  setup() {
-    const forms = reactive({}) as any
-    const beforeData: any = ref({}) // 储存原始数据
-    const formsRef = ref()
-    const btnLoading = ref(false)
-    const message = useMessage()
-
-    const getList = async () => {
-      try {
-        const { data } = await sysParamConfigPage({ page: 1, rows: 999, group: 'OTHER' })
-
-        const rows = data.rows || []
-        rows.forEach((row: any) => {
-          forms[row.paramName] = row.paramValue
-        })
-        beforeData.value = { ...forms }
-      } catch {}
-    }
-
-    // 数组进行对比
-    const dataCompare = (beforeData: any, afterData: any) => {
-      const changeDate: any = []
-      for (let key in beforeData) {
-        if (beforeData[key] != afterData[key]) {
-          changeDate.push({
-            paramName: key,
-            paramValue: afterData[key]
-          })
-        }
-      }
-      return changeDate || []
-    }
-
-    const onSubmit = async () => {
-      formsRef.value.validate(async (errors: any) => {
-        if (errors) return
-
-        const submitData = dataCompare(beforeData.value, forms)
-        if (submitData && submitData.length > 0) {
-          btnLoading.value = true
-          try {
-            await sysParamConfigUpdate({ configs: [...submitData], group: 'OTHER' })
-            message.success('保存成功')
-            beforeData.value = { ...forms }
-          } catch (e) {
-            console.log(e)
-          }
-          btnLoading.value = false
-        } else {
-          message.success('保存成功')
-        }
-      })
-    }
-
-    onMounted(() => {
-      getList()
-    })
-    return () => (
-      <>
-        <NForm ref={formsRef} labelPlacement="left" model={forms} requireMarkPlacement="left">
-          <NAlert title="设备限制" showIcon={false} bordered={false} style="margin-bottom: 12px;" />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="教务端每个账号可登录"
-              path="school_device_num"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入设备数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['school_device_num']}>
-                {{ suffix: () => '台' }}
-              </NInput>
-              设备
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="学生端每个账号可登录"
-              path="student_device_num"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入设备数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['student_device_num']}
-              >
-                {{ suffix: () => '台' }}
-              </NInput>
-              设备
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="老师端每个账号可登录"
-              path="teacher_device_num"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入设备数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['teacher_device_num']}
-              >
-                {{ suffix: () => '台' }}
-              </NInput>
-              设备
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="后端账号登录异常"
-              path="backend_login_locked"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入次数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['backend_login_locked']}
-              >
-                {{ suffix: () => '次' }}
-              </NInput>
-              锁定
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="教务端账号登录异常"
-              path="school_login_locked"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入次数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['school_login_locked']}
-              >
-                {{ suffix: () => '次' }}
-              </NInput>
-              锁定
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="学生端账号登录异常"
-              path="student_login_locked"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入次数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['student_login_locked']}
-              >
-                {{ suffix: () => '次' }}
-              </NInput>
-              锁定
-            </NFormItemGi>
-          </NGrid>
-
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="老师端账号登录异常"
-              path="teacher_login_locked"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入次数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['teacher_login_locked']}
-              >
-                {{ suffix: () => '次' }}
-              </NInput>
-              锁定
-            </NFormItemGi>
-          </NGrid>
-
-          {/* <NAlert
-            title="学期开始时间"
-            showIcon={false}
-            bordered={false}
-            style="margin-bottom: 12px;"
-          />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="上学期开始时间"
-              path="last_term_time"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入上学期开始时间',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['last_term_time']}></NInput>
-            </NFormItemGi>
-          </NGrid>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="下学期开始时间"
-              path="next_term_time"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入下学期开始时间',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['next_term_time']}></NInput>
-            </NFormItemGi>
-          </NGrid> */}
-
-          <NAlert
-            title="课程最早开始和最晚结束时间"
-            showIcon={false}
-            bordered={false}
-            style="margin-bottom: 12px;"
-          />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="最早开始时间"
-              path="course_start_time"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入最早开始时间',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['course_start_time']}
-              ></NInput>
-            </NFormItemGi>
-          </NGrid>
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="最晚结束时间"
-              path="course_end_time"
-              rule={[
-                {
-                  required: true,
-                  message: '请输入最晚结束时间',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['course_end_time']}
-              ></NInput>
-            </NFormItemGi>
-          </NGrid>
-
-          <NAlert
-            title="二维码有效期"
-            showIcon={false}
-            bordered={false}
-            style="margin-bottom: 12px;"
-          />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="二维码过期时间"
-              path="qr_code_expire_hours"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入二维码过期时间',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput
-                class={[styles.w140, styles.mr14]}
-                v-model:value={forms['qr_code_expire_hours']}
-              >
-                {{ suffix: () => '小时' }}
-              </NInput>
-            </NFormItemGi>
-          </NGrid>
-
-          <NAlert
-            title="酷乐秀按钮设置"
-            showIcon={false}
-            bordered={false}
-            style="margin-bottom: 12px;"
-          />
-          <NGrid class={styles.pl13} cols={1}>
-            <NFormItemGi
-              label="是否开启酷乐秀"
-              path="clx_enable"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入天数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NSelect
-                class={styles.w140}
-                options={[
-                  {
-                    label: '启用',
-                    value: '1'
-                  },
-                  {
-                    label: '停用',
-                    value: '0'
-                  }
-                ]}
-                v-model:value={forms['clx_enable']}
-              />
-            </NFormItemGi>
-            <NFormItemGi
-              label="开启酷乐秀按钮后,学生上课"
-              path="clx_hidden_day"
-              rule={[
-                {
-                  required: true,
-                  pattern: /^\d+$/,
-                  message: '请输入天数',
-                  trigger: ['blur', 'input']
-                }
-              ]}
-            >
-              <NInput class={[styles.w140, styles.mr14]} v-model:value={forms['clx_hidden_day']}>
-                {{ suffix: () => '天' }}
-              </NInput>
-              后展示按钮
-            </NFormItemGi>
-          </NGrid>
-        </NForm>
-
-        <NButton
-          type="primary"
-          onClick={onSubmit}
-          loading={btnLoading.value}
-          //v-auth="sysParamConfig/update1597903200849350657"
-        >
-          保存设置
-        </NButton>
-      </>
-    )
-  }
-})

+ 0 - 168
src/views/system-manage/param-settings/component/payment-operation.tsx

@@ -1,168 +0,0 @@
-import { getMenus } from '@/api/system/menu'
-import { clientTypeArray, openTypeArray } from '@/utils/searchArray'
-import { SearchOutline } from '@vicons/ionicons5'
-import {
-  NForm,
-  NFormItem,
-  NInput,
-  NSpace,
-  NButton,
-  useMessage,
-  NRadioGroup,
-  NRadio,
-  NSelect
-} from 'naive-ui'
-import { defineComponent, onMounted, PropType, reactive, ref } from 'vue'
-import { sysPaymentConfigSave, sysPaymentConfigUpdate } from '../../api'
-export default defineComponent({
-  name: 'role-operation',
-  props: {
-    type: {
-      type: String,
-      default: 'add'
-    },
-    data: {
-      type: Object as PropType<any>,
-      default: () => {}
-    }
-  },
-  emits: ['close', 'getList'],
-  setup(props, { slots, attrs, emit }) {
-    const forms = reactive({
-      paramName: null,
-      paramValue: null,
-      clientType: null,
-      openType: null,
-      description: null
-    })
-    const btnLoading = ref(false)
-
-    const formsRef = ref()
-    const message = useMessage()
-
-    const onSubmit = async () => {
-      formsRef.value.validate(async (error: any) => {
-        if (error) return false
-        try {
-          btnLoading.value = true
-          if (props.type === 'add') {
-            await sysPaymentConfigSave({ ...forms })
-            message.success('添加成功')
-          } else if (props.type === 'edit') {
-            await sysPaymentConfigUpdate({ ...forms, id: props.data.id })
-            message.success('修改成功')
-          }
-
-          emit('close')
-          emit('getList')
-        } catch (e: any) {
-          console.log(e, 'e')
-        }
-        btnLoading.value = false
-      })
-    }
-
-    onMounted(async () => {
-      if (props.type === 'edit') {
-        const data = props.data
-        forms.paramName = data.paramName
-        forms.paramValue = data.paramValue
-        forms.clientType = data.clientType
-        forms.openType = data.openType
-        forms.description = data.description
-      }
-    })
-
-    return () => (
-      <div style="background: #fff; padding-top: 12px">
-        <NForm model={forms} ref={formsRef} label-placement="left" label-width="100">
-          <NFormItem
-            label="提供方"
-            path="openType"
-            rule={[
-              {
-                required: true,
-                message: '请输入提供方'
-              }
-            ]}
-          >
-            <NSelect
-              placeholder="请输入提供方"
-              v-model:value={forms.openType}
-              options={openTypeArray}
-            />
-          </NFormItem>
-          <NFormItem
-            label="客户端类型"
-            path="clientType"
-            rule={[
-              {
-                required: true,
-                message: '请输入客户端类型'
-              }
-            ]}
-          >
-            <NSelect
-              placeholder="请输入客户端类型"
-              v-model:value={forms.clientType}
-              options={clientTypeArray}
-            />
-          </NFormItem>
-          <NFormItem
-            label="参数名称"
-            path="paramName"
-            rule={[
-              {
-                required: true,
-                message: '请输入参数名称'
-              }
-            ]}
-          >
-            <NInput
-              v-model:value={forms.paramName}
-              placeholder="请输入参数名称"
-              clearable
-              maxlength={100}
-            ></NInput>
-          </NFormItem>
-          <NFormItem
-            label="参数值"
-            path="paramValue"
-            rule={[
-              {
-                required: true,
-                message: '请输入参数值'
-              }
-            ]}
-          >
-            <NInput
-              v-model:value={forms.paramValue}
-              placeholder="请输入参数值"
-              clearable
-              maxlength={100}
-            ></NInput>
-          </NFormItem>
-          <NFormItem label="备注" path="description">
-            <NInput
-              v-model:value={forms.description}
-              maxlength={180}
-              type="textarea"
-              rows={2}
-              placeholder="请输入备注"
-              clearable
-            />
-          </NFormItem>
-        </NForm>
-
-        <NSpace justify="end">
-          <NButton type="default" onClick={() => emit('close')}>
-            取消
-          </NButton>
-          <NButton type="primary" onClick={onSubmit} loading={btnLoading.value}>
-            保存
-          </NButton>
-        </NSpace>
-      </div>
-    )
-  }
-})

+ 0 - 167
src/views/system-manage/param-settings/component/payment-setting.tsx

@@ -1,167 +0,0 @@
-import SaveForm from '@/components/save-form'
-import Pagination from '@/components/pagination'
-import { NButton, NDataTable, NModal, NSpace, useDialog, useMessage } from 'naive-ui'
-import { defineComponent, onMounted, reactive, ref } from 'vue'
-import { sysPaymentConfigPage, sysPaymentConfigRemove } from '../../api'
-import { filterClientType, filterOpenType } from '@/utils/filters'
-import PaymentOperation from './payment-operation'
-
-export default defineComponent({
-  name: 'subsidy-list',
-  setup() {
-    const state = reactive({
-      loading: false,
-      pagination: {
-        page: 1,
-        rows: 10,
-        pageTotal: 0
-      },
-      dataList: [] as any,
-      visiablePayment: false,
-      paymentOperation: 'add',
-      paymentData: {} as any
-    })
-    const dialog = useDialog()
-    const message = useMessage()
-
-    const columns = () => {
-      return [
-        {
-          title: '编号',
-          key: 'id'
-        },
-        {
-          title: '提供方',
-          key: 'openType',
-          render(row: any) {
-            return filterOpenType(row.openType)
-          }
-        },
-        {
-          title: '客户端类型',
-          key: 'clientType',
-          render(row: any) {
-            return filterClientType(row.clientType)
-          }
-        },
-        {
-          title: '参数名称',
-          key: 'paramName'
-        },
-        {
-          title: '参数值',
-          key: 'paramValue'
-        },
-        {
-          title: '描述',
-          key: 'description'
-        },
-        {
-          title: '操作',
-          key: 'operation',
-          render(row: any) {
-            return (
-              <NSpace>
-                <NButton
-                  type="primary"
-                  size="small"
-                  text
-                  //v-auth="sysPaymentConfig/update1597903527669518338"
-                  onClick={() => {
-                    state.visiablePayment = true
-                    state.paymentOperation = 'edit'
-                    state.paymentData = row
-                  }}
-                >
-                  修改
-                </NButton>
-                <NButton
-                  type="primary"
-                  size="small"
-                  text
-                  onClick={() => onRemove(row)}
-                  //v-auth="sysPaymentConfig/remove1597903613933768705"
-                >
-                  删除
-                </NButton>
-              </NSpace>
-            )
-          }
-        }
-      ]
-    }
-
-    const onRemove = (row: any): void => {
-      dialog.warning({
-        title: '警告',
-        content: `是否删除?`,
-        positiveText: '确定',
-        negativeText: '取消',
-        onPositiveClick: async () => {
-          try {
-            await sysPaymentConfigRemove({ id: row.id })
-            getList()
-            message.success('删除成功')
-          } catch {}
-        }
-      })
-    }
-
-    const getList = async () => {
-      try {
-        state.loading = true
-        const { data } = await sysPaymentConfigPage({ ...state.pagination })
-        state.loading = false
-        state.pagination.pageTotal = Number(data.total)
-        state.dataList = data.rows || []
-      } catch {
-        state.loading = false
-      }
-    }
-
-    onMounted(() => {
-      getList()
-    })
-    return () => (
-      <>
-        <NSpace style="padding-bottom: 12px">
-          <NButton
-            type="primary"
-            //v-auth="sysPaymentConfig/save1597903459457552386"
-            onClick={() => {
-              state.visiablePayment = true
-              state.paymentOperation = 'add'
-              state.paymentData = []
-            }}
-          >
-            新增
-          </NButton>
-        </NSpace>
-        <NDataTable loading={state.loading} columns={columns()} data={state.dataList}></NDataTable>
-        <Pagination
-          v-model:page={state.pagination.page}
-          v-model:pageSize={state.pagination.rows}
-          v-model:pageTotal={state.pagination.pageTotal}
-          onList={getList}
-          sync
-          saveKey="payemnt-setting"
-        ></Pagination>
-
-        <NModal
-          v-model:show={state.visiablePayment}
-          preset="dialog"
-          showIcon={false}
-          title={state.paymentOperation === 'add' ? '新增支付参数' : '修改支付参数'}
-          style={{ width: '550px' }}
-        >
-          <PaymentOperation
-            type={state.paymentOperation}
-            data={state.paymentData}
-            onClose={() => (state.visiablePayment = false)}
-            onGetList={getList}
-          />
-        </NModal>
-      </>
-    )
-  }
-})

+ 100 - 0
src/views/system-manage/param-settings/component/project-setting.tsx

@@ -0,0 +1,100 @@
+import {NButton, NForm, NFormItemGi, NGrid, NInputNumber, useMessage} from 'naive-ui'
+import {defineComponent, onMounted, reactive, ref} from 'vue'
+import {sysParamConfigQueryByParamName, sysParamConfigUpdate} from "@views/system-manage/param-settings/api";
+
+export default defineComponent({
+  name: 'project-param-setting',
+  props: {
+    appKey: {
+      type: String,
+      default: 'KT'
+    }
+  },
+  setup(props) {
+    const forms = reactive({
+      id: null as any,
+      paramValue: null as any,
+      group: null as any,
+    }) as any
+    const formsRef = ref()
+    const btnLoading = ref(false)
+    const message = useMessage()
+
+    const paramName = (() => {
+      return props.appKey.toLowerCase() + '_frequency' as any
+    })
+
+    onMounted(async () => {
+      const {data} = await sysParamConfigQueryByParamName(paramName());
+      if (data) {
+        forms.id = data.id
+        forms.paramValue = parseInt(data.paramValue)
+        forms.group = data.group
+      }else {
+        message.error("加载配置参数失败");
+      }
+    })
+
+
+    const onSubmit = async () => {
+      const param = {
+        group: forms.group,
+        configs: [
+          {
+            ...forms
+          }
+        ]
+      }
+      btnLoading.value = true
+      try {
+        const res = await sysParamConfigUpdate(param) as any
+        if (res && res.code == '200') {
+          message.success('保存成功')
+        }
+      } catch (err) {
+
+      }
+      btnLoading.value = false
+    }
+
+    return () => (
+        <>
+          <NForm labelPlacement="left" model={forms} requireMarkPlacement="left" ref={formsRef}>
+            <NGrid cols={1}>
+              <NFormItemGi
+                  label="评测频率"
+                  path="scope_of_attendance"
+                  rule={[
+                    {
+                      required: false,
+                      message: '请输入评测频率',
+                      trigger: ['blur', 'input']
+                    }
+                  ]}
+              >
+                <NInputNumber
+                    placeholder="请输入评测频率"
+                    showButton={false}
+                    min="0"
+                    max="99999"
+                    v-model:value={forms.paramValue}
+                    // v-slots={{
+                    //   suffix: () => 's(秒)'
+                    // }}
+                />
+              </NFormItemGi>
+            </NGrid>
+          </NForm>
+
+          <NButton
+              type="primary"
+              onClick={onSubmit}
+              loading={btnLoading.value}
+              //v-auth="sysParamConfig/update1597903049401421825"
+          >
+            保存设置
+          </NButton>
+        </>
+    )
+  }
+})

+ 51 - 68
src/views/system-manage/param-settings/index.tsx

@@ -1,19 +1,18 @@
-import { NTabPane, NTabs } from 'naive-ui'
-import { defineComponent, reactive } from 'vue'
-import { useRoute } from 'vue-router'
-import AttendanceRule from './component/attendance-rule'
-import FinanceRule from './component/finance-rule'
-import LeaveCategory from './component/leave-category'
-import MessageSetting from './component/message-setting'
-import OtherRule from './component/other-rule'
-import PaymentSetting from './component/payment-setting'
-import Memberfee from './component/member-fee'
-import { getTabsCache, setTabsCaches } from '@/hooks/use-async'
+import {NTabPane, NTabs} from 'naive-ui'
+import {defineComponent, h, onMounted, reactive} from 'vue'
+import {useRoute} from 'vue-router'
+import {getTabsCache, setTabsCaches} from '@/hooks/use-async'
+import {appKey} from "@/utils/constant";
+import {sysApplicationPage} from "@views/menu-manage/api";
+import ProjectSetting from "@views/system-manage/param-settings/component/project-setting";
+
 export default defineComponent({
   name: 'param-settings',
   setup() {
     const state = reactive({
-      tabName: 'attendance' as 'attendance' | 'finance' | 'other' | 'payment' | 'message' | 'leave'
+      tabName: 'KT' as 'KT' | 'GYT' | 'KLX' | 'GYM',
+      appKeyList: [] as any,
+      appNameList: [] as any,
     })
     const route = useRoute()
     getTabsCache((val: any) => {
@@ -24,67 +23,51 @@ export default defineComponent({
     const setTabs = (val: any) => {
       setTabsCaches(val, 'tabName', route)
     }
+
+    onMounted(async () => {
+      // 获取应用APP信息
+      {
+        const appKeys = Object.keys(appKey);
+        const {data} = await sysApplicationPage({page: 1, rows: 99, parentId: 0})
+        const tempList = data.rows || []
+        tempList.forEach((next: any) => {
+          if (appKeys.includes(next.appKey)) {
+            state.appKeyList.push(next.appKey)
+            state.appNameList.push(next.appName)
+          }
+        })
+      }
+    })
+
     return () => {
       return (
-        <div class="system-menu-container">
-          <h2>参数设置</h2>
+          <div class="system-menu-container">
+            <h2>参数设置</h2>
 
-          <div class={['section-container']} style="padding-top: 0">
-            <NTabs
-              type="line"
-              size="large"
-              v-model:value={state.tabName}
-              onUpdate:value={(val: any) => setTabs(val)}
-            >
-              <NTabPane
-                name="attendance"
-                tab="考勤规则"
-                //v-auth="sysParamConfig/page1597901894499815425"
-              >
-                <AttendanceRule />
-              </NTabPane>
-              <NTabPane
-                name="finance"
-                tab="财务规则"
-                //v-auth="sysParamConfig/page1597902460701495297"
-              >
-                <FinanceRule />
-              </NTabPane>
-              <NTabPane name="other" tab="其它参数" //v-auth="sysParamConfig/page1597902586396397570"
-              >
-                <OtherRule />
-              </NTabPane>
-              {/* <NTabPane
-                name="payment"
-                tab="支付参数"
-                v-auth="sysPaymentConfig/page1597902712028385281"
-              >
-                <PaymentSetting />
-              </NTabPane> */}
-              <NTabPane
-                name="message"
-                tab="消息通知设置"
-                //v-auth="sysMessageConfig/page1597902847743479810"
-              >
-                <MessageSetting />
-              </NTabPane>
-              <NTabPane
-                name="leave"
-                tab="请假类型"
-                //v-auth="sysMessageConfig/page1597902847743479810"
-              >
-                <LeaveCategory />
-              </NTabPane>
-              <NTabPane
-                name="member"
-                tab="会员价格配置"
-                //v-auth="vipPriceSettings/page1623234661835988994"
+            <div class={['section-container']} style="padding-top: 0">
+              <NTabs
+                  type="line"
+                  size="large"
+                  v-model:value={state.tabName}
+                  onUpdate:value={(val: any) => setTabs(val)}
               >
-                <Memberfee />
-              </NTabPane>
-            </NTabs>
+                {state.appKeyList.map((app: any, index: number) => {
+                  return h(
+                      NTabPane,
+                      {
+                        name: app,
+                        tab: state.appNameList[index]
+                      },
+                      {
+                        default: () => {
+                          return h(ProjectSetting, {'appKey': app})
+                        }
+                      }
+                  )
+                })}
+              </NTabs>
+            </div>
           </div>
-        </div>
       )
     }
   }