Browse Source

Merge remote-tracking branch 'origin/master'

周壕 1 year ago
parent
commit
6f7c2e8538

+ 2 - 0
.idea/smartsearch2.iml

@@ -91,6 +91,8 @@
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.3" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.3" level="project" />
     <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.29" level="project" />
+    <orderEntry type="library" name="Maven: org.postgresql:postgresql:42.3.6" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.checkerframework:checker-qual:3.5.0" level="project" />
     <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.11" level="project" />
     <orderEntry type="library" name="Maven: com.alibaba:druid:1.2.11" level="project" />
     <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />

+ 3 - 3
find.xml

@@ -1,8 +1,8 @@
 <application>
   <component name="FindSettings">
-    <option name="customScope" value="Project 'untitled1'" />
-    <option name="defaultScopeName" value="Project 'untitled1'" />
-    <option name="SEARCH_SCOPE" value="Project 'untitled1'" />
+    <option name="customScope" value="All Places" />
+    <option name="defaultScopeName" value="All Places" />
+    <option name="SEARCH_SCOPE" value="All Places" />
     <mask>*.css</mask>
     <mask>*.html</mask>
     <mask>*.xml</mask>

+ 5 - 0
ide.general.xml

@@ -0,0 +1,5 @@
+<application>
+  <component name="GeneralSettings">
+    <option name="showTipsOnStartup" value="false" />
+  </component>
+</application>

+ 3 - 3
target/classes/application.yml

@@ -25,11 +25,11 @@ spring:
       driver-class-name: com.mysql.jdbc.Driver
     postgre:
       # 数据源基本配置
-      username: root
+      username: postgres
       password: bowin123
-      url: jdbc:mysql://office.bowintek.com:3306/practicedb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
+      url: jdbc:postgresql://office.bowintek.com:5432/postgres
       # driver-class需要注意mysql驱动的版本(com.mysql.cj.jdbc.Driver 或 com.mysql.jdbc.Driver)
-      driver-class-name: com.mysql.jdbc.Driver
+      driver-class-name: org.postgresql.Driver
     druid:
       #监控统计拦截的filters
       filters: stat

+ 109 - 0
vue/src/components/basic/transfer/Transfer.vue

@@ -0,0 +1,109 @@
+<template>
+  <templat v-for="it in selectData">
+    <a-tag closable @close="removeItem(it)">{{ it.title }}</a-tag>
+  </templat>
+  <a-button type="link" @click="visible=!visible">选择</a-button>
+  <a-modal
+    title="选择"
+    :width="600"
+    :visible="visible"
+    :ok-text="'选择'"
+    :cancel-text="'取消'"
+    @cancel="close()"
+    @ok="ok()"
+    :closable="true"
+    wrapClassName="ant-modal-cust-warp">
+    <div>
+      <a-transfer
+        :list-style="{
+          width: '250px',
+          height: '300px',
+        }"
+        :data-source="sourceData"
+        :target-keys="targetKeys"
+        :render="item => item.title"
+        @change="handleChange"
+      />
+    </div>
+  </a-modal>
+</template>
+<script lang="ts">
+import {defineComponent, ref} from "vue";
+import {getDictionaryItemList} from "@/api/system/dictionary";
+
+interface DataItem {
+  key: string;
+  title: string;
+}
+
+export default defineComponent({
+  name: 'Transfer',
+  components: {},
+  props: {
+    fieldId: String,//字段id
+    dictionaryCode: String,//字典编码
+    defaultValue: String //默认选中值,多个值用,号分割
+  },
+  emits: [
+    "ok"
+  ],
+  setup(props, {emit}) {
+    console.log(props.fieldId);
+    console.log(props.dictionaryCode);
+    const sourceData = ref<DataItem[]>([]);
+    const visible = ref(false);
+    const targetKeys = ref<string[]>([]);
+    const selectedKeys = ref<string[]>(props.defaultValue ? props.defaultValue.split(",") : []);
+    const selectData = ref<DataItem[]>([]);
+
+    const removeItem = (it: DataItem) => {
+      console.log(it);
+      selectData.value = selectData.value.filter(x => x.key != it.key);
+      targetKeys.value = selectedKeys.value = selectData.value.map(x => x.key);
+      emit('ok', selectedKeys.value, props.fieldId);
+    }
+    const getDataSource = () => {
+      getDictionaryItemList({code: props.dictionaryCode}).then((data: any[]) => {
+        sourceData.value = data.map(m => ({key: m.value.toString(), title: m.name}));
+
+        targetKeys.value = selectedKeys.value;
+        if (props.defaultValue) {
+          selectData.value = sourceData.value.filter(x => selectedKeys.value.indexOf(x.key) > -1);
+        }
+      });
+    };
+
+    const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
+      console.log(keys, direction, moveKeys);
+      targetKeys.value = keys;
+    };
+    const closing = () => {
+      visible.value = false;
+    };
+    const close = () => {
+      targetKeys.value = selectData.value.map(x => x.key);
+      closing();
+    };
+    const ok = () => {
+      closing();
+      selectedKeys.value = targetKeys.value;
+      selectData.value = sourceData.value.filter(x => targetKeys.value?.indexOf(x.key) > -1)
+      emit('ok', selectedKeys.value, props.fieldId);
+    };
+
+    return {
+      close, visible,
+      ok, getDataSource, removeItem,
+      sourceData, handleChange, selectData,
+      targetKeys,
+    };
+  },
+  created() {
+    this.getDataSource();
+  },
+  mounted() {
+
+  }
+})
+</script>
+

