This commit is contained in:
zhangjianjun 2026-03-27 15:11:59 +08:00
parent 2a6263ac65
commit fade9d07e2
5 changed files with 30 additions and 14 deletions

View File

@ -9,6 +9,13 @@ export default {
params: {} params: {}
}) })
}, },
getDataDetail(id: number) {
return Request({
url: `yt/role/${id}`,
method: 'get',
params: {}
})
},
updateData(params: any) { updateData(params: any) {
return Request({ return Request({
url: 'yt/role', url: 'yt/role',

View File

@ -52,7 +52,7 @@ export const uploadApi = {
method: 'post', method: 'post',
data: params, data: params,
params: { params: {
expire: 24 * 30 * 12 * 10, expire: 86400 * 24 * 30 * 12 * 10,
}, },
headers: { headers: {
"Content-Type": "multipart/form-data", "Content-Type": "multipart/form-data",

View File

@ -477,12 +477,12 @@ const NodeEditor: Component = defineComponent({
const zhItem = Array.isArray(zhArr) ? zhArr[i] : undefined const zhItem = Array.isArray(zhArr) ? zhArr[i] : undefined
return h(NodeEditor, { parent: item, fieldKey: k, fieldMap: fm, depth: depth + 1, key: k, lang: p.lang, zhParent: zhItem }) return h(NodeEditor, { parent: item, fieldKey: k, fieldMap: fm, depth: depth + 1, key: k, lang: p.lang, zhParent: zhItem })
}), }),
// h('div', { class: 'jfd-item-actions' }, h('div', { class: 'jfd-item-actions' },
// h(ElButton, { h(ElButton, {
// size: 'small', type: 'danger', size: 'small', type: 'danger',
// onClick: () => value.splice(i, 1), onClick: () => value.splice(i, 1),
// }, () => [h(ElIcon, { size: 14 }, () => h(Delete)), ' ']) }, () => [h(ElIcon, { size: 14 }, () => h(Delete)), ' 删除此项'])
// ) )
]) ])
}) })
) )

View File

@ -62,7 +62,7 @@ const data: TableData = {
}, },
], ],
subFun(self, data) { subFun(self, data) {
return self.api?.addData(data) return self.api?.addData({...data, role: String(data.role)})
} }
} }
} }
@ -98,7 +98,7 @@ const data: TableData = {
openValue: 1, openValue: 1,
closeValue: 2, closeValue: 2,
subFun(self, data) { subFun(self, data) {
return self.api?.updateData({id: String(data.id), status: String(data.status)}) return self.api?.updateData({id: String(data.id), status: String(data.status), role: String(data.role)})
}, },
} }
}, },

View File

@ -11,8 +11,8 @@ const data: TableData = {
launchTask: [ launchTask: [
async (self: any) => { async (self: any) => {
if (self.bean) { if (self.bean) {
const res = await self.api?.getResources({type: "page"}) const res = await self.api?.getResources({ type: "page", page: 1, size: 1000 })
const res2 = await self.api?.getResources({type: "api"}) const res2 = await self.api?.getResources({ type: "api", page: 1, size: 1000 })
self.bean.resources = [...res.data.items, ...res2.data.items].map((item: any) => { self.bean.resources = [...res.data.items, ...res2.data.items].map((item: any) => {
const type = item.type === 'page' ? '页面' : '接口' const type = item.type === 'page' ? '页面' : '接口'
return { return {
@ -98,6 +98,15 @@ const data: TableData = {
title: '编辑', title: '编辑',
type: 'warning', type: 'warning',
primary: 'id', primary: 'id',
beforeShow: async (self: any, form: any, row: any) => {
const res = await self.api?.getDataDetail(row.id)
const resources = res.data.map((item: any) => item.id)
const findItem = form.data.find((i: any) => i.key === 'resource')
findItem.values[form.show] = resources
console.log('row', row)
console.log('form', form)
console.log('resource', resources)
},
data: [ data: [
{ {
key: 'name', key: 'name',