From 1828cfc3c596ee2142a9e76582fa02ee9631a23d Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期三, 15 一月 2025 17:55:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal.vue               |   65 ++++++
 src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal__Style#Drawer.vue |   92 +++++++++
 src/views/dnc/base/NcDeviceCharactersList.vue                                           |  219 +++++++++++++++++++++
 src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersForm.vue                |  197 +++++++++++++++++++
 4 files changed, 573 insertions(+), 0 deletions(-)

diff --git a/src/views/dnc/base/NcDeviceCharactersList.vue b/src/views/dnc/base/NcDeviceCharactersList.vue
new file mode 100644
index 0000000..9cb34fd
--- /dev/null
+++ b/src/views/dnc/base/NcDeviceCharactersList.vue
@@ -0,0 +1,219 @@
+<!--
+ Description: 璁惧鐗规畩瀛楃绠$悊椤甸潰 List
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <a-card :bordered="false">
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="璁惧缂栧彿">
+              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.deviceNo"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="鐗规畩瀛楃">
+              <a-input placeholder="璇疯緭鍏ョ壒娈婂瓧绗�" v-model="queryParam.characters"></a-input>
+            </a-form-item>
+          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="閮ㄩ棬鍒嗙粍">
+                <j-dict-select-tag v-model="queryParam.departId" placeholder="璇烽�夋嫨閮ㄩ棬鍒嗙粍" dictCode="sys_department,depart_name,depart_id"/>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="鏁版帶绯荤粺">
+                <a-input placeholder="璇疯緭鍏ユ暟鎺х郴缁�" v-model="queryParam.controlSystem"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="10" :lg="11" :md="12" :sm="24">
+              <a-form-item label="鎿嶄綔鏃堕棿">
+                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust" v-model="queryParam.startTime"></j-date>
+                <span class="query-group-split-cust"></span>
+                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust" v-model="queryParam.endTime"></j-date>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">{{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}<a-icon :type="toggleSearchStatus ? 'up' : 'down'" /></a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 鏌ヨ鍖哄煙-END -->
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span>
+          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            涓嬭浇
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">缂栬緫</a>
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">鏇村
+              <a-icon type="down" />
+            </a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">璇︽儏</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="纭畾鍒犻櫎鍚�?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a>鍒犻櫎</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+
+
+    <NcDeviceCharactersModal ref="modalForm" @ok="modalFormOk"></NcDeviceCharactersModal>
+
+  </a-card>
+</template>
+
+<script>
+
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
+import NcDeviceCharactersModal from './modules/NcDeviceCharacters/NcDeviceCharactersModal__Style#Drawer.vue'
+
+export default {
+  name: 'NcDeviceCharactersList',
+  mixins:[JeecgListMixin, mixinDevice],
+  components: {
+    JDictSelectTag,
+    NcDeviceCharactersModal
+  },
+  data () {
+    return {
+      description: '璁惧鐗规畩瀛楃绠$悊椤甸潰',
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key:'rowIndex',
+          width:200,
+          align:"center",
+          customRender:function (t,r,index) {
+            return parseInt(index)+1;
+          }
+        },
+        {
+          title: '璁惧缂栧彿',
+          align: "center",
+          dataIndex: 'deviceNo',
+          width: 200,
+        },
+        {
+          title: '鎵�灞為儴闂�',
+          align: "center",
+          dataIndex: 'departId_dictText',
+          width: 220,
+        },
+        {
+          title: '鏁版帶绯荤粺',
+          align: "center",
+          dataIndex: 'controlSystem',
+          width: 250,
+        },
+        {
+          title: '鐗规畩瀛楃',
+          align: "center",
+          dataIndex: 'characters',
+          width:250
+        },
+        {
+          title: '鎿嶄綔鏃堕棿',
+          align: "center",
+          dataIndex: 'createTime',
+          width:300
+        },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: 'center',
+          width: 200,
+          fixed: 'right'
+        }
+      ],
+      url: {
+        list: "/nc/device/characters/find/page",
+        delete: "/nc/device/characters/delete",
+        deleteBatch: "/mdc/mdcDriveTypeParamConfig/deleteBatch",
+        exportXlsUrl: "/mdc/mdcDriveTypeParamConfig/exportXls",
+        importExcelUrl: "mdc/mdcDriveTypeParamConfig/importExcel",
+      },
+      dictOptions:{},
+    }
+  },
+  created() {
+  },
+  computed: {
+    importExcelUrl: function(){
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    initDictConfig(){
+    }
+  }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>
\ No newline at end of file
diff --git a/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersForm.vue b/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersForm.vue
new file mode 100644
index 0000000..5b707e6
--- /dev/null
+++ b/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersForm.vue
@@ -0,0 +1,197 @@
+<!--
+ Description: 璁惧鐗规畩瀛楃绠$悊椤甸潰 Form
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form :form="form" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="['deviceNo', validatorRules.deviceNo]" placeholder="璇疯緭鍏ヨ澶囩紪鍙�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鎵�灞為儴闂�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <j-dict-select-tag type="list" v-decorator="['departId']" :trigger-change="true" dictCode="sys_department,depart_name,depart_id" placeholder="璇烽�夋嫨鎵�灞為儴闂�"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鏁版帶绯荤粺" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="['controlSystem', validatorRules.controlSystem]" placeholder="璇疯緭鍏ユ暟鎺х郴缁�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鐗规畩瀛楃" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input v-decorator="['characters', validatorRules.characters]" placeholder="璇疯緭鍏ョ壒娈婂瓧绗�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
+            <a-button @click="submitForm">鎻� 浜�</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import pick from 'lodash.pick'
+  import JFormContainer from '@/components/jeecg/JFormContainer'
+  import JDictSelectTag from "@/components/dict/JDictSelectTag"
+
+  export default {
+    name: 'NcDeviceCharactersForm',
+    components: {
+      JFormContainer,
+      JDictSelectTag,
+    },
+    props: {
+      //娴佺▼琛ㄥ崟data
+      formData: {
+        type: Object,
+        default: ()=>{},
+        required: false
+      },
+      //琛ㄥ崟妯″紡锛歵rue娴佺▼琛ㄥ崟 false鏅�氳〃鍗�
+      formBpm: {
+        type: Boolean,
+        default: false,
+        required: false
+      },
+      //琛ㄥ崟绂佺敤
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        form: this.$form.createForm(this),
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+          deviceNo: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ヨ澶囩紪鍙�!'},
+            ]
+          },
+          departId: {
+            rules: [
+              { required: true, message: '璇烽�夋嫨閮ㄩ棬鍒嗙粍!'},
+            ]
+          },
+          controlSystem: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ユ暟鎺х郴缁�!'},
+            ]
+          },
+          characters: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'},
+            ]
+          },
+        },
+        url: {
+          add: "/nc/device/characters/add",
+          edit: "/nc/device/characters/edit",
+          // queryById: "/zhshj/wglltwh/query/by/id"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        if(this.formBpm===true){
+          if(this.formData.disabled===false){
+            return false
+          }
+          return true
+        }
+        return this.disabled
+      },
+      showFlowSubmitButton(){
+        if(this.formBpm===true){
+          if(this.formData.disabled===false){
+            return true
+          }
+        }
+        return false
+      }
+    },
+    created () {
+      //濡傛灉鏄祦绋嬩腑琛ㄥ崟锛屽垯闇�瑕佸姞杞芥祦绋嬭〃鍗昫ata
+      this.showFlowData();
+    },
+    methods: {
+      add () {
+        this.edit({});
+      },
+      edit (record) {
+        this.form.resetFields();
+        this.model = Object.assign({}, record);
+        this.visible = true;
+        this.$nextTick(() => {
+          this.form.setFieldsValue(pick(this.model,'deviceNo','departId','controlSystem','characters'))
+        })
+      },
+      //娓叉煋娴佺▼琛ㄥ崟鏁版嵁
+      showFlowData(){
+        if(this.formBpm === true){
+          let params = {id:this.formData.dataId};
+          getAction(this.url.queryById,params).then((res)=>{
+            if(res.success){
+              this.edit (res.result);
+            }
+          });
+        }
+      },
+      submitForm () {
+        const that = this;
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            let formData = Object.assign(this.model, values);
+            console.log("琛ㄥ崟鎻愪氦鏁版嵁",formData)
+            httpAction(httpurl,formData,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+      popupCallback(row){
+        this.form.setFieldsValue(pick(row,'deviceNo','departId','controlSystem','characters'))
+      },
+    }
+  }
+</script>
\ No newline at end of file
diff --git a/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal.vue b/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal.vue
new file mode 100644
index 0000000..f72335b
--- /dev/null
+++ b/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal.vue
@@ -0,0 +1,65 @@
+<!--
+ Description: 璁惧鐗规畩瀛楃绠$悊椤甸潰 Modal
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴">
+    <NcDeviceCharactersForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></NcDeviceCharactersForm>
+  </j-modal>
+</template>
+
+<script>
+
+  import NcDeviceCharactersForm from './NcDeviceCharactersForm.vue'
+  export default {
+    name: 'NcDeviceCharactersModal',
+    components: {
+      NcDeviceCharactersForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
\ No newline at end of file
diff --git "a/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal__Style\043Drawer.vue" "b/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal__Style\043Drawer.vue"
new file mode 100644
index 0000000..8145565
--- /dev/null
+++ "b/src/views/dnc/base/modules/NcDeviceCharacters/NcDeviceCharactersModal__Style\043Drawer.vue"
@@ -0,0 +1,92 @@
+<!--
+ Description: 璁惧鐗规畩瀛楃绠$悊椤甸潰 Modal-Drawer
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <NcDeviceCharactersForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></NcDeviceCharactersForm>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">鍏抽棴</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">鎻愪氦</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+
+import MdcEquipmentTypeForm from '@views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeForm.vue'
+import NcDeviceCharactersForm from './NcDeviceCharactersForm.vue'
+
+export default {
+  name: 'NcDeviceCharactersModal',
+  components: {
+    MdcEquipmentTypeForm,
+    NcDeviceCharactersForm
+  },
+  data() {
+    return {
+      title: "鎿嶄綔",
+      width: 800,
+      visible: false,
+      disableSubmit: false
+    }
+  },
+  methods: {
+    add() {
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.add();
+      })
+    },
+    edit(record) {
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record);
+      });
+    },
+    close() {
+      this.$emit('close');
+      this.visible = false;
+    },
+    submitCallback() {
+      this.$emit('ok');
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm();
+    },
+    handleCancel() {
+      this.close()
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+/** Button鎸夐挳闂磋窛 */
+.ant-btn {
+  margin-left: 30px;
+  margin-bottom: 30px;
+  float: right;
+}
+.drawer-footer{
+  position: absolute;
+  bottom: -8px;
+  width: 100%;
+  border-top: 1px solid #e8e8e8;
+  padding: 10px 16px;
+  text-align: right;
+  left: 0;
+  background: #fff;
+  border-radius: 0 0 2px 2px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3