li.shaoyi 8 månader sedan
förälder
incheckning
de5028a5a5

+ 6 - 3
src/packages/pc/views/investor/manage/modification/components/audit/index.vue

@@ -1,6 +1,6 @@
 <!-- 交易商管理-交易商管理-交易商管理-审核 -->
 <template>
-    <DetailsView v-bind="{ userId: record.userid, modifyStatus: record.modifystatus }">
+    <DetailsView ref="detailsRef" v-bind="{ userId: record.userid, modifyStatus: record.modifystatus }">
         <el-button type="primary" @click="openComponent('Operate')">{{ t('operation.aduit') }}</el-button>
         <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
             v-if="componentId" />
@@ -8,7 +8,7 @@
 </template>
 
 <script lang="ts" setup>
-import { PropType,defineAsyncComponent } from 'vue'
+import { shallowRef, PropType, defineAsyncComponent } from 'vue'
 import { useComponent } from '@/hooks/component'
 import DetailsView from '@pc/views/investor/manage/user/components/details/view.vue'
 import { i18n } from '@/stores'
@@ -21,10 +21,13 @@ defineProps({
 })
 
 const { global: { t } } = i18n
+const detailsRef = shallowRef()
 
 const componentMap = new Map<string, unknown>([
     ['Operate', defineAsyncComponent(() => import('./operate/index.vue'))], // 操作
 ])
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    detailsRef.value?.close(true)
+})
 </script>

+ 6 - 2
src/packages/pc/views/investor/manage/user/components/details/view.vue

@@ -50,7 +50,7 @@
             </template>
         </app-table-details>
         <template #footer>
-            <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
+            <el-button @click="close(false)">{{ t('operation.close') }}</el-button>
             <slot></slot>
         </template>
     </app-drawer>
@@ -208,8 +208,12 @@ const detailProps2 = computed<CellProp[]>(() => {
     return []
 })
 