+ 2 - 2
vue/src/plugins/antd.ts

@@ -19,7 +19,7 @@ import {
   Switch,
   Space, Cascader,
   Tree,
-  Transfer,Image,Progress,List,Avatar,Badge,Spin,Pagination,Popover
+  Transfer,Image,Progress,List,Avatar,Badge,Spin,Pagination,Popover,Tag
 } from 'ant-design-vue';
 import type { App } from 'vue';
 //导入组件库
@@ -68,5 +68,5 @@ export function setupAntd(app: App<Element>) {
     .use(Transfer)
     .use(Cascader)
     .use(Image)
-    .use(Tree).use(Progress).use(List).use(Avatar).use(Badge).use(Spin).use(Pagination).use(Popover);
+    .use(Tree).use(Progress).use(List).use(Avatar).use(Badge).use(Spin).use(Pagination).use(Popover).use(Tag);
 }

+ 14 - 4
vue/src/views/position/index.vue

@@ -13,7 +13,8 @@
             name="practiceBaseName"
             label="单位名称"
             :label-col="{span:6}">
-            <a-input v-model:value="formState.practiceBaseName" style="width: 200px"></a-input>
+<!--            <a-input v-model:value="formState.practiceBaseName" style="width: 200px"></a-input>-->
+            <transfer @ok="transferOk" :default-value="selectKeys" :dictionary-code="'queryType'" :fieldId="'test1'"></transfer>
           </a-form-item>
         </a-col>
         <a-col :span="6">
@@ -21,7 +22,8 @@
             name="name"
             label="岗位名称"
             :label-col="{span:6}">
-            <a-input v-model:value="formState.name" style="width: 200px"></a-input>
+<!--            <a-input v-model:value="formState.name" style="width: 200px"></a-input>-->
+            <transfer @ok="transferOk" :default-value="selectKeys2" :dictionary-code="'settingType'" :fieldId="'test2'"></transfer>
           </a-form-item>
         </a-col>
         <a-col :span="6">
@@ -120,10 +122,11 @@ import type {ImportProps} from "@/components/basic/excel/importExcel/ImportProps
 import BImportExcel from "@/components/basic/excel/importExcel/importExcel.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import {getPaginationTotalTitle} from "@/utils/common";
