2025-03-24 14:59:31 +08:00
|
|
|
<template>
|
|
|
|
<div class="p-2">
|
|
|
|
<!--查询区域-->
|
|
|
|
<div class="jeecg-basic-table-form-container">
|
2025-03-26 15:36:35 +08:00
|
|
|
<a-form ref="formRef" :model="searchForm" :label-col="labelCol" :wrapper-col="wrapperCol">
|
2025-03-24 14:59:31 +08:00
|
|
|
<a-row :gutter="24">
|
|
|
|
<a-col :lg="6">
|
|
|
|
<a-form-item name="packageName">
|
|
|
|
<template #label><span title="服务指令包名称">服务指令包</span></template>
|
2025-03-26 15:36:35 +08:00
|
|
|
<a-input v-model:value="searchForm.packageName" allow-clear />
|
2025-03-24 14:59:31 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
|
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
|
|
|
<a-col :lg="6">
|
|
|
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
|
|
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
|
|
|
style="margin-left: 8px">重置</a-button>
|
2025-03-26 15:36:35 +08:00
|
|
|
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"
|
|
|
|
style="margin-left: 8px">新增</a-button>
|
2025-03-24 14:59:31 +08:00
|
|
|
</a-col>
|
|
|
|
</span>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
|
|
|
</div>
|
2025-03-26 15:36:35 +08:00
|
|
|
<div style="background-color: #000;padding: 20px;">
|
|
|
|
<a-card :title="directive.packageName" :key="directive.id" :bordered="false" style="width: 300px;margin: 10px;"
|
|
|
|
v-for="directive of tableData.records">
|
|
|
|
<div>{{ directive.description }}</div>
|
|
|
|
<div>{{ directive.createTime }} - {{ directive.createBy }}</div>
|
|
|
|
<div>
|
|
|
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="packageEdit(directive)"
|
|
|
|
style="margin-left: 8px">编辑</a-button>
|
|
|
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="remove(directive)"
|
|
|
|
style="margin-left: 8px">删除</a-button>
|
|
|
|
</div>
|
|
|
|
</a-card>
|
|
|
|
</div>
|
2025-03-24 14:59:31 +08:00
|
|
|
</div>
|
2025-03-26 15:36:35 +08:00
|
|
|
<!-- 表单区域 -->
|
|
|
|
<DirectivePackageModal ref="registerModal" @success="handleSuccess"></DirectivePackageModal>
|
2025-03-24 14:59:31 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" name="directivePackage-directivePackage" setup>
|
2025-03-26 15:36:35 +08:00
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
2025-03-24 14:59:31 +08:00
|
|
|
import DirectivePackageModal from './components/DirectivePackageModal.vue'
|
2025-03-26 15:36:35 +08:00
|
|
|
import { list, queryById } from './DirectivePackage.api'
|
2025-03-24 14:59:31 +08:00
|
|
|
|
|
|
|
const registerModal = ref();
|
2025-03-26 15:36:35 +08:00
|
|
|
const searchForm = ref({})
|
|
|
|
const tableData = ref({})
|
2025-03-24 14:59:31 +08:00
|
|
|
const labelCol = reactive({
|
|
|
|
xs: 24,
|
|
|
|
sm: 4,
|
|
|
|
xl: 6,
|
|
|
|
xxl: 6
|
|
|
|
});
|
|
|
|
const wrapperCol = reactive({
|
|
|
|
xs: 24,
|
|
|
|
sm: 20,
|
|
|
|
xl: 14,
|
|
|
|
xxl: 14
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
2025-03-26 15:36:35 +08:00
|
|
|
* 搜索
|
2025-03-24 14:59:31 +08:00
|
|
|
*/
|
2025-03-26 15:36:35 +08:00
|
|
|
function searchQuery() {
|
|
|
|
queryList({})
|
2025-03-24 14:59:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2025-03-26 15:36:35 +08:00
|
|
|
* 重置
|
2025-03-24 14:59:31 +08:00
|
|
|
*/
|
2025-03-26 15:36:35 +08:00
|
|
|
function searchReset() {
|
|
|
|
searchForm.value = {}
|
|
|
|
queryList({})
|
2025-03-24 14:59:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2025-03-26 15:36:35 +08:00
|
|
|
* 新增
|
2025-03-24 14:59:31 +08:00
|
|
|
*/
|
2025-03-26 15:36:35 +08:00
|
|
|
function handleAdd() {
|
2025-03-24 14:59:31 +08:00
|
|
|
registerModal.value.disableSubmit = false;
|
2025-03-26 15:36:35 +08:00
|
|
|
registerModal.value.add();
|
2025-03-24 14:59:31 +08:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* 成功回调
|
|
|
|
*/
|
|
|
|
function handleSuccess() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2025-03-26 15:36:35 +08:00
|
|
|
* 数据查询
|
2025-03-24 14:59:31 +08:00
|
|
|
*/
|
2025-03-26 15:36:35 +08:00
|
|
|
function queryList(params) {
|
|
|
|
list({ pageNo: 1, pageSize: 10, packageName: searchForm.value.packageName }).then(res => {
|
|
|
|
tableData.value = res
|
|
|
|
})
|
2025-03-24 14:59:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2025-03-26 15:36:35 +08:00
|
|
|
* 编辑
|
|
|
|
* @param data
|
2025-03-24 14:59:31 +08:00
|
|
|
*/
|
2025-03-26 15:36:35 +08:00
|
|
|
function packageEdit(data) {
|
|
|
|
queryById({ id: data.id }).then(item => {
|
|
|
|
registerModal.value.edit(item);
|
|
|
|
})
|
2025-03-24 14:59:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2025-03-26 15:36:35 +08:00
|
|
|
* 移除
|
|
|
|
* @param data
|
2025-03-24 14:59:31 +08:00
|
|
|
*/
|
2025-03-26 15:36:35 +08:00
|
|
|
function remove(data) {
|
2025-03-24 14:59:31 +08:00
|
|
|
|
2025-03-26 15:36:35 +08:00
|
|
|
}
|
2025-03-24 14:59:31 +08:00
|
|
|
|
2025-03-26 15:36:35 +08:00
|
|
|
onMounted(() => {
|
|
|
|
queryList({ pageNo: 1, pageSize: 10 })
|
|
|
|
})
|
2025-03-24 14:59:31 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.jeecg-basic-table-form-container {
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
.table-page-search-submitButtons {
|
|
|
|
display: block;
|
|
|
|
margin-bottom: 24px;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-group-cust {
|
|
|
|
min-width: 100px !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-group-split-cust {
|
|
|
|
width: 30px;
|
|
|
|
display: inline-block;
|
|
|
|
text-align: center
|
|
|
|
}
|
|
|
|
|
|
|
|
.ant-form-item:not(.ant-form-item-with-help) {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
height: 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.ant-picker),
|
|
|
|
:deep(.ant-input-number) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|