-const onCancel = (isRefresh = false) => {
+const close = (isRefresh = false) => {
     show.value = false
     refresh.value = isRefresh
 }
+
+defineExpose({
+    close
+})
 </script>

+ 38 - 120
src/packages/pc/views/member/institution/role/components/details/index.vue

@@ -1,152 +1,70 @@
 <!-- 会员机构管理-机构管理-系统角色管理-详情 -->
 <template>
-    <app-drawer :title="t('admin.role.edit.title')" width="680" v-model:show="show" :refresh="refresh"
-        :loading="loading">
-        <el-form ref="formRef" class="el-form--vertical" label-width="90px" :model="formData" :rules="formRules">
-            <el-form-item :label="t('admin.role.edit.rolename')" prop="rolename">
-                <el-input v-model="formData.rolename" :placeholder="t('common.pleaseenter')"
-                    :disabled="!!record?.autoid" />
-            </el-form-item>
-            <el-form-item :label="t('admin.role.edit.sensitivefields')" prop="sensitivefields">
-                <el-checkbox-group v-model="checkedValue">
-                    <el-checkbox :label="t('admin.role.edit.mobilephone')" value="1" />
-                    <el-checkbox :label="t('admin.role.edit.cardtypeid')" value="2" />
-                    <el-checkbox :label="t('admin.role.edit.email')" value="3" />
-                </el-checkbox-group>
-            </el-form-item>
-            
-            <el-form-item :label="t('admin.role.edit.menuids')" prop="menuids">
+    <app-drawer :title="t('admin.role.edit.title')" width="680" v-model:show="show" :loading="loading">
+        <app-table-details :data="data" :label-width="120" :cell-props="detailProps" :column="1">
+            <template #sensitivefields>
+                {{ getSensitiveWords() }}
+            </template>
+            <template #menuids>
                 <el-scrollbar max-height="300px" style="width: 100%;">
-                    <el-tree ref="treeRef" :data="routerStore.userRoutes" :props="{ label: 'title' }"
-                        node-key="resourceCode" show-checkbox check-strictly @check="handleCheck" />
+                    <el-tree :data="routerStore.userRoutes" :props="{ label: 'title' }" node-key="resourceCode" />
                 </el-scrollbar>
-            </el-form-item>
-        </el-form>
+            </template>
+        </app-table-details>
         <template #footer>
-            <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
-            <el-button type="primary" @click="onSubmit">{{ t('operation.submit') }}</el-button>
+            <el-button @click="onCancel">{{ t('operation.cancel') }}</el-button>
         </template>
     </app-drawer>
 </template>
 
 <script lang="ts" setup>
-import { ref, PropType, toRaw, onMounted } from 'vue'
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
-import type Node from 'element-plus/es/components/tree/src/model/node'
+import { ref, PropType } from 'vue'
+import { ElMessage } from 'element-plus'
 import { useRequest } from '@/hooks/request'
-import { dealRoleMenus, queryDetail } from '@/services/api/admin'
+import { queryDetail } from '@/services/api/admin'
 import { useRouterStore, i18n } from '@/stores'
+import { CellProp } from '@pc/components/base/table-details/types'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
 
 const props = defineProps({
     record: {
-        type: Object as PropType<Model.RoleRsp>
+        type: Object as PropType<Model.RoleRsp>,
+        required: true
     }
 })
 
-const routerStore = useRouterStore()
-const treeRef = ref()
 const { global: { t } } = i18n
-const formRef = ref<FormInstance>()
+const routerStore = useRouterStore()
 const show = ref(true)
-const refresh = ref(false)
-const checkedValue = ref<string[]>([])
-
-const formData = ref<Partial<Model.RoleRsp>>({})
 
-const { loading, run } = useRequest(queryDetail, {
-    manual: true,
-    onSuccess: ((res) => {
-        // const isPrefixOfAny = (str: string, arr: string[]) => {
-        //     // 检查str是否是arr中其他元素(以下划线分隔的部分)的前缀
-        //     return arr.some((item) => {
-        //         // 排除str本身,并将两个字符串分割成数组进行比较
-        //         if (item === str) return false
-        //         const strParts = str.split('_')
-        //         const itemParts = item.split('_')
-        //         return itemParts.length >= strParts.length && strParts.every((part, index) => part === itemParts[index])
-        //     })
-        // }
+const getSensitiveWords = () => {
+    const options = [
+        { label: t('admin.role.edit.mobilephone'), value: 1 },
+        { label: t('admin.role.edit.cardtypeid'), value: 2 },
+        { label: t('admin.role.edit.email'), value: 3 }
+    ]
+    const checkedValues = data.value?.sensitivefields.split(',') ?? []
+    const selectedOptions = options.filter((e) => checkedValues.includes(e.value.toString()))
+    return selectedOptions.map((e) => e.label).join(',')
+}
 
-        // // 过滤出不是其他元素前缀的元素
-        // const checkedKeys = res.data.menuids.filter((item) => !isPrefixOfAny(item, res.data.menuids))
-        res.data.menuids.forEach((val) => {
-            treeRef.value.setChecked(val, true, false)
-        })
-        formData.value = res.data
-        checkedValue.value = res.data.sensitivefields.split(',')
-    }),
+const { data, loading } = useRequest(queryDetail, {
+    params: {
+        autoId: props.record.autoid
+    },
     onError: (err) => {
         ElMessage.error(err)
     }
 })
 
-// 表单验证规则
-const formRules: FormRules = {
-    rolename: [{ required: true }],
-}
-
-const handleCheck = (data: Model.MenusRsp, state: { checkedKeys: string[] }) => {
-    if (state.checkedKeys.includes(data.resourceCode)) {
-        const node = treeRef.value.getNode(data.resourceCode)
-        selectChildren(data, true)
-        parentNodesChange(node)
-    } else {
-        selectChildren(data, false)
-    }
-}
-
-// 选择子节点
-const selectChildren = (data: Model.MenusRsp, checked: boolean) => {
-    data && data.children && data.children.map((item) => {
-        treeRef.value.setChecked(item.resourceCode, checked)
-        if (data.children) {
-            selectChildren(item, checked)
-        }
-    })
-}
+const detailProps: CellProp[] = [
+    { prop: 'rolename', label: t('admin.role.edit.rolename') },
+    { prop: 'sensitivefields', label: t('admin.role.edit.sensitivefields') },
+    { prop: 'menuids', label: t('admin.role.edit.menuids') },
+]
 
-// 选中父节点
-const parentNodesChange = (node: Node) => {
-    if (node.parent) {
-        treeRef.value.setChecked(node, true)
-        if (node.id > 0) {
-            parentNodesChange(node.parent)
-        }
-    }
-}
-
-const onCancel = (isRefresh = false) => {
+const onCancel = () => {
     show.value = false
-    refresh.value = isRefresh
-}
-
-const onSubmit = () => {
-    formRef.value?.validate((valid) => {
-        if (valid) {
-            const rawData = toRaw(formData.value)
-            rawData.sensitivefields = checkedValue.value.join(',')
-            rawData.menuids = treeRef.value.getCheckedKeys()
-            loading.value = true
-            dealRoleMenus({
-                data: rawData
-            }).then(() => {
-                ElMessage.success(t('common.tips3'))
-                onCancel(true)
-            }).catch((err) => {
-                ElMessage.error(t('common.tips4') + err)
-            }).finally(() => {
-                loading.value = false
-            })
-        }
-    })
 }
-
-onMounted(() => {
-    const autoId = props.record?.autoid
-    if (autoId) {
-        run({ autoId })
-    }
-})
-
 </script>

+ 6 - 3
src/packages/pc/views/member/institution/role/index.vue

@@ -8,7 +8,8 @@
             </template>
             <!-- 操作 -->
             <template #operate="{ row }">
-                <app-operation size="small" :data-list="getActionButtons(['member_institution_role_details', 'member_institution_role_users',])"
+                <app-operation size="small"
+                    :data-list="getActionButtons(['member_institution_role_details', 'member_institution_role_users',])"
                     @click="(code: string) => openComponent(code, row)" circle />
             </template>
             <template #footer>
@@ -25,6 +26,7 @@
 import { shallowRef } from 'vue'
 import { ElMessage } from 'element-plus'
 import { formatDate } from '@/filters'
+import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
 import { useOperation } from '@/hooks/operation'
 import { queryRole } from '@/services/api/admin'
@@ -32,6 +34,8 @@ import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
+const userstatusEnum = useEnum('userstatus') // 状态
+
 const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Model.RoleRsp>({
     onClose: () => onRefresh()
 })
@@ -48,11 +52,10 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryR
 })
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
-    { field: 'autoid', label: 'member.institution.role.autoid' },
     { field: 'rolename', label: 'member.institution.role.rolename' },
     { field: 'modifiername', label: 'member.institution.role.modifiername' },
     { field: 'modifytime', label: 'member.institution.role.modifytime' },
-    { field: 'rolestatus', label: 'member.institution.role.rolestatus' },
+    { field: 'rolestatus', label: 'member.institution.role.rolestatus', formatValue: (val) => userstatusEnum.getEnumTypeName(val) },
     { field: 'operate', label: 'common.operate', fixed: 'right' }
 ])
 