+import Transfer from '@/components/basic/transfer/Transfer.vue'
 
 export default defineComponent({
   name: 'positionlist',
-  components: {DownOutlined, UpOutlined,BImportExcel,BExportExcel},
+  components: {DownOutlined, UpOutlined,BImportExcel,BExportExcel,Transfer},
   setup() {
 
     const route = useRoute();
@@ -162,6 +165,13 @@ export default defineComponent({
       },
     ];
 
+    const selectKeys = ref("1,2,3,4");
+    const selectKeys2 = ref("3,4");
+    const transferOk = (keys: string, fieldId: string) => {
+      selectKeys.value = keys;
+      console.log(selectKeys.value, fieldId);
+    }
+
     const importOptions = ref<ImportProps>({
       title: "导入",
       url: 'position/importData',
@@ -246,7 +256,7 @@ export default defineComponent({
     return {
       router,
       route,
-      expand,
+      expand,transferOk,selectKeys,selectKeys2,
       formRef,
       formState,
       columns,data,loading,selectedRowKeys,

+ 50 - 41
vue/src/views/query/table.vue

@@ -8,7 +8,7 @@
       @finish="onFinish"
     >
       <a-row :gutter="24">
-        <a-col :span="9">
+        <a-col :span="6">
           <a-form-item
             name="tempName"
             label="模板名称"
@@ -16,7 +16,7 @@
             <a-input v-model:value="formState.tempName" style="width: 200px"></a-input>
           </a-form-item>
         </a-col>
-        <a-col :span="9">
+        <a-col :span="6">
           <a-form-item
             name="tempNo"
             label="模板编号"
@@ -24,6 +24,14 @@
             <a-input v-model:value="formState.tempNo" style="width: 200px"></a-input>
           </a-form-item>
         </a-col>
+        <a-col :span="6">
+          <a-form-item
+            name="tempNo"
+            label="创建日期"
+            :label-col="{span:6}">
+
+          </a-form-item>
+        </a-col>
         <a-col :span="6" style="text-align: left">
           <a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
           <a-button style="margin: 0 8px" @click="() => {formRef.resetFields();loadData()}">重置</a-button>
@@ -37,7 +45,7 @@
           </a-radio-group>
           <a-button type="primary" html-type="button" @click="add">
             <template #icon>
-              <PlusOutlined  />
+              <PlusOutlined/>
             </template>
             添加搜索模板
           </a-button>
@@ -52,46 +60,47 @@
     <div class="search-result-list" v-if="viewModel=='card'">
       <a-spin :spinning="loading">
         <a-row :gutter="[24,8]">
-        <a-col :span="6" v-for="item in data">
-          <a-card :title="item.tempName" >
-            <template #extra>
-              <a-button type="link" @click="edit(item.tempId)">查看详情</a-button>
-            </template>
-            <template class="ant-card-actions" #actions>
-              <FormOutlined  key="edit" @click="edit(item.tempId)"/>
-              <a-popconfirm placement="leftTop"
-                            title="是否删除数据?"
-                            @confirm="deleteSingle(item.tempId)">
-                <DeleteOutlined  key="ellipsis"/>
-              </a-popconfirm>
-            </template>
-            <a-popover title="详细信息" :visible="item.visible">
-              <template #content>
-                <p>维度:{{ item.dimensionName }}</p>
-                <p>度量:{{ item.measurName }}</p>
+          <a-col :span="6" v-for="item in data">
+            <a-card :title="item.tempName">
+              <template #extra>
+                <a-button type="link" @click="edit(item.tempId)">查看详情</a-button>
               </template>
-            </a-popover>
-            <a-row :gutter="[24,4]" @mouseover="item.visible=true"  @mouseout="item.visible=false">
-              <a-col :span="10" class="col-text">维度:</a-col>
-              <a-col :span="12" class="col-content" >{{ item.dimensionName }}</a-col>
-              <a-col :span="10" class="col-text">度量:</a-col>
-              <a-col :span="12" class="col-content" >{{ item.measurName }}</a-col>
-              <a-col :span="10" class="col-text">创建人:</a-col>
-              <a-col :span="12">{{ item.createdName }}</a-col>
-              <a-col :span="10" class="col-text">创建/更新日期:</a-col>
-              <a-col :span="12">{{ dayjs(item.createTime ?? item.modifyTime).format('YYYY-MM-DD') }}</a-col>
-              <a-col :span="10" class="col-text">备注:</a-col>
-              <a-col :span="12" class="col-content">{{ item.remark }}</a-col>
-            </a-row>
-          </a-card>
-        </a-col>
-      </a-row>
+              <template class="ant-card-actions" #actions>
+                <FormOutlined key="edit" @click="edit(item.tempId)"/>
+                <a-popconfirm placement="leftTop"
+                              title="是否删除数据?"
+                              @confirm="deleteSingle(item.tempId)">
+                  <DeleteOutlined key="ellipsis"/>
+                </a-popconfirm>
+              </template>
+              <a-popover title="详细信息" :visible="item.visible">
+                <template #content>
+                  <p>维度:{{ item.dimensionName }}</p>
+                  <p>度量:{{ item.measurName }}</p>
+                </template>
+              </a-popover>
+              <a-row :gutter="[24,4]" @mouseover="item.visible=true" @mouseout="item.visible=false">
+                <a-col :span="10" class="col-text">维度:</a-col>
+                <a-col :span="12" class="col-content">{{ item.dimensionName }}</a-col>
+                <a-col :span="10" class="col-text">度量:</a-col>
+                <a-col :span="12" class="col-content">{{ item.measurName }}</a-col>
+                <a-col :span="10" class="col-text">创建人:</a-col>
+                <a-col :span="12">{{ item.createdName }}</a-col>
+                <a-col :span="10" class="col-text">创建/更新日期:</a-col>
+                <a-col :span="12">{{ dayjs(item.createTime ?? item.modifyTime).format('YYYY-MM-DD') }}</a-col>
+                <a-col :span="10" class="col-text">备注:</a-col>
+                <a-col :span="12" class="col-content">{{ item.remark }}</a-col>
+              </a-row>
+            </a-card>
+          </a-col>
+        </a-row>
       </a-spin>
     </div>
     <div class="search-result-list" v-else="viewModel=='list'">
       <a-table :columns="columns" :data-source="data" :scroll="{ x:'100%', y: 500 }"
                :loading="loading"
-               :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :row-key="record=>record.tempId"
+               :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+               :row-key="record=>record.tempId"
                bordered>
         <template #bodyCell="{ column,record }">
           <template v-if="column.key === 'operation'">
@@ -100,7 +109,8 @@
         </template>
       </a-table>
     </div>
-    <a-pagination :page-size-options="['5', '20', '30', '40', '50']" show-size-changer v-model:current="pagination.current" :total="pagination.total" style="float: right;margin-top: 10px;"
+    <a-pagination :page-size-options="['5', '20', '30', '40', '50']" show-size-changer
+                  v-model:current="pagination.current" :total="pagination.total" style="float: right;margin-top: 10px;"
                   :pageSize="pagination.pageSize" :show-total="total => `共 ${total} 条`"
                   @change="(current)=>handleTableChange({ current: current,pageSize: pagination.pageSize })"
                   @showSizeChange="(current,pageSize)=>handleTableChange({ current: current,pageSize: pageSize })"/>
@@ -122,7 +132,6 @@ export default defineComponent({
   name: 'tempList',
   components: {},
   setup() {
-
     const route = useRoute();
     const router = useRouter();
     const expand = ref(false);
@@ -195,7 +204,7 @@ export default defineComponent({
         loadData();
       })
     };
-    const deleteSingle=(id:string)=>{
+    const deleteSingle = (id: string) => {
       postdel('temp/deletes', [id]).then(() => {
         loadData();
       })
@@ -221,7 +230,7 @@ export default defineComponent({
       onSelectChange,
       onFinish,
       loadData,
-      add,deleteSingle,
+      add, deleteSingle,
       edit, onDelete
     };
   },