Browse Source

fix: 数据定义修改

wanggaokun 1 năm trước cách đây
mục cha
commit
3ced8d2f8d

+ 2 - 0
src/components/Upload/Imgs.vue

@@ -221,6 +221,7 @@ const handleRemove = (file: UploadFile) => {
  * @description 图片上传错误
  * */
 const uploadError = () => {
+  tryHideFullScreenLoading()
   ElMessage.error('图片上传失败,请您重新上传!')
 }
 
@@ -228,6 +229,7 @@ const uploadError = () => {
  * @description 文件数超出
  * */
 const handleExceed = () => {
+  tryHideFullScreenLoading()
   ElMessage.warning(`当前最多只能上传 ${props.limit} 张图片,请移除后上传!`)
 }
 

+ 3 - 1
src/components/Upload/ImgsS3.vue

@@ -194,8 +194,8 @@ const uploadedSuccessfully = () => {
     uploadList.value = []
     number.value = 0
     emit('update:modelValue', listToString(_fileList.value))
-    tryHideFullScreenLoading()
   }
+  tryHideFullScreenLoading()
   // 监听表单验证
   formItemContext?.prop && formContext?.validateField([formItemContext.prop as string])
 }
@@ -221,6 +221,7 @@ const handleRemove = (file: UploadFile) => {
  * @description 图片上传错误
  * */
 const uploadError = () => {
+  tryHideFullScreenLoading()
   ElMessage.error('图片上传失败,请您重新上传!')
 }
 
@@ -228,6 +229,7 @@ const uploadError = () => {
  * @description 文件数超出
  * */
 const handleExceed = () => {
+  tryHideFullScreenLoading()
   ElMessage.warning(`当前最多只能上传 ${props.limit} 张图片,请移除后上传!`)
 }
 

+ 1 - 1
src/components/UploadDialog/index.vue

@@ -46,7 +46,7 @@ const _options: ComputedRef<ProForm.FormOptions> = computed(() => {
     disabled: false
   }
 })
-let itemsOptions: ProForm.ItemsOptions[] = []
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
   itemsOptions = [
     {

+ 2 - 2
src/views/index.vue

@@ -77,7 +77,7 @@ const enumData = [
     value: '3'
   }
 ]
-let items: ProForm.ItemsOptions[] = [
+let items = reactive<ProForm.ItemsOptions[]>([
   {
     label: '单行输入框',
     prop: 'username',
@@ -236,7 +236,7 @@ let items: ProForm.ItemsOptions[] = [
       elTagName: 'slot'
     }
   }
-]
+])
 </script>
 
 <style scoped lang="scss"></style>

+ 3 - 3
src/views/system/dept/index.vue

@@ -68,7 +68,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
   // 重置表单项
   setItemsOptions()
   if (row?.parentId == 0 && type == 2) {
-    itemsOptions.value.splice(0, 1)
+    itemsOptions.splice(0, 1)
   }
   // 增加子节点
   if (type == 4) {
@@ -122,9 +122,9 @@ const columns = reactive<ColumnProps<any>[]>([
 ])
 
 // 表单配置项
-let itemsOptions = ref<ProForm.ItemsOptions[]>([])
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
-  itemsOptions.value = [
+  itemsOptions = [
     {
       label: '上级部门',
       prop: 'parentId',

+ 2 - 2
src/views/system/dict/data.vue

@@ -157,9 +157,9 @@ const columns = reactive<ColumnProps<any>[]>([
 ])
 
 // 表单配置项
-let itemsOptions = ref<ProForm.ItemsOptions[]>([])
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
-  itemsOptions.value = [
+  itemsOptions = [
     {
       label: '标签类型',
       prop: 'dictType',

+ 2 - 2
src/views/system/dict/index.vue

@@ -138,9 +138,9 @@ const columns = reactive<ColumnProps<any>[]>([
 ])
 
 // 表单配置项
-let itemsOptions = ref<ProForm.ItemsOptions[]>([])
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
-  itemsOptions.value = [
+  itemsOptions = [
     {
       label: '字典名称',
       prop: 'dictName',

+ 3 - 3
src/views/system/oss/config.vue

@@ -66,7 +66,7 @@ const batchDelete = async (ids: string[]) => {
 }
 // 切换用户状态
 const changeStatus = async (row: OssConfigVO) => {
-  let text = row.status === '1' ? '启用' : '停用'
+  let text = row.status === '0' ? '启用' : '停用'
   await useHandleData(
     changeOssConfigStatusApi,
     { ossConfigId: row.ossConfigId, version: row.version, status: row.status == '1' ? 0 : 1, configKey: row.configKey },
@@ -182,9 +182,9 @@ const columns = reactive<ColumnProps<any>[]>([
   { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
 ])
 // 表单配置项
-let itemsOptions = ref<ProForm.ItemsOptions[]>([])
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
-  itemsOptions.value = [
+  itemsOptions = [
     {
       label: '配置key',
       prop: 'configKey',

+ 4 - 4
src/views/system/role/index.vue

@@ -405,9 +405,9 @@ const columns = reactive<ColumnProps<any>[]>([
       return (
         <el-switch
           model-value={scope.row.status}
-          active-text={scope.row.status === '1' ? '禁用' : '启用'}
-          active-value={'0'}
-          inactive-value={'1'}
+          active-text={scope.row.status === '0' ? '禁用' : '启用'}
+          active-value={'1'}
+          inactive-value={'0'}
           onClick={() => changeStatus(scope.row)}
         />
       )
@@ -430,7 +430,7 @@ let _options = ref<ProForm.FormOptions>({
 })
 
 // 表单配置项
-let itemsOptions: ProForm.ItemsOptions[] = []
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
   itemsOptions = [
     {

+ 3 - 3
src/views/system/user/index.vue

@@ -160,7 +160,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
   // 表单项配置
   setItemsOptions()
   if (type == 1) {
-    itemsOptions.value.splice(
+    itemsOptions.splice(
       4,
       0,
       {
@@ -242,9 +242,9 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
   { prop: 'operation', label: '操作', width: 240, fixed: 'right' }
 ])
 // 表单配置项
-let itemsOptions = ref<ProForm.ItemsOptions[]>([])
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
 const setItemsOptions = () => {
-  itemsOptions.value = [
+  itemsOptions = [
     {
       label: '用户昵称',
       span: 12,

+ 5 - 5
src/views/system/user/profile/index.vue

@@ -131,8 +131,7 @@ const _options: ProForm.FormOptions = {
   showCancelButton: true,
   cancelButtonText: '关闭'
 }
-// 表单配置项
-let itemsOptions: ProForm.ItemsOptions[] = [
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([
   {
     label: '用户昵称',
     prop: 'nickName',
@@ -167,8 +166,9 @@ let itemsOptions: ProForm.ItemsOptions[] = [
       placeholder: '请输入邮箱'
     }
   }
-]
-let itemsOptions1: ProForm.ItemsOptions[] = [
+])
+// 表单配置项
+let itemsOptions1 = reactive<ProForm.ItemsOptions[]>([
   {
     label: '旧密码',
     prop: 'oldPassword',
@@ -208,7 +208,7 @@ let itemsOptions1: ProForm.ItemsOptions[] = [
       placeholder: '请输入新密码'
     }
   }
-]
+])
 onMounted(() => {
   getUser()
 })