+ 3 - 3
src/packages/pc/views/notice/manage/components/audit/index.vue

@@ -1,6 +1,6 @@
 <!-- 通知公告-公告通知管理-审核 -->
 <template>
-    <Details ref="detailsRef" v-bind="{ record }" :loading="loading">
+    <DetailsView ref="detailsRef" v-bind="{ record }" :loading="loading">
         <el-button type="primary" @click="showDialog(1)">审核通过</el-button>
         <el-button type="primary" @click="showDialog(0)">审核不通过</el-button>
         <el-dialog v-model="dialogVisible" :title="formData.auditflag === 1 ? '提示' : ''" :width="480" append-to-body
@@ -17,14 +17,14 @@
                 <el-button type="primary" @click="onSubmit">提交</el-button>
             </template>
         </el-dialog>
-    </Details>
+    </DetailsView>
 </template>
 
 <script lang="ts" setup>
 import { reactive, shallowRef, PropType } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { auditinform } from '@/services/api/notice'
-import Details from '../details/index.vue'
+import DetailsView from '../details/index.vue'
 
 const props = defineProps({
     record: {

+ 2 - 2
src/packages/pc/views/notice/manage/index.vue

@@ -25,7 +25,7 @@
                     @change="onSearch" />
             </template>
         </app-table>
-        <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
+        <component :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
             v-if="componentId" />
     </app-view>
 </template>
@@ -78,7 +78,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'operate', label: 'common.operate', fixed: 'right', width: 200 }
 ])
 
