|
@@ -58,55 +58,51 @@
|
|
</n-radio-group>
|
|
</n-radio-group>
|
|
</n-form-item>
|
|
</n-form-item>
|
|
</n-form>
|
|
</n-form>
|
|
- <n-modal :show-icon="false" v-model:show="modal.showModalobj" style="width: 900px;min-height: 700px;" preset="dialog"
|
|
|
|
- title="选择添加">
|
|
|
|
- <n-form inline label-placement="left" :model="formValues" :rules="rules" :size="size">
|
|
|
|
- <n-form-item label="布局编号">
|
|
|
|
- <n-input v-model:value="formValues.T_layout_no" placeholder="输入布局编号" />
|
|
|
|
- </n-form-item>
|
|
|
|
- <n-form-item label="设备编号">
|
|
|
|
- <n-input v-model:value="formValues.T_sn" placeholder="输入设备编号" />
|
|
|
|
- </n-form-item>
|
|
|
|
- <n-form-item>
|
|
|
|
- <n-button type="primary" attr-type="button" @click="GetficateListApi">
|
|
|
|
- 查询
|
|
|
|
- </n-button>
|
|
|
|
- </n-form-item>
|
|
|
|
- </n-form>
|
|
|
|
- <n-table :bordered="false" :single-line="false">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>
|
|
|
|
- <n-checkbox :checked="checked" @update:checked="handleCheckedChange" />
|
|
|
|
- </th>
|
|
|
|
- <th>布局编号</th>
|
|
|
|
- <th>设备编号</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr v-for="item, index in checje.chkData" :key="index">
|
|
|
|
- <td style="width: 60px;">
|
|
|
|
- <n-checkbox-group v-model:value="checje.Selecteds" @update:value="handleUpdateValue">
|
|
|
|
- <n-checkbox :value="item" />
|
|
|
|
- </n-checkbox-group>
|
|
|
|
- </td>
|
|
|
|
- <td style="width: 250px;">{{ item.T_layout_no }}</td>
|
|
|
|
- <td>{{ item.Id }}</td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </n-table>
|
|
|
|
- <div style="margin-top: 20px;">
|
|
|
|
- <n-pagination :display-order="[ 'size-picker', 'pages','quick-jumper']" :page-count="100" :page-sizes="[10, 20, 30, 40]" show-quick-jumper show-size-picker>
|
|
|
|
- <template #prefix="">共 200项
|
|
|
|
- </template>
|
|
|
|
- </n-pagination>
|
|
|
|
|
|
+ <n-modal :show-icon="false" v-model:show="modal.showModalobj" style="width: 900px;" preset="dialog" title="选择添加">
|
|
|
|
+ <div style="max-height: 700px;display: flex;flex-direction: column;overflow-y: hidden;">
|
|
|
|
+ <n-form inline label-placement="left" :model="formValues" :rules="rules" :size="size">
|
|
|
|
+ <n-form-item label="布局编号">
|
|
|
|
+ <n-input v-model:value="formValues.T_layout_no" placeholder="输入布局编号" />
|
|
|
|
+ </n-form-item>
|
|
|
|
+ <n-form-item label="设备编号">
|
|
|
|
+ <n-input v-model:value="formValues.T_sn" placeholder="输入设备编号" />
|
|
|
|
+ </n-form-item>
|
|
|
|
+ <n-form-item>
|
|
|
|
+ <n-button type="primary" attr-type="button" @click="GetficateListApi">
|
|
|
|
+ 查询
|
|
|
|
+ </n-button>
|
|
|
|
+ </n-form-item>
|
|
|
|
+ <n-form-item>
|
|
|
|
+ <n-button type="primary" :disabled="checkedRowKeysRef.length==0" attr-type="button" @click="submitis">
|
|
|
|
+ 立即导入
|
|
|
|
+ </n-button>
|
|
|
|
+ </n-form-item>
|
|
|
|
+ </n-form>
|
|
|
|
+ <div style="flex: 1;overflow-y: auto;">
|
|
|
|
+ <n-data-table :columns="createColumns()" :data="checje.chkData" :remote="true" :max-height="480" :pagination="{
|
|
|
|
+ pageSize: formValues.page_z,
|
|
|
|
+ page:formValues.page,
|
|
|
|
+ pageCount:pageData.pageCount,
|
|
|
|
+ 'show-quick-jumper':true,
|
|
|
|
+ 'show-size-picker':true,
|
|
|
|
+ 'display-order':[ 'size-picker', 'pages','quick-jumper'],
|
|
|
|
+ 'page-sizes':[10, 20, 30, 40],
|
|
|
|
+ prefix() {
|
|
|
|
+ return `共${pageData.pageNum}条`
|
|
|
|
+ }}"
|
|
|
|
+ @update:page="prevFun"
|
|
|
|
+ :on-update:page-size="pagesizeFun"
|
|
|
|
+ :row-key="rowKey" @update:checked-row-keys="handleCheck">
|
|
|
|
+ </n-data-table>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
</n-modal>
|
|
</n-modal>
|
|
</n-modal>
|
|
</n-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { h, ref, watch } from 'vue';
|
|
|
|
|
|
+import { h, reactive, ref, watch } from 'vue';
|
|
import { NButton, NSpace, NPopconfirm, NInput } from 'naive-ui';
|
|
import { NButton, NSpace, NPopconfirm, NInput } from 'naive-ui';
|
|
import {
|
|
import {
|
|
getDeviceClassListList,
|
|
getDeviceClassListList,
|
|
@@ -121,9 +117,70 @@ const task = window.sessionStorage.getItem('task')
|
|
: {};
|
|
: {};
|
|
|
|
|
|
|
|
|
|
|
|
+const checje = reactive({
|
|
|
|
+ Selecteds: null,
|
|
|
|
+ chkData: []
|
|
|
|
+})
|
|
|
|
+const checkedRowKeysRef = ref([]);
|
|
|
|
+const createColumns = () => [
|
|
|
|
+ {
|
|
|
|
+ type: "selection",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "布局编号",
|
|
|
|
+ key: "T_layout_no",
|
|
|
|
+ // sortOrder: false,
|
|
|
|
+ // sorter (rowA, rowB) {
|
|
|
|
+ // return rowA.age - rowB.age
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "设备编号",
|
|
|
|
+ key: "Id"
|
|
|
|
+ }
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+const rowKey = (row) => row.T_layout_no
|
|
|
|
+const handleCheck = (rowKeys) => {//点击选项框勾选存值
|
|
|
|
+ checkedRowKeysRef.value = rowKeys;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
|
|
+
|
|
|
|
+const submitis = ()=>{
|
|
|
|
+ console.log(checkedRowKeysRef.value)
|
|
|
|
+ if(checkedRowKeysRef.value.length!=0){
|
|
|
|
+ addDeviceClassList({
|
|
|
|
+ T_class: queryData.T_class,
|
|
|
|
+ T_layout_no_list:checkedRowKeysRef.value.join(',')
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.data.Code==200){
|
|
|
|
+ getDataList();
|
|
|
|
+ message.success('导入成功')
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
const message = useMessage();
|
|
const message = useMessage();
|
|
|
|
+//上下页分页
|
|
|
|
+const prevFun = (e) => {
|
|
|
|
+ formValues.page = e
|
|
|
|
+ GetficateListApi()
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//每页显示条数
|
|
|
|
+const pagesizeFun = (e) => {
|
|
|
|
+ formValues.page_z = e
|
|
|
|
+ GetficateListApi()
|
|
|
|
|
|
|
|
+}
|
|
|
|
+const pageData = reactive({
|
|
|
|
+ pageCount: 0,
|
|
|
|
+ pageNum: 0
|
|
|
|
+})
|
|
const formValues = reactive({
|
|
const formValues = reactive({
|
|
T_sn: '',//设备编号
|
|
T_sn: '',//设备编号
|
|
T_layout_no: '',//布局编号
|
|
T_layout_no: '',//布局编号
|
|
@@ -131,31 +188,21 @@ const formValues = reactive({
|
|
page: 1,
|
|
page: 1,
|
|
page_z: 10,
|
|
page_z: 10,
|
|
});
|
|
});
|
|
-const checked = ref(false)
|
|
|
|
-const checje = reactive({
|
|
|
|
- Selecteds: null,
|
|
|
|
- chkData: []
|
|
|
|
-})
|
|
|
|
-//全选
|
|
|
|
-const handleCheckedChange = (value) => {
|
|
|
|
- checked.value = value
|
|
|
|
- value ? checje.Selecteds = checje.chkData : checje.Selecteds = null
|
|
|
|
-}
|
|
|
|
-//单选
|
|
|
|
-const handleUpdateValue = (value) => {
|
|
|
|
- value.length == checje.chkData.length ? checked.value = true : checked.value = false
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
// 选择导入
|
|
// 选择导入
|
|
const showAddModalobj = () => {
|
|
const showAddModalobj = () => {
|
|
|
|
+ formValues.page = 1
|
|
modal.showModalobj = true;
|
|
modal.showModalobj = true;
|
|
GetficateListApi()
|
|
GetficateListApi()
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+//列表Api
|
|
const GetficateListApi = () => {
|
|
const GetficateListApi = () => {
|
|
getCertificateList(formValues).then(res => {
|
|
getCertificateList(formValues).then(res => {
|
|
let { data: resIt } = res
|
|
let { data: resIt } = res
|
|
if (resIt.Code == 200) {
|
|
if (resIt.Code == 200) {
|
|
- checje.chkData = resIt.Data.List
|
|
|
|
|
|
+ resIt.Data.List!=null?checje.chkData = resIt.Data.List:checje.chkData = []
|
|
|
|
+ pageData.pageCount = resIt.Data.Page_size
|
|
|
|
+ pageData.pageNum = resIt.Data.Num
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|