init: cdk初步+语言管理
This commit is contained in:
28
storm-vue/src/api/cdk/cdkCodeInfoApi.js
Normal file
28
storm-vue/src/api/cdk/cdkCodeInfoApi.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { baseRequest } from '@/utils/request'
|
||||
|
||||
const request = (url, ...arg) => baseRequest(`/cdk/cdkcodeinfo/` + url, ...arg)
|
||||
|
||||
/**
|
||||
* 授权码Api接口管理器
|
||||
*
|
||||
* @author lyd
|
||||
* @date 2025/09/26 17:28
|
||||
**/
|
||||
export default {
|
||||
// 获取授权码分页
|
||||
cdkCodeInfoPage(data) {
|
||||
return request('page', data, 'get')
|
||||
},
|
||||
// 提交授权码表单 edit为true时为编辑,默认为新增
|
||||
cdkCodeInfoSubmitForm(data, edit = false) {
|
||||
return request(edit ? 'edit' : 'add', data)
|
||||
},
|
||||
// 删除授权码
|
||||
cdkCodeInfoDelete(data) {
|
||||
return request('delete', data)
|
||||
},
|
||||
// 获取授权码详情
|
||||
cdkCodeInfoDetail(data) {
|
||||
return request('detail', data, 'get')
|
||||
}
|
||||
}
|
||||
32
storm-vue/src/api/cdk/cdkEncryInfoApi.js
Normal file
32
storm-vue/src/api/cdk/cdkEncryInfoApi.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { baseRequest } from '@/utils/request'
|
||||
|
||||
const request = (url, ...arg) => baseRequest(`/cdk/cdkencryinfo/` + url, ...arg)
|
||||
|
||||
/**
|
||||
* 密钥信息Api接口管理器
|
||||
*
|
||||
* @author lyd
|
||||
* @date 2025/09/26 17:06
|
||||
**/
|
||||
export default {
|
||||
// 获取密钥信息分页
|
||||
cdkEncryInfoPage(data) {
|
||||
return request('page', data, 'get')
|
||||
},
|
||||
// 提交密钥信息表单 edit为true时为编辑,默认为新增
|
||||
cdkEncryInfoSubmitForm(data, edit = false) {
|
||||
return request(edit ? 'edit' : 'add', data)
|
||||
},
|
||||
// 删除密钥信息
|
||||
cdkEncryInfoDelete(data) {
|
||||
return request('delete', data)
|
||||
},
|
||||
// 获取密钥信息详情
|
||||
cdkEncryInfoDetail(data) {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
// 获取密钥信息详情
|
||||
generated(data) {
|
||||
return request('generated', data, 'post')
|
||||
}
|
||||
}
|
||||
31
storm-vue/src/api/cdk/cdkProjectApi.js
Normal file
31
storm-vue/src/api/cdk/cdkProjectApi.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { baseRequest } from '@/utils/request'
|
||||
|
||||
const request = (url, ...arg) => baseRequest(`/cdk/CdkProject/` + url, ...arg)
|
||||
|
||||
/**
|
||||
* 项目表Api接口管理器
|
||||
*
|
||||
* @author lyd
|
||||
* @date 2025/09/26 15:38
|
||||
**/
|
||||
export default {
|
||||
// 获取项目表分页
|
||||
cdkProjectPage(data) {
|
||||
return request('page', data, 'get')
|
||||
},
|
||||
// 提交项目表表单 edit为true时为编辑,默认为新增
|
||||
cdkProjectSubmitForm(data, edit = false) {
|
||||
return request(edit ? 'edit' : 'add', data)
|
||||
},
|
||||
// 删除项目表
|
||||
cdkProjectDelete(data) {
|
||||
return request('delete', data)
|
||||
},
|
||||
// 获取项目表详情
|
||||
cdkProjectDetail(data) {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
cdkProjectList(data) {
|
||||
return request('project-list', data, 'get')
|
||||
}
|
||||
}
|
||||
28
storm-vue/src/api/inter/interProjectLangApi.js
Normal file
28
storm-vue/src/api/inter/interProjectLangApi.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { baseRequest } from '@/utils/request'
|
||||
|
||||
const request = (url, ...arg) => baseRequest(`/inter/projectlang/` + url, ...arg)
|
||||
|
||||
/**
|
||||
* 项目-语言关系表Api接口管理器
|
||||
*
|
||||
* @author lyd
|
||||
* @date 2025/09/29 14:17
|
||||
**/
|
||||
export default {
|
||||
// 获取项目-语言关系表分页
|
||||
interProjectLangPage(data) {
|
||||
return request('page', data, 'get')
|
||||
},
|
||||
// 提交项目-语言关系表表单 edit为true时为编辑,默认为新增
|
||||
interProjectLangSubmitForm(data, edit = false) {
|
||||
return request(edit ? 'edit' : 'add', data)
|
||||
},
|
||||
// 删除项目-语言关系表
|
||||
interProjectLangDelete(data) {
|
||||
return request('delete', data)
|
||||
},
|
||||
// 获取项目-语言关系表详情
|
||||
interProjectLangDetail(data) {
|
||||
return request('detail', data, 'get')
|
||||
}
|
||||
}
|
||||
@@ -216,4 +216,13 @@ tool.parseTime = (time, cFormat) => {
|
||||
return time_str
|
||||
}
|
||||
|
||||
// options一定要是label-value
|
||||
tool.getOptionLabel = (options, value) => {
|
||||
if (!options || options.length === 0) {
|
||||
return ''
|
||||
}
|
||||
const option = options.find((item) => item.value === value)
|
||||
return option ? option.label : ''
|
||||
}
|
||||
|
||||
export default tool
|
||||
|
||||
87
storm-vue/src/views/cdk/code/form.vue
Normal file
87
storm-vue/src/views/cdk/code/form.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<xn-form-container
|
||||
:title="formData.cdkId ? '编辑授权码' : '增加授权码'"
|
||||
:width="700"
|
||||
v-model:open="open"
|
||||
:destroy-on-close="true"
|
||||
@close="onClose"
|
||||
>
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授权码:" name="cdkCode">
|
||||
<a-input v-model:value="formData.cdkCode" placeholder="请输入授权码" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="公钥:" name="publicKey">
|
||||
<a-input v-model:value="formData.publicKey" placeholder="请输入公钥" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="到期时间:" name="expirationTime">
|
||||
<a-input v-model:value="formData.expirationTime" placeholder="请输入到期时间" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
|
||||
</template>
|
||||
</xn-form-container>
|
||||
</template>
|
||||
|
||||
<script setup name="cdkCodeInfoForm">
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { required } from '@/utils/formRules'
|
||||
import cdkCodeInfoApi from '@/api/cdk/cdkCodeInfoApi'
|
||||
// 抽屉状态
|
||||
const open = ref(false)
|
||||
const emit = defineEmits({ successful: null })
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = ref({})
|
||||
const submitLoading = ref(false)
|
||||
|
||||
// 打开抽屉
|
||||
const onOpen = (record) => {
|
||||
open.value = true
|
||||
if (record) {
|
||||
let recordData = cloneDeep(record)
|
||||
formData.value = Object.assign({}, recordData)
|
||||
}
|
||||
}
|
||||
// 关闭抽屉
|
||||
const onClose = () => {
|
||||
formRef.value.resetFields()
|
||||
formData.value = {}
|
||||
open.value = false
|
||||
}
|
||||
// 默认要校验的
|
||||
const formRules = {
|
||||
}
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
submitLoading.value = true
|
||||
const formDataParam = cloneDeep(formData.value)
|
||||
cdkCodeInfoApi
|
||||
.cdkCodeInfoSubmitForm(formDataParam, formDataParam.cdkId)
|
||||
.then(() => {
|
||||
onClose()
|
||||
emit('successful')
|
||||
})
|
||||
.finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
// 抛出函数
|
||||
defineExpose({
|
||||
onOpen
|
||||
})
|
||||
</script>
|
||||
117
storm-vue/src/views/cdk/code/index.vue
Normal file
117
storm-vue/src/views/cdk/code/index.vue
Normal file
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<s-table
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="options.alert.show"
|
||||
bordered
|
||||
:row-key="(record) => record.cdkId"
|
||||
:tool-config="toolConfig"
|
||||
:row-selection="options.rowSelection"
|
||||
>
|
||||
<template #operator class="table-operator">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('cdkCodeInfoAdd')">
|
||||
<template #icon><plus-outlined /></template>
|
||||
新增
|
||||
</a-button>
|
||||
<xn-batch-button
|
||||
v-if="hasPerm('cdkCodeInfoBatchDelete')"
|
||||
buttonName="批量删除"
|
||||
icon="DeleteOutlined"
|
||||
:selectedRowKeys="selectedRowKeys"
|
||||
@batchCallBack="deleteBatchCdkCodeInfo"
|
||||
/>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
<a @click="formRef.onOpen(record)" v-if="hasPerm('cdkCodeInfoEdit')">编辑</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(['cdkCodeInfoEdit', 'cdkCodeInfoDelete'], 'and')" />
|
||||
<a-popconfirm title="确定要删除吗?" @confirm="deleteCdkCodeInfo(record)">
|
||||
<a-button type="link" danger size="small" v-if="hasPerm('cdkCodeInfoDelete')">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||
</template>
|
||||
|
||||
<script setup name="cdkcodeinfo">
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import Form from './form.vue'
|
||||
import cdkCodeInfoApi from '@/api/cdk/cdkCodeInfoApi'
|
||||
const tableRef = ref()
|
||||
const formRef = ref()
|
||||
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
||||
const columns = [
|
||||
{
|
||||
title: '授权码',
|
||||
dataIndex: 'cdkCode'
|
||||
},
|
||||
{
|
||||
title: '公钥',
|
||||
dataIndex: 'publicKey'
|
||||
},
|
||||
{
|
||||
title: '到期时间',
|
||||
dataIndex: 'expirationTime'
|
||||
},
|
||||
]
|
||||
// 操作栏通过权限判断是否显示
|
||||
if (hasPerm(['cdkCodeInfoEdit', 'cdkCodeInfoDelete'])) {
|
||||
columns.push({
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
width: 150
|
||||
})
|
||||
}
|
||||
const selectedRowKeys = ref([])
|
||||
// 列表选择配置
|
||||
const options = {
|
||||
// columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
||||
alert: {
|
||||
show: true,
|
||||
clear: () => {
|
||||
selectedRowKeys.value = ref([])
|
||||
}
|
||||
},
|
||||
rowSelection: {
|
||||
onChange: (selectedRowKey, selectedRows) => {
|
||||
selectedRowKeys.value = selectedRowKey
|
||||
}
|
||||
}
|
||||
}
|
||||
const loadData = (parameter) => {
|
||||
return cdkCodeInfoApi.cdkCodeInfoPage(parameter).then((data) => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
const reset = () => {
|
||||
searchFormRef.value.resetFields()
|
||||
tableRef.value.refresh(true)
|
||||
}
|
||||
// 删除
|
||||
const deleteCdkCodeInfo = (record) => {
|
||||
let params = [
|
||||
{
|
||||
cdkId: record.cdkId
|
||||
}
|
||||
]
|
||||
cdkCodeInfoApi.cdkCodeInfoDelete(params).then(() => {
|
||||
tableRef.value.refresh(true)
|
||||
})
|
||||
}
|
||||
// 批量删除
|
||||
const deleteBatchCdkCodeInfo = (params) => {
|
||||
cdkCodeInfoApi.cdkCodeInfoDelete(params).then(() => {
|
||||
tableRef.value.clearRefreshSelected()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
95
storm-vue/src/views/cdk/encryption/form.vue
Normal file
95
storm-vue/src/views/cdk/encryption/form.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<xn-form-container
|
||||
:title="formData.encryId ? '编辑密钥信息' : '增加密钥信息'"
|
||||
:width="700"
|
||||
v-model:open="open"
|
||||
:destroy-on-close="true"
|
||||
@close="onClose"
|
||||
>
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="私钥:" name="privateKey">
|
||||
<a-input v-model:value="formData.privateKey" placeholder="请输入私钥" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="公钥:" name="publicKey">
|
||||
<a-input v-model:value="formData.publicKey" placeholder="请输入公钥" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="项目:" name="projectId">
|
||||
<a-select v-model:value="formData.projectId" placeholder="请选择项目" :options="projectIdOptions" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="加密算法名:" name="encryName">
|
||||
<a-input v-model:value="formData.encryName" placeholder="请输入加密算法名" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
|
||||
</template>
|
||||
</xn-form-container>
|
||||
</template>
|
||||
|
||||
<script setup name="cdkEncryInfoForm">
|
||||
import tool from '@/utils/tool'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { required } from '@/utils/formRules'
|
||||
import cdkEncryInfoApi from '@/api/cdk/cdkEncryInfoApi'
|
||||
// 抽屉状态
|
||||
const open = ref(false)
|
||||
const emit = defineEmits({ successful: null })
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = ref({})
|
||||
const submitLoading = ref(false)
|
||||
const projectIdOptions = ref([])
|
||||
|
||||
// 打开抽屉
|
||||
const onOpen = (record) => {
|
||||
open.value = true
|
||||
if (record) {
|
||||
let recordData = cloneDeep(record)
|
||||
formData.value = Object.assign({}, recordData)
|
||||
}
|
||||
projectIdOptions.value = tool.dictList('GENDER')
|
||||
}
|
||||
// 关闭抽屉
|
||||
const onClose = () => {
|
||||
formRef.value.resetFields()
|
||||
formData.value = {}
|
||||
open.value = false
|
||||
}
|
||||
// 默认要校验的
|
||||
const formRules = {
|
||||
}
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
submitLoading.value = true
|
||||
const formDataParam = cloneDeep(formData.value)
|
||||
cdkEncryInfoApi
|
||||
.cdkEncryInfoSubmitForm(formDataParam, formDataParam.encryId)
|
||||
.then(() => {
|
||||
onClose()
|
||||
emit('successful')
|
||||
})
|
||||
.finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
// 抛出函数
|
||||
defineExpose({
|
||||
onOpen
|
||||
})
|
||||
</script>
|
||||
145
storm-vue/src/views/cdk/encryption/index.vue
Normal file
145
storm-vue/src/views/cdk/encryption/index.vue
Normal file
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="6">
|
||||
<a-form-item label="项目" name="projectId">
|
||||
<a-select v-model:value="searchFormState.projectId" placeholder="请选择项目" :options="projectIdOptions" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
||||
<a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<s-table
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="options.alert.show"
|
||||
bordered
|
||||
:scroll="{ x: 1300}"
|
||||
:row-key="(record) => record.encryId"
|
||||
:tool-config="toolConfig"
|
||||
:row-selection="options.rowSelection"
|
||||
>
|
||||
<template #operator class="table-operator">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('cdkEncryInfoAdd')">
|
||||
<template #icon><plus-outlined /></template>
|
||||
新增
|
||||
</a-button>
|
||||
<xn-batch-button
|
||||
v-if="hasPerm('cdkEncryInfoBatchDelete')"
|
||||
buttonName="批量删除"
|
||||
icon="DeleteOutlined"
|
||||
:selectedRowKeys="selectedRowKeys"
|
||||
@batchCallBack="deleteBatchCdkEncryInfo"
|
||||
/>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'projectId'">
|
||||
{{ $TOOL.dictTypeData('GENDER', record.projectId) }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
<a @click="formRef.onOpen(record)" v-if="hasPerm('cdkEncryInfoEdit')">编辑</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(['cdkEncryInfoEdit', 'cdkEncryInfoDelete'], 'and')" />
|
||||
<a-popconfirm title="确定要删除吗?" @confirm="deleteCdkEncryInfo(record)">
|
||||
<a-button type="link" danger size="small" v-if="hasPerm('cdkEncryInfoDelete')">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||
</template>
|
||||
|
||||
<script setup name="cdkencryinfo">
|
||||
import tool from '@/utils/tool'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import Form from './form.vue'
|
||||
import cdkEncryInfoApi from '@/api/cdk/cdkEncryInfoApi'
|
||||
const searchFormState = ref({})
|
||||
const searchFormRef = ref()
|
||||
const tableRef = ref()
|
||||
const formRef = ref()
|
||||
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
||||
const columns = [
|
||||
{
|
||||
title: '私钥',
|
||||
dataIndex: 'privateKey',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '公钥',
|
||||
dataIndex: 'publicKey',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '项目',
|
||||
dataIndex: 'projectId'
|
||||
},
|
||||
{
|
||||
title: '加密算法名',
|
||||
dataIndex: 'encryName'
|
||||
},
|
||||
]
|
||||
// 操作栏通过权限判断是否显示
|
||||
if (hasPerm(['cdkEncryInfoEdit', 'cdkEncryInfoDelete'])) {
|
||||
columns.push({
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
width: 150
|
||||
})
|
||||
}
|
||||
const selectedRowKeys = ref([])
|
||||
// 列表选择配置
|
||||
const options = {
|
||||
// columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
||||
alert: {
|
||||
show: true,
|
||||
clear: () => {
|
||||
selectedRowKeys.value = ref([])
|
||||
}
|
||||
},
|
||||
rowSelection: {
|
||||
onChange: (selectedRowKey, selectedRows) => {
|
||||
selectedRowKeys.value = selectedRowKey
|
||||
}
|
||||
}
|
||||
}
|
||||
const loadData = (parameter) => {
|
||||
const searchFormParam = cloneDeep(searchFormState.value)
|
||||
return cdkEncryInfoApi.cdkEncryInfoPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
const reset = () => {
|
||||
searchFormRef.value.resetFields()
|
||||
tableRef.value.refresh(true)
|
||||
}
|
||||
// 删除
|
||||
const deleteCdkEncryInfo = (record) => {
|
||||
let params = [
|
||||
{
|
||||
encryId: record.encryId
|
||||
}
|
||||
]
|
||||
cdkEncryInfoApi.cdkEncryInfoDelete(params).then(() => {
|
||||
tableRef.value.refresh(true)
|
||||
})
|
||||
}
|
||||
// 批量删除
|
||||
const deleteBatchCdkEncryInfo = (params) => {
|
||||
cdkEncryInfoApi.cdkEncryInfoDelete(params).then(() => {
|
||||
tableRef.value.clearRefreshSelected()
|
||||
})
|
||||
}
|
||||
const projectIdOptions = tool.dictList('GENDER')
|
||||
</script>
|
||||
82
storm-vue/src/views/cdk/project/form.vue
Normal file
82
storm-vue/src/views/cdk/project/form.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<xn-form-container
|
||||
:title="formData.projectId ? '编辑项目表' : '增加项目表'"
|
||||
:width="700"
|
||||
v-model:open="open"
|
||||
:destroy-on-close="true"
|
||||
@close="onClose"
|
||||
>
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="项目编码:" name="projectCode">
|
||||
<a-input v-model:value="formData.projectCode" placeholder="请输入项目编码" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="项目名称:" name="projectName">
|
||||
<a-input v-model:value="formData.projectName" placeholder="请输入项目名称" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
|
||||
</template>
|
||||
</xn-form-container>
|
||||
</template>
|
||||
|
||||
<script setup name="cdkProjectForm">
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { required } from '@/utils/formRules'
|
||||
import cdkProjectApi from '@/api/cdk/cdkProjectApi'
|
||||
// 抽屉状态
|
||||
const open = ref(false)
|
||||
const emit = defineEmits({ successful: null })
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = ref({})
|
||||
const submitLoading = ref(false)
|
||||
|
||||
// 打开抽屉
|
||||
const onOpen = (record) => {
|
||||
open.value = true
|
||||
if (record) {
|
||||
let recordData = cloneDeep(record)
|
||||
formData.value = Object.assign({}, recordData)
|
||||
}
|
||||
}
|
||||
// 关闭抽屉
|
||||
const onClose = () => {
|
||||
formRef.value.resetFields()
|
||||
formData.value = {}
|
||||
open.value = false
|
||||
}
|
||||
// 默认要校验的
|
||||
const formRules = {
|
||||
}
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
submitLoading.value = true
|
||||
const formDataParam = cloneDeep(formData.value)
|
||||
cdkProjectApi
|
||||
.cdkProjectSubmitForm(formDataParam, formDataParam.projectId)
|
||||
.then(() => {
|
||||
onClose()
|
||||
emit('successful')
|
||||
})
|
||||
.finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
// 抛出函数
|
||||
defineExpose({
|
||||
onOpen
|
||||
})
|
||||
</script>
|
||||
157
storm-vue/src/views/cdk/project/index.vue
Normal file
157
storm-vue/src/views/cdk/project/index.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="6">
|
||||
<a-form-item label="项目编码" name="projectCode">
|
||||
<a-input v-model:value="searchFormState.projectCode" placeholder="请输入项目编码" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-form-item label="项目名称" name="projectName">
|
||||
<a-input v-model:value="searchFormState.projectName" placeholder="请输入项目名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
||||
<a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<s-table
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="options.alert.show"
|
||||
bordered
|
||||
:row-key="(record) => record.projectId"
|
||||
:tool-config="toolConfig"
|
||||
:row-selection="options.rowSelection"
|
||||
>
|
||||
<template #operator class="table-operator">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('cdkProjectAdd')">
|
||||
<template #icon>
|
||||
<plus-outlined />
|
||||
</template>
|
||||
新增
|
||||
</a-button>
|
||||
<xn-batch-button
|
||||
v-if="hasPerm('cdkProjectBatchDelete')"
|
||||
buttonName="批量删除"
|
||||
icon="DeleteOutlined"
|
||||
:selectedRowKeys="selectedRowKeys"
|
||||
@batchCallBack="deleteBatchCdkProject"
|
||||
/>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
<a @click="toGeneratedEncry(record)">密钥生成</a>
|
||||
<a @click="formRef.onOpen(record)" v-if="hasPerm('cdkProjectEdit')">授权码生成</a>
|
||||
<a @click="formRef.onOpen(record)" v-if="hasPerm('cdkProjectEdit')">编辑</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(['cdkProjectEdit', 'cdkProjectDelete'], 'and')" />
|
||||
<a-popconfirm title="确定要删除吗?" @confirm="deleteCdkProject(record)">
|
||||
<a-button type="link" danger size="small" v-if="hasPerm('cdkProjectDelete')">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||
</template>
|
||||
|
||||
<script setup name="CdkProject">
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import Form from './form.vue'
|
||||
import cdkProjectApi from '@/api/cdk/cdkProjectApi'
|
||||
import cdkEncryInfoApi from "@/api/cdk/cdkEncryInfoApi";
|
||||
import {message} from "ant-design-vue";
|
||||
|
||||
const searchFormState = ref({})
|
||||
const searchFormRef = ref()
|
||||
const tableRef = ref()
|
||||
const formRef = ref()
|
||||
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
||||
const columns = [
|
||||
{
|
||||
title: '项目编码',
|
||||
dataIndex: 'projectCode'
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'projectName'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime'
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime'
|
||||
}
|
||||
]
|
||||
// 操作栏通过权限判断是否显示
|
||||
if (hasPerm(['cdkProjectEdit', 'cdkProjectDelete'])) {
|
||||
columns.push({
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
width: 350
|
||||
})
|
||||
}
|
||||
const selectedRowKeys = ref([])
|
||||
// 列表选择配置
|
||||
const options = {
|
||||
// columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
||||
alert: {
|
||||
show: true,
|
||||
clear: () => {
|
||||
selectedRowKeys.value = ref([])
|
||||
}
|
||||
},
|
||||
rowSelection: {
|
||||
onChange: (selectedRowKey, selectedRows) => {
|
||||
selectedRowKeys.value = selectedRowKey
|
||||
}
|
||||
}
|
||||
}
|
||||
const loadData = (parameter) => {
|
||||
const searchFormParam = cloneDeep(searchFormState.value)
|
||||
return cdkProjectApi.cdkProjectPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
const reset = () => {
|
||||
searchFormRef.value.resetFields()
|
||||
tableRef.value.refresh(true)
|
||||
}
|
||||
// 删除
|
||||
const deleteCdkProject = (record) => {
|
||||
let params = [
|
||||
{
|
||||
projectId: record.projectId
|
||||
}
|
||||
]
|
||||
cdkProjectApi.cdkProjectDelete(params).then(() => {
|
||||
tableRef.value.refresh(true)
|
||||
})
|
||||
}
|
||||
// 批量删除
|
||||
const deleteBatchCdkProject = (params) => {
|
||||
cdkProjectApi.cdkProjectDelete(params).then(() => {
|
||||
tableRef.value.clearRefreshSelected()
|
||||
})
|
||||
}
|
||||
const toGeneratedEncry = (record) => {
|
||||
let params = {
|
||||
projectId: record.projectId
|
||||
}
|
||||
cdkEncryInfoApi.generated(params).then(() => {
|
||||
message.success('密钥生成成功')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
45
storm-vue/src/views/inter/editLang/index.vue
Normal file
45
storm-vue/src/views/inter/editLang/index.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<div className="table-wrapper">
|
||||
<div className="s-table-tool">
|
||||
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="6">
|
||||
<a-form-item label="项目" name="projectId">
|
||||
<a-select
|
||||
v-model:value="searchFormState.projectId"
|
||||
placeholder="请选择项目"
|
||||
show-search
|
||||
option-filter-prop="label"
|
||||
:options="projectIdOptions"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button type="primary" >查询</a-button>
|
||||
<a-button style="margin: 0 8px" >重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="editLang">
|
||||
import cdkProjectApi from '@/api/cdk/cdkProjectApi'
|
||||
|
||||
const projectIdOptions = ref([])
|
||||
const searchFormState = ref({})
|
||||
const searchFormRef = ref()
|
||||
|
||||
const getProjectList = () => {
|
||||
cdkProjectApi.cdkProjectList({}).then((res) => {
|
||||
projectIdOptions.value = res
|
||||
})
|
||||
}
|
||||
|
||||
getProjectList()
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
99
storm-vue/src/views/inter/projectlang/form.vue
Normal file
99
storm-vue/src/views/inter/projectlang/form.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<xn-form-container
|
||||
:title="formData.plId ? '编辑项目语言' : '增加项目语言'"
|
||||
:width="700"
|
||||
v-model:open="open"
|
||||
:destroy-on-close="true"
|
||||
@close="onClose"
|
||||
>
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="项目:" name="projectId">
|
||||
<a-select v-model:value="formData.projectId" placeholder="请选择项目" :options="projectIdOptions" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="语言:" name="langId">
|
||||
<a-select v-model:value="formData.langId" placeholder="请选择语言" :options="langIdOptions" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="语言json:" name="langData">
|
||||
<a-textarea v-model:value="formData.langData" placeholder="请输入语言json" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
|
||||
</template>
|
||||
</xn-form-container>
|
||||
</template>
|
||||
|
||||
<script setup name="interProjectLangForm">
|
||||
import tool from '@/utils/tool'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { required } from '@/utils/formRules'
|
||||
import interProjectLangApi from '@/api/inter/interProjectLangApi'
|
||||
import cdkProjectApi from '@/api/cdk/cdkProjectApi'
|
||||
// 抽屉状态
|
||||
const open = ref(false)
|
||||
const emit = defineEmits({ successful: null })
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = ref({})
|
||||
const submitLoading = ref(false)
|
||||
const langIdOptions = ref([])
|
||||
const projectIdOptions = ref([])
|
||||
|
||||
// 打开抽屉
|
||||
const onOpen = (record) => {
|
||||
open.value = true
|
||||
if (record) {
|
||||
let recordData = cloneDeep(record)
|
||||
formData.value = Object.assign({}, recordData)
|
||||
}
|
||||
langIdOptions.value = tool.dictList('language')
|
||||
// 获取项目下拉框
|
||||
getProjectList()
|
||||
}
|
||||
// 关闭抽屉
|
||||
const onClose = () => {
|
||||
formRef.value.resetFields()
|
||||
formData.value = {}
|
||||
open.value = false
|
||||
}
|
||||
// 默认要校验的
|
||||
const formRules = {}
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
submitLoading.value = true
|
||||
const formDataParam = cloneDeep(formData.value)
|
||||
interProjectLangApi
|
||||
.interProjectLangSubmitForm(formDataParam, formDataParam.plId)
|
||||
.then(() => {
|
||||
onClose()
|
||||
emit('successful')
|
||||
})
|
||||
.finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
const getProjectList = () => {
|
||||
cdkProjectApi.cdkProjectList({}).then((res) => {
|
||||
projectIdOptions.value = res
|
||||
})
|
||||
}
|
||||
// 抛出函数
|
||||
defineExpose({
|
||||
onOpen
|
||||
})
|
||||
</script>
|
||||
134
storm-vue/src/views/inter/projectlang/index.vue
Normal file
134
storm-vue/src/views/inter/projectlang/index.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<s-table
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="options.alert.show"
|
||||
bordered
|
||||
:row-key="(record) => record.plId"
|
||||
:tool-config="toolConfig"
|
||||
:row-selection="options.rowSelection"
|
||||
>
|
||||
<template #operator class="table-operator">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('interProjectLangAdd')">
|
||||
<template #icon><plus-outlined /></template>
|
||||
新增
|
||||
</a-button>
|
||||
<xn-batch-button
|
||||
v-if="hasPerm('interProjectLangBatchDelete')"
|
||||
buttonName="批量删除"
|
||||
icon="DeleteOutlined"
|
||||
:selectedRowKeys="selectedRowKeys"
|
||||
@batchCallBack="deleteBatchInterProjectLang"
|
||||
/>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'projectId'">
|
||||
{{ $TOOL.getOptionLabel(projectIdOptions, record.projectId) }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'langId'">
|
||||
{{ $TOOL.dictTypeData('language', record.langId) }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
<a @click="formRef.onOpen(record)" v-if="hasPerm('interProjectLangEdit')">编辑</a>
|
||||
<a @click="formRef.onOpen(record)" v-if="hasPerm('interProjectLangEdit')">导出</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(['interProjectLangEdit', 'interProjectLangDelete'], 'and')" />
|
||||
<a-popconfirm title="确定要删除吗?" @confirm="deleteInterProjectLang(record)">
|
||||
<a-button type="link" danger size="small" v-if="hasPerm('interProjectLangDelete')">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||
</template>
|
||||
|
||||
<script setup name="projectlang">
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import Form from './form.vue'
|
||||
import interProjectLangApi from '@/api/inter/interProjectLangApi'
|
||||
import cdkProjectApi from '@/api/cdk/cdkProjectApi'
|
||||
const tableRef = ref()
|
||||
const formRef = ref()
|
||||
const projectIdOptions = ref([])
|
||||
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
||||
const columns = [
|
||||
{
|
||||
title: '项目',
|
||||
dataIndex: 'projectId'
|
||||
},
|
||||
{
|
||||
title: '语言',
|
||||
dataIndex: 'langId'
|
||||
},
|
||||
{
|
||||
title: '语言json',
|
||||
dataIndex: 'langData',
|
||||
ellipsis: true
|
||||
}
|
||||
]
|
||||
// 操作栏通过权限判断是否显示
|
||||
if (hasPerm(['interProjectLangEdit', 'interProjectLangDelete'])) {
|
||||
columns.push({
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
width: 200
|
||||
})
|
||||
}
|
||||
const selectedRowKeys = ref([])
|
||||
// 列表选择配置
|
||||
const options = {
|
||||
// columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
||||
alert: {
|
||||
show: true,
|
||||
clear: () => {
|
||||
selectedRowKeys.value = ref([])
|
||||
}
|
||||
},
|
||||
rowSelection: {
|
||||
onChange: (selectedRowKey, selectedRows) => {
|
||||
selectedRowKeys.value = selectedRowKey
|
||||
}
|
||||
}
|
||||
}
|
||||
const loadData = (parameter) => {
|
||||
return interProjectLangApi.interProjectLangPage(parameter).then((data) => {
|
||||
return data
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
const reset = () => {
|
||||
searchFormRef.value.resetFields()
|
||||
tableRef.value.refresh(true)
|
||||
}
|
||||
// 删除
|
||||
const deleteInterProjectLang = (record) => {
|
||||
let params = [
|
||||
{
|
||||
plId: record.plId
|
||||
}
|
||||
]
|
||||
interProjectLangApi.interProjectLangDelete(params).then(() => {
|
||||
tableRef.value.refresh(true)
|
||||
})
|
||||
}
|
||||
// 批量删除
|
||||
const deleteBatchInterProjectLang = (params) => {
|
||||
interProjectLangApi.interProjectLangDelete(params).then(() => {
|
||||
tableRef.value.clearRefreshSelected()
|
||||
})
|
||||
}
|
||||
const getProjectList = () => {
|
||||
cdkProjectApi.cdkProjectList({}).then((res) => {
|
||||
console.log(res)
|
||||
projectIdOptions.value = res
|
||||
})
|
||||
}
|
||||
getProjectList()
|
||||
</script>
|
||||
Reference in New Issue
Block a user