-const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.QueryReq>({
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.QueryReq>({
     filters: [
         {
             field: 'title',

+ 2 - 2
src/packages/pc/views/notice/newscolumn/index.vue

@@ -20,7 +20,7 @@
                     @change="onSearch" />
             </template>
         </app-table>
-        <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
+        <component :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
             v-if="componentId" />
     </app-view>
 </template>
@@ -67,7 +67,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'operate', label: 'common.operate', fixed: 'right' }
 ])
 
-const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.ColumnQueryReq>({
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.ColumnQueryReq>({
     filters: [
         {
             field: 'columntype',

+ 2 - 2
src/packages/pc/views/notice/newssource/index.vue

@@ -24,7 +24,7 @@
                     @change="onSearch" />
             </template>
         </app-table>
-        <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
+        <component :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
             v-if="componentId" />
     </app-view>
 </template>
@@ -66,7 +66,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'operate', label: 'common.operate', fixed: 'right' }
 ])
 
-const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.ColumnSourceQueryReq>({
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.ColumnSourceQueryReq>({
     filters: [
         {
             field: 'smembername',

+ 3 - 3
src/packages/pc/views/query/other/esign/index.vue

@@ -10,7 +10,7 @@
                     @change="onSearch" />
             </template>
         </app-table>
-        <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
+        <component :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
             v-if="componentId" />
     </app-view>
 </template>
@@ -63,7 +63,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'operate', label: 'common.operate', fixed: 'right' }
 ])
 
-const { filterOption, queryParams, getQueryParams, resetFilters } = useDataFilter<Model.SignRecordReq>({
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.SignRecordReq>({
     filters: [
         {
             field: 'userid',
@@ -72,7 +72,7 @@ const { filterOption, queryParams, getQueryParams, resetFilters } = useDataFilte
         },
         {
             field: 'recordstatus',
-            label:  t('query.other.esign.recordstatus'),
+            label: t('query.other.esign.recordstatus'),
             placeholder: t('query.other.esign.tips2'),
             options: () => getEnumOptions()
         }

+ 1 - 2
src/packages/pc/views/system/operation_log/index.vue

@@ -10,7 +10,7 @@
                     @change="onSearch" />
             </template>
         </app-table>
-        <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
+        <component :is="componentMap.get(componentId)" v-bind="{ record }" @closed="closeComponent"
             v-if="componentId" />
     </app-view>
 </template>
@@ -31,7 +31,6 @@ import { i18n } from '@/stores'
 
 const { global: { t } } = i18n
 
-const queryParams = shallowRef<Model.SystemLogReq>()
 const { filterOptons, getQueryParams } = useDataFilter<Model.SystemLogReq>()
 const userStore = useUserStore()
 

+ 35 - 0
src/services/api/notice/index.ts

@@ -118,4 +118,39 @@ export function columnsourcedelete(options: CommonFetchOptions<{ request: Notice
  */
 export function informManquery(options: CommonFetchOptions<{ request: Notice.InformManqueryReq; response: Notice.InformManqueryRsp[]; }>) {
     return httpClient.commonRequest('/notice/informManquery', 'get', options)
+}
+
+/**
+ * 通知公告-->资讯管理-->初始化类型列表
+ */
+export function informManinit(options: CommonFetchOptions<{ response: Notice.InformManinitRsp; }>) {
+    return httpClient.commonRequest('/notice/informManinit', 'get', options)
+}
+
+/**
+ * 通知公告-->资讯管理-->新增/修改
+ */
+export function dealinform(options: CommonFetchOptions<{ request: Partial<Notice.DealInformReq>; }>) {
+    return httpClient.commonRequest('/notice/dealinform', 'post', options)
+}
+
+/**
+ * 通知公告-->资讯管理-->详情
+ */
+export function informDetail(options: CommonFetchOptions<{ request: Notice.InformDetailReq; response: Notice.InformDetailRsp; }>) {
+    return httpClient.commonRequest('/notice/informDetail', 'get', options)
+}
+
+/**
+ * 通知公告-->资讯管理-->展示/不展示
+ */
+export function isshow(options: CommonFetchOptions<{ response: Notice.IsShowReq; }>) {
+    return httpClient.commonRequest('/notice/isshow', 'get', options)
+}
+
+/**
+ * 通知公告-->资讯管理-->删除
+ */
+export function deleteinform(options: CommonFetchOptions<{ response: Notice.DeleteInformReq; }>) {
+    return httpClient.commonRequest('/notice/deleteinform', 'get', options)
 }

+ 99 - 0
src/types/model/notice.d.ts

@@ -216,4 +216,103 @@ declare namespace Notice {
         status: number; // 状态
         title: string; // 标题
     }
+
+    /** 通知公告-->资讯管理-->初始化类型列表 响应 */
+    interface InformManinitRsp {
+        gzMemberinfo: {
+            contactname: string; // 联系人
+            contactphone: string; // 电话
+            contactwx: string; // 微信号
+            imageurl: string; // 图片地址来源LOGO
+            memberid: number; // 会员ID(SEQ_GZ_MEMBERINFO)
+            membername: string; // 会员名称来源名称
+            membertags: string; // 标签(逗号分隔)来源网址
+            orderindex: number; // 显示顺序
+            updatetime: string; // 更新时间
+        }[];
+        siteColumnconfig: {
+            columnname: string; // 栏目名称
+            columntype: number; // 栏目类型 - 1:行情资讯 10:会员服务 30:关于我们 100:核心企业栏目-百色
+            creaedate: string; // 创建时间
+            creatorid: number; // 创建人
+            creatoruser: string;
+            id: number; // ID(SEQ_SITE_COLUMNCONFIG)
+            isshow: number; // 是否展示 - 0:不展示 1:展示
+            modifierid: number; // 操作人
+            modifieruser: string;
+            sort: number; // 排序
+            updatedate: string; // 修改时间
+        }[];
+    }
+
+    /** 通知公告-->资讯管理-->新增/修改 请求 */
+    interface DealInformReq {
+        author: string; // 作者
+        brief: string; // 简介
+        columnid: number; // 所属栏目
+        columnname: string;
+        columntype: number;
+        context: string; // 内容
+        coverimage: string; // 封面图片
+        creaedate: string; // 创建时间
+        creatorid: number; // 创建人
+        creatoruser: string;
+        hits: number; // 点击数
+        id: number; // ID(SEQ_SITE_COLUMNDETAIL)
+        isshow: number; // 是否展示 - 0:不展示 1:展示
+        istop: number; // 是否置顶 - 0:不置 1:置顶
+        modifierid: number; // 操作人
+        modifieruser: string;
+        publishdate: string; // 发布日期
+        publishdate2: string;
+        srcid: number; // 来源ID
+        srcname: string;
+        status: number; // 状态 - 1:暂存 10:待审核 20:审核通过 30:审核拒绝
+        title: string; // 标题
+        updatedate: string; // 修改时间
+        userid: number; // 用户ID(默认为0, 核心为为机构用户ID)
+    }
+
+    /** 通知公告-->资讯管理-->详情 请求 */
+    interface InformDetailReq {
+        id: number;
+    }
+
+    /** 通知公告-->资讯管理-->详情 响应 */
+    interface InformDetailRsp {
+        author: string; // 作者
+        brief: string; // 简介
+        columnid: number; // 所属栏目
+        columnname: string;
+        columntype: number;
+        context: string; // 内容
+        coverimage: string; // 封面图片
+        creaedate: string; // 创建时间
+        creatorid: number; // 创建人
+        creatoruser: string;
+        hits: number; // 点击数
+        id: number; // ID(SEQ_SITE_COLUMNDETAIL)
+        isshow: number; // 是否展示 - 0:不展示 1:展示
+        istop: number; // 是否置顶 - 0:不置 1:置顶
+        modifierid: number; // 操作人
+        modifieruser: string;
+        publishdate: string; // 发布日期
+        publishdate2: string;
+        srcid: number; // 来源ID
+        srcname: string;
+        status: number; // 状态 - 1:暂存 10:待审核 20:审核通过 30:审核拒绝
+        title: string; // 标题
+        updatedate: string; // 修改时间
+        userid: number; // 用户ID(默认为0, 核心为为机构用户ID)
+    }
+
+    /** 通知公告-->资讯管理-->展示/不展示 请求 */
+    interface IsShowReq {
+        id: number;
+    }
+
+    /** 通知公告-->资讯管理-->删除 请求 */
+    interface DeleteInformReq {
+        id: number;
+    }